TCP/IP Protocol Model

What Is a Protocol?

A protocol is a set of rules that governs how data is transmitted between devices on a network. Without agreed protocols, different hardware and software from different manufacturers could not communicate.


Why Layers?

The TCP/IP model divides network communication into four distinct layers. Each layer:

  • Has a specific, independent function
  • Only communicates with the layers directly above and below it
  • Makes hardware/software from different manufacturers interoperable

Data flows down the stack on the sending device (adding information at each layer) and back up the stack on the receiving device (stripping information at each layer).


The Four Layers

Layer 4, Application Layer

  • Handles network-facing applications: web browsers, email clients, FTP clients
  • Protocols: HTTP, HTTPS, FTP, SMTP, DNS
  • Adds application-specific headers to the data

Layer 3, Transport Layer

  • Responsible for establishing communication between devices
  • Splits data into packets and assigns sequence numbers and port numbers
  • Ensures reliable delivery (TCP handles acknowledgements and retransmission)
  • Protocol: TCP (Transmission Control Protocol)
  • Port numbers identify which application the data is destined for

Layer 2, Internet Layer

  • Responsible for routing packets across networks
  • Adds source and destination IP addresses to each packet
  • Routers operate at this layer
  • Protocol: IP (Internet Protocol)
  • Handles the physical connection and hardware
  • Adds source and destination MAC addresses
  • Transmits data over cables or wireless connections
  • Protocols: Ethernet, Wi-Fi

Layer Summary Table

LayerNameKey FunctionProtocolsAddress Added
4ApplicationUser-facing apps; prepares dataHTTP, HTTPS, FTP, SMTPApp headers
3TransportSplit into packets; sequencing; portsTCPPort numbers
2InternetRouting across networksIPIP addresses
1LinkPhysical transmissionEthernet, Wi-FiMAC addresses

Sockets

A socket is the combination of an IP address and a port number:

Socket = IP Address : Port Number
Example: 192.168.1.5 : 443

A socket identifies exactly where data should be delivered, which device and which application on that device.


Encapsulation

As data passes down the stack, each layer wraps the data with additional header information (encapsulation). When it arrives at the destination, each layer strips off its header and passes the remainder up.

Application:  [DATA]
Transport:    [TCP Header][DATA]
Internet:     [IP Header][TCP Header][DATA]
Link:         [MAC Header][IP Header][TCP Header][DATA][MAC Footer]

Exam Questions

Q: Name the four layers of the TCP/IP model.

Application, Transport, Internet, Link.

Q: What is the function of the Transport layer?

It establishes communication between devices, splits data into packets, and adds sequencing information and port numbers to ensure reliable delivery.

Q: Which layer does IP operate at?

The Internet layer.

Q: What is a socket?

A socket is the combination of an IP address and a port number that together identify the specific application and device that should receive data.

Q: Why is the TCP/IP model structured in layers?

Layering reduces complexity and allows different hardware and software from different manufacturers to work together, because each layer performs a specific function independently.


Exam Tip

Know which protocol belongs to which layer: HTTP/FTP = Application; TCP = Transport; IP = Internet; Ethernet/Wi-Fi = Link. This is frequently tested with “which layer does X operate at?”