The address space of IPv6 is its most obvious feature, it uses an address space that is four times larger than IPv4. Recall that IPv4 address space is 32 bits – 4,294,967,296 addresses, IPv6 spot an address space of 128 bits – 340,282,366,920,938,463,463,374,607,431,768,211,456 or 3.3×10^38 addresses to put it mildly.
The large size of the IPv6 address is designed to be divided into hierarchical unicast routing domains that reflect the topology of the modern internet. The use of 128-bits allows for multiple levels of hierarchy and flexibility in designing hierarchical unicast addressing and routing that is currently lacking on the IPv4-based internet.
Additionally, the large address space has been designed to allow for multiple levels of subnetting and address allocation, from the internet backbone to the individual subnets within an organization.
IPv6 Address Syntax
The 128-bit address of IPv6 is divided into 8 sections along 16-bit boundaries, and each 16-bit block is converted to a 4-digit hexadecimal number separated by colons. This form of representation is called colon hexadecimal.
Consider this IPv6 address in binary form:
Now let’s divide this address along 16-bit boundary:
0010000000000001 0000110110111000 0000000000000000 0010111100111011
0000001010101010 0000000011111111 1111111000101000 1001110001011010
Let’s convert this to hexadecimal and delimit them by colon, should be readable that way.
For the sake of simplicity, leading zeros within each 16-bit block can be suppressed. However, each block must have at least a single digit. From the above example, suppressing leading zeros gives us
There are some types of IPv6 address that contains long sequences of zeros. For example, the multicast address FF02:0:0:0:0:0:0:2. To simplify the representation of addresses like this, the block of zeros can be removed and replaced with double colons (::). The above multicast address can now be written as FF02::2. It must be said that only one contiguous block of zeros can be replaced this way. Suppose we have an address
We can’t compress it like the one below because there are two contiguous block of zeros
The correct way to compress this address is
The first option is wrong because if we remove two sets of zeros, the device looking at the address will have no way of knowing where the zeros go back in. A router would look at the incorrect address and say “well, do I place two blocks into the first set of double colons and two into the second set, or do I place three blocks into the first set and one block into the second set?” This put the router in a confused state because the information it needs isn’t there.
Given an address FF05:2, to determine how many 0 blocks are represented by the double colons, count the number of blocks in the compressed address and subtract it from 8 (why 8? Because there are 8 block of in an IPv6 address). We have 8 – 2 = 6 zero blocks represented by the double colons. Also, the number of bits represented by the double colon is 16 * 6 = 96 bits.
Once again, only leading zeros can be suppressed, not trailing zeros. For example, the address FF02:30:0:0:0:0:0:5 can’t be written as FF02:3::5, the correct form is FF02:30::5. In addition, IPv6 uses hexadecimal rather than the decimal numbering system found in IPv4. This is because it is far easier to convert between hexadecimal and binary than it is between binary and decimal.
The part of an IPv6 address where the bits have a fixed value is called the prefix of that address. It’s also the part of the address that defines a route or subnet. Subnets and summarized route prefixes are expressed in the same way as CIDR notation for IPv4. The IPv6 prefix is written as address/prefix-length. For example, 2001:DB8:3C0:6402::/64 is a subnet prefix and 2001:DB8:7C::/48 is a summarized route prefix. Any subnet less than 64-bit prefix indicate a summarized route, or an address range summarizing a portion of the IPv6 address space.
There is no such thing as variable length subnet prefix in IPv6 because at the individual subnet level for unicast addresses the number of bits used to identify the subnet is always 64 and the number of bits used to identify the host on the subnet is always 64.
TYPES OF IPv6 ADDRESS
There are three types of IPv6 address:
- Unicast IPv6 addresses.
- Multicast IPv6 addresses.
- Anycast IPv6 addresses.
Unicast IPv6 Addresses
There are five types of IPv6 unicast addresses:
- Global unicast addresses.
- Link local unicast addresses.
- Unique local unicast addresses.
- Special addresses.
- Transition addresses.
Global unicast addresses
This is the address anyone interested in connecting to the internet need. It’s an equivalent of the IPv4 public address, globally reachable and routable on the IPv6 internet. To allow for an efficient routing process, they are designed to be summarized or aggregated. The structure of a global unicast address is made up of the following fields:
- A fixed portion.
The designer of the IPv6 address states that the first 3 bits of a global unicast address must be 001.
- Global routing prefix.
This is a 45-bit field that alongside the fixed portion of the address is used to create a 48-bit site prefix given to the individual site of an organization. It is part of the address that makes it routable and globally significant.
- Subnet ID.
The subnet ID portion is the part used for subnetting, it is 16 bit in size providing 65,536 subnets.
- Interface ID.
A 64-bit size field that indicate the interface on a specific subnet within a site.
Link local Addresses
The first 64 bits of a link local address is set to 1111 1110 1000 …. 0000, which gives FE80 in hexadecimal. Link local address always begin with FE80, and when the 64- bit interface identifier is included the prefix becomes FE80::/64.
They are used by nodes on the same link to communicate with each other and on par with IPv4 link local addresses defined in RFC 3927 that use the 169.254.0.0/16 prefix. On Windows, the use of IPv4 link local addresses is known as Automatic Private IP Addressing (APIPA).
For some neighbor discovery processes, the link local address is required, and is always automatically configured even in the absence of all other unicast addresses.
Unique Local Addresses
This is similar to the IPV4 private addresses, they are not routable on the IPv6 internet. Unique local unicast addresses are defined by RFC 4193. They have a global scope, but despite this, they will not be advertised outside of an organization’s network. They are filtered out at internet boundaries to prevent them from being forwarded.
The first seven bits of a unique local address as stated by the IPv6 designers have a fixed value of 1111 1110, leaving all local address with the prefix FC00::/7. The local flag (L) is 1 bit, and it indicate whether the address is globally assigned or locally assigned. L flag set to 0 is not defined by RFC 4193, effectively leaving it with no global significance. The L flag is set to 1 when it is assigned within an organization, giving it the local status. Therefore, unique local address within an organization with the L flag set to 1 will have the prefix FD00::/8 (1111 1101).
The global ID identifies a site within an organization. It’s a 40 bit value that’s randomly generated, and alongside the fixed bit and L flag value forms a unique 48 bit prefix assigned to a site within an organization.
Special IPv6 Addresses
These are addresses reserved for special use.
- The Unspecified Address (0:0:0:0:0:0:0:0 or :: )
This is equivalent to the IPv4 unspecified address 0.0.0.0. It is used only to indicate the absence of an address. Mainly used when a unique address has not been determined, it is never assigned to an interface or used as a destination address.
- Loopback Address (0:0:0:0:0:0:0: or ::1 )
Equivalent to the IPv4 loopback address 127.0.0.1. It is assigned to a loopback interface, enabling a node to send packets to itself.
- Multicast Address ( FF00::/8)
These are addresses used for multicasting.
- 3FFF:FFFF::/32 -: Reserved foe examples and documentation.
- 2001:0DB8::/32 -: Also reserved for examples and documentation.
- 2002::/16 -:Used with 6 to 4.
- IPv4 Mapped Address
Used to represent an IPv4 address as a 128 bit IPv6 address. It’s of the type 0:0:0:0:0:FF:W.X.Y.Z or ::FF.W.X.Y.Z
- 6 to 4 Address
The 6 to 4 is a transition system, a structure that allows IPv6 packet to be transmitted over an IPv4 network without a need to configure explicit tunnels. It is of the type 2002:WWXX:YYZZ:Subnet ID:Interface ID.
- ISATAP Address
Assigned to a node for the Intrasite Automatic Tunnel Addressing Protocol IPv6 transition technology. This address is of the type 64-bit prefix:0:5EFE:W.X.Y.Z where w, x, y, z is a private IP address.
Assigned to a node for the teredo IPv6 transition technology. It’s a global address that uses the prefix 2001::/32
A multicast address is an address that identifies a group interface address. Packets sent to a multicast address are delivered to all interfaces identified by the multicast address. It is sometimes called one – to –many address.
IPv6 multicast address performs the same function that IPv4 multicast address do, and it can’t be used as a source address. The first 8 bits of an IPv6 multicast address is set to a fixed value of 1111 1111 which is equivalent to FF in hexadecimal. Thus, an IPv6 multicast address will always begin with FF.
This is a 4 bit field that consists of 3 flags in the lower order bits. The transient flag (T) is the first lower order bit whose value can either be 0 or 1. When the value is 0, it indicate that the multicast address is a permanently assigned multicast address, handed out by IANA. A value of 1 indicates that the multicast is a transient address i.e. not permanently assigned.
The prefix flag (P) is the second low order bit defined by RFC 3306 which indicate whether the multicast address is based on a unicast address prefix. The Rendezvous point Address flag (R) is the third low order bit and it indicates if there’s an embedded rendezvous point address in the multicast address. The R flag is described by RFC 3956.
This is a 4-bit field that indicate the scope of the IPv6 network for which the multicast traffic is to be delivered. The table below shows the defined values for the scope field as per RFC 4291.
|Scope field value||Scope|
|1||Interface local scope|
A traffic with the multicast address FF02::2 for example, has a link-local scope. This traffic will not be forwarded beyond the link by the router.
The group ID is a 112 bits field that identifies the multicast group, and it is unique within the scope. Group IDs are independent of the address scope if they are permanently assigned, while transient group IDs are relevant only to a specific scope.
For a list of permanently assigned IPv6 multicast address visit http://www.iana.org/assignments/ipv6-multicast-addresses
Anycast address identifies multiple IPv6 interfaces, but packets addressed to anycast address is delivered to only the nearest address it finds. Anycast address is sometimes called one – to – one of many. These address as defined by RFC 4291 are used only as destination addresses and are assigned only to routers.
RFC 4291 define a subnet – router anycast address which is created from the subnet prefix for a given interface. Router interfaces attached to a subnet have a subnet – router anycast address for that subnet.
When the subnet – router anycast router address is constructed, the bits in the subnet prefix are fixed at their appropriate values and the remaining bits are set to 0.