TWAMP

Overview

TWAMP is a way to test two-way packet delay between two given machines. It is specified in RFC 5357. TWAMP computes:

  • send, reflect and round-trip times

  • Packet loss

  • Jitters (median and average delay change between packets)

The TWAMP client and server system clocks must be synchronized.

See also

The NTP client configuration for details.

TWAMP client

The TWAMP client starts a test session with a given server.

It is possible to configure more than one client. If a client configuration changes, the test is restarted and statistics from the previous session are lost.

The client will send packets indefinitely until the session is enabled. It will use TWAMP open mode, which does not require any form of authentication with the server.

Here is an example that initiates a test session with a server at 10.200.0.1. The client selects a port between 10000 and 12000 (included) (sender-udp-port-range), this port will be used during the test by the server to send reflected packets to the client. Once the test is started, the client sends a test packet every 1000ms (packet-interval) to 10.200.0.1:1500 (server:reflector-udp-port). If the reflected packet is not received during this timer-lapse the packet is regarded as lost. Statistics are computed with the last 10 packets (packet-count).

vsr running config# vrf main twamp client foo
vsr running client foo#! server 10.200.0.1
vsr running client foo#! sender-udp-port-range 10000-12000
vsr running client foo# reflector-udp-port 1500
vsr running client foo# packet-count 10
vsr running client foo# packet-interval 1000
vsr running client foo# commit

The same configuration can be made using this NETCONF XML configuration:

vsr running config# show config xml absolute vrf main twamp client foo
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <twamp xmlns="urn:6wind:vrouter/twamp">
      <client xmlns="urn:6wind:vrouter/twamp-client">
        <name>foo</name>
        <enabled>true</enabled>
        <server>10.200.0.1</server>
        <sender-udp-port-range>10000-12000</sender-udp-port-range>
        <reflector-udp-port>1500</reflector-udp-port>
        <packet-count>10</packet-count>
        <packet-interval>1000</packet-interval>
      </client>
    </twamp>
  </vrf>
</config>

To display the client state:

vsr running config# show state twamp client foo
client foo
 enabled true
 server 10.200.0.1
 sender-udp-port-range 10000-12000
 reflector-udp-port 1500
 packet-count 10
 packet-interval 1000
 test-session
     starts 2022-11-22T16:53:36.491764+01:00
     clock-sync true
     send-hops-average 0
     reflect-hops-average 0
     packets-lost-average 0
     round-trip-delay
         minimum 720
         median 941
         average 985
         maximum 1413
         ..
     send-delay
         minimum 191
         median 425
         average 471
         maximum 899
         ..
     reflect-delay
         minimum 454
         median 515
         average 513
         maximum 575
         ..
     round-trip-jitter
         median 210
         average 226
         ..
     send-jitter
         median 202
         average 238
         ..
     reflect-jitter
         median 25
         average 30
         ..
     ..
 ..

See also

The command reference for details.

TWAMP ping

It is also possible to run a session that sends a finished number of packets with the cmd twamp ping RPC.

In this example, a test session is starts with the server at 10.200.0.1. The server will send reflected packets to the port 14000. 10 packets are sent every 1000ms by the client. Then the client closes the test session with the server and exits.

vsr> cmd twamp ping server 10.200.0.1 sender-udp-port-range 14000 packet-count 10 packet-interval 1000
Connecting to Server 10.200.0.1...
Received ServerGreeting message with mode 1
Sending SetUpResponse with mode 1
Received ServerStart at Client 10.200.0.1
Sending RequestTWSession for Receiver port 862...
Received Accept-Session for Receiver port 862...
SID: 0x7F000001.E72771C0.38DBBE01.FE6C793A
#Session        0, Sender       10.125.0.1:14000, Receiver       10.200.0.1:862, Mode: 1
Nb of Packets   10, Packet length       160, DSCP       0, TOS  0
Sending Start-Sessions for all active Sender ports...
        Time    , Snd#  , Rcv#  , SndPt , RcvPt ,  Sync , FW TTL, SW TTL, SndTOS, FW_TOS, SW_TOS, NwRTD , IntD  , FWD   , SWD  [ms]
1669282124376   ,   0   ,   0   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 1.424 , 0.001 , 1.080 , 0.344
1669282125376   ,   1   ,   1   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 0.862 , 0.002 , 0.623 , 0.239
1669282126376   ,   2   ,   2   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 1.087 , 0.002 , 0.752 , 0.335
1669282127376   ,   3   ,   3   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 0.830 , 0.001 , 0.518 , 0.312
1669282128376   ,   4   ,   4   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 1.260 , 0.001 , 0.903 , 0.357
1669282129376   ,   5   ,   5   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 2.088 , 0.002 , 1.906 , 0.182
1669282130376   ,   6   ,   6   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 0.987 , 0.001 , 0.495 , 0.492
1669282131376   ,   7   ,   7   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 1.088 , 0.001 , 0.806 , 0.282
1669282132376   ,   8   ,   8   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 0.832 , 0.001 , 0.453 , 0.379
1669282133376   ,   9   ,   9   , 14000 , 862   ,   Y   , 255   , 255   , 0     ,   -   , 0     , 1.304 , 0.001 , 0.972 , 0.332
RT Lost packets: 0/10,  RT Loss Ratio: 0.00%
Sending Stop-Sessions for all active ports...

Here is details about columns meaning:

  • Sync indicates if client and server clocks seems synchronized or not

  • FW TTL and SW TTL are TTLs extracted from the packet sent by the client and the packet sent by the server respectively

  • IntD is the delay between the time when the server reads the packet and the time when it sends the reply

  • FWD is the time spent from the moment where the client sends the packet and the server reads it

  • SWD is the time spent from the moment where the server sends the reflected packet and the client reads it

  • NwRTD is the Network Round-Trip delay. This is the sum of FWD and SWD

See also

The command reference for details.

TWAMP server

The TWAMP server negotiates sessions configuration with clients and reflects received packets for each running sessions.

Here is an example that starts a server listening on the 10.200.0.1 IP address. When a client initiates a test session, the server selects a port between 10200 and 10220 (included) (reflector-udp-port-range). This port will be used by the client to send test packets to the server.

vsr running config# vrf main twamp server
vsr running server# address 10.200.0.1
vsr running server# reflector-udp-port-range 10200-10220
vsr running config# commit

Note

The server will accept only one session at a time if a single reflector-udp-port-range is set.

The same configuration can be made using this NETCONF XML configuration:

vsr running config# show config xml absolute vrf main twamp server
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <twamp xmlns="urn:6wind:vrouter/twamp">
      <server xmlns="urn:6wind:vrouter/twamp-server">
        <enabled>true</enabled>
        <address>10.200.0.1</address>
        <reflector-udp-port-range>10200-10220</reflector-udp-port-range>
      </server>
    </twamp>
  </vrf>
</config>

To display the server state:

vsr running config# vrf main twamp server
vsr running server# show state
server
    enabled true
    address 127.0.0.1
    reflector-udp-port-range 10200-10220
    ..

See also

The command reference for details.