Internet Protocol version 6 is defined by RFC 2460 published in 1998, 15 years after the first deployment of IPv4.
The main advantage is the address length - 128 bits or 4 times longer than IPv4. Other enhancements:
- Stateless address autoconfiguraion (SLAAC) using Neighbor Discover Protocol (NDP) via ICMPv6 router discovery messages. Alternatively, DHCPv6 or static configuration can be used as well
- Simplified network renumbering when changing ISP since host identifiers (least significant 64 bits) can be independently self-configured by a host
- Routers announcement of a new prefix when changing ISP renumbers the entire network with ease
- Packet fragmentation can only be done by end nodes (not routers any more) via path MTU discovery, end-to-end fragmentation or sending packets no larger than the default MTU of 1,280 bytes.
- Subnet size is 64 bits. Most significant bits are used for subnets. The least significant 64 bits are used for host identifiers.
- Efficient routing due to large subnet space and hierarchical address aggregation
- IPSec is included. It was developed originally for IPv6 but adopted by IPv4
- Broadcast address is not defined. Multicasts to the link-local all nodes multicast group ff02::01 are used instead, which is analogous to 224.0.0.1 IPv4 group.
- Multicasts are globally routable
- Privacy extension allows to randomly generate host identifiers, hence making node tracking is more difficult
- Transport or application layer protocols need little or no change with the exception of some that embed IPv4 addresses such as FTP or NTP.
IPv6 is not interoperable with IPv4. To exchange information, some methods exist: NAT64 and tunneling 6to4, 6in4 or Teredo.
Loopback address is ::1.
A link-local 64-bit address is created by prefixing 16 bits fe80::/10 to a 48-bit MAC address. It is unique within the 64-bit subnet only.
A global address is configured by prefixing the link-local address by a 64-bit network prefixes supplied by a router.
IPv6 Header
Version | Traffic Class | Flow Label | Payload Length | Next Header | Hop Limit | Source IP | Destination IP | Options | |
The Next Header field indicates if there are Options or the Protocol in the payload.
There is no checksum protection any more; hence, a router does not need to recalculate it after changing the TTL, which in IPv6 is called Hop Limit. MTU can be as large as 4GB.