[Computer network] - sliding window

Sliding window

concept

Sliding window is a buffer when transferring data between two hosts. Each TCP / IP host support two sliding windows,

A means for receiving data and one for transmitting data. Window size represents the data amount of the computer may be buffered.

working principle

1. The sliding window during operation

TCP protocol transport stream controlled by means of a sliding window. In the transport layer, according to certain data

Format labeled the same size package. The size of each sliding window contains a certain number of data packets, the sliding window may be

To adjust. Each host on the network maintains a send window and a receive window. The sender may send a number of packets corresponding to the size of the sliding window, and adds header information before each data packet, then waits for the receiver returns confirmation information. Because TCP is a connection-oriented protocol, you can guarantee the integrity and accuracy of data transmission, when a packet loss occurs during transmission, the receiver will ask the sender retransmit data from the breakpoint.

When the TCP receive data from the application layer, TCP header with a sequence number added to the packet and

IP, the IP sends it to the target host.

When each packet transmission, the source host set the retransmission timer, the description will wait before resending a packet

ACK time. In general, after the first attempt fails, a retransmission retry timer time is set to a front

Twice times. Backup each data packet in the transmission window until it receives an ACK.

When the packet reaches the destination host receives the window, they are placed in accordance with the sequence number. When the destination host receives a number of continuous

According segment when it transmits data about a recognition (ACK) response message to the source host, which with the current window size. Once the source host receives a packet and recognition, will be sliding transmission window. If the retransmission timer is set

Between the source host is not received approval of the existing data, the data will be retransmitted. The retransmitted data packet network and the burden of the source host.

Published 43 original articles · won praise 4 · Views 1188

Guess you like

Origin blog.csdn.net/weixin_42176221/article/details/105391521