I'm currently experimenting with implementing unidirectional TCP and I would just like some clarification on the behaviour of the TCP sender/receiver window and receiving buffer.
My understanding of the windowing process is as follows:
The window size represents the maximum number of un-acknowledged bytes which the sender can send at one time.
This size is agreed upon during connection.
The TCP sender should keep track of the ACK with the lower sequence number, and also mark packets as ACKed when an ACK is received. If the lowest sequence number (which it is tracking) 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 a packet arrives out of order. The data is placed into a buffer, and the receiver does not ACK it, rather it continues to ACK the last packet it received prior to the earliest out of order packet. This causes the sender to "fast" re-transmit the next packet after the duplicate ACK number.
Is this a correct understanding for both of these concepts and if not, please clarify.
Thanks!