Note AcademyNote Academy

Computer Science (AS & A Level) 9618 · Chapter 14

Communication and Internet Technologies

Why protocols are needed, the TCP/IP protocol stack and its four layers, the purpose of HTTP, FTP, POP3, IMAP, SMTP and BitTorrent, and circuit switching compared with packet switching.

Written for the 2027–2029 syllabus · 11 min read

Chapter 2 described the networks. This chapter explains the rules that let very different computers talk to each other, and the two ways data can be sent across a network.

14.1 Protocols

Why a protocol is essential

A protocol is a set of agreed rules for communication between devices. Computers made by different companies, running different software, can communicate only if they follow the same rules. A protocol sets out, for example:

  • the format of the data and of its header;
  • how the start and end of a message are signalled;
  • how the sender and receiver agree to begin (a handshake), and at what speed;
  • how errors are detected and corrected;
  • how lost data is handled, and how flow of data is controlled;
  • how the devices are addressed.

Without protocols, the receiver would not know where one message ends or how to interpret the bits.

The protocol stack

In practice the work of communicating is divided into layers. Each layer has its own job and only communicates with the layer directly above and below it (and with the same layer on the other computer). A set of protocols arranged in layers is called a protocol stack.

Benefits of layering:

  • Each layer can be designed, tested and changed independently, as long as it keeps the same interface to the layers next to it.
  • The complexity is split into smaller, manageable parts.
  • Different companies can write different layers that work together, and a new technology (such as a new type of cable) only affects one layer.

The TCP/IP protocol suite

The internet uses the TCP/IP suite, usually described as four layers. When data is sent, it goes down the layers at the sender, each layer adding its own header to the data; when it is received, it goes up the layers at the receiver, and each layer removes its header.

LayerJobExamples
ApplicationProvides the services the user's software needs; defines the format of the data for applications such as web pages and emailHTTP, HTTPS, FTP, SMTP, POP3, IMAP, BitTorrent
TransportBreaks the data into packets, numbers them, sets up and ends the connection, and provides reliable delivery (re-ordering, checking for errors, resending lost packets) and the port number that says which application the data is forTCP, UDP
Internet (Network)Adds the source and destination IP addresses to each packet and works out the route across the networks (routing)IP
Link (Network access)Sends the packets over the physical medium of the local network, using the MAC address of the next deviceEthernet, WiFi

The four TCP/IP layers, application, transport, internet and link, with their protocols and how the data is wrapped as it goes down: the transport layer adds a TCP header, the internet layer an IP header and the link layer a frame header and trailer, and each is removed on the way up at the receiver

The four TCP/IP layers, application, transport, internet and link, with their protocols and how the data is wrapped as it goes down: the transport layer adds a TCP header, the internet layer an IP header and the link layer a frame header and trailer, and each is removed on the way up at the receiver

Application layer protocols

ProtocolNamePurpose
HTTPHypertext Transfer ProtocolUsed by a web browser to request web pages from a web server, and by the server to send them back. HTTPS is the same with encryption (SSL/TLS)
FTPFile Transfer ProtocolTransfers files between computers over a network, for example uploading a website to a server, or downloading large files. It can be used to upload and download
SMTPSimple Mail Transfer ProtocolSends email from a client to a mail server, and between mail servers
POP3Post Office Protocol (version 3)Retrieves email from a mail server by downloading it to one device. The messages are normally deleted from the server afterwards
IMAPInternet Message Access ProtocolRetrieves email but leaves it on the server, synchronised across several devices, so the same mailbox can be read from a phone, tablet and laptop. Messages can be organised in folders on the server
BitTorrentPeer-to-peer file sharing protocolUsed to share large files, by a swarm of peers (see below)

BitTorrent

BitTorrent shares a large file without one server having to send it to everyone. The file is split into many pieces. A torrent file (or a magnet link) holds the information about the pieces and a tracker, a server that lists the peers. A swarm of peers is formed: peers that have the complete file are seeders; those still downloading are leechers. A peer downloads different pieces from many peers at the same time, and, as soon as it has a piece, it uploads it to others. The final file is then put together from the pieces.

Benefits: the load is shared across the peers, so it is fast and no single server is overloaded; if one peer disconnects, the others carry on; the more popular the file is, the faster it can be downloaded. Drawbacks: it is often used to share files that break copyright; a user's IP address is visible to other peers; and malware can be hidden in shared files.

14.2 Circuit switching and packet switching

Circuit switching

In circuit switching, a dedicated communication path is set up between the sender and the receiver before any data is sent, and it is kept for the whole of the communication. All the data follows the same path and arrives in order. The path is released when the communication ends. Old telephone (PSTN) calls work this way.

  1. A circuit is established between the two ends (a route through the switches is reserved).
  2. Data is transferred over that circuit.
  3. The circuit is released.

Advantages: a fixed, guaranteed bandwidth and speed, no delays from routing, the data arrives in order and with no need to reassemble it. Disadvantages: the circuit is reserved even when no data is being sent, so the capacity is wasted; it takes time to set up; if a node on the path fails the connection is lost; and fewer users can share the network.

Suited to: a live voice or video call where a steady, uninterrupted connection is needed.

Packet switching

In packet switching, the message is divided into small packets, and each packet is sent separately, and may follow a different route through the network. Each packet has:

  • a header holding the destination IP address, the source IP address, the packet number (sequence number), the number of packets in the message, a time to live (hop count) and error-checking data;
  • the payload: part of the data;
  • a trailer that marks the end and may hold error-checking data (a checksum).

How it works:

  1. The message is split into packets and each is numbered.
  2. Each packet is sent to the nearest router, which reads the destination address and uses its routing table to choose the next hop (the best route at that moment, taking into account traffic and faults).
  3. The packets may take different routes and arrive out of order.
  4. At the destination the packets are reordered using their numbers and put together to make the original message.
  5. If a packet is lost or damaged, it is requested again (re-sent).

A message split into three packets that travel from the sender to the receiver by three different routes through six routers, and the structure of one packet: a header with destination and source IP addresses, packet number and time to live, a payload holding part of the data, and a trailer

A message split into three packets that travel from the sender to the receiver by three different routes through six routers, and the structure of one packet: a header with destination and source IP addresses, packet number and time to live, a payload holding part of the data, and a trailer

The hop count (time to live) is reduced by one at each router; when it reaches zero the packet is discarded, so a packet that is going round in circles does not clog the network.

Circuit switchingPacket switching
PathOne dedicated path for the whole communicationEach packet may take a different route
Set-upNeeded before sendingNone
BandwidthReserved (and wasted if idle)Shared: used only when packets are sent
Order of arrivalAlways in orderMay be out of order: reassembled at the end
If a node failsThe connection is lostPackets are re-routed
DelayConstant, smallCan vary (jitter), and packets can be lost
Used forTelephone calls (PSTN)The internet: web pages, email, file transfer
Test yourself31 flashcards on this chapter.Flashcards →

Practise this chapter

Every past-paper question on these topics, with the mark scheme.