journal-18-4-11
I read through the TCP page on Wikipedia as well as a few of the pages describing the various congestion avoidance algorithms and how they are used.
I also started looking at IP. I found
this April fools RFC about IPv9. The protocol itself seems pretty simple and mainly serves as an addressing mechanism. It was interesting to see that the checksum is removed in IPv6.
Selective Acknowledgement
The typical scheme for selective acknowledgement is as follows:
Modern computers exchange the "TCP SACK Permitted Option: True" option during the initial three-way handshake.
They can then acknowledge out of order packets by specifying a number of SACK blocks, where each SACK block is conveyed by the starting and ending sequence numbers block of data that was received. This system works quite well assuming both parties agreed on it during the initial three-way handshake.
I believe I have a scheme that would allow a TCP implementation to partially mimic this behavior by adjusting the window size when talking to an older machine that didn't support SACK.
To demonstrate I will use an example scenario:
1
Alice:
Sequence number: 0
Acknowledgement number: N/A
SYN
Window Size: 1000
2
Bob:
Sequence number: 0
Acknowledgement number: 0
SYN ACK
Window Size: 1000
3
Alice:
Sequence number: 400
Acknowledgement number: 0
ACK
Window Size: 1000
400 bytes of data
4
Alice:
Sequence number: 800
Acknowledgement number: 0
ACK
Window Size: 1000
400 bytes of data
5
Alice:
Sequence number: 1000
Acknowledgement number: 0
ACK
Window Size: 1000
200 bytes of data
As you can see Alice and Bob have started a TCP conversation and both requested an initial window size of 3. Then Alice sent the first 1000 bytes in three packets. What happens now if Bob doesn't get packet #4 but he does get packet #5?
If Alice and Bob agreed to selective acknowledgement in the initial three way handshake then bob can specify an acknowledgement block from 800 to 1000 with a regular acknowledgement number of 400 like so:
6
Bob:
Sequence number: 0
Acknowledgement number: 400
ACK
Window Size: 1000
Acknowledgement Block from 800 - 1000
However if SACK was not agreed on at the beginning then he Bob can't be sure that Alice will understand that so he must do something else. My idea is that Bob send the following packet:
6
Bob:
Sequence number: 0
Acknowledgement number: 400
ACK
Window Size: 400
And then when he gets the missing 400 bytes send
7
Bob:
Sequence number: 0
Acknowledgement number: 1000
ACK
Window Size: 1000
Since Bob has specified a smaller window size Alice won't send any redundant data and Bob will get everything he needs. He then returns the window size to it's higher value and the conversation can continue. This is of course not ideal because Alice won't be able to send anything past 1000 until she receives packet 7. Clearly Selective Acknowledgement is preferable when its possible but if it weren't, this system would at least avoid unnecessary redundancy which is nice when bandwidth is at a premium.
This is of course a simplified example in which the number of bytes missing could clearly fit into a single packet. Bob can know how many packets were missed because he knows how many bytes per packet to expect so he can simply reduce the window size to the number of packets he missed.