copa [1] is a congestion control algorithm propsed by MIT, targeting for low latency. It was implemented in mvfst[2], another quic protocol stack released by facebook。I test the peroformance of copa on ns3.
A target rate is defined in Copa to achieve high throughput and low queuing delay. Target rate is defined as
T
a
r
g
e
t
=
1
δ
Q
i
Target=\frac{1}{\delta Q_i}
Target=δQi1.
Q
i
Q_i
Qi is the mean per-packet queuing delay and is calculated as
Q
i
=
R
T
T
s
t
a
n
d
i
n
g
−
R
T
T
m
i
n
Q_i=RTT_{standing}-RTT_{min}
Qi=RTTstanding−RTTmin.
In congestion avoidance phase, on each ACK, if delivery rate is smaller than target rate, cwnd is increased by
v
δ
×
c
w
n
d
\frac{v}{\delta \times cwnd}
δ×cwndv. Otherwise, cwnd is decreased by
v
δ
×
c
w
n
d
\frac{v}{\delta \times cwnd}
δ×cwndv.
v
v
v controls the increase/decrease speed of cwnd and its value is changed based on the direction of congestion window trend to make Copa flows converge fast to the maximum available bandwidth.
The mechanism of Copa is quite similar to Vegas[6].
x
=
c
w
n
d
r
t
t
x=\frac{cwnd}{rtt}
x=rttcwnd,
q
=
r
t
t
−
r
t
t
m
i
n
q=rtt-rtt_{min}
q=rtt−rttmin.
In Vegas,
d
i
f
f
diff
diff is defined to guide the adjustment of congestion window.
d
i
f
f
=
(
c
w
n
d
r
t
t
m
i
n
−
c
w
n
d
r
t
t
)
r
t
t
m
i
n
=
c
w
n
d
r
t
t
(
r
t
t
−
r
t
t
m
i
n
r
t
t
m
i
n
)
r
t
t
m
i
n
=
x
q
diff=(\frac{cwnd}{rtt_{min}}-\frac{cwnd}{rtt})rtt_{min}=\frac{cwnd}{rtt}(\frac{rtt-rtt_{min}}{rtt_{min}})rtt_{min}=xq
diff=(rttmincwnd−rttcwnd)rttmin=rttcwnd(rttminrtt−rttmin)rttmin=xq
A point point channel is built. The bandwidth is 3Mbps and one way propagation delay is 100 ms, the maximum queue delay is 300ms. Three flows are tested.
When all three flows take copa as congestion control. The rate dynamic of each flow is given blow. The fairness is guaranteed.
The one way delay of each received packet. And the lantency is also quite low.
When the second flow takes BBR for rate control. From the below figure, BBR takes most bandwidth and the other two copa flow only maintain mimimum rate.
The one way transmission delay of each flow:
When the second flow takes Cubic for rate control. The rate dymamic of each flow:
The one way transmission delay of each flow:
it seems the bandwidth competence of copa is not quite well when sharing link with BBR and Cubic.
And Copa is less suffered from rtt unfairness issue.
Two copa flows run on a dumbbell topology. Here, rate denoted gootput calculated by receiver at 1s interval.
Two BBR flows run under the same test.
From my congestion control peformance evaluation paper [8], When six flows all take copa for congestion control, each receiver outputs the rate every 1 seconds and the final results are given below. Copa flows can achieve well bandwidth allocation fairness.
Copa takes the AIAD rule to adjust its cwnd with the goal to converge to target rate. When thera are n flows in a network system and each flow try to backlog 1 packet into the network pipe, n packets will be buffered in the bottleneck buffer and the
r
t
t
s
t
a
n
d
i
n
g
=
n
C
+
r
t
t
m
i
n
rtt_{standing}=\frac{n}{C}+rtt_{min}
rttstanding=Cn+rttmin . If we set
δ
\delta
δ is 1, and the target rate of each flow is
C
n
\frac{C}{n}
nC. That is the reason why copa can achieve such well bandwidth allocation fairness.
Transmission delay and throughput of different protocols (the points on the top left are better):
From experimental results, Copa is really a perfect protocol in term of bandwith fairness [5] and gets close the optimal control point (low transmission delay and high throughput). The only drawback is that Copa flow gets starved by Reno and BBR flows in simulated platform. But in real Internet, it is impossible to make a backbone link congested by a single flow. And most of traffic is from web application, in which the session may stop before the congestion control algorithm enters congestion avoidance phase. And the channel utilization of backbone link is below 80% most of time [6]. Copa may stll gain enough bandwidth in Real Internet. So the delay of Copa flow in real Internet tests from facebook [3] is lower than BBR. Copa should be widely deployed to make a better Internet, especially for bulk data transmisson. A low latency network is beneficial for real time traffic.
[1] Copa: Practical Delay-Based Congestion Control for the Internet
[2] mvfst
[3] Facebook:对比COPA 与CUBIC,BBR v1在拥塞控制及视频质量的表现
[4] CS 244 Project Report: Reproducing Copa
[5]tcp拥塞控制vegas的数学分析
[6] 拥塞控制的评价标准
[7] Rethinking End-to-End Congestion Control in Software-Defined Networks
[8] An evaluation of bottleneck bandwidth and round trip time and its variants