# Protocols

> CIE A-Level Computer Science · 9618
> Source: https://www.owlsprep.com/study/cie-9618-u2-protocols/

This sub-topic covers the core purpose of network protocols, layered protocol operation, and common protocols across the TCP/IP stack. You will learn how protocols enable standardized communication and key differences between popular internet protocols.

**Prerequisites:** [Basic TCP/IP layered network models](https://www.owlsprep.com/study/cie-9618-u2-network-models/)

## Learning objectives

- Explain the core purpose and function of network protocols
- Classify common protocols by their layer in the TCP/IP stack
- Compare and contrast properties of TCP and UDP, and their use cases
- Describe the function of common application layer protocols
- Explain layered protocol operation and encapsulation

## Core Principles of Network Protocols

Networks connect heterogeneous devices from different manufacturers, running different operating systems and software. Without shared standard rules, devices cannot interpret data received from each other. Protocols solve this by standardizing all aspects of network communication.

**Network Protocol** — A formal, vendor-agreed set of rules that govern all stages of data communication: data formatting, transmission order, error checking, connection setup/teardown, and interpretation of received data.

**Worked example:** A home router receives a data frame from a new laptop, but cannot recognize the frame's format. How do protocols prevent this issue from occurring in functional networks?

1. This error occurs because the sending laptop and receiving router are not following the same rules for structuring data. Without a standard, the router cannot extract the destination address or payload from the frame.
2. Protocols prevent this by enforcing vendor-independent common standards. Both devices implement the same agreed protocol, so the router knows where to find the destination address, what type of payload it carries, and how to check for corruption.

> **tip**
>
> Always mention standardization as a core purpose of protocols. This is a common 1-mark question in Paper 1.

> **Exam tip:** Never forget to mention that protocols enable interoperability between different devices and vendors.

## Transport Layer Protocols: TCP vs UDP

The transport layer provides end-to-end communication between applications on different hosts. The two core transport protocols in TCP/IP are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol), with very different properties and use cases.

**Comparing methods**

Comparison of core properties:

- **TCP** — Connection-oriented, performs three-way handshake to establish a connection, guarantees delivery of all data, retransmits lost packets, reorders out-of-sequence packets, provides flow control.
  - Pros: Full reliability, ordered delivery, built-in error correction
  - Cons: Higher overhead, higher latency due to handshake and retransmissions

- **UDP** — Connectionless, no handshake required, sends independent datagrams, no guarantee of delivery, no reordering or retransmission of lost packets.
  - Pros: Very low overhead, minimal latency, no connection setup delay
  - Cons: No reliability, packets may be lost or arrive out of order

**Worked example:** A developer is building a live interactive video call application. Should they use TCP or UDP for the video stream? Justify your answer.

1. Live video calls require very low latency to maintain real-time interaction. A small amount of lost video data is acceptable, as lost frames can be skipped without breaking the user experience.
2. TCP is unsuitable here because it will retransmit lost packets, causing delays and buffering that disrupt the call. The three-way handshake also adds unnecessary overhead.
3. UDP is the correct choice. It has very low latency and minimal overhead, which meets the core requirements of a live real-time application.

> **Exam tip:** You will almost always be asked to compare TCP and UDP in Paper 1, so memorize their properties and common use cases.

## Common Application Layer Protocols

Application layer protocols define rules for communication between end-user applications. Each uses a specific well-known port number to identify itself to the transport layer. The table below lists the most common protocols you need to know for CIE 9618:

| Protocol Name | Full Name | Well-Known Port | Primary Use Case |
| --- | --- | --- | --- |
| HTTP | Hypertext Transfer Protocol | 80 | Unencrypted web page transfer |
| HTTPS | HTTP Secure | 443 | Encrypted secure web communication |
| FTP | File Transfer Protocol | 21 | Transferring files between hosts |
| DNS | Domain Name System | 53 | Translate domain names to IP addresses |
| SMTP | Simple Mail Transfer Protocol | 25 | Sending email between mail servers |

**Worked example:** Explain why HTTPS is required for online banking transactions instead of plain HTTP.

1. Plain HTTP sends all data (including usernames, passwords, and payment details) as unencrypted plain text. Any third party intercepting the network traffic can read this sensitive data easily.
2. HTTPS uses TLS encryption to scramble data in transit. Only the client device and the bank's server can decrypt the data, preventing third-party eavesdropping and tampering with transaction details.
3. This ensures that sensitive financial information remains confidential and cannot be modified in transit, making HTTPS essential for secure online banking.

## Layered Operation and Encapsulation

Protocols operate in a layered stack, where each layer only interacts with the layer directly above and below it. When sending data from a source host to a destination host, data passes down the stack from application to physical layer, with each layer adding its own control header in a process called encapsulation. At the destination, data passes up the stack, with each layer removing the corresponding header (decapsulation) to access the payload.

**Encapsulation** — The process of adding layer-specific control information (a header) to data as it passes down the protocol stack before transmission to the lower layer.

**Worked example:** Describe how an email message is encapsulated as it passes down the TCP/IP stack from your device to the network.

1. 1. Application layer: The email client formats the message according to SMTP rules, and passes the raw message data down to the transport layer.
2. 2. Transport layer: The message is split into smaller segments. A TCP header is added, containing source/destination port numbers, sequence number, and checksum for error checking.
3. 3. Internet layer: Each TCP segment is encapsulated into an IP packet. An IP header is added, containing the source IP address of your device and the destination IP address of the mail server.
4. 4. Link layer: Each IP packet is encapsulated into a network frame. A link layer header is added containing the MAC address of your default gateway and your device's MAC address, before transmission over the physical network.

> **tip**
>
> You do not need to memorize the contents of protocol headers for CIE 9618, only the purpose of encapsulation.

## Common pitfalls

- **Wrong:** Claiming UDP is connection-oriented and TCP is connectionless
  - Why it fails: This is the reverse of the correct definition: TCP requires a handshake to establish a connection, while UDP has no connection state
  - Correct: TCP = connection-oriented, UDP = connectionless
- **Wrong:** Stating HTTPS is a transport layer protocol, rather than an application layer protocol
  - Why it fails: HTTPS is encrypted HTTP, which operates at the application layer, running over TCP
  - Correct: HTTPS is an application layer protocol that provides encrypted web communication
- **Wrong:** Memorizing incorrect well-known ports for common protocols e.g. 80 for HTTPS
  - Why it fails: CIE examiners regularly test knowledge of common ports in 1-mark multiple choice or short answer questions
  - Correct: Learn the core ports: 80 (HTTP), 443 (HTTPS), 21 (FTP), 53 (DNS), 25 (SMTP)
- **Wrong:** Claiming encapsulation occurs when data moves up the protocol stack at the destination
  - Why it fails: Encapsulation is the addition of headers when moving down the stack at the source. Header removal (decapsulation) occurs when moving up the stack
  - Correct: Encapsulation = add headers moving down the sender's stack, decapsulation = remove headers moving up the receiver's stack
- **Wrong:** Claiming TCP is always superior to UDP for all applications
  - Why it fails: TCP's reliability comes with significant overhead and latency that makes it unsuitable for real-time use cases
  - Correct: Choose the protocol based on requirements: TCP for reliability-critical use cases, UDP for low-latency real-time applications

## Cheatsheet

| Protocol Type | Name | Key Properties | Port |
| --- | --- | --- | --- |
| Transport | TCP | Connection-oriented, reliable, ordered | - |
| Transport | UDP | Connectionless, unreliable, low latency | - |
| Application | HTTP | Unencrypted web transfer | 80 |
| Application | HTTPS | Encrypted web transfer | 443 |
| Application | FTP | File transfer between hosts | 21 |
| Application | DNS | Domain → IP translation | 53 |
| Application | SMTP | Sending email | 25 |

## What's next

Understanding protocols is the foundation of all network communication topics in CIE 9618. Protocols underpin every aspect of networking, from local area networks to the global internet, so a solid grasp of their purpose, properties and common examples will help you tackle all subsequent advanced topics. Next, you will explore how IP addressing works, how data is routed between different networks, and how network security relies on correctly implemented protocols. The knowledge of TCP/IP protocols you gained here is also essential for understanding common network security threats and how to mitigate them, a key topic for both Paper 1 and Paper 2.

- [Wireless networking](https://www.owlsprep.com/study/cie-9618-u2-wireless-networking/)
- [Internet technologies](https://www.owlsprep.com/study/cie-9618-u2-internet-technologies/)
- [Circuit and packet switching](https://www.owlsprep.com/study/cie-9618-u2-circuit-and-packet-switching/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/cie-9618-u2-protocols/
