Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I sometimes face voice break when calling through a VOIP application. Since all VOIP applications uses UDP for data transmission, is there any tool in Linux to measure the amount of packet loss and measure the performance of the network.

What could be the general reason for UDP packet loss and what measures I need to take when there is lot of packet loss ?

share|improve this question
    
iperf works good for testing UDP. It reports back loss and jitter. – Zoredache Dec 20 '10 at 21:23
    
I used iperf and it is reporting high data loss and jitter. What steps should I take to fix this problem ? – Supratik Dec 21 '10 at 12:20

What could be the general reason for UDP packet loss

Congestion (too many packets) with lack of QOS (random packets dropped, VOIP not handled with priority) and / or faulty equipment (line quality etc.) For the first, get QOS capable equipment, for the later check the lines (hardware, switches, whatever) for being bad.

Note that you need for an internet conenction QOS routers on both ends - which you wont have (unless voip is offered by your provide, then he likely has the infrastructurei n place). That said, as your down channel typically is a lot bigger than the up channel, a local router prioritizing only the out channel is normally "good enough", as: it already brings hugh improovements.

Bad line quality is a general hard to handle problems, though.

share|improve this answer

If you're suffering UDP packet loss, you're almost certainly suffering TCP packet loss as well. The difference is TCP will re-transmit lost packets and UDP does not. VoIP applications cannot re-transmit because if they did, the information would no longer be any good.

I'm going to assume your VoIP calls are going over the Internet. QoS may be necessary, but it won't do any good, if your Internet connection is not working properly. Use this packet loss test to check it out. It will tell you were packet loss is happening, i.e in the ISP or at your local site.

If it finds trouble at your local site, then it's time to check out your cable or DSL modem for good signal noise ratio, output power and attenuation (DSL).

share|improve this answer

One of the main culprits of UDP loss, especially in LANs is buffer overflows. These can happen in the switch, or in the sending or receiving servers. One mechanism you can use on Linux to verify packet loss is to run the following command:

watch -n 1 -d 'cat /proc/net/udp'

This will show an output similar to the following, where the last column is the number of packets dropped:

Every 1.0s: cat /proc/net/udp                                                                                                                                 Mon Sep 28 15:01:00 2015

  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode ref pointer drops
11362: 00000000:3443 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 18224 2 ffff880808040000 0
19543: 00000000:D438 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 3809742 2 ffff8808060c8400 0
30819: 00000000:0044 00000000:0000 07 00000000:00000000 00:00000000 00000000     0        0 12644 2 ffff88100f2b0400 0

You can then try a number of different tricks to try and address these (again using Linux as an example):

  • ensure that the app consuming the data has enough CPU available,
  • ensure that the threads doing the I/O are as close to the network device as possible
  • ensure that the udp buffer sizes are all large enough to accomodate the data (again, you can watch the watch command's output to see if the tx_queue or rx_queue columns grow), and then increase the udp buffers using sudo sysctl -w 'net/ipv4/udp_mem=xxx yyy zzzz', or sysctl -w 'net/core/rmem_default=????', or sysctl -w 'net/core/wmem_default=????' (note, the xxx,yyyy,zzz are defined here

In an unashamed self promotion, I've created a product called Pontus Vision Thread Manager that continuously tunes this automatically.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.