Networking – Difference between TCP and IP tunnelling

icmpipnetworkingtcptunnel

Can someone please explain in terms of the OSI (or TCP/IP) layers, what is the difference with what goes on when you tunnel IP or TCP, say over the ICMP protocol (although the latter doesnt really latter i dont think) ?

Best Answer

Tunneling is the process in which one layer is encapsulated in the payload of another layer. In the OSI model.

IP Tunneling: Suppose you tunnel an ip packet inside another ip packet. On the left you can see the packet to be encapsulated and on the right this packet is added as payload to another IP packet.

enter image description here

On the receiving end the process is reversed and the payload packet is sent to the higher layers of stack.

IP tunneling can be of many types ip over ip , ip6 over ip , ip over ip6.

In TCP tunneling the same process is done at TCP level.

TCP tunneling is generally used for port forwarding because traffic can be selectively forwarded based on destination port.

Here are some nice articles:

IP Tunneling. http://www.linuxfoundation.org/collaborate/workgroups/networking/tunneling

TCP Port Forwarding: http://www.cyberciti.biz/faq/linux-unix-tcp-port-forwarding/

Related Question