GCSE Revision Aid: This resource is designed to support your revision and may contain errors. If you find a discrepancy with your class teaching, your teacher is correct β please let us know at gcserevise@scott.scottrix.co.uk.
CS31: TCP/IP Model
FoundationHigherAQAEdexcelOCREduqasNetworks
The four layers of the TCP/IP model, the function of each layer, and how data is encapsulated and passed between layers.
π What is the TCP/IP Model?
Definition: The TCP/IP model is a conceptual framework that describes how data is transmitted over a network. It divides network communication into four layers, each with a specific role. Data passes down through the layers when being sent, and up through the layers when being received.
The TCP/IP model is the foundation of all internet communication. It was developed by the US Department of Defense and has become the standard model for network communication. Each layer handles a different aspect of getting data from one device to another, and the layers work together seamlessly.
The model has 4 layers, each with a specific function
Each layer only communicates with the layer above and below it
Layers can be developed and changed independently
Data is encapsulated as it passes down the layers (headers added)
Data is decapsulated as it passes up the layers (headers removed)
π The Four Layers
Layer Number
Layer Name
Key Protocols
Main Function
4 (Top)
Application
HTTP, HTTPS, SMTP, IMAP, FTP
Provides network services to applications
3
Transport
TCP, UDP
End-to-end delivery and reliability
2
Internet
IP
Addressing and routing across networks
1 (Bottom)
Link
Ethernet, Wi-Fi
Physical transmission on local network
π₯οΈ Layer 4: Application Layer
Function: The application layer provides network services directly to user applications. It is the layer that users interact with most directly. It determines what data is sent and how it is formatted for the application.
Highest layer - closest to the user
Provides the interface between applications and the network
Formats data for the specific application being used
Handles high-level protocols that applications use
Protocols at this layer include: HTTP/HTTPS (web), SMTP/IMAP (email), FTP (file transfer)
Example
When you type a URL into your web browser, the browser uses HTTP (application layer) to format a request for the web page. The application layer doesn't care how the data gets to the server - it just prepares the request in the correct format.
π Layer 3: Transport Layer
Function: The transport layer manages end-to-end communication between two devices. It ensures data is delivered reliably (TCP) or quickly (UDP), breaks data into segments, and handles flow control.
Manages communication between sending and receiving devices
Breaks large data into smaller segments for transmission
Numbers segments so they can be reassembled in order
TCP provides reliable delivery with acknowledgements
UDP provides fast delivery without guaranteed reliability
Adds port numbers to identify which application should receive the data
TCP: Downloading a file - every byte must arrive correctly, so reliability matters more than speed.
UDP: Live video call - a few dropped frames are acceptable, but delay (latency) is very noticeable, so speed matters more than guaranteed delivery.
πΊοΈ Layer 2: Internet Layer
Function: The internet layer handles addressing and routing of data packets across networks. It adds IP addresses to identify the source and destination, and determines the best route for packets to take across interconnected networks.
Adds source and destination IP addresses to packets
Routers operate at this layer - they read IP addresses to forward packets
Determines the best path (route) for data across networks
Packets may take different routes to reach the same destination
Handles IPv4 and IPv6 addressing
Does not guarantee delivery (that's TCP's job at the transport layer)
Example
When you send data from London to Tokyo, the internet layer adds the destination IP address and routers at each network junction read this address to decide where to forward the packet next. The packet may pass through many routers, each making a forwarding decision based on the IP address.
π Layer 1: Link Layer
Function: The link layer handles the physical transmission of data on a local network segment. It is responsible for getting data from one device to the next on the same network, using MAC addresses and physical media.
Lowest layer - closest to the physical hardware
Handles transmission on the local network (same network segment)
Adds MAC addresses for device identification on the local network
Converts data into signals (electrical, radio, light) for transmission
Handles error detection at the physical level
Technologies: Ethernet (wired), Wi-Fi (wireless)
Example
When your laptop sends data over Wi-Fi, the link layer converts the data into radio waves transmitted through the air. When data arrives at your router via an Ethernet cable, the link layer converts the electrical signals back into data and passes it up to the internet layer.
π¦ Encapsulation
Definition: Encapsulation is the process where each layer adds its own header (control information) to the data as it passes down the layers. When data is received, each layer removes its header (decapsulation) as it passes up the layers.
Sending Data (Down the Layers)
Application layer: Creates the data (e.g. HTTP request) and passes it down
Transport layer: Adds transport header (port numbers, sequence numbers) β creates a segment
Internet layer: Adds IP header (source and destination IP addresses) β creates a packet
Link layer: Adds frame header (MAC addresses) and trailer (error checking) β creates a frame
Receiving Data (Up the Layers)
Link layer: Removes frame header/trailer, passes packet up
Internet layer: Removes IP header, passes segment up
Transport layer: Removes transport header, passes data up
Application layer: Receives the data (e.g. displays the web page)
Encapsulation Example
Sending a web page request:
1. Application: HTTP request data "GET /index.html"
4. Link: [Frame header | IP header | TCP header | HTTP data | Frame trailer] = frame
Each layer wraps the data from the layer above with its own header information.
Encapsulation Summary:
Application: creates DATA
Transport: adds port/sequence β SEGMENT
Internet: adds IP addresses β PACKET
Link: adds MAC addresses + error check β FRAME
Each layer adds a header; the link layer also adds a trailer
β οΈ Common Mistakes to Avoid
Mistake
Why It's Wrong
How to Fix It
Confusing layer order
Application is the TOP, Link is the BOTTOM
Remember: Application (4) > Transport (3) > Internet (2) > Link (1)
Saying IP works at the link layer
IP works at the Internet layer (it's in the name!)
Internet Protocol = Internet layer
Forgetting encapsulation includes both headers AND trailer
The link layer adds a frame trailer for error checking
Link layer = header + data + trailer
Confusing MAC and IP addresses
MAC = link layer (local); IP = internet layer (global)
MAC = hardware address (local network); IP = logical address (across networks)
Saying UDP is unreliable so it's never used
UDP is chosen deliberately for speed-critical applications
UDP is appropriate for streaming, gaming where speed > reliability
β Practice Questions
Q1: Name the four layers of the TCP/IP model from top to bottom and state the main function of each.
Q2: Explain the difference between TCP and UDP at the transport layer. Give an example of when each would be used.
Q3: Describe the process of encapsulation as data is sent down the layers.
Q4: Which layer of the TCP/IP model handles routing of data across networks? Which protocol operates at this layer?
Q5: Explain why the TCP/IP model uses layers rather than having a single protocol handle everything.
β Answers
Application (top): provides network services to applications (HTTP, SMTP). Transport: manages end-to-end delivery, reliability, and segmentation (TCP, UDP). Internet: handles addressing and routing across networks (IP). Link (bottom): handles physical transmission on the local network (Ethernet, Wi-Fi).
TCP is connection-oriented, reliable (uses acknowledgements and resends lost data), and ordered. UDP is connectionless, unreliable (no guarantees), and faster. TCP is used for web browsing and email where all data must arrive. UDP is used for live video streaming and online gaming where speed matters more than perfect delivery.
Encapsulation: the application layer creates data and passes it down. The transport layer adds a header with port numbers (creating a segment). The internet layer adds an IP header with source and destination addresses (creating a packet). The link layer adds a frame header with MAC addresses and a frame trailer for error checking (creating a frame). Each layer wraps the data from above with its own control information.
The Internet layer handles routing of data across networks. The Internet Protocol (IP) operates at this layer, adding source and destination IP addresses to packets and determining the best route for them.
Layers allow each aspect of communication to be developed independently. A change at one layer (e.g. switching from Wi-Fi to Ethernet at the link layer) doesn't affect other layers. Layers make the model modular, easier to understand, and allow different technologies to work together. Without layers, a single protocol would need to handle everything from physical signals to application formatting, which would be extremely complex.
π― Exam Tips
Know all four layers in order: Application, Transport, Internet, Link
Be able to name the key protocol(s) at each layer
Understand encapsulation: each layer adds a header going down, removes it going up
Know when TCP vs UDP is appropriate (reliability vs speed)
Remember: IP = Internet layer, HTTP/SMTP = Application layer, Ethernet/Wi-Fi = Link layer
The link layer is the ONLY layer that adds a trailer (for error checking)
β οΈ Common Errors
β Confusing the TCP/IP model with the OSI modelβ TCP/IP has 4 layers (Application, Transport, Internet, Link). OSI has 7 layers. TCP/IP is the practical model used on the internet; OSI is the theoretical reference model.
β Thinking data is sent as a single block across the networkβ Data is broken into packets, each with headers containing source/destination IP, port numbers, and sequence numbers. Packets may take different routes and are reassembled at the destination.
β Forgetting that each layer adds its own header to the packetβ As data passes down the layers, each layer encapsulates it with its own header (Application β Transport β Internet β Link). At the destination, each layer strips its header going back up.
β Believing the Internet layer handles physical transmissionβ The Internet layer handles logical addressing (IP addresses) and routing. The Link layer handles the actual physical transmission over the network medium (Ethernet frames, WiFi signals).
βοΈ Model Answer
Full-Mark Response
Describe the four layers of the TCP/IP model, explaining the role of each layer and giving one protocol that operates at each layer. [4 marks]
Application layer: Provides the interface for user applications and handles high-level protocols. Formats data for the user and manages application-level communication. Protocol: HTTP (web browsing).
Transport layer: Manages end-to-end communication between applications, ensuring data is delivered reliably or quickly depending on the protocol. Handles port addressing and error checking. Protocol: TCP (reliable delivery with error checking).
Internet layer: Handles logical addressing (IP addresses) and routing of packets across networks. Determines the best path for data to travel from source to destination. Protocol: IP (Internet Protocol for addressing and routing).
Link layer: Manages physical transmission of data over the network medium. Handles hardware addressing (MAC addresses), framing, and error detection at the physical level. Protocol: Ethernet (wired LAN transmission).
π AO Deep Dive
Assessment Objective Analysis
AO1 (Computational Thinking β 40%): Demonstrate knowledge and understanding of the principles and concepts of computer science, including the TCP/IP model and its four layers for AQA 8525, OCR J277 & Edexcel 1CP2.
AO2 (Application β 40%): Apply knowledge and understanding of computer science, including the TCP/IP model and its four layers to analyse problems in computational terms and to design, write and evaluate solutions.
AO3 (Evaluation β 20%): Evaluate the effectiveness, correctness and efficiency of computational solutions, including the TCP/IP model and its four layers, and make reasoned judgements about trade-offs.
π Exam Technique
GCSE Computer Science Exam Tips:
4 TCP/IP layers (top to bottom): Application β Transport β Internet β Link. Each layer has a specific role and uses specific protocols. Data is encapsulated going down, decapsulated going up. Packets contain headers from each layer. Application = user interface, Transport = delivery, Internet = routing, Link = physical. Know which protocols belong to which layer.