IPv6 hex value range from prefix

WastedHatWastedHat Member Posts: 132 ■■■□□□□□□□
Hi, I've been going back over the IPv6 section of the offical cert guide and theres a few details that keep throwing me off regarding prefixes and the hex values. Heres some examples from the book..

"Just to be completely exact, IANA actually reserves prefix FC00::/7, and not FD00::/8, for these addresses. FC00::/7 includes all addresses that begin with hex FC and FD. However, an RFC (4193) requires the eighth bit of these addresses to be set to 1, so in practice today, the unique local addresses all begin with their first two digits as FD."

I can see how 1111 1100 = FC and changing the 8th bit to one means 1111 1101 = FD, but I dont understand how "FC00::/7 includes all addresses that begin with hex FC and FD"

A few more examples I found..

"Originally, IANA reserved all IPv6 addresses that begin with hex 2 or 3 as global unicast addresses. This address range can be written succinctly as prefix 2000::/3"

"By definition, the first 10 bits must match prefix FE80::/10, meaning that the first three hex digits will be either FE8, FE9, FEA, or FEB"


I'm not sure how to take the prefix and calculate the address range like these examples.

I'd be very grateful if anyone could explain whats going on

Comments

  • james43026james43026 Member Posts: 303 ■■□□□□□□□□
    "Just to be completely exact, IANA actually reserves prefix FC00::/7, and not FD00::/8, for these addresses. FC00::/7 includes all addresses that begin with hex FC and FD. However, an RFC (4193) requires the eighth bit of these addresses to be set to 1, so in practice today, the unique local addresses all begin with their first two digits as FD."

    This is a fairly bad interpretation of the RFC. The IPv6 Unique local prefix FC00::/7, is indeed divided into two /8 blocks.

    FC00::/8—Reserved for future usage
    FD00::/8—Locally assigned unique local addresses

    The eighth bit is there to identify if the address is local assigned or not. And currently will always be on in your network. Meaning you currently will never see the FC00::/8 prefix in a real network. Only FD00::/8.

    As for the last two examples, are you asking how they are able to derive the range of addresses covered based on the CIDR notation? Lets look at FE80::/10, the CIDR notation of /10, means that the first 10 bits are locked into place, below we will look at the binary.

    FE80::/10 = 1111 1110 1000:

    Now look at the first 10 bits, these bits cannot change, the rest of them can, meaning the nibble that represents the hex character of 8, will always start with 10, and then the next two binary digits can be either 0 or 1. Which means that the binary that the hex 8 represents, could be any of the following values in binary, 1000, 1001, 1010, 1011. Which would correspond to 8, 9, A, B in hex, for the third nibble.

    Hope this helps.
  • WastedHatWastedHat Member Posts: 132 ■■■□□□□□□□
    Hi thanks for your reply. Very nice explanation, it all makes sense now :)
Sign In or Register to comment.