TCP/IP model layers
The TCP/IP Model
When data travels across a network, many different tasks must be handled: the application must format the data, a connection must be established, the data must be addressed and routed, and the hardware must physically transmit it. The TCP/IP model organises these responsibilities into four distinct layers, each with a specific role. Every layer adds information to the data as it travels down the stack (on the sending side) and strips it back as it travels up (on the receiving side).
Data travels down through all four layers on the sending device and back up through all four layers on the receiving device.
Each Layer in Detail
Application Layer
The application layer is where network applications operate. This is the layer that users and programs interact with directly. When you open a web browser and type a URL, or press Send in an email client, you are working at the application layer. This layer is responsible for formatting the data and determining what protocol is appropriate for the type of communication.
Protocols operating at this layer:
- HTTP and HTTPS - used by web browsers to request and receive web pages
- SMTP - used to send emails
- IMAP - used to retrieve emails from a server
The application layer passes data down to the transport layer, which handles how it will be reliably delivered.
Transport Layer
The transport layer sets up the communication between the two hosts (the sender and the receiver) and establishes agreed settings for how data will be transferred. This includes agreeing on the size of packets - the chunks that the data will be divided into for transmission. The transport layer ensures that all packets are accounted for, requests retransmission of any that are lost, performs error checking, and reassembles packets in the correct order at the destination.
Protocol operating at this layer:
- TCP (Transmission Control Protocol) - provides reliable, ordered, error-checked delivery of data packets between two hosts
Think of the transport layer as a logistics manager: it takes the data from the application layer and organises the delivery so that everything arrives correctly.
Internet Layer
The internet layer is responsible for addressing and packaging data for transmission, and for routing packets across the network. Each packet is given source and destination IP addresses so that it can be directed from the sending device, through a series of routers, to the correct destination - even if the route spans multiple different networks across the world.
Protocol operating at this layer:
- IP (Internet Protocol) - handles the addressing of packets and their routing from source to destination across interconnected networks
IP does not guarantee delivery or ordering - that is handled by TCP at the transport layer above it. IP's job is simply to get each packet as close to its destination as possible using the most appropriate route available.
Link Layer
The link layer is where the physical network hardware operates. This layer is responsible for the actual transmission of data between two directly connected devices - whether that is over an ethernet cable, a Wi-Fi radio signal, or a fibre optic connection. The link layer handles the physical encoding of data onto the medium and its detection at the other end.
Components at this layer:
- NIC (Network Interface Card) - the physical hardware component that connects a device to a network. Every NIC has a unique MAC address embedded in it.
- OS device drivers - the software that allows the operating system to communicate with the NIC and control its operation
The link layer has no knowledge of the wider network - it only concerns itself with the next immediate hop. Routing across multiple networks is handled by the internet layer above it.
Protocol Placement Summary
| Layer | Protocols | Main function |
|---|---|---|
| Application | HTTP, HTTPS, SMTP, IMAP | Network applications - web and email |
| Transport | TCP | Reliable delivery, packet size, error checking |
| Internet | IP | Addressing packets, routing across networks |
| Link | - | Physical hardware (NIC) and device drivers |
Key Takeaways
- The TCP/IP model has four layers: Application, Transport, Internet, and Link.
- HTTP, HTTPS, SMTP, and IMAP operate at the Application layer; TCP operates at the Transport layer; IP operates at the Internet layer.
- The Link layer contains the NIC hardware and OS device drivers responsible for physical transmission.
- Data travels down all four layers on the sending device and back up through all four on the receiving device - each layer adds or removes its own information.