A technique of internetworking called Tunneling is used when source and destination networks of same type are to be connected through a network of different type. For example, let us consider an Ethernet to be connected to another Ethernet through a WAN as:
The task is sent on an IP packet from host A of Ethernet-1 to the host B of ethernet-2 via a WAN.
Sequence of events:
- Host A construct a packet which contains the IP address of Host B.
- It then inserts this IP packet into an Ethernet frame and this frame is addressed to the multiprotocol router M1
- Host A then puts this frame on Ethernet.
- When M1 receives this frame, it removes the IP packet, inserts it in the payload packet of the WAN network layer packet and addresses the WAN packet to M2. The multiprotocol router M2 removes the IP packet and send it to host B in an Ethernet frame.
Why is this Technique called Tunneling?
In this particular example, the IP packet does not have to deal with WAN, the host A and B also do not have to deal with the WAN. The multiprotocol routers M1 and M2 will have to understand about IP and WAN packets. Therefore, the WAN can be imagined to be equivalent to a big tunnel extending between multiprotocol routers M1 and M2 and the technique is called Tunneling.
Tunneling uses a layered protocol model such as those of the OSI or TCP/IP protocol suite. So, in other words, when data moves from host A to B it covers all the different level of the specified protocol (OSI, TCP/IP, etc.), while moving between different levels, data conversion (encapsulation) to suit different interfaces of the particular layer is called tunneling.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.