This is more of a general networking question, but I don't think anyone in the Network forum would be able to help with this. I'm implementing some basic TCP functionality over UDP for my grad program, but I'm running into a problem when the following happens:
A) My window size gets large (say 100)
B) My receiver drops about 20 packets for whatever reason (network congestion, over running the receiver, etc)
So when that happens, I expect my program to deal with the situation gracefully... but it does not. The dilemma is this: If I send packets 1-100, and the receiver gets packets 1-80, it will ACK 1-80, causing my sender to also send packets 101-180. Now my sender is going to receive 80/3 = 26 duplicate ACK messages requesting packet 81. So my sender will then send packet 81 26 times to the receiver, causing the receiver to send the receiver to send 25/3 = 8 duplicate ACK messages asking for packet 80. As you hopefully can tell, by packet 85 or so, the receiver actually won't be generating any more duplicate ACKs.
Now my program doesn't stop running - instead, my sender starts having transmission time outs for the sent packets and resends packets 85-100. The problem is, the timeout interval doubles each time, and so it can take a really really long time to retransmit those packets.
There seems to be something really wrong here... does anyone see the flaw or something I'm overlooking?