Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Example: Configuring TWAMP Client and Server on MX Series Routers

date_range 11-Dec-23

This example shows how to configure the TWAMP client and server and contains the following sections.

Requirements

This example uses the following hardware and software components:

  • MX Series routers.

  • Junos OS Release 15.1 or later.

Overview

This example explains the Two-Way Active Measurement Protocol (TWAMP). TWAMP is an open protocol for measuring network performance between any two devices supporting the TWAMP protocol. The TWAMP-Control protocol is used to set up performance measurement sessions. The TWAMP-Test protocol is used to send and receive performance measurement probes.

The TWAMP architecture is composed of the following entities that are responsible for starting a monitoring session and exchanging packets:

  • The control client initiates all requested test sessions with a start sessions message, and the server acknowledges. When necessary, the control client sends a message to stop all test sessions.

  • The session sender and the session reflector exchange test packets according to the TWAMP-Test protocol for each active session. On receiving a TWAMP-Test packet, the session reflector only reflects a measurement packet and does not collect packet statistics in TWAMP.

The TWAMP server is an end system that manages one or more TWAMP sessions and is also capable of configuring per-session ports. The server listens on the TCP port. The session reflector and server make up the TWAMP responder in an IP service-level agreement operation.

For 15.1, both the control client and session sender would be residing on the same Juniper router. The client design does not mandate the server and the session reflector to be on the same system. Hence the Juniper TWAMP client will also be capable of working with a third-party server implementation.

Configuration for TWAMP client

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI, at the [edit] hierarchy level, of SG1 router.

Configuring Chassis

content_copy zoom_out_map
set chassis fpc 4 pic 1 inline-services bandwidth 1g

Configuring Interfaces

content_copy zoom_out_map
set interfaces si-4/1/0 unit 0 family inet
set interfaces si-4/1/0 unit 10 rpm twamp-client
set interfaces si-4/1/0 unit 10 family inet address 10.60.60.1/32

Configuring Services

content_copy zoom_out_map
set services rpm twamp client control-connection c1 destination-interface si-4/1/0.10
set services rpm twamp client control-connection c1 history-size 500
set services rpm twamp client control-connection c1 target-address 10.70.70.1
set services rpm twamp client control-connection c1 test-count 1
set services rpm twamp client control-connection c1 test-interval 1
set services rpm twamp client control-connection c1 traps test-iteration-done
set services rpm twamp client control-connection c1 traps control-connection-closed
set services rpm twamp client control-connection c1 test-session t1 target-address 10.70.70.1
set services rpm twamp client control-connection c1 test-session t1 data-fill-with-zeros
set services rpm twamp client control-connection c1 test-session t1 data-size 1400
set services rpm twamp client control-connection c1 test-session t1 probe-count 55
set services rpm twamp client control-connection c1 test-session t1 probe-interval 1

Configuring TWAMP client

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy.

  1. Configure the chassis.

    content_copy zoom_out_map
    [edit chassis]
    user@router1# set fpc 4 pic 1 inline-services bandwidth 1g
    
  2. Configure the interfaces.

    content_copy zoom_out_map
    [edit interfaces]
    user@router1# set si-4/1/0 unit 0 family inet
    user@router1# set si-4/1/0 unit 10 rpm twamp-client
    user@router1# set si-4/1/0 unit 10 family inet address 10.60.60.1/32
    
  3. Configure the services.

    content_copy zoom_out_map
    [edit services]
    user@router1# set rpm twamp client control-connection c1 destination-interface si-4/1/0.10
    user@router1# set rpm twamp client control-connection c1 history-size 500
    user@router1# set rpm twamp client control-connection c1 target-address 10.70.70.1
    user@router1# set rpm twamp client control-connection c1 test-count 1
    user@router1# set rpm twamp client control-connection c1 test-interval 1
    user@router1# set rpm twamp client control-connection c1 traps test-iteration-done
    user@router1# set rpm twamp client control-connection c1 traps control-connection-closed
    user@router1# set rpm twamp client control-connection c1 test-session t1 target-address 10.70.70.1
    user@router1# set rpm twamp client control-connection c1 test-session t1 data-fill-with-zeros
    user@router1# set rpm twamp client control-connection c1 test-session t1 data-size 1400
    user@router1# set rpm twamp client control-connection c1 test-session t1 probe-count 55
    user@router1# set rpm twamp client control-connection c1 test-session t1 probe-interval 1
    

Results

From the configuration mode of Router 1, confirm your configuration by entering the show chassis, show interfaces, and show services rpm twamp commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

content_copy zoom_out_map
user@router1# show chassis
fpc 4 {
    pic 1 {
        inline-services {
            bandwidth 1g;
        }
    }
}
content_copy zoom_out_map
user@router1# show interfaces
    si-4/1/0 {
        unit 0 {
            family inet;
        }
        unit 10 {
            rpm twamp-client;
            family inet {
                address 10.60.60.1/32;
            }
        }
    }
content_copy zoom_out_map
user@router1# show services rpm twamp
client {
    control-connection c1 {
        destination-interface si-4/1/0.10;
        history-size 500;
        target-address 10.70.70.1;
        test-count 1;
        test-interval 1;
        traps {
            test-iteration-done;
            control-connection-closed;
        }
        test-session t1 {
            target-address 10.70.70.1;
            data-fill-with-zeros;
            data-size 1400;
            probe-count 55;
            probe-interval 1;
        }
    }
}

Configuration for TWAMP server

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI, at the [edit] hierarchy level, of SG1 router.

Configuring Chassis

content_copy zoom_out_map
set chassis fpc 2 pic 1 inline-services bandwidth 1g

Configuring Interfaces

content_copy zoom_out_map
set interfaces si-2/1/0 unit 0 family inet
set interfaces si-2/1/0 unit 10 rpm twamp-server
set interfaces si-2/1/0 unit 10 family inet address 10.70.70.1/32

Configuring Services

content_copy zoom_out_map
set services rpm twamp server authentication-mode none
set services rpm twamp server port 862
set services rpm twamp server client-list Client1 address 10.60.60.1/32

Configuring TWAMP server

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy.

  1. Configure the chassis.

    content_copy zoom_out_map
    [edit chassis]
    user@router1# set fpc 2 pic 1 inline-services bandwidth 1g
    
  2. Configure the interfaces.

    content_copy zoom_out_map
    [edit interfaces]
    user@router1#set si-2/1/0 unit 0 family inet
    user@router1#set si-2/1/0 unit 10 rpm twamp-server
    user@router1#set si-2/1/0 unit 10 family inet address 10.70.70.1/32
    
  3. Configure the services.

    content_copy zoom_out_map
    [edit services]
    user@router1# set rpm twamp server authentication-mode none
    user@router1# set rpm twamp server port 862
    user@router1# set rpm twamp server client-list Client1 address 10.60.60.1/32
    

Results

From the configuration mode of Router 1, confirm your configuration by entering the show chassis, show interfaces, and show services rpm twamp server commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

content_copy zoom_out_map
user@router1# show chassis
fpc 2 {
    pic 1 {
        inline-services {
            bandwidth 1g;
        }
    }
}
content_copy zoom_out_map
user@router1# show interfaces
si-2/1/0 {
    unit 0 {
        family inet;
    }
    unit 10 {
        rpm twamp-server;
        family inet {
            address 10.70.70.1/32;
        }
    }
}
content_copy zoom_out_map
user@router1# show services rpm twamp server
authentication-mode none;
    port 862;
    client-list Client1 {
    address {
        10.60.60.1/32;
    }
}

Verification

Verifying TWAMP server sessions

Purpose

Verify that the TWAMP server sessions are established.

Action

From operational mode, enter the show services rpm twamp server session command.

content_copy zoom_out_map
user@router1> show services rpm twamp server session
    Session  Connection      Sender           Sender    Reflector          Reflector
         ID          ID      address            port      address               port
          4          44     10.1.1.1           12345  192.168.219.203          890
         78          44     10.22.1.55           345  10.22.2.2                89022
        234         423     192.168.219.203     2345  10.2.22.2                3333
          5         423     10.4.1.1           82345  10.2.2.2                 45909
          1         423     192.168.1.1          645  10.32.2.2                2394

Verifying TWAMP client sessions

Purpose

Verify that the TWAMP client sessions are established.

Action

From operational mode, enter the show services rpm twamp client session command.

content_copy zoom_out_map
user@router1> show services rpm twamp client session

Connection  Session   Sender        Sender    Reflector    Reflector
      Name     Name   address         port      address         port
        c2       t1   10.60.60.1     10008   10.70.70.1        10008
footer-navigation