KS48525 3.5.3 to 3.5.4 26 min read 10 question quiz 12 exam marks

Protocols and Layers

Every protocol named in the specification and what each one is actually for, why TCP and UDP are different jobs rather than rivals, and what layering buys you.

What a protocol is

A protocol is a set of rules governing how devices communicate. Both ends must follow the same rules or nothing can be understood.

That is more than a definition. It is why standards matter: a laptop made in one country can talk to a server made in another because both implement the same agreed rules.

The protocols AQA names

ProtocolStands forWhat it does
EthernetThe family of protocols for wired LANs, defining how frames are sent over cable
Wi-FiThe family of protocols for wireless LANs
TCPTransmission Control ProtocolSplits data into packets, checks they all arrive, and reassembles them in order
UDPUser Datagram ProtocolSends packets with no checking and no reassembly, which is faster
IPInternet ProtocolAddresses packets and routes them between networks
HTTPHypertext Transfer ProtocolRequests and delivers web pages
HTTPSHTTP SecureThe same, but encrypted so it cannot be read if intercepted
FTPFile Transfer ProtocolTransfers files between computers
SMTPSimple Mail Transfer ProtocolSends email
IMAPInternet Message Access ProtocolRetrieves email, leaving it on the server so it syncs across devices
SMTP sends, IMAP retrieves

The single most commonly asked pair on this topic. Sending goes out with SMTP, reading comes back with IMAP.

How an email travels, and the difference between POP and IMAPThe journey of an email. The sender's laptop uses SMTP to send the message to the sender's mail server. SMTP is used again to pass it to the recipient's mail server. The recipient then collects it with POP or IMAP. Below, the two ways of collecting mail are compared. With POP the mail is downloaded to one device and then removed from the server, so it only exists on the device that downloaded it. With IMAP the mail stays on the server and every device, such as a phone and a laptop, shows the same mailbox, so they stay in sync.sendersender's mail serverrecipient's mail serverrecipientSMTPSMTPPOP or IMAP1POP: download, then deletemail serverone laptopdownloadremoved from the servermail is only on the device that downloaded itgood for: one device, little storage2IMAP: keep it on the servermail serverevery devicesame mailkept on the serverevery device shows the same mailboxgood for: phone and laptop together3
  1. SMTP sends email, from the sender to their server and between mail servers.
  2. POP downloads mail and normally deletes it from the server, so it lives on one device.
  3. IMAP keeps mail on the server, so a phone and a laptop both show the same mailbox.
SMTP sends. POP downloads and removes. IMAP keeps it on the server and in sync. Two devices means IMAP.

TCP and UDP

These are not competitors. They are different tools for different jobs, and a question asking you to choose is really asking whether reliability or speed matters more.

TCP guarantees delivery. It numbers each packet, waits for the receiver to acknowledge each one, resends anything that does not arrive, and puts the packets back into order at the far end.

Use it when every byte must arrive: a web page, a file download, an email, a bank transfer. A missing byte in a downloaded program is a corrupt program.

UDP sends packets and does not check. Nothing is acknowledged, nothing is resent and nothing is reordered.

Use it when speed matters more than completeness: live video, voice calls, online gaming. A resent video frame would arrive after the moment it belonged to had passed, so resending it is worse than useless.

The reasoning examiners want

"UDP is used for a live video call because a lost packet would arrive too late to be useful, and waiting for it would add delay to the whole call." That is the mark, not "UDP is faster".

Layers

Network protocols are organised into layers, each of which handles one part of the job and passes its result to the layer below.

A four layer model is used:

LayerJobProtocols
ApplicationProvides services to the user's softwareHTTP, HTTPS, FTP, SMTP, IMAP
TransportSplits data into packets and manages the connectionTCP, UDP
NetworkAdds addresses and routes packets between networksIP
LinkSends the data over the physical mediumEthernet, Wi-Fi

Each layer wraps what it receives from the layer above in its own header. The receiving computer unwraps them in the reverse order, so each layer only ever deals with the header its counterpart added.

Why layering is used

It divides a huge problem into manageable parts. Nobody has to understand the whole of networking at once.

Layers can be changed independently. Moving a laptop from Ethernet to Wi-Fi changes the link layer only. HTTP, TCP and IP carry on exactly as before, and no application has to be rewritten.

It allows specialisation and competition. Different manufacturers can build products for different layers, and as long as each follows the standard for its layer, everything interoperates.

It makes faults easier to isolate. If a website loads by its IP address but not by its name, the problem is in name resolution, not in the cable.

Do not say layers make the network faster

They do not. Layering is about manageability, interoperability and independent change, and that is what the mark scheme rewards.

The four layer TCP/IP model and packet encapsulationThe four layer TCP/IP model, drawn top to bottom with the growing packet beside it. The application layer handles protocols such as HTTP, HTTPS, FTP, SMTP and IMAP, and produces the raw data. The transport layer, using TCP, splits that data into packets and adds a header carrying port numbers, so the packet is now a TCP header followed by data. The internet layer adds an IP header carrying the source and destination IP addresses, so the packet is an IP header, a TCP header and the data. The link layer, Ethernet or Wi-Fi, adds a frame header carrying MAC addresses and a frame end, giving frame header, IP header, TCP header, data, frame end. Each layer wraps the one above it in its own header, and the receiving computer unwraps the layers in reverse order.ApplicationHTTP, HTTPS, FTP, SMTP, IMAPTransportTCP splits data into packets, adds port numbersInternetIP adds source and destination IP addressesLinkEthernet or Wi-Fi, adds MAC addressessendingDataTCPDataIPTCPDataFrameIPTCPDataEndeach layer wraps the layer above in its own headerthe receiver unwraps them in the reverse order
Layers are independent. Changing from Wi-Fi to Ethernet swaps the link layer only, and nothing above it has to change.
The TCP/IP model: a message wrapped on the way down and unwrapped on the way upTwo stacks of four layers, the sender's on the left and the receiver's on the right, with the data between them. At the application layer, where HTTP, HTTPS, SMTP, IMAP and FTP live, the data is just the message. The transport layer splits it into segments and adds a TCP or UDP header carrying the port number. The internet layer wraps each segment in a packet and adds the source and destination IP addresses used for routing. The link layer wraps the packet in a frame carrying MAC addresses and a check value, and puts it on the cable or the wireless link. At the receiving computer the same four layers run in reverse: each strips off the wrapper it recognises and hands the rest up, so the application receives exactly the message that was sent. No layer needs to know how another layer does its job, which is the whole reason the model is split up this way.chatSenderchatReceiverWhat is on the wireApplicationHTTP · SMTP · DNSApplicationshows the pageDATAmessage80TransportTCP · UDP · ports80Transportputs the pieces in orderTCPDATAsegmentInternetIP · addressesInternetchecks it is for meIPTCPDATApacketLinkWi-Fi · Ethernet · MACLinkreads the frameMACIPTCPDATAFCSframecable or Wi-Fi: bits on the wire12345
  1. Your message starts at the top, in the application.
  2. Transport splits it into segments and adds a port number.
  3. Internet wraps each segment in a packet and adds IP addresses.
  4. Link turns the packet into a frame with MAC addresses, and it goes out.
  5. At the other end the same four layers run in reverse, unwrapping it.
Each layer wraps what the layer above handed it, and knows nothing about what is inside. That is why you can change the wifi for a cable without rewriting the web browser.

Key terms you must be able to define

Protocol
A set of rules governing how devices communicate, which both ends must follow.
TCP
Transmission Control Protocol, which splits data into packets, checks delivery and reassembles them in order.
UDP
User Datagram Protocol, which sends packets without checking delivery or reassembling them.
IP
Internet Protocol, which addresses packets and routes them between networks.
HTTP
The protocol used to request and deliver web pages.
HTTPS
HTTP with encryption, so intercepted traffic cannot be read.
SMTP
The protocol used to send email.
IMAP
The protocol used to retrieve email while leaving it on the server.
Layer
One level of a networking model, handling one part of the communication task.
Encapsulation
Each layer wrapping the data it receives in its own header before passing it on.

Flashcards

Say the definition out loud before you flip the card. Retrieving it from memory is what builds recall, reading it again is not.

DefineProtocol
AnswerA set of rules governing how devices communicate, which both ends must follow.
DefineTCP
AnswerTransmission Control Protocol, which splits data into packets, checks delivery and reassembles them in order.
DefineUDP
AnswerUser Datagram Protocol, which sends packets without checking delivery or reassembling them.
DefineIP
AnswerInternet Protocol, which addresses packets and routes them between networks.
DefineHTTP
AnswerThe protocol used to request and deliver web pages.
DefineHTTPS
AnswerHTTP with encryption, so intercepted traffic cannot be read.
DefineSMTP
AnswerThe protocol used to send email.
DefineIMAP
AnswerThe protocol used to retrieve email while leaving it on the server.

Reach the top grade on this topic

This topic rewards knowing why, not just what.

Justify TCP or UDP from the consequence of loss. Ask what happens if a packet goes missing. If the result is corrupt data, TCP. If the result is a moment that has already passed, UDP.

Explain layering with a change. The clearest evidence of understanding is an example: swapping Wi-Fi for Ethernet changes the link layer and nothing above it, so no application needs rewriting.

Give HTTPS its mechanism. Not "it is secure" but "the data is encrypted before transmission, so intercepted traffic cannot be read without the key".

Mistakes that cost marks here

Avoid these
  • Swapping SMTP and IMAP. SMTP sends, IMAP retrieves.
  • Saying UDP is better than TCP. They serve different purposes, and the right one depends on whether loss or delay is worse.
  • Saying layering makes a network faster. It makes it manageable and interoperable.
  • Describing HTTPS as a different protocol from HTTP. It is HTTP with encryption added.
  • Saying IP guarantees delivery. IP addresses and routes packets; TCP is what checks they arrived.
Fun fact

TCP and IP were originally a single protocol. They were split in 1978 precisely so that applications needing speed more than reliability could use IP without paying for TCP's guarantees, which is where UDP came from.

Knowledge check

0 of 10 answered
1Which protocol is used to send an email?
2What is the main difference between TCP and UDP?
3Why is UDP used for live video calls?
4What does the Internet Protocol do?
5At which layer of the four layer model does HTTP operate?
6What is added by each layer as data passes down the stack?
7Why is layering used in network protocols?
8What does HTTPS add to HTTP?
9Which protocol would be most appropriate for downloading a program installer?
10A laptop is moved from a wired connection to Wi-Fi and everything still works. Which principle does this demonstrate?
Score 0 / 10

Exam-style questions

Five written questions in the style of the real paper. Write a full answer, then let the marker check it against the mark scheme.

12 marks
1State what is meant by a protocol.1 mark
State

Mark scheme0 / 1
  • LA set of rules governing how devices communicate
Model answer

A protocol is a set of rules that governs how devices communicate, which both the sending and the receiving device must follow for the communication to be understood.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
2Explain why TCP would be used to download a file but UDP would be used for a live video call.4 marks
Explain

Mark scheme0 / 4
  • LTCP checks that every packet arrives and reassembles them in order
  • LA downloaded file would be corrupt if any part were missing
  • LUDP sends packets without checking or resending, so it is faster
  • LA resent video packet would arrive too late to be useful, and waiting for it would add delay
Model answer

TCP numbers every packet, waits for the receiver to acknowledge each one, resends anything that fails to arrive and puts the packets back into the right order at the far end. That is essential for a file download, because a file with a missing or misordered section is corrupt and will not work at all. UDP does none of that checking, which makes it faster and removes the delay that waiting for acknowledgements introduces. For a live video call that trade is the right one: a packet that was lost and then resent would arrive after the fraction of a second it belonged to had already been displayed, so it is useless, and the delay caused by waiting for it would degrade the whole call for everyone.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
3Describe two reasons why network protocols are arranged in layers.4 marks
Describe

Mark scheme0 / 4
  • LEach layer handles one part of the task, so the problem is broken into manageable parts
  • LDevelopers can work on one layer without understanding the whole system
  • LA layer can be changed or replaced without affecting the layers above or below
  • LGives an example, such as changing from Ethernet to Wi-Fi affecting only the link layer
Model answer

The first reason is that layering divides a very large problem into parts small enough to handle. Each layer is responsible for one aspect of communication and only has to interact with the layer directly above and below it, so a developer working on an email client does not need to understand how a signal is placed onto a cable. The second is independence. Because each layer only relies on the interface the next one presents, a layer can be replaced entirely without disturbing the others. Moving a laptop from an Ethernet cable to Wi-Fi changes the link layer completely, but IP, TCP and HTTP carry on unchanged, which is why no application has to be rewritten when the connection type changes.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
4A school website changes from HTTP to HTTPS. Explain the benefit to users.3 marks
Explain

Mark scheme0 / 3
  • LHTTPS encrypts the data before it is transmitted
  • LIntercepted traffic cannot be read without the key
  • LSo personal data such as logins and messages is protected in transit
Model answer

HTTPS carries the same HTTP requests and responses over an encrypted connection, so the data is scrambled before it leaves the user's device and is only unscrambled at the far end. Anybody who intercepts the traffic in between, for example on a shared public network, sees only unreadable data rather than the actual content. That matters because users log in to the school site and may send personal information through it, and under plain HTTP a username and password would travel as readable text that anyone on the same network could capture.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
Machine mark 0 / 12