Home  >  Article  >  How to classify ipv6 addresses

How to classify ipv6 addresses

coldplay.xixi
coldplay.xixiOriginal
2020-10-10 12:32:2723806browse

IPv6 address classification method: 1. Unicast address, a unicast address corresponds to an interface, and data packets sent to the unicast address will be received by the corresponding interface; 2. Multicast address, a multicast address The address corresponds to a group of interfaces, and data packets sent to the multicast address will be received by all interfaces in this group.

How to classify ipv6 addresses

How to classify ipv6 addresses:

For IPv4 addresses, we know that they are divided into Class A, Class B, Class C, multicast address and reserved address are several major categories. Class ABC addresses also have different functions such as broadcast address, private address and other types. So how are IPv6 addresses classified? This article will give you a preliminary understanding.

Let’s first talk about why it is called a preliminary understanding, because so far, the classification standard for IPv6 addresses is still being formulated. The most recent draft standard was formulated in 2006 (specifically You can check RFC4291), so this article can only lead you to try it out and have a general understanding of IPv6 address classification and structure. Just like the IPv6 standard took 20 years to change from a draft to a formal standard, the determination of IPv6 address classification standards is also a long process. Of course, with the rapid popularity of IPv6, the determination of this standard will definitely accelerate.

1. IPv6 address representation method

The IPv6 address has a total of 128 digits. In order to facilitate manual reading and input, like the IPv4 address, the IPv6 address can also be represented by a string. character representation. The IPv6 address is expressed in hexadecimal. The IPv6 address is divided into 8 blocks, each block is 16 bits, and the blocks are separated by ":". As shown below:

How to classify ipv6 addresses

#At the same time, when multiple address blocks are 0, you can use the "::" sign to simplify.

Simplification principle:

  • All 0 blocks "0000" can be simplified to "0"

  • ## Multiple All 0 blocks can be simplified to "::"

  • Only one "::" can appear in an IPv6 address. When multiple all 0 blocks appear, "::" must Simplify the longest paragraph. If there is no longest paragraph, go to the nearest one (left)

  • "::" can appear at the beginning or end of the address

Specific examples are as follows:

How to classify ipv6 addresses

2. IPv6 address types

IPv6 addresses are generally divided into three categories: unicast addresses, Anycast address, multicast address.

  • Unicast address: A unicast address corresponds to an interface, and data packets sent to the unicast address will be received by the corresponding interface;

  • Anycast address: An anycast address corresponds to a group of interfaces. Data packets sent to the anycast address will be received by one of the interfaces in the group. Which interface is received is determined by the specific routing protocol;

  • Multicast address: A multicast address corresponds to a group of interfaces. Data packets sent to the multicast address will be received by all interfaces in this group;

Specific address The distribution is as shown below. Anycast exists among unicast addresses, and there is no special distinction:

How to classify ipv6 addresses

Specially specified address type:

No address specified, It is mainly used as the source address when requesting an IP address from the outside when the IP has not been allocated at the beginning of the system startup. It cannot be used as the destination address of the data packet.

The loopback address is used when sending data packets to itself. It can test the network layer protocol status during daily network troubleshooting.

Local link unicast address. The prefix of the local unicast address is FE80::/64. Its function is that in a network where no routing (gateway) exists, the host automatically configures the IPv6 address through the MAC address. , can only be used on the local network.

The IPv6 address space is allocated by the IANA organization. For details, you can check its official website.

In addition: PHP's address translation for ipv4 includes: ip2long() and long2ip()

The above is the detailed content of How to classify ipv6 addresses. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to check computer IPNext article:How to check computer IP