Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


test-session (Junos OS Evolved)


Hierarchy Level


Specify the TWAMP test session details, including the session name, the contents of the test packet, the data size, the probe details, and the target destination. You must configure at least one test session.



Name of the test session.

data-size bytes

Specify the size of the data portion of the test packet, in bytes.

  • Range: 0 through 65400 bytes

  • Default: 0

destination-port port

Specify the User Datagram Protocol (UDP) port number to which a probe is sent. You must have the control-type option for the control-connection statement set to light to be able to configure a destination port for a particular test session. If you set the control-type option to managed, the destination port is negotiated for you between the client and the server, and so you cannot configure the destination port for a particular test session.

  • Range: You can specify port 862, or any port from 49152 through 65535.

  • Default: 862 (IANA port for TWAMP)

dscp-code-points dscp-bits

Configure the value of the Differentiated Services (DiffServ) field within the IP header. The DiffServ code point (DSCP) bits value must be set to a valid 6-bit pattern.

  • Values: Configure a valid 6-bit pattern; for example, 001111, or one of the following DSCP aliases:

    • af11—Default: 001010

    • af12—Default: 001100

    • af13—Default: 001110

    • af21—Default: 010010

    • af22—Default: 010100

    • af23 —Default: 010110

    • af31 —Default: 011010

    • af32 —Default: 011100

    • af33 —Default: 011110

    • af41 —Default: 100010

    • af42 —Default:100100

    • af43 —Default:100110

    • be—Default: 000000

    • cs1—Default: 001000

    • cs2—Default: 010000

    • cs3—Default: 011000

    • cs4—Default: 100000

    • cs5—Default: 101000

    • cs6—Default: 110000

    • cs7—Default: 111000

    • ef—Default: 101110

    • nc1—Default: 110000

    • nc2—Default: 111000

history-size number

Specify the number of stored history entries. The value configured for the history-size option must be equal to or larger than the value configured for the probe-count option, or the configuration will not commit.

  • Range: 0 to 255

  • Default: 50

moving-average-size number

Enable statistical calculations to be performed across a configurable number of the most recent samples.

  • Range: 0 through 512

  • Default: 0 (disable)

offload-type (none | pfe-timestamp)

Enable timestamping of TWAMP probe messages in the Routing Engine or Packet Forwarding Engine host processor.

  • Default: pfe-timestamp

probe-count number

Specify the number of probes within a test. The value configured for the probe-count option must be smaller than the value configured for the history-size option, or the configuration will not commit.

  • Range: 1 through 255

  • Default: 1

probe-interval seconds

Specify the number of seconds to wait before sending the next probe.

  • Range: 1 through 255 seconds

  • Default: 1

source-address address

Specify the IPv4 source address used for test probes. If the IPv4 source address is not one of the device’s assigned addresses, the probe uses the outgoing interface’s IPv4 address as its source.

The following addresses cannot be used for the source address for probes:


  • (loopback)

  • (multicast)

  • (broadcast)

target target-address

Specify the IPv4 address for the target destination of the probe.

ttl hop-count

Specify the maximum number of hops a TWAMP probe can travel. You configure the ttl option when necessary to restrict the scope of a probe, so that a probe does not unintentionally monitor an alternative path to the destination (such as may occur after a BGP re-routing). You can also use the ttl option to monitor direct reachability by specifying a TTL of 1. Probes that exceed the number configured are discarded.

  • Range: 1 through 255 hops

  • Default: 64 hops

The remaining statements are explained separately. Search for a statement in CLI Explorer or click a linked statement in the Syntax section for details.

Required Privilege Level

system—To view this statement in the configuration.

system-control—To add this statement to the configuration.

Release Information

Statement introduced in Junos OS Evolved 20.3R1.