The TCP/IP model has four layers: application, transport, internet, and network interface. Together, they describe how data is prepared, addressed, transmitted across networks, and delivered to the correct application.
Functions of the four layers
| Layer | Main function | Examples |
|---|---|---|
| Application | Provides network services directly to user applications and specifies how application data is exchanged. | HTTP/HTTPS, DNS, SMTP, FTP |
| Transport | Provides end-to-end communication between processes. It may provide reliability, sequencing, flow control, and error recovery. | TCP, UDP, port numbers |
| Internet | Addresses and routes packets between networks so they can reach the destination device. | IP, IP addresses, routers |
| Network interface | Transfers data over the local physical network and controls access to the transmission medium. | Ethernet, Wi-Fi, MAC addresses, frames |
When data is sent, it moves down the model through encapsulation. Each layer adds control information required to perform its function.
- The application layer creates the data, such as an HTTP request.
- The transport layer adds a TCP or UDP header, including source and destination port numbers. The resulting unit is commonly called a segment for TCP or datagram for UDP.
- The internet layer adds an IP header containing source and destination IP addresses, creating an IP packet.
- The network interface layer places the packet inside a frame, adding information such as local MAC addresses before transmitting it as signals or bits.
At the receiving device, decapsulation reverses this process. Each layer reads and removes its relevant header before passing the remaining data upward.
A common misconception is that TCP/IP has seven layers. The seven-layer model is the OSI model; TCP/IP uses four layers, with several OSI functions combined.
Exam technique
For an IB Computer Science HL response, state the layers in the correct order and connect each one to its function, addressing type, protocol, and protocol data unit. If asked to explain transmission, describe encapsulation and decapsulation rather than merely listing the layers.