The shape of the lesson
By the end of the lesson, learners can
- Web pages and files: In the lab, switch to Protocols and click each one to see what it moves and in which direction.
- Three email protocols: Email needs a push protocol to send and a pull protocol to collect.
- BitTorrent: sharing peer to peer: Downloading a huge file from one server is slow when thousands want it at once.
- HTTP/HTTPS: request and transfer web resources (HTTPS encrypted).
- FTP: transfer files between client and server.
- SMTP push; POP3 / IMAP pull: POP3 downloads and deletes, IMAP keeps on the server and syncs.
- BitTorrent: torrent file, tracker, swarm, seeds and leechers, pieces from many peers at once.
One picture every idea returns to
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.
Forty-five minutes, phase by phase
| Time | Phase | What happens in the room | Grouping |
|---|---|---|---|
| 0 to 5 min | Hook: predict | Open with the question in the title, 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. Put the figure on the board: it is the one picture every idea in the lesson returns to. | Whole class, then pairs |
| 5 to 13 min | Teach and check: Web pages and files | In the lab, switch to Protocols and click each one to see what it moves and in which direction. Project tab 7 of the lab (Application layer protocols) and let a student drive it while the class predicts. | Whole class, then pairs |
| 13 to 21 min | Teach and check: Three email protocols | Email needs a push protocol to send and a pull protocol to collect. Model the worked example Choose the retrieval protocol on the board, one line at a time. Your turn: Which protocol is used when the sender's mail server passes an email to the recipient's mail server? | Pairs |
| 21 to 30 min | Teach and check: BitTorrent: sharing peer to peer | Downloading a huge file from one server is slow when thousands want it at once. Model the worked example Counting pieces on the board, one line at a time. 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. | Cooperative Concept Mapping |
| 30 to 36 min | Check | The four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong. | Individual, then whole class |
| 36 to 43 min | Plenary | The exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording. | Individual, random call |
| 43 to 45 min | Exit and homework | Set the worksheet below (6 questions, 22 marks). Learners self-assess against the objectives before they leave. | Individual |
Protect the parts that carry the learning
The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.
Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.
Cut first if the build overruns: the last check in BitTorrent: sharing peer to peer, never the check or the plenary.
In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.
Cooperative Concept Mapping
Teams receive the key terms on cards and arrange them on a large sheet, drawing and labelling the links. Compare maps between teams before showing the model map.
The full structure, with its variations and the other twelve, is on the cooperative-learning page.
What to head off, and how
| Trap learners fall into | Teaching move that pre-empts it |
|---|---|
| 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. |
| 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. |
| 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. |
HTTP, FTP, POP3, IMAP, SMTP and BitTorrent: worksheet
6 questions, 22 marks. Written in the style of the papers; no past paper question is reproduced.
State the purpose of each protocol: (a) HTTP (b) FTP (c) SMTP.
Describe two differences between POP3 and IMAP.
Ali sends an email from his laptop to Bea, who reads it on her phone. Describe the protocols used as the email travels from Ali to Bea.
Explain how the BitTorrent protocol allows a large file to be shared between many users.
A 1.5 GiB file is shared using BitTorrent with a piece size of 512 KiB. Calculate the number of pieces. Show your working.
A games company must distribute a 40 GiB update to millions of players on the day it is released. Discuss the benefits and drawbacks of using a peer-to-peer protocol such as BitTorrent instead of downloads from the company's own servers.
Answer key and marking notes
- (a) To request and transfer web pages / web resources between a web server and a browser.
- (b) To transfer files between a client and a server (upload and download).
- (c) To send email from a client to a mail server / between mail servers.
- POP3 downloads email to the client device ...
- ... and usually deletes it from the server, whereas IMAP leaves the email on the server.
- With IMAP, changes made on one device (read, deleted, moved to a folder) are synchronised across all devices ...
- ... whereas with POP3 each device has its own separate copy / email can be read offline once downloaded.
- Ali's email client uses SMTP to send the email to Ali's mail server.
- Ali's mail server uses SMTP to send the email to Bea's mail server.
- The email is stored on Bea's mail server (in her mailbox).
- Bea's phone uses POP3 or IMAP to retrieve the email from her mail server.
- The file is split into small pieces of equal size, each with a hash value.
- A user obtains a torrent file containing metadata, including the tracker's address and the piece hashes.
- The tracker provides a list of peers in the swarm that have pieces of the file.
- The user's client downloads different pieces from many peers at the same time, and checks each one against its hash.
- As soon as it has a piece, the user's client uploads it to other peers; seeds have the complete file.
- 1.5 GiB = 1.5 x 1024 x 1024 KiB = 1 572 864 KiB.
- 1 572 864 / 512 = 3072 pieces.
- Benefit: each player who downloads pieces also uploads them, so capacity grows with demand and the company's servers are not overloaded.
- Benefit: lower bandwidth and server costs for the company; no single point of failure.
- Drawback: players' upload bandwidth is used, and some may block it or have slow connections.
- Drawback: the company has less control; pieces come from unknown peers (security/integrity must rely on hashes), and early on there may be few seeds.
6 multiple-choice questions on this lesson
From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.
A web designer needs to log on to a remote server, upload a folder of new files and rename and delete some old ones. Which protocol is designed for this?
- AFTP
- BHTTP
- CSMTP
- DIMAP
Priya's email client on her laptop uses POP3 with its default settings. She reads a new email on the laptop, then checks her phone, which also uses POP3, and the email is not there. What is the most likely reason?
- APOP3 moved the email to the laptop, removing the server copy
- BSMTP has not yet delivered the email from the laptop to the phone
- CIMAP hides an email on other devices once it has been read on one
- DThe phone needs HTTP to collect the email from the laptop
A 2 GiB file is shared using BitTorrent with a piece size of 256 KiB. How many pieces is the file split into?
- A8192
- B7813
- C8
- D2 097 152
What does a torrent file contain?
- AMetadata: the piece size, a hash of every piece and the tracker's address
- BA compressed copy of the complete file, so that it can be downloaded in one go from any peer
- CThe IP address of every peer that will ever share the file, fixed when the torrent is created
- DThe first piece of the file, together with a key needed to decrypt all of the other pieces
In BitTorrent, why does every piece of the file have its own hash value?
- ASo each piece from an unknown peer can be checked and, if corrupted, fetched again
- BSo each piece can be encrypted before it is sent, which stops the pieces being read if intercepted
- CSo the client knows the order in which the pieces must be downloaded, starting with the smallest hash
- DSo the tracker can tell which peer created each piece and block peers who upload too slowly
Kofi sends an email from his laptop. Ama reads it on her phone, her tablet and her office PC, and wants the same inbox and folders on all three. Which protocols carry the email from Kofi's client to his mail server, from his mail server to hers, and from her mail server to her devices?
- ASMTP, then SMTP, then IMAP
- BSMTP, then IMAP, then IMAP
- CSMTP, then SMTP, then POP3
- DIMAP, then SMTP, then POP3
Quiz key
FTP (File Transfer Protocol) lets a client log on and upload, download, rename and delete files on a server. HTTP transfers web pages from a server to a browser; SMTP sends email; IMAP retrieves email from a mail server.
POP3 usually downloads an email to one device and removes it from the server, so a second device has nothing to collect. SMTP sends email between clients and servers, not from one of the recipient's devices to another. IMAP is not in use here, and with IMAP the email would stay on the server and show on every device. Email is not collected from another client by HTTP.
2 GiB = 2 x 1024 x 1024 KiB = 2 097 152 KiB, and 2 097 152 / 256 = 8192 pieces. 7813 comes from treating 2 GiB as 2 000 000 KiB (decimal units); 8 comes from dividing 2048 MiB by 256 without converting to KiB; 2 097 152 is the size in KiB, before dividing by the piece size.
A torrent file holds metadata: the file name and size, the piece size, the hash of each piece and the tracker's address. It does not hold the file itself. The list of peers changes all the time, so it comes from the tracker while downloading, not from the torrent file; and BitTorrent pieces are not locked by a key in the torrent file.
Pieces come from many untrusted peers. The client hashes each piece it receives and compares the result with the hash in the torrent file; if they differ the piece is damaged or altered and is requested again, possibly from a different peer. A hash is not encryption; pieces can be downloaded in any order (often rarest first), and the order is not given by hash values; and the tracker only lists peers, it does not inspect pieces.
SMTP pushes the email from Kofi's client to his mail server and again from server to server. Ama's devices then pull it with IMAP, which keeps the email and folders on the server so every device shows the same view. IMAP is never used between mail servers or for sending; POP3 usually downloads to one device and deletes the server copy, so her devices would not stay in sync.
What to project
The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.
Slides for this lesson
A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.