快考计网了,正好看到以前 收藏 的一篇文章,关于堵塞控制,我在这里整理一下。
- 作者写的相关代码,有空研究研究
为什么会发生阻塞呢?
可以看到下图,当有多个发端最后汇入一个收端,由于发端都以1GB的速度传输,加起来为2GB,而收端的链路只能传输1GB的数据,从而导致阻塞的发生。
除了 delay / bandwidth / queue,还有一个 BDP(bandwidth-delay product) 的概念,它是 bandwidth 和 delay 的乘积,表示在一定时间内该链路可以容纳的字节(容量)。
A link is fully utilized when the number of bytes flowing through it
is equal to the BDP。
所以当发端发送的数据量大于 BDP,链路中的 queue 就会溢出,于是就会丢弃数据包。