Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 917507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:13:24+00:00 2026-05-15T18:13:24+00:00

How does the zone index relate to the scope_id in the sockaddr_in6 structure? The

  • 0

How does the zone index relate to the scope_id in the sockaddr_in6 structure?

The functionality appears to differ between platforms and I’d love to know how they relate. Windows for example has a SCOPE_ID structure (as well as just a 32-bit value). Mac OSX only has a 32-bit value. Obviously the 32-bit value is the way to go but how exactly is it laid out? Is it still the top 4 bits are the “level”? How does network byte order affect this?

Also I assume that, under windows, the zone index given in the ip address (eg FF80::1%1) translates directly to the bottom 28 bits of the aforementioned structure. How does it work under Mac OSX that uses names rather than numbers (eg FF80::1%en0). Do I encode it as a four CC? Equally I seem to recall that linux uses 4 characters which couldn’t possibly fit in 28-bits.

So can someone explain this mess to me? I really am going to need to write a tutorial on all this when I’m finished because there is precious little info about ipv6 around the net.

Edit: Is the scope_id in network byte order? I’m just looking at the scope_id returned from a recvfrom and it appears to be in little-endian order … that can’t be right can it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:13:24+00:00Added an answer on May 15, 2026 at 6:13 pm

    The index of zone and scope are the same and frequently interchanged, however the terms themselves are different.

    Scope is used as in “global scope”, “local scope”, “universal scope” and refer to how unique a particular IPv6 address is. Every interface has a local scope which is unique to the immediate LAN segment, which is say useful for automatic configuration and discovery of local devices, say a printer you just plugged into the network. Global scope IPv6 address may be provided by a DHCP server.

    Zone is to specify a particular effective interface within the local scope.

    The scope index is different from interface index such that to specify an interface I use a structure as follows:

    struct interface_req_t {
            uint32_t                                ir_interface;
            uint32_t                                ir_scope_id;
    };
    

    Each platform is unique into how it interprets the value, with Windows having several re-interpretations of interface enumeration depending on domain. The downside with the Windows implementation is that the index can change when you hot swap adapters. On Unix you tend to see interface names %qe0, %eth0, etc, that can be resolved to numeric form when required, e.g. if_nametoindex(). Windows Vista adds a compatible API.

    Only the local scope is identifiable by it’s address prefix fe80::/10.

    The Windows SCOPE_ID shows over design that also exists in IPv4 multicast, i.e. splitting administration domains of addresses. It’s all purely optional and frequently ignored.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know if there is a function to obtain the server's time zone
Does anyone know of a compiled list of translations for the time zone names
Does anyone know how i can use BST for config.time_zone in my rails config/environment.rb
Does anybody know any good resources for learning how to program CIL with in-depth
Does anyone know how to get IntelliSense to work reliably when working in C/C++
Does anyone use have a good regex library that they like to use? Most
Does anyone know how to transform a enum value to a human readable value?
So my app is now firing malloc: purgeable zone does not support guard pages
Android provides a permission called SET_TIME_ZONE with OS permission level dangerous. Does anyone know
In a DNS zone file, for the type 'A', what is the difference between

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.