Skip to content

IPv6 - Address Types

IPv6 addresses are represented in hexadecimal, a base-16 number system. It uses digits 0-9 and letters A-F (representing 10-15). Each hexadecimal digit corresponds to 4 bits. For example, ‘F’ in hex is ‘1111’ in binary, and ‘2B’ in hex is ‘0010 1011’ in binary.

A quick conversion reference: Binary ‘0000’ is Hex ‘0’, ‘0001’ is ‘1’, …, ‘1001’ is ‘9’, ‘1010’ is ‘A’, ‘1011’ is ‘B’, ‘1100’ is ‘C’, ‘1101’ is ‘D’, ‘1110’ is ‘E’, ‘1111’ is ‘F’.

An IPv6 address is 128 bits long, compared to IPv4’s 32 bits. It is written as eight groups of four hexadecimal digits (16 bits per group), separated by colons.

For example, a 128-bit IPv6 address in binary:

0010000000000001 0000110110111000 0000000000000000 0001000100010001 0000000000000000 0000000000000000 0010111100111011 0000001010101010

Converted to hexadecimal, this becomes:

2001:0DB8:0000:1111:0000:0000:2F3B:02AA

To make IPv6 addresses more manageable, two shortening rules can be applied:

Rule 1: Omit leading zeros in any 16-bit group. For example, ‘0DB8’ can be written as ‘DB8’, and ‘0000’ as ‘0’.

Applying Rule 1 to the example: 2001:DB8:0:1111:0:0:2F3B:2AA

Rule 2: One contiguous sequence of 16-bit groups consisting entirely of zeros can be replaced by a double colon ’::’. This can only be used once in an address to avoid ambiguity.

Applying Rule 2 to the example (the two ‘0:0’ groups): 2001:DB8:0:1111::2F3B:2AA

If there are multiple blocks of zeros, only one can be compressed using ’::’. For instance, 2001:0:0:0:ABCD:0:0:EF cannot be 2001::ABCD::EF. It could be 2001::ABCD:0:0:EF or 2001:0:0:0:ABCD::EF. Typically, the longest run of zeros is compressed.

In most IPv6 unicast addresses, the last 64 bits form the Interface ID (IID), which uniquely identifies an interface on a subnet. The first 64 bits typically represent the network prefix.

One method to generate an IID is using the Modified EUI-64 (Extended Unique Identifier) format. This involves taking a 48-bit MAC address, splitting it into two 24-bit halves, inserting ‘FFFE’ (16 bits) in the middle, and then inverting the 7th bit (the Universal/Local or U/L bit). For example, if a MAC address is 00-1A-2B-3C-4D-5E:

  1. Split: 001A2B and 3C4D5E.
  2. Insert FFFE: 001A2BFFFE3C4D5E.
  3. Invert 7th bit: The first byte is ‘00’ (binary 00000000). The 7th bit is 0. Inverting it makes it 1. So, ‘00’ becomes ‘02’ (binary 00000010).
  4. Resulting IID: 021A:2BFF:FE3C:4D5E.

However, due to privacy concerns with EUI-64 (as it embeds a fixed MAC address), modern operating systems often use Privacy Extensions (RFC 4941). These generate temporary, randomized IIDs that change over time, making it harder to track devices.

GUAs are globally unique and routable on the internet, similar to public IPv4 addresses. Most GUAs are currently allocated from the 2000::/3 range (meaning the first three bits are ‘001’).

A typical GUA structure is: Global Routing Prefix (48 bits) | Subnet ID (16 bits) | Interface ID (64 bits).

  • Global Routing Prefix: Typically assigned by an ISP to an organization. For example, 2001:0DB8:ACAD::/48.
  • Subnet ID: Used by the organization to create internal subnets. For example, using the 16 bits, the organization can create up to 65,536 subnets (e.g., 2001:0DB8:ACAD:0001::/64, 2001:0DB8:ACAD:0002::/64, etc.).
  • Interface ID: The last 64 bits, identifying a specific host on that subnet.

These addresses are used for communication only on a single network link (e.g., an Ethernet segment). They are not routable beyond the local link. Link-local addresses are essential for NDP functions like address resolution and router discovery.

They always start with the prefix FE80::/10. Typically, the 54 bits following FE80 (up to the 64th bit) are set to zero, effectively making the prefix FE80::/64 for a specific link. The remaining 64 bits are the Interface ID.

Example: FE80::021A:2BFF:FE3C:4D5E (where the IID is EUI-64 derived or randomized).

ULAs (RFC 4193) are intended for local use within a site or set of sites. They are globally unique (with high probability if generated correctly) but are not meant to be routed on the public internet. They are similar in concept to IPv4 private addresses (e.g., 10.0.0.0/8).

ULAs have the prefix FC00::/7. The 8th bit (L-bit) is set to ‘1’ for locally assigned ULAs, making the prefix FD00::/8. The structure is: FD (8 bits) | Global ID (40 bits) | Subnet ID (16 bits) | Interface ID (64 bits).

  • FD: Indicates a locally assigned ULA.
  • Global ID: A 40-bit pseudo-randomly generated value to ensure uniqueness if sites using ULAs ever merge. It should not be trivially chosen.
  • Subnet ID: 16 bits for internal subnetting within the site.
  • Interface ID: 64 bits for the host.

Example: FDe3:a45b:9876:0001::1234 (where e3a45b9876 is the 40-bit Global ID).

Link-Local addresses are confined to a single link. Unique Local Addresses are typically routed within an organization or a limited set of cooperating sites but not on the global internet. Global Unicast Addresses are routed worldwide. Understanding these scopes is crucial for network design and troubleshooting.