IPv6 Addressing Architecture

IPv6 Addressing Architecture

IPv6 are 128-bit identifiers (addresses) for interfaces and sets of interfaces. IPv6 addresses are assigned to interfaces, not nodes. There are three types of addresses-

1. Unicast: An identifier for a single interface. A packet sent to unicast address is delivered to a single interface identified by that address.

2. Anycast: An identifier for a set of interfaces. A packet sent to an anycast address is delivered to one of the interfaces identified by that address- the "closest" interface as suggested by the routing protocol.

3. Multicast: An identifier for a set of interfaces. A packet sent to a multicast address is delivered to all of the interfaces identified by that address.

IPv6 addresses are notified in the form X:X:X:X:X:X:X:X where "X" is a hexadecimal value with eight 16-bit pieces- each piece is represented by four hexadecimal digits seperated by a colon.

For example- a typical IPv6 address may look like FEDC: 0001: 0000: 0000: 0000: 0000: ABDC: 0FF0.

Since an IPv6 address may contain a long string of zero bits, few rules have been developed to write these addresses with ease.

Rule 1: The use of "::" indicates multiple groups of 16-bits of zeroes.

Rule 2: The "::" can appear only ONCE in an address.

Rule 3: The "::" can also be used to compress leading or trailing zeroes in an address.

For example- the IPv6 address FEDC: 0001: 0000: 0000: 0000: 0000: ABDC: 0FF0 can be compressed to FEDC: 1:: ABDC: FF0.

Also, the IPv6 address FEDC: 0000: 0000: 0001: 0000: 0000: ABDC: 0FF0 can be compressed to FEDC :: 1: 0: 0: ABDC: FF0. The "::" cannot appear twice in an address.

And, IPv6 address 0000: 0000: 0000: 0000: 0001: FEDC: ABDC: 0FF0 can be compressed to :: 1: FEDC: ABDC: FF0.

Rule 4: When dealing with a mixed IPv4 and IPv6 environment, the X:X:X:X:X:X.d.d.d.d is used where "X" are hexadecimal values of six high-order 16-bit pieces of the address, and "d" are the decimal values of four low-order 8-bit pieces of the address (the actual 32-bit IPv4 address).

For example- 0:0:0:0:0:0:10.1.8.24 or in compressed form ::10.1.8.24

IPv6 address prefixes can be written in a manner similar to CIDR notation ipv6-address/ prefix-length where

ipv6 address is an IPv6 address

prefix-length is a decimal value specifying how many leftmost contiguous bits of the address comprise the prefix.

For example- the following are legal representations of 60-bit prefix 1234: 0000: 0000: 0CB3.

1234: 0000: 0000: CB3: 0000: 0000: 0000: 0000/60

1234: 0: 0: CB3::/60

1234::CB3: 0: 0: 0: 0/60

However, 1234::CB3/60 is illegal since it means 1234: 0: 0: 0: 0: 0: 0: CB3/60.

Address Type Allocation:

The specific type of an IPv6 address is specified using the leading bits in the address. The variable-length field comprising of these leading bits is called Format Prefix (FP).

Unicast addresses are distinguishable from Multicast addresses from high-order octet of the addresses. A value of FF (11111111) indicates a Multicast address, anything else is a unicast address. Anycast addresses are taken from Unicast address space, but they are not distinguishable from unicast addresses.

Unicast Addresses:

Aggregatable global unicast addresses are analogous to routable IPv4 IP addresses. They are assigned in blocks to ISPs, who then assign portions of the addresses to businesses and end users.

The IPv6 global aggregatable global unicast address format is as follows-

FP is Format Prefix which is 001 for global aggregatable global unicast addresses.

TLA ID is Top-Level Aggregation Identifier

RES is Reserved. All bits are set to 0, except when TLA ID is 0x0001, two bits are used and six bits are unused.

NLA ID is Next-Level Aggregation Identifier

SLA ID is Site-Level Aggregation Identifier

Interface ID is Interface Identifier

The network portion makes up the first-64 bits while the node portion makes up the last 64-bits.

The IANA assigns a range of IPv6 TLA IDs to regional IP registries (RIRs) around the world. The RIRs then assign TLA IDs to large ISPs.

An organization assigned a TLA ID, creates address hierarchy and identifies sites using NLA ID.

A site is free to create as many number of hierarchies within the SLA ID as is appropriate. It could have a flat numbering scheme with no further sub-division, it could sub-divide into subnets, creating a hierarchy of SLA ID addresses.

Interface Identifiers are used to identify an interface on a link. They are required to be unique on a link. The FP 001 through 111, except Multicast addresses 11111111, are required to have a 64-bit interface identifiers in EUI-64 format.

Converting a 48-bit MAC address to a 64-bit Interface Identifier in EUI-64 format:

To create a EUI-64 interface identifier from a 48-bit MAC address, two octets of values 0xFF and 0xFE are inserted in the middle of 48-bit MAC address (between vendor ID (OUI) and vendor supplied ID). Also, the universal/local bit is set to 1 indicating global scope.

For example, the MAC address 00-05-9A-3C-78-00 is converted to EUI-64 format interface identifier as follows-

00-05-9A-3C-78-00 can be written in binary as 00000000 00000101 10011010 00111100 01111000 00000000.

^=U/L bit

Now, we insert 0xFF and 0xFE between 9A and 3C, and also set the U/L bit to 1. This converts to-

00000010 00000101 10010101 11111111 11111110 00111100 01111000 00000000 which in hexadecimal form is 02-05-9A-FF-FE-3C-78-00.

Other Unicast address types:

1. Unspecified address:

The address 0: 0: 0: 0: 0: 0: 0: 0 is an unspecified address. It should never be used. However, a host may use this as Source address when it is unaware of its IP address. The Destination address should never be set to this address.

2. Loopback address:

The address 0: 0: 0: 0: 0: 0: 0: 1 is the Loopback address. It is same as 127.0.0.1 IPv4 address. It may be used by a node to send traffic to itself. Traffic destined for Loopback address must never leave the sending node.

3. IPv6 addresses with Embedded IPv4 addresses:

The IPv6 transition mechanism include a technique for hosts and routers to dynamically tunnel IPv6 packets over IPv4 routing infrastructure. IPv6 nodes that implement this technique are assigned special IPv6 unicast address with IPv4 address in the low-order 32-bits. Addresses of these format are termed "IPv4 compatible IPv6 addresses". They are of following format-

IPv4 address is of decimal format d.d.d.d

Nodes that do not support IPv6 use a second type of format called "IPv4 mapped IPv6 address" which has the following format-

4. Link-Local IPv6 unicast addresses:

A link-local address is used for nodes on a single link for purposes such as auto-configuration, neighbor discovery or when no routers are present. Routers must never forward packets with source or destination address as link-local address beyond the link.

A link-local address starts with a FP 1111111010 followed by 54 zeroes and 64-bit interface identifier.

5. Site-Local IPv6 unicast addresses:

Site-Local addresses are designed to be used for addressing within a site (an organisation). These addresses are not reachable from locations outside of the site. These addresses are analogous to IPv4 private addresses.

A site-local address starts with a FP 1111111011 followed by 38 zeroes, 16-bit subnet ID and 64-bit interface identifier.The Subnet ID can be used to create multiple networks within the site.

NSAP addresses and IPX addresses can also be mapped to IPv6 addresses.

Further reading:

1. RFC 2373: IPv6 addressing architecture http://www.faqs.org/ftp/rfc/pdf/rfc2373.txt.pdf

2. IPv6 Addressing at a Glance from Cisco.com