# 自适应路由

自适应路由是一种网络方法，路由器和交换机根据拥塞、链路故障或流量负载等当前状况动态选择数据包转发路径，而不是遵循一次计算便固定不变的路由。它与当今互联网的负载不敏感路由形成对比：在后者中，RIP 和 OSPF 根据配置的链路代价计算路径，而这些代价并不反映当前拥塞；BGP 则依据路径属性和路由策略而非链路代价在路由之间进行选择。<sup>[1](https://azunyan.gitbook.io/internet-protocol/4.-the-network-layer/4.4-routing-algorithms)</sup><sup> • </sup><sup>[26](http://www.rfc.fr/rfc/en/rfc7311.pdf)</sup><sup> • </sup><sup>[1](https://azunyan.gitbook.io/internet-protocol/4.-the-network-layer/4.4-routing-algorithms)</sup> 一个 IETF 框架将其定义为在现有无环替代路径上动态调整路径，并具有基于流和基于包的调整模式。<sup>[2](https://datatracker.ietf.org/doc/draft-cheng-rtgwg-adaptive-routing-framework/05/)</sup> 自适应路由用于流量繁重且拓扑丰富的场景：数据中心 Clos 架构、高性能计算（HPC）互连，如 [Slingshot](https://www.edgepedia.org/zh/slingshot)<sup>[3](https://ar5iv.labs.arxiv.org/html/2008.08886)</sup> 和 [InfiniBand](https://www.edgepedia.org/zh/infiniband)。<sup>[4](https://hardwarenation.com/wp-content/uploads/2021/09/infiniband-white-paper-adaptive-routing.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 决策粒度 | 基于流、基于流片或逐包；逐包转发可能导致乱序交付，接收方必须处理<sup>[2](https://datatracker.ietf.org/doc/draft-cheng-rtgwg-adaptive-routing-framework/05/)</sup> |
| 经典信号 | 测量的链路延迟（ARPANET：每 10 秒对每条线路进行一次延迟估计）<sup>[5](http://www.ece.ucf.edu/~yuksem/teaching/ip/reading/ccr-9501-mcquilln.pdf)</sup>、ECN 标记、队列深度以及信用/队列占用<sup>[6](https://arxiv.org/html/2407.21625v4)</sup><sup> • </sup><sup>[3](https://ar5iv.labs.arxiv.org/html/2008.08886)</sup> |
| 控制开销 | 1979 年 ARPANET 自适应算法使用的线路和 CPU 开销不到百分之二，大多数节点在 100 毫秒内获知更新<sup>[5](http://www.ece.ucf.edu/~yuksem/teaching/ip/reading/ccr-9501-mcquilln.pdf)</sup> |
| 数据中心收益 | 即使存在单条链路故障，CONGA 的流完成时间也比 ECMP 好 5 倍<sup>[7](https://dl.acm.org/doi/10.1145/2740070.2626316)</sup> |
| HPC 收益 | 在 HDR InfiniBand 上，自适应路由将两级胖树中大消息的平均延迟降低了 20%<sup>[8](https://web-backend.simula.no/sites/default/files/publications/files/adaptive_routing_in_infiniband_hardware.pdf)</sup> |
| 故障重路由 | ARCANE 在不到 100 微秒内将流量重新路由到其他链路，避开故障链路<sup>[6](https://arxiv.org/html/2407.21625v4)</sup> |
| 已知代价 | 在热点场景中，InfiniBand 自适应路由将拥塞扩散到受害流，与确定性路由相比损失了总吞吐量的四分之一<sup>[8](https://web-backend.simula.no/sites/default/files/publications/files/adaptive_routing_in_infiniband_hardware.pdf)</sup> |

## 工作原理

自适应路由构成一个反馈回路：测量网络状态、传播状态并据此选择路径。信号因场景而异。1979 年 ARPANET 算法每 10 秒测量每条线路上的平均数据包延迟，并广播测量结果，使每个节点在同一个数据库上运行最短路径计算。<sup>[5](http://www.ece.ucf.edu/~yuksem/teaching/ip/reading/ccr-9501-mcquilln.pdf)</sup> 数据中心方案使用显式拥塞通知（ECN），ARCANE 选择它是因为当队列低于最小阈值时不会标记，从而过滤掉轻微排队。<sup>[6](https://arxiv.org/html/2407.21625v4)</sup> HPC 交换机直接读取硬件状态：Slingshot 根据每个输出端口上请求队列的总深度估计拥塞<sup>[3](https://ar5iv.labs.arxiv.org/html/2008.08886)</sup>，高基数 Clos 路由器使用下游路由器的信用作为负载信号。<sup>[9](http://cva.stanford.edu/publications/2006/SC_adaptive.pdf)</sup>

粒度决定重排序代价。在基于流的调整中，每条流保持在一条路径上，只有跨路径的负载分配发生变化；在基于包的调整中，每个数据包选择记录负载最低的 ECMP 链路，这可能导致数据包乱序交付。<sup>[2](https://datatracker.ietf.org/doc/draft-cheng-rtgwg-adaptive-routing-framework/05/)</sup> 流片交换由斯里坎特·坎杜拉（Srikanth Kandula）及其同事于 2007 年在《ACM SIGCOMM Computer Communication Review》上提出，它利用流中突发之间的间隙：间隔超过最大路径间延迟差的突发可以走不同路径而不会乱序。<sup>[10](https://doi.org/10.1145/1232919.1232925)</sup> CONGA 对每个流片的第一个数据包做出决策，选择使本地和远端拥塞度量最大值最小的上行链路。<sup>[7](https://dl.acm.org/doi/10.1145/2740070.2626316)</sup>

## 实现方式

典型部署遵循四个步骤。第一，测量：每个交换机或线卡跟踪队列深度、延迟、ECN 标记或出端口负载。CONGA 的折扣速率估计器维护一个寄存器 \( X \)，每来一个数据包按其字节数增加，并周期性乘以因子 \( \alpha \) 递减，使得对于流量速率 \( R \)，\( X \) 近似为 \( R \cdot \tau \)。<sup>[7](https://dl.acm.org/doi/10.1145/2740070.2626316)</sup> 第二，传播：链路状态协议使用可靠泛洪<sup>[11](https://intronetworks.cs.luc.edu/current1/html/routing.html)</sup>；拥塞通知可以通过带内或带外传输，并且必须比路由信息更频繁地发送<sup>[2](https://datatracker.ietf.org/doc/draft-cheng-rtgwg-adaptive-routing-framework/05/)</sup>；Slingshot 在确认包中在相邻交换机之间携带拥塞数据，大约每个正向数据包四字节。<sup>[3](https://ar5iv.labs.arxiv.org/html/2008.08886)</sup> 第三，计算或选择：负载敏感的最短路径优先算法将测量的延迟作为链路长度，并运行迪杰斯特拉（Dijkstra）式计算<sup>[12](https://ftp.funet.fi/index/rfc/ien/ien189.html)</sup>，而逐包方案在转发时比较候选路径。例如，UGAL 在 \( TQ_{\mathrm{MIN}} \leq TQ_{\mathrm{VLB}} \) 时选择最小路径，否则选择 Valiant 负载均衡路径，其中这两个量分别是候选最小路径和 VLB 路径中最小的路径队列长度。<sup>[13](https://www.osti.gov/servlets/purl/1565855)</sup> 第四，转发并重新评估，可以周期性进行或逐包进行。

## 起源

分布式自适应消息块网络利用对过去流量的自适应学习来路由每个消息块，每个数据包中有一个切换计数器作为路径长度估计器；该方案后来被称为热土豆路由算法，现在最常被称为偏转路由。<sup>[14](https://web.cs.ucla.edu/~lixia/papers/Baran2002.pdf)</sup> 他关于分布式网络的 RAND 简报——其中每个站点只连接到最近邻居——于 1964 年 11 月提交，1965 年 4 月发布。<sup>[15](https://apps.dtic.mil/sti/trecms/pdf/AD0615396.pdf)</sup><sup> • </sup><sup>[14](https://web.cs.ucla.edu/~lixia/papers/Baran2002.pdf)</sup>

ARPANET 1969 年的原始算法在邻居之间交换估计延迟表，容易产生环路和振荡。<sup>[5](http://www.ece.ucf.edu/~yuksem/teaching/ip/reading/ccr-9501-mcquilln.pdf)</sup> 加里·李·富尔茨（Gary Lee Fultz）1972 年在 UCLA 的报告调查了消息交换网络的自适应路由技术<sup>[16](https://dl.acm.org/doi/10.1145/800280.811026)</sup>，约翰·M·麦奎兰（John M. McQuillan）1974 年 5 月在博尔特·贝拉尼克和纽曼公司（Bolt Beranek and Newman）的博士论文深入讨论了路由算法。<sup>[17](https://apps.dtic.mil/sti/html/tr/AD0781467/index.html)</sup> R. 加拉格尔（R. Gallager）于 1977 年在《IRE Transactions on Communications Systems》上发表了一种分布式最小延迟路由算法。<sup>[18](https://doi.org/10.1109/tcom.1977.1093711)</sup> 1979 年 5 月，ARPANET 用直接测量延迟并广播更新的分布式自适应算法取代了原始方案<sup>[5](http://www.ece.ucf.edu/~yuksem/teaching/ip/reading/ccr-9501-mcquilln.pdf)</sup>；坎纳（Khanna）和津基（Zinky）后来于 1989 年在《ACM SIGCOMM Computer Communication Review》上修订了 ARPANET 路由度量。<sup>[19](https://doi.org/10.1145/75247.75252)</sup>

## 变体

**距离向量与链路状态。** 距离向量路由器仅通过周期性更新与直接邻居交换信息；RIP 版本 2 在 RFC 2453 中规定。链路状态路由器传播每条链路的状态，使每个路由器构建完整的网络地图；主要协议是 OSPF（RFC 2328）和 IS-IS。<sup>[11](https://intronetworks.cs.luc.edu/current1/html/routing.html)</sup> 负载敏感 SPF 将测量的延迟作为链路度量并泛洪路由更新，如 ARPANET 的 SPF 算法，这是对迪杰斯特拉（Dijkstra）最短路径算法的修改。<sup>[12](https://ftp.funet.fi/index/rfc/ien/ien189.html)</sup>

**多路径方案。** ECMP 组合多条等代价路由，通常将一条 TCP 连接的所有数据包哈希到一条链路上以避免重排序。<sup>[11](https://intronetworks.cs.luc.edu/current1/html/routing.html)</sup> 数据包喷洒逐包转发；流片交换则改为喷洒数据包序列。<sup>[20](https://htor.inf.ethz.ch/publications/img/besta-TPDS21-routing.pdf)</sup> Valiant 负载均衡通过随机中间交换机发送数据包，UGAL 根据流量状况逐包在最小路径和 VLB 路径之间选择。<sup>[13](https://www.osti.gov/servlets/purl/1565855)</sup> 在并行计算机网络中，克里斯托弗·J·格拉斯（Christopher J. Glass）和倪明选（Lionel M. Ni）（1992）提出的自适应路由转向模型是一种有名称的自适应路由方法。<sup>[21](https://doi.org/10.1145/146628.140384)</sup>

**数据中心与 HPC 方案。** CONGA 由穆罕默德·阿里扎德（Mohammad Alizadeh）及其同事（2014）提出，是一种用于 Clos 架构的分布式拥塞感知负载均衡器，将 TCP 流拆分为流片并使用远端交换机反馈。<sup>[7](https://dl.acm.org/doi/10.1145/2740070.2626316)</sup> MicroTE 由西奥菲勒斯·本森（Theophilus Benson）及其同事（2011）提出，执行细粒度流量工程，但需要全局控制器。<sup>[6](https://arxiv.org/html/2407.21625v4)</sup> 在 HPC 互连中，迈络思（Mellanox）InfiniBand 自适应路由由子网管理器使用 LAG、TREE 和 DFP 算法配置<sup>[8](https://web-backend.simula.no/sites/default/files/publications/files/adaptive_routing_in_infiniband_hardware.pdf)</sup>，Slingshot 为每个数据包估计最多四条最小和非最小路径。<sup>[3](https://ar5iv.labs.arxiv.org/html/2008.08886)</sup>

## 应用

**数据中心架构。** CONGA 在定制 ASIC 中实现，作为新数据中心架构的一部分，能在微秒级对拥塞做出反应，在叶脊拓扑中具有可证明的小无政府代价。<sup>[7](https://dl.acm.org/doi/10.1145/2740070.2626316)</sup> ARCANE 已贡献给[超以太网联盟](https://www.edgepedia.org/zh/ultra-ethernet-consortium)，针对 ECMP 和支持 ECN 的交换机上的 AI/ML 工作负载。<sup>[6](https://arxiv.org/html/2407.21625v4)</sup>

**HPC 互连。** 自适应路由在英伟达（NVIDIA）Switch-IB 2（EDR）、Quantum（HDR）及后续交换机上默认启用，配合 ConnectX-5 或更新适配器，其硬件管理乱序到达。<sup>[4](https://hardwarenation.com/wp-content/uploads/2021/09/infiniband-white-paper-adaptive-routing.pdf)</sup> UGAL 运行在基于克雷（Cray）Aries 的超级计算机上，如[洛斯阿拉莫斯国家实验室](https://www.edgepedia.org/zh/los-alamos-national-laboratory)的 Trinity<sup>[13](https://www.osti.gov/servlets/purl/1565855)</sup>，克雷（Cray）的 Slingshot 为所有三个已宣布的美国百亿亿次系统提供自适应路由和拥塞控制。<sup>[3](https://ar5iv.labs.arxiv.org/html/2008.08886)</sup>

## 局限与替代方案

**振荡。** 最小排队延迟路径算法在没有阻尼机制时表现出剧烈振荡；1969 年 ARPANET 方案容易因路由选择与延迟估计之间的反馈而产生严重振荡，因此为每条链路的估计延迟添加了偏置因子以稳定它。<sup>[22](http://cs-www.cs.yale.edu/homes/yry/readings/general/bertsekas_dyna_spr.pdf)</sup>

**拥塞扩散与受害流。** 交换机本地决策缺乏全局流量视角，因此拥塞可能扩散到原始拥塞区域之外。<sup>[23](https://arxiv.org/html/2502.00616v1)</sup>

**重排序。** 逐包负载均衡通过重排序损害 TCP 流控制，这就是 ECMP 与逐流哈希配对的原因<sup>[20](https://htor.inf.ethz.ch/publications/img/besta-TPDS21-routing.pdf)</sup><sup> • </sup><sup>[11](https://intronetworks.cs.luc.edu/current1/html/routing.html)</sup>；因此包粒度自适应路由需要在出口交换机或接收方设置重排序机制。<sup>[24](https://www.ietf.org/archive/id/draft-xu-idr-fare-06.html)</sup>

**控制平面开销。** 分布式路由重计算可能很慢，导致更新风暴，并且在 BGP 和生成树中，会破坏工作路径以及故障路径。<sup>[25](https://www.cs.princeton.edu/~jrex/papers/ccr10.pdf)</sup>

**替代方案。** [静态路由](https://www.edgepedia.org/zh/static-routing)简单且可预测；在均匀流量下，确定性和自适应策略产生非常相似的流模式，这为网络设计中使用确定性策略提供了依据。<sup>[16](https://dl.acm.org/doi/10.1145/800280.811026)</sup> ECMP 哈希对拥塞不敏感，不原生支持自适应负载均衡。<sup>[20](https://htor.inf.ethz.ch/publications/img/besta-TPDS21-routing.pdf)</sup> 金（Kim）、达利（Dally）和阿布茨（Abts）表明，在高基数折叠 Clos 网络中正确实现的自适应路由优于 oblivious 路由，具有更低的延迟、更低的延迟方差和在有限缓冲下的更高吞吐量。<sup>[9](http://cva.stanford.edu/publications/2006/SC_adaptive.pdf)</sup> 一些研究人员则提出从部署拓扑离线计算路径，并通过多路径负载均衡和端点参与来处理故障。<sup>[25](https://www.cs.princeton.edu/~jrex/papers/ccr10.pdf)</sup> 自适应路由也不能解决最后一跳的入向拥塞，这仍然需要拥塞控制。<sup>[24](https://www.ietf.org/archive/id/draft-xu-idr-fare-06.html)</sup>

## References

1. [Routing Algorithms (network-layer chapter, reproducing Kurose & Ross-style material)](https://azunyan.gitbook.io/internet-protocol/4.-the-network-layer/4.4-routing-algorithms)
2. [Adaptive Routing Framework (draft-cheng-rtgwg-adaptive-routing-framework-05)](https://datatracker.ietf.org/doc/draft-cheng-rtgwg-adaptive-routing-framework/05/)
3. [An In-Depth Analysis of the Slingshot Interconnect](https://ar5iv.labs.arxiv.org/html/2008.08886)
4. [NVIDIA InfiniBand Adaptive Routing Technology Accelerating HPC and AI Applications (WP-10326-001_v01)](https://hardwarenation.com/wp-content/uploads/2021/09/infiniband-white-paper-adaptive-routing.pdf)
5. [An Overview of the New Routing Algorithm for the ARPANET (McQuillan et al.)](http://www.ece.ucf.edu/~yuksem/teaching/ip/reading/ccr-9501-mcquilln.pdf)
6. [ARCANE: Adaptive Routing with Caching and Aware Network Exploration](https://arxiv.org/html/2407.21625v4)
7. [CONGA: Distributed Congestion-Aware Load Balancing for Datacenters (SIGCOMM '14)](https://dl.acm.org/doi/10.1145/2740070.2626316)
8. [Adaptive Routing in InfiniBand Hardware](https://web-backend.simula.no/sites/default/files/publications/files/adaptive_routing_in_infiniband_hardware.pdf)
9. [Adaptive Routing in High-Radix Clos Network (Kim, Dally, Abts, 2006)](http://cva.stanford.edu/publications/2006/SC_adaptive.pdf)
10. [Srikanth Kandula and colleagues (2007). Dynamic load balancing without packet reordering. ACM SIGCOMM Computer Communication Review.](https://doi.org/10.1145/1232919.1232925)
11. [Routing-Update Algorithms, An Introduction to Computer Networks](https://intronetworks.cs.luc.edu/current1/html/routing.html)
12. [IEN 189: Internet Routing Algorithm (proposed)](https://ftp.funet.fi/index/rfc/ien/ien189.html)
13. [Throughput Models for UGAL Adaptive Routing (UGAL-G linear programming models)](https://www.osti.gov/servlets/purl/1565855)
14. [The Beginnings of Packet Switching](https://web.cs.ucla.edu/~lixia/papers/Baran2002.pdf)
15. [A Briefing on the Distributed Adaptive Message-Block Network](https://apps.dtic.mil/sti/trecms/pdf/AD0615396.pdf)
16. [Deterministic and adaptive routing policies in packet-switched computer networks](https://dl.acm.org/doi/10.1145/800280.811026)
17. [Adaptive Routing Algorithms for Distributed Computer Networks (McQuillan doctoral thesis, BBN-2831, May 1974)](https://apps.dtic.mil/sti/html/tr/AD0781467/index.html)
18. [R. Gallager (1977). A Minimum Delay Routing Algorithm Using Distributed Computation. IRE Transactions on Communications Systems.](https://doi.org/10.1109/tcom.1977.1093711)
19. [A. Khanna, J. Zinky (1989). The revised ARPANET routing metric. ACM SIGCOMM Computer Communication Review.](https://doi.org/10.1145/75247.75252)
20. [High-Performance Routing With Multipathing and Path Diversity in Ethernet and HPC Networks](https://htor.inf.ethz.ch/publications/img/besta-TPDS21-routing.pdf)
21. [Christopher J. Glass, Lionel M. Ni (1992). The turn model for adaptive routing. ACM SIGARCH Computer Architecture News.](https://doi.org/10.1145/146628.140384)
22. [Routing Algorithms for Communication (Bertsekas)](http://cs-www.cs.yale.edu/homes/yry/readings/general/bertsekas_dyna_spr.pdf)
23. [Congestion Management in High-Performance Interconnection Networks Using Adaptive Routing Notifications](https://arxiv.org/html/2502.00616v1)
24. [Fully Adaptive Routing Ethernet using BGP (IETF Internet-Draft draft-xu-idr-fare-06)](https://www.ietf.org/archive/id/draft-xu-idr-fare-06.html)
25. [Dynamic Route Recomputation Considered Harmful](https://www.cs.princeton.edu/~jrex/papers/ccr10.pdf)
26. [Rfc7311 (rfc.fr)](http://www.rfc.fr/rfc/en/rfc7311.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 网络与安全 › 网络基础与架构 › 路由与寻址 › 路由理论与算法

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/adaptive-routing

English original: https://www.edgepedia.org/adaptive-routing
