[asterisk-dev] RTCP jitter computation

Matthew Jordan mjordan at digium.com
Mon Jul 30 10:14:53 CDT 2012


----- Original Message -----
> From: "Mark Kica" <mark.kica at gmail.com>
> To: asterisk-dev at lists.digium.com
> Sent: Thursday, July 26, 2012 10:09:23 AM
> Subject: [asterisk-dev] RTCP jitter computation
> 
> Dear Sir or Mader ,
> 
> 
> 
> I would like to understand better to Asterisk's RTCP jitter
> computation and improve its RTCP code (etc. rtcp transmission
> interval
> computation)  , so  I found following code in res_rtp_asterisk.c

<snip>

> Why is the value of the jitter multiplied with rate ? Is it valid ?
 
The timestamp for a given RTP packet is given in relation to the rate of the
media contained in that packet (see 5.1 of RFC 3550).  As such, when calculating
jitter, the timespan calculated between a given RTP packet's timestamp and the
first known timestamp for an RTP stream is divided by the rate of the media
related to that stream.  This timestamp, which is now independent of the rate
of that particular media stream, is used to calculate the amount of jitter
detected across all media streams for that RTP session.  This value is what is
stored in rtp->rxjitter (see calc_rxstamp for more information).

Since rtp->rxjitter is no longer using the same units for any particular RTP stream,
when expressing the rxjitter for a particular media stream, the units have to be
restored.  Hence, rtp->rxjitter is multiplied by the rate of the media stream.
For more information, see 6.4 of RFC 3550's definition of interarrival jitter. 
 
> There is also following code :
<snip>
>  Can somebody give me explanation what is dtv , prog a drxcore ?

This is quickly going to go into the realm of "read the code and find out", but
I'll try.

prog: the timespan between the received RTP packet's timestamp and the "seed"
  timestamp received from the RTP stream, divided by the rate of the respective
  media stream.  The "seed" timestamp could be the first timestamp received from
  the RTP stream, or it could be reset based on a marked packet.  This is stored
  in rtp->seedrxts.

drxcore: the wall time for when we set rtp->seedrxts.

dtv: the time calculated from drxcore + prog.  This would be the calculated
  received time, based on our wall time + the delay calculated from their
  initial sending + their current timestamp.  This may or may not reflect the
  actual current time - which is why the jitter is the difference between the
  calculated received time and the current time.

--
Matthew Jordan
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org



More information about the asterisk-dev mailing list