"The server receives C, then A, and B never arrives" is possible. UDP has no ordering, no retransmission and no acknowledgements. So datagrams (single UDP messages) can arrive:
• in a different order
• more than once
• not at all
The sender is not told about any of this.
"The server receives the first half of B in one read and the rest in the next" is wrong. UDP keeps message boundaries: one receive call delivers each datagram whole, or the datagram never arrives. TCP is different: its reads can split or merge writes.
"The server receives A and C, and the kernel automatically retransmits B" is wrong, because UDP never retransmits. "The sender gets an error for B, because UDP acknowledges every datagram" is wrong, because UDP sends no acknowledgements.
Backend question · OS, networking & Linux › TCP vs UDP
A client sends three UDP datagrams, A, B and C, to a server. Which outcome is possible?
The server receives C, then A, and B never arrives
Read more