This is the 19th day of my participation in the August More Text Challenge

We reviewed IPV4 last time, but today we’ll take a look at IPV6. The main problem IPV6 addresses is the need for IP address expansion, and the rest are additional attributes.

1. Address mode

  • IPV6 addresses are assigned to network interfaces, not hosts.

  • An interface can have multiple IPV6 addresses of different types.

  • V6 addresses are divided into three types: unicast, multicast and anycast.

  • Anycast: IP addresses of a group of network interfaces on different nodes. These interfaces share the same IP address. When a packet is sent to the Anycast address, it will be sent to the “nearest” interface.

  • Multicast: Packets sent to all network interfaces identified by the multicast address.

  • V6 removes broadcast addresses;

2. Address format

  • IPV6 USES 128 bits number: is divided into eight segments, each period of 16 bits, XXXX: XXXX: XXXX: XXXX: XXXX: XXXX: XXXX: XXXX, each USES 4 16 hexadecimal Numbers, said such as fe80:0:0:0: b002: d7a: e02b: 92 c1

  • In short mode, you can omit 0 by using double colons, but can use only one double colon in an address. The address above can be abbreviated to FE80 ::b002: D7a: e022B: 92C1

  • The hexadecimal characters in the address are case insensitive

  • At the end of the address is a % sign, indicating the port number of the nic. For example, fe80::b002: D7A: E022B: 92C1 %13 indicates that the address is limited to network interface 13 and is invalid on other network interfaces

  • The network number is assigned. The interface ID can be automatically configured based on the MAC address of the interface or manually configured in EUI-64 format. The interface ID must be unique on a link. A host can use the same interface number on different links.

3. Unicast address

  • According to the reachable range of IP addresses, unicast addresses are classified into four types:

    • Aggregatable Global Address
    • Local link address
    • IPV4 translation address
    • The specific address
  • Aggregable public IP addresses:

    • Similar to IPV4’s public address, it can be globally routed and accessed by the public network. Aggregation means that network prefixes can be combined like hypernet CIDR, which effectively reduces the capacity of routing tables.

    • A public network route prefix (assigned by IANA to carriers or sites), subnet ID(similar to IPV4 subnets, usually assigned by carriers), and interface ID(identifying hosts)

    • According to the protocol, the interface ids of all public IP addresses (starting from 001 to 111) must be 64 bits, except the public IP addresses whose binary digits start with 000.

- As of press time, IANA distribution is limited to 2000: public address: 45 bits / 3 or 001 start | 3 | | 16 bits to 64 bits | | +---+---------------------+-----------+-----------------+ |001|global routing prefix| subnet ID | interface ID | + + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + - another 000 heading address, is being used for IPV4 address mapping, talk about laterCopy the code
  • Local Link address link-local

    • It is used to communicate with other interfaces on the same link. It can be used for neighbor Discover. IP packets with this address cannot be routed, and the effect is similar to 169.254.0.0/16 prefix in IPV4.

    • All IPV6 interfaces must have only one local link unicast address.

    • All local link addresses are automatically configured in the following format: the prefix is 1111111010 or FE80::/10;

  • V4 and V6 address translation
    • Two types of V4 into V6 are defined in IPV6: IPv4 compatible IPV6 Address and IPv4-mapped IPV6 Address.

    • Mapping is the only reserved conversion mode at present. The application scenario is to represent an IPV4 node in an IPV6 system. Is 0 for the left 80 bits fixed, fixed for the next 16 bit FFFF, to the right of 32 bits specify the decimal value, used to embed IPv4 addresses, such as: 0:0:0:0-0: FFFF: 192.1.56.10 or: : FFFF: 192.1.56.10/96

- Compatibility is invalid. When IPV6 packets are sent over an IPV4 network, addresses suitable for IPV4 routes are assigned to these packets.Copy the code
  • The specific address:
    • ::1 or 0:0:0:0:0:0:0:0:0:0:1 is a loopback address. It has the same function as 127.x.x.x in IPV4.

    • 0:0:0:0:0:0:0:0:0:0 or ::/128: the address is not specified and cannot be assigned to a host. If the host address is this, the host has no address.

Unique Local Unicast Addresses

It is singled out because, by protocol, the IETF protocol does not belong to the Unicast address type, but is a separate category.

  • The prefix is defined by the protocol FC00::/7, that is, the first seven bits of the network prefix are fixed: 1111110.

  • L indicates how the global ID is generated, which currently defaults to 1;

  • The GLOBAL ID is generated by the pseudo-random algorithm, which makes it more collision-proof. It also makes it clear that these addresses cannot be routed by the public network, and these prefixes cannot be combined like hypernetworks. With this configuration, there could be 2^41 different network prefixes, which would be 236 for each person in the current world population;

  • Subnet ID, which is the subnet ID assigned within the local site.

  • Interface ID, which is the same as that of unicast interface ID.

  • A locally unique unicast address is a globally unique address with 48bits in total.

  • The IP address cannot be used for communication on the public network but only for local communication, for example, routing within a local site or organization.

  • If the local site is merged, it does not need to be renumbered because it is unique.

  • It can be used by network operators as private network addresses. Even if a network leak occurs, it will not conflict with the public address, but the IETF strongly advises against doing so.

  • For applications, these addresses are essentially the same as public addresses.

The above is a detailed introduction of IPV6 address formats and unicast addresses. The next section will introduce IPV6 anycast and multicast addresses in detail. Thank you for reading.






Summary is not easy, please do not reprint without permission, otherwise don’t blame old uncle you are welcome

Welcome technical friends to communicate with me, wechat 1296386616

References:

The IP Version 6 Addressing Architecture, IETF datatracker.ietf.org/doc/html/rf…

The IPv6 Global Unicast Address Format, IETF datatracker.ietf.org/doc/html/rf…

Internet Protocol Version 6 Address Space IANA www.iana.org/assignments…

The IPv6 chapter 3 introduces (summary) Oracle Corporation docs.oracle.com/cd/E19253-0…