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 ?
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:
This will show an output similar to the following, where the last column is the number of packets dropped:
You can then try a number of different tricks to try and address these (again using Linux as an example):
tx_queue
orrx_queue
columns grow), and then increase the udp buffers using sudosysctl -w 'net/ipv4/udp_mem=xxx yyy zzzz'
, orsysctl -w 'net/core/rmem_default=????'
, orsysctl -w 'net/core/wmem_default=????'
(note, the xxx,yyyy,zzz are defined hereIn an unashamed self promotion, I've created a product called Pontus Vision Thread Manager that continuously tunes this automatically.
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 latter check the lines (hardware, switches, whatever) for being bad.
For an internet connection, you need QOS routers on both ends - which you won't have (unless VoIP is offered by your provider, then he likely has the infrastructure in place). That said, since your down channel is typically a lot bigger than the up channel, a local router prioritizing only the down channel is normally "good enough".
Bad line quality is a hard problem to handle, though.
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).