Sub topic 2
The OSI and TCP/IP Models Layer by Layer
Assume you know what a computer network is, can distinguish bits from bytes, and can convert rates such as Mbps into bits per second. This chapter uses the OSI model to classify network functions and the TCP/IP model to describe the Internet in practice.
Why use layers?
A network layer is a group of related responsibilities. Each layer provides a service to the layer above it and uses the layer below it. This separation lets engineers replace one technology without redesigning the entire network.
For example, an application does not need to know whether data travels through copper, fiber, or radio. The lower layers hide those details behind standard services.
The seven OSI layers
The OSI model is a reference model with seven layers. From highest to lowest:
| Layer | Main responsibility | Common examples |
|---|---|---|
| 7. Application | Services directly used by network applications | HTTP, DNS, SMTP |
| 6. Presentation | Data format, encryption, and compression | TLS, character encoding |
| 5. Session | Starts, manages, and ends communication sessions | Dialog control, checkpoints |
| 4. Transport | End-to-end delivery, reliability, and flow control | TCP, UDP |
| 3. Network | Logical addressing and routing between networks | IP, routers |
| 2. Data link | Framing and delivery across one local link | Ethernet, Wi-Fi, switches |
| 1. Physical | Sends raw bits as electrical, optical, or radio signals | Cables, radio, connectors |
The application layer represents network services from the program's viewpoint. The presentation layer handles differences in data representation. The session layer manages a continuing exchange between applications. Modern Internet protocols often combine these three functions, so they are less visible as separate layers.
The transport layer identifies processes using port numbers. TCP provides reliable, ordered delivery with congestion and flow control. UDP provides a simpler, connectionless service without built-in reliability.
The network layer moves packets across multiple networks. IP addresses identify endpoints and routers choose the next hop. The data-link layer moves frames between nodes on the same link using addresses such as Ethernet MAC addresses. The physical layer carries the actual signal.
TCP/IP model and OSI mapping
The TCP/IP model is the practical model used by the Internet. A common version has four layers:
- Application: Combines OSI application, presentation, and session functions.
- Transport: Corresponds mainly to the OSI transport layer.
- Internet: Corresponds to the OSI network layer and uses IP.
- Link or network access: Combines OSI data-link and physical functions.
Some textbooks use a five-layer TCP/IP model by separating the link and physical layers. Both descriptions can be correct if the mapping is stated clearly.
How to use the models in questions
First identify the responsibility, then identify the layer. Routing and IP addressing indicate the network or Internet layer. MAC addresses and frames indicate the data-link layer. Port numbers and reliable process-to-process delivery indicate the transport layer.
The models are conceptual boundaries, not strict descriptions of every modern protocol. A protocol can perform functions associated with more than one layer, and an implementation can combine layers internally.
Exercise
Which TCP/IP layer contains the functions of the OSI presentation and session layers, and what is the main role of the Internet layer?
Show answer
The TCP/IP application layer contains those presentation and session functions. The Internet layer provides logical addressing and routes packets between networks.