RTP Packet Loss Diagnostics / Bad Audio


for about 2-3% of our calls our users suffer bad audio quality (intermittent dropouts, sometimes more, sometimes less) caused by RTP Packet Loss. Sometimes it’s just a few seconds in the middle of the call.
I can identify this from SIP Debug log in /var/log/asterisk/full, where I have this:

<— SIP read from UDP:10.0.x.x:5060 —>
BYE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK-sfdsfd3;rport
From: “XXX” sip:[email protected];tag=01md46w8ka
To: sip:[email protected];user=phone;tag=sdfdsf
Call-ID: sdfsdf-tlb3xf8javp6
CSeq: 3 BYE
Max-Forwards: 70
Contact: sip:[email protected]:5060;reg-id=1
User-Agent: snom320/
RTP-RxStat: Total_Rx_Pkts=929,Rx_Pkts=0,Rx_Pkts_Lost=0,Remote_Rx_Pkts_Lost=480
RTP-TxStat: Total_Tx_Pkts=925,Tx_Pkts=925,Remote_Tx_Pkts=751

So the phone reports 480 out of 929 packets lost in its statistics.
It happens not very often and not reproducible. It’s not limited to external calls and can happen for every call, so it’s not an internet upstream bandwidth problem.

But at IP Level it looks very fine:

[[email protected] tmp]# ifconfig eth0
eth0 Link encap:Ethernet Hardware Adresse 0C:C4:xx:Xx:xx:xx
inet Adresse:10.0.x.x Bcast: Maske:
inet6 Adresse: xxxxxxx/64 Gültigkeitsbereich:Verbindung
RX packets:152303193 errors:0 dropped:0 overruns:0 frame:0
TX packets:159289385 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX bytes:21482872013 (20.0 GiB) TX bytes:54754222429 (50.9 GiB)

This is the only application where we suffer this kind of packet loss in the network. So what really causes this packet loss for SIP Audio and therefore bad audio quality sometimes.

Your IP stats are just for the local network, not your provider’s network.

There are LOTS of things that can cause intermittent problems like this, and lots of them are outside your control.

One of the things that I do is reduce the number of UPD ports that are open and then set the firewall to pass those directly to the server. It reduced the number of random UDP port collisions, but YMMV.

Another important note is when you see “Remote_Rx_Pkts_Lost=480” is that you are losing a lot of packets from the remote end of the connection. While the problem could be something in your config, I’d start looking at things like network bandwidth and other applications stealing cycles on your router (downloads take time and bandwidth).