Understanding IPv4 over IPv6 Tunnel Technology

Background

During the later transition phase from IPv4 to IPv6, IPv6 networks have been widely deployed, and IPv4 sites are scattered across IPv6 networks. It is not economical to connect these isolated IPv4 sites with private lines. The common solution is the tunneling technology. With this technology, IPv4 over IPv6 tunnels can be created on IPv6 networks to enable communication between isolated IPv4 sites through IPv6 public networks.

IPv4 over IPv6 Tunnel Header

To ensure the transmission of IPv4 packets over IPv6 networks, append IPv6 headers to IPv4 packets to encapsulate the IPv4 packets into IPv6 packets. Figure 1 shows the standard protocol-defined format of an IPv6 header.

Figure 1 IPv6 header format

Table 1 shows the description of each field in an IPv6 header.

Table 1 Description of each field of an IPv6 header

Field

Description

Value

Version

A 4-bit field indicating the version number of the Internet Protocol

The value is 6 for an IPv6 header.

Traffic Class

An 8-bit field indicating the traffic class of an IPv4 over IPv6 tunnel, used to identify the service class of packets and similar to the ToS field in IPv4

The value is an integer ranging from 0 to 255. The default value is 0.

Flow Label

A 20-bit field used to mark the packets of a specified service flow so that a device can recognize and provide special handling of packets in the flow

The value is an integer ranging from 0 to 1048575. The default value is 0.

Payload Length

A 16-bit field indicating the length of an IPv6 packet excluding the IPv6 header (payload), in bytes

-

Next Header

An 8-bit field indicating the type of header immediately following the IPv6 header

The value is 4 in IPv4 over IPv6 tunnel scenarios.

Hop Limit

An 8-bit field indicating the maximum number of hops along a tunnel, allowing packet transmission termination when routing loops occur on an IPv4 over IPv6 tunnel

The value is an integer ranging from 1 to 255. The default value is 64.

Source Address

A 128-bit field indicating the source IPv6 address of an IPv6 packet

The address is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.

Destination Address

A 128-bit field indicating the destination IPv6 address of an IPv6 packet

The address is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.

Implementation Principle

An IPv4 over IPv6 tunnel is manually configured between two border routers. You must manually specify the source address/source interface and the destination address/destination domain name of the tunnel.

As shown in Figure 2, packets passing through the IPv4 over IPv6 tunnel are processed on border nodes (B and C), and the other nodes (A, D, and intermediate nodes between B and C) are unaware of the tunnel. IPv4 packets are transmitted between A, B, C, and D, whereas IPv6 packets are transmitted between B and C. Therefore, border routers B and C must be able to process both IPv4 and IPv6 packets, that is, IPv4/IPv6 dual protocol stack must be supported and enabled on B and C.

Figure 2 Schematic diagram of an IPv4 over IPv6 tunnel

Figure 2 shows the processing of IPv4 packets along an IPv4 over IPv6 tunnel.

  1. IPv4 packet forwarding: Node A sends an IPv4 packet to node B in which the destination address is the IPv4 address of node D.
  2. Tunnel encapsulation: After B receives the IPv4 packet from A on the IPv4 network, B finds that the destination address of the IPv4 packet is not itself and the outbound interface to the next hop is a tunnel interface. B then adds an IPv6 header to the packet. Specifically, node B encapsulates its own IPv6 address and that of node C into the Source Address and Destination Address fields, respectively, sets the value of the Version field to 6 and that of the Next Header field to 4, and encapsulates other fields that ensure the transmission of the packet along the tunnel as required.
  3. Tunnel forwarding: Node B searches the IPv6 routing table based on the Destination Address field carried in the IPv6 packet header and forwards the encapsulated IPv6 packet to node C. Other nodes on the IPv6 network are unaware of the tunnel and process the encapsulated packet as an ordinary IPv6 packet.
  4. Tunnel decapsulation: Upon receipt of the IPv6 packet in which the destination address is its own IPv6 address, node C decapsulates the packet by removing its IPv6 header based on the Version field and determines the encapsulated packet is an IPv4 packet based on the Next Header field.
  5. IPv4 packet forwarding: Node C searches the IPv4 routing table based on the Destination Address field of the IPv4 packet and forwards the packet to Node D.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic