# IPv6 Addressing
## What is IPv6
IPv6 is the sixth version of the Internet Protocol, developed to succeed IPv4. The primary motivation for IPv6 was the exhaustion of the 32-bit IPv4 address space. IPv6 uses 128-bit addresses, providing an address space of approximately 3.4 times 10 to the power of 38 unique addresses. This is such a vast number that every person on Earth could be assigned billions of addresses with vast quantities remaining. IPv6 also incorporates improvements in routing efficiency, security, and support for mobility compared to IPv4.
## IPv6 Address Format
An IPv6 address is 128 bits long, written as eight groups of four hexadecimal digits separated by colons. An example IPv6 address is 2001:0db8:85a3:0000:0000:8a2e:0370:7334. Two rules allow IPv6 addresses to be abbreviated. Leading zeros within any group can be omitted, so 0db8 can be written as db8. One or more consecutive groups of all zeros can be replaced by a double colon, but this can only be done once in an address. So 2001:0db8:85a3:0000:0000:8a2e:0370:7334 can be written as 2001:db8:85a3::8a2e:370:7334.
## IPv6 Address Types
IPv6 defines several types of addresses. A unicast address identifies a single interface. A packet sent to a unicast address is delivered to the single interface with that address. A multicast address identifies a group of interfaces. A packet sent to a multicast address is delivered to all interfaces that are members of that multicast group. IPv6 does not have broadcast addresses as IPv4 does; multicast replaces the broadcast functionality. An anycast address is assigned to multiple interfaces. A packet sent to an anycast address is delivered to the nearest interface with that address, as determined by routing metrics. Anycast is used for services like DNS where any server in a group can answer the query.
## IPv6 Address Scopes
Link-local addresses are valid only on a single network link and are automatically configured on all IPv6-enabled interfaces. They always begin with fe80. Link-local addresses are used for neighbor discovery and router discovery protocols. Global unicast addresses are globally routable addresses equivalent to public IPv4 addresses. They currently begin with 2001 or 2 in the first hexadecimal digit. Unique local addresses are analogous to private IPv4 addresses and are used within a private network. They begin with fc00 or fd00.
## IPv6 Features
IPv6 includes IPsec support as a mandatory component, providing built-in security. IPv6 supports stateless address autoconfiguration, allowing devices to automatically configure their own IPv6 addresses without a DHCP server by combining the network prefix advertised by the local router with a host identifier derived from the device's MAC address. IPv6 has a simplified header format compared to IPv4, improving routing efficiency. IPv6 eliminates the need for NAT because every device can have a globally unique address.
## IPv6 Transition
The transition from IPv4 to IPv6 is ongoing but gradual. Many networks now support both IPv4 and IPv6 simultaneously in a configuration called dual-stack. Tunneling mechanisms allow IPv6 packets to be carried inside IPv4 packets across networks that have not yet been upgraded to support IPv6 natively. The widespread adoption of IPv6 is necessary to support the continued growth of the internet and the billions of IoT devices being connected.Back to Subject