6.6.2 How a stack works

A TCP/IP stack works by passing packets up and down from layer to layer. Each layer does something to the packet in order to achieve its allotted purpose. Mostly this involves adding headers to, or stripping headers from, packets.

As a simple analogy, think of what courier services like DHL, FedEx or UPS do when you give them a parcel to deliver. They immediately put it into one of their specially designed envelopes or containers and then send it through their system to its destination. But suppose that for some crazy reason you specified that you wanted DHL, FedEx and UPS to transport your parcel in relays.

First DHL would place the parcel in one of their envelopes and deliver it to FedEx. They would then insert the (DHL) parcel into a FedEx envelope and pass it to UPS who would … well, you get the idea. And when the parcel eventually arrived at its destination, the whole process would go into reverse.

It might help you to understand more fully how TCP/IP works if you look at the following animation. This explains the TCP/IP protocols and, in particular, what happens within the transport and network layers.

This file will not appear on this screen. Click on "launch in separate player" to view.

6.6.1 TCP/IP at the code layer

6.7 The importance of end to end