Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twamp-tool

C implementation of the TWAMP Light session-sender and session-reflector, as defined by RFC 5357.

twamp-tool is a high-performance network measurement tool calculating Round-Trip Time (RTT) latency and jitter, and for detecting packet loss, reordering and duplicates. It features support for hardware timestamping using FPGA cards running the NDK Minimal framework (planned feature).

Minimum requirements

  • OS: Linux x86-64 (Kernel 4.18)
  • GCC: 8.5.0
  • glibc: 2.28
  • Python: 3.6.8

Supported FPGA cards

  • Netcope NFB-200G2QL

Quick start

Clone the twamp-tool repository and build the base CLI tools:

git clone https://github.com/CESNET/twamp-tool.git
cd twamp-tool
make

Web Sender (GUI)

It is recommended to use a Python virtual environment:

python3 -m venv venv
source venv/bin/activate

Install dependencies and run the web server:

pip install fastapi pydantic uvicorn
uvicorn main:app --port 8000

CLI Sender

./sender 192.168.1.101 -p 862

CLI Reflector

sudo ./reflector -p 862

CLI Reflector (Test)

sudo ./reflector-test -p 862 -d 4

Configure FPGA card - Planned feature

(Currently this chapter only goes through configuration of an FPGA card to act as a standard NIC in the Linux network stack.)

For high-precision, hardware-level latency and jitter measurements on the sender side, you can utilize an FPGA card running the NDK Minimal framework.

After booting up, verify that you are running the Minimal firmware on a supported FPGA card:

nfb-info

Enable the Ethernet ports and configure the link:

nfb-eth -e1
nfb-eth -Pc "100GBASE-SR4"

Next, expose the card as a standard network interface in the Linux network stack:

XDP option

Clone the NDK-SW repository from GitHub:

git clone https://github.com/CESNET/ndk-sw.git
cd ndk-sw

Uncomment the following line in drivers/Makefile.conf:

CONFIG_NFB_XDP		= y

Follow the remaining installation steps in the NDK-SW documentation. Once built, reload the driver with XDP enabled:

sudo rmmod nfb
sudo insmod drivers/kernel/drivers/nfb/nfb.ko xdp_enable=yes

Add an XDP network interface:

sudo nfb-dma -i0-7 -N nfb_xdp add,id=1

Verify the interface was added successfully and identify it's assigned name:

dmesg

Interface configuration via NetworkManager

The new interface should be listed as disconnected:

nmcli device status

Create a new connection profile with a static IPv4 address:

nmcli con add type ethernet con-name "your-interface-name" ifname your-interface-name ipv4.method manual ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns "8.8.8.8"

Alternatively, for dynamic IPv4 (DHCP):

sudo nmcli con add type ethernet con-name "your-interface-name" ifname your-interface-name ipv4.method auto

Bring the interface up:

sudo nmcli con up "your-interface-name"

Documentation

Command-line parameters and their descriptions can be viewed by passing the -h flag to any CLI executable. For the Web Sender, detailed parameter descriptions are available by hovering over the info bubble in the GUI.

Sender

The sender periodically transmits TWAMP-Test packets to specified nodes and processes replies from session-reflectors to calculate RTT latency and jitter (using a 16-scale EWMA algorithm as defined in RFC 3550 Appendix A.8).

It also detects network anomalies - including packet drops, reordering (late packets), duplicates and super late packets - using a 64-bit sliding window based on the IPsec Anti-Replay standard (RFC 4303 Section 3.4.3).

The core engine is written in C and can be run directly from the command line, or driven by a FastAPI web server featuring a GUI that visualizes real-time statistics using μPlot graphs and live counters.

The sender also supports optional hardware timestamping using FPGA cards running the NDK Minimal framework (planned feature).

Reflector

The reflector is a lightweight C program that receives TWAMP-Test packets, copies the necessary data into the outbound payload, and bounces them back to the sender.

Reflector (Test)

The test reflector is a superset of the base reflector. It introduces parameters to artificailly inject network anomalies (drops, reordering, duplicates and super late packets) for verifying the sender implementation. Due to this simulation overhead, it is less performant than the base reflector.

Troubleshooting / Quick fixes

  • No packets received by the reflector: The traffic might be getting filtered by the local firewall (nftables). To explicitly allow incoming UDP traffic on the TWAMP testing port:
sudo nft add rule inet firewall INPUT udp dport 862 counter accept

License

Unless otherwise noted, the content of this repository is available under the BSD 3-Clause License. Please read the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages