KCC: An Exploration Along the Lines of BBR

KCC: An Exploration Along the Lines of BBR

0. Algorithm and State Machine

The identity of a congestion control algorithm is defined by its state machine. Tahoe/Reno, CUBIC, and BBR each have their own distinctive state machine. The relationship between KCC and BBR is similar to that between CUBIC and BIC --- retaining the outer framework while replacing/adding core components to form an independent algorithm.

KCC retains BBR's four-state naming (STARTUP/DRAIN/PROBE_BW/PROBE_RTT) but introduces two key changes:

  1. Replaces the sliding-window min_rtt estimator with a Kalman filter;
  2. Adds an ACK aggregation confidence state machine (four states: IDLE → SUSPECTED → CONFIRMED → TRUSTED).

At the same time, DRAIN and PROBE_RTT change from mandatory to on-demand, driven by the inner state machine.

The author holds great respect for BBR's pioneering contributions; KCC is merely a feasibility exploration built upon it.


1. BBR State Machine Recap

#mermaid-svg-xlwiiqgiBtqM5eBg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-xlwiiqgiBtqM5eBg .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-xlwiiqgiBtqM5eBg .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-xlwiiqgiBtqM5eBg .error-icon{fill:#552222;}#mermaid-svg-xlwiiqgiBtqM5eBg .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-xlwiiqgiBtqM5eBg .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-xlwiiqgiBtqM5eBg .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-xlwiiqgiBtqM5eBg .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-xlwiiqgiBtqM5eBg .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-xlwiiqgiBtqM5eBg .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-xlwiiqgiBtqM5eBg .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-xlwiiqgiBtqM5eBg .marker{fill:#333333;stroke:#333333;}#mermaid-svg-xlwiiqgiBtqM5eBg .marker.cross{stroke:#333333;}#mermaid-svg-xlwiiqgiBtqM5eBg svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-xlwiiqgiBtqM5eBg p{margin:0;}#mermaid-svg-xlwiiqgiBtqM5eBg defs #statediagram-barbEnd{fill:#333333;stroke:#333333;}#mermaid-svg-xlwiiqgiBtqM5eBg g.stateGroup text{fill:#9370DB;stroke:none;font-size:10px;}#mermaid-svg-xlwiiqgiBtqM5eBg g.stateGroup text{fill:#333;stroke:none;font-size:10px;}#mermaid-svg-xlwiiqgiBtqM5eBg g.stateGroup .state-title{font-weight:bolder;fill:#131300;}#mermaid-svg-xlwiiqgiBtqM5eBg g.stateGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-xlwiiqgiBtqM5eBg g.stateGroup line{stroke:#333333;stroke-width:1;}#mermaid-svg-xlwiiqgiBtqM5eBg .transition{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-xlwiiqgiBtqM5eBg .stateGroup .composit{fill:white;border-bottom:1px;}#mermaid-svg-xlwiiqgiBtqM5eBg .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px;}#mermaid-svg-xlwiiqgiBtqM5eBg .state-note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-xlwiiqgiBtqM5eBg .state-note text{fill:black;stroke:none;font-size:10px;}#mermaid-svg-xlwiiqgiBtqM5eBg .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-xlwiiqgiBtqM5eBg .edgeLabel .label rect{fill:#ECECFF;opacity:0.5;}#mermaid-svg-xlwiiqgiBtqM5eBg .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-xlwiiqgiBtqM5eBg .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-xlwiiqgiBtqM5eBg .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-xlwiiqgiBtqM5eBg .edgeLabel .label text{fill:#333;}#mermaid-svg-xlwiiqgiBtqM5eBg .label div .edgeLabel{color:#333;}#mermaid-svg-xlwiiqgiBtqM5eBg .stateLabel text{fill:#131300;font-size:10px;font-weight:bold;}#mermaid-svg-xlwiiqgiBtqM5eBg .node circle.state-start{fill:#333333;stroke:#333333;}#mermaid-svg-xlwiiqgiBtqM5eBg .node .fork-join{fill:#333333;stroke:#333333;}#mermaid-svg-xlwiiqgiBtqM5eBg .node circle.state-end{fill:#9370DB;stroke:white;stroke-width:1.5;}#mermaid-svg-xlwiiqgiBtqM5eBg .end-state-inner{fill:white;stroke-width:1.5;}#mermaid-svg-xlwiiqgiBtqM5eBg .node rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-xlwiiqgiBtqM5eBg .node polygon{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-xlwiiqgiBtqM5eBg #statediagram-barbEnd{fill:#333333;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-cluster rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-xlwiiqgiBtqM5eBg .cluster-label,#mermaid-svg-xlwiiqgiBtqM5eBg .nodeLabel{color:#131300;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-cluster rect.outer{rx:5px;ry:5px;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-state .divider{stroke:#9370DB;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-state .title-state{rx:5px;ry:5px;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-cluster.statediagram-cluster .inner{fill:white;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-cluster.statediagram-cluster-alt .inner{fill:#f0f0f0;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-cluster .inner{rx:0;ry:0;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-state rect.basic{rx:5px;ry:5px;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#f0f0f0;}#mermaid-svg-xlwiiqgiBtqM5eBg .note-edge{stroke-dasharray:5;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-note text{fill:black;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram-note .nodeLabel{color:black;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagram .edgeLabel{color:red;}#mermaid-svg-xlwiiqgiBtqM5eBg #dependencyStart,#mermaid-svg-xlwiiqgiBtqM5eBg #dependencyEnd{fill:#333333;stroke:#333333;stroke-width:1;}#mermaid-svg-xlwiiqgiBtqM5eBg .statediagramTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-xlwiiqgiBtqM5eBg :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} full_bw_reached
inflight ≤ BDP
10s without min_rtt update
after 200ms
STARTUP
DRAIN
PROBE_BW
PROBE_RTT

  • DRAIN and PROBE_RTT are mandatory (because the sliding-window min_rtt requires draining to obtain a true value)

2. Two Modifications in KCC

2.1 Kalman Filter Replaces Sliding-Window min_rtt

Modeling : x k = x k − 1 + w k ,    w k ∼ N ( 0 , Q ) x_k = x_{k-1} + w_k,\; w_k\sim N(0,Q) xk=xk−1+wk,wk∼N(0,Q); z k = x k + v k ,    v k ∼ N ( 0 , R ) z_k = x_k + v_k,\; v_k\sim N(0,R) zk=xk+vk,vk∼N(0,R)

x x x: true propagation delay, z z z: observed RTT.

Key internal variables : x_est, p_est (covariance), sample_cnt, jitter_ewma, qdelay_avg, qboost_cdwn, consec_reject_cnt.

Predict-Update:

c 复制代码
// predict-update iteration
p_est = p_est + Q;
K = p_est / (p_est + R_dynamic);
x_est = x_est + K * (rtt_sample - x_est);
p_est = (1 - K) * p_est;

Physical meaning of gain K K K : R d y n a m i c R_{dynamic} Rdynamic increases → K → 0 K\to0 K→0 → ignore polluted RTT samples.

Kalman's own state machine:
#mermaid-svg-faGWbO0htY4upgme{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-faGWbO0htY4upgme .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-faGWbO0htY4upgme .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-faGWbO0htY4upgme .error-icon{fill:#552222;}#mermaid-svg-faGWbO0htY4upgme .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-faGWbO0htY4upgme .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-faGWbO0htY4upgme .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-faGWbO0htY4upgme .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-faGWbO0htY4upgme .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-faGWbO0htY4upgme .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-faGWbO0htY4upgme .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-faGWbO0htY4upgme .marker{fill:#333333;stroke:#333333;}#mermaid-svg-faGWbO0htY4upgme .marker.cross{stroke:#333333;}#mermaid-svg-faGWbO0htY4upgme svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-faGWbO0htY4upgme p{margin:0;}#mermaid-svg-faGWbO0htY4upgme defs #statediagram-barbEnd{fill:#333333;stroke:#333333;}#mermaid-svg-faGWbO0htY4upgme g.stateGroup text{fill:#9370DB;stroke:none;font-size:10px;}#mermaid-svg-faGWbO0htY4upgme g.stateGroup text{fill:#333;stroke:none;font-size:10px;}#mermaid-svg-faGWbO0htY4upgme g.stateGroup .state-title{font-weight:bolder;fill:#131300;}#mermaid-svg-faGWbO0htY4upgme g.stateGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-faGWbO0htY4upgme g.stateGroup line{stroke:#333333;stroke-width:1;}#mermaid-svg-faGWbO0htY4upgme .transition{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-faGWbO0htY4upgme .stateGroup .composit{fill:white;border-bottom:1px;}#mermaid-svg-faGWbO0htY4upgme .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px;}#mermaid-svg-faGWbO0htY4upgme .state-note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-faGWbO0htY4upgme .state-note text{fill:black;stroke:none;font-size:10px;}#mermaid-svg-faGWbO0htY4upgme .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-faGWbO0htY4upgme .edgeLabel .label rect{fill:#ECECFF;opacity:0.5;}#mermaid-svg-faGWbO0htY4upgme .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-faGWbO0htY4upgme .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-faGWbO0htY4upgme .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-faGWbO0htY4upgme .edgeLabel .label text{fill:#333;}#mermaid-svg-faGWbO0htY4upgme .label div .edgeLabel{color:#333;}#mermaid-svg-faGWbO0htY4upgme .stateLabel text{fill:#131300;font-size:10px;font-weight:bold;}#mermaid-svg-faGWbO0htY4upgme .node circle.state-start{fill:#333333;stroke:#333333;}#mermaid-svg-faGWbO0htY4upgme .node .fork-join{fill:#333333;stroke:#333333;}#mermaid-svg-faGWbO0htY4upgme .node circle.state-end{fill:#9370DB;stroke:white;stroke-width:1.5;}#mermaid-svg-faGWbO0htY4upgme .end-state-inner{fill:white;stroke-width:1.5;}#mermaid-svg-faGWbO0htY4upgme .node rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-faGWbO0htY4upgme .node polygon{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-faGWbO0htY4upgme #statediagram-barbEnd{fill:#333333;}#mermaid-svg-faGWbO0htY4upgme .statediagram-cluster rect{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-faGWbO0htY4upgme .cluster-label,#mermaid-svg-faGWbO0htY4upgme .nodeLabel{color:#131300;}#mermaid-svg-faGWbO0htY4upgme .statediagram-cluster rect.outer{rx:5px;ry:5px;}#mermaid-svg-faGWbO0htY4upgme .statediagram-state .divider{stroke:#9370DB;}#mermaid-svg-faGWbO0htY4upgme .statediagram-state .title-state{rx:5px;ry:5px;}#mermaid-svg-faGWbO0htY4upgme .statediagram-cluster.statediagram-cluster .inner{fill:white;}#mermaid-svg-faGWbO0htY4upgme .statediagram-cluster.statediagram-cluster-alt .inner{fill:#f0f0f0;}#mermaid-svg-faGWbO0htY4upgme .statediagram-cluster .inner{rx:0;ry:0;}#mermaid-svg-faGWbO0htY4upgme .statediagram-state rect.basic{rx:5px;ry:5px;}#mermaid-svg-faGWbO0htY4upgme .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#f0f0f0;}#mermaid-svg-faGWbO0htY4upgme .note-edge{stroke-dasharray:5;}#mermaid-svg-faGWbO0htY4upgme .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#mermaid-svg-faGWbO0htY4upgme .statediagram-note rect{fill:#fff5ad;stroke:#aaaa33;stroke-width:1px;rx:0;ry:0;}#mermaid-svg-faGWbO0htY4upgme .statediagram-note text{fill:black;}#mermaid-svg-faGWbO0htY4upgme .statediagram-note .nodeLabel{color:black;}#mermaid-svg-faGWbO0htY4upgme .statediagram .edgeLabel{color:red;}#mermaid-svg-faGWbO0htY4upgme #dependencyStart,#mermaid-svg-faGWbO0htY4upgme #dependencyEnd{fill:#333333;stroke:#333333;stroke-width:1;}#mermaid-svg-faGWbO0htY4upgme .statediagramTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-faGWbO0htY4upgme :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} first RTT
p_est < 500
|rtt_sample - x_est| > 4ms && cdwn==0
reset p_est, cdwn=15
p_est > 250000
trigger PROBE_RTT safety net
ColdStart
CatchUp
Converged
QBoost
Diverged

  • When Converged: notify outer layer that DRAIN can be skipped and PROBE_RTT suppressed.
  • If consecutive abnormal rejections exceed 25, force acceptance to prevent filter lock-up.

2.2 ACK Aggregation Confidence State Machine

BBR unconditionally adds extra_acked. KCC uses four states to assess signal reliability:

c 复制代码
enum kcc_agg_state {
    KCC_AGG_STATE_IDLE,       // total score < 256
    KCC_AGG_STATE_SUSPECTED,  // >= 256
    KCC_AGG_STATE_CONFIRMED,  // >= 512
    KCC_AGG_STATE_TRUSTED,    // >= 768
};

Four scoring factors (each 256 points, total 1024):

  1. Kalman converged (p_est<500 && sample_cnt≥5)
  2. Not in loss recovery
  3. Low queuing delay (RTT ≤ min_rtt + 2ms)
  4. extra_acked stable (≤ 1.5× window maximum)

Behavior:

  • IDLE/SUSPECTED: do not compensate cwnd
  • CONFIRMED/TRUSTED: compensate cwnd, and dynamically amplify Kalman R R R (up to 8×)
  • Compensation lasting more than 8 RTTs → demote to SUSPECTED
  • R R R scaling factor smoothly regresses toward the baseline: each RTT round decays 25% of the excess above the baseline (i.e., retains 75% of the excess). It returns to baseline in about 4 rounds.

2.3 DRAIN and PROBE_RTT Become On-Demand

  • DRAIN : Kalman converged and qdelay_avg < 1ms → skip DRAIN (turns into extra cruise)
  • PROBE_RTT : Kalman healthy (p_est ≤ 250000) → fully suppressed; triggered once only upon divergence as a safety net

3. BBR vs KCC Comparison

Feature BBR KCC
RTT estimator Sliding-window minimum (stateless) Kalman filter (stateful, outputs confidence)
Extra state machine None ACK aggregation confidence four-state
DRAIN mandatory Yes No (conditionally skipped)
PROBE_RTT mandatory Yes (fixed 10s) Suppressed when healthy, on-demand when diverged
Path change detection Depends on PROBE_RTT (~10s) Q-Boost (a few RTTs)
ACK aggregation compensation Unconditionally add to cwnd Confidence-gated + dynamic R scaling
Outlier handling None Dynamic threshold + consecutive rejection protection
R smooth regression None Decay 25% of the excess per round, ~4 rounds to baseline

4. Positioning

The relationship between KCC and BBR is similar to that between CUBIC and BIC: inheriting the outer framework, replacing the core estimator, and forming an independent algorithm. Hence it can be called K‑BBR or BBR‑K.

On the pure model-driven path, KCC continues BBR's philosophy --- directly driving with bandwidth and delay, rather than piling up rules. It differs from Google BBRv2's approach: the latter introduces numerous hard thresholds (ECN, loss rate, etc.), heading toward rule accumulation; KCC insists on using modern control theory (Kalman filter, confidence evaluation) to upgrade estimation tools, keeping the model simple and interpretable.

This is an exploration in an ideal direction and does not claim the naming rights to "BBR-2."


GitHub : TCP KCC

相关推荐
虎头金猫4 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
Seoyoneh4 天前
呼叫中心系统上云还是本地部署?架构、成本与运维全维度技术对比
人工智能·信息与通信·通信
wuyk5554 天前
《WiFi 嵌入式物联网开发全套实战》| 第 16 章 ESP32 AP+STA 双模共存原理与工程坑点
网络·stm32·物联网
QYRdata4 天前
年均增速24.2%!机器人数据湖未来六年增长动能强劲
网络·机器人·服务发现
CHENKONG_CK4 天前
破解制鞋打磨痛点:RFID赋能去毛刺工序自动化升级
网络·单片机·嵌入式硬件·网络协议·tcp/ip
chshang19924 天前
工业路由器是什么?浅谈5G工业网络中的IR602
网络·物联网·5g·智能路由器
萧瑟余晖4 天前
Netty 核心组件与 Reactor 模型详解
网络·架构
ITxiaobing20234 天前
IP 定位服务选型指南:从准确率到工程落地的技术考察
linux·服务器·网络
wuyk5554 天前
【Socket 进阶之路】第 9 章 Linux 网络服务量产稳定性优化|心跳保活、TIME_WAIT、SO_LINGER、内存池、断线重连、完整异常防护框架
linux·服务器·开发语言·网络·物联网
z落落4 天前
C#UDP+串口服务端+UDP 客户端(含 CRC16 校验)
网络·网络协议·udp