O'Reilly logo

VoIP Hacks by Theodore Wallingford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #75. Graph Latency and Jitter

Use sip_ping.pl to record latency and jitter data in a nice, pretty graph.

It's time to step beyond the basic ping and traceroute, and to graph packet flow using Perl. In "Monitor VoIP Devices" [Hack #72] , you saw how to determine the availability of a SIP host using Perl and the SIP OPTIONS packet. The next logical step is to time how long it takes to receive a response to monitor the latency on the link between you and the device you're monitoring. This hack uses the script from "Monitor VoIP Devices" [Hack #72] , but this time you use the –t option to time the round trip:

	# ./sip_ping.pl –t 192.168.0.123
	50.77

This shows me that it took almost 51 milliseconds for my Snom handset to respond to a SIP request. This isn't a terribly useful test, however, considering I'm timing this response from my desktop computer hooked up to phone's built-in switch. Latency (and its cousin, jitter) starts to be an issue when your VoIP traffic passes out of your local area network (LAN) and traverses the wide Internet. For every router that your VoIP traffic passes through, there is a chance for your VoIP packets to be delayed or, worse, dropped. You can use the traceroute (tracert on Windows) application to see how many hops it takes to get from your computer to a remote VoIP provider. Here is an example from my PC to a SIP-based Internet telephony provider:

	# traceroute sip.example.com traceroute to sip.example.com (172.16.15.15), 30 hops max, 38 byte packets ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required