I am reading about implementations of reliable UDP (ie. sending ACK packets and resending non-ACKed packets again).
Of the two main patterns I seem to find arround the net:
Client sends an ACK for each received packet with the sequence of that packet. Server assumes packet is undelivered unless it receives an ACK.
Client sends an ACK packet with the sequences of the packets it thinks are missing. Server assumes packet is delivered unless it receives an ACK from the client saying it's missing a sequence, then it resends the requested (missing) packets again.
In short, in 1. the clients sends the sequence of the received packets, while in 2. client sends the sequence of the missing packets.
Just wondering what are the pros/cons of each method, and which one is more mainstream (I assume 1, but 2 seems like a very clever method since assumably most packets do arrive and only a few are usually lost).
EDIT: A short example on both methods:
Method 1: Server sends: 1,2,3,4,5
Client received: 1,3,5,4
Client sends back: ACK 1, ACK 3, ACK 5, ACK 4
Server resends: 2.. maybe more if ACK packets were lost
Method 2:
Server sends 1,2,3,4,5,6,7,8
Client receives: 1,3,2,5,7
Client Sends :ACK (lowest continuous 3,highest received 7, seem to be missing 4,6)
Server resends: 4,6,8