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.
Next, we describe the setup commands which are mandatory for traffic generation to work. They are mainly related to the configuration of Tofino and its ports.
You can use the below code to create an instance of our traffic generator (in the main.py file) with the name you prefer
TG = generator("tftg")
You need to define the physical output ports that will be used to send the configurated traffic. These ports are physical ports on Tofino, and should be configured appropriately with your setup.
Parameters: Port number, Port ID (D_P) and bandwidth
Usage:
#Add a new output port
TG.addOutputPort(1, 132, "100G") #Physical Port, Port ID(D_P), Port bw
You should also define which port will be used to generate the traffic. This will affect which pipeline or traffic will arrive, so if you have questions about how this works, read section 9 of the Tofino documentation.
Usage:
TG.addGenerationPort(68)
Next, we describe the commands used to configure the traffic that will be generated.
Add a new flow of packets to be generated. This flow has a fixed inter-packet gap (IPG) and packet size. You just need to define the name, the fixed delay em nanoseconds, the packet size and the desired output port (D_P of the port).
# create a simple flow
TG.addFlow("flow1", fixedDelay=10000, pktLen=1000, outputPort=134)
This will create a flow of ethernet packets with the desired IPG, len, and sent to the output port.
Coming soon...
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)