FTC disclaimer: This post contains affiliate links and I will be compensated if you make a purchase after clicking on my link.
Internet Protocol version 6 (IPv6) is the network layer protocol in the TCP/IP model. Its work is to communicate and transfer data over the network.
The sole purpose of IPv6 existence is to replace IPv4 protocol before it gets exhausted. An Internet Protocol version 6 (IPv6) address identifies a network interface on the computer or network node.
It is used to locate any network device that is participating in an IPv6 computer network. The IPv6 address is used in the packet header to indicate the source and destination of each packet.
You can easily find the IPv6 address on your Windows or MAC pc by using the command “ipconfig” and “ifconfig.”
Most of the device adds support to IPv6 for better security and a more efficient connection. There would be the possibility that some of the older devices may not work as expected.
Here, we will discuss IPv6 address architecture and IPv6 address space, types, and scope.
IPv6 Addresses representation
An IPv6 address consists of 128-bits in length as opposed to 32-bits of IPv4. Also, the IPv6 addresses are written in a string of hexadecimal digits instead of the dotted-decimal format of IPv4.
In hexadecimal, 4-bits are represented as a single hexadecimal digit, 128-bits will be equal to 32 hexadecimal digits.
Also, the four hexadecimal digits combine to form a single group in IPv6 address architecture. So, the group’s total number formed is equal to 8 (32/4).
And each group is separated with a colon (:), which can be represented as below.
In another way, it can be written as x:x:x:x:x:x:x:x, where x is equal to 4 hexadecimal digits, and each hexadecimal digit is equal to 4-bits then the total of 16-bits in a single group.
Now, the 16-bits section is also called as Hextet, which count to 128-bits in the address.
1 Hextet = 4 hexadecimal digits = 16-bits (1 hexadecimal digit = 4-bits)
Here is an IPv6 address example
Omitting rule in IPv6 address
As we can see, the above address looks overwhelming. To keep the address short and readable, the shortening technique is adopted.
The shortening technique will keep the address shorter and readable.
We will discuss here two rules that will help you in the shortening of IPv6 address.
Rule 1: Omit leading zeros (0s)
The first technique is to omit leading zeros (0s) from a section if it occurs multiple times or more than once.
In other words, we have to remove zeros (0s) in a section as we move from left to right and reduce multiple zeros (0s) to single zero (0).
The only main thing we have to keep in mind is that we should not remove trailing zeros, which comes after the hexadecimal digit varies from 1 to F.
For instance, 0002 can be reduced to 2, 002F can be reduced to 2F, 0200 can be reduced to 200, and 0000 can be reduced to 0.
2001:0dc9:1fa1:000a:00b0:0000:9000:0200 (Exact IPv6 Address)
2001:dc9:1fa1:a:b0:0:9000:200 (Omitted leading zeros (0s) – Rule 1)
Rule 2: Omitting all zeros (0s) Hextets
The second shortening technique is to remove only single longest contiguous string of all- zeros (0s) hextets (containing only zeros) appearing from left to right and it can be represented as double colon (::).
Let’s break the above rule in multiple parts to understand better.
Rule 2(a): First thing, the single hextet should contain all zeros (0s)
2001:0db8:1111:000a:00b0:0000:0200 (Exact IPv6 address)
2001:0db8:1111:000a:00b0::0200 (Removing all-zeros segment and represent it with double colon (::))
Rule 2(b): Omit contiguous string of all-zeros (0s) hextets.
::a312 (Removing contiguous all-zeros segments)
Rule 2(c): Omit only a single longest contiguous string of all-zeros (0s)
2001:0000:dcba::1234 (Omitting only single largest contiguous string of all-zeros)
Rule 2(d): If more than one contiguous strings of all-zeros are of equal length, then omit only one contiguous string of all-zeros appearing first from left to right.
2001:0cab::abcd:0000:0000:1234 (omitting contiguous strings of all-zeros appearing first from left to right)
The below example will depict the following rule.
0000:0000:0000:0000:0000:0000:0000:0000 (Exact IPv6 address)
:: (Omitting all zeros hextets – Rule 2)
0000:0000:0000:0000:0000:0000:0000:0a21 (Exact IPv6 address)
::0a21 (Removing all zeros segments – Rule 2)
2001::abcd:0000:0000:1234 (Removing single longest contiguous strings of all-zeros)
2001::0db8:0000:1234:0000:0000 ( applying rule 2)
Combining Rule 1 and Rule 2:
You can combine rule 1 and rule 2, as we have discussed above, to reduce the IPv6 address further.
The following example will depict the above method.
2001:0db8:aaaa:0001:0000:0000:0000:0f00 (Exact IPv6 address)
2001:db8:aaaa:1:0:0:0:f00 (Applying Rule 1 – Omitting leading zeros)
2001:db8:aaaa:1::f00 (Applying Rule 2 – Omitting zeros segments)
2001:0ff8:0000:0000:abcd:0000:0000:ab34 (Exact IPv6 address)
2001:ff8:0:0:abcd:0:0:ab34 (Applying Rule 1 – Omitting leading zeros)
2001:ff8::abcd:0:0:ab34 (Applying Rule 2 – Omitting zeros segments)
IPv6 address space
Like IPv4, the IPv6 addresses space are also divided into two parts: Prefix and Suffix.
The prefix part is linked to the network ID, and the Suffix part is linked to the Interface ID.
Here, the only difference you will observe is that the Host part is replaced with the Interface part. It is because a Host can have multiple interfaces.
The Prefix part of the IPv6 is 64-bits and the Suffix, part of the IPv6 that carries the remaining 64-bits, is for the Interface part.
In IPv4, the Prefix that is the network portion of an address, is identified using a network mask. For instance, the network mask 255.255.255.0 refers to the leftmost 24-bits of IPv4 address and is occupied by network ID.
Additionally, the network mask in IPv4 can also be written in CIDR notation as /24, which indicates that the 24-bits are for the Prefix.
Similarly, the IPv6 address prefix can also be represented in CIDR notation. It is represented as below.
Let’s look at an example below:
2001:db8:aaaa:1111::100/64, where, /64 refer to prefix length or network portion or network ID.
So, the remaining 64-bits belongs to Interface ID or Suffix.
We will later discuss how the prefix part (the network portion) is further divided into the network.
If we look at the number of devices in a network with /64 prefix length, it has a huge capacity of around 18 quintillion devices.
IPv6 Address Types and Scope
We have already discussed how IPv6 address space is divided into two groups: A network ID and an Interface ID. Now, we will discuss how the different types of addresses are allocated within this space.
The different types of IPv6 addresses are Unicast, Multicast, and Anycast.
A Unicast address is an address that uniquely identifies a single interface by its address on the IPv6 device.
A packet sent to the Unicast address is received by a single interface that is assigned to that address. It is used for one-to-one communication.
There are five most common types of IPv6 Unicast address: Global Unicast, Unique local, Link-local, Loopback, Unspecified address.
Global Unicast Address
It is very similar to the IPv4 public address. The Global Unicast addresses are assigned by the IANA and are used for the public network.
It is also termed as aggregatable global unicast addresses. The Global Unicast Addresses are globally routable and reachable on the IPv6 Internet.
Global Unicast address has fixed the first three bits, which are set to 001. The first hexadecimal digit would be either two (2) or three (3) because it can either be 0010 or 0011.
In hexadecimal, it can be represented as 2000::/3.
The generic structure of Global Unicast Address consist of three fields:
Global Routing Prefix:
The Global Routing Prefix is the network portion of the address assigned by the Internet Service Provider (ISP) to the customer site.
It occupies 45-bits on the IPv6 address structure just after the fixed first three bits (001).
So, the combined 48-bits Global Routing prefix indicates the specific organization site. It is also known as site prefix because it is assigned to an individual site of an organization.
The network architect and administrators manage the addressing plan and routing policy for the organization site.
The Subnet ID is the separate field in the IPv6 address for building a subnetwork within a network.
It is used within an organization’s site to identify subnets within its site.
In IPv4, we used to borrow some bits from the host portion for subnetting, but here in IPv6, the subnet field is allocated separately.
In IPv6, the total of 16-bits is allocated for Subnet ID. With 16-bits subnet ID, you can build a total of 65,536 subnets within its site.
The 16-bits subnet ID provides an opportunity for a site to build a multilevel addressing hierarchy and efficient routing infrastructure.
So, if we calculate the network portion of the IPv6, then it will be as below.
Network portion or Prefix (IPv6) = 3-bits (fixed) + 45-bits (Global routing prefix) + 16-bits (Subnet ID) = 64-bits.
Interface ID represents the end device’s destination or interface, which receives the source’s packets.
The Interface ID indicates the interface on a specific subnet within the organization site. The size of the Interface ID is equal to 64-bits.
The Interface ID is somewhat equivalent to the host ID of the IPv4. The only difference between Interface ID and the host ID is that the host ID represents a single device in the network, whereas a single device can have multiple Interface ID.
The graphical representation of the Global Unicast Address is as below.
Unique Local Address
Unique Local Address is the private address not allocated by the address registry and is also not intended to be routable.
The Unique local address functionality is very similar to the global unicast address, but it is only private.
It is intended to use only for limited area or site and can be routed between a limited number of administrative domains.
Unique Local Address is meant for devices that never need access to the internet and never need to be accessible from the internet.
The Unique Local Addresses begin with FC00::/7, in which 7-bits are fixed, and it is denoted as “FC” in a hexadecimal number.
Now, the range of first Hextet will be FC00 to FDFF (1111 1100 0000 0000 to 1111 1101 1111 1111).
So, the remaining 40-bits of the Global ID are randomly generated and append with fixed 7-bits.
The Subnet ID and Interface ID are also created in the same way as the Global IPv6 address.
The graphical representation of the Unique Local address is as below:
Link-Local Unicast Address
Link-Local Address is another Unicast address whose scope is confined to a single link or single subset.
Moreover, Link-local addresses only need to be unique within a link or subset, and it does not have to be unique outside the link.
In other words, it means that the scope of the Link-Local Address is within a network segment in which the host is connected.
The router cannot use a link-local address to forward the packets, nor can it forward any packets to a link-local address.
In any network segments or network interface, where the IPv6 protocol is enabled, the link-local address must be assigned to that network.
A host can automatically retrieve the link-local address, or it can be manually configured.
The link-local address start with a prefix of FE80::/10, where the first 10-bits are fixed (1111 1110 10)
The link-local address graphical representation is as below.
What is the advantage of a link-local address?
The link-local address has so many benefits within a network. It does not require a Global Unicast address to communicate with other devices in a network.
Also, the device is capable enough to create its own IPv6 link-local address. It doesn’t require any manual configuration, nor does it require any services from the DHCP server.
Thus, it means that devices can communicate with other devices within a link or subnet on its link-local address.
The other use of the link-local address is to obtain Global Unicast address by communicating with a device such as an IPv6 router or a DHCPv6 server.
As discussed, the link-local address on Windows, Mac OS, and Linux is enabled by default. Moreover, you can view your link-local address in Windows and Mac OS by using the command “ipconfig” and “ifconfig.”
A Loopback address is a special address and is another type of Unicast address.
The loopback address is represented as 0000:0000:0000:0000:0000:0000:0000:0001 or ::1 (compressed), where all bits are equal to zeros (0) except the last bit, which is set to 1.
It is similar to the IPv4 Loopback address, which is represented as 127.0.0.0/8 in CIDR notation.
The Loopback address is assigned to a node or host. It is used to send IPv6 packets to itself, typically testing the TCP/IP stack.
Moreover, a Loopback address cannot be assigned to a physical interface. A router can never forward a packet if the destination address is the Loopback address. Also, the device will drop a packet destined to the Loopback address.
An Unspecified address is another special address that contains all the bits equal to zeros (0). It is represented with all hexadecimal digit set to zero (0) as 0000:0000:0000:0000:0000:0000:0000:0000 or ::(compressed).
An Unspecified address is used as a source address to indicate the absence of an address. It never can be assigned to a physical interface, nor can it be used as a destination address.
Moreover, a router will drop a packet if the source has an Unspecified address.
A multicast address represents a dynamic group of hosts in a network called a multicast group.
It is a technique in which a device sends a packet to multiple interfaces simultaneously. It carries one-to-many communication (multiple destinations) compared to the global unicast address, one-one communication (single destination).
Multicast addresses in IPv6 serve the same purpose as their counterpart in IPv4. The only difference is, unlike IPv4, there is no separate broadcast address in IPv6; instead, it uses multicast.
The IPv6 Multicast address starts with the prefix FF00::/8, where the first 8-bits are fixed. The next four bits represent the flag fields that indicate the nature of a specific multicast address.
After the flag field, four bits are occupied for the scope field, which indicates the range of the IPv6 networks where the multicast packet is intended.
The remaining 112-bits in IPv6 address is for a multicast group.
An Anycast address is an address that can be assigned to more than one interface. In other words, multiple interfaces can have the same Anycast address.
When a data packet is sent to an Anycast address, then it gets routed to the “nearest” interface having the same address. It is also known as a one-to-nearest address. Anycast addresses are used for load-balancing.
Furthermore, there is no special prefix for the Anycast address. Also, the Anycast address uses the same address range of Global Unicast address.
IPv6 Interface Identifier
The interface identifier is the second part of the IPv6 address used to identify the host network interface. The interface part consists of 64-bit and is already part of Unicast and Anycast address.
The 64-bit interface ID is prepared using the MAC address of the network card. Most of the devices in a network are still using the 48-bits MAC address.
So, to create a 64-bits Interface ID, we need to convert 48-bits MAC addresses to IPv6 Modified EUI-64 Identifiers.
There are specific rules and processes we need to follow during conversion.
The first 24-bits of the MAC address, known as OUI (Organizationally Unique Identifier), assigned by IEEE, is separated and placed to the left-most 24-bits of the Interface ID.
We will take the remaining 24-bits MAC address and place it on the Interface ID’s rightmost part.
The remaining 16-bits left in the middle of the Interface ID is placed with a value “FFFE” (11111111 11111110). This address is known as EUI-64 (Extended Unique Identifier 64).
The next process involved is changing the 7-bits (from the left) from a zero to a one. This will give us a new address, which is known as the Modified EUI-64 Interface ID.
Demonstration with example
Let’s demonstrate the above rule with an example.
Now, let’s assume the MAC address to be 39-A7-94-07-CB-D0.
- As discussed, we will separate the first 24 bits of the MAC address 39-A7-94 and put it on the leftmost part of Interface ID (39A7 94).
- The MAC address’s remaining 24-bit is to be placed on the right-most part of the Interface ID (39A7 94 07 CBD0 ).
- In the middle, we have to place 16-bits value FF FE. Now the Interface ID will be 39A7 94FF FE07 CBD0.
- Finally, we have to change the 7-bits from zero to one. Here, we have to change the first Octet “39“, which is in hexadecimal value to binary number. It will come as 0011 1001. After changing the seventh value from zero to one, it will become 0011 1011. Now, the value would be “3B” in the hexadecimal format.
So, the Interface ID in IPv6 Modified EUI-64 is 3BA7:94FF:FE07:CBD0 (Hexadecimal notation).
The only drawback of the above method is that if the physical hardware changes, then IPv6 Interface ID will also change.
IPv6 is the next-generation internet protocol (IP) address standard intended to replace IPv4. The main advantage of IPv6 over IPv4 is the address space.
Overall, the functionality of IPv6 is similar to IPv4, but the only significant difference is that it utilizes a 128-bits IP address.
Understanding IPv6 addressing architecture, types, and scope will let you know the simplicity and flexibility options.
Furthermore, its auto-configuration, more straightforward header format, and better multicast routing are additional features.