在线一本码道高清

IPv6 encoding rules, IPv6 address representation method

text

IPv6 addresses are 128 bits long and are usually written in 8 groups of four characters each (converted to a 16-bit length). Groups are separated by ":". E.g:

2001: 0db8: 85a3: 08d3: 1319: 8a2e: 0370: 7344

There are also abbreviations, for example: :: 874B: 2B34

1st Floor

According to the coding rules of IPv6, IPv6 can allocate 2 128 IP addresses, and can assign different IPs to each sand on the earth. The broad development of China brings bright prospects.

The encoding rules for IPv6 addresses are as follows:

(1) IPv6 addresses are 128 bits long, usually written in 8 groups, each group of four characters (converted to 16-bit length), separated by a half-width ":" between groups. E.g:

2001: 0db8: 85a3: 08d3: 1319: 8a2e: 0370: 7344

This is a valid IPv6 address.

(2) If all four characters are zero in a group, it can be abbreviated to a zero or omitted. E.g:

2001: 0db8: 85a3: 0000: 1319: 8a2e: 0370: 7344

Equivalent to

2001: 0db8: 85a3: 0: 1319: 8a2e: 0370: 7344

2001: 0db8: 85a3 :: 1319: 8a2e: 0370: 7344

(3) If two or more consecutive colons appear due to omission, they can be compressed into two colons.

such as:

2001: 0DB8: 0000: 0000: 0000: 0000: 1428: 57ab

Equivalent to

2001: 0DB8: 0: 0: 0: 0: 1428: 57ab

2001: 0DB8: 0: 0 ::: 1428: 57ab

2001: 0DB8 :::: 1428: 57ab

2001: 0DB8 :: 1428: 57ab

They are equivalent, all are legal addresses.

However, zero compression can only occur once in an address. IPv6 addresses like "2001 :: 25de :: cade" are illegal. Because there are two separate compressions in the middle, it makes it difficult to know how many all-zero packets are in each compression.

(4) In each group, leading zeros can be omitted, for example:

2001: 0DB8: 02de :: 0e13

Equivalent to

2001: DB8: 2de :: e13

(5) IPv4 addresses can be easily converted into IPv6 address formats.

For example, if an IPv4 address is 135.75.43.52 (hex 0x874B2B34), it can be converted into the following three fully equivalent IPv6 formats:

0000: 0000: 0000: 0000: 0000: 0000: 874B: 2B34

:: 874B: 2B34

:: 135.75.43.52

With the introduction above, we should have a general understanding of how IPv6 addresses are represented. In fact, we are not engaged in research, but actually use it, so it is quite enough to understand the above knowledge.

2nd Floor