IPv6

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

IPv6 is the most recent version of the Internet Protocol (IP). A first draft was issued in December 1998, and IPv6 was ratified as an Internet Standard in July 2017.

This page is a general introduction to IPv6. For information about configuring IPv6 on Gentoo, please refer to the IPv6/Configuration page.

Introduction

Compared to IPv4, IPv6 provides a significantly larger number of available addresses: IPv4 uses 32-bit addresses, allowing for a total of 2^32 = 4,294,967,296 addresses, whereas IPv6 uses 128-bit addresses, allowing for a total of 2^128 = 340,282,366,920,938,463,463,374,607,431,768,211,456 addresses. The IPv4 address space has now been exhausted:

All RIRs [Regional Internet Registries] have exhausted their address pools, except those reserved for IPv6 transition; this occurred on 15 April 2011 for the Asia-Pacific (APNIC), on 10 June 2014 for Latin America and the Caribbean (LACNIC), on 24 September 2015 for North America (ARIN), on 21 April 2017 for Africa (AfriNIC), and on 25 November 2019 for Europe, Middle East and Central Asia (RIPE NCC). These RIRs still allocate recovered addresses or addresses reserved for a special purpose. Individual ISPs still have pools of unassigned IP addresses, and could recycle addresses no longer needed by subscribers.[1]

The use of Carrier-Grade Network Address Translation (CGNAT) has reduced the pressure to move to IPv6. However, there are other advantages to IPv6 compared to IPv4, such as:

  • Multicasting, via which a single send operation can transmit data to multiple destinations, is part of the base specification of IPv6. It's only optional in IPv4 (RFC 1112), and therefore not guaranteed to be supported.
  • Stateless address autoconfiguration, via which hosts configure their IP address automatically.
  • Mobile IPv6, which avoids the triangular routing required by Mobile IPv4.

There was never an 'IPv5'. A streaming protocol known as the Internet Streaming Protocol, abbreviated as 'ST', used the IP version 5 ID, but it used the same limited address space as IPv4, and never made it past the draft stage.

IPv6 address format

An individual IPv6 address has the format nnnn:nnnn:nnnn:nnnn:nnnn:nnnn:nnnn:nnnn, where each n is a hexadecimal digit. Leading zeroes in each inter-colon group can be removed; thus, a group '0021' can be reduced to simply '21'. Additionally, a single sequence of inter-colon groups only containing zeroes can be abbreviated to '::'. Thus, fe80:0000:0000:0000:0000:0000:000:0001 can be abbreviated to fe80::0001, and even further to fe08::1. Note that the '::' abbreviation can only be used once in an address: thus, fe80:0000:0000:1111:0000:0000:0000:0001 can be abbreviated to fe80::1111:0000:0000:0000:0001, fe80::1111:0000:0000:0000:1, fe80:0000:0000:1111::0001 or fe80:0000:0000:1111::1, but not fe80::1111::0001.

IPv6 address ranges/blocks are represented using standard CIDR (Classless Inter-Domain Routing) notation, e.g. fe80::/48; the number after the '/' indicates how many bits are allocated to the prefix designating a specific subnetwork.

Link-local addresses

All IPv6 interfaces require a link-local address, i.e. an address only valid on the local network to which a host is connected. IPv6 link-local addresses have the prefix fe80::/10; the first 54 bits after the prefix can be used for subnetting. Bringing an IPv6 interface up will result in a link-local address automatically being generated via Stateless address autoconfiguration (SLAAC); how this address is generated is implementation-dependent. However, globally routable addresses can also be assigned using DHCPv6, or manually.

Neighbor Discovery

The Neighbor Discovery Protocol (NDP), specified by RFC 4861. uses five ICMPv6 packet types to gather information required for configuring of local connections, domain name servers, and gateways. These packet types provide functionality similar to the IPv4 Address Resolution Protocol (ARP) and ICMP redirect and router discovery message types.

NDP also includes Neighbor Unreachability Detection (NUD), improving packet delivery in the presence of failing routers, links, or mobile nodes.

IPv6 address blocks

A selection of standard IPv6 address blocks/ranges.

Address block Description RFC(s)
::/128 The 'unspecified' address RFC 4291
::1/128 Loopback address / 'localhost' RFC 4291
::ffff:0:0/96 IPv4-mapped addresses: an IPv4 address in the form of an IPv6 address RFC 4291
::ffff:0:0:0/96 IPv4 translated addresses, via the Stateless IP/ICMP Translation (SIIT) algorithm RFC 2765
64:ff9b::/96 IPv4/IPv6 translation 6052, updating 4291
64:ff9b:1::/48 IPv4/IPv6 translation for private networks RFC 8215
2001::/32 Teredo tunneling RFC 4380
2001:db8::/32 Addresses for use in examples (e.g. in documentation and code examples) RFC 3849
2002::/16 The deprecated 6to4 addressing scheme RFC 7526
fc00::/7 Unique local addresses for private networks RFC 4193
fe80::/64 Link-local addresses RFC 4291
ff00::/8 Multicast addresses RFC 4291

RFCs

A selection of current IETF RFCs describing IPv6 standards.

RFC Title
RFC 4291 IP Version 6 Addressing Architecture
RFC 4862 IPv6 Stateless Address Autoconfiguration
RFC 4861 Neighbor Discovery for IP version 6 (IPv6)
RFC 4193 Unique Local IPv6 Unicast Addresses
RFC 4213 Basic Transition Mechanisms for IPv6 Hosts and Routers
RFC 3053 IPv6 Tunnel Broker

Transition mechanisms

6to4

6to4 generates a globally-routable IPv6 address by appending the IPv4 address to 2002::/16. For example, an IPv4 address of 203.0.113.1 has a hexadecimal representation of cb007101, so the 6to4 IPv6 address would be 2002:0000:0000:0000:0000:0000:cb00:7101 (which can be abbreviated to 2002::cb00:7101). It cannot used behind NAT devices (e.g. home routers), should not be used for connecting IPv4-only hosts with IPv6-only hosts (which should be done with NAT64), and is often misconfigured.

6rd

6rd, IPv6 rapid deployment, is derived from 6to4; it operates entirely within the network of an end-user's ISP. Each ISP uses one of its own IPv6 prefixes instead of the 6to4 2002::/16 prefix, allowing all its 6rd hosts to be reachable by all IPv6 hosts that can reach the ISP's IPv6 network.

6over4

6over4 generates a link-local IPv6 address from an IPv4 address, and provide a mechanism to perform Neighbor Discovery on top of IPv4, via IPv4 multicast. The link-local IPv6 address is obtained by appending the IPv4 address to fe80::/96. For example, an IPv4 address of 203.0.113.1 has a hexadecimal representation of cb007101, so the 6over4 IPv6 address would be fe80:0000:0000:0000:0000:0000:cb00:7101 (which can be abbreviated to fe80::cb00:7101).

6in4

6in4 is a tunneling protocol which transfers IPv6 packets via specially configured IPv4 links: the endpoints are configured statically.

Teredo

Teredo is a tunneling protocol providing IPv6 connectivity to IPv6-capable hosts which are only on the IPv4 Internet; unlike 6to4, it works even behind NAT devices (e.g. home routers).

External resources

References

  1. Wikipedia: "IPv4 address exhaustion". Retrieved on 2024-04-15.