TCP Window and Buffer - check my understanding?

I am currently experimenting with the implementation of unidirectional TCP, and I just would like to explain the behavior of the TCP sender / receiver window and the receive buffer.

My understanding of the windows process is as follows:

The window size represents the maximum number of unwritten bytes that the sender can send at a time.

This size is agreed upon when connecting.

The TCP sender must monitor the ACK with a lower sequence number, and also mark packets as ACKed when receiving the ACK. If the lowest sequence number (which it tracks) matches the first byte in the current window, slide the window to the right.

Now, my understanding of the receiver buffer ...

This is used when the package fails. The data is buffered and the receiver does not execute the ACK; rather, it continues the ACK of the last packet that it received out of order until the very first packet. This causes the sender to "quickly" re-transmit the next packet after the duplicated ACK number.

Is this the correct understanding for both of these concepts, and if not, please clarify.

Thanks!

+4
source share
1 answer

The window size is the maximum number of bytes not confirmed bytes that the sender can send at a time.

No. This is the maximum number of unacknowledged bytes that may be in transit. When the sender reaches this limit, he must stop sending.

This size is agreed upon when connecting.

No. It is dynamically configured in the protocol.

The TCP sender must monitor the ACK with a lower sequence number, and also mark packets as ACKed when receiving the ACK.

The sender must buffer the data sent before it is acknowledged, after which it can be discarded. If it is not confirmed, it can be retransmitted, etc.

If the lowest sequence number (which it tracks) matches the first byte in the current window, slide the window to the right.

Any ACK contains a sequence number. All buffered send data below this sequence number may be discarded.

Now, my understanding of the receiver buffer ...

This is used when the package fails.

No, it is used when any package arrives in order. It stays there until it is read by the application. Out-of-order segments are not necessarily buffered at all.

The data is buffered and the receiver does not perform the ACK, but continues the ACK of the last packet that it received prior to the earliest packet out of order. This causes the sender to "quickly" re-transmit the next packet after the duplicated ACK number.

More or less, but the buffer part is optional.

+16
source

Source: https://habr.com/ru/post/1484506/


All Articles