TCP吞吐量的理论计算公式

  本篇文章本来是收录AIMD拥塞控制吞吐量的计算公式。Valve游戏公司开源GameNetworkingSockets[1],既支持可靠的数据传输,也支持不可靠的数据传输。数据的传输速率,是直接计算出来的。

const int64 k_nMillion = 1000000;
int TFRCCalcX( int s, int64 rtt, float p )
{
	// TFRC throughput equation
	// 
	//                                s
	//   X_Bps = ----------------------------------------------------------
	//           R*sqrt(2*b*p/3) + (t_RTO * (3*sqrt(3*b*p/8)*p*(1+32*p^2)))
	//
	// b is TCP acknowlege packet rate, assumed to be 1 for this implementation

	float R = (double)rtt / k_nMillion;
	float t_RTO = MAX( 4 * R, 1.0f );

	return static_cast< int >( static_cast<float>( s ) /
		( R * sqrt( 2 * p / 3 ) + ( t_RTO * ( 3 * sqrt( 3 * p / 8 ) * p * ( 1 + 32 * ( p * p ) ) ) ) ) );
}

 这个公式速率控制公式就是基于一篇大名鼎鼎的论文[2]。[3]的论文论文早一年, 对Jocobson提出拥塞控制算法进行数学建模,称之为TCP的宏观模型。但是直接基于一个公式计算出数据的发送速率,是不靠谱的。一条数据流不向网络中注入多余的数据,是不可能探测更多的可用带宽的。而要探测带宽,必然导致网络拥塞。另外一个不靠谱的领域就是带宽测量。通过一次测量的带宽值,就能当做一个会话持续过程的传输速率吗?还好,这个领域过气很多年了。
 互联网的互联靠的数据传输,数据传输依赖TCP,TCP需要拥塞控制。因为1986的网络拥塞崩溃,Jocobson提议基于AIMD机制TCP作为拥塞控制算法[4]。 TCP的拥塞控制将互联网从拥塞奔溃中拯救了出来。这里用了提议,没有用提出。Jain [5] 在1988年就讨论了几种可能的拥塞控制算法: AIAD,AIMD, MIMD, MIAD。最终的建议是AIMD,因为这个算法能够保证带宽资源的公平性。但是,在拥塞控制领域,好像大家更认可Jocobson的工作。Jain只能在自己的维基百科上写道:He is also the co-inventor of the Additive Increase Multiplicative Decrease (AIMD) principle used for traffic management in computer networks。
 学术其实是一件功利的事情。谁不想做出一件事情,能够让后世铭记呢。棺材一抬,人生白来。死亡的恐惧太过强大。普通人只能靠宗教,上天堂。牛逼的人,靠贡献,进入各种历史记录中。牛逼的人知道,天堂太虚幻。Benjamin Franklin: “If you would not be forgotten, as soon as you are dead and rotten, either write things worth reading, or do things worth writing.” 中文版:太上有立德,其次有立功,其次有立言,虽久不废,此之谓不朽。AIMD的算法机制很简单,但是总结计算机网络的发展历史,Jocobson这个名字是绕不开的。He is one of the primary contributors to the TCP/IP protocol stack—the technological foundation of today’s Internet.
 TCP的宏观模型其实就是总结Reno算法吞吐量的理论公式: T = M S S ∗ C r t t ∗ p T=\frac{MSS*C}{rtt*\sqrt{p}} T=rttp MSSC. The TCP Macroscopic Model estimates that Reno TCP performance is proportional to one over the square root of the loss probability.
 在2020的sigcomm会议,Mathis要宣布TCP Macroscopic Model过时了。

The TCP Macroscopic Model will be completely obsolete soon. It was a closed form performance model for Van Jacobson’s landmark congestion control algorithms presented at Sigcomm’88. Jacobson88 requires relatively large buffers to function as intended, while Moore’s law is making them uneconomical.

 它的过时,是因为BBR的出现。BBR算法开启拥塞控制的新时代。

Reference:
[1]GameNetworkingSockets
[2]Padhye J, Firoiu V, Towsley D, et al. Modeling TCP throughput: A simple model and its empirical validation[J]. ACM SIGCOMM Computer Communication Review, 1998, 28(4): 303-314
[3] Mathis M, Semke J, Mahdavi J, et al. The macroscopic behavior of the TCP congestion avoidance algorithm[J]. ACM SIGCOMM Computer Communication Review, 1997, 27(3): 67-82.
[4] Jacobson V. Congestion avoidance and control[J]. ACM SIGCOMM computer communication review, 1988, 18(4): 314-329.
[5] Congestion avoidance in computer networks with a connectionless network layer: concepts, goals and methodology
[6] Mathis M, Mahdavi J. Deprecating the TCP macroscopic model[J]. ACM SIGCOMM Computer Communication Review, 2019, 49(5): 63-68.

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值