aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@es.net>2017-05-05 08:59:13 -0700
committerBruce A. Mah <bmah@es.net>2017-05-05 08:59:13 -0700
commit67653543ad750acbd816d7473a56f721bb811383 (patch)
treece4b69fbfbce636ea15eb07d80fbd48b87c11d26 /src
parent103d4318e85783b99d6984c091ea878fc0d844b2 (diff)
downloadiperf3-67653543ad750acbd816d7473a56f721bb811383.tar.gz
Improve / fix comments regarding UDP jitter calculation.
Internal documentation fix only, no functional change.
Diffstat (limited to 'src')
-rw-r--r--src/iperf_udp.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/iperf_udp.c b/src/iperf_udp.c
index b32f574..85ef4d4 100644
--- a/src/iperf_udp.c
+++ b/src/iperf_udp.c
@@ -108,7 +108,17 @@ iperf_udp_recv(struct iperf_stream *sp)
iperf_err(sp->test, "OUT OF ORDER - incoming packet = %zu and received packet = %d AND SP = %d", pcount, sp->packet_count, sp->socket);
}
- /* jitter measurement */
+ /*
+ * jitter measurement
+ *
+ * This computation is based on RFC 1889 (specifically
+ * sections 6.3.1 and A.8).
+ *
+ * Note that synchronized clocks are not required since
+ * the source packet delta times are known. Also this
+ * computation does not require knowing the round-trip
+ * time.
+ */
gettimeofday(&arrival_time, NULL);
transit = timeval_diff(&sent_time, &arrival_time);
@@ -116,8 +126,6 @@ iperf_udp_recv(struct iperf_stream *sp)
if (d < 0)
d = -d;
sp->prev_transit = transit;
- // XXX: This is NOT the way to calculate jitter
- // J = |(R1 - S1) - (R0 - S0)| [/ number of packets, for average]
sp->jitter += (d - sp->jitter) / 16.0;
if (sp->test->debug) {