If the sender receive positive acknowledgement,then increase the congestion window according to the following:
w
=
w
+
I
(1)
w=w+I\tag{1}
w=w+I(1)
For the negative feedback,decreasing the congestion window:
w
=
w
−
D
(2)
w=w-D\tag{2}
w=w−D(2)
网络链路中的丢包速率设为
p
p
p,双向传输时延表示为
r
t
t
rtt
rtt,这里认为这是个定值。在一个rtt内,收到的ack的间隔为:
Δ
t
=
r
t
t
w
\Delta t=\frac{rtt}{w}
Δt=wrtt
Δ
t
\Delta t
Δt时间内窗口的变化表示为下式,这个意思是说,发送端可能以概率p收到positive ack,而也有可能收到nack。当然这是理论分析,在TCP里,三次重复的ack会进行快速重传,并将降窗减半。
Δ
w
=
I
(
1
−
p
)
−
D
p
(3)
\Delta w=I(1-p)-Dp\tag{3}
Δw=I(1−p)−Dp(3)
流的发送速率表示为:
x
=
w
r
t
t
(4)
x=\frac{w}{rtt}\tag{4}
x=rttw(4)
接下来推导x的微分方程。
x
˙
=
d
d
t
x
=
1
r
t
t
d
w
d
t
=
1
r
t
t
Δ
w
Δ
t
=
w
r
t
t
2
{
I
(
1
−
p
)
−
D
p
}
=
x
r
t
t
{
I
(
1
−
p
)
−
D
p
}
(5)
\dot x=\frac{\mathrm d}{\mathrm dt}x=\frac{1}{rtt}\frac{\mathrm dw}{\mathrm dt}=\frac{1}{rtt}\frac{\Delta w}{\Delta t}=\frac{w}{rtt^2}\{I(1-p)-Dp\}=\frac{x}{rtt}\{I(1-p)-Dp\}\tag{5}
x˙=dtdx=rtt1dtdw=rtt1ΔtΔw=rtt2w{I(1−p)−Dp}=rttx{I(1−p)−Dp}(5)
对于Reno算法来说,
I
=
1
w
,
D
=
w
2
I=\frac{1}{w},D=\frac{w}{2}
I=w1,D=2w。于是:
x
˙
=
1
−
p
r
t
t
2
−
x
2
p
2
(6)
\dot x=\frac{1-p}{rtt^2}-\frac{x^2p}{2}\tag{6}
x˙=rtt21−p−2x2p(6)
使
x
˙
=
0
\dot x=0
x˙=0,便可以得出TCP在equilibrium point的理论吞吐量:
x
=
1
r
t
t
1
−
p
p
(7)
x=\frac{1}{rtt}\sqrt{\frac{1-p}{p}}\tag{7}
x=rtt1p1−p(7)
速率的分配要保证公平性,下式定义公平系数(fairness index):
F
I
=
(
∑
x
i
)
2
n
∗
∑
(
x
i
2
)
(8)
FI=\frac{(\sum x_i)^2}{n*\sum(x_i^2)}\tag{8}
FI=n∗∑(xi2)(∑xi)2(8)
从这个公式可以看出乘性减少速率,无益于公平性的提升,而加性增长系数
α
\alpha
α才能影响公平性。[2]中有个很有意思的示意图。
[1]An Analysis of AIMD Algorithm with Decreasing Increases
[2]Analysis of the Increase/Decrease Algorithms for Congestion Avoidance in Computer Networks