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).
- OS: Linux x86-64 (Kernel 4.18)
- GCC: 8.5.0
- glibc: 2.28
- Python: 3.6.8
- Netcope NFB-200G2QL
Clone the twamp-tool repository and build the base CLI tools:
git clone https://github.com/CESNET/twamp-tool.git
cd twamp-tool
makeIt is recommended to use a Python virtual environment:
python3 -m venv venv
source venv/bin/activateInstall dependencies and run the web server:
pip install fastapi pydantic uvicorn
uvicorn main:app --port 8000./sender 192.168.1.101 -p 862sudo ./reflector -p 862sudo ./reflector-test -p 862 -d 4(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-infoEnable 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:
Clone the NDK-SW repository from GitHub:
git clone https://github.com/CESNET/ndk-sw.git
cd ndk-swUncomment 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=yesAdd an XDP network interface:
sudo nfb-dma -i0-7 -N nfb_xdp add,id=1Verify the interface was added successfully and identify it's assigned name:
dmesgThe new interface should be listed as disconnected:
nmcli device statusCreate 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 autoBring the interface up:
sudo nmcli con up "your-interface-name"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.
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).
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.
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.
- 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 acceptUnless otherwise noted, the content of this repository is available under the BSD 3-Clause License. Please read the LICENSE file for more details.