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-setup
This creates a python venv and installs P4RROT inside it.
-
Generate the code for the provided example.
make code-gen
This runs P4RROT. The generated P4 code assembled with the default template can be found in the
output_code
directory. -
Build the P4 code.
make build
This will compile the generated P4 code to both the BMv2 and NFP targets (by calling
p4app
andnfp4build
). Theconfig.sh
file 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.py
script on the same machine as your smartNIC is.python3 measurement_server.py <scenario-name>
-
Start the
mold-udp/client.py
script on a different server that can send traffic to the smartNIC. Thenorequest
argument 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>.pcap
file.
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