Skip to content

gycsaba96/mold-udp-example

Repository files navigation

MoldUDP example for P4RROT

A motivating examle on how to use P4RROT for High-Frequency Trading.

Dependencies

  • Make
  • git
  • virtualenv
  • Netronome SDK

Getting started

  1. Clone this repository.

  2. Initialise your development environment.

    make dev-setup

    This creates a python venv and installs P4RROT inside it.

  3. 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.

  4. Build the P4 code.

    make build

    This will compile the generated P4 code to both the BMv2 and NFP targets (by calling p4app and nfp4build). The config.sh file might need manual adjustments depending on your exact setup.

  5. 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.

Measure the performance

Offloaded solution

  1. Start the RTE provided by Netronome.

  2. Deploy the generated code.

    make deploy SERVER=<server_name>
  3. Configure the ethernet ports (IP address, netmask, etc.).

  4. Start the mold-udp/measurement_server.py script on the same machine as your smartNIC is.

    python3 measurement_server.py <scenario-name>
  5. Start the mold-udp/client.py script on a different server that can send traffic to the smartNIC. The norequest argument will disable the automatic retransmission requests.

    python3 client.py norequest
  6. Start background traffic (e.g. using iperf).

  7. 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.

  8. After the test, the captured MoldUDP traffic is saved in the measurement_<scenario-name>.pcap file.

Non-offloaded solution

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.

  1. Build and deploy only packet forwarding.

    make build-baseline
    make deploy-baseline
  2. Run the client without disabling the retransmission requests.

    python3 client.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published