论文:Congestion Avoidance and Control
本篇整理 Van Jacobson 与 Michael J. Karels 的《Congestion Avoidance and Control》。正文按作者注明的 November 1988 slightly revised version 逐页翻译;每一页保留原始 PDF 页面图,包含 figures、公式、脚注、代码、实验曲线、Acknowledgements 和 References。slow-start、congestion window、RTT、retransmission、AIMD、gateway 等术语按网络领域惯例保留 English 或中英并列。
论文:Congestion Avoidance and Control
相关文章:论文:A Protocol for Packet Network Intercommunication · 论文:End-to-End Arguments in System Design · 论文:Time, Clocks, and the Ordering of Events in a Distributed System
TL;DR
- 问题:window-based transport protocol 的“直觉式”实现,在 network congestion 下可能产生更多 retransmission,最终让 throughput 从 32 Kbps 崩到 40 bps。
- 核心原则:稳定的 transport connection 应遵守 packet conservation——只有旧 packet 离开 network 后,才注入新 packet。
- 四个关键机制:slow-start 负责从空 pipe 安全进入 equilibrium;RTT mean/variation estimator 与 exponential backoff 避免 spurious retransmission;congestion avoidance 使用 multiplicative decrease / additive increase;gateway 侧还需要 congestion detection 与 fair allocation。
- 重要区分:slow-start 与 congestion avoidance 都可能由 timeout 触发,也都操作
cwnd,但目标不同:前者快速找到安全 operating point,后者在安全点附近探测更多 bandwidth。 - 边界:本文是 1988 年的 early TCP congestion-control design;参数、实验环境、ACK policy 和 gateway 行为属于当时的 Internet,不应直接当作现代 TCP 标准的完整规范。
名词解释
| 名词 | 含义 | 本文对应物 |
|---|---|---|
| congestion collapse | network 中 retransmission 与 queueing 的 positive feedback 使有效 throughput 崩溃 | 1986 年 LBL 到 Berkeley 从 32 Kbps 降到 40 bps |
| packet conservation | equilibrium 中,旧 packet 离开前不注入新 packet | sender 用 ACK 作为 packet clock |
| self-clocking | ACK 到达节奏控制 sender 的 packet 注入节奏 | TCP ACK clock |
| slow-start | 从 starting/restarting 状态逐步扩大 congestion window 的算法 | cwnd 从一个 packet 开始,每个新 data ACK 增加一个 packet |
| congestion avoidance | 根据 loss/timeout 调节发送窗口的稳定控制策略 | multiplicative decrease + additive increase |
cwnd | sender 侧 congestion window | 与 receiver advertised window 取 minimum |
RTT / R | packet 发出到 ACK 返回的 round-trip time | retransmission timer 和 path capacity 的观测量 |
rto | retransmission timeout | R + 4V(本文 appendix A 的最终形式) |
ssthresh | slow-start threshold | combined algorithm 在 slow-start 与 congestion avoidance 间切换 |
| AIMD | additive increase / multiplicative decrease | 无 congestion 时加法增长,发生 congestion 时乘法下降 |
目录
| 章节 | 内容 |
|---|---|
| 版本与来源 | 1988 revised version、来源 PDF 与固定信息 |
| 原文页面与逐页翻译 | 25 个 PDF 页面按原页保留并翻译 |
| 协议机制索引 | slow-start、RTT timer、AIMD、gateway control 与附录 |
| 设计判断与边界 | packet conservation、参数取舍和实验边界 |
| 本篇验收 | 页数、图片、算法和 References 覆盖范围 |
版本与来源
- 论文标题:Congestion Avoidance and Control。
- 作者:Van Jacobson,Lawrence Berkeley Laboratory;Michael J. Karels,University of California at Berkeley。
- 版本:November 1988;页面脚注说明这是最初发表于 SIGCOMM ’88 的论文的 very slightly revised version,引用时应引用 [12]。
- 会议书目信息:SIGCOMM ’88,Stanford,August 1988;页码 314–329;DOI:
10.1145/52325.52356(ACM SIGCOMM Computer Communication Review 记录)。 - 本地固定来源:University of Wisconsin PDF mirror;作者资料页也可由 LBL Network Research Group papers 交叉核对。
- 本地固定文件:
source/congestion-avoidance-and-control.pdf。 - PDF 固定信息:25 页;SHA-256:
9ca88dfa60f98d5cf736c3917df45420eb91861dd1de453a3dedf3d91c1836eb。 - 附件处理:每页按 PDF 页面矩形以 2× 渲染为
1190×1684PNG,存放于assets/52 Congestion Avoidance and Control/,正文按600宽度嵌入。 - 笔记类型:深度分析;理由是本文同时讨论 transport implementation、control-theoretic model、实验 traces、TCP 算法和 gateway-side policy。
原文页面与逐页翻译
第 1 页:Introduction 与 congestion collapse

Congestion Avoidance and Control
作者:Van Jacobson、Michael J. Karels。前者来自 Lawrence Berkeley Laboratory,后者来自 University of California at Berkeley。
时间:November 1988。
Introduction
过去几年,computer networks 经历了 explosive growth;随着 growth 而来的,是严重的 congestion problems。例如,现在经常可以看到 Internet gateways 因 local buffer overflow 而 drop 10% 的 incoming packets。
我们对这些 problems 的 investigation 表明,问题的很大一部分来自 transport protocol implementations,而不是 protocols 本身:实现 window-based transport protocol 时那些“显而易见”的方式,在 network congestion 下可能产生完全错误的 behavior。
本文给出错误 behavior 的 examples,并描述一些可以让系统产生正确 behavior 的 simple algorithms。这些 algorithms 建立在一个 idea 上:通过强迫 transport connection 遵守 packet conservation principle 来获得 network stability。
本文展示这些 algorithms 如何从这个 principle 推导出来,以及它们会怎样影响 congested networks 上的 traffic。
1986 年 10 月,Internet 经历了后来一系列 “congestion collapses” 中的第一次。在那段时间里,LBL 到 UC Berkeley 的 data throughput 从 32 Kbps 下降到 40 bps;两个 sites 相距只有 400 yards,中间隔着两个 IMP hops。
我们对 bandwidth 突然下降一千倍感到 fascinated,于是开始调查事情为何会变得如此糟糕。尤其是,我们想知道:是 4.3BSD(Berkeley UNIX)的 TCP 行为异常,还是它可以通过 tuning,在极端糟糕的 network conditions 下表现更好。
这两个问题的答案都是 “yes”。
论文页脚说明:本文是最初发表于 SIGCOMM ’88 [12] 的论文的 very slightly revised version;如果引用本文,应引用 [12]。本文还保留了 Department of Energy 与 Department of Commerce/National Bureau of Standards 的资助说明。
第 2 页:Packet conservation 与 slow-start 的动机

1 GETTING TO EQUILIBRIUM: SLOW-START
从那以后,我们已经把七个新 algorithms 放入 4BSD TCP:
- round-trip-time variance estimation;
- exponential retransmit timer backoff;
- slow-start;
- more aggressive receiver ACK policy;
- dynamic window sizing on congestion;
- Karn’s clamped retransmit backoff;
- fast retransmit。
我们的 measurements 以及 beta testers 的 reports 表明,最终 product 在处理 Internet 上的 congested conditions 时相当不错。
本文简要描述其中的 (i)–(v) 以及它们背后的 rationale。 (vi) 是 Bell Communications Research 的 Phil Karn 最近开发的 algorithm,见 [16];(vii) 会在一份即将发布的 RFC(ARPANET “Request for Comments”)中描述。
(i)–(v) 这些 algorithms 都来自同一个 observation:TCP connection(或者 ISO TP-4、Xerox NS SPP connection)上的 flow 应该遵守 conservation of packets principle。
如果遵守这个 principle,congestion collapse 就会从常态变成例外。因此,congestion control 的工作,就是找出违反 conservation 的地方,并修复它们。
所谓 packet conservation,是指一个处于 equilibrium 的 connection——也就是稳定运行、且有一个 full window of data 在 transit 中的 connection——其 packet flow 应当具有 physicist 所说的 conservative 性质:只有一个 old packet 离开 network 后,才把一个 new packet 放进 network。
flow physics 预言,具备这个 property 的 systems 应该能够在 congestion 面前保持 robust。但对 Internet 的 observation 表明,它并不特别 robust。为什么两者不一致?
packet conservation 只有三种失败方式:
- connection 没有达到 equilibrium;
- sender 在 old packet 离开之前注入了 new packet;
- 由于 path 上的 resource limits,connection 无法达到 equilibrium。
下面各节将依次处理这三个问题。
1 Getting to Equilibrium: Slow-start
Failure (1) 发生在 connection starting,或者 packet loss 后 restarting 的时候。
换一种看 conservation property 的方式:sender 使用 ACK 作为 clock,把 new packets strobe 到 network 中。由于 receiver 产生 ACK 的速度不会快过 data packets 穿过 network 的速度,所以 protocol 是 self-clocking(见 Fig. 1)。
self-clocking systems 会自动适应 bandwidth 和 delay 的变化,并且具有 wide dynamic range;这一点很重要,因为 TCP 覆盖从 800 Mbps Cray channels 到 1200 bps packet-radio links 的范围。
但正是 self-clocked system 在运行时保持稳定的特性,让它很难启动:要让 data 流动,必须先有 ACK 来 clock out packets;但要获得 ACK,又必须先有 data 流动。
为了启动这个 clock,我们开发了 slow-start algorithm,逐步增加 in-transit data 的数量[^1]。
作者谦称这个 algorithm 的 design 相当 subtle,但 implementation 很简单:sender 只需要增加一个 state variable,并加入三行 code。
第 3 页:Self-clocking 与 slow-start 算法

Figure 1:Window Flow Control “Self-clocking”
图中是 high-bandwidth networks 上的 sender 和 receiver,它们通过一个较慢的 long-haul net 连接。sender 刚开始 transmission,并 back-to-back 地发送了一个 window 的 packets。第一个 packet 的 ACK 即将返回 sender(图中 lower-left funnel 入口处的 vertical line)。
纵轴是 bandwidth,横轴是 time。每个 shaded box 是一个 packet;Bandwidth × Time = Bits,所以每个 box 的 area 就是 packet size。
当 packet 经过 network 时,bit 数量不会改变;因此,被挤入较小的 long-haul bandwidth 后,packet 必须在 time 上 spread out。Pb 表示 path 上最慢 link(bottleneck)的 minimum packet spacing。
当 packets 从 bottleneck 离开、进入 destination net 时,inter-packet interval 不再改变,所以 receiver net 上的 packet spacing Pr = Pb。
如果 receiver processing time 对所有 packets 都相同,那么 receiver net 上 ACK 的 spacing 为 Ar = Pr = Pb。如果 Pb 的 time slot 足以容纳一个 packet,那么它也足以容纳一个 ACK,因此 ACK spacing 在 return path 上得到保持;sender net 上的 ACK spacing 为 As = Pb。
因此,如果 first burst 之后的 packets 只在 ACK 响应下发送,那么 sender 的 packet spacing 会准确匹配 path 上最慢 link 的 packet time。
图下方的结论是:当 sender 通过 ACK 发出后续 packets 时,ACK 流会自动把 sender 的 transmission rate 拉到 bottleneck 所允许的节奏。
作者在本页继续说明:slow-start 的实现只需以下 four steps(完整 bullet 在下一页以原文顺序保留):
- 增加 congestion window
cwnd到 per-connection state; - starting 或 packet loss 后 restarting 时,把
cwnd设置为一个 packet; - 每收到一个 new-data ACK,就把
cwnd增加一个 packet; - sending 时,使用 receiver advertised window 和
cwnd中的 minimum。
脚注 1:conservative flow 的含义是,对任意给定时间,sender–receiver–sender loop 周围 packet density 的 integral 是 constant。由于 packets 必须沿该 loop “diffuse”,这个 integral 足够 continuous,可以作为 system 的 Lyapunov function。constant function trivially 满足 Lyapunov stability 的条件,因此 system 是 stable;这类 systems 的任意 superposition 也 stable。原文建议参见 [3] 第 11–12 章或 [21] 第 9 章的 system stability theory 介绍。
脚注 2:slow-start 与 [14] 中的 CUTE algorithm 非常相似。作者在开发 slow-start 时并不知道 CUTE,但事后认为应该知道,因为 CUTE 比他们的工作早数月。
1987 年 2 月 IETF meeting 上介绍这个 algorithm 时,作者称它为 soft-start,借用了 electronics engineer 限制 in-rush current 的技术。1987 年 3 月,John Nagle 在 IETF mailing list 的 message 中创造了 slow-start 这个名称;作者认为这个名字明显更好,于是立即采用。
第 4 页:Slow-start 的 chronology 与 exponential opening

Figure 2:The Chronology of a Slow-start
横向是 time。连续的 time line 被切成一个个 round-trip-time pieces,并以 time increasing 的方向向下堆叠。灰色、带编号的 boxes 是 packets;白色、带编号的 boxes 是相应的 ACKs。
每当一个 ACK 到达时,会生成两个 packets:一个 packet 是因为 ACK 表示某个 packet 已离开 system,需要补上一个新的 packet;另一个 packet 是因为 ACK 让 congestion window 增加一个 packet。
从图中可以看出,采用“window 每次加一个 packet”的 policy,会让 window 随 time 以 exponential 方式打开。
如果 local net 比 long-haul net 快得多,那么这两个 packets 会几乎同时到达 bottleneck。图中把它们上下叠放,表示其中一个必须占用 gateway outbound queue 的 space。
因此,gateway 的 short-term queue demand 以 exponential 方式增加;要打开大小为 W packets 的 window,bottleneck 需要 W/2 packets 的 buffer capacity。
slow-start window increase 实际并不 slow:打开 window 需要 R log₂ W 的 time,其中 R 是 round-trip-time,W 是 packet 数量(见 Fig. 2)。这意味着即使在 bandwidth–delay product 很大的 links 上,window 也能足够快地打开,对 performance 的影响可以忽略。
同时,algorithm 保证 connection source data 的 rate 不超过 path 上 maximum possible rate 的两倍。
如果没有 slow-start,例如 10 Mbps Ethernet hosts 通过 IP gateways 和 56 Kbps Arpanet 对话,first-hop gateway 会看到一个 burst:八个 packets 以 path bandwidth 200 倍的 rate 送达。
这个 burst 经常会让 connection 进入 persistent failure mode,表现为持续 retransmissions(见 Figures 3 和 4)。
第 5 页:没有 slow-start 的实验与 RTT timing

Figure 3:Startup behavior of TCP without Slow-start
图中 trace 展示两个运行 Sun OS 3.5(4.3BSD TCP)的 Sun 3/50 之间 TCP conversation 的 startup behavior。两个 Suns 位于不同 Ethernets,通过 IP gateways 连接到一个 230.4 Kbps point-to-point link;基本 setup 如 Fig. 7 所示。
connection 的 window size 是 16 KB,即 32 个 512-byte packets;bottleneck gateway 有 30 个 packets 的 buffer。实际 path 包含六个 store-and-forward hops,因此 pipe 加 gateway queue 足以容纳 full window,但 gateway queue 单独不足以容纳它。
每个 dot 是一个 512 data-byte packet。x-axis 是 packet sent 的 time,y-axis 是 packet header 中的 sequence number。因此,vertical array 的 dots 表示 packets back-to-back 发送;两个 y 相同、x 不同的 dots 表示 retransmit。
在这个 graph 中,“desirable” behavior 应该是一条从 lower-left 平滑斜向 upper-right 的 dots line;其 slope 应等于 available bandwidth。但这条 trace 几乎没有任何部分符合 desirable behavior。
dashed line 表示这个 connection 可用的 20 KBps bandwidth。只有 35% 的 bandwidth 被使用,其余都浪费在 retransmits 上。几乎所有 packets 至少 retransmitted 一次;从 54 KB 到 58 KB 的 data 被发送了五次。
2 Conservation at equilibrium: round-trip timing
一旦 data 可靠地流动起来,就应当处理问题 (2) 和 (3)。假设 protocol implementation 是正确的,那么 (2) 必然表示 sender 的 retransmit timer 失效。
一个 good round-trip-time estimator,是任何希望 survive heavy load 的 protocol implementation 的 single most important feature。遗憾的是,它经常被错误实现([26] 和 [13] 描述了典型问题)。
一种错误,是不估计 round-trip time R 的 variation σR。从 queueing theory 可以知道,随着 load 增加,R 和 σR 会快速增加。如果 load 为 ρ,即 average arrival rate 与 average departure rate 的 ratio,那么 R 和 σR 都按 (1−ρ)⁻¹ scaling。
具体来说,如果 network 运行在 75% capacity 上——上一年 4 月 congestion collapse 时的 Arpanet 大致就是这个状态——那么应该预期 round-trip-time 变化 16 倍(−2σ 到 +2σ)。
TCP protocol specification [2] 建议用 low-pass filter 估计 mean round-trip time:
R ← αR + (1 − α)M
其中,R 是 average RTT estimate,M 是最近被 acknowledged data packet 的 round-trip-time measurement,α 是 filter gain constant,建议值为 0.9。
更新 R estimate 后,next packet 的 retransmit timeout interval rto 被设置为 βR。
第 6 页:RTT variation 与 timer 的问题

Figure 4:Startup behavior of TCP with Slow-start
图 4 与图 3 的 conditions 相同:time of day、Suns、network path、buffer 和 window sizes 都相同;不同之处是 machines 运行带 slow-start 的 4.3+TCP。
没有 bandwidth 浪费在 retransmits 上,但 slow-start 花费了两 seconds,因此这段 trace 的 effective bandwidth 是 16 KBps,比图 3 好两倍。
这个对比略有 misleading:与前一幅图不同,本图 trace 的 slope 是 20 KBps,随着 trace length 增加,2-second offset 的影响会减小。例如,如果 trace 持续一分钟,effective bandwidth 会达到 19 KBps;而没有 slow-start 时,effective bandwidth 无论 trace 持续多久都保持 7 KBps。
前页的 RFC793 timer 使用 fixed multiplier β 来 account for RTT variation。建议的 β = 2 只能适应最多 30% 的 load。超过这个 load 后,connection 会因为 retransmit 那些其实只是 transit 中被延迟的 packets,而响应 load increase。
这迫使 network 在已经明显难以处理 useful work 时,额外做 useless work,浪费 bandwidth 传输最终本来会到达的 duplicate packets。换句话说,这相当于给 fire 浇汽油。
我们开发了一种 cheap method 来估计 variation(见 Appendix A)1;由此得到的 retransmit timer 基本消除了 spurious retransmissions。
估计 β 而不是使用 fixed value,还有一个 pleasant side effect:low load 和 high load 的 performance 都得到改善,尤其是在 satellite links 这类 high-delay paths 上(见 Figures 5 和 6)。
另一个 timer mistake,出现在 retransmit 之后的 backoff:如果一个 packet 必须 retransmit 多次,retransmits 应该如何 spacing?
对于嵌入一个 topology unknown、competing conversations 的 population unknown 且不断变化的 network 中的 transport endpoint,只有一种 scheme 有希望工作:exponential backoff。本文不证明这一点2。
第 7 页:RFC793 timer 与 exponential backoff

Figure 5:Performance of an RFC793 retransmit timer
图中 trace 展示一个 behavior 良好的 Arpanet connection 上,每个 packet 的 round-trip time。x-axis 是 packet number(packets 从 1 开始顺序编号);y-axis 是从 packet send 到 sender 收到 ACK 的 elapsed time。
在这段 trace 中,没有 packets 被 drop 或 retransmit。dots 表示 packets;dashed line 把它们连接起来,以便更容易追踪 sequence。solid line 表示按照 RFC793 rules 计算的 retransmit timer。
如果一个 packet 必须 retransmit 不止一次,那么在 unknown network 中,exponential backoff 是能够避免竞争 conversations 同时继续加压的基本方案。作者用 control theory 的直觉解释它:network 可以近似视为 linear system,由 integrators、delays、gain stages 等 linear operators 组成。
linear system theory 表明,稳定 system 的 stability 是 exponential 的。这提示我们:一个会受到 random load shocks、并容易 congestion collapse 的 unstable network,可以通过在其 primary excitation(senders、traffic sources)上增加 exponential damping(exponential timer backoff)来 stabilize。
脚注 3:作者并不是第一个认识到 transport 需要同时估计 mean 和 variation 的人;例如可参见 [6]。但作者认为他们的 estimator 比多数方案简单。
脚注 4:参见 [8]。一些 authors 已经证明,在 finite populations 且知道 global traffic 时,比 exponential “slower” 的 backoffs 也可以 stable;但 [17] 证明,在 general case 下,任何 slower than exponential 的 behavior 都无法工作。
为了形成直觉,可以把 IP gateway 看作与 ALOHA net 或 Ethernet 中的 “ether” 具有基本相同的 behavior。证明 exponential retransmit backoff 的必要性,就类似于证明在 Ethernet 上没有比 exponential 更慢的 collision backoff 能够 guarantee stability。
遗憾的是,当 user population infinite 时,即使 exponential backoff 也不能 guarantee stability(虽然它“almost”能做到,见 [1])。幸运的是,我们还不需要处理 infinite user population。
3 Adapting to the path: congestion avoidance
如果 timers 状态良好,那么可以相当有把握地认为 timeout 表示 packet loss,而不是 broken timer。此时可以处理问题 (3)。
packets 会因两种原因 lost:它们在 transit 中被 damaged,或者 network congested,path 上某处没有足够的 buffer capacity。
在大多数 network paths 上,damage loss 很少(≪ 1%),所以 packet loss 很可能由 network congestion 导致3。
第 8 页:Congestion avoidance 的 signal 与 path adaptation

Figure 6:Performance of a Mean+Variance retransmit timer
图 6 使用与图 5 相同的 data,但 solid line 是按照 Appendix A 的 algorithm 计算出来的 retransmit timer。
为了绕开完整 proof,可以注意到:network 在非常好的近似下是一个 linear system。也就是说,它由表现为 linear operators 的 elements 构成,例如 integrators、delays、gain stages 等。
linear system theory 表明,如果一个 system 是 stable 的,那么它的 stability 是 exponential 的。这提示:一个 unstable system——例如受到 random load shocks、容易 congestion collapse 的 network——可以通过向 primary excitation(senders、traffic sources)增加 exponential damping(exponential timer backoff)来 stabilize[^6]。
3 Adapting to the path: congestion avoidance
如果 timers 状态良好,就可以较有把握地认为 timeout 表示 packet lost,而不是 timer broken。此时可以处理 packet conservation failure 的第三种情况。
packets 会因两种原因 lost:它们在 transit 中 damaged,或者 network congested,path 上某处 buffer capacity 不足。
在大多数 network paths 上,因 damage 导致的 loss 很少(≪ 1%),所以 packet loss 很可能由 network congestion 导致[^7]。
congestion avoidance strategy(例如 [15] 中提出的 strategy)有两个 components:
- network 必须能够向 transport endpoints signal congestion 正在发生或即将发生;
- endpoints 必须具有一个 policy:收到 signal 时降低 utilization,没有收到 signal 时增加 utilization。
如果 packet loss 几乎总是由 congestion 导致,而且 timeout 几乎总是表示 packet lost,那么我们就有了一个很好的 “network is congested” signal candidate。
特别重要的是,所有现有 networks 都会自动提供这个 signal,不需要特殊 modification;相比之下,[15] 要求在 packet headers 中新增一个 bit,并修改所有现有 gateways 来设置这个 bit。
congestion avoidance strategy 的另一部分是 endnode action。DEC/ISO scheme 和本文 TCP 的 endnode action 几乎相同[^8],并且可以直接从 network 的 first-order time-series model 推导出来[^9]。
设 network load 由固定 intervals 上的 average queue length 衡量;interval 应选择为合适的长度,通常接近 round-trip time。
如果 interval i 的 load 为 Lᵢ,那么一个 uncongested network 可以用如下方式建模:Lᵢ 相对于 sampling time 变化很慢,即:
Lᵢ = N
其中 N 为 constant。
如果 network 受到 congestion,这个 zeroth-order model 就不成立。average queue length 变成两项之和:第一项 N account for average arrival rate of new traffic 和 intrinsic delay;第二项则 account for 上一个 time interval 遗留下来的 traffic fraction,以及这些 leftover traffic 产生的 effect(例如 induced retransmits):
Lᵢ = N + γLᵢ₋₁
这两个式子相当于 L(t) 的 Taylor series expansion 的前两项。作者认为,最终可能需要 three-term、second-order model,但要等 Internet 显著增长之后才有必要。
当 network congested 时,γ 必须很大,queue lengths 会开始 exponential increase[^10]。只有当 traffic sources 至少以 queue growth 的速度 throttle back,system 才能 stabilize。
window-based protocol 中,source 通过调整 window size W 控制 load,于是 sender policy 为:
On congestion:
Wᵢ = dWᵢ₋₁ (d < 1)
也就是说,window size 采取 multiplicative decrease;如果 congestion 持续存在,window size 就会随 time exponential decrease。
第 9 页:Congestion model 与 multiplicative decrease

Figure 8 之前的模型推导继续
当 network 没有 congestion 时,γ 应当接近 zero,load 大致保持 constant。network 通过 dropped packet 宣布 demand 过高;但当一个 connection 使用量低于 fair share 时,network 不会给出任何 signal,因为 network 是 stateless 的,不知道这个 connection 是否使用了 fair share。
因此,connection 必须增加 bandwidth utilization,才能探测当前 limit。
例如,connection 可能和另一个 connection 共享 path,并最终收敛到各自使用一半 available bandwidth 的 window。如果另一个 connection 停止,那么除非你的 window size 增加,否则 50% bandwidth 会被浪费。此时应该采用什么 increase policy?
第一个想法,是使用 symmetric、multiplicative increase,并且可能把 time constant 设置得更长:
Wᵢ = bWᵢ₋₁ (1 < b ≤ 1/d)
这是错误的。结果会是剧烈 oscillation,平均 throughput 反而很差。
analytic reason 与以下事实有关:把 network 推入 saturation 很容易,但让 network recover 很困难;[18] 第 2.1 章把这称为 rush-hour effect[^11]。
因此,overestimating available bandwidth 的 cost 很高。但 exponential increase 几乎无论 time constant 取什么值,增长都太快,所以 overestimate 是 inevitable 的。
本文不展开 justification,直接指出 best increase policy:对 window size 做 small、constant changes[^12]:
On no congestion:
Wᵢ = Wᵢ₋₁ + u (u ≪ Wmax)
其中 Wmax 是 pipe size,即 path 的 delay-bandwidth product 减去 protocol overhead;它是 unloaded path 上 sensible window 的最大值。
这就是 [15] 建议的 additive increase / multiplicative decrease(AIMD)policy,也是我们在 TCP 中实现的 policy。两个 implementations 唯一的差异,是 d 和 u 的 constants 选择。
本文使用 0.5 和 1,部分理由在 Appendix D 解释;更完整的 analysis 将在另一篇 in-progress paper 中给出。
前面可能让 congestion control algorithm 听起来很 hairy,但它其实并不复杂。和 slow-start 一样,核心只有三行 code:
- 任何 timeout 发生时,把
cwnd设置为当前 window size 的一半(multiplicative decrease); - 每收到一个 new-data ACK,把
cwnd增加1/cwnd(additive increase)[^13]; - sending 时,发送 receiver advertised window 与
cwnd中的 minimum。
第 10 页:Additive increase 与算法边界

图中 continuation 的重点,是 window increase 不能采用 symmetric exponential policy。
如果没有 congestion,connection 必须主动 probe path capacity;但 probe 太快会形成 persistent queue,而 queue 的清空速度受 bottleneck 的 free capacity 限制。于是,additive increase 让 connection 以慢而可控的方式寻找更多 bandwidth;一旦 packet loss 暗示 congestion,multiplicative decrease 快速释放 capacity。
在实现层面,cwnd 的 additive increase 不是“每个 ACK 永远加一个完整 packet”。本文使用每个 new-data ACK 增加 1/cwnd 的方式,使得在一个 RTT 内累计增加不超过一个 packet,并保持 ACK clock 的 self-clocking 性质。
这里的 congestion avoidance algorithm 只处理 congestion avoidance,不包含前面描述的 slow-start。
由于 signal congestion 的 packet loss 会导致 restart,因此除了 congestion avoidance 之外,几乎肯定还需要 slow-start。但 congestion avoidance 与 slow-start 都由 timeout 触发,也都 manipulate congestion window,因此经常被混淆。
实际上,它们是两个 independent algorithms,目标完全不同。为了强调这种差异,本文把它们分开介绍,即使实践中应该把它们一起实现。Appendix B 描述 combined slow-start/congestion avoidance algorithm[^14]。
脚注 10:Fig. 1 中,pipe size 是 16 packets(每个 direction 8 个),但 sender 使用 22-packet window。多出的 6 packets 会在 bottleneck entry 形成 queue;即使 sender 仔细以 bottleneck link rate clock packets,这个 queue 也无法 shrink。
这是 packet conservation 的另一个 unfortunate aspect:只有当 gateway 能以比 sender 把 packets dump 到 fat pipe 更快的速度,把 packets 移入 skinny pipe 时,queue 才会 shrink。
gateway 需要 excess output capacity(即 ρ < 1)才能 dissipate queue;clearing time 约按 (1−ρ)⁻² scaling。由于 equilibrium 时 transport connection 希望以 100% 利用率运行 bottleneck(ρ = 1),所以在 non-equilibrium window adjustment 期间,control policy 必须为 gateway 留出足够 free bandwidth,以消除因 path testing 和 traffic fluctuations 必然形成的 queues。
脚注 11:完整的 increase/decrease policy analysis 见 [4];[8] 和 [9] 给出类似 control policies 的 control-theoretic analysis。
脚注 12:这个 increment rule 可能并不直观。我们希望 window 在一个长度为 R 的 interval(round-trip time)内最多增加一个 packet。为了让 algorithm self-clocked,最好在每个 ACK 上增加一个 small amount,而不是在 interval 末尾一次增加 large amount。
脚注 13:作者也开发了 connectionless traffic(例如 domain server queries、RPC requests)的 rate-based congestion avoidance variant。由于目标是 bandwidth adjustment,rate-based scheme 中受控的参数是 time,而 bandwidth 位于 time 的 denominator 中,因此 multiplicative decrease 保持 multiplicative decrease,但对 interval 减去 constant 并不会产生 additive bandwidth increase。
第 11 页:Slow-start 与 congestion avoidance 的组合

combined algorithm 中,sender 保持两个 congestion-control state variables:slow-start/congestion window cwnd,以及用于在两个 algorithms 间切换的 threshold size ssthresh。
sender 的 output routine 总是发送 receiver advertised window 与 cwnd 中的 minimum。
发生 timeout 时,先把当前 window size 的一半记录到 ssthresh(这是 congestion avoidance 的 multiplicative decrease 部分),然后把 cwnd 设置为 1 packet(启动 slow-start)。
当新 data 被 acknowledged 时,sender 执行:
if (cwnd < ssthresh)
/* if we're still doing slow-start,
open window exponentially */
cwnd += 1;
else
/* otherwise do Congestion
Avoidance increment-by-1 */
cwnd += 1/cwnd;
因此,slow-start 会快速把 window 打开到 congestion avoidance 认为安全的 operating point——也就是让我们陷入 trouble 的 window 的一半;随后 congestion avoidance 接管,以较慢速度增加 window,probe path 上是否有更多 bandwidth available。
注意,如果 cwnd 使用 unscaled、one-packet units 的 integer 表示,上面 else clause 会 malfunction。假设 path 的 maximum window 是 w packets,那么 cwnd 必须覆盖 0..w,并且 resolution 至少为 1/w[^15]。
由于发送 smaller-than-MTU packets 会降低 efficiency,implementor 必须确保 fractionally sized cwnd 不会导致发送 small packets。合理的 TCP implementations 已经有 silly-window avoidance code,可以避免 runt packets;但这个 point 仍需仔细检查。
4 Future work: the gateway side of congestion control
Figures 7–12 展示了有无 congestion avoidance 时 TCP connections 的 behavior。尽管 test conditions(例如 16 KB windows)是特意选择来 stimulate congestion 的,但 test scenario 并不脱离 common practice:Arpanet IMP end-to-end protocol 允许任意一对 gateways 之间最多有 8 个 packets in transit;4.3BSD default window size 是 8 packets(4 KB)。
因此,例如 Berkeley 的两台 hosts 与 MIT 的两台 hosts 之间同时进行 conversations,就会超过 UCB–MIT IMP path 的 capacity,并产生后文展示的 behavior[^16]。
transport endpoints 上的 algorithms 可以确保 network capacity 不被 exceed,但不能确保 capacity 被 fair sharing。只有在 flows 汇合的 gateways 中,才有足够 information 来控制 sharing 和 fair allocation。
因此,作者把 gateway 的 congestion detection algorithm 视为 next big step。
第 12 页:Multiple TCP test setup 与 gateway-side policy

Figure 7:Multiple conversation test setup
该 test setup 用来研究多个 simultaneous TCP conversations 共享 bottleneck link 时的 interaction。
四台 LBL machines 分别向四台 UCB machines 发起 1 MByte transfers(每次 transfer 由 2048 个 512-data-byte packets 组成),每隔 3 seconds 启动一个 conversation,每对 machines 之间有一个 conversation。
所有 traffic 都经过连接 LBL 的 IP router csam 与 UCB 的 IP router cartan 的 230.4 Kbps link。microwave link 的 queue 最多能容纳 50 packets。
每个 connection 的 window 是 16 KB(32 个 512-byte packets)。因此,任意两个 connections 就可能 overflow available buffering;四个 connections 更是超出 queue capacity 的 160%。
gateway-side algorithm 的目标,是尽早向 endnodes 发送 signal,但又不能过早,以至于 gateway 被 traffic 饿死。
由于计划继续使用 packet drops 作为 congestion signal,gateway 对 misbehaving host 的 self-protection 可以自然获得:该 host 的大多数 packets 会被 drop,因为 gateway 试图告诉它正在使用超过 fair share 的 capacity。
因此,和 endnode algorithm 一样,gateway algorithm 即使在 endnode 未修改、未实现 congestion avoidance 时,也应当降低 congestion;实现 congestion avoidance 的 nodes 则可以获得 fair share bandwidth,并把 packet drops 保持在 minimum。
由于 congestion exponential growth,early detection 很重要。如果 early detect 到 congestion,只需对 senders 的 windows 做 small adjustments 就能修复;否则需要 massive adjustments,才能给 network 足够 spare capacity 排出 backlog。
但由于 traffic 具有 bursty nature,reliable detection 是 non-trivial problem。Jain [15] 提出基于 regeneration points 之间 averaging 的 scheme。它可能具有 good burst filtering,但作者认为,在 high load 或 traffic 的 significant second-order dynamics 下,可能出现 convergence problems[^17]。
作者计划把他们早期关于 round-trip-time/queue length prediction 的 ARMAX models 用作 detection 的 basis。
第 13 页:没有 congestion avoidance 的实验

Figure 8:Multiple, simultaneous TCPs with no congestion avoidance
图中是四个 simultaneous TCP conversations 在 Fig. 7 所示 paths 上运行、且没有 congestion avoidance 时的 trace。
发送的 11,000 个 packets 中有 4,000 个是 retransmissions,也就是说一半的 data packets 被 retransmitted。
由于 link data bandwidth 是 25 KBps,四个 conversations 每个本应获得 6 KBps。但实际结果是:一个 conversation 获得 8 KBps,两个获得 5 KBps,一个只有 0.5 KBps,还有 6 KBps 消失了。
初步结果表明,作者计划使用的 gateway detection approach 在 high load 下表现良好,不受 traffic 的 second-order effects 影响,并且 computational cost 足够低,不会拖慢每秒处理 kilopackets 的 gateways。
Acknowledgements
作者感谢 Internet Activity Board 的 End-to-End 和 Internet-Engineering task forces 成员,在过去一年中提供的 interest、encouragement、cogent questions 和 network insights。
作者特别感谢 ISI 的 Bob Braden 和 BBN 的 Craig Partridge;他们仔细阅读 early drafts,对本文的 improvement 极其有帮助。
第一作者还特别感谢 DEC Western Research Lab 的 Jeff Mogul。没有 Jeff 的 interest 和耐心推动,这篇 paper 不会存在。
第 14 页:加入 congestion avoidance 的实验

Figure 9:Multiple, simultaneous TCPs with congestion avoidance
图中是四个 simultaneous TCP conversations 使用 congestion avoidance、并沿 Fig. 7 所示 paths 运行的 trace。
发送的 8,281 个 packets 中只有 89 个 retransmissions,也就是只有 1% 的 data packets 需要 retransmit。
两个 conversations 获得 8 KBps,另外两个获得 4.5 KBps;所有 link bandwidth 都 accounted for(见 Fig. 11)。high-bandwidth 与 low-bandwidth senders 之间的差异来自 receivers。
获得 4.5 KBps 的 senders 对话的是 4.3BSD receivers;这些 receivers 会延迟 ACK,直到 window 填充 35%,或经过 200 ms(平均每次 ACK 延迟 5–7 packets)。因此 sender 每个 ACK 会 burst 发送 5–7 packets。
获得 8 KBps 的 senders 对话的是 4.3+BSD receivers;这些 receivers 最多只延迟一个 packet 的 ACK。由于 ACK 具有 clock role,作者认为 minimum ACK frequency 应该是每两个 packets 一个 ACK。
sender 每次 ACK 最多 burst 发送两个 packets。loss probability 会随 burst size 快速增加,因此对话旧式 receivers 的 senders 看到的 loss rate 是新式 receivers 的三倍(1.8% 对 0.5%)。更高 loss rate 意味着更多 time spent in retransmit wait;而 congestion avoidance 又会使 average window size 变小。
第 15 页:Old/new TCP 使用的总 bandwidth

Figure 10:Total bandwidth used by old and new TCPs
thin line 表示没有 congestion avoidance 的四个 senders(Fig. 8),数据按 5-second intervals average,并以 25 KBps link bandwidth normalize。
可以看到,senders 平均发送的 data 比 wire 能容纳的多 25%。
thick line 表示带 congestion avoidance 的 senders(Fig. 9)。最初 5-second interval 较低,这是 slow-start 的结果;随后出现大约 20 seconds 的 damped oscillation,此时每个 TCP 的 congestion-control regulator 正在寻找正确的 window size。
剩余时间里,senders 以 wire bandwidth 运行。
约 110 seconds 处的 activity,是由于 conversation 1 shutdown 触发的 bandwidth “re-negotiation”。约 80 seconds 处的 activity,反映了 Fig. 9 中的 “flat spot”:conversation 2 的大部分 bandwidth 突然转移给 conversations 3 和 4。
竞争中的 conversations 经常表现出这种 “punctuated equilibrium” behavior;作者希望在未来 paper 中研究它的 dynamics。
第 16 页:Effective bandwidth

Figure 11:Effective bandwidth of old and new TCPs
Fig. 10 表明,old TCPs 使用的 bandwidth 比 bottleneck link bandwidth 多 25%。因此,一旦 bottleneck queue 填满,senders 的 25% packets 会被 discard。
如果只 retransmit 被 discard 的 packets,senders 就能获得完整的 25 KBps link bandwidth;这意味着它们虽然 behavior anti-social,但不会 self-destructive。
但 Fig. 8 说明约 25% 的 link bandwidth 没有 accounted for。图 11 对每个 five-second interval 中 ACK 的 data 总量做 average,得到 link 的 effective 或 delivered bandwidth。
thin line 仍然表示 old TCPs。只有 75% 的 link bandwidth 被 data 使用;剩余部分必然被那些其实不需要 retransmit 的 packets 的 retransmissions 消耗。
thick line 表示 new TCPs 的 delivered bandwidth。它同样有 slow-start 和 turn-on transient,随后进入长时间的 operation,正好运行在 link bandwidth 上。
第 17 页:Window adjustment detail

Figure 12:Window adjustment detail
由于 old TCP data 需要用 five-second averaging 来平滑 spikes,Figures 10 和 11 很难看出 congestion avoidance window policy 的细节。
因此这里展示带 congestion control 的 TCPs 的 effective throughput(data acked),average interval 缩短为 three seconds。
当一个 packet 被 drop 时,sender 会继续发送,直到填满 window,然后停止,等待 retransmission timeout。
由于 receiver 不能 acknowledge dropped packet 之后的数据,预计 graph 会出现一个 negative-going spike,其 amplitude 等于 sender window size 减去一个 packet。
如果 retransmission 发生在下一个 interval(interval 的选择与 retransmit timeout 对齐),那么当 receiver acknowledge 它缓存的 out-of-order data 时,预计会出现同样 amplitude 的 positive-going spike。
因此,这些 spikes 的 height 直接测量 sender window size。
data 清楚地显示了三个 events(15、33 和 57 seconds);window size 看起来在 exponential decrease。
dotted line 是从这六个 window-size measurements 获得的 least-squares fit。fit time constant 是 28 seconds。这个较长 time constant 是因为 gateway 中还没有 congestion avoidance algorithm;如果 gateway 运行 drop algorithm,time constant 应该接近 4 seconds。
脚注 6:由于 packet loss 会清空 window,window flow-control protocol 的 throughput 对 damage loss 很敏感。对于 RFC793 standard TCP,如果 window 为 w(且 w 不超过 bandwidth-delay product),loss probability 为 p 时,throughput 会乘上 (1 + 2pw)⁻¹。
例如,在 Arpanet path 上 1% damage loss rate(8-packet window)会让 TCP throughput 降低 14%。本文的 congestion-control scheme 在 loss rate 达到 window equilibration length(loss 后 window 恢复到原 size 所需的 packets 数)之前,对 damage loss 不敏感。
如果 pre-loss size 是 w,equilibration 大约需要 w^(2/3) packets;对 Arpanet 而言,loss sensitivity threshold 约为 5%。在这个高 loss rate 下,empty-window effect 已经让 throughput 降低 44%,此时由 congestion-avoidance window shrinking 造成的 additional degradation 已经不是主要问题。
作者担心 congestion-control noise sensitivity 关于 w 是 quadratic 的,但至少还要一代 network evolution 才会达到使它 significant 的 window sizes。如果 experience 表明这是 liability,只需做一个 trivial modification,就能让它关于 w linear;一篇 in-progress paper 正在详细研究该 subject。
脚注 7:这并非偶然;作者听过 Jain 在 [10] 的 presentation 后,意识到 Jain 的 scheme 在某种意义上是 universal,于是复制了它。
脚注 8:参见任何优秀的 control theory text,了解 system model 与 admissible controls 的关系;[21] 第 8 章提供了一个 nice introduction。
脚注 9:此时 system 的 behavior 近似为 Lᵢ ≈ γLᵢ₋₁,这是一个 difference equation,其 solution 为:
Lₙ = γⁿL₀
当 γ > 1 时,它会 exponential 地趋向 infinity。
脚注 14:原文说明此处的 “would lead” 是指前述 type of behavior。
脚注 15:对于 TCP,这件事自然成立,因为 windows 以 bytes 而不是 packets 表示。对于 ISO TP4 等 protocols,implementor 应当对 cwnd scaling,使上述 calculations 能以 integer arithmetic 完成;scale factor 必须足够大,避免 ⌊1/cwnd⌋ 在 congestion-avoidance increment 中落到 fixed point zero。
脚注 16:原文指出这是对窗口行为的补充说明,不改变 slow-start 与 congestion avoidance 的独立目标。
脚注 17:这些 problems 来自 regeneration points 之间的 average time 按 (1−ρ)⁻¹ scaling,而 variance 按 (1−ρ)⁻³ scaling。因此 congestion detector 在 congestion 增加时变得 sluggish,其 signal-to-noise ratio 会 dramatically decrease。
第 18 页:Appendix A——RTT mean 与 variation 的 fast algorithm

A A fast algorithm for RTT mean and variation
A.1 Theory
RFC793 的 mean round-trip-time estimator,是一类称为 recursive prediction error 或 stochastic gradient algorithms 的 estimator 中最简单的 examples 之一。
过去 20 年,这类 algorithms 已经 revolutionize estimation 和 control theory [20];因此值得详细考察 RFC793 estimator。
给定一个新的 RTT measurement m,TCP 按如下方式更新 average RTT estimate a:
a ← (1 − g)a + gm
其中 g 是 gain(0 < g < 1),应该与 m 的 signal-to-noise ratio(或者等价地,variance)相关。
将式子重排,把乘以 g 的 terms 收集到一起,会更容易理解且计算更快:
a ← a + g(m − a)
可以把 a 看作 next measurement 的 prediction。m − a 是这个 prediction 的 error;上式表示:基于 old prediction 加上 prediction error 的一部分,生成 new prediction。
prediction error 由两个 components 组成:
- measurement 中 noise 导致的 error,即 competing traffic fluctuation 等 random、unpredictable effects;
a选择不当导致的 estimation error。
分别把 random error 记作 Eᵣ,estimation error 记作 Eₑ,则:
a ← a + gEᵣ + gEₑ
gEₑ term 会把 a 向正确方向 kick;gEᵣ term 则把它向 random direction kick。经过多个 samples 后,random kicks 会相互 cancel,因此 algorithm 会趋向正确 average。
但 g 是一个 compromise:我们希望 g 足够大,以便从 Eₑ 中获得 mileage;又希望 g 足够小,以降低 Eᵣ 带来的 damage。
由于 Eₑ terms 无论使用什么 g 都会把 a 推向 real average,所以 gain 太小通常比 gain 太大更好。典型 gain choices 是 0.1–0.2,但在选择 gain 之前,最好先长时间观察 raw data。
显然,a 会在 true average 周围 random oscillate;a 的 standard deviation 是 g sdev(m)。a 会以 exponential 的方式收敛到 true average,time constant 为 1/g。
因此,较小的 g 会让 a 更 stable,但代价是需要更长时间才能到达 true average。
如果希望估计 m 的 variation,例如计算一个 good TCP retransmit timer,有几个 alternatives。Variance σ² 是 conventional choice,因为它具有一些 nice mathematical properties。
但计算 variance 需要对 (m − a) 做 squaring,因此 estimator 包含一次 multiply,并有 integer overflow 的危险。并且,大多数 applications 希望 variation 与 a 和 m 使用相同 units,所以使用时还必须对 variance 开 square root;这至少需要一个 divide、一个 multiply 和两个 adds。
一个更容易计算的 variation measure,是 mean prediction error 或 mean deviation,即 |m − a| 的 average。
由于:
mdev² = (Σ|m − a|)² ≥ Σ|m − a|² = σ²
mean deviation 是比 standard deviation 更 conservative(即更大)的 variation estimate[^18]。
第 19 页:Mean deviation estimator 的 implementation

mean deviation 与 standard deviation 经常存在简单关系。例如,如果 prediction errors 正态分布,则:
mdev = √(π/2) sdev
对于大多数 common distributions,从 sdev 到 mdev 的 factor 接近 one(√(π/2) ≈ 1.25)。也就是说,mdev 是 sdev 的 good approximation,却容易得多计算。
A.2 Practice
给定 measurement m,average a 和 mean deviation v 的 fast estimators 可以直接由上面的 reasoning 得到。两个 estimators 都是在计算 means,因此是 RFC793 algorithm 的两个 instances:
Err ≡ m − a
a ← a + gErr
v ← v + g(|Err| − v)
为了快速计算,上述运算应使用 integer arithmetic。但 expressions 中包含 fractions(g < 1),所以需要 scaling 才能保持 integer。
reciprocal power of 2(即 g = 1/2ⁿ)是特别好的 g choice,因为 scaling 可以通过 shifts 实现。
把式子乘以 1/g,得到:
2ⁿa = 2ⁿa + Err
2ⁿv = 2ⁿv + (|Err| − v)
为了最小化 round-off error,应该保存 scaled versions sₐ 和 sᵥ,而不是 unscaled versions。
选择 g = .125 = 1/8(接近 RFC793 建议的 .1),可以用如下 C-like code:
/* update Average estimator */
m -= (sa >> 3);
sa += m;
/* update Deviation estimator */
if (m < 0)
m = -m;
m -= (sv >> 3);
sv += m;
没有必要让 a 和 v 使用相同 gain。为了让 timer 在 RTT 发生变化时快速上升,最好给 v 使用更大的 gain。
特别是,由于 window–delay mismatch,RTT 中经常出现 window size 的 integer multiples 的 artifacts[^19]。为了 filter 这些 artifacts,希望 a estimator 中的 1/g 至少和 window size(packets)一样大,而 v estimator 中的 1/g 小于 window size[^20]。
脚注 18:严格来说,前面的 inequality 省略了 1/n factor,其中 n 是 samples 数量;这不影响结论。
脚注 19:例如 Fig. 5 的 packets 10–50。注意,这些 window effects 来自 Arpa/Milnet subnet 的 characteristics。一般来说,timer 上的 window effects 最多是 second-order consideration,并且高度依赖 underlying network。
脚注 20:绝对值计算会让 timer 产生 asymmetry:由于 v 与 increase 同号、与 decrease 反号,v 使用更大 gain,会让 timer rise faster、fall slower,从而自动获得 [22] 建议的 behavior;例如 Fig. 6 的 packets 50–80 区域。
第 20 页:最终 retransmit timer 与 combined algorithm

对 deviation 使用 .25 的 gain,并令 retransmit timer rto = a + 4v,最终 timer code 如下:
m -= (sa >> 3);
sa += m;
if (m < 0)
m = -m;
m -= (sv >> 2);
sv += m;
rto = (sa >> 3) + sv;
一般来说,这个 computation 会正确 round rto。原因是:计算 m − a 时 sa 的 truncation,会让 sa 收敛到向上 round 到下一个 tick 的 true mean;同理,sv 也如此。
rto computation 应加入 half tick 的 rounding;此外,还要加一个 tick,以 account for sends 相对于 clock 的 random phase。因此,4v 带来的 1.75 tick bias,大致等于希望的 half-tick rounding 加 one-tick phase correction。
B The combined slow-start with congestion avoidance algorithm
sender 为 congestion control 保持两个 state variables:slow-start/congestion window cwnd,以及 threshold size ssthresh,用于在两个 algorithms 间切换。
sender output routine 总是发送 cwnd 和 receiver advertised window 中的 minimum。
timeout 时,把 current window size 的一半记录到 ssthresh(congestion avoidance 的 multiplicative decrease),随后把 cwnd 设置为 1 packet(启动 slow-start)。
new data 得到 ACK 时,sender 执行:
if (cwnd < ssthresh)
/* if we're still doing slow-start
open window exponentially */
cwnd += 1;
else
/* otherwise do Congestion
Avoidance increment-by-1 */
cwnd += 1/cwnd;
这样,slow-start 会迅速把 window 打开到 congestion avoidance 认为安全的 point(导致 trouble 的 window 的一半);然后 congestion avoidance 接管,慢慢增加 window,probe path 上是否有更多 bandwidth available。
如果 cwnd 是 unscaled、one-packet units 的 integer,上述 else clause 会 malfunction。也就是说,如果 path maximum window 是 w packets,cwnd 必须以至少 1/w 的 resolution 覆盖 0..w。
第 21 页:Window adjustment 与 RTT interaction

C Interaction of window adjustment with round-trip timing
一些 TCP connections,尤其是通过低速 link(例如 dial-up SLIP line [25])的 connections,可能经历 congestion-window adjustment 与 retransmit timing 之间的不幸 interaction。
network paths 往往分成两类:
- delay-dominated:store-and-forward 和/或 transit delays 决定 RTT;
- bandwidth-dominated:bottleneck link bandwidth 和 average packet size 决定 RTT[^21]。
在 bandwidth b 的 bandwidth-dominated path 上,congestion-avoidance window increment Δw 会把 increment 之后 packets 的 RTT 增加约:
ΔR ≈ Δw / b
如果 path RTT variation V 很小,那么 ΔR 可能超过 rto 中的 4V cushion,导致 retransmit timeout。
经过几个 cycles 后,ssthresh(以及 cwnd)会被 clamp 到很小的 values。
Appendix A 的 rto calculation 被设计来防止 slow-start 期间发生这种 spurious retransmission timeout。特别地,rto 中 RTT variation 被乘以 four,理由如下:
如果 slow-start round i 末尾计算的 rtoᵢ 小于或等于下一轮的 actual RTT,就会发生 spurious retransmit。
最坏情况是所有 delay 都由 window 造成;此时每一轮 window 都翻倍,所以 Rᵢ₊₁ = 2Rᵢ,其中 Rᵢ 是 slow-start round i measured RTT。但:
Vᵢ = Rᵢ − Rᵢ₋₁ = Rᵢ/2
rtoᵢ = Rᵢ + 4Vᵢ = 3Rᵢ
> 2Rᵢ
> Rᵢ₊₁
因此不可能发生 spurious retransmit timeout。
原始 SIGCOMM ’88 version 建议使用 R + 2V 而不是 R + 4V。之后,作者在低速 SLIP links 上积累了更多 experience,观察到 connection startup 期间存在 spurious retransmissions;对原因的 investigation 导致上面的 analysis,并把 Appendix A 中的计算改为 R + 4V。
第 22 页:Idle connection 与 slow-start restart

congestion-avoidance window increment 也可能触发 spurious retransmission,因为 window 只能以 one-packet increments 改变;对于 packet size s,两次 increments 之间可能有多达 s − 1 packets,足够让上一次 window increment 导致的 V 增长在此期间 decay 到 zero。
不过,在 bandwidth-dominated path 上这个问题不太可能发生:increments 必须间隔超过 twelve packets(这是 V filter 在 rto calculation 中、结合其 gain 得到的 decay time),这意味着 path 使用了 ridiculously large window[^22]。
因此,这类 timeout 可以视为对 gross mis-tuning 的 appropriate punishment;其 effect 只是把 window reduce 到更适合 path 的 size。
虽然 slow-start 和 congestion avoidance 被设计成不会触发这类 spurious retransmission,但 higher-level protocols 经常会触发 interaction。
例如 SMTP 和 NNTP 等 application protocols 有一个 negotiation phase:少量 packets 以 stop-and-wait 方式 exchange;随后进入 data-transfer phase,一次发送整封 mail message 或 news article。
不幸的是,negotiation exchanges 会打开 congestion window,因此 data transfer 开始时会在没有 slow-start 的情况下,向 network dump 多个 packets;在 bandwidth-dominated path 上,这个速度还可能快到 rto 无法 track 这些 packets 造成的 RTT increase。
这个问题的 root cause,与第 1 节描述的 root cause 相同:向一个 empty pipe dump too many packets,而没有 ACK clock。第 1 节提出的 fix——slow-start——如果 TCP implementation 能检测 phase change,也能防止这个问题。
检测很简单:如果至少一个 round-trip-time 没有发送任何东西,pipe 就是 empty 的(也可以把 RTT 看成从最近一次 send 起,pipe 清空所需的 time)。
因此,如果至少一个 RTT 没有发送 data,那么 next send 应把 cwnd 设置为 1 packet,强制进入 slow-start。
如果 connection state variable lastsnd 保存 last packet sent 的 time,那么下面的 code 应出现在 TCP output routine 的 early position:
int idle = (snd_max == snd_una);
if (idle && now - lastsnd > rto)
cwnd = 1;
如果没有 data in transit(所有 sent data 都已 ACK),boolean idle 为 true;因此 if 的含义是:“如果没有 data in transit,且已经有很长时间没有 send,就进入 slow-start。”
作者的 experience 是:用当前 RTT estimate 或 rto estimate 作为 “long time” 都能得到 good results[^23]。
D Window Adjustment Policy
选择 1/2 作为 decrease term,而不是 [15] 中的 7/8,作者给出如下 handwaving。
packet dropped 时,connection 要么处于 starting(或 drop 后 restarting),要么处于 steady-state sending。
如果处于 starting,就知道当前 window 的一半是“work 的”:slow-start 保证了此前有一个 window 的 packets exchange 且没有 drops。因此发生 congestion 时,把 window 设置成已知能够工作的最大 size,然后慢慢增加。
如果 connection steady-state running 时发生 packet drop,很可能是一个 new connection 启动并占用了部分 bandwidth。作者的 networks 通常以 ρ ≤ 0.5 运行,因此很可能此时恰好有两个 conversations sharing bandwidth。
也就是说,应把自己的 window 减半,因为 available bandwidth 减半;如果有多于两个 conversations,halving window 是 conservative 的,而在高 traffic intensity 下 conservative 通常是明智的。
第 23 页:Decrease/increase 参数的 rationale

虽然 window size 减半看起来是 large performance penalty,但在 system terms 中,这个 cost negligible:当前 packets 只会在 large queue 形成后才被 drop。
即使使用 ISO IP 的 “congestion experienced” bit [11],迫使 senders reduce windows,queue 仍然存在,因为 bottleneck 以 100% utilization 运行,没有 excess bandwidth 可以 dissipate queue。
一旦一个 packet 被丢弃,某个 sender 会静默 two RTT,这正好是清空 queue 所需的时间。如果该 sender 随后以正确 window size restart,queue 就不会重新形成。
因此,delay 被 reduce 到 minimum,同时 system 没有失去任何 bottleneck bandwidth。
one-packet increase 的 justification 比 0.5 decrease 弱得多;事实上,它几乎肯定 too large。
如果 algorithm 收敛到 window size w,在 additive-increase policy 下,两次 drops 之间有 O(w²) packets。作者追求 average drop rate 小于 1%,并发现 Arpanet(四个 tested networks 中最差的一个)上的 windows 收敛到 8–12 packets。这产生了约 1% average drop rate 下的 one-packet increments。
但由于 gateway 中还没有实现任何东西,收敛的 window 实际上是 gateway 在不 drop packets 的情况下能够接受的最大值。
用 [15] 的术语说,当前 window 位于 cliff 的左边,而不是 knee 的右边。
如果 gateways 被修复为:queue 被推过 knee 后就开始 drop packets,那么当前 increment 会过于 aggressive,应当约缩小 four 倍;因为作者对 unloaded Arpanet 的 measurements 表明,它的 pipe size 是 4–5 packets。
实现一个 second-order control loop,自适应地确定 path 所需的 appropriate increment,看起来很 trivial。但在投入时间研究 gateway algorithm 的 first-order part 之前,second-order problems 暂时搁置。
第 24 页:References [1]–[22]

References
- Aldous, D. J. “Ultimate instability of exponential back-off protocol for acknowledgment based transmission control of random access communication channels.” IEEE Transactions on Information Theory IT-33(2),March 1987。
- ARPANET Working Group Request for Comment;DDN Network Information Center. Transmission Control Protocol Specification. SRI International,Menlo Park,California,September 1981,RFC-793。
- Borrelli, R.;Coleman, C. Differential Equations. Prentice-Hall,1987。
- Chiu, D.-M.;Jain, R. “Networks with a connectionless network layer; part III: Analysis of the increase and decrease algorithms.” Technical Report DEC-TR-509,Digital Equipment Corporation,Stanford,California,August 1987。
- Clark, D. “Window and Acknowledgement Strategy in TCP.” RFC-813,DDN Network Information Center,July 1982。
- Edge, S. W. “An adaptive timeout algorithm for retransmission across a packet switching network.” Proceedings of SIGCOMM ’83,ACM,March 1983。
- Feller, W. Probability Theory and its Applications, second edition,Vol. II,John Wiley & Sons,1971。
- Hajek, B. “Stochastic approximation methods for decentralized control of multi-access communications.” IEEE Transactions on Information Theory IT-31(2),March 1985。
- Hajek, B.;van Loon, T. “Decentralized dynamic control of a multiaccess broadcast channel.” IEEE Transactions on Automatic Control AC-27(3),June 1982。
- Proceedings of the Sixth Internet Engineering Task Force. Boston,April 1987;由 DDN Network Information Center 以 NIC document IETF-87/2P 提供。
- International Organization for Standardization. ISO International Standard 8473, Information Processing Systems — Open Systems Interconnection — Connectionless-mode Network Service Protocol Specification. March 1986。
- Jacobson, V. “Congestion avoidance and control.” 收录于 Proceedings of SIGCOMM ’88,Stanford,August 1988,ACM。
- Jain, R. “Divergence of timeout algorithms for packet retransmissions.” Proceedings of the Fifth Annual International Phoenix Conference on Computers and Communications,Scottsdale,Arizona,March 1986。
- Jain, R. “A timeout-based congestion control scheme for window flow-controlled networks.” IEEE Journal on Selected Areas in Communications SAC-4(7),October 1986。
- Jain, R.;Ramakrishnan, K.;Chiu, D.-M. “Congestion avoidance in computer networks with a connectionless network layer.” Technical Report DEC-TR-506,Digital Equipment Corporation,August 1987。
- Karn, P.;Partridge, C. “Estimating round-trip times in reliable transport protocols.” Proceedings of SIGCOMM ’87,August 1987,ACM。
- Kelly, F. P. “Stochastic models of computer communication systems.” Journal of the Royal Statistical Society B 47(3),1985,pp. 379–395。
- Kleinrock, L. Queueing Systems, Vol. II,John Wiley & Sons,1976。
- Kline, C. “Supercomputers on the Internet: A case study.” Proceedings of SIGCOMM ’87,August 1987。
- Ljung, L.;Söderström, T. Theory and Practice of Recursive Identification. MIT Press,1983。
- Luenberger, D. G. Introduction to Dynamic Systems. John Wiley & Sons,1979。
- Mills, D. Internet Delay Experiments. RFC-889,DDN Network Information Center,December 1983。
第 25 页:References [23]–[26]

- Nagle, J. Congestion Control in IP/TCP Internetworks. RFC-896,DDN Network Information Center,January 1984。
- Prue, W.;Postel, J. Something A Host Could Do with Source Quench. RFC-1016,DDN Network Information Center,July 1987。
- Romkey, J. A Nonstandard for Transmission of IP Datagrams Over Serial Lines: SLIP. RFC-1055,DDN Network Information Center,June 1988。
- Zhang, L. “Why TCP timers don’t work well.” Proceedings of SIGCOMM ’86,August 1986。
协议机制索引
| 机制 | 触发条件 | 作用 | 代价/边界 |
|---|---|---|---|
| packet conservation | equilibrium 中 packets 在 path 上稳定流动 | 旧 packet 离开后才注入新 packet,使 ACK 成为 self-clock | starting、loss restart、resource limit 会破坏 equilibrium |
| slow-start | connection starting 或 timeout restart | cwnd 从 1 packet 开始按 ACK 快速增长,避免空 pipe 上 burst | 需要 startup RTT;它不是长期 fair-share policy |
| RTT mean estimator | 每个新 RTT measurement | 估计下一次 RTT | gain 太大放大 noise,太小收敛慢 |
| RTT variation estimator | RTT 受 queue/load 影响波动 | 用 mean deviation 产生更 robust 的 rto | variation 与 window effects 需要按 path 调参 |
| exponential backoff | retransmission 发生 | 降低未知 competing population 下的再次注入压力 | infinite population 下仍不保证 stability |
| multiplicative decrease | timeout/packet loss 暗示 congestion | 快速释放 bottleneck capacity | window 会骤降,需后续 probe |
| additive increase | 没有 congestion signal | 小步探测更多 available bandwidth | 收敛慢,但避免 exponential overshoot |
combined cwnd/ssthresh | timeout 后 restart | slow-start 快速到 safe point,再交给 AIMD | cwnd 必须支持 fraction resolution |
| gateway congestion detection | 多个 flows 在 bottleneck 汇合 | 早 signal、fair sharing、自我保护 | detection 受 burst、high load 和 second-order dynamics 影响 |
设计判断与边界
- 拥塞是 transport implementation 与 network dynamics 的共同结果:仅有 protocol 的 window 语义不够;sender 如何使用 ACK、timer、window 和 retransmission,会改变整个 network 的 stability。
- slow-start 解决 startup,congestion avoidance 解决 steady-state probing:两者都操作
cwnd,但前者为了找到 safe operating point,后者为了在无 congestion 时逐步利用空余 bandwidth。 - timeout 既是 failure detector,也是 congestion signal:本文利用 packet damage 很少这一假设,把 timeout 解释为 path congestion 的近似 signal;在损坏率较高的 path 上,这个 inference 会变弱。
- AIMD 的不对称是必要的:multiplicative decrease 快速清理 overshoot,additive increase 慢速探测 capacity;symmetric multiplicative increase 会产生 wild oscillation 和 poor average throughput。
- endnode control 不能解决 fair allocation 的全部问题:只有 gateway 处于多个 flows 的 convergence point,才能观察 sharing 并执行 fair allocation;因此作者把 gateway-side congestion detection 列为下一步。
- 参数是 path-dependent 的:
R、variation、cwnd、ssthresh、window resolution 和 ACK frequency 都依赖 bottleneck、delay、buffer 和 receiver behavior,本文的数值不能脱离 1988 Internet 直接搬用。
本篇验收
- [x] 已固定作者注明的 November 1988 slightly revised version;PyMuPDF 实际解析为 25 页,SHA-256 为
9ca88dfa60f98d5cf736c3917df45420eb91861dd1de453a3dedf3d91c1836eb。 - [x] 已按 PDF 页序保留第 1–25 页页面图;25 张 PNG 均为
1190×1684,正文按600宽度嵌入。 - [x] 已覆盖 Introduction、packet conservation、slow-start、self-clocking、Figures 1–12、RTT mean/variation、retransmission timer、exponential backoff、congestion avoidance、AIMD、combined algorithm、gateway-side congestion detection、实验结果、Appendix A–D、Acknowledgements 和 26 条 References。
- [x] 已保留代码、公式、实验曲线、脚注以及 revised version 与 SIGCOMM ’88 的版本边界。
- [x] 已补充术语表、机制索引、参数取舍、实验边界和 endnode/gateway responsibility 分析。
参考资料
评论 (0)