Skip to content

Communication and internet technologies

A-Level Computer Science · Topic 14

Train
14.1

Why protocols are needed

Syllabus
Candidates should be able to: Notes and guidance
Show understanding of why a protocol is essential for communication between computers
Show understanding of how protocol implementation can be viewed as a stack, where each layer has its own functionality
Show understanding of the TCP/IP protocol suite Four Layers (Application, Transport, Internet, Link) Purpose and function of each layer Application when a message is sent from one host to another on the internet
Show understanding of protocols (HTTP, FTP, POP3, IMAP, SMTP, BitTorrent) and their purposes BitTorrent protocol provides peer-to-peer file sharing

Source: Cambridge International syllabus

A protocol 协议 is a set of rules for how devices communicate. Both ends must follow the same rules, or one side's signals are meaningless to the other. Protocols define the format of the data (where addresses and payload sit), the order of messages (who speaks first, when to acknowledge), the meaning of each message, the timing (timeouts, retransmits), and what to do on error. Without an agreed protocol, communication fails — like two people speaking different languages with no translator.

Two devices following the same rules: format, order, timing and what to do on error A protocol is the shared rules: format, order, timing and errors

Vocabulary Train
English Chinese Pinyin
protocol 协议 xié yì
14.1

Layered protocols

Networking is complex, so it is split into layers, each with one focused job, talking only to the layer above and below. Benefits: modularity 模块化 (replace one layer — say Ethernet with Wi-Fi — without touching the others), standardisation (vendors interoperate), and abstraction 抽象 (you ignore details handled elsewhere). The internet uses the TCP/IP protocol suite 协议栈 (4 layers).

Vocabulary Train
English Chinese Pinyin
layers céng
modularity 模块化 mó kuài huà
abstraction 抽象 chōu xiàng
protocol suite 协议栈 xié yì zhàn
14.1

TCP/IP protocol suite

Layer Purpose Examples
Application what the user program does HTTP, FTP, SMTP, IMAP
Transport end-to-end delivery between processes TCP, UDP
Internet routing packets between networks IP
Link sending bits over the physical medium Ethernet, Wi-Fi

A four-row stack: Application, Transport, Internet, Link, with sending going down the left and receiving going up the right, and example protocols on each layer The four layers of the TCP/IP protocol suite

Application layer

The application layer 应用层 gives services to user programs and defines the protocols they speak (HTTP for web, SMTP for email). This is where a programmer most often works.

Transport layer

The transport layer 传输层 delivers data end-to-end between processes, identified by port numbers 端口号. Two protocols:

TCP sets up a connection and delivers all data in order; UDP sends and forgets TCP connects and delivers in order; UDP sends and forgets

  • TCP 传输控制协议connection-oriented 面向连接: sets up a connection, ensures all data arrives in order, retransmits lost packets 数据包, controls flow. Reliable but with overhead. Used by HTTP, HTTPS, SMTP, FTP.
  • UDP 用户数据报协议connectionless 无连接: sends and forgets, with no acknowledgements or ordering. Low overhead, no guarantees. Used for streaming, DNS and gaming, where speed beats reliability.

Internet layer

The internet layer 网络层 carries packets between hosts using IP. Each packet has a source and destination IP address IP地址, and routers 路由器 forward it onward. It does not guarantee delivery — that is TCP's job.

A home router does this job for your house: it reads each packet's destination address and sends it on towards the internet, and back to the right device.

A black home Wi-Fi router with four upright antennas and a row of status lights along the front A home Wi-Fi router: it forwards packets between your devices and the internet

Before the router reaches the wider internet, a modem 调制解调器 connects the home to the internet provider over the provider's cable or phone line. Its lights show the link is up and online.

A tall black cable modem standing upright on a plain background, with a column of status lights down its front A cable modem connects a home network to the internet provider

Link layer

The link layer 链路层 sends bits over one physical link (Ethernet, Wi-Fi). It adds a frame header with MAC addresses MAC地址 and handles medium access (e.g. CSMA/CD 载波侦听多路访问 on Ethernet).

An Ethernet frame split into preamble, start of frame, Ethernet data and interpacket gap, with the data part expanded into destination and source MAC addresses, type/length, payload message and frame check sequence, each with its size in bytes The parts of a typical Ethernet frame

On a wired local network, a switch 交换机 joins many devices together. Each device plugs into a port with an Ethernet cable (an RJ45 plug), and the switch uses the MAC addresses in each frame to send it only to the correct port.

A small black 8-port Gigabit Ethernet switch on a plain background, its numbered RJ45 ports in a row along the front, each with a status light A network switch connects many wired devices on a local network

The physical link can be a copper wire, a radio signal (Wi-Fi), or a fibre-optic cable 光纤. In a fibre-optic cable, the bits travel as flashes of light through very thin strands of glass, which is fast and carries data a long way.

A bundle of fibre-optic strands fanning out against a dark background, each thin glass strand glowing with a point of blue-white light at its tip A fibre-optic cable: data travels as light through thin glass strands

A radio link can reach much further. A satellite dish 卫星天线 sends and receives radio signals to and from a satellite, carrying data to places that wired links cannot easily reach.

A round grey home satellite dish mounted on a house wall beside a window, with its feed arm reaching out to the front A satellite dish sends and receives data by radio over a long distance

Explore

Tap the four layers of the TCP/IP model

Explore each layer. Data travels DOWN the stack as it's sent (each layer adds its header) and back UP as it's received — and any layer can be swapped without touching the others.

Vocabulary Train
English Chinese Pinyin
application layer 应用层 yìng yòng céng
transport layer 传输层 chuán shū céng
port numbers 端口号 duān kǒu hào
TCP 传输控制协议 chuán shū kòng zhì xié yì
connection-oriented 面向连接 miàn xiàng lián jiē
packets 数据包 shù jù bāo
UDP 用户数据报协议 yòng hù shù jù bào xié yì
connectionless 无连接 wú lián jiē
internet layer 网络层 wǎng luò céng
IP address IP地址 IP dì zhǐ
routers 路由器 lù yóu qì
modem 调制解调器 tiáo zhì jiě tiáo qì
link layer 链路层 liàn lù céng
MAC addresses MAC地址 MAC dì zhǐ
CSMA/CD 载波侦听多路访问 zài bō zhēn tīng duō lù fǎng wèn
switch 交换机 jiāo huàn jī
fibre-optic 光纤 guāng xiān
satellite dish 卫星天线 wèi xīng tiān xiàn
14.1

Common application-layer protocols

  • HTTP 超文本传输协议 — browsers fetch web pages from servers (over TCP, port 80). HTTPS is HTTP over TLS — encrypted, port 443.
  • FTP 文件传输协议 — transfer files between client and server.
  • SMTP 简单邮件传输协议send email between client and server, and between servers. Receiving uses POP3 or IMAP.
  • POP3 — downloads email and usually deletes it from the server. IMAP — leaves email on the server and syncs across devices, so the same inbox appears everywhere.
  • BitTorrent — a peer-to-peer 对等网络 protocol; a file is split into pieces downloaded from many peers in parallel, so no single server carries all the load.

A tracker in the centre with peers around it — seeds, leeches and new peers — exchanging file pieces, with a key BitTorrent: a tracker helps peers find each other, then they share file pieces directly

Explore

Network route lab

Follow data from a device through network hardware and protocols.

Vocabulary Train
English Chinese Pinyin
HTTP 超文本传输协议 chāo wén běn chuán shū xié yì
FTP 文件传输协议 wén jiàn chuán shū xié yì
SMTP 简单邮件传输协议 jiǎn dān yóu jiàn chuán shū xié yì
peer-to-peer 对等网络 duì děng wǎng luò
14.2

Circuit switching vs packet switching

Syllabus
Candidates should be able to: Notes and guidance
Show understanding of circuit switching Benefits, drawbacks and where it is applicable
Show understanding of packet switching Benefits, drawbacks and where it is applicable Show understanding of the function of a router in packet switching Explain how packet switching is used to pass messages across a network, including the internet

Source: Cambridge International syllabus

Circuit switching

A dedicated path is set up between the two ends before any data is sent (circuit switching 电路交换), reserved for the whole conversation, then released. It gives reserved bandwidth 带宽 and in-order delivery, but is inefficient during silences and slow to set up. Classic example: the traditional telephone network.

A mesh of routers between device A and device B, with one path highlighted and reserved end-to-end for the whole call Circuit switching: one dedicated path is reserved end to end

Packet switching

The data is split into packets, each sent independently (packet switching 分组交换). Each packet carries the destination address; routers make per-packet decisions, so packets may take different routes and arrive out of order, and the destination reassembles them. It is efficient (one link is multiplexed 多路复用 across many conversations), robust (reroute around a failure), but has variable latency 延迟 and possible loss (TCP handles reliability). Used by the internet.

The same router mesh with packets shown as numbered coloured squares taking different routes from computer A to computer B, then reassembled in order at B Packet switching: packets travel independently and may take different routes

Aspect Circuit switching Packet switching
Path dedicated, reserved shared, per-packet
Setup time slow none
Bandwidth use inefficient efficient
Order in order may be out of order
Robustness one failure cuts the circuit reroute around failures
Suits constant-rate flows (voice) bursty flows (web, email)

Modern networks use packet switching for its efficiency and resilience.

Describing packet switching in a few sentences

A good exam answer: "The message is broken into small packets. Each packet carries the destination and source addresses and a sequence number. Each packet travels through the network independently, with routers choosing the next hop per packet. Packets may take different paths and arrive out of order. The destination uses the sequence numbers to reassemble the message, and missing packets can be requested again."

Worked example. A phone call and a large file download share a network. Which switching method suits each, and why? A phone call needs a steady stream with low delay, and it would suffer badly if pieces arrived late or out of order - so circuit switching suits it: a dedicated path is set up for the whole call and its capacity is reserved for the duration. A file download does not care about timing or arrival order, because the receiver reassembles it, and it benefits from using whatever capacity happens to be spare - so packet switching suits it: the file is split into packets that travel independently, each carrying source and destination addresses and a sequence number, with routers choosing a next hop per packet. Name the property of the traffic that decides it: reserved capacity and low delay for the call, efficiency and resilience for the download.

Explore

A packet's journey across the internet

Step through packet switching. The message is split up, each packet finds its own way, and the destination puts them back together — which is why the internet is so efficient and hard to break.

Vocabulary Train
English Chinese Pinyin
circuit switching 电路交换 diàn lù jiāo huàn
bandwidth 带宽 dài kuān
packet switching 分组交换 fēn zǔ jiāo huàn
multiplexed 多路复用 duō lù fù yòng
latency 延迟 yán chí
14.2

Exam tips

  • Explain why protocols and layers are used: each layer has one job and can change independently.
  • Place common protocols in the TCP/IP stack (HTTP/FTP/SMTP application; TCP/UDP transport; IP internet).
  • Compare circuit switching vs packet switching (a dedicated path vs independent packets) with a use for each.

Log in or create account

IGCSE & A-Level