4

I am transmitting UDP data across 2 Linux (Intel) based routers, and I am experiencing low levels of packet loss which are interfering with the application.

Is there a way (ideally, but not necessarily involving iptables) I can receive each UDP packet and send 2 copies of it, discarding the second one to arrive (if both packets arrive) ? I am aware that this will use double the bandwidth and I'm OK with that.

9
  • That's a lame solution. How do you handle the case when both datagrams get lost? Have you looked into Reliable UDP, RUDP, or Reliable Datagram Protocol, RDP?
    – sawdust
    Commented Nov 27, 2017 at 4:48
  • @sawdust - Thank you for these options, but I don't see how I can deploy them in my usage case. I was trying to avoid disclosing it, but I'm trying to bolt a hack on a VOIP network where I can't modify the clients or server - and am seeing a very low level of packet loss (significantly less then 1%). I am also not in a position to deal with the heavy jitter caused by retransmission of lost packets over the moderately long distance link. Also, the circuit will always be very overspecced capacity wise and is flat rate with 100% CIR, so its OK to waste bits.
    – davidgo
    Commented Nov 27, 2017 at 5:01
  • @sawdust - Also, the connection is used ONLY for VOIP, so no need to handle a mix of large and small packets, or bursty usage.
    – davidgo
    Commented Nov 27, 2017 at 5:05
  • 1
    I suspect that without ARQ, you cannot achieve reliability. But if you replicate datagrams and send as a pair, then you maximize the chance of losing both (by a noise burst of x duration). You might minimize the chance of losing both by separating the duplicate datagrams, i.e. delay sending the replicated datagram by time x. But you might be better off understanding why you're losing the datagrams in the first place. I.E maybe there's something that could be done to reduce the loss rate.
    – sawdust
    Commented Nov 27, 2017 at 5:24
  • 1
    I agree with @sawdust, unless you are pushing a large amount of traffic through the connection you shouldn’t be dropping that many UDP packets. I find even standard internet connections transmit UDP from end to end almost flawlessly at any bandwidth suitable for VoIP. You can use iPerf to do some UDP quality and bandwidth testing. I think the answer it to find out why you are having the packet loss. Is it a router, QoS, noisy line, failing modem, etc. I bet you could even narrow it down to one side of the connection with the problem by testing to a third site. Commented Nov 27, 2017 at 5:32

2 Answers 2

1

I know this is an older thread, but you might want to look into FEC.

Check our the "UDPspeeder" application written by wangyu. You can find it here on git: https://github.com/wangyu-/UDPspeeder

This application doesn't just duplicate the packet, but sends packets with information about being able to reconstruct the packet that is lost if needed.

There are lots of parameters to tune for your needs.

1

If an application transmits UDP packets, it must be prepared that some (or even many) of these packets are dropped.

So either the application must deal with that (e.g. real-time audio or video data, where the missing information is just ignored and causes reduced quality, because you can't resend packages), or it must implement its own protocol to ensure retransmitting, or it must use another protocol that guarantuees eventual delivery.

Implementing an external "just send 2 copies" layer is not the solution. Yes, I know you don't want to hear that, but it's true.

So rewrite the application to use the proper protocol.

Alternatively, tunnel the packets over some other application that implements a proper protocol (tun/tap interface). If you insist on "just duplicate packets" to be a proper protocol (it's not difficult to write such an application, google for tun/tap example programs), try it, and see if it works (it won't).

3
  • this in no way answers the question. I could accept this as a comment, but not a solution. Further, as stated, I have no ability to modify the clients (sip phones) or server - indeed these are standard sip components (controlled by a third party). Would you care to delete your answer and make it a comment?
    – davidgo
    Commented Nov 27, 2017 at 8:15
  • If this is about SIP phones, please include it in the question. Don't add additional information in comments, edit the question. And the answer stays the same: If you experience heavy UDP packet loss, the application must deal with that.
    – dirkt
    Commented Nov 27, 2017 at 8:32
  • It's not about SIP phones. It's about duplicating UDP packets and deduplicating them. As a network administrator I want to improve performance of a link I can excert limited control over.
    – davidgo
    Commented Nov 27, 2017 at 8:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .