Archiving an article previously written on the public account
It is reported that on November 26th, the European Network Coordination Center, responsible for the allocation of Internet resources in the UK, Europe, the Middle East, and parts of Central Asia, announced that all 4.3 billion IPv4 addresses worldwide have been fully allocated. This means that there are no new Internet devices that can be allocated new IP addresses. In the current situation, what would the interested parties think of first? Is it the classless inter-domain routing that improves IP address utilization or the NAT technology that has made great contributions to extending the life of IPv4?
I have to say, relying on the IPv4 protocol is just for fun. To completely solve the address allocation problem, you have to look at my IPv6 protocol.
Today, due to limited space, we will mainly focus on the address resolution of IPv6.
Advantages of IPv6#
- Large address space, theoretically having 2^128 addresses, almost no need to worry about address shortage
- Reduced routing table size, improved router processing performance
- Improved security
- Good service quality, flexible and rich service type extension
- Support for mobile hosts and networks
- Strong compatibility, fully backward compatible with IPv4
- ...
IPv6 Addresses#
The 128-bit address of an IPv6 address is divided into 8 sections, with each section being 16 bits, and each section is represented by a 4-bit hexadecimal number in the "colon hexadecimal representation" format.
Address Format:
X:X:X:X:X:X:X
Compressed Representation
-
If a group of consecutive zeros is included in the address, it can be replaced with a double colon "::".
For example,
FC00:0:130F:0:0:9C0:876A:130B
can be written asFC00:0:130F::9C0:876A:130B
Note:
-
The number of 0s represented by "::" must be maximized;
Incorrect example:
FC00:0:130F:0:0:9C0:876A:130B
cannot be written asFC00:0:130F::0:9C0:876A:130B
-
"::" cannot represent only one group of all zeros;
Incorrect example:
FC00:1:130F:0:1:9C0:876A:130B
cannot be written asFC00:1:130F::1:9C0:876A:130B
-
If multiple consecutive groups of all zeros have the same length, the representation must include the one at the front.
Incorrect example:
FC00:0:130F:0:0:9C0:0:0
cannot be written asFC00:0:130F:0:0:9C0::
-
-
Leading zeros can be omitted.
For example,
FC00:0000:130F:0000:0000:09C0:876A:130B
can be written asFC00:0:130F:0:0:9C0:876A:130B
Address Structure
An IPv6 address can be divided into the following two parts:
- Network Prefix: n bits, equivalent to the network ID in an IPv4 address
- Interface Identifier: 128-n bits, equivalent to the host ID in an IPv4 address
The representation is like FF00::/8
representing address/prefix length
The interface identifier can be generated in three ways: manual configuration, software-generated by the system, or generated according to the IEEE EUI-64 specification. Among them, the EUI-64 specification is the most commonly used for automatic generation.
Address Classification
-
Unicast Address
One-to-one
Common unicast addresses
-
Unspecified Address
::/128
This address can indicate that an interface or node does not have an IP address yet and can be used as the source IP address for certain packets.
-
Loopback Address
::1/128
It is the local address.
-
Global Unicast Address: with a global unicast prefix, the first 3 bits of the assigned global routing prefix are
001
IPv6 addresses with a global unicast prefix have a similar function to public addresses in IPv4.
-
Link-Local Address: uses a specific link-local prefix
FE80::/10
Link-local addresses are a type of address in IPv6 with limited application scope and can only be used between nodes connected to the same local link.
-
Unique Local Address: the prefix is fixed as
FC00::/7
It is also a type of address with limited application scope and can only be used within a site, similar to private addresses in IPv4.
-
-
Multicast Address
IPv6 multicast is the same as IPv4, used to identify a group of interfaces, generally belonging to different nodes.
The prefix of an IPv6 multicast address is
FF00::/8
- Flags are used to identify the identity of the multicast address
- Scopes are used to limit the range of multicast data flow sent in the network
- Group ID identifies the multicast group
-
Anycast Address
Anycast addresses identify a group of network interfaces (usually belonging to different nodes). A data packet with a destination address that is an anycast address will be sent to the network interface that is closest in terms of routing. It is mainly used to provide redundancy and load balancing functionality when providing the same service to multiple hosts or nodes.
Note: IPv6 anycast addresses can only be assigned to routing devices and cannot be applied to hosts. An anycast address cannot be used as the source address of an IPv6 packet.
Here is a summary of the common IPv6 addresses that can be present on an interface of an IPv6 host