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

相关推荐
郝学胜-神的一滴9 小时前
Effective STL 条款09:慎重选择删除元素的方法
开发语言·网络·数据结构·c++·算法·stl
飞花漫卷,情随岁迁14 小时前
网络数据包转发与内核机制:小白概念科普
linux·运维·网络·数据库·mysql·oracle·智能路由器
derek199715 小时前
软考软件设计师:主键、传递依赖和冗余,三问其实是一件事
c语言·c++·计算机网络·软件工程·学习方法
laozhang70016 小时前
自己动手写一个 WebSocket 调试工具:告别广告与限制
网络·websocket·网络协议
LabVIEW开发17 小时前
5850E 质量流量计 + LabVIEW 流量怎么控?
服务器·网络·labview
国科安芯18 小时前
可信的电流:ASP4644S2B电源模块与星载电子供应链网络安全防护体系
网络·安全·web安全·架构·芯片·抗辐射
程序员大阳19 小时前
副队长Vue3教程(24)--Vue父子组件通信方案汇总对比
vue3·组件·汇总·通信·对比·父传子·子传父
炸薯条!20 小时前
计算机网络基础知识(一):IP、域名、端口、网络模型与 HTTP 协议
网络
无奈笑天下20 小时前
银河麒麟高级服务器操作系统【通过 sysctl 调整内核网络参数】操作方法
运维·服务器·网络