Networking / Beginners

Why Layers and Encapsulation?

The use of encapsulation seems wasteful: if the original data are small, then the packet on the wire could be mostly headers from the various layers. This is overhead that reduces the effective throughput of the transmission. Surely it is better to just put the data directly into the link layer?

The idea of using layers is for flexibility. Suppose we have a 10Mb network card in our machine and someone comes up with an improved 100Mb card. Because the physical layer is (almost) totally separate from the data link layer, we can just write a new standard for a 100Mb physical layer and slot it in where the old 10Mb one used to be. The upper layers do not even need to know the hardware has changed. Imagine having to rewrite every email program, Web browser and other application each time something changed in the network. This is why we need to separate functionality carefully: the network layer and above should certainly know nothing about what hardware you are using.

In fact, the above example has happened several times: the Internet runs over (amongst many others), 10Mb Ethernet, 100Mb Ethernet, 1Gb Ethernet, 10Gb Ethernet, telephone lines (SLIP and PPP), radio. The user sitting at their terminal has no idea of what is going on beneath them.

In principle you could use carrier pigeons as the physical layer and your browser should work unchanged, apart from a slow-down, maybe.

Tunnelling

Indeed, encapsulation may not stop even at this, the physical layer. For example, there are physical limits on the size of an Ethernet (speed of light problems), so how can we connect up an Ethernet that spans the Atlantic? One way we might do this is to tunnel the Ethernet traffic inside some other kind of network, ATM or SMDS, for example. These protocols can work over long distances.

We simply stuff an Ethernet packet into the ATM network and it pops out the other end to continue in its Ethernet world. The ATM protocol (itself a link layer protocol) is being used as a data link layer. In practice, things are more complicated of course and we tend to tunnel at the network layer level as this is more efficient.

An analogy for layering: suppose you are sending a present to a friend abroad, France say. You wrap the present securely ('encapsulate the present in brown paper'), you address the parcel correctly ('add a header'), and give it to the Post Office. The Post Office puts the parcel on a plane destined for France ('encapsulates it in the plane'). When the plane reaches France, the package is 'de-encapsulated' and it carries on in its journey. When it reaches its destination, your friend de-encapsulates the parcel to discover the present.

[Previous] [Contents] [Next]