| Syllabus section (AS & A‑Level) | What the syllabus expects | Covered in these notes? |
|---|---|---|
| 14.1 – Protocols (application layer) | Identify purpose, ports, transport, state‑management and security of HTTP, FTP, POP3, IMAP, SMTP, BitTorrent. | ✓ |
| 13 – Data representation & file organisation (relevant to email & file transfer) | Explain how binary data is encoded for transmission (e.g., MIME, Base‑64). | ✓ (see §5) |
| 15 – System software (socket API, OS networking stack) | Describe how protocols are implemented using sockets and the role of the OS. | ✓ (briefly in §3) |
| 16 – Security | Identify encryption methods (TLS/SSL, FTPS, SFTP, POP3S, IMAPS, STARTTLS) and discuss their impact. | ✓ (throughout) |
| 17 – Networks (OSI/TCP‑IP model) | Place each protocol in the correct layer(s) and relate to transport mechanisms. | ✓ (see §3) |
| Programming (Paper 4) | Write, test and evaluate a small program that uses one of the protocols. | ✓ (see §6) |
| OSI layer | TCP‑IP equivalent | Application‑layer protocols covered |
|---|---|---|
| 7 – Application | Application | HTTP, FTP, POP3, IMAP, SMTP, BitTorrent, DNS, SSH |
| 4 – Transport | Transport | TCP (reliable) – used by all except BitTorrent’s DHT (UDP) |
| 3 – Network | Internet | IP (v4/v6) |
| 2 – Data link | Link | Ethernet, Wi‑Fi (IEEE 802.11) |
| 1 – Physical | Physical | Copper, fibre, wireless radio |
All six protocols operate at the **Application layer**; they depend on TCP for reliable delivery (BitTorrent also uses UDP for its Distributed Hash Table).
| Protocol | Purpose | Typical port(s) | Transport | Model | State‑management | Security (default / recommended) |
|---|---|---|---|---|---|---|
| HTTP | Web resource retrieval (HTML, JSON, images …) | 80 / 443 (HTTPS) | TCP | Client‑Server request/response | Stateless per request (cookies optional) | None → HTTPS (TLS) for confidentiality & integrity |
| FTP | Upload & download files | 21 (control) / 20 (active data) or high ports (passive) | TCP (control + data) | Client‑Server (separate channels) | Stateful session (login, cwd, etc.) | None → FTPS (explicit/implicit TLS) or SFTP (SSH) |
| POP3 | Retrieve mail, usually deleting after download | 110 / 995 (POP3S) | TCP | Client‑Server | Stateless after each message retrieval | None → POP3S (TLS) |
| IMAP | Access & manipulate mail stored on a server | 143 / 993 (IMAPS) | TCP | Client‑Server | Stateful (selected mailbox, flags, UID‑validity) | None → IMAPS (TLS) |
| SMTP | Send mail (client‑to‑server & server‑to‑server) | 25 (MX), 587 (submission), 465 (SMTPS) | TCP | Client‑Server (relay) | Stateless per message transaction | None → STARTTLS or SMTPS (TLS) |
| BitTorrent | Distribute large files via a peer‑to‑peer swarm | 6881‑6889 (default) or any high port | TCP (piece exchange) + UDP (DHT, trackerless) | Peer‑to‑Peer (swarm) | Stateful connections to many peers | None → optional protocol‑level encryption or VPN |
GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH.Scenario: An online store must transmit credit‑card details and display product pages.
GET /hello.txt HTTP/1.1 request.requests (or raw socket for extra credit).USER, PASS, CWD, LIST, RETR, STOR, QUIT.QUIT.Scenario: A company needs to upload daily backup files to a remote server.
TYPE I) is suitable.ftplib library.USER → PASS → STAT → LIST → RETR → DELE → QUIT.UIDL is used).Scenario: A mobile device with limited storage needs to download mail once and delete it from the server.
poplib and compare plain vs. TLS connections.a LOGIN …) to allow interleaved responses.Scenario: A user accesses the same email account from a laptop, smartphone and web‑mail.
LOGIN → SELECT INBOX → FETCH 1 … → STORE +FLAGS \Seen → LOGOUT.imaplib to list unread messages.MAIL FROM → RCPT TO → DATA → . → QUIT.STARTTLS, SIZE, 8BITMIME).Scenario: An organisation must send automated invoices to clients over the internet.
STARTTLS to ensure encryption of credentials and message body.MAIL FROM.AUTH LOGIN) and sends a multipart MIME message.smtplib, first without TLS (to see failure on a modern server), then with starttls().Scenario: A university wants to distribute a 2 GB video lecture to 500 students.
GET /index.html HTTP/1.1 Host: www.example.com User-Agent: Mozilla/5.0 Accept: text/html <empty line>
Server response (simplified):
HTTP/1.1 200 OK Date: Sun, 04 Jan 2026 12:00:00 GMT Content-Type: text/html; charset=UTF-8 Content-Length: 1024 <!DOCTYPE html> <html> … </html>
Key points:
\r.Content‑Length or Transfer‑Encoding: chunked.PORT h1,h2,h3,h4,p1,p2 (its IP + high‑port).PASV.227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).Encryption options:
AUTH TLS on the control channel (still port 21).+OK POP3 server ready USER alice +OK password required PASS secret +OK maildrop has 3 messages (12345 octets) STAT +OK 3 12345 LIST +OK 3 messages: 1 4000 2 3500 3 4850 . RETR 1 +OK 4000 octets [message data] . DELE 1 +OK message 1 deleted QUIT +OK goodbye
a LOGIN alice secret b SELECT INBOX c FETCH 2 (FLAGS BODY[HEADER.FIELDS (FROM SUBJECT DATE)]) d STORE 2 +FLAGS \Seen e LOGOUT
Responses are prefixed with the same tag (a, b, …) so the client can match them with commands.
EHLO client.example.com 250‑client.example.com Hello 250‑STARTTLS 250‑AUTH PLAIN LOGIN STARTTLS [TLS handshake] EHLO client.example.com AUTH LOGIN 334 VXNlcm5hbWU6 YWxpY2U= (base64 “alice”) 334 UGFzc3dvcmQ6 c2VjcmV0 (base64 “secret”) 235 2.7.0 Authentication successful MAIL FROM:<alice@client.example.com> 250 2.1.0 OK RCPT TO:<bob@server.org> 250 2.1.5 OK DATA 354 End data with <CRLF>.<CRLF> Subject: Test mail From: Alice <alice@client.example.com> To: Bob <bob@server.org> Hello Bob, This is a test. . 250 2.0.0 OK: queued as 12345 QUIT 221 2.0.0 Bye
request message: piece index, begin offset, length.piece message containing the raw data.Optional encryption (protocol‑level) masks the payload to avoid ISP throttling.
| Aspect | HTTP | FTP | POP3 | IMAP | SMTP | BitTorrent |
|---|---|---|---|---|---|---|
| Primary use | Web page & resource retrieval | File upload/download | Email download (delete after) | Email management on server | Email sending (client‑to‑server & server‑to‑server) | Large‑file distribution via swarm |
| Communication model | Client‑Server request/response | Client‑Server (control + data) | Client‑Server | Client‑Server | Client‑Server (relay) | Peer‑to‑Peer (swarm) |
| State‑management | Stateless per request | Stateful session | Stateless after each download | Stateful (mailbox, flags) | Stateless per message | Stateful connections to many peers |
| Transport | TCP (or TLS over TCP) | TCP (control + data) | TCP | TCP | TCP (STARTTLS/SMTPS optional) | TCP (piece exchange) + UDP (DHT) |
| Typical ports | 80 / 443 | 21 / 20 (active) or high (passive) | 110 / 995 | 143 / 993 | 25 / 587 / 465 | 6881‑6889 (default) or any high port |
| Default security | None → HTTPS (TLS) | None → FTPS / SFTP | None → POP3S (TLS) | None → IMAPS (TLS) | None → STARTTLS / SMTPS (TLS) | None → optional encryption or VPN |
Task: Write a short program that demonstrates a real‑world use of one of the protocols. Choose either HTTP, FTP or SMTP.
import requests
url = 'https://example.com'
response = requests.get(url) # HTTPS → TLS encryption
print('Status:', response.status_code)
print('Headers:', response.headers)
print('Body preview:', response.text[:200])
import ftplib, ssl
host = 'ftp.example.org'
username = 'alice'
password = 'secret'
# Connect in passive mode and enable TLS (FTPS explicit)
ftps = ftplib.FTP_TLS(host)
ftps.login(username, password)
ftps.prot_p() # Switch data channel to TLS
ftps.cwd('/pub')
filename = 'report.pdf'
with open(filename, 'wb') as f:
ftps.retrbinary(f'RETR {filename}', f.write)
ftps.quit()
import smtplib, ssl
from email.message import EmailMessage
msg = EmailMessage()
msg['Subject'] = 'Test invoice'
msg['From'] = 'alice@example.com'
msg['To'] = 'bob@client.org'
msg.set_content('Please find the invoice attached.')
smtp_server = 'mail.example.com'
port = 587 # submission
context = ssl.create_default_context()
with smtplib.SMTP(smtp_server, port) as server:
server.ehlo()
server.starttls(context=context)
server.ehlo()
server.login('alice@example.com', 'secret')
server.send_message(msg)
| Test case | Input | Expected output | Pass/Fail criteria |
|---|---|---|---|
| HTTP – valid URL | https://example.com | Status 200, body contains “” | Pass if status 200 and body preview length > 50 |
| FTP – correct credentials | user/pass, existing file | File saved locally, size matches server | Pass if file size diff < 1 % |
| SMTP – authentication failure | wrong password | SMTP 535 error | Pass if exception raised and error code captured |
socket(), connect(), listen()) underpins all six protocols; OS networking stack handles TCP/UDP multiplexing.| Area of focus | What the syllabus requires | Typical short‑falls in classroom notes | Concrete suggestions to bring the notes into line |
|---|---|---|---|
| Coverage of all required topics | Every sub‑topic listed in the syllabus (e.g., “Binary‑coded decimal”, “Compression”, “Security & privacy”, “Ethics & ownership”, A‑Level extensions such as floating‑point representation, RISC vs CISC, AI – graphs & neural nets, exception handling). | Often only the core protocols are mentioned; peripheral topics like compression or ethical issues are omitted. | Insert a checklist slide at the start of each chapter mapping headings to exact syllabus items; add a 5‑minute “gap‑filler” box for any missing sub‑item with definition, key properties and an exam‑style question. |
| Depth and accuracy (AO1‑AO3) | AO1 – factual knowledge; AO2 – analysis/application; AO3 – design, programming, evaluation. | Notes give high‑level over‑views but lack algorithmic detail, pseudo‑code, or state‑transition diagrams required for AO2/AO3. | For every protocol include a “Depth Box” (as shown in Section 5) that separates AO1 facts, AO2 decision‑making flowcharts, and AO3 design/implementation activities. Verify terminology against the official syllabus glossary. |
| Use of correct terminology | Distinguish clearly between TCP, IP, UDP, TLS, SSL, FTPS, SFTP, etc. | Occasional conflation of “TCP” with “IP” or omission of “TLS vs. SSL”. | Provide a glossary table (Appendix A) and colour‑code terms in the notes (e.g., transport = blue, security = red). |
| Practical programming links | Paper 4 requires a short program that uses a protocol, a test plan and evaluation. | Only a single HTTP example is usually given. | Expand the practical activity to include FTP and SMTP alternatives (see Section 8) and supply a template test‑plan table. |
| Linking to other syllabus areas | Show how protocols relate to data representation, system software, security and networks. | Connections are mentioned in passing or omitted. | Add a “Linkage” subsection after each protocol (e.g., MIME for email, socket API for implementation, TLS for security) as done in Section 9. |
Create an account or Login to take a Quiz
Log in to suggest improvements to this note.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.