A Level · Topic 14.1
A-Level Computer Science 9618 / Topic 14 / A2

A protocol for every job.

The Application layer is where the protocols you actually use live: one fetches web pages, one moves files, three handle email, and one shares huge files between thousands of ordinary computers. Learn the purpose of each and, for email, which way each one pushes or pulls the message.

The key idea

HTTP transfers web pages and their resources between a web server and a browser (HTTPS is HTTP made secure by encryption). FTP transfers files between a client and a server. Email uses three protocols: SMTP pushes an email from the sender's client to their mail server and on to the recipient's mail server; POP3 and IMAP let the recipient pull it from their server. POP3 downloads the email (usually deleting the server copy); IMAP keeps it on the server so every device stays in sync. BitTorrent is a peer-to-peer protocol: a file is split into pieces and each peer in a swarm downloads different pieces from many other peers at once while uploading the pieces it already has.

one email, three protocols sender'semail client sender'smail server recipient'smail server recipient'semail client SMTPSMTPPOP3IMAP or SMTP pushes the email towards the recipient (client to server, server to server) POP3 / IMAP let the recipient pull the email from their server
Fig. 1: SMTP pushes an email to the recipient's mail server; POP3 or IMAP pulls it to the recipient's device
Section 01

Web pages and files.

In the lab, switch to Protocols and click each one to see what it moves and in which direction.

ProtocolPurposeHow it works
HTTP (HyperText Transfer Protocol)transfers web pages and their resources (HTML, images, scripts) between a web server and a browserthe browser sends a request (e.g. GET for a page, POST to send form data); the server sends a response with a status code (200 OK, 404 Not Found) and the content; usually port 80
HTTPSsecure version of HTTPthe HTTP messages are encrypted using SSL/TLS, so they cannot be read if intercepted; the server proves its identity with a digital certificate; usually port 443
FTP (File Transfer Protocol)transfers files between a client and a server over a network: upload, download, rename and delete files in a directory structurethe client logs on (username and password, or anonymous access); commands are sent on a control connection (port 21) and files on a separate data connection; can transfer in binary or text mode
Examiner trap

HTTP is not "the internet" and not "how web pages are displayed". It is the set of rules for requesting and transferring web resources between a client and a web server; the browser renders the page.

Section 02

Three email protocols.

Email needs a push protocol to send and a pull protocol to collect. Follow the arrows in Fig. 1.

SMTPPOP3IMAP
Full nameSimple Mail Transfer ProtocolPost Office Protocol version 3Internet Message Access Protocol
Directionpush: sends emailpull: retrieves emailpull: retrieves email
Betweensender's client and mail server; mail server and mail serverrecipient's mail server and clientrecipient's mail server and client
Where email is kept-downloaded to one device; usually deleted from the serverstays on the server; the client shows a synchronised copy
Suitsevery email sentone device, reading offline, little server storageseveral devices (phone, laptop, webmail) that must all show the same inbox and folders
Worked example Choose the retrieval protocol
A sales manager reads email on a phone, a tablet and an office PC, and wants an email read or moved to a folder on one device to show as read or moved on all of them. POP3 or IMAP?
  1. With POP3 the email is downloaded to one device and usually deleted from the server, so the other devices never see it.
  2. With IMAP the email stays on the server; each device views the server copy.
  3. Flags (read/unread) and folders are stored on the server, so every device stays in sync.
Answer: IMAP, because the email and its folders stay on the server and are synchronised across all devices
Your turn
Which protocol is used when the sender's mail server passes an email to the recipient's mail server?
Examiner trap

POP3 and IMAP are not used to send email. A common lost mark is writing "IMAP sends the email to the recipient": the recipient's client retrieves it.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

Which protocol pushes an email from the sender's client to the sender's mail server?

Quick check+10 XP

Which is the key difference between POP3 and IMAP?

Quick check+10 XP

In the lab, what happens when peer 1 downloads a file using BitTorrent?

Quick check+10 XP

What is the purpose of FTP?

Section 03

BitTorrent: sharing peer to peer.

Downloading a huge file from one server is slow when thousands want it at once. BitTorrent turns every downloader into an uploader as well.

Worked example Counting pieces
A 6 MiB file is shared using BitTorrent with a piece size of 256 KiB. How many pieces is it split into?
  1. Convert to the same unit: 6 MiB = 6 x 1024 KiB = 6144 KiB.
  2. Divide by the piece size: 6144 / 256 = 24.
  3. So the torrent file holds 24 piece hashes, and a peer can fetch the 24 pieces from up to 24 different peers.
Answer: 24 pieces
Your turn
Explain why a file shared using BitTorrent usually downloads faster when it becomes more popular, while a file on a single web server usually downloads more slowly.
Examiner trap

The tracker does not store or send the file. It only coordinates the swarm by telling peers about each other; the pieces travel directly between peers.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to A Level Paper 3 and Paper 4 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

What is the role of the tracker in BitTorrent?

Exam style+20 XP

In BitTorrent, what is a seed?

Exam style+20 XP

A student reads email on a laptop and a phone and wants both to show the same folders. Which protocol should the email client use?

Exam style+20 XP

What does HTTPS add to HTTP?

Skill unlocked

Application protocols, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
The purposes of HTTP, FTP, SMTP, POP3 and IMAP, choosing between POP3 and IMAP, and how BitTorrent shares files peer to peer.