Reliable UDP and ACK Method Question

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 
+6
udp network-protocols
source share
1 answer

# 2 also known as Negative ACK, aka NAK, this is an optimistic view of transport. This means that the balance is better when the transport is working properly.

# 1 is a pessimistic point of view and suggests that transportation often fails.

TCP uses ACK because there is a fundamental reliance on congestion control to drop packets to perform traffic shaping to create a fair network. Reliable UDP channels typically use NAKs because you are using a reliable high-speed or low-speed stream with a low latency requirement at the blocking stage, typical of the basic ACK implementation.

Note that if you step up and look at managing your subscription over a reliable UDP channel, there is no clear winner in using ACK or NAK. The global data market has proven that both technologies use high speed in high-bandwidth networks. ACKs have the advantage with subscriptions that you do not need complex re-synchronization after a network failure, but you will see a consistent peak in network and CPU usage when each node issues a re-subscription.

+5
source share

All Articles