[SIPForum-discussion] RTP skew and delta

Maciej Wasiel Maciej.Wasiel at dialogic.com
Thu Sep 1 16:08:21 UTC 2011

There are many different algorithms for doing determining skew, depending on whether you are calculating it in real-time or, like wireshark, from a file. Look at Perkins's "RTP: Audio and Video for the Internet" for an excellent explanation of several algorithms. Below is a summary of Perkins's explanation:

The simple approach to Clock Skew detection continually monitors the average network transit delay and compares it with an active delay estimate. Increasing divergence between the active delay estimate and measured average delay denotes the presence of Clock Skew. As each packet arrives, the receiver calculates the instantaneous one-way delay for the nth packet, dn, based on the reception time of the packet and its RTP timestamp:

[cid:image001.png at 01CC689F.CD47DF30]
On receipt of the first packet, the receiver sets the active delay, E = d0, and the estimated average delay, D0 = d0. With each subsequent packet the average delay estimate, Dn, is updated by an exponentially weighted moving average:

[cid:image002.png at 01CC689F.CD47DF30]

The factor 31/32 controls the averaging process, with values closer to unity making the average less sensitive to short-term fluctuation in the transit time. This calculation is similar to the calculation of the estimated jitter; but it retains the sign of the variation, and it uses a time constant chosen to capture the long-term variation and reduce the response to short-term jitter.

The average one-way delay, Dn, is compared with the active delay estimate, E, to estimate the divergence since the last estimate:

[cid:image003.png at 01CC689F.CD47DF30]
If the remote clock and the local clock are synchronized, the divergence will be close to zero, with only minor variations due to network jitter. If the clocks are skewed, the divergence will increase or decrease.


Maciej Wasiel

From: discussion-bounces at sipforum.org [mailto:discussion-bounces at sipforum.org] On Behalf Of VAMBARA, SAMPATH (SAMPATH)** CTR **
Sent: Thursday, September 01, 2011 2:41 AM
To: Raghul Prasanna; discussion at sipforum.org
Subject: Re: [SIPForum-discussion] RTP skew and delta

Hi Raghul,

I am not sure how to put it in words but below is an example to calculate skew.

If the packet rate should be 100packets/sec and 1000 packets have arrived in some 10.04 seconds. I mean the 1000th packet has arrived at 10.04th second then the skew value would be -40msec. and if the 1000th packet arrives in 9.96 seconds then the skew value will be +40msec.
And Delta is the time difference between the current packet and the previous packet in the stream.

From: discussion-bounces at sipforum.org [mailto:discussion-bounces at sipforum.org] On Behalf Of Raghul Prasanna
Sent: Wednesday, August 31, 2011 8:52 PM
To: discussion at sipforum.org
Subject: [SIPForum-discussion] RTP skew and delta

HI All,

Can anyone explain how skew and delta is calculated in a rtp stream please?

wireshark displays them when we do rtp stream analysis, but i cant figure out how this is done.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sipforum.org/pipermail/discussion/attachments/20110901/f3ed1d05/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 1254 bytes
Desc: image001.png
URL: <http://sipforum.org/pipermail/discussion/attachments/20110901/f3ed1d05/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 4518 bytes
Desc: image002.png
URL: <http://sipforum.org/pipermail/discussion/attachments/20110901/f3ed1d05/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1597 bytes
Desc: image003.png
URL: <http://sipforum.org/pipermail/discussion/attachments/20110901/f3ed1d05/attachment-0008.png>

More information about the discussion mailing list