📚 GCSE OCR Computer Science: TCP/IP Revision Guide | GCSE OCR 计算机:TCP/IP 考点精讲
Welcome to the ultimate GCSE OCR Computer Science revision guide on the TCP/IP protocol stack. This article covers all essential exam topics, including the four-layer model, protocols, IP addressing, encapsulation, and the differences between TCP and UDP. Understanding TCP/IP is crucial for the 'Computer networks, connections and protocols' topic in the OCR J277 specification.
欢迎阅读 GCSE OCR 计算机科学 TCP/IP 协议栈的终极复习指南。本文涵盖所有核心考点,包括四层模型、各种协议、IP 地址、封装过程以及 TCP 与 UDP 的区别。理解 TCP/IP 对于 OCR J277 大纲中“计算机网络、连接与协议”这一单元至关重要。
1. The Role of TCP/IP in Networking | TCP/IP 在网络中的角色
TCP/IP stands for Transmission Control Protocol / Internet Protocol. It is the fundamental set of rules that governs how data is sent and received across the Internet and most modern networks. The suite defines how data is broken into packets, addressed, transmitted, routed, and reassembled at the destination.
TCP/IP 代表传输控制协议 / 互联网协议。它是管控数据如何通过互联网和大多数现代网络发送和接收的一套基本规则。该协议族定义了数据如何被拆分为数据包、寻址、传输、路由以及在目的地重组。
For the GCSE OCR exam, you need to know that TCP/IP is a protocol stack organised into four layers, each responsible for different aspects of communication. This layered approach makes it easier to develop, troubleshoot, and upgrade network technologies independently.
在 GCSE OCR 考试中,你需要了解 TCP/IP 是一个分为四层的协议栈,每一层负责通信的不同方面。这种分层方法使得独立开发、故障排除和升级网络技术变得更加容易。
The term 'stack' describes how data passes down through the layers on the sending device and up through the layers on the receiving device, with each layer adding or removing its own header information.
“栈”这个词描述了数据如何在发送设备上逐层向下传递,在接收设备上逐层向上传递,每一层都会添加或移除自己的头部信息。
2. The Four-Layer TCP/IP Model | 四层 TCP/IP 模型
The TCP/IP model simplifies networking into four logical layers: Application, Transport, Internet, and Network Access (also called the Link layer). This model is not identical to the seven-layer OSI model but serves as a practical reference for real-world Internet communications.
TCP/IP 模型将网络简化为四个逻辑层:应用层、传输层、互联网层和网络接入层(也叫链路层)。该模型不同于七层的 OSI 模型,但为实际互联网通信提供了一个实用的参考框架。
| Layer | Main Function | Examples |
|---|---|---|
| Application | Provides network services directly to user applications | HTTP, HTTPS, FTP, SMTP |
| Transport | Manages end-to-end delivery, error checking, and flow control | TCP, UDP |
| Internet | Handles logical addressing and routing of packets across networks | IP (IPv4, IPv6) |
| Network Access | Controls the physical transmission of data over hardware (MAC addressing, framing) | Ethernet, Wi-Fi |
The Application layer is closest to the user and contains high-level protocols. The Transport layer ensures data arrives correctly, offering either reliable (TCP) or fast (UDP) communication. The Internet layer routes packets using IP addresses, while the Network Access layer deals with the physical hardware and frame delivery within a local network segment.
应用层最接近用户,包含高层协议。传输层确保数据正确到达,提供可靠(TCP)或快速(UDP)的通信。互联网层使用 IP 地址路由数据包,而网络接入层处理物理硬件以及本地网络段内的帧传输。
3. Application Layer Protocols | 应用层协议
The Application layer provides protocols that applications use to exchange data. Each protocol normally has an associated port number that the Transport layer uses to deliver messages to the correct service.
应用层提供应用程序用于交换数据的协议。每个协议通常都有一个关联的端口号,传输层利用该端口将消息传递给正确的服务。
HTTP (Hypertext Transfer Protocol) is used to request and deliver web pages. It uses port 80 by default. HTTPS is the secure version using TLS/SSL encryption and operates on port 443.
HTTP(超文本传输协议)用于请求和交付网页,默认使用端口 80。HTTPS 是使用 TLS/SSL 加密的安全版本,运行在端口 443。
FTP (File Transfer Protocol) handles the transfer of files between a client and a server. It uses ports 20 and 21. SMTP (Simple Mail Transfer Protocol) is used to send emails (port 25 or 587), while POP3 (port 110) and IMAP (port 143) are used to retrieve emails from a mail server.
FTP(文件传输协议)处理客户端与服务器之间的文件传输,使用端口 20 和 21。SMTP(简单邮件传输协议)用于发送邮件(端口 25 或 587),而 POP3(端口 110)和 IMAP(端口 143)用于从邮件服务器获取电子邮件。
DNS (Domain Name System) converts human-readable domain names (like aleveler.com) into IP addresses. It operates on port 53. For example, when you type a URL, DNS helps your browser find the correct server.
DNS(域名系统)将人类可读的域名(例如 aleveler.com)转换为 IP 地址,运行在端口 53。例如,当你输入一个网址时,DNS 帮助浏览器找到正确的服务器。
4. Transport Layer – TCP (Transmission Control Protocol) | 传输层 – TCP(传输控制协议)
TCP provides reliable, connection-oriented communication. Before any data is sent, a virtual connection is established between the sender and receiver using a process called the three-way handshake.
TCP 提供可靠的、面向连接的通信。在发送任何数据之前,发送方与接收方之间会通过一个称为三次握手的过程建立虚拟连接。
1. Client → SYN → Server
2. Client ← SYN-ACK ← Server
3. Client → ACK → Server
This handshake synchronises sequence numbers and confirms both sides are ready. Once established, TCP segments data and adds a header containing sequence and acknowledgment numbers. The receiver sends back acknowledgments (ACKs) for each segment received correctly. If an ACK is not received in time, the sender retransmits the segment.
这次握手同步序列号并确认双方准备就绪。连接建立后,TCP 对数据进行分段,并添加包含序列号和确认号的头部。接收方为每个正确收到的段发回确认(ACK)。如果未及时收到 ACK,发送方将重新传输该段。
TCP also provides flow control and error detection, making it suitable for applications where data integrity is vital, such as web browsing (HTTP), file transfers (FTP), and email (SMTP).
TCP 还提供流量控制和错误检测,因此适合数据完整性至关重要的应用,如网页浏览(HTTP)、文件传输(FTP)和电子邮件(SMTP)。
5. Transport Layer – UDP (User Datagram Protocol) | 传输层 – UDP(用户数据报协议)
UDP is a simpler, connectionless protocol. It sends datagrams without establishing a connection, which means there is no handshake, no sequencing, and no guarantee of delivery. If a datagram is lost, it is not resent.
UDP 是一种更简单、无连接的协议。它不建立连接就发送数据报,这意味着没有握手、没有序列号,也不保证送达。如果数据报丢失,不会重发。
UDP's lack of overhead makes it much faster and more efficient for real-time applications where occasional data loss is acceptable but low latency is critical. Examples include online gaming, video and voice streaming (VoIP), and live broadcasts.
UDP 没有额外开销,因此速度更快、效率更高,特别适合允许偶尔数据丢失但延迟必须极低的实时应用。例如在线游戏、视频和语音流(VoIP)以及直播。
Exam questions often ask you to justify choosing TCP or UDP for a given scenario. For instance, a banking application would use TCP because accuracy is essential; a sports live streaming service would use UDP because speed is more important than perfect delivery.
考试常常要求你为给定场景选择 TCP 或 UDP 并说明理由。例如,银行应用会使用 TCP 因为准确性至关重要;体育直播服务会使用 UDP 因为速度比完美交付更重要。
6. The Internet Layer and IP | 互联网层与 IP
At the core of the Internet layer is the Internet Protocol (IP). It is responsible for logical addressing and routing packets across multiple networks. Each device on an IP network is assigned a unique IP address, which allows routers to forward packets hop-by-hop toward their destination.
互联网层的核心是网际协议(IP),负责逻辑寻址以及跨多个网络路由数据包。IP 网络中的每台设备都被分配唯一的 IP 地址,路由器据此逐跳转发数据包直至目的地。
IP is connectionless - each packet is treated independently and may take different paths through the network. This is the foundation of packet switching. Routers examine the destination IP address in the packet header and consult their routing tables to decide the next hop.
IP 是无连接的——每个数据包独立处理,可能经由不同路径穿越网络。这就是分组交换的基础。路由器检查数据包头部中的目的 IP 地址,并查阅路由表决定下一跳。
The Internet layer also handles fragmentation when a packet is too large for a network segment. IP fragments the packet and the receiving host reassembles it using a fragment offset field.
当数据包过大无法通过某个网络段时,互联网层还负责分片。IP 将数据包分片,接收主机会使用分片偏移字段重新组装。
7. IPv4 and IPv6 Addressing | IPv4 与 IPv6 地址
IPv4 uses 32-bit addresses, written in dotted decimal notation as four octets (e.g., 192.168.0.1). This allows for about 2³² (roughly 4.3 billion) unique addresses. Due to the rapid growth of Internet-connected devices, the IPv4 address space has been exhausted.
IPv4 使用 32 位地址,用点分十进制表示为四个八位组(例如 192.168.0.1),可提供大约 2³²(约 43 亿)个唯一地址。由于联网设备急速增长,IPv4 地址空间已经耗尽。
IPv6 was developed to solve this limitation. It uses 128-bit addresses, typically written as eight groups of four hexadecimal digits separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). IPv6 supports 2¹²⁸ addresses, which is an astronomically large number.
IPv6 为解决此限制而开发,使用 128 位地址,通常写成八组十六进制数字,用冒号分隔(例如 2001:0db8:85a3:0000:0000:8a2e:0370:7334)。IPv6 支持 2¹²⁸ 个地址,数量极其庞大。
IPv6 also introduces improved features such as simplified header format, built-in security (IPsec), and more efficient routing. In the exam you may be asked to compare the two addressing schemes in terms of address length, format, and availability.
IPv6 还引入了改进特性,如简化的头部格式、内置安全性(IPsec)和更高效的路由。考试中你可能需要比较这两种寻址方案的地址长度、格式和可用性。
8. Network Access (Link) Layer | 网络接入层(链路层)
The Network Access layer controls the physical transmission of data on the local network. It defines how bits are converted into electrical, optical, or radio signals and how frames are structured for the specific transmission medium (e.g., Ethernet cable or Wi-Fi radio waves).
网络接入层控制数据在本地网络上的物理传输。它定义了如何将比特转换为电信号、光信号或无线电波,以及如何根据特定的传输介质(以太网电缆或 Wi-Fi 无线电波)构建帧。
Every network interface card (NIC) has a hard-coded MAC (Media Access Control) address, which is a 48-bit identifier used to direct frames to the correct device within a local area network. While IP addresses route packets across the globe, MAC addresses enable frame delivery between devices on the same network segment.
每块网络接口卡(NIC)都有一个固化的MAC(媒体访问控制)地址,这是一个 48 位标识符,用于在局域网内将帧发送至正确的设备。IP 地址负责在全球范围内路由数据包,而 MAC 地址则在同一网段内实现设备间的帧传输。
Common technologies at this layer include Ethernet (wired) and Wi-Fi (wireless). The layer adds a frame header (containing source and destination MAC addresses) and a trailer for error checking, creating the final frame ready for transmission.
这一层的常见技术包括以太网(有线)和 Wi-Fi(无线)。该层会添加帧头部(包含源和目的 MAC 地址)以及用于差错校验的尾部,最终形成准备传输的帧。
9. Data Encapsulation and Decapsulation | 数据封装与解封装
As data moves down the protocol stack on the sending device, each layer wraps the data with its own header (and sometimes a trailer). This process is called encapsulation. The resulting unit of data is given a new name at each layer.
当数据在发送设备上沿着协议栈向下移动时,每一层都用自己的头部(有时还有尾部)包裹数据,这个过程称为封装。每一层产生的数据单元都有一个新名称。
Original Data → TCP Segment (or UDP Datagram) → IP Packet → Ethernet Frame → Bits
At the Application layer, data is simply the user payload. The Transport layer adds a TCP or UDP header, creating a segment (TCP) or datagram (UDP). The Internet layer adds an IP header, forming a packet. Finally, the Network Access layer adds a frame header and trailer, generating a frame that is transmitted as bits.
在应用层,数据只是用户负载。传输层添加 TCP 或 UDP 头部,生成段(TCP)或数据报(UDP)。互联网层添加 IP 头部,形成数据包。最后,网络接入层添加帧头部和尾部,生成帧并以比特流的形式发送出去。
On the receiving device, the reverse process, decapsulation, occurs: each layer removes the corresponding header, checks for errors, and passes the payload upward until the original data reaches the application.
在接收设备上,发生相反的过程,即解封装:每一层移除相应的头部、检查错误,并将负载向上传递,直到原始数据到达应用层。
10. IP Addresses vs MAC Addresses | IP 地址与 MAC 地址
Both IP addresses and MAC addresses are essential for network communication, but they serve different purposes. An IP address is a logical address that identifies a device on an internetwork and is used for routing packets from source to destination across different networks. It can be assigned manually or dynamically (via DHCP) and can change when the device moves to a different network.
IP 地址和 MAC 地址都是网络通信所必需的,
Published by TutorHao | GCSE Computer Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图