4

Under normal circumstances, what should I expect the worse case scenario to be for out of order UDP packets?

I'm currently tagging each packet with two bytes (a 0 to 65535 number) to keep track of the order. Is this enough or too much?

jnm2
  • 7,960
  • 5
  • 61
  • 99

2 Answers2

2

According to the RFC 3208 you can target the last two packets being out of order.

Worst case would by definition be unlimited and such you are better off treating a third out of sequence packet as data loss.

In all cases, receivers SHOULD temper the initiation of NAK generation to account for simple mis-ordering introduced by the network. A possible mechanism to achieve this is to assume loss only after the reception of N packets with sequence numbers higher than those of the (assumed) lost packets. A possible value for N is 2. This method SHOULD be complemented with a timeout based mechanism that handles the loss of the last packet before a pause in the transmission of the data stream.

https://www.rfc-editor.org/rfc/rfc3208

Community
  • 1
  • 1
Steve-o
  • 12,678
  • 2
  • 41
  • 60
1

It should be plenty, I have never seen more then 3-4 out of order UDP packets, you could get away with a single byte to track it.

Geoffrey
  • 10,843
  • 3
  • 33
  • 46