The calculation of the following metrics is supported by the srt-xtransmit
application:
-
Transmission Delay or Latency
Delay is measured based on the system clock so it's important to check and set up the synchronization of clocks between sender and receiver machines before the experiment. Minimum and maximum values are reset at the start of each measurement period while smoothed value isn't reset and is calculated during the entire experiment. In the case of SRT, this metric (as well as Interarrival Jitter and TS-DF) is calculated at the time the packet is given to the upstream application by the receiver and therefore it includes SRT Latency.
-
Interarrival Jitter (RFC 3550)
Monotonic clock is used for Jitter measurement. This value is smoothed and isn't reset at the start of each measurement period. In the case of SRT, this metric is calculated after the de-jittering has been made by the SRT. The same is true for TS-DF metric.
-
Time-Stamped Delay Factor (TS-DF) (EBU 3337)
Monotonic clock is used for TS-DF measurement. Unlike the jitter algorithm in RFC 3550, this algorithm does not use a smoothing factor and therefore gives a very accurate instantaneous result. As per specification, the recommended measurement period is 1 second, but other values are also possible. See
--metricsfreq
of thesrt-xtransmit receive
for details. -
The total number of received packets
-
The total number of lost packets
In the case of SRT, this metric represents the total number of unrecovered (or dropped) SRT packets.
-
The total number of reordered packets and reordering distance
There is a plot_metrics.py
script for generating graphs from collected statistics. An example of a .csv
file and an output .html
file with graphs generated by the script can be found here.
Note: Both SRT and UDP can be used as a transmission medium.
On the sending side the generate
subcommand with --enable-metrics
command-line flag should be used. The --enable-metrics
flag enables payload generation mode when additional supplemental data is written in the payload of every packet. Using this additional information, the receiver then calculates metrics for each packet.
set ip=127.0.0.1
set port=4200
set latency=120
srt-xtransmit generate "srt://%ip%:%port%?latency=%latency%" --enable-metrics --sendrate 5Mbps --duration 120s
Command line options used:
--enable-metrics
tells the generator to use a certain payload format with supplemental information;--sendrate <value>
defines the packet generation and sending rate;--duration <value>
defines the duration of transmission.
Receiver receives the packet, reads the timestamp and sequential packet number from the payload, compares it to its local system or monotonic clock, and calculates the metrics. This behaviour is turned on by specifying the --enable-metrics
flag, but it is assumed that the payload generator has prepared a certain payload for the receiver.
set ip=
set port=4200
set latency=120
set metricsfile="metrics.csv"
set metricsfreq=1s
srt-xtransmit receive "srt://%ip%:%port%?latency=%latency%" --enable-metrics --metricsfile %metricsfile% --metricsfreq %metricsfreq%
Command line options used:
--enable-metrics
tells the receiver to expect a certain payload format and analyse it;--metricsfile <value>
output CSV file that will contain the collected metrics;--metricsfreq <value>
frequency of retrieving the metrics (every X milliseconds).
When sender and receiver are located on different machines, they have different clocks. Therefore, unless the clocks are well synchronised, the value of latency also includes the difference in clocks, and can be used to monitor changes in the end-to-end latency.
Both sender and the final receiver of the payload can be located on the same machine. Then the exact transmission delay can be measured.
Consider the following example, where both payload generator and payload receiver are located on machine B, while the transmission itself goes from A to B and then back to B. In this case, the A->B->A transmission characteristics could be measured.
A: SRT -> SRT
^ \
/ \
/ v
B: SRT SRT
generate receive