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

相关推荐
编程之路,妙趣横生5 小时前
IP 协议
计算机网络
記億揺晃着的那天7 小时前
NAS 内网域名访问为什么需要浏览器授权
网络·nginx·js·nas
chunmiao30327 小时前
DeepSeek V4-Pro 正式版上线,API 8月17日起分时调价
网络·安全
迪康Defender9 小时前
AI 重构终端安全运营:智能分析中枢 AI Insight 模块架构与落地场景深度解析
运维·网络·人工智能·其他·安全·重构·架构
0x5310 小时前
Java网络编程(二)
java·服务器·网络
西安景驰电子11 小时前
《PTP精确时间协议系列》第一篇:从原理到应用,全面解读IEEE 1588
linux·运维·服务器·开发语言·网络·windows·php
Bruce_Liuxiaowei12 小时前
基于微步在线威胁情报的公网 IP 攻击迹象监测:threatbook_query 脚本全解析与 BruceSec 平台整合实践
数据库·tcp/ip·安全·网络安全·智能体
ZGi.ai12 小时前
多模型回答不稳定:路由规则与评测方法
网络·人工智能·大模型评测·多模型·模型路由·zgi·模型网关
80s77713 小时前
独享住宅IP、长效代理ip是什么?有哪些作用?
网络·网络协议·tcp/ip
IPdodo_13 小时前
静态 IP、住宅 IP 和固定出口有什么区别?开发场景选型指南
服务器·网络·网络协议·tcp/ip·代理ip