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).

Application layer HTTP · HTTPS · SMTP · IMAP  |  web browsers, email clients Transport layer TCP  |  sets up connection · packet size · error checking Internet layer IP  |  addresses and packages data · routes packets Link layer NIC · device drivers  |  physical transmission sending receiving

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.

Protocol Placement Summary

LayerProtocolsMain function
ApplicationHTTP, HTTPS, SMTP, IMAPNetwork applications - web and email
TransportTCPReliable delivery, packet size, error checking
InternetIPAddressing 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.