CS 168 · DISCUSSION 02 · GUIDED REASONING WORKBOOK

在途数据包、时延与统计复用

把所有 delay 写成“哪一段 bytes 在哪条 link 上占了多久”,再判断何时形成 queue;不要靠跨洲/大文件等语言直觉。

现在轮到你推

无需离开 CourseStack:先预测,再在表格、时间线或状态空间里完成推导;卡住时逐层打开提示,最后才展开解释与变式。

已阅读 Spring 2026 worksheet 与 official solution;以下是原创等价练习。官方 IDs 用于 coverage,对精确原题请回到页末 PDF。

忘记机制?回到 L2 Links 与队列 →

对应官方 1.1、1.2、1.3、1.4、1.5

1 · 传播与发送:先比较量纲

Why the official problem exists:训练你在 packet、file 与 flow 三个尺度切换时不混淆 propagation、transmission 与 queuing。

跨洲 link:rate=100 Gbit/s,one-way propagation=20 ms。比较 100 MB message 与 100 GB file。

先预测:100 MB 放上链路约 8 ms,端到端首份数据的主导项?

Work It Out

分别计算 L/R,与 20 ms 比较;再解释为什么 bursty 不必然排队,以及 packet switching 如何利用 peak-of-aggregate 小于 sum-of-peaks。

Hint 1 · Concept

统一 bit、second 单位。

Hint 2 · State / Invariant

queue state 是 backlog;没有 backlog 就没有 queuing delay。

Hint 3 · First Step

先算 100 MB×8 / 100 Gbit/s。

Reveal · 展开完整推导

100 MB→8 ms,小于 20 ms;100 GB→8 s,transmission 主导。Bursty 只有在到达间隔短于服务时间且已有重叠时才形成 backlog。Internet 按需 packet switching,而非每次先预留 circuit。

Why This Works

主导 delay 是数值比较,不是介质标签。统计复用来自流量峰值通常不同步。

Variation

rate 降为 10 Gbit/s,求 propagation 与 transmission 相等时的 message size。

对应官方 2.1、2.2、2.3、2.4

2 · 两跳 store-and-forward 与第二包排队

Why the official problem exists:检查你是否按 event time 推 packet,而不是把所有 link delay 一次相加。

A—B 两条 link:R1=10 Mbit/s,prop1=2 ms;B—C:R2=5 Mbit/s,prop2=1 ms。两个 1000-byte packets 背靠背从 A 出发,B store-and-forward。

先预测:第二包在 B 是否排队?

Work It Out

事件P1P2
最后一 bit 到 B________
开始 B→C____max(到达, P1完成)=____
到 C________
Hint 1 · Concept

store-and-forward 要等整个 packet 到齐。

Hint 2 · State / Invariant

B 的输出 link 是单服务器,next start=max(arrival, previous finish)。

Hint 3 · First Step

先算 8000/10M=0.8 ms,8000/5M=1.6 ms。

Reveal · 展开完整推导

P1 最后一 bit 2.8 ms 到 B,2.8→4.4 ms 发送并于 5.4 ms 到 C。P2 于 3.6 ms 到 B,但等到 4.4 ms 才开始,6.0 ms 发完,7.0 ms 到 C;queue=0.8 ms。无排队条件是上游 packet spacing ≥ 下游 service time。

Why This Works

事件时间线显式保存 output-link busy-until state,因此 max 项自然出现。

Variation

把 R2 提高到 20 Mbit/s,重算 busy-until;哪条不等式保证 queue=0?

对应官方 3.1、3.2、3.3

3 · sum of peaks 为什么不是 peak of aggregate

Why the official problem exists:用时间序列证明统计复用,而不是背一句“更有效”。

三条 flow 在三个时隙的 rates:F1=[8,1,1],F2=[1,7,1],F3=[1,1,6] Mbit/s。

先预测:sum of individual peaks 与 aggregate peak 分别是?

Work It Out

先逐 flow 找 peak,再逐 column 求 aggregate=[__,__,__],最后比较两种 peak。

Hint 1 · Concept

max 与 sum 一般不可交换。

Hint 2 · State / Invariant

sum(max Fi) 是各流分别最坏;max(sum Fi) 是同一时刻共享容量。

Hint 3 · First Step

先算每个时隙 8+1+1。

Reveal · 展开完整推导

sum of peaks=21 Mbit/s;aggregate 每时隙=10,所以 peak aggregate=10。若各 flow 的峰完全同步,两者才相等。

Why This Works

共享 link 只需承载同一时刻的总量;不同步的 idle capacity 可被别的 flow 使用。

Variation

把 F2 改为 [7,1,1]。重新计算并说明同步如何降低 multiplexing gain。

Closed-book reconstruction

自造两条不同 rate、propagation 的链路和三个 packets,画完整 busy-until timeline;再造三条 flow 使 sum-of-peaks 恰等于 aggregate peak。

一手资料