I am reading about implementing reliable UDP (i.e. sending ACK packets and resending non-ACKed packets).
Of the two main patterns, I seem to be around the web:
The client sends an ACK for each packet received with the sequence of this packet. The server assumes that the packet is not delivered if it does not receive the ACK.
The client sends an ACK packet with sequences of packets that it believes are missing. The server assumes that the packet is delivered if it does not receive the ACK from the client, stating that it lacks the sequence, and then resends the requested (missing) packets.
In short, in 1. clients send a sequence of received packets, and in 2. a client sends a sequence of missing packets.
Itβs just interesting what are the pros and cons of each method and which one is more general (I assume 1, but 2 seems to be a very smart method, since most packages are supposedly really coming, and only some of them are usually lost).
EDIT: A brief example for 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
udp network-protocols
Radu094
source share