This article is to share the knowledge about IPv6 (Internet Protocol version 6) in a simple way.
The first important knowledge you will needed to know before understanding IPv6 is that it is a 128-bit address that is represented using Hexadecimal values and it will be beneficial to know the binary and decimal equivalent.
Please see below the table showing this information:
| Hex | Binary | Decimal |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 2 |
| 3 | 0011 | 3 |
| 4 | 0100 | 4 |
| 5 | 0101 | 5 |
| 6 | 0110 | 6 |
| 7 | 0111 | 7 |
| 8 | 1000 | 8 |
| 9 | 1001 | 9 |
| A | 1010 | 10 |
| B | 1011 | 11 |
| C | 1100 | 12 |
| D | 1101 | 13 |
| E | 1110 | 14 |
| F | 1111 | 15 |
The next aspect of IPv6 Addressing to understand is that it is similar to IPv4 address where the address is split up into Octet (10.10.10.1) separated by a dot (.), IPv6 address are split up into quartet (2000:ABCD:0000:0000:0000:0000:0000:0001) separated by a colon (:). Each quartet is made up of 4 Hexadecimal number.
An example of an IPv6 address is below along with the binary of the address:
| Quartet | Hexadecimal | Binary |
|---|---|---|
| 1st | 2000 | 0010 0000 0000 0000 |
| 2nd | ABCD | 1010 1011 1100 1101 |
| 3rd | 0000 | 0000 0000 0000 0000 |
| 4th | 0000 | 0000 0000 0000 0000 |
| 5th | 0000 | 0000 0000 0000 0000 |
| 6th | 0000 | 0000 0000 0000 0000 |
| 7th | 0000 | 0000 0000 0000 0000 |
| 8th | 0001 | 0000 0000 0000 0001 |
Shortening the IPv6 Address
there are two methods we can use to shorten the IPv6 address to make it easier to write which is also applied by supported devices.
- Eliminating the leading zeros
- Using the double colon (::) to represents multiple quartet of zeros. this can only be applied once in an IPv6 address.
let me use an example IPv6 address 2000:ABC0:00ED:0000:0000:1234:0000:0001
Applying shortening rule 1 to eliminating the leading zeros which will be:
| 2000 : ABC0 : |
| 2000 : ABC0 : ED : 0 : 0 : 1234 : 0 : 1 |
Then we are going to apply rule 2 which is to use the double colon (::) to replace multiple quartet of zeros:
| 2000 : ABC0 : 0 : 0 : 1234 : 0 : 1 |
| 2000 : ABC0 :: 1234 : 0 : 1 |
IPv6 Prefix
The IPv6 address has two main parts to the address:
- Prefix (Network ID)
- Interface ID (Host ID)
The IPv6 Prefix is denoted by the CIDR /XX. For example 2000::/3 where /3 tells you the network portion of the IPv6 address space.
There are also subdivision of the Prefix:
- Registry Prefix – assigned by IANA to an RIR
- ISP Prefix – assigned by an RIR to an ISP
- Site Prefix (Global Routing Prefix) – assigned by an ISP to customer
- Subnet Prefix – assigned by a customer engineer internally
RIR – Regional Internet Registry
IANA – Internet Assigned Numbers Authority
IPv6 Address Types
The unspecified address is an address used by an IPv6 node that has not gotten an IPv6 address.
The Global address is the address space reserved to be routed on the internet which is assigned by the IANA.
The Multicast address is joined by IPv6 nodes depending on the class the device is apart of which will be discussed later.
The Link-local is the address automatically assigned by the IPv6 node using the EUI-64 method once the IPv6 is enabled on an interface.
| Types of Address | Binary Reality | IPv6 method |
|---|---|---|
| Unspecified | 0000…0 | ::/128 |
| Loopback | 0000…1 | ::1/128 |
| Global | 001… (first 3) | 2000::/3 (2000 – 3FFF) |
| Multicast | 1111 1111 (first 8) | FF00::/8 |
| Link-local | 1111 1110 10… (first 10) | FE80::/10 |
There is another special type of address which is the Extended Unique Identifier (EUI-64) that uses the MAC address (48-bit) as part of the IPv6 Address. The challenge with the MAC address is that it is short 16-bit so to make it 64-bit, FFFE will be place in the middle of the MAC address. Another modification that is required to derive the EUI-64 address is that the 7th bit must be flipped. To better understand this address, let me list the rules in a table:
| Steps | Rule | Address |
|---|---|---|
| 1 | Get the Mac Address | AAAA.BBBB.CCCC |
| 2 | Insert FFFE in the middle of the MAC | AAAABB FFFE BBCCCC |
| 3 | Flip the 7th bit by converting the first 2 Hex to binary, flipping the 7th bit and then converting it back to Hexidecimal | AA = 1010 1010
1010 1000 = A8 A8AA:BB FF:FE BB:CCCC |
| 4 | Apply the network prefix. in the example using link-local FE80::/8 | FE80:0000:0000:0000:A8AA:BBFF:FEBB:CCCC /64 |
| 5 | Shorten the IPv6 Address | FE80::A8AA:BBFF:FEBB:CCCC /64 |
Local Multicast Address
| IPv6 Local Multicast Address | Description |
|---|---|
| FF02::1 | All-node |
| FF02::2 | all-routers |
| FF02::5 | all-OSPF routers |
| FF02::6 | OSPF designated routers |
| FF02::9 | All RIP |
| FF02::A | All-EIGRP |
| FF02::1:FFxx:xxxx | solicited-node where x is the last 6 Hex of the IPv6 unicast address |
IPv6 Node Layer 2 Communication
When a IPv6 node needs to communicate at the Layer 2 after receiving a multicast packet, the IPv6 node uses the following Layer 2 (MAC) address format:
3333 : xxxx : xxx1
where X is the last 8 Hex of the MAC address but the 8th Hex is change to 1 as shown above.
For the solicited address after the 3333, we will insert FF and then add the last 6 Hex as shown below:
3333 : FFxx : xxxx
IPv6 Address Dynamic Assignment
Stateless Address Auto Configuration (SLAAC)
- The IPv6 address is derived using the Network prefix and adding the MAC address to it (EUI-64)
- It used the Stateless DHCP
- The prefix must be /64
- There should be no DHCP IP pool configured on router
Stateful DHCP
- The IPv6 address is dynamically assigned to the host by the DHCP server along with DNS and gateway.
Domain Name System (DNS) – RF6106
IPv6 Neighbor Discovery Protocol (NDP)
Network Discovery Protocol is defined in the RF 4861.
NDP Message Types
- Router Solicitation (ICMPv6 type 133)
- Asking router for information
- Router Advertisement (ICMPv6 type 134)
- Router responding with information
- Neighbor Solicitation (ICMPv6 type 135)
- Asking the neighbor for information
- Neighbor Advertisement (ICMPv6 type 136)
- Neighbor responding with information
- Redirect (ICMPv6 type 137)
- redirect of a packet
Function of NDP
- Duplicate Address Detection (DAD)
- Router Discovery
- Address Configuration
- L2 (link-level) Resolution
- Redirection of a Packet