How IPv6 works in the Internet

How IPv6 works in the Internet

[[342618]]

This article is reprinted from the WeChat public account "Cisco CCIE Club", the author is Lao Yang. Please contact the Cisco CCIE Club public account to reprint this article.

How IPv6 works in the Internet

Now it's time to explore the details of IPv6. First, we'll describe how addresses are assigned to hosts and how hosts find other hosts and resources on the network.

We will also demonstrate automatic addressing of devices (stateless autoconfiguration) and another type of autoconfiguration (stateful autoconfiguration). Remember that stateful autoconfiguration uses a DHCP server, much like in IPv4.

Automatic Configuration

Autoconfiguration is a useful solution that allows devices in a network to assign themselves link-local unicast addresses and global unicast addresses. It is done by first obtaining the previous information from the router and then using the device's own interface address as the interface ID.

But how is the interface ID obtained? As we all know, each device in Ethernet has a MAC address, which is used as the interface ID. However, the interface ID in the IPv6 address is 64 bits long, while the MAC address is only 48 bits. How do the extra 16 bits come from? Insert extra bits in the middle of the MAC address, namely FFFE.

For example, suppose the MAC address of the device is 0060:d673:1987. After inserting FFFE, the result is 0260:d6FF:FE73:1987. Why did the leading 00 become 02? Good idea. The modified EUI-64 (Extended Unique Identifier) ​​format is used when inserting, which uses the 7th bit to identify whether the address is locally unique or globally unique. If this bit is 1, it means that the address is globally unique, and if it is 0, it means that the address is locally unique. In this example, is the final address globally unique or locally unique?

The correct answer is globally unique. Automatic configuration saves addressing time because the host only needs to communicate with the router to complete the work.

To accomplish automatic configuration, the host performs two steps.

(1) First, to configure the interface, the host needs prefix information (similar to the network part of an IPv4 address), so it sends a Router Solicitation (RS) message. This message is sent to all routers in a multicast manner. This is actually an ICMP message and is identified by a number. The ICMP type of the RS message is 133.

(2) The router responds with a router advertisement (RA) containing the requested previous information. RA messages are also multicast packets and are sent to a multicast address representing all nodes. Their ICMP type is 134. RA messages are sent periodically, but after a host sends an RS message, it can get a response immediately, so it does not need to wait for the next regularly sent RA message to obtain the required information.

Figure 15-2 illustrates these two steps.

By the way, this type of autoconfiguration is called stateless autoconfiguration because no further contact with other devices is required to learn additional information. We will introduce stateful autoconfiguration later when we discuss DHCPv6.

Router Configuration IPv6

Let's take a look at how to configure IPv6 for your router.

To enable IPv6 on a router, you must use the global configuration command ipv6 uni cast-routing:

  1. Corp(config)#ipv6 unicast-routing

By default, the ability to forward IPv6 traffic is disabled, so you need to enable it using the above command. Also, as you might guess, IPv6 is not enabled on any interface by default, so you must go into each interface and enable it.

There are many ways to do this, but the simplest way is to use the command 1pv6 address / [eui -64] Assign an address to the interface.

Here is an example:

  1. Corp(config-if)#ipv6 address 2001 :db8: 3c4d:1:0260:d6FF .FE73:1987/64

You can specify a full 128-bit IPv6 global address (as in the previous example), or you can use the eui-64 option. The eui-64 format allows the device to translate its MAC address to generate the interface ID, as shown below:

  1. Corp(config-if)#ipv6 address 2001:db8:3c4d:1::/64 eui-64

To enable IPv6 on a router interface, you can also let it automatically use a link-local address instead of entering an IPv6 address.

Note: If you only have a link-local address, you can only communicate within the local subnet.

To configure the router interface to use only link-local addresses, use the interface configuration command ipv6 enable:

  1. Corp(config-if)#ipv6 enable

Next, we configure a DHCPv6 server to explore stateful autoconfiguration.

DHCPv6

DHCPv6 works very similarly to DHCPv4, but with one notable difference: support for the new addressing scheme for IPv6. You may be surprised to learn that DHCP provides some options that autoconfiguration does not. DNS servers, domain names, and the many other options provided by DHCP are not involved at all in autoconfiguration. This is an important reason to use DHCP in most IPv6 networks.

In an IPv4 network, when a client starts up, it will send a DHCP discovery message to find a server that can provide it with the information it needs. But in IPv6, the RS and RA processes occur first. If there is a DHCPv6 server in the network, the RA returned to the client will indicate whether DHCP is available. If no router is found, the client will send a DHCP request message, which is a multicast message with a destination address of f02:1:2, indicating all DHCP agents, including servers and relays.

IOS provides some DHCPv6 support, but it is limited to a stateless DHCP server, which means it does not provide address pool management capabilities, and the configurable options are limited to DNS, domain name, default gateway, and SIP server.

This means that additional servers need to be provided, if necessary, to provide all the necessary information and manage the address allocation.

ICMPv6

IPv4 uses ICMP for many things, such as error messages like destination unreachable and diagnostic functions like ping and traceroute.

ICMPv6 also provides these functions, but the difference is that it is not an independent layer 3 protocol. ICMPv6 is an integral part of IPv6, and its information is contained in the extension header after the basic IPv6 header. ICMPv6 adds a new feature: by default, IPv6 can avoid packet fragmentation through the ICMPv6 process "Path MTU Discovery".

The path MTU discovery process works as follows: The source node sends a packet whose length is the MTU of the local link. On the way to the destination, if the MTU of the link is smaller than the length of the packet, an intermediate router sends a message to the source node saying "Packet Too Big". This message tells the source node the maximum packet length supported by the current link and asks the source node to send a small packet that can traverse the link. This process continues until the destination is reached, at which point the source node knows the MTU of the transmission path. Next, when transmitting other data packets, the source node will ensure that the packets are not fragmented.

ICMPv6 takes over the task of discovering the addresses of other devices on the local link; in IPv4, this task was handled by the Address Resolution Protocol, but ICMPv6 renamed this protocol as Neighbor Discovery. This process is done using a multicast address called the solicited nodeaddress, which each host joins when it connects to the network. To generate the solicited nodeaddress, add the last 24 bits of the target host's IPv6 address to the end of FF02:0:0:0:0:1:FF/104. When the solicited nodeaddress is queried, the corresponding host will return its Layer 2 address. Network devices also discover and track neighboring devices in a similar manner. When introducing the RA and RS messages, we mentioned that they use multicast to request and send address information, which is also the neighbor discovery function of ICMPv6.

In IPv4, a host uses the IGMP protocol to tell the local router that it wants to join a specific multicast group and receive data streams sent to that multicast group. This IGMP function has been replaced by ICMPv6 and renamed multicast listener discovery.

<<:  Latest report: Is 5G private network a hero or a monster?

>>:  Can operators make money without doing anything?

Recommend

Build an HTTP experimental environment by yourself

[[326829]] This is the last lecture of the "...

An automation-first approach to network predictability

An automation-first approach is one of the most e...

Four waves, closing the TCP connection

[[428968]] This article is reprinted from the WeC...

Huawei's Hu Houkun: Make Hongmeng and Euler into important social resources

On November 20, the 2021 China 5G+ Industrial Int...

What exactly is 5G Open RAN?

Traditionally, the proprietary network equipment ...

Revolutionizing Connectivity: Benefits of Power over Ethernet Solutions

Revolutionizing Connectivity: The Untold Benefits...

A brief analysis of the technical difficulty of "number portability"

According to the Ministry of Industry and Informa...

After 5G, there will be no more "operators", what do you think?

As the name implies, the core capability of opera...