TCP/IP — AQA A-Level Computer Science
The TCP/IP stack is a modular four-layer communication protocol suite (Application, Transport, Network, Link) governing data transmission across networks. It standardises packet encapsulation, end-to-end addressing, logical routing, and error checking to ensure reliable cross-platform interoperability.
TCP/IP explained
The TCP/IP stack organises network communication into four layers, each with a distinct job.
Read the full explanation
The application layer holds the protocols that user programs use directly, such as HTTP for web pages, SMTP for email and FTP for file transfer. The transport layer, using TCP or UDP, moves data between two applications on different hosts, adding port numbers so the correct program receives each message; TCP adds reliability through acknowledgements and retransmission. The network layer, using IP, addresses hosts and routes packets across interconnected networks from source to destination. The link layer carries packets across a single physical connection or local network segment, handling framing and addressing within that segment, for example through Ethernet or Wi-Fi.
Your focus
- Describe the role of the four layers of the TCP/IP stack (application, transport, network, link).
Which command word is this?
Set out the mathematical or logical reasons for how something happens. You must link cause to effect rather than simply defining terms.
TCP/IP exam tips
Topic Overview
The TCP/IP stack is the fundamental communication framework that underpins the global internet and modern computer networks. It provides an abstract, modular architecture consisting of four discrete layers (Application, Transport, Network, and Link), each tasked with specific communication protocols and boundaries.
Understanding TCP/IP is essential for AQA A-Level Computer Science, as it connects theoretical data structures to physical transmission systems. Mastery of this model equips students to analyse network vulnerabilities, routing behaviours, data integrity mechanisms, and socket-level programming interfaces.
Key Concepts
- →Four-Layer Model: Application (protocols like HTTP, FTP, SMTP, DNS), Transport (TCP, UDP), Network/Internet (IP), and Link/Network Interface (Ethernet, Wi-Fi).
- →Encapsulation and Decapsulation: Wrapping higher-layer PDUs with layer-specific headers (and Link trailers) during transmission and stripping them sequentially upon receipt.
- →Sockets and Port Numbers: Combining an IP address with a 16-bit port number to establish a unique identifier for a specific communicating application process.
- →Packet Switching: Dividing data into independent packets tagged with IP addresses and sequence numbers to allow dynamic path selection through routers.
- →Transmission Control: TCP uses a three-way handshake (SYN, SYN-ACK, ACK), checksums, windowing, and timeouts to guarantee ordered and lossless data delivery.
Marking Points
- Identifies the application layer as the layer that provides protocols used directly by user programs
- Identifies the transport layer as responsible for end-to-end delivery between applications using ports
- Identifies the network layer as responsible for logical addressing and routing packets across networks
- Identifies the link layer as responsible for transferring frames across a single physical link or local network
Examiner Tips
- 💡Use the layer names exactly as given in the specification when labelling a diagram or answering an MCQ
- 💡Link each layer to one key example protocol to make recall faster, such as HTTP, TCP, IP and Ethernet
- 💡When a question gives a function, ask which layer owns it: addressing across networks points to IP, while delivery between applications points to TCP or UDP
- 💡Memorise standard port numbers specified by AQA: 20/21 (FTP), 22 (SSH), 25 (SMTP), 53 (DNS), 80 (HTTP), and 443 (HTTPS). Questions frequently award a mark for matching a protocol to its default port.
- 💡In 6-mark or 9-mark extended answers about data movement, always list the layers in strict order (top-to-bottom or bottom-to-top) and name the protocol data unit at each stage: Data, Segment, Packet, Frame, Bits.
- 💡Distinguish clearly between routing and forwarding: Routing determines the optimal end-to-end path across networks using algorithms, while forwarding moves a packet from an input interface to an output interface within a single router.
Common Mistakes
- Assigns routing to the transport layer; route packets across networks at the network layer using IP addresses
- Confuses port numbers with IP addresses; ports identify applications at the transport layer, while IP addresses identify hosts at the network layer
- Places the physical transmission of bits in the network layer; the link layer, together with the hardware it controls, handles transfer over the physical link
- Assuming routers read and alter Application or Transport layer data: Standard routers operate strictly up to the Network layer (Layer 3) to inspect IP headers for routing; they do not process port numbers or application payloads.
- Believing MAC addresses travel across the entire internet: A destination MAC address changes at every router hop on the path, whereas the destination IP address remains constant from source to destination.
- Confusing TCP and IP roles: Students often state that IP guarantees delivery; IP is entirely best-effort and connectionless, while TCP handles error detection, sequencing, and reliable delivery.
Revision Plan
- 1Day 1-2: Map out the 4-layer TCP/IP stack on flashcards, listing the purpose, protocols, and data structures (segments, packets, frames) for each layer.
- 2Day 3-4: Practise socket addressing, mapping default port numbers to protocols, and tracing how packets cross subnets via default gateways.
- 3Day 5-6: Diagram the encapsulation/decapsulation pipeline and compare TCP against UDP using past paper scenario-based questions.
- 4Day 7: Complete timed AQA past-paper questions focusing on 6-mark protocol comparison and packet-switching analysis.
Exam Question Types
- 📋Layer identification and role description: Short 2-3 mark questions asking to name which layer performs a specific task (e.g., error detection or port addressing).
- 📋Extended comparison response: 4-6 mark questions contrasting TCP vs UDP, or circuit switching vs packet switching in given application contexts.
- 📋Data transmission trace: Step-by-step description of an end-to-end exchange (e.g., DNS resolution followed by an HTTP GET request).
Command Word Expectations (AQA)
Set out the mathematical or logical reasons for how something happens. You must link cause to effect rather than simply defining terms.
Provide a factual, step-by-step account of a process or system without needing to justify the underlying reasoning.
Identify both similarities and differences between two technologies (e.g., TCP vs UDP), making direct paired comparisons rather than writing isolated paragraphs.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: Explain the process of encapsulation and decapsulation as an HTTP request is transmitted from a client web browser to a web server via the TCP/IP stack. [6 marks]
- 1.Step 1: Identify the role of the Application layer during transmission: The web browser constructs an HTTP GET request containing application-level commands and payload data.
- 2.Step 2: Detail Transport layer encapsulation: The request is passed to the Transport layer (TCP), where it is split into segments; a TCP header containing source/destination port numbers (destination port 80 or 443) and sequence numbers is appended.
- 3.Step 3: Detail Network layer encapsulation: Segments are passed to the Network/Internet layer (IP), which attaches an IP header containing source and destination IP addresses, packaging them into IP packets for routing.
- 4.Step 4: Detail Link layer encapsulation: The packet descends to the Link/Network Interface layer, adding a MAC header (source and next-hop physical MAC addresses) and a frame trailer/checksum to create a frame, then converts it into physical signals/bits.
- 5.Step 5: Explain decapsulation upon receipt: When received by the server, the Link layer checks the frame trailer, strips the MAC header, and passes the packet upwards. The Network layer validates the IP address and strips the IP header.
- 6.Step 6: Conclude with final delivery: The Transport layer verifies sequence numbers/checksums, strips the TCP header, reassembles segments, and directs the raw HTTP payload to the web server process listening on the specified destination port.
Question: Compare TCP and UDP, giving one scenario where UDP is preferred over TCP and explaining why. [4 marks]
- 1.Step 1: Define TCP characteristics: TCP is a connection-oriented protocol that establishes a three-way handshake, ensures reliable delivery via segment acknowledgements, and orders packets using sequence numbers.
- 2.Step 2: Define UDP characteristics: UDP is a connectionless, lightweight protocol with no handshake, no guarantee of delivery, and no automatic retransmission mechanism.
- 3.Step 3: Select an appropriate scenario: Real-time multiplayer video gaming or live VoIP streaming.
- 4.Step 4: Justify the choice: In real-time video or audio streaming, low latency is critical; retransmitting a dropped packet causes buffering delays, and a lost video frame is obsolete by the time it arrives, making UDP high throughput and low overhead preferable.