I assume that the reason for this is that the window probe messages contain one octet of data.
Just to be clear, there is no special packet format, or header, or other identifier for a window probe packet. TCP just sends a standard TCP packet when it needs to probe a window. It just happens to limit the user/application data in that TCP packet to one single octet.
- I haven't seen it stated in the standard that probe packets must contain one octet of new data.
You just quoted the statement in the standard that probe packets must contain at least one octet of new data, didn't you? If you want additional statements, you'll find statements in RFC 793 and RFC 1122 reminding you that Acks with no new application data are not reliably transported (with the implication that you must transmit some new data in order to be able to know if it got through).
Are there different ways to probe the window size?
One could imagine that the authors of the TCP standard could have come up with other ways, but the way you quoted is the only way they provided for in the standard.
- If it is the only way, I wonder why resending an old segment (with an old sequence number) will not suffice.
It's not a question of if it would suffice, it's a question of what's the best way. If you have no further data to send, you don't need to probe the window. If you do have further data to send, why not use that to probe the window, rather than wasting bandwidth on previously sent (and presumably Ack'd) data?
Does the receiver have to acknowledge only data that is within the window at a certain moment (meaning old data will not be necessarily acknowledged)
The receiver should only acknowledge the latest data it has received, that is contiguous with all the data received since the beginning (by contiguous, I'm saying if it has a hole because it missed one or more packets, but got a later packet, it can't ack that later packet; it has to keep acking the last sequence number before the first hole).
- Generally speaking, does the receiver notify the sender when its window grows in size?
Yes, generally speaking, the receiver notifies the sender of window size updates with every Ack.
Also, under "Window Management Suggestions" on p. 43 of RFC 793, the authors suggest that TCP receivers "send another acknowledgment with new window information when the window is larger". This RFC predates RFC 2119 that defined the MAY/SHOULD/MUST terminology standards, but this suggestion seems like it would be considered a SHOULD under RFC 2119's requirements levels guidance.
Does it have to do it (I understand the ack may be lost so the sender may have to probe anyway)?
I'm not aware of any RFC updating RFC 793 that would make this behavior into a MUST.
Are probe packets sent only when window = 0 or may they be sent before?
If the window weren't zero, then a single-data-byte TCP segment wouldn't really be considered a probe. For example, if I had a telnet connection that was sending individual keystrokes to the remote host, each keystroke might be sent as a single-data-byte TCP segment. These are fine to send in a case like telnet, even when the window is larger than 0 or 1, but they would not be considered probes.