IGCSE WJEC Computer Science: TCP/IP Key Revision Points | IGCSE WJEC 计算机:TCP/IP 考点精讲

📚 IGCSE WJEC Computer Science: TCP/IP Key Revision Points | IGCSE WJEC 计算机:TCP/IP 考点精讲

The Transmission Control Protocol/Internet Protocol (TCP/IP) suite is the foundational set of rules that governs how data travels across the internet and most private networks. For IGCSE WJEC Computer Science, a solid grasp of TCP/IP is not just about memorising acronyms — it is about understanding how reliability, addressing, routing and application services combine to make global communication possible. This revision guide unpacks every layer, protocol and process you need to succeed in your exam.

传输控制协议/互联网协议(TCP/IP)协议族是管理数据在互联网及大多数私有网络中传输的基础规则集。对 IGCSE WJEC 计算机科学课程而言,扎实掌握 TCP/IP 并非只是死记硬背缩写,而是理解可靠性、寻址、路由和应用服务如何协同实现全球通信。这份复习指南为你逐一拆解考试所需的每一层、每一种协议及关键过程。


1. What Is TCP/IP? | 什么是 TCP/IP?

TCP/IP stands for Transmission Control Protocol / Internet Protocol. It is not a single protocol but a complete suite of cooperating protocols that standardise how data is packetised, addressed, transmitted, routed and received across interconnected networks. Because it is open and vendor‑neutral, any device can use the same rules to join the internet.

TCP/IP 代表传输控制协议/互联网协议。它并非单一协议,而是一个完整、协同工作的协议族,用于规范数据在互联网络中如何打包、编址、传输、路由和接收。由于它开放且不受厂商限制,任何设备都可以使用同一套规则接入互联网。

Developed in the 1970s by DARPA, the TCP/IP model predates the seven‑layer OSI model but maps closely to it. Its simpler four‑layer structure is the framework your WJEC specification expects you to know in detail.

TCP/IP 于 20 世纪 70 年代由 DARPA 开发,虽然早于七层 OSI 模型,但两者紧密对应。其更简单的四层结构正是 WJEC 考纲要求你详细掌握的框架。


2. The Four‑Layer TCP/IP Model | 四层 TCP/IP 模型

The TCP/IP stack organises networking tasks into four abstraction layers. From top to bottom, they are:

TCP/IP 协议栈将网络任务组织为四个抽象层,自上而下依次为:

Application Layer (Layer 4): This highest layer provides protocols that software applications use to exchange data. Examples include HTTP for web browsing, SMTP for email and FTP for file transfers. It focuses purely on the meaning and structure of the data.

应用层(第 4 层): 最高层提供软件应用程序交换数据时使用的协议。例如 HTTP 用于网页浏览、SMTP 用于电子邮件、FTP 用于文件传输。它只关注数据的含义与结构。

Transport Layer (Layer 3): This layer is responsible for end‑to‑end communication and reliability. It hosts TCP, which guarantees ordered, error‑checked delivery, and UDP, which offers faster but connectionless delivery. It also uses port numbers to direct data to the correct application.

传输层(第 3 层): 该层负责端到端通信与可靠性。它包含 TCP,可保证有序且经过检错的数据交付,以及 UDP,提供更快速但无连接的交付。它还通过端口号将数据导向正确的应用程序。

Internet Layer (Layer 2): This layer handles logical addressing and routing. The fundamental protocol here is IP (Internet Protocol), which adds source and destination IP addresses and makes forwarding decisions. Companion protocols like ICMP (ping) also operate at this layer.

互联网层(第 2 层): 该层处理逻辑寻址与路由。此处最基本的协议是 IP(互联网协议),它添加源和目标 IP 地址并作出转发决策。ICMP(ping)等辅助协议也在这一层运行。

Network Access (Link) Layer (Layer 1): This lowest layer deals with the physical hardware and local network transmission. It covers MAC addresses, Ethernet frames, and how bits are placed onto the wire or radio signal. Protocols like ARP bridge IP addresses to physical addresses here.

网络接入(链路)层(第 1 层): 最底层负责物理硬件与本地网络传输。它涉及 MAC 地址、以太网帧以及比特如何被加载到线缆或无线信号上。ARP 等协议在此将 IP 地址桥接到物理地址。


3. IP Addressing and Subnet Masks | IP 地址与子网掩码

An IPv4 address is a 32‑bit number, usually written in dotted‑decimal notation like 192.168.1.10. The address is split into a network portion and a host portion. The dividing line is determined by the subnet mask, such as 255.255.255.0. Using a logical AND between the IP address and the subnet mask reveals the network address. A common shorthand is CIDR notation, e.g. 192.168.1.0/24, where /24 means the first 24 bits are the network part.

IPv4 地址是一个 32 位数字,通常写成点分十进制,如 192.168.1.10。该地址分为网络部分和主机部分,其分界线由子网掩码决定,例如 255.255.255.0。将 IP 地址与子网掩码进行逻辑与运算,即可得到网络地址。常见的简写形式是 CIDR 表示法,如 192.168.1.0/24,其中 /24 表示前 24 位是网络部分。

Devices on the same network share the same network portion; the host portion uniquely identifies each device. Routers use the network portion to forward packets towards the destination network. Private IP ranges (e.g. 10.x.x.x, 192.168.x.x) are reserved for local use and must be translated to a public IP by NAT at the gateway.

同一网络内的设备共享相同的网络部分;主机部分唯一标识每台设备。路由器利用网络部分将数据包向目标网络转发。私有 IP 范围(如 10.x.x.x、192.168.x.x)保留供本地使用,必须通过网关的 NAT 转换为公网 IP。


4. IP Routing and Packet Switching | IP 路由与数据包交换

Routing is the process of selecting paths for data packets across multiple networks. A router examines the destination IP address of an incoming packet, consults its routing table, and forwards the packet to the next‑hop router or the final destination if directly connected. Packet switching means each packet may take a different path and is forwarded independently, which increases resilience.

路由是跨多条网络为数据包选择路径的过程。路由器检查到达数据包的目标 IP 地址,查阅其路由表,并将数据包转发到下一跳路由器;若直连,则直接发送至最终目的地。数据包交换意味着每个数据包可走不同路径且独立转发,从而提升了网络弹性。

On the journey, the Time‑to‑Live (TTL) field in the IP header is decreased by one at each hop; if it reaches zero, the packet is discarded to prevent infinite looping. Intermediate routers never reassemble packets — that job belongs to the transport layer at the receiving host.

在传输过程中,IP 头部中的生存时间(TTL)字段每经过一跳就减 1;若减至零,数据包将被丢弃,以防止无限循环。中间路由器从不重组数据包——这项工作由接收主机的传输层负责。


5. Transmission Control Protocol (TCP) – Reliable Delivery | 传输控制协议(TCP)——可靠交付

TCP is a connection‑oriented protocol that guarantees data arrives complete, in order, and without errors. Before any application data is sent, TCP establishes a virtual connection through a three‑way handshake:

TCP 是一种面向连接的协议,可保证数据完整、有序且无差错地到达。在发送任何应用数据之前,TCP 通过三次握手建立虚拟连接:

1. The client sends a SYN (synchronise) packet with a random sequence number X.
2. The server replies with a SYN‑ACK, acknowledging X+1 and providing its own sequence number Y.
3. The client sends an ACK for Y+1. The connection is now open.

1. 客户端发送一个带有随机序列号 X 的 SYN(同步)包。
2. 服务器回复 SYN‑ACK,确认 X+1 并提供自己的序列号 Y。
3. 客户端发送针对 Y+1 的 ACK。此时连接建立。

Once data flows, TCP tracks every byte with sequence numbers and requires acknowledgements. If an ACK is not received within a timeout window, the segment is retransmitted. Flow control (via a sliding window) prevents overwhelming the receiver, and a four‑way handshake ensures a graceful connection termination.

数据传输过程中,TCP 使用序列号跟踪每个字节并要求确认。若在超时窗口内未收到 ACK,该报文段将重传。流量控制(通过滑动窗口)可防止接收方被淹没,而四次挥手确保连接的优雅终止。


6. User Datagram Protocol (UDP) – Fast and Lightweight | 用户数据报协议(UDP)——快速轻量

UDP is a connectionless transport protocol that sends data packets, called datagrams, without establishing a session or checking for delivery. It provides no acknowledgements, sequencing, or retransmission. The advantage is extremely low overhead and latency, making UDP ideal for time‑sensitive applications like live video streaming, VoIP, and online gaming where occasional packet loss is acceptable.

UDP 是一种无连接的传输协议,它发送称为数据报的数据包,不建立会话,也不检查交付情况。它不提供确认、排序或重传。其优点是开销极低、延迟极小,因此非常适合实时视频流、VoIP 和在线游戏等对时间敏感的应用,在这些场景中偶尔的丢包是可接受的。

UDP still uses port numbers and includes an optional checksum for error detection, but applications must handle any reliability themselves if needed. The table below highlights the contrasts between TCP and UDP.

UDP 仍使用端口号并包含可选的校验和用于差错检测,但应用程序若需要可靠性,必须自行处理。下表突出了 TCP 与 UDP 的区别。

Feature TCP UDP
Connection type Connection‑oriented Connectionless
Reliability Guaranteed delivery with ACKs Best‑effort, no ACKs
Ordering Packets reordered by sequence No sequencing
Speed Slower due to overhead Faster, lower latency
Typical uses Web browsing, email, file transfer Streaming, DNS lookups, online games

Knowing when to apply TCP versus UDP is a common exam question. Remember: TCP for reliability, UDP for speed.

何时使用 TCP 还是 UDP 是常见的考题。记住:TCP 追求可靠性,UDP 追求速度。


7. Common Application Layer Protocols | 常见应用层协议

Many well‑known protocols sit at the application layer. Your WJEC exam may ask you to identify them by function and associated port number.

许多知名协议位于应用层。WJEC 考试可能会要求你根据功能及关联端口号来识别它们。

HTTP (Hypertext Transfer Protocol) – Port 80: Used for transferring web pages from a server to a browser. HTTPS (HTTP Secure) uses port 443 and adds TLS/SSL encryption.

HTTP(超文本传输协议)– 端口 80: 用于从服务器向浏览器传输网页。HTTPS(HTTP 安全版)使用端口 443 并附加 TLS/SSL 加密。

FTP (File Transfer Protocol) – Ports 20 and 21: Transfers files between a client and a server. Control commands use port 21, while actual data transfer may use port 20.

FTP(文件传输协议)– 端口 20 和 21: 在客户端和服务器之间传输文件。控制命令使用端口 21,实际数据传输可能使用端口 20。

SMTP (Simple Mail Transfer Protocol) – Port 25: Sends outgoing email from a client to a mail server and between mail servers. For receiving, protocols like POP3 (port 110) and IMAP (port 143) are used.

SMTP(简单邮件传输协议)– 端口 25: 用于将电子邮件从客户端发送至邮件服务器,以及在邮件服务器之间传递。接收邮件则使用 POP3(端口 110)和 IMAP(端口 143)。

DNS (Domain Name System) – Port 53: Translates human‑readable domain names (like http://www.example.com) into IP addresses. It typically uses UDP for queries and TCP for zone transfers.

DNS(域名系统)– 端口 53: 将易读的域名(如 http://www.example.com)翻译为 IP 地址。它通常使用 UDP 进行查询,使用 TCP 进行区域传输。

DHCP (Dynamic Host Configuration Protocol) – Ports 67/68: Automatically assigns IP configuration (address, subnet mask, gateway, DNS) to devices when they join a network.

DHCP(动态主机配置协议)– 端口 67/68: 当设备加入网络时,自动为其分配 IP 配置(地址、子网掩码、网关、DNS)。


8. MAC Addresses and ARP | MAC 地址与 ARP 协议

At the Network Access layer, every network interface card (NIC) is identified by a unique 48‑bit MAC address, usually written as six hexadecimal pairs (e.g. 00:1A:2B:3C:4D:5E). While IP addresses can change with location, the MAC address is ‘burned in’ at manufacture and stays fixed.

在网络接入层,每个网络接口卡(NIC)由一个唯一的 48 位 MAC 地址标识,通常写作六组十六进制数字(例如 00:1A:2B:3C:4D:5E)。IP 地址可随位置变化,而 MAC 地址在制造时“烧录”并保持不变。

When a device wants to send data to a local IP address, it must discover the corresponding MAC address. The Address Resolution Protocol (ARP) broadcasts a request (“Who has 192.168.1.10?”) onto the local network. The device with that IP replies with its MAC address, and the mapping is cached in an ARP table.

当设备希望向本地 IP 地址发送数据时,必须发现对应的 MAC 地址。地址解析协议(ARP)在本地网络广播一个请求(“谁拥有 192.168.1.10?”)。拥有该 IP 的设备回复其 MAC 地址,该映射随后缓存在 ARP 表中。

For destinations outside the local network, the sender uses the default gateway’s MAC address, allowing the router to forward the frame onward.

对于本地网络以外的目的地,发送方使用默认网关的 MAC 地址,从而使路由器能够继续转发帧。


9. Port Numbers and Sockets | 端口号与套接字

IP addresses identify a host, but a single host runs many applications. Port numbers (16‑bit values, 0–65535) allow the transport layer to deliver incoming data to the correct process. Well‑known ports (0–1023) are reserved for standard services: port 80 for HTTP, 443 for HTTPS, 25 for SMTP, etc. Registered ports range from 1024 to 49151, while dynamic/private ports (49152–65535) are used for temporary client connections.

IP 地址标识了一台主机,但同一台主机可能运行许多应用程序。端口号(16 位数值,0–65535)使传输层能将传入的数据交付给正确的进程。知名端口(0–1023)保留给标准服务:80 用于 HTTP,443 用于 HTTPS,25 用于 SMTP 等。注册端口范围为 1024–49151,而动态/私有端口(49152–65535)用于临时客户端连接。

A socket is the combination of an IP address and a port number, often written as IP:port (e.g., 192.168.1.10:80). A complete connection is identified by the pair of sockets at both ends. This pairing ensures that even if several browser tabs request the same web server, each session is kept separate.

套接字是 IP 地址与端口号的组合,常写作 IP:port(如 192.168.1.10:80)。一条完整连接由两端的套接字对来标识。这一配对可确保即使多个浏览器标签页请求同一 Web 服务器,每个会话也能被隔离开。


10. Error Detection and Checksums | 差错检测与校验和

Both TCP and UDP include a checksum field in their headers to help detect errors introduced during transmission. The sender performs a simple mathematical computation on the segment’s data (often ones‑complement addition) and stores the result. The receiver repeats the calculation on the received data; if the values match, the segment is assumed error‑free. If they differ, the segment is discarded.

TCP 和 UDP 都在其头部包含一个校验和字段,以帮助检测传输过程中引入的差错。发送方对报文段的数据执行简单的数学运算(通常为二进制反码加法),并存储结果。接收方对收到的数据重复该计算;若两值相符,则认为报文段无差错。若不符,则丢弃该报文段。

In TCP, a failed checksum triggers a retransmission because no ACK will be sent. In UDP, the packet is simply dropped — it is up to the application to notice and compensate. The IP header itself also contains a checksum, though it covers only the header fields, not the payload.

在 TCP 中,校验和失败会因未收到 ACK 而触发重传。而在 UDP 中,数据包直接被丢弃——应用程序需自行察觉并补偿。IP 头部本身也包含一个校验和,但仅覆盖头部字段,不含有效载荷。


11. Data Packets and Encapsulation | 数据包与封装

As data passes down the TCP/IP stack, each layer wraps the data from the layer above with its own header — a process called encapsulation. On the sending side:

当数据沿 TCP/IP 协议栈向下传递时,每一层都为上层数据包裹上自己的头部——这一过程称为封装。在发送方:

1. Application → Transport: The data stream is broken into segments. TCP adds a header containing sequence and ACK numbers, flags, and port numbers.

1. 应用层 → 传输层: 数据流被切分为报文段。TCP 添加包含序列号、确认号、标志和端口号的头部。

2. Transport → Internet: The segment is placed inside an IP datagram with a header bearing source and destination IP addresses, TTL, and protocol identifier.

2. 传输层 → 互联网层: 报文段被放入 IP 数据报中,该数据报头部包含源和目标 IP 地址、TTL 以及协议标识符。

3. Internet → Network Access: The IP datagram is encased in a frame (e.g. Ethernet frame) that adds source and destination MAC addresses and a cyclic redundancy check (CRC) trailer.

3. 互联网层 → 网络接入层: IP 数据报被封装进帧(如以太网帧)中,帧添加了源和目标 MAC 地址以及循环冗余校验(CRC)尾部。

At the receiving end, the opposite process — decapsulation — strips headers at each layer and finally delivers the original application data.

在接收端,相反的过程——解封装——在每一层剥离头部,最终交付原始应用数据。


12. Exam Tips and Quick Summary | 考试小贴士与速记

Published by TutorHao | IGCSE Computer Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading