rtpqos - QoS measuring tool for RTP packets

rtpqos [options] remote_host/local_port[/remote_port]


This is a tool to measure QoS parameters, delay, round trip time, diff, jitter and loss, for RTP packets.

The rtpqos will generate packets with a specific byte pattern which sounds like a periodic beep. The byte pattern will be used as a signature for matching packets later. After sending each packet, it stores the signature of the packet in a table, along with sent timing information.

Then rtpqos listens to packets on a given network address. It determines which original packet received belongs to sent packets by using the embedded byte pattern in the payload.

Calculate and updates delay, jitter and loss statistics to a file.

Consequently, following parameters are created and obtained from the tool, in addition to the information contained in the original RTP headers.

  1. From RTP packets:
    1. total round trip delay
      includes processing time at remote.
    2. interval_from_prev_packet
    3. diff
      This is a fraction of deviance from the ideal arrival time.
    4. jitter
      Uses normal 1/16 noise reduction ratio of the diff.
    5. loss
      It is incremented whenever the embedded id jumps.
  2. From RTCP packets:
    1. network round trip time
      This is computed from RTCP_RR_arrival_time - DLSR - LSR.
      Contrary to the "total round trip time", it measures round trip time on the network without including processing time at remote.

The rtpqos has two modes to calculate QoS statistics.

One is "match mode", which compares the arrival time of received packets with its departure time. This allows computing total round trip delay time. This formula is used to measure difference, jitter and loss and becomes more accurate than later mode. This mode will give more parameters of QoS but requires the remote host to send back exact the same packet what rtpqos have sent.

Alternative is "listen mode." The rtpqos will send packets with the according payload type, but does not store the departure data for each packet with id number. When any packets arrive from specified remote host, it will compute interval time from previously arrived packet. The diff and jitter are calculated from the interval time. This way, even the remote host does not loop back senders packet, which is the most case for audio tools; the rtoqos could measure some QoS parameters.

For example, in default, the RAT will send only its source audio and does not have a feature to loop back only received audio without mixing them. By use listen mode, the rtpqos could measure QoS for RAT tools.

It should support any RTP payload type. However only PCMU. PCMA and GSM are tested. The ideal arrival time for the each packet is dynamically distinguished by the payload type and timestamp in the RTP header.

Source codes are available from:

Unix/Unix like system
To build, unpack the tar file, then type:


Microsoft VC++ 6
Open newudpl.dsw under msc\ and just press F7.

Borland C++ builder
Open newudpl_bcb.bpr under bcb\ and just press F9.

I have only tested on SunOS 5.7, 5.8, Linux and Windows2000 but it should compile on other Posix-compliant platforms.

Verbose output.
With a single -v,
The title and the information of statistics, delay, round trip time, diff, jitter and loss, are displayed;
with a second one, receiving packets will also be shown.

Example output for -v,

RTP Quality of Service
Copyright (c) 2002 by Columbia University; all rights reserved

!Terminated by command: bye

Closing network emulation.
Wait while flushing packets in the buffer.

--- Statistics ---
RTP packets:
start time:1021444252.625976
last time:1021444289.117533
total :1794(packets)
diff max :52.6200(%)
avr :1.6163(%)
jitter :0
loss :0(packets)

RTCP packets:
total :7(packets)
rtt max :0.030044(sec)
avr :0.009967(sec)

-m mode of QoS measuring method
The rtpqos has two mode to calculate QoS statisitcs.
0 is match mode: (defualt)
1 is listen mode:

-o log_file_name
Specifies the file name for generating log files. Otherwise, default values, "rtpqos_log", will be used.
Two files will be created on current directory with ".rtp" and ".rtcp" extensions. If the same file exist, they will be over written.

This file contains space sapareted following parameters:

match mode:
[packet_id] [RTT_delay(sec)] [interval_from_prev_packet(sec)] [diff] [jitter] [loss(packets)]

Example logfile:

          0  0.06712  0.02006  0.00330  0  0
          1  0.07178  0.02465  0.23295  1  0
          2  0.06706  0.01528 -0.23600  2  0
          3  0.06716  0.02010  0.00530  1  0
          156  0.26453  0.00761 -0.61905  40  30
          157  0.29944  0.05491  1.74560  48  30
          158  0.28704  0.00759 -0.62025  48  30
          159  0.27466  0.00761 -0.61905  48  30
listen mode:
[packet_id] [interval_from_prev_packet(sec)] [diff] [jitter]

Example logfile:

          0  0.02000  0.00000  0
          1  0.00010 -0.99495  6
          2  0.00250 -0.87485  11
          3  0.02718  0.35915  12
          181  0.02691  0.34565  6
          182  0.02011  0.00565  5
          183  0.01994 -0.00270  4
          184  0.01996 -0.00175  3
This file contains space sapareted following parameters for each one line:

[pckts_sent_from_remote] [rtp_ts] [bytes_sent(bytes)] [ntp_converted_to_timeval] [rtpqos_ssrc] [seq_cycles] [seq] [lsr] [dlsr] [network_rtt] [jitter] [fract_lost] [total_lost]
      20043 1117225831 3368402 1021440038.867156 0x92351E63 0 44995 1856107494 319826 0.02003 1 0.000000 0 
      20271 1117262311 3378662 1021440043.471645 0x92351E63 0 45226 1856513171 216931 0.02006 0 0.000000 0 
      20457 1117292071 3387032 1021440047.241837 0x92351E63 0 45415 1856824484 152703 0.02003 1 0.000000 0 
      20728 1117335431 3399227 1021440052.767608 0x92351E63 0 45690 1857120270 218897 0.00680 0 0.000000 0 
      20996 1117378311 3411287 1021440058.192182 0x92351E63 0 45962 1857519194 175637 0.02000 0 0.000000 0 
-i packetizing_interval
Specifies packetizing interval in millisecond. Default is 20(millisecond).

-p payload type
Specifies payload type of RTP data packets. Please use the number of IANA assignments.
Default is PCMU(0).
GSM ; 3
G722; 9

-l time length
Specifies how long to measure the QoS for target host. Use this option to terminate after specific time period.
Default is infinite.

This option will change rtpqos to none interactive mode. By default, the rtpqos traps the typed stdin for the termination. It is usefull for using the rtpqos as an external audio tool of other session negotiation tools, such as, sipua.

Print out the usage.

Measure against RAT,
Evoke RAT on the remote host, dhaka.clic.cs.columbia.edu:

$ ./rat-4.2.20 cairo/2000
Launch rtpqos on the cairo.clic.cs.columbia.edu:

$./rtpqos -v -m1 -p3 -t60 dhaka/2000
It is measuring GSM RTP packets for 1 minutes.
All the QoS info will be stored in "rtpqos_log.rtp" and "rtpqos_log.rtcp"

Use rtpqos as an external tools for sipua,
First setup the sipconf on sbb.cs.columbia.edu.

$ ./sipconf -X -B -Dsql://root:tiger@grandcentral/sip -m20 -l
Locate both sipua and rtpqos at the same directory,

$ ./sipua -a "rtpqos -n"
SIPUA, (c) 2000, Columbia University
Visit http://www.cs.columbia.edu/~kns10/software/sipua for more info
SIP Endpoint: sipua@cairo.clic.cs.columbia.edu Server, Listening at
Waiting for connections...
Type help to get list of commands
sipua> invite sip:rtpqos@sbb
Self Session Audio Rx128.59.15.49:10000 (0)pcmu/8000;
Calling sip:rtpqos@sbb from sip:at541@cairo.clic.cs.columbia.edu
Call Established
Accepted by remote
Remote Session Audio Rx128.59.19.193:64316 (0)pcmu/8000;
audiotool: rtpqos -n
sipua> bye

Please wait about 10 seconds here to let the rtpqos close all the files.

sipua> exit

All the QoS info will be stored in "rtpqos_log.rtp" and "rtpqos_log.rtcp"

To stop the rtpqos,
  • press ctr-c
  • type any 'q' 'quit' 'stop' 'exit' from the console.


RTP, sipua, SIPstone, and CINEMA sipd
Akira Tsukamoto

This emulator was developed under supervising by,
Kundan Singh
Henning Schulzrinne

I referred many codes from cinema and rtptools.

rtpqos contains RTP library from
Bell Laboratories, Columbia University and University of Massachusetts,
copyright (c) 1998 Lucent Technologies; all rights reserved.

Copyright (C) 2001 by Columbia University; all rights reserved

Permission to use, copy, modify, and distribute this software and its documentation for not-for-profit research and educational purposes and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that the copyright notice and warranty disclaimer appear in supporting documentation, and that the names of the copyright holders or any of their entities not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Use of this software in whole or in parts for commercial advantage and by for-profit organizations requires a license.

The copyright holders disclaim all warranties with regard to this software, including all implied warranties of merchantability and fitness. In no event shall the copyright holders be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortuous action, arising out of or in connection with the use or performance of this software.

Last updated: 2002-05-16 by Akira Tsukamoto