Why is network communication divided into layers?
EasyConceptOSI & TCP/IP Models
Answer
Layering splits a complex job into smaller, independent tasks. Each layer solves one problem, offers a service to the layer above and uses the service of the layer below, without needing to know how the other layers work inside.
- Modularity: one layer can change without affecting the others. Moving a laptop from Wi-Fi to Ethernet changes only the lower layers; the browser and TCP stay exactly the same.
- Interoperability: vendors can build hardware or software for one layer that works with any standard-compliant product at the other layers.
- Easier troubleshooting: a fault can be narrowed down to a layer, for example "the cable is fine (layer 1) but the laptop has no IP address (layer 3)".
- The cost is some overhead, because every layer adds its own header to the data.
Example: The postal system is layered. You write a letter (application) and put it in an envelope with an address and PIN code (network addressing). The post office sorts it by PIN code (routing), and a van or train physically carries the bag (physical layer). You do not care whether it travels by road or rail, and the van driver never reads the letter; each layer does only its own job.