Circuit switching and packet switching
引入本课内容
| English | 释义 | 拼音 |
|---|---|---|
| communications network | 通信网络 | tōng xìn wǎng luò |
| message/ˈmesɪdʒ/ | 消息 | xiāo xī |
| link/lɪŋk/ | 链路 | liàn lù |
| internet/ˈɪntənet/ | 互联网 | hù lián wǎng |
| circuit switching/ˈsɜːkɪt ˈswɪtʃɪŋ/ | 电路交换 | diàn lù jiāo huàn |
| packet switching/ˈpækɪt ˈswɪtʃɪŋ/ | 分组交换 | fēn zǔ jiāo huàn |
| traffic | 流量 | liú liàng |
| circuit/ˈsɜːkɪt/ | 电路 | diàn lù |
| dedicated path/ˈdedɪkeɪtɪd pæθ/ | 专用路径 | zhuān yòng lù jìng |
| bandwidth/ˈbændwɪdθ/ | 带宽 | dài kuān |
| rate/reɪt/ | 速率 | sù lǜ |
| delay/dɪˈleɪ/ | 时延 | shí yán |
| packets/ˈpækɪts/ | 分组 | fēn zǔ |
| destination and source addresses | 目的地址和源地址 | mù dì dì zhǐ hé yuán dì zhǐ |
| sequence number/ˈsiːkwəns ˈnʌmbə/ | 序号 | xù hào |
| router/ˈruːtə/ | 路由器 | lù yóu qì |
| next hop | 下一跳 | xià yī tiào |
| reassemble | 重组 | chóng zǔ |
| multiplexed/ˌmʌltɪˈplekst/ | 多路复用 | duō lù fù yòng |
| variable latency/ˈveərɪəbl ˈleɪtənsi/ | 延迟 | yán chí |
| TCP/ˌtiː siː ˈpiː/ | 传输控制协议 | chuán shū kòng zhì xié yì |
| destination IP address | 目的IP地址 | mù dì IP dì zhǐ |
| routing table/ˈraʊtɪŋ ˈteɪbl/ | 路由表 | lù yóu biǎo |
| interface/ˈɪntəfeɪs/ | 接口 | jiē kǒu |
| constant-rate flows | 恒定速率流 | héng dìng sù lǜ liú |
| bursty flows | 突发流 | tū fā liú |
为在自身被摧毁后仍能运转而建的网络
- 1964 年,保罗·巴兰被问到:一个通信网络怎样才能在核打击之后继续工作。当时所有的网络都通不过这个测试,因为一通电话要预留一条路径,切断那条路径,通话就结束了。
- 他的答案是不再预留路径。把每条消息切成小块,给每一块加上地址,让每一块自己找路;如果某条链路消失了,下一块就绕过去。
- 这个想法有好几年被认为不可行。如今几乎所有数据都是这样流动的,这也是互联网没有一个可以被切断的中心的原因。
- 这一课讲电路交换和分组交换:各自怎样工作、各自的代价,以及哪种适合哪种流量。

电路交换
- 在发送任何数据之前,先在两端之间建立一条专用路径,整个会话期间一直占用,结束时释放。
- 好处:带宽被预留,所以速率有保证且恒定,数据按序到达,延迟可预测。
- 坏处:它低效,因为在沉默期间被预留的线路空闲着,别人也不能用;而且建立慢,因为必须先把路径建起来。一条链路断了就会切断电路,会话结束。
- 典型例子是传统电话网。

整通电话期间被预留,用不用都一样
In circuit switching:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Circuit switching reserves one path end-to-end (reserved bandwidth) — but it wastes the line during silences.
What is the main drawback of circuit switching?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Reserving the path guarantees the rate and the order, and that is exactly what makes it wasteful. The other three describe packet switching.
分组交换
- 消息被切成数据包,每个数据包独立发送。每个数据包带有目的地址和源地址以及一个序列号。
- 每台路由器对每个数据包单独决定下一跳,所以数据包可能走不同的路径并乱序到达。目的端用序列号重组消息,丢失的数据包可以再次请求。
- 好处:高效,因为一条链路被许多会话多路复用,只在有数据时才承载数据;健壮,因为流量会绕过失效的链路重新选路。
- 坏处:延迟可变,因为数据包在路由器排队;数据包可能丢失,所以可靠性必须由上层的 TCP 添加。

同一条消息,多条路径,在目的端重组
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.
A key advantage of packet switching is that it is:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Sharing links is efficient and rerouting makes it resilient. The trade-off is variable latency and possible loss (TCP fixes that).
Because each packet carries a sequence number, the destination can reassemble the message in the right order and re-request any missing packet.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Packets may arrive out of order or be lost; the sequence numbers (and TCP) put everything right.
路由器做什么
- 路由器连接两个或更多网络。对每个数据包,它读取目的 IP 地址,在路由表中查找,然后从合适的接口把数据包向目的地转发。
- 它不记住这次会话:同一条消息的两个数据包,如果两次之间路由表变了,可能从不同接口离开。
- 正是这种逐包决策,让绕过故障重新选路自动发生。

Put the stages of sending a message by packet switching in order.
难度 3/5 · 今日首次完成可获 200 金币及少量额外奖励
Split, address, route, arrive, reassemble. That is the five-mark answer to "explain how packet switching passes a message".
例题:描述分组交换
- 解释分组交换怎样通过互联网传送一条消息。 [5]
- 消息被切成小的数据包。每个数据包带有目的地址、源地址和一个序列号。
- 每个数据包独立地穿过网络,路由器为每一个选择下一跳,所以数据包可能走不同路径、乱序到达。
- 目的端用序列号按正确顺序重组消息,任何丢失的数据包都可以再次请求。
- 五句话,五分。漏掉序列号或重组会丢掉其中两分。

A router reads the destination address of every ____ and forwards it towards its destination.
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
The decision is made per packet, with no memory of the conversation, which is what lets traffic reroute around a failure automatically.
并排对比
| 方面 | 电路交换 | 分组交换 |
|---|---|---|
| 路径 | 端到端专用、预留 | 共享、逐包选择 |
| 建立 | 慢,在发送任何数据之前 | 无需建立 |
| 带宽利用 | 低效,沉默时空闲 | 高效,多路复用 |
| 顺序 | 总是按序到达 | 可能乱序到达 |
| 出故障时 | 电路被切断 | 绕过故障重新选路 |
| 延迟 | 恒定且可预测 | 可变 |
| 适合 | 恒定速率的流,语音 | 突发性的流,网页和邮件 |

Match each term to what it means.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Circuit = one reserved path; packet = independent packets reordered by sequence number — what the internet uses.
The modern internet uses:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
The internet uses packet switching for its efficiency and resilience.
例题:哪种流量用哪种方法
- 一通电话和一次大文件下载共享一个网络。各适合哪种交换方法,为什么?
- 电话需要恒定速率的稳定流,延迟低且可预测,如果片段迟到或乱序会严重受影响。电路交换适合它:整通电话预留一条路径,容量有保证。
- 文件下载不在意到达顺序和短暂延迟,因为文件在使用前会被重组,而且它是突发性的。分组交换适合它:链路与其他流量共享,只在有数据流动时才占用。
- 说出方法、说出流量的性质,并把两者连起来。
Which properties make circuit switching a good fit for a telephone call? Select 所有 that apply.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Efficient sharing is packet switching's advantage, and it is the thing circuit switching gives up in exchange for the guarantees.
容易丢掉的分
- 数据包可能乱序到达,而序列号正是解决这个问题的东西。两半都要有。
- 电路交换的缺点是被预留却空闲的线路,不是"它太老了"。
- 路由器的决策是逐包做出的,这正是重新选路能自动发生的原因。
- 分组交换本身不保证送达;TCP 在它之上添加了这一点。
你掌握了
- 电路交换在发送前预留一条专用路径:带宽和顺序有保证,但沉默时空闲、建立慢,一处故障就被切断
- 分组交换把消息切成独立选路的数据包,携带地址和序列号,在目的端重组
- 路由器对每个数据包决定下一跳,所以流量会自动绕过故障重新选路
- 分组交换高效、健壮但延迟可变;电路交换适合恒定的语音流,分组交换适合突发的数据
出了什么问题?只有网站团队能看到这些信息。