Sub topic 1
Why Networks Are Layered
Prerequisites
You should know what a computer network and the Internet are. You should also know that data is measured in bits and bytes, and that a communication rate is measured in bits per second. Basic algebra and unit conversion are useful.
The problem layering solves
A network performs many different jobs:
- An application creates a message.
- The sender identifies the destination.
- The message is divided into manageable units.
- Data is placed into frames for a local link.
- Signals travel through copper, fiber, or radio.
- The receiver checks errors and delivers the message to the correct application.
If one protocol had to handle every job, it would become difficult to design, test, and change. A change in radio transmission, for example, should not require rewriting a web browser.
Layering divides networking into levels. Each layer has a focused responsibility and offers a service to the layer above it. The upper layer uses that service without needing to know how the lower layer implements it. This idea is called service abstraction.
How layers cooperate
A layer follows a protocol, which is a set of rules for communicating with its peer layer on another device. For example, two transport-layer implementations may agree on how to identify application data and detect missing pieces.
A layer does not directly call the peer layer across the network. Instead, it passes data downward through local interfaces. The sender's layers add the information needed by their protocols. The receiver's layers process that information and pass the remaining data upward.
This structure provides several benefits:
- Modularity: Each layer can be designed and tested separately.
- Interoperability: Devices from different manufacturers can communicate when they follow the same protocol.
- Reuse: One upper-layer protocol can work over many lower-layer technologies.
- Easier maintenance: A change inside one layer usually affects fewer other components.
- Clear troubleshooting: A failure can be narrowed to a likely layer.
The OSI model is a seven-layer reference model. The Internet mainly uses the TCP/IP model, which groups some OSI functions differently. These models are conceptual tools, not necessarily separate software components in every device.
| Layering idea | Meaning |
|---|---|
| Service | What a layer promises to the layer above |
| Protocol | Rules used by peer entities at the same layer |
| Interface | How adjacent layers exchange data locally |
| Encapsulation | Adding control information as data moves downward |
Common errors and trade-offs
Do not confuse a layer with a physical device. A router mainly performs network-layer forwarding, while a switch mainly performs link-layer forwarding, but real equipment can contain functions from several layers.
Also, layering does not mean perfect isolation. A transport protocol may adjust its behavior based on network delay, and implementations may combine layers for speed. Layering is an organizing model with useful boundaries, not an absolute rule that prevents interaction.
A layered design can add headers and processing overhead. It can also make optimization harder when a decision would be easier with information from several layers. The benefit is usually worth this cost because standardized boundaries make large networks manageable.
Exercise
Why can a web application usually continue working when a network changes from wired Ethernet to Wi-Fi?
Show answer
The application uses an upper-layer service. The link and physical layers can change their protocols and signals while preserving the higher-layer interface.