Unit 4: Computer Systems and Networks
单元 4:计算机系统与网络
Explore how networks transfer data and keep working through failures. Compare sequential, parallel, and distributed computing solutions.
探索网络如何传输数据并在发生故障时继续运行,再比较顺序计算、并行计算与分布式计算方案。
The Internet
互联网
- A computing device can run a program; a computing system is devices and programs working together. A computer network connects devices that can send or receive data and is a type of computing system. (CSN-1.A.1, CSN-1.A.2, CSN-1.A.3, CSN-1.A.4)
- A path is a sequence of directly connected devices from sender to receiver; routing finds a path. Bandwidth is the maximum data sent per fixed time, usually measured in bits per second. (CSN-1.A.5, CSN-1.A.6, CSN-1.A.7, CSN-1.A.8)
- The Internet connects networks using standardized, open protocols. A protocol is an agreed set of rules; open protocols make it easy to connect more devices. Access requires a connection to an Internet-connected device. (CSN-1.B.1, CSN-1.B.2, CSN-1.B.3, CSN-1.B.4)
- Internet routing is usually dynamic, not specified in advance. Scalability is the capacity to change size or scale for new demands; the Internet was designed to be scalable. (CSN-1.B.5, CSN-1.B.6, CSN-1.B.7)
- Internet data streams contain chunks encapsulated in packets. Packets carry data and metadata for routing and reassembly; they can arrive in order, out of order, or not at all. IP, TCP, and UDP are common Internet protocols. (CSN-1.C.1, CSN-1.C.2, CSN-1.C.3, CSN-1.C.4)
- The World Wide Web is a system of linked pages, programs, and files. It uses the Internet and the HTTP protocol. (CSN-1.D.1, CSN-1.D.2, CSN-1.D.3)
- 计算设备(computing device)可以运行程序;计算系统(computing system)是为共同目的协作的设备和程序。计算机网络(computer network)连接能够发送或接收数据的设备,是一种计算系统。(CSN-1.A.1, CSN-1.A.2, CSN-1.A.3, CSN-1.A.4)
- 路径(path)是从发送方到接收方的一串直接相连的设备;路由(routing)寻找这样的路径。带宽(bandwidth)是固定时间内可发送的数据最大量,通常以比特每秒计量。(CSN-1.A.5, CSN-1.A.6, CSN-1.A.7, CSN-1.A.8)
- 互联网(Internet)使用标准化的开放协议连接各个网络。协议(protocol)是一组约定的规则;开放协议使连接更多设备更容易。接入互联网需要连接到已接入互联网的设备。(CSN-1.B.1, CSN-1.B.2, CSN-1.B.3, CSN-1.B.4)
- 互联网路由通常是动态的,不预先指定。可扩展性(scalability)是系统为满足新需求而改变大小或规模的能力;互联网的设计具有可扩展性。(CSN-1.B.5, CSN-1.B.6, CSN-1.B.7)
- 互联网数据流(data stream)中的数据块被封装在数据包(packet)中。数据包携带数据和用于路由及重新组装的元数据(metadata);它们可能按序、乱序到达,也可能根本不到达。IP、TCP 和 UDP 是常见的互联网协议。(CSN-1.C.1, CSN-1.C.2, CSN-1.C.3, CSN-1.C.4)
- 万维网(World Wide Web)是由相互链接的页面、程序和文件组成的系统。它使用互联网和 HTTP 协议。(CSN-1.D.1, CSN-1.D.2, CSN-1.D.3)
Devices, paths, and bandwidth
设备、路径与带宽
Computers, tablets, servers, routers, and smart sensors are examples of computing devices. In a network path, each consecutive pair of devices is directly connected. Routing finds a path from the sender to the receiver.
计算机、平板电脑、服务器、路由器和智能传感器都是计算设备的例子。在网络路径中,每两个相邻设备都直接相连。路由负责寻找从发送方到接收方的路径。
Bandwidth describes a maximum rate, not the amount of data in a single message. For example, a bandwidth of 8 million bits per second allows at most 8 million bits to be sent in one second.
带宽描述的是最大速率,而不是单条消息的数据量。例如,带宽为每秒 800 万比特时,一秒内最多可发送 800 万比特。
Open protocols and packets
开放协议与数据包
The Internet is a network of interconnected networks. Its open, standardized protocols let devices follow shared rules, making it easier to connect additional devices. Its design supports growth as demands change.
互联网是由相互连接的网络组成的网络。开放且标准化的协议让设备遵循共同规则,使连接更多设备更容易。互联网的设计支持随需求变化而扩展。
A data stream is sent in packets. Each packet contains a data chunk and metadata used for routing and reassembly. Routes are usually chosen dynamically, and arrival order is not guaranteed.
数据流以数据包的形式发送。每个数据包都包含一个数据块,以及用于路由和重新组装的元数据。路径通常是动态选择的,数据包不保证按序到达。
The Web and the Internet
万维网与互联网
The Web uses the Internet to connect linked pages, programs, and files. HTTP is a Web protocol. The Web is not the same thing as the Internet.
万维网使用互联网来连接相互链接的页面、程序和文件。HTTP 是万维网使用的协议。万维网与互联网不是同一个概念。
Sender A and receiver E are connected through routers. Direct links are A–B, B–E, A–C, C–D, and D–E. A sends a message in packets P1, P2, and P3. E receives P2 first, then P1; P3 does not arrive. What paths are possible, and can E reassemble the complete message from the received packets?
发送方 A 和接收方 E 通过路由器连接。直接连接分别为 A–B、B–E、A–C、C–D 和 D–E。A 将一条消息分成数据包 P1、P2 和 P3 发送。E 先收到 P2,再收到 P1;P3 没有到达。有哪些可能的路径?E 能否仅用收到的数据包重新组装完整消息?
- A–B–E and A–C–D–E are both paths because each consecutive pair is directly connected.
- Routing finds a path. Internet routing is usually dynamic, so do not assume a path was fixed in advance.
- The received packets arrived out of order. Their metadata can be used for reassembly, but P3 is missing.
- Answer: Both listed paths are possible. E cannot reassemble the complete message from only P1 and P2.
- A–B–E 和 A–C–D–E 都是路径,因为每两个相邻设备都直接相连。
- 路由会寻找路径。互联网路由通常是动态的,因此不要假定路径已预先固定。
- 收到的数据包是乱序到达的。元数据可用于重新组装,但 P3 缺失。
- 答案:列出的两条路径都可能使用。E 仅凭 P1 和 P2 无法重新组装完整消息。
A common wrong answer is that all packets must follow one fixed path and arrive in the order sent. Internet routing is usually dynamic, and packets can arrive out of order or not at all. Another trap is treating the Web as the entire Internet: the Web uses the Internet.
常见错误答案是:所有数据包必须沿同一条固定路径,并按发送顺序到达。互联网路由通常是动态的,数据包可能乱序到达,也可能根本不到达。另一个陷阱是把万维网当作整个互联网:万维网使用互联网。
A possible path is not necessarily the path a packet takes. In the example, knowing the network links gives possible routes, but it does not reveal which route carried each packet. Similarly, bandwidth is a maximum rate, not proof that data is always sent at that rate.
可能的路径不一定是数据包实际经过的路径。在例题中,知道网络连接只能确定可能的路线,不能确定每个数据包实际经过了哪条路线。同样,带宽是最大速率,不能证明数据总是以该速率发送。
Fault Tolerance
容错(fault tolerance)
- The Internet is engineered for fault tolerance, using abstractions for routing and transmitting data. (CSN-1.E.1)
- Redundancy adds components to mitigate failures. Multiple paths between connected devices are one form of network redundancy. (CSN-1.E.2, CSN-1.E.3)
- If an Internet device or connection fails, subsequent data takes another route if one is available. (CSN-1.E.4)
- A fault-tolerant system keeps functioning despite failures. This lets users continue using the network when components fail unexpectedly, sometimes in groups. (CSN-1.E.5)
- Redundancy often costs extra resources but can provide fault tolerance. (CSN-1.E.6)
- Multiple routing options increase Internet reliability and help it scale to more devices and people. (CSN-1.E.7)
- 互联网被设计为具有容错能力,并使用抽象(abstraction)来进行路由(routing)和数据传输。 (CSN-1.E.1)
- 冗余(redundancy)通过增加组件来减轻故障的影响。连接的设备之间有多条路径是网络冗余的一种形式。 (CSN-1.E.2, CSN-1.E.3)
- 如果互联网中的设备或连接发生故障,后续数据会在有其他路线可用时改走其他路线。 (CSN-1.E.4)
- 容错系统在发生故障时仍能继续运行。这使用户在组件意外发生故障,有时甚至成组发生故障时,仍能使用网络。 (CSN-1.E.5)
- 冗余通常需要额外资源,但可以提供容错能力。 (CSN-1.E.6)
- 多种路由选择提高了互联网的可靠性,也帮助互联网扩展以支持更多设备和用户。 (CSN-1.E.7)
Routes, failures, and trade-offs
路线、故障与权衡
Routing abstractions help the Internet direct data without requiring users to manage each connection. If one route fails, another route can allow communication to continue. Extra connections require resources, so redundancy has a cost as well as a benefit.
路由抽象帮助互联网引导数据传输,无须用户管理每一条连接。如果一条路线发生故障,另一条路线可以让通信继续。额外连接需要资源,因此冗余既有成本,也有好处。
Exam pattern: trace the available paths after the stated failure. If every path between the devices uses the failed component, those devices cannot communicate through that network. Do not assume that an alternate path exists.
考试常见题型:在指定故障发生后,追踪仍可用的路径。如果两台设备之间的所有路径都经过发生故障的组件,它们就无法通过该网络通信。不要假设一定存在备用路径。
A network has connections A–B, B–D, A–C, C–D, and D–E. Can A still reach E if A–B fails? What if D–E fails instead?
一个网络有连接 A–B、B–D、A–C、C–D 和 D–E。如果 A–B 发生故障,A 还能到达 E 吗?如果换成 D–E 发生故障呢?
- Before a failure, A can reach D through either B or C, then reach E through D–E.
- If A–B fails, A can still reach E along A–C–D–E. The alternate path provides fault tolerance for that failure.
- If D–E fails instead, neither route to D can reach E. Every path from A to E uses D–E.
- Answer: A can reach E after A–B fails, but not after D–E fails. D–E is a vulnerability in this network.
- 故障发生前,A 可以经 B 或 C 到达 D,再通过 D–E 到达 E。
- 如果 A–B 发生故障,A 仍可沿 A–C–D–E 到达 E。备用路径使网络能够容忍这一故障。
- 如果换成 D–E 发生故障,两条到达 D 的路线都无法再通向 E。因为 A 到 E 的每条路径都经过 D–E。
- 答案:A–B 故障后,A 仍可到达 E;D–E 故障后则不能。D–E 是该网络中的一个薄弱点。
Parallel and Distributed Computing
并行与分布式计算
- Sequential computing performs operations one at a time in order. Parallel computing breaks a program into smaller sequential operations, some performed simultaneously. Distributed computing uses multiple devices to run a program. (CSN-2.A.1, CSN-2.A.2, CSN-2.A.3)
- Compare efficiency by the time solutions take for the same task. Sequential time is the sum of all steps; parallel time is the time of the sequential portions plus the longest simultaneous task. (CSN-2.A.4, CSN-2.A.5, CSN-2.A.6)
- Speedup equals sequential time divided by parallel time. (CSN-2.A.7)
- Parallel solutions have sequential and parallel portions and can scale more effectively than sequential solutions. The sequential portion limits the benefit of adding more parallelism. (CSN-2.B.1, CSN-2.B.2, CSN-2.B.5)
- Distributed computing can solve problems too demanding for one computer in processing time or storage, and can solve much larger problems faster. (CSN-2.B.3, CSN-2.B.4)
- 顺序计算(sequential computing)按顺序一次执行一个操作。并行计算(parallel computing)将程序分成较小的顺序操作,其中一些同时执行。分布式计算(distributed computing)使用多个设备运行程序。(CSN-2.A.1, CSN-2.A.2, CSN-2.A.3)
- 比较完成同一任务所需的时间,可以比较解法的效率。顺序时间是所有步骤时间之和;并行时间是顺序部分的时间加上同时执行的任务中最长的时间。(CSN-2.A.4, CSN-2.A.5, CSN-2.A.6)
- 加速比(speedup)等于顺序时间除以并行时间。(CSN-2.A.7)
- 并行解法包含顺序部分和并行部分,通常比顺序解法更容易有效扩展。顺序部分限制了增加并行度带来的收益。(CSN-2.B.1, CSN-2.B.2, CSN-2.B.5)
- 分布式计算可以解决单台计算机因处理时间或存储需求而无法解决的问题,也可以更快地解决规模大得多的问题。(CSN-2.B.3, CSN-2.B.4)
Compare the models
比较计算模型
A sequential solution completes each operation before the next. A parallel solution can run independent operations at the same time, while each smaller operation is itself sequential. A distributed solution uses multiple devices; using multiple devices and performing operations simultaneously describe different aspects of a solution.
顺序解法在完成一个操作后才执行下一个操作。并行解法可以同时运行相互独立的操作,而每个较小操作本身仍按顺序执行。分布式解法使用多个设备;使用多个设备与同时执行操作描述的是解法的不同方面。
To compare solutions, use the time each takes to complete the same task. For a parallel stage in which tasks start together, the stage finishes when its longest task finishes. Add that time to the time for the sequential stages.
比较解法时,要看各解法完成同一任务所需的时间。在任务同时开始的并行阶段,最长的任务完成时,该阶段才结束。将这段时间与各顺序阶段的时间相加。
A task requires 2 seconds of preparation, three independent operations taking 4, 6, and 8 seconds, and 2 seconds to finish. A sequential solution runs every operation one at a time. A parallel solution runs the three independent operations simultaneously after preparation, then finishes. What are the times and the speedup?
一项任务需要 2 秒准备,接着完成三个相互独立的操作,分别需要 4、6、8 秒,最后需要 2 秒收尾。顺序解法一次执行一个操作。并行解法在准备之后同时执行三个独立操作,然后收尾。两种解法分别需要多少时间,加速比是多少?
- Sequential time: 2 + 4 + 6 + 8 + 2 = 22 seconds.
- The parallel stage takes 8 seconds, because the solution must wait for its longest operation.
- Parallel time: 2 + 8 + 2 = 12 seconds. Speedup: 22 / 12 = 11 / 6, or about 1.83.
- Answer: The parallel solution takes 12 seconds instead of 22 seconds and is about 1.83 times as fast for this task.
- 顺序时间:2 + 4 + 6 + 8 + 2 = 22 秒。
- 并行阶段需要 8 秒,因为解法必须等待最长的操作完成。
- 并行时间:2 + 8 + 2 = 12 秒。加速比:22 / 12 = 11 / 6,约为 1.83。
- 答案:并行解法需要 12 秒,而顺序解法需要 22 秒。对这项任务而言,前者的速度约为后者的 1.83 倍。
Unit 4 MCQ Patterns That Show Up Every Year
单元 4 每年都会出现的选择题套路
Computer Systems and Networks accounts for 11–15% of the multiple-choice exam. Expect network scenarios, questions about reliability, and comparisons of computing time or speedup.
计算机系统与网络(Computer Systems and Networks)占选择题考试的 11–15%。题目可能涉及网络场景、可靠性,以及计算时间或加速比的比较。
Flashcards, Click to Flip
闪卡(点击翻面)
Unit 4, Practice Quiz
单元 4:练习小测
AP-Style Practice Problems
AP 风格练习题
Try the 15-question practice set to test your understanding of networks, fault tolerance, and computing efficiency.
完成 15 道题的练习,检验你对网络、容错性和计算效率的理解。
鼎睿学苑 · Dingrui Scholars
AP Computer Science Principles, Unit 4: Computer Systems and Networks · 2026 Edition
AP 计算机科学原理,单元 4:计算机系统与网络 · 2026 版