Repository of paper NETWORK-24-00606 submitted for IEEE Network Magazine special issue of Deterministic, Reliable, Resilient and Programmable Networks for 6G.
TFTG, a traffic generator based on Tofino capable of creating TSN and DetNet traffic with nanoscale precision and high throughput. The proposed solution can be used in different scenarios to test standards for synchronization, reliability, and scheduling, with high flexibility in its applications. With these functionalities, TFTG serves as an open-source solution that users can employ to test target device capabilities, abstracting different topologies and scenarios for multiple protocols and testbed configurations.
Simple packet generation (with fixed inter-packet gaps)
Packet generation for time-sensitive applications.
TSN Packet transmission with TAS control.
TSN Packet transmission with ATS control.
Packet Duplication using FRER and PREOF.
Testing reordering function.
gPTP Synchronization mode.
git clone https://github.com/intrig-unicamp/TFTG.git
- git
- pyhton3
- tofino sde 9.13.0
From the sde directory set environment variables (SDE BASH).
After that, edit the main.py file according to the characteristics you want to generate traffic (see available commands).
After edit, execute:
python3 main.py
It will generate all necessary files to start the traffic generation.
If everything is correct, just run the run.sh script
./run.sh
Then in a few seconds the traffic generator will start, and the configured traffic will be sent.
Add the output port for the configurated traffic Parameters: P_ID of output port (Tofino P-ID)
Usage:
# addGenerationPort(P_ID) Adiciona a porta de geração de trafego
Gerador.addGenerationPort(68)
# Adiciona a porta de saida do equipamento
Gerador.addOutputPort(5, 160, "100G") #Physical Port, Port ID(D_P), Port bw
Add a new flow of packets to be generated. The optional parameters have default values and can be set later in the code
Mandatory parameters:
- Name of the flow (for later identification)
Optional parameters
- MODE of generation (could be by histograms or using numerical parameters)
- PCP, indicating the priority of the flow (0-7)
- PktLen, with the packet size in bytes
- Eth_src and Eth_dest, indicating the MAC source and destination
- IP_src and IP_dest, indicating the IP source and destination
Gerador.addFlow(name,distMode="computed", PktType="TSN/DETNET", Payload=64,
Eth_src="10.2.2.2",Eth_dest="10.2.2.3", IP_src="198.168.1.0",IP_dest="198.168.1.1")
For flows generated by histograms, the file path is required
Gerador.histogram(name,"histogram.xml")
For flows computed, the interval (ns) to generate the packets are required. Optional parameters can also be defined
# distribution(name = "flow", sendInt, intStdDev = 0)
Gerador.distribution(name, sendInt = 10000, intStdDev = 10)
By default, no standards are applied. The user must define between the available standards to start using it
Gerador.setGateControl(mode="")
Each gate of each port that will apply the standard must define its parameters. Another function that can be used is to set if the guard bands of the standard will be calculated or assumed to be inside the values already sent.
Mandatory parameters:
- P_ID of output port (Tofino P-ID)
- queue for where the packet is forwarded
- Time_Open and Time_Closed, defining the time the gate will be oppened and closed respectvely
- Time_Offset, indicating when the gate will start to be oppen
Gerador.setGateControl(mode="TAS")
Gerador.setGclPriPort(160, 1, 100, 900, 0) #Port ID(D_P), PCP (0-7), Time Open (ns), Time Closed (ns), Offset (ns)
Gerador.setGB(True) # Se verdadeiro deve computar a guardband (pkt_size/throughput) para n mandar pacotes mesmo q com o gate aberto antes do
Gerador.FRER(False,replicating=True,reordering=False)
Gerador.PREOF(False,replicating=True,reordering=False)
A special packet that TFTG can emit is synchronization packets from TSN, using the gPTP, where we can also change some parameters as needed.
Usage
Gerador.gPTP(syncInt = 125, correctField = 0, rateRatio = 1) # intervalo de sincronização (ms), valor setado pro correctionField (ns), valor setado pro rateRatio
We are members of INTRIG (Information & Networking Technologies Research & Innovation Group) at Universidade Estudal Campinas - Unicamp, SP, Brazil and SMART NEtworks and ServiceS for 2030 (SMARTNESS)