IPv6 Addresses

IPv6 Address Format

A 128-bit IPv6 address has two formats:

  • X:X:X:X:X:X:X:X

    • IPv6 addresses in this format are written as eight groups of four hexadecimal digits (0 to 9, A to F), each group separated by a colon (:). Every "X" represents a group of hexadecimal digits. For example, 2001:db8:130F:0000:0000:09C0:876A:130B is a valid IPv6 address.

      For convenience, any zeros at the beginning of a group can be omitted; therefore, the given example becomes 2001:db8:130F:0:0:9C0:876A:130B.

    • Any number of consecutive groups of 0s can be replaced with two colons (::). Therefore, the given example can be written as 2001:db8:130F::9C0:876A:130B.

      This double-colon substitution can only be used once in an address; multiple occurrences would be ambiguous.

  • X:X:X:X:X:X:d.d.d.d

    IPv4-mapped IPv6 address: The format of an IPv4-mapped IPv6 address is 0:0:0:0:0:FFFF:IPv4-address. IPv4-mapped IPv6 addresses are used to represent IPv4 node addresses as IPv6 addresses.

    "X:X:X:X:X:X" represents the high-order six groups of digits, each "X" standing for 16 bits represented by hexadecimal digits. "d.d.d.d" represents the low-order four groups of digits, each "d" standing for 8 bits represented by decimal digits. "d.d.d.d" is a standard IPv4 address.

IPv6 Address Structure

An IPv6 address is composed of two parts:

  • Network prefix: network ID of an IPv4 address, which is of n bits.

  • Interface identifier: host ID of an IPv4 address, which is of 128-n bits.

Figure 1 illustrates the structure of the address 2001:A304:6101:1::E0:F726:4E58 /64.

Figure 1 Structure of the address 2001:A304:6101:1::E0:F726:4E58 /64

IPv6 Address Types

IPv6 addresses have three types.

  • Unicast address: identifies a single network interface and is similar to an IPv4 unicast address. A packet sent to a unicast address is transmitted to the unique interface identified by this address.

    A global unicast address cannot be the same as its network prefix because an IPv6 address which is the same as its network prefix is a subnet-router anycast address reserved for a device. However, this rule does not apply to an IPv6 address with a 127-bit network prefix.

  • Anycast address: assigned to a group of interfaces, which usually belong to different nodes. A packet sent to an anycast address is transmitted to only one of the member interfaces, typically the nearest according to the routing protocol's choice of distance.

    Application scenario: When a mobile host communicates with the mobile agent on the home subnet, it uses the anycast address of the subnet router.

    Addresses specifications: Anycast addresses do not have independent address space. They can use the format of any unicast address. Syntax is required to differentiate an anycast address from a unicast address.

    As IPv6 defines, an IPv6 address with the interface identifier of all 0s is a subnet-router anycast address. As shown in Figure 2, the subnet prefix is an IPv6 unicast address prefix which is specified during configuration of an IPv6 unicast address.

    Figure 2 Format of a subnet-router anycast address

    An anycast address is not necessarily a subnet-router anycast address and can also be a global unicast address.

  • Multicast address: assigned to a set of interfaces that belong to different nodes and is similar to an IPv4 multicast address. A packet that is sent to a multicast address is delivered to all the interfaces identified by that address.

    IPv6 addresses do not include broadcast addresses. In IPv6, multicast addresses can provide the functions of broadcast addresses.

Unicast addresses can be classified into four types, as shown in Table 1.

Table 1 IPv6 unicast address types

Address Type

Binary Prefix

IPv6 Prefix Identifier

Link-local unicast address



Unique local unicast address



Loopback address

00...1 (128 bits)


Unspecified address

00...0 (128 bits)


Global unicast address



Each unicast address type is described as follows:

  • Link-local unicast address: used in the neighbor discovery protocol and in the communication between nodes on the local link during stateless address autoconfiguration. The packet with the link-local unicast address as the source or destination address is only forwarded on the local link. The link-local unicast address can be automatically configured on any interface using the link-local prefix FE80::/10 (1111 1110 10), and the interface identifier in IEEE EUI-64 format (an EUI-64 can be derived from an EUI-48).

  • Unique Local unicast address: is globally unique and intended for local communication. Unique local unicast addresses are not expected to be routable on the global internet. They are routable inside a site and also possibly between a limited set of sites. These addresses are not auto-configured. A unique local unicast address consists of a 7-bit prefix, a 41-bit global ID (including the L bit which is one bit), a 16-bit subnet ID, and a 64-bit interface ID.

  • Loopback address: is 0:0:0:0:0:0:0:1 or ::1 and not assigned to any interface. Similar to the IPv4 loopback address, the IPv6 loopback address indicates that a node sends IPv6 packets to itself.

  • Unspecified address (::): can neither be assigned to any node nor function as the destination address. The unspecified address can be used in the Source Address field of the IPv6 packet sent by an initializing host before it has learned its own address. During Duplicate Address Detection (DAD), the Source Address field of a Neighbor Solicitation (NS) packet is an unspecified address.

  • Global unicast address: equivalent to an IPv4 public network address. Global unicast addresses are used on links that can be aggregated, and are provided to the Internet Service Provider (ISP). The structure of this type of address enables route-prefix aggregation to solve the problem of a limited number of global routing entries. A global unicast address consists of a 48-bit route prefix managed by operators, a 16-bit subnet ID managed by local nodes, and a 64-bit interface ID. Unless otherwise specified, global unicast addresses include site-local unicast addresses.

Interface ID in the IEEE EUI-64 Format

The 64-bit interface ID in an IPv6 address identifies a unique interface on a link. This address is derived from the link-layer address (such as a MAC address) of the interface. The 64-bit IPv6 interface ID is translated from a 48-bit MAC address by inserting a hexadecimal number into the MAC address, and then setting the U/L bit (the leftmost seventh bit) to 1.

If the interface has been configured with a MAC address, the EUI-64 address is generated based on the MAC address of the interface, with FFFE added in the middle.

If the interface has not been configured with a MAC address, the EUI-64 address is generated based on the following rules:

  • For Layer 3 physical interfaces and sub-interfaces, the EUI-64 address is generated based on the MAC address of a physical interface, with FFFE added in the middle.
  • For loopback interfaces , VBDIF interfaces, and tunnel interface, the EUI-64 address is generated based on the MAC address of an interface, with the last two bytes following the interface index added in the middle.
  • For Eth-Trunk interfaces and its sub-interfaces, Global-VE sub-interfaces, VE sub-interfaces, and VLANIF interfaces, the EUI-64 address is generated based on the MAC address of an interface, with FFFE added in the middle.

Taking the insertion of a hexadecimal number FFFE (1111 1111 1111 1110) into the middle of a MAC address as an example, see Figure 3 for the detailed conversion procedure.

Figure 3 Translation from a MAC address to an EUI-64 address
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >