A motivating examle on how to use P4RROT for High-Frequency Trading.
- Make
- git
- virtualenv
- Netronome SDK
-
Clone this repository.
-
Initialise your development environment.
make dev-setupThis creates a python venv and installs P4RROT inside it.
-
Generate the code for the provided example.
make code-genThis runs P4RROT. The generated P4 code assembled with the default template can be found in the
output_codedirectory. -
Build the P4 code.
make buildThis will compile the generated P4 code to both the BMv2 and NFP targets (by calling
p4appandnfp4build). Theconfig.shfile might need manual adjustments depending on your exact setup. -
Deploy the solution on the Netronome smartNIC.
make deploy SERVER=<server_name>
The mold-udp/server.py and mold-udp/client.py scripts can be used to test the functionality of the solution.
-
Start the RTE provided by Netronome.
-
Deploy the generated code.
make deploy SERVER=<server_name> -
Configure the ethernet ports (IP address, netmask, etc.).
-
Start the
mold-udp/measurement_server.pyscript on the same machine as your smartNIC is.python3 measurement_server.py <scenario-name> -
Start the
mold-udp/client.pyscript on a different server that can send traffic to the smartNIC. Thenorequestargument will disable the automatic retransmission requests.python3 client.py norequest -
Start background traffic (e.g. using iperf).
-
Hit ENTER in the console of
mold-udp/measurement_server.py. This will send only every second packet thus triggering a retransmission request each time. -
After the test, the captured MoldUDP traffic is saved in the
measurement_<scenario-name>.pcapfile.
A baseline can be obtained, by running only the P4 template on the smartNIC. This can be done by slightly modifying steps 2 and 5.
-
Build and deploy only packet forwarding.
make build-baseline make deploy-baseline
-
Run the client without disabling the retransmission requests.
python3 client.py