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!
source share