Skip to content

9618 · Unit 15 · Paper 3: Advanced theory

Protocols and switched communication.

9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

Circuit and packet switching

§14.2 · Switching and routing

An old phone call held one line open for the whole conversation, even through the pauses; a chat app sends short bursts that squeeze in between everyone else’s. A circuit-switched connection reserves a path before communication. Packet switching divides a message into addressed portions that share network capacity.

A gallery’s exhibit controller sends GALLERY|OPEN|18:20 to a remote display. It sends only occasional status changes; a live audio guide would produce a continuous stream.

The path A → B → D is held for one conversation, even while nothing is being said.

Reserved for this conversationOther traffic cannot use its reserved capacity.ABCDSender sideDisplay side

Read each row across: one consequence, and how each method handles it.

ConsequenceCircuit switchingPacket switching
Before sendingSet up a dedicated circuit; setup takes time.No dedicated circuit needs reserving.
CapacityReserved even during silence; predictable rate once set up.Shared by many senders; efficient for bursts.
Route and orderSame path; data stays in order.Packets may take different paths and arrive out of order.
Failure and delayA broken path interrupts the connection.Other routes may remain available; queuing and reassembly add variable delay.

Which method suits which use

  • Bursts of exhibit updates suit shared packet capacity.
  • A reserved circuit can suit a sustained conversation needing a steady rate, if its setup time and reserved capacity are acceptable.
  • Release the circuit’s reserved channels when the conversation ends.
Your turn

1 Which method reserves a path before any data is sent?

2 A camera streams video all day without a pause. A door sensor sends a message only when the door opens. Which method suits each?

3 Give one drawback of a reserved circuit when data comes in short bursts.

  1. 1
    circuit switching
  2. 2
    camera: a reserved circuit can suit its steady, continuous stream; door sensor: packet switching, because occasional bursts can share capacity
  3. 3
    the reserved capacity is wasted during the silences (and setting up the circuit takes time)
Tick what you can do now
Practise with w25/32 Q4(a–b) (older paper: switching comparison)
1 / 10
9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

Packet delivery through routers

§14.2 · Switching and routing

Once a message is cut into packets, each one travels on its own, like letters posted separately. Every packet needs a destination address. Routers choose its next hop; the receiving endpoint uses sequence information to recover the message’s original order.

Follow the exhibit controller’s 18-character message GALLERY|OPEN|18:20 to the remote display. It is split into three six-character payloads. The labels 1–3 show their order in the message.

The sender’s router is R1 and the display’s router is R4; R2 and R3 are the two routers between them.

Each packet carries source 192.0.2.18 and destination 198.51.100.46, as well as ordering information.

Packet labelPayloadRoute
1GALLERR1 → R2 → R4
2Y|OPENR1 → R3 → R4
3|18:20R1 → R2 → R4

The same routes drawn out. Packets 1 and 3 go through R2, packet 2 through R3, so they need not arrive in the order sent.

SenderR1R2R3R4Receiverpacket 1: R1 → R2 → R4packet 2: R1 → R3 → R4packet 3: R1 → R2 → R41231 · 2 · 3The links also carry other messages.

Send → attach addressing and ordering information; forward packets independently.

At a router → read the destination IP address, consult its routing table and forward to the selected next hop.

  • R1 chooses R2 or R3 from its routing information: a next hop, not a whole fixed route written into the packet.
  • Changed routes or congestion can send later packets along a different path.
Your turn

1 What does a router read in each packet to choose the next hop?

2 Which packet goes through R3?

3 The packets reach the display in the order 3, 1, 2. What message does the display rebuild, and what tells it the order?

  1. 1
    the destination IP address, looked up in its routing table
  2. 2
    packet 2
  3. 3
    GALLERY|OPEN|18:20: the sequence information (labels 1, 2, 3) in each packet
Tick what you can do now
Practise with w24/32 Q1(a); s25/33 Q4(b) (older papers: packet journey and router functions)
2 / 10
9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

Packet loss and reassembly

§14.2 · Switching and routing

Three packets leave in the order 1, 2, 3 and the last one turns up first; another may not turn up at all. Receiving them is not enough: an endpoint must recover the complete message in its original order. Sequence information reveals the order and any gaps.

The exhibit message GALLERY|OPEN|18:20 was divided into payloads 1 = GALLER, 2 = Y|OPEN and 3 = |18:20. They can arrive in a different order from the order sent.

Each row shows the receiver’s three slots just after one more packet arrives. Blue marks the packet that has just come in.

Arrivesslot 1slot 2slot 3Receiverpacket 3gapgap|18:20waits for 1, 2packet 1GALLERgap|18:20waits for 2packet 2GALLERY|OPEN|18:20joins 1, 2, 3GALLERY|OPEN|18:20
  • After 3 arrives, the end is present but the start is missing.
  • After 1 arrives there is a gap at slot 2: do not join 1 straight to 3.
  • When 2 arrives, the order 1, 2, 3 recovers GALLERY|OPEN|18:20.

Detect and recover missing data

Spotting a gap is only half the job: the missing data has to be sent again.

Detect → error checks reveal damaged data; sequence information reveals a gap.

Recover → TCP uses acknowledgements and timing to detect missing data and retransmit it.

Reassemble → retain valid received data, place recovered data in order, and supply the complete stream to the application.

  • Only the missing data needs retransmitting.
  • Buffering out-of-order data and waiting for recovery use memory and add delay.
  • Packet switching gives flexible shared routes, but the delivery protocol must handle loss and order.

When a route fails

  • If the R2 route becomes unavailable, a later or retransmitted packet may travel through R3.
  • A packet’s hop limit decreases at routers; when it expires the packet is discarded, preventing endless circulation.
  • End-to-end recovery is still needed if that packet’s data has not reached the display.
Your turn

1 Packets 2 and 3 have arrived but packet 1 has not. What can the receiver conclude?

2 Which protocol notices missing data and has it sent again?

3 What stops a lost packet circulating between routers for ever?

  1. 1
    the start of the message is missing: wait for packet 1 and do not deliver a broken message
  2. 2
    TCP, using acknowledgements, timing and retransmission
  3. 3
    its hop limit: it decreases at each router and the packet is discarded when it expires
Tick what you can do now
Practise with w24/32 Q1(a–b); w25/31 Q3(c) (older papers: reassembly, recovery and delay)
3 / 10
9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

Protocols and layers

§14.1 · Protocols and layers

One maker’s display reads another maker’s controller only because both keep the same rules. A protocol specifies rules that communicating systems agree to follow: how data is represented, exchanged and interpreted. A protocol suite combines protocols with different jobs.

What each layer needs

Read from the top: each job can only be done if the job below it is done first.

Exhibit application → needs a request and reply that both ends can interpret.

Reliable transport → needs addressed packets to reach the other endpoint.

Internet routing → needs a local link to carry each packet to its next hop.

Link delivery → needs frames and signals that the adjacent devices can handle.

Down one stack, across the cable, up the other. The dashed lines are agreements, not wires.

Exhibit controllerRemote displayApplicationApplicationsame rulesTransportTransportsame rulesInternetInternetsame rulesLinkLinksame rulescable or radio: the only physical connection123
  1. 1
    A layer provides a service to the layer above and uses the service below. Inside one device, data moves between adjacent layers through defined interfaces.
  2. 2
    Corresponding layers at opposite endpoints follow the same protocol rules.
  3. 3
    They have no separate physical wire between them: only the bottom layer is connected, by cable or radio.

Why use layers

Each reason leads to a practical gain in the same row.

Reason for layersPractical consequence
Each layer has a distinct responsibility.A transport problem can be investigated separately from an application’s message format.
Interfaces define the service offered.A wired link can be replaced by a suitable wireless link while the application still requests the same service.
Protocol rules are agreed.Different implementations can exchange messages if they follow those rules.
When identifying a layer from a description, locate its job: user service, end-to-end delivery, network addressing or delivery on a local link.
Your turn

1 What is a protocol?

2 A gallery replaces a cable with a wireless link. Which layer’s job changes, and must the application change?

3 Give one reason for dividing communication into layers.

  1. 1
    an agreed set of rules for how data is represented, exchanged and interpreted
  2. 2
    the link layer (local delivery); no, the application still requests the same service through the same interface
  3. 3
    each layer has one job, so a problem can be investigated in one layer, or one layer can be replaced without changing the others
Tick what you can do now
Practise with s26/33 Q2; s26/31 Q4; w25/31 Q3(a) (older paper: why protocols are needed)
4 / 10
9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

The four TCP/IP layers

§14.1 · Protocols and layers

A present goes into a box, the box into a padded bag, the bag into a sack, and they come off in the opposite order. A message is wrapped the same way. The TCP/IP suite has four layers: Application, Transport, Internet and Link. Sending adds control information; receiving removes and uses it in the reverse order.

Sending and receiving

Read down the sender, then up the receiver.

SENDER ↓RECEIVER ↑ApplicationHTTP messageApplicationHTTP messageTransportTCP segmentTransportTCP segmentInternetIP packetInternetIP packetLinkLocal frameLinkLocal frameFrames cross links through routers

How encapsulation wraps the data

Read from the middle out: each layer wraps what it was given.

Link frameLink headerIP packetIP headerTCP segmentTCP headerStatus · application dataLink check

What each wrapper adds to GALLERY|OPEN|18:20:

LayerWhat it contributes to the exhibit message
ApplicationCreates the HTTP request/response and the status content the application understands.
TransportTCP adds ports and sequence/error-control information for delivery between the endpoint processes.
InternetIP adds source and destination network addresses so routers can forward the packet.
LinkEncapsulates the IP packet in a frame for this link, using local addressing and error checking.

Encapsulation wraps the next layer’s data with control information. Receiving reverses the nesting: Link extracts the IP packet; Internet passes up the TCP segment; TCP supplies the ordered application data.

Your turn

1 Name the four TCP/IP layers from the top.

2 Which layer adds the source and destination IP addresses?

3 On receiving, which layer takes the IP packet out of the frame?

  1. 1
    Application, Transport, Internet, Link
  2. 2
    Internet
  3. 3
    Link
Tick what you can do now
Practise with s26/31 Q4; s26/32 Q2
5 / 10
9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

HTTP and FTP

§14.1 · Protocols and layers

Opening a status page and storing a photo on a shared server both cross the same network, but one asks a question and the other moves a whole file. Choose an Application-layer protocol from the service needed. HTTP exchanges web requests and responses; FTP transfers files between a client and server.

Two jobs in one picture. HTTP: the display asks for the status and gets it back. FTP: one image file goes up to the file server and later down to the display.

GALLERY|OPEN|18:20Display: HTTP clientWeb server1 request: status2 response: status dataCurator: FTP clientFile serverDisplayuploaddownloadFTP: one named image file

HTTP: fetch the status page

Display’s HTTP client → exhibit web server → request the current status resource.

Web server → display → return a response containing the status data.

Display application → interpret GALLERY|OPEN|18:20 and update the visible page.

FTP: upload and download a file

Curator’s FTP client → file server → authenticate where required and upload a replacement exhibit image.

Display’s FTP client ← file server → download the image file to local storage.

HTTP means Hypertext Transfer Protocol; FTP means File Transfer Protocol. Both rely on lower layers to carry their messages.

Mailbox access needs POP3 or IMAP. Moving a file alone does not provide an email mailbox service.
Your turn

1 The display asks the web server for the current status. Which protocol?

2 The curator uploads a new exhibit image to the file server. Which protocol?

3 Write HTTP and FTP in full.

  1. 1
    HTTP: a request, then a response
  2. 2
    FTP
  3. 3
    Hypertext Transfer Protocol; File Transfer Protocol
Tick what you can do now
Practise with w25/33 Q4; w24/32 Q5(a) (older papers: application-protocol purposes)
7 / 10
9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

Email protocols

§14.1 · Protocols and layers

An email makes two journeys: out to the recipient’s mail server, then from that server to whoever reads it. SMTP sends mail. POP3 and IMAP let a receiving client access mail held by its server. Sending and mailbox access are different stages.

Follow the notice: SMTP carries it twice, then the display client collects it with POP3 or IMAP.

Curator’s clientDisplay clientSending serverReceiving serverNoticeSMTPOutgoing queueSMTPStored mailPOP3 or IMAPReady to read

SMTP does all the sending. The real choice is how the mailbox is read:

ProtocolMailbox behaviour and suitable use
SMTP · Simple Mail Transfer ProtocolPushes outgoing mail from a client to its server and onward between mail servers.
POP3 · Post Office Protocol 3Downloads messages to a client; it can remove server copies after retrieval. Useful when mail is kept primarily on one device.
IMAP · Internet Message Access ProtocolKeeps mail on the server and synchronises message/folder state. Useful when the curator checks the same mailbox on several devices.

Choose POP3 or IMAP

  • One device keeping its own mail: consider POP3.
  • Several devices needing the same mailbox state: choose IMAP.
  • POP3 need not delete server mail, but keeping a copy does not give IMAP’s synchronisation.
Your turn

1 Which protocol moves the notice from the curator’s client to the sending server?

2 Which protocol carries it from the sending server to the receiving server?

3 A guide reads the same mailbox on a phone and a laptop and wants the same folders on both. POP3 or IMAP?

  1. 1
    SMTP
  2. 2
    SMTP
  3. 3
    IMAP: it keeps mail on the server and synchronises its state
Tick what you can do now
Practise with w25/31 Q3(b); s24/32 Q2(b) (older papers: sending and receiving mail)
8 / 10
9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

BitTorrent and peer-to-peer sharing

§14.1 · Protocols and layers

When many computers want the same large file, one server sending every copy becomes a bottleneck. BitTorrent shares a file in pieces among peers. A peer can download pieces and upload pieces it already holds, spreading the transfer load across the group.

The exhibit’s authorised media pack has pieces A, B, C and D. A seed holds the complete pack. East and West hold different pieces and exchange them directly.

Follow the arrows: the seed gives each peer different pieces, then East and West swap what they have.

Seed: complete fileABCDEastACWestBDA, CB, DABGrey dashed: a piece that peer still needs
1
Obtain the torrent descriptor: metadata identifies the file and its pieces, rather than containing the media itself.
2
Use a tracker in a tracker-based system to find peers in the swarm, the group sharing this content.
3
Download different pieces from available peers; verify and assemble the pieces into the complete file.
4
Upload received pieces to other peers. A peer with the complete file that keeps sharing is a seed.

The tracker locates peers; peers supply the file

  • A tracker may coordinate discovery without serving the media pack. No single central file server has to supply every piece.
  • If East leaves, its pieces must be available from another peer or the seed. Many peers do not guarantee that every piece is currently available.
  • BitTorrent is an application protocol. “Peer-to-peer” does not mean the computers are cabled in one particular topology.
Your turn

1 What does a torrent descriptor hold?

2 What does a tracker do? Does it send the media pack?

3 East holds pieces A and C. Which pieces can it upload, and which must it still download?

  1. 1
    metadata that identifies the file and its pieces, not the media itself
  2. 2
    it helps peers find the swarm; no, the peers supply the pieces
  3. 3
    upload A and C; download B and D
Tick what you can do now
Practise with w25/32 Q3(b); s24/32 Q2(c) (older papers: BitTorrent sharing)
9 / 10
9618 · Unit 15 · Protocols and switched communication
Revisionbyexamplicity

Choosing the route and protocol

§14.1 · Protocols and layers

Why does the display show OPEN at 18:20? Because of a service, a delivery mechanism and a network route: each answers a different question, and together they explain one complete communication.

At the gallery, the controller sends status messages such as GALLERY|OPEN|18:20 to remote displays. A packet from the controller travels via router R1, then R2 or R3, to the display’s router R4.

Each need decides one choice; read across for the reason.

Need at the exhibitChoice and decisive reason
Occasional status updatesPacket switching shares links between bursts; tolerate variable network delay.
Display requests the current web statusHTTP exchanges a request and a resource response.
Managed upload of an image fileFTP moves the named file from client to server.
Curator reads mail on two devicesIMAP retains and synchronises one server mailbox.
Many displays share a large media packBitTorrent peers contribute pieces as they receive them.

Follow one status response all the way

Use the evidence in a description to name the layer. Each numbered point matches a mark on the figure.

Web serverApplicationTransportInternetLinkEach routerInternetLinkDisplayApplicationTransportInternetLinkR1, then R2 or R3, then R41234
  1. 1
    Application: the server builds the HTTP response carrying GALLERY|OPEN|18:20. Interpreting an HTTP request points here.
  2. 2
    Transport: TCP identifies endpoint processes and supplies sequencing, acknowledgements and recovery. Missing-data recovery and ordered delivery point here.
  3. 3
    Internet: IP supplies the destination; each router looks it up. A destination-network lookup points here.
  4. 4
    Link: a new frame carries the packet over each hop. A frame on one local hop points here.
  • The display removes each layer’s control information in reverse order and delivers the response to the display application.
  • A packet taking R3 instead of R2 changes its route, while its application service stays HTTP.
Your turn

1 A missing segment is sent again and the display puts the data back in order. Which layer is doing this?

2 R1 looks up 198.51.100.46 to choose its next hop. Which layer?

3 A packet goes through R3 instead of R2. Does the application protocol change?

  1. 1
    Transport (TCP)
  2. 2
    Internet (IP)
  3. 3
    no: only the route changes; the service is still HTTP
Tick what you can do now
Practise with s26/31 Q4; s26/33 Q2; w25/33 Q4 (older paper: application-protocol purposes)
10 / 10