当前位置:网站首页>20210520 TCP sliding window

20210520 TCP sliding window

2022-07-27 12:19:00 Anethole job

TCP The sliding window

effect :
1. Provide TCP reliability : Confirm the sent data
2. flow control : The window size varies with the link

One 、TCP Window control
TCP Window size in refers to tcp How many data does the protocol transmit at a time . because TCP It is a reliable connection oriented transmission protocol , Since it is reliable, it is necessary to confirm the transmitted data .TCP There are two window mechanisms , One is fixed window size , The other is sliding window . When data is transmitted ,TCP All data will be numbered , The sender always keeps a window during the sending process , Only data frames falling in the transmission window are allowed to be transmitted ; At the same time, the receiver always maintains an acceptance window , Only the data falling in the window will be received . In this way, the flow control can be realized by changing the size of the sending window and the receiving window .

Two 、TCP Window size
TCP The window sliding technology adjusts the data transmission between two hosts by dynamically changing the size of the window . Every TCP/IP The host supports full duplex data transmission , therefore TCP There are two sliding windows , One for receiving data , One for sending data . The receiving device requires a window size of 0 when , Indicates that the receiver has received all the data , Or the receiving application doesn't have time to read the data , Request to suspend sending .
TCP When transmitting data , The first receiver window size is determined by the link bandwidth , But after receiving the data , return ack Confirmation message , At the same time, it also tells the sender its own window size , At this time, when the sender sends data for the second time , It will change the size of its own window to be consistent with that of the receiver .
When the window is too large , It will cause unnecessary data to jam our links , But the window is too small , It will cause great delay , For example 1 when , Every time the sender sends a data , The receiver will return a ack message , The sender does not receive the confirmation message from the receiver ack The next transmission will not be made before .( When the link gets better or worse, this window will change , It's not the first time we've negotiated that it will never change .)【 I don't quite understand this sentence 】

3、 ... and 、 Window slide

原网站

版权声明
本文为[Anethole job]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/200/202207170001458937.html