Notes:IPv6
Contents
Important things
- 128 bits long =16 bytes.[1]
- Left-most bytes are "high order" rightmost are low order[2] - as expected.
String representation
IPv6 addresses are represented by 8 blocks of 2 bytes = 8 blocks of 4 hex digits[2], separated by colons (:)[2], subject to the following rules:
- Leading 0s can be left out. There must be at least 1 digit in every field except for a special case[2]
- :: may occur 0 or 1 time in an address. It means "the missing blocks (where this symbol is) consist of all 0s"[2] so:
- 1234::5678 consists of 1234 then 6 blocks of 0000 then 5678
- The last 2 blocks / 4 bytes of data may be specified in w.x.y.z form, where w,x,y and [ilmath]z[/ilmath] are numbers in the range 0 to 255 inclusive. This is an IPv4 address format.
- ::1.2.3.4 is 6 blocks of 0000 followed by 102, followed by 304
Address prefixes
- Format: ipv6-address "/" prefix-length[2] where:
- ipv6-address is a valid address in any of the above notations and
- the prefix-length field is a decimal number of the number of leftmost bits that comprise the prefix.
Example
the node address 2001:0DB8:0:CD30:123:4567:89AB:CDEF and its subnet number 2001:0DB8:0:CD30::/60 can be abbreviated as 2001:0DB8:0:CD30:123:4567:89AB:CDEF/60 |
Straight from[2] notice that 60 bits are ignored. 2001:0DB8:0:CD30 is 64 bits, so 4 bits (half of the 0 in CD30) are NOT a part of the subnet identification. |
---|
Note in the example you cannot turn 2001:0DB8:0:CD30::/60 into 2001:0DB8:0:CD3::/60 as a block called "CD3" represents 0CD3 - which is not what we want here.
If the bits of the prefix is divisible exactly by 16, it's nice amount of blocks, otherwise we'll need one more block which will contain up to 15 extra bits of information.
- Question: is there a standard form? Should the "extra" bits be 0? For example FFFF::/8 is the same as FF00::/8, does it matter? If we have F000::/7 that's the same as E000::/7 right? Letters can be deceptive.
Special addresses
Special address ranges
Range | Name | Binary prefix | Comment |
---|---|---|---|
::/128[2] | unspecified | 00...0 | A part of the subset :: (128 bits - all 0) |
::1/128[2] | loopback | 00...01 | Localhost. this is apart of the subnet ::1 - 128 bit subnet |
FF00::/8 | Multicast | 1111 1111 | High order byte is all 1s. |
FE80::/10 | Link-local unicast | 1111 1110 10 | We only require the hi 2 bits of the 2nd 16 bits of FE80[Note 1] |
(remainder) | Global unicast |
Deprecated ranges
Range | Name | Binary prefix | Comment |
---|---|---|---|
::/96[2] | IPv4-Compatible IPv6 addresses | 00...0 | Deprecated now[2]. |
FEC0::/10[2] | site-local unicast | 1111 1110 11 | Deprecated[2] - treat as global unicast |
Embedding IPv4 in IPv6 space
There are 2 types of IPv6 address designed to carry an IPv4 address. They both carry the IPv4 address in their lower bits[2]. The types are:
IPv4-Compatible IPv6 address
These are all 0s except for the last 32 bits, which are the bits of the IPv4 address. That is ::w.x.y.z for an IPv4 address: w.x.y.z[2].
- Deprecated - new implementations need not support this[2].
- Was deprecated due to lack of usage.
IPv4-Mapped IPv6 address
This represents IPv4 nodes as IPv6 addresses. The format is ::FFFF:w.x.y.z for an IPv4 w.x.y.z[2]
Notes
- ↑ That means if we have the hex string XY it doesn't matter what X is (as long as the upper two bits are 10) and Y can take any value.