Computer Networking, A Top-Down Approach, 5th Edition

Network Edge

applications and hosts

Client Program and Server Program

一般而言,客户端程序是 发送请求 的,而服务器端程序是 接受请求 的。

Access Technologies

接入技术 分类 简要说明
数字用户线(DSL) 居家接入 通过电话线为家庭用户提供宽带互联网接入
电缆调制解调器 居家接入 通过有线电视网络为家庭用户提供互联网接入
光纤到户(FTTH) 居家接入/公司接入 通过光纤直接连接家庭或公司,提供高速接入
以太网 公司接入 企业内部常用的局域网接入方式
Wi-Fi 居家接入/公司接入 无线局域网,常用于家庭和公司内部无线接入
蜂窝移动网络(3G/4G/5G) 移动接入 通过移动运营商网络为移动设备提供互联网接入
接入技术 典型速率范围 速率共享性 说明
拨号调制解调器 最高 56 Kbps 专用 每户独占电话线
HFC 10 Mbps ~ 1 Gbps(下行) 共享 同轴电缆段内用户共享带宽
DSL 256 Kbps ~ 100 Mbps(下行) 专用 每户独占电话线,汇聚点可能有瓶颈
FTTH 100 Mbps ~ 10 Gbps 通常专用 部分PON架构下分光器后带宽被共享

HFC: hybrid fiber coax

问题 答案
HFC 传输速率是专用还是共享? 共享
下行 HFC 信道是否可能发生冲突? 不会
原因 只有头端设备发送,无多发冲突

Ethernet LANs

以太网类型 典型速率 每用户能否持续满速发送?
10BASE-T 10 Mbps
100BASE-TX 100 Mbps
1000BASE-T 1 Gbps
10GBASE-T 10 Gbps
物理介质类型 典型应用场景 传输距离 传输速率
双绞线 局域网、办公、家庭 最远可达100米 10 Mbps ~ 40 Gbps
光纤 数据中心、骨干网 数百米至数十公里 100 Mbps ~ 400 Gbps
同轴电缆 早期局域网 数百米 10 Mbps

Wireless Internet Access Technologies

技术类型 典型速率范围 覆盖范围 主要应用场景 延迟 主要优缺点
Wi-Fi 数十 Mbps ~ 数 Gbps 局部(几十米) 家庭、办公、热点 速率高、成本低、覆盖范围有限
蜂窝网络(4G/5G) 数十 Mbps ~ 数 Gbps 广域(城市/乡村) 移动设备、车载、物联网 低(5G更优) 覆盖广、速率高、需付流量费用
卫星互联网 数十 Mbps ~ 数百 Mbps 全球(含偏远区) 偏远地区、应急通信 中~高 覆盖广、不依赖地面设施、延迟较高
设备类型 物理层 链路层 网络层 传输层 应用层
路由器 \[\surd\] \[\surd\] \[\surd\] \[\times\]
链路层交换机 \[\surd\] \[\surd\] \[\times\]
主机 \[\surd\] \[\surd\] \[\surd\] \[\surd\] \[\surd\]

Packet Switching and Circuit Switching

  • 带宽保证:电路交换网络(如传统电话网)在通信双方建立连接时,会为其分配一条固定的物理路径和带宽,整个通信期间该带宽专属使用,不会被其他用户占用。
  • 通信延迟低且稳定:由于路径和带宽在会话期间独占,数据传输延迟固定且可预测,适合对实时性要求高的应用(如语音通话)。
  • 无拥塞丢包:通信过程中不会因网络拥塞导致丢包或重传,通信质量有保障。
网络类型 主要优势
电路交换网络 带宽独占、延迟稳定、无拥塞丢包
分组交换网络 资源利用率高、灵活、适合突发性数据传输

Statistical Multiplexing

分组交换(Packet Switching)中,网络资源(如链路带宽)是按需动态分配给各个数据流的。每个用户的数据被分成分组(包),这些分组在网络中独立传输,多个用户的分组在同一链路上交错传输
由于不是每个用户都持续发送数据,链路带宽可以被“活跃”的用户动态共享,这种方式称为统计复用(Statistical Multiplexing)

  • 核心思想:利用用户流量的突发性和不均匀性,通过动态分配资源,提高链路利用率。
  • 资源分配:没有为每个用户预留固定带宽,资源按需分配。
复用方式 资源分配方式 利用率 适用场景 主要特点
统计复用 动态分配,按需使用 分组交换网络 用户多时可能拥塞,利用率高
TDM(时分复用) 固定分配,每用户固定时隙 低(有空闲浪费) 电路交换网络 时隙空闲时无法被他人利用

Store-and-Forward Packet Switching

存储转发:交换机必须在收到整个分组后,才能开始向下一个链路转发。

ISP

ISP 类型 互联方式 是否需购买上网带宽 网络覆盖范围
Tier-1 ISP 与其他 Tier-1 ISP 结算互免互联 全球骨干
Tier-2 ISP 部分互联+向上级 ISP 购买带宽 区域/国家级

Delay

  • Processing Delay:每个路由器或主机在接收到分组时进行首部检查、差错检测等处理所需的时间。
  • Queuing Delay:分组在路由器的输出队列中等待转发的时间,取决于当前队列的长度和网络拥塞状况。
  • Transmission Delay: 分组所有比特从路由器或主机的输出端口“上线”所需的时间,计算公式为 \[ \text{传输时延} = \frac{L}{R} \] 其中,\(L\) 为分组长度(比特),\(R\) 为链路带宽(比特/秒)。
  • Propagation Delay: 分组在物理链路上传播所需的时间,计算公式为: \[ \text{传播时延} = \frac{d}{s} \] 其中,\(d\) 为链路长度,\(s\) 为信号在介质中的传播速率。
时延类型 公式 是否依赖分组长度 L 是否依赖传输速率 R
传播时延 \[\frac{d}{s}\]
传输时延 \[\frac{L}{R}\]
总时延 \[\frac{L}{R} + \frac{d}{s}\] 部分依赖 部分依赖

Throughput

吞吐量:传输速率,单位 \(\text{bits} / \text{time}\)

每一个用于传输比特流的 pipe 的吞吐量可能不一致,这时如何计算端到端的吞吐量? \[ \min \, \{R_C, R_S, \dots\} \]

这种情况下,端到端的吞吐量取决于整个传输路径中最慢的通道

Layer Structure

任务名称 可能涉及的层级 是否可多层实现
分段与重组 传输层、网络层
差错检测与纠正 数据链路层、传输层
流量控制 数据链路层、传输层
寻址与路由选择 网络层 否(主要网络层)
封装与解封装 各层均有
层级 数据单元名称 主要内容说明
应用层 应用层消息 应用协议数据(如HTTP请求、邮件内容等)
传输层 报文段(Segment) 传输层首部 + 应用层消息
网络层 数据报(Datagram) 网络层首部 + 传输层报文段
链路层 帧(Frame) 链路层首部 + 网络层数据报 + 链路层尾部

Security

类型 是否自我复制 是否依附宿主 是否主动传播 主要危害方式
病毒 破坏文件、传播感染
蠕虫 网络传播、资源消耗
特洛伊木马 窃密、远控、伪装攻击
  • 僵尸网络(Botnet):由大量被恶意控制的设备组成的分布式网络。
  • DDoS攻击(分布式拒绝服务攻击):利用僵尸网络同时发起大规模攻击,瘫痪目标服务。
阶段 说明
恶意软件传播 通过多种方式感染大量设备
设备感染与控制 感染设备与C&C服务器建立联系,成为“僵尸”
集中管理 攻击者统一管理所有僵尸设备
发起DDoS攻击 僵尸设备同时向目标发起流量,导致目标服务瘫痪

End-of-chapter exercises

R.15

Suppose users share a \(2\) Mbps link. Also suppose each user transmits continuously at \(1\) Mbps when transmitting, but each user transmits only \(20\) percent of the time. (See the discussion of statistical multiplexing in Section \(1.3\).)

Questions and Answers:

a. When circuit switching is used, how many users can be supported?

在电路交换中,每个用户需要预留 \(1\) Mbps 的带宽,而链路总带宽为 \(2\) Mbps。因此,最多可以支持:

\[ \text{用户数} = \frac{\text{总带宽}}{\text{每用户带宽}} = \frac{2 \, \text{Mbps}}{1 \, \text{Mbps}} = 2 \, \text{用户} \]

b. For the remainder of this problem, suppose packet switching is used. Why will there be essentially no queuing delay before the link if two or fewer users transmit at the same time? Why will there be a queuing delay if three users transmit at the same time?

  • 如果两名或更少的用户同时传输,每个用户的传输速率为 \(1\) Mbps,总传输速率为 \(2\) Mbps 或更少,等于链路的总带宽。因此,数据可以立即通过链路传输,不会产生排队延迟。
  • 如果三名用户同时传输,总传输速率为 \(3 \, \text{Mbps}\),超过了链路的总带宽 \(2 \, \text{Mbps}\)。此时,链路无法立即传输所有数据,导致数据在队列中等待,从而产生排队延迟。

c. Find the probability that a given user is transmitting.

每个用户有 \(20\%\) 的时间在传输数据,因此某个用户正在传输的概率为:

\[ P(\text{用户传输}) = 0.2 \]

d. Suppose now there are three users. Find the probability that at any given time, all three users are transmitting simultaneously. Find the fraction of time during which the queue grows.

  • 每个用户独立传输的概率为 \(0.2\),因此三名用户同时传输的概率为:

\[ P(\text{三名用户同时传输}) = P(\text{用户1传输}) \cdot P(\text{用户2传输}) \cdot P(\text{用户3传输}) = 0.2 \cdot 0.2 \cdot 0.2 = 0.008 \]

  • 队列增长的时间比例等于三名用户同时传输的概率,因为只有在这种情况下,传输速率超过链路带宽:

\[ \text{队列增长的时间比例} = 0.008 \]

R.19

Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rates \(R_1\) = \(500\) Kbps, \(R_2\) = \(2\) Mbps, and \(R_3\) = \(1\) Mbps.

Questions and Answers:

a. Assuming no other traffic in the network, what is the throughput for the file transfer.

  • 用公式 \(\min {R_i}\) 计算得到实际吞吐量是 \(500\) Kbps。

b. Suppose the file is 4 million bytes. Dividing the file size by the throughput, roughly how long will it take to transfer the file to Host B?

  • \[\text{传输时间} = \frac{4 \times 10^{6} \times 8}{500 \times 1000} = 64 \, \text{s}\]

c. Repeat (a) and (b), but now with R2 reduced to 100 Kbps.

  • 用公式 \(\min {R_i}\) 计算得到实际吞吐量是 \(100\) Kbps。
  • \[\text{传输时间} = \frac{4 \times 10^{6} \times 8}{100 \times 1000} = 320 \, \text{s}\]

R.23

Questions and Answers:

What are the five layers in the Internet protocol stack? What are the principal responsibilities of each of these layers?

There are application layer, transport layer, network layer, data link layer and physical layer. Their principal responsibilities are as follow:

层级 名称 主要职责 典型协议举例
第5层 应用层 (Application) 提供网络服务的接口,支持应用程序间的通信 HTTP, FTP, SMTP, DNS
第4层 传输层 (Transport) 提供端到端的传输服务,负责分段、重组、流量控制和差错恢复 TCP, UDP
第3层 网络层 (Network) 负责数据包的路由和转发,实现端到端的寻址和路径选择 IP, ICMP, OSPF, BGP
第2层 数据链路层 (Data Link) 提供相邻节点间可靠传输,处理帧的封装、寻址、差错检测和媒体访问控制 Ethernet, PPP, HDLC, Wi-Fi
第1层 物理层 (Physical) 负责比特流的传输,定义物理介质、信号编码和传输速率等物理特性 RS-232, USB, SONET, 以太网物理标准

P.8

Consider the discussion in Section \(1.3\) of statistical multiplexing in which an example is provided with a \(1\) Mbps link. Users are generating data at a rate of \(100\) Kbps when busy, but are busy generating data only with probability \(p = 0.1\). Suppose that the \(1\) Mbps link is replaced by a \(1\) Gbps link.

Questions and Answers:

a. What is \(N\), the maximum number of users that can be supported simultaneously under circuit switching?

\[ N = \frac{1 \, \text{Gbps}}{100 \, \text{Kbps}} = 10000 \]

b. Now consider packet switching and a user population of \(M\) users. Give a formula (in terms of \(p\), \(M\), \(N\)) for the probability that more than \(N\) users are sending data.

假设用户的发送行为是独立的,则发送数据的用户数目服从二项分布,只考虑 \(M \geq N\)\[ P_{ > N} = 1 - \sum_{k = 0}^{N} \binom{M}{k} p^k (1 - p)^{M - k} \]

P.22

Consider Figure \(1.19(a)\). Assume that we know the bottleneck link along the path from the server to the client is the first link with rate \(R_s\) \(\text{bits/sec}\). Suppose we send a pair of packets back to back from the server to the client, and there is no other traffic on this path. Assume each packet of size \(L\) \(\text{bits}\), and both links have the same propagation delay \(d_{prop}\).

Figure 1.19(a)

back-to-back 指的是一组数据包在没有间隔的情况下连续发送

Questions and Answers:

a. What is the packet inter-arrival time at the destination? That is, how much time elapses from when the last bit of the first packet arrives until the last bit of the second packet arrives?

从图中我们可以看到有两条 link,速率分别是 \(R_s\)\(R_c\),前者导致瓶颈,也就是 \(R_c\) > \(R_s\)。所以,inter-arrival time\[ t = \frac{L}{R_s} \]

b. Now assume that the second link is the bottleneck link (i.e., \(R_c\) < \(R_s\)). Is it possible that the second packet queues at the input queue of the second link? Explain. Now suppose that the server sends the second packet \(T\) seconds after sending the first packet. How large must \(T\) be to ensure no queuing before the second link? Explain.

有可能第二个包在第二条 link 输入处排队,因为 \(R_c\) < \(R_s\) 导致,第一包仍在传输。只要保证当第二个包到达第二条 link 输入时,第一个包已经传完了,也就是: \[ T = \frac{L}{R_c} \]

P.28

Suppose there is a \(10\) \(\text{Mbps}\) microwave link between a geostationary satellite and its base station on Earth. Every minute the satellite takes a digital photo and sends it to the base station. Assume a propagation speed of \(2.4 \cdot 10^8\) \(\text{meters/sec}\).

Questions and Answers:

a. What is the propagation delay of the link?

地球静止卫星轨道高度约为 \(d \approx 3.5786 \times 10^7 \, \text{m}\),再由公式 \(d_{prop} = \frac{d}{s}\) 得到 \(d_{prop} \approx 150 \, \text{ms}\)

b. What is the bandwidth-delay product, \(R \cdot d_{prop}\)?

这个乘式中的 \(R\) 是 link 的传输速率,表示的是因延迟而没有传输的数据大小。结果是 \(10 \times 10^6 \times 0.15 = 1.5 \times 10^6 \, \text{bits}\)

c. Let \(x\) denote the size of the photo. What is the minimum value of \(x\) for the microwave link to be continuously transmitting?

设照片大小为 \(x\)(单位:\(\text{bits}\)),要使链路持续发送,需满足传输时间 \(\frac{x}{R}\) 不小于拍照间隔 \(60\,\text{s}\),即
\[ \frac{x}{R} \geq 60 \, \Longrightarrow \; x \geq R \times 60 = 10\times10^6\ \text{bps} \times 60\ \text{s} = 600\times10^6\ \text{bits} = 75\ \text{MB}. \]


Introduction
https://ddccffq.github.io/2025/06/10/计算机网络/Introduction/
作者
ddccffq
发布于
2025年6月10日
许可协议