About IPv4 over IPv4 tunneling
IPv4 over IPv4 tunneling (RFC 1853) enables isolated IPv4 networks to communicate. For example, an IPv4 over IPv4 tunnel can connect isolated private IPv4 networks over a public IPv4 network.
Figure 91: IPv4 over IPv4 tunnel
Figure 91 shows the encapsulation and de-encapsulation processes.
Encapsulation:
Device A receives an IP packet from an IPv4 host and submits it to the IP protocol stack.
The IPv4 protocol stack determines how to forward the packet according to the destination address in the IP header. If the packet is destined for the IPv4 host connected to Device B, Device A delivers the packet to the tunnel interface.
The tunnel interface adds a new IPv4 header to the IPv4 packet and submits it to the IP protocol stack.
In the new header, the source IP address specifies the tunnel source, and the destination IP address specifies the tunnel destination.
The IP protocol stack uses the destination IP address of the new IP header to look up the routing table, and then sends the packet out.
De-encapsulation:
After receiving the packet, Device B delivers it to the IP protocol stack.
If the protocol number is 4 (indicating an IPv4 packet is encapsulated within the packet), the IP protocol stack delivers the packet to the tunnel module for de-encapsulation.
The tunnel module de-encapsulates the IP packet and sends it back to the IP protocol stack.
The protocol stack forwards the de-encapsulated packet.