This article explains how to calculate RTT value using RPM probes hardware time stamping in Junos.
The Timestamping activity consists of the source (client) node applying a timestamp (T1) to the RPM packets with the time at which they leave the node. The destination (server) node applies a timestamp (T2) when it receives the probe and a timestamp (T3) when the probe leaves the destination back to the source. The source receives the response and applies a timestamp (T4). Different metrics are calculated based on these timestamps collected from a series of probes.
The initial type of software or classical timestamping was done on the requester Routing Engine by the rmopd process when sending and receiving RPM probes. However, using the general OS affected the accuracy of the measurements, as the variability factor introduced by the general OS doing processing proved to be significantly larger than the amount of time spent by the packet on the wire.
RTT is now (time in wire + server spent time) starting from Junos 14.2R8. In earlier releases, it was “time in wire” only.
Procedure:
Add the following statement in your RPM configuration to see hardware time stamps:
set services rpm probe RPM test Mx104 hardware-timestamp
Enable rpm traceoptions
Example:
set services rpm traceoptions falg all set services rpm traceoptions file RPM size 10m # run show configuration services rpm traceoptions { file RPM size 10m; flag all;
From the logs, check all T1, T2,T3 and T4 times
Calculate RTT as T4-T1 (time in wire + server processing time)
From the traceoptions log file RPM:
Dec 12 04:32:41 rmop_calc_jitter: rdiff: 1035632, sdiff: 1035639, jitter: -7 Dec 12 04:32:44 Owner: TIR-THES, Test: tirmx104-themx104-BRONZE Client Sent(T1) sec: 0x5c108f6c usec: 0xa0832 Client Recd(T4) sec: 0x5c108f6c usec: 0xa0992 Dec 12 04:32:44 Owner: TIR-THES, Test: tirmx104-themx104-BRONZE Server Recd(T2) sec: 0x5c108f72 usec: 0x13497 Server Sent(T3) sec: 0x5c108f72 usec: 0x134cb Dec 12 04:32:44 rmop_calc_jitter: rdiff: 3041017, sdiff: 3041025, jitter: -8
T4-T1 (usec) --------------- 352 usec RTT (time in wire + Server time)
You can cross verify the same RTT value using the below command from CLI:
root# run show services rpm probe-results Owner: TIR-THES, Test: tirmx104-themx104-BRONZE Target address: 62.75.50.9, Source address: 62.75.50.8, Probe type: icmp-ping, Icmp-id: 12, Test size: 6 probes Probe results: Response received Wed Dec 12 04:32:44 2018 Wed Dec 12 04:32:44 2018, Client and server hardware timestamps Rtt: 352 usec, Round trip jitter: -8 usec, Round trip interarrival jitter: 335 usec Results over current test: Probes sent: 2, Probes received: 2, Loss percentage: 0.000000 Measurement: Round trip time Samples: 2, Minimum: 352 usec, Maximum: 360 usec, Average: 356 usec, Peak to peak: 8 usec, Stddev: 4 usec, Sum: 712 usec Measurement: Negative round trip jitter Samples: 2, Minimum: 7 usec, Maximum: 8 usec, Average: 8 usec, Peak to peak: 1 usec, Stddev: 0 usec, Sum: 15 usec Results over last test: Probes sent: 6, Probes received: 6, Loss percentage: 0.000000 Test completed on Wed Dec 12 04:32:40 2018 Measurement: Round trip time Samples: 6, Minimum: 353 usec, Maximum: 386 usec, Average: 368 usec, Peak to peak: 33 usec, Stddev: 11 usec, Sum: 2207 usec Measurement: Positive round trip jitter Samples: 4, Minimum: 1 usec, Maximum: 24 usec, Average: 11 usec, Peak to peak: 23 usec, Stddev: 8 usec, Sum: 42 usec Measurement: Negative round trip jitter Samples: 2, Minimum: 8 usec, Maximum: 28 usec, Average: 18 usec, Peak to peak: 20 usec, Stddev: 10 usec, Sum: 36 usec Results over all tests: Probes sent: 110, Probes received: 110, Loss percentage: 0.000000 Measurement: Round trip time Samples: 110, Minimum: 309 usec, Maximum: 4363 usec, Average: 434 usec, Peak to peak: 4054 usec, Stddev: 417 usec, Sum: 47700 usec