0

If UDP packets are dropped on a host because its socket buffers are full, should I consider that to be network loss? The distinction would help me decide whether to look into implementing retransmission at the application layer, or to increase the buffer size.

I'm stuck with UDP but my application is required to transmit packets in order with no packet loss... >_<

sourcenouveau
  • 29,356
  • 35
  • 146
  • 243

2 Answers2

0

If packets are dropped in the network stack, then you could consider it in the same way that you consider network packet loss.

UDP is not reliable. You might not receive all packets, and they might be received in a different order. You'll need a mechanism in your application to cope with this anyway.

qbert220
  • 11,220
  • 4
  • 31
  • 31
  • Thanks--if I'm going to need to add out-of-order handling for the packets I might as well add packet loss handling as well. – sourcenouveau May 23 '11 at 15:29
  • The 2 can have quite different requirements and implementations. Out of order can be handled using a simple continuity counter in packets. Coping with packet loss often uses a re-transmit protocol to allow the receiver to ask the sender to send a packet again if it is not received when expected. An alternative strategy would be to use forward error correction. – qbert220 May 23 '11 at 15:50
0

UDP is unreliable so if you need reliability you MUST implement it yourself; it doesn't matter where the datagrams are dropped, some will be dropped and the end result is the same.

Likewise you will get duplicate datagrams and you will get datagrams in a different sequence to when you sent them.

You might be interested in the answers to this question: What do you use when you need reliable UDP?

Community
  • 1
  • 1
Len Holgate
  • 21,282
  • 4
  • 45
  • 92