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 4-1 shows the standard protocol-defined format of an IPv6 header.
Table 4-1 shows the description of each field in 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-bit 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-bit 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 statically specify the source addresses or source interfaces and the target addresses for the tunnel interfaces.
As shown in Figure 4-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 nodes 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 4-2 shows the processing of IPv4 packets along an IPv4 over IPv6 tunnel.
- IPv4 packet forwarding: Node A sends an IPv4 packet to Node B in which the destination address is the IPv4 address of node D.
- Tunnel encapsulation: Upon receipt of the packet from the IPv4 network, node B finds that the destination address of the IPv4 packet is not its own address and the next-hop outbound interface is the tunnel interface. Node B then appends an IPv6 header as shown in Table 4-1 to the IPv4 packet. Node B encapsulates its own IPv6 address and that of node C into the Source Address and Destination Address fields, sets the value of the Version and Next Header fields to 6 and 4, and encapsulates other fields that ensure the transmission of the packet along the tunnel as required.
- 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.
- 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.
- 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.