P4mite - resource aware load balancer
There are multiple folders in the project:
- The switches
- The application
- SmartNIC-LB
There are three switches implemented:
cd switches
./setup_switch.sh p4mite_switch.p4
./setup_switch.sh ecmp_switch.p4
./setup_switch.sh round_robin.p4
For each switch, there is a Python script containing the configurations. The configuration files should be updated based on the physical connections and IP addresses in the testbed. In our case:
- The client: 10.50.0.1
- The server: 10.50.0.6
- The SmartNIC: 10.50.0.16
There are 5 ones in the applications folder:
- p4mite_agent.py: The agent monitoring server and measure latency using tcpdump
cd applications
sudo tcpdump --immediate-mode -n -i <INTERFACE_NAME> | sudo python3 p4mite_agent.py <SERVER_ADDR> <ACCELERATE_ADDR> <THRESHOLD>
- Microbenchmark: a synthetic workload
To run the microbenchmark's server
cd applications/microbenchmark/server
# To see the options
python3 server_bite_report.py -h
# An example:
python3 server_bite_report.py -H <HOST_ADDR> -P <PORT>
# Run multiple instances:
./run.sh
To run the client:
cd applications/microbenchmark/client
# To see the options
python3 client_multi_port.py -h
#By defaults the client sends the request to ports [10001,10020] of the server.
# An example:
python3 client_multi_port.py -H <HOST_ADDR> -N <NUMBER_OF_REQUESTS> -R <SENDING_RATE>
- VGG16:
there are two version of the server for VGG16. One version uses TensorFlow (server_udp_reporting.py
), and the other version uses TensorFlow lite (server_udp_arm.py
).
cd applications/vgg16/server
# To run TensorFlow version
python3 server_udp_reporting.py -H <HOST_ADDR> -P <PORT>
# To run TensorFlow lite version
python3 server_udp_arm.py -H <HOST_ADDR> -P <PORT>
# To see help
python3 server_udp_reporting.py -h
python3 server_udp_arm.py -h
VGG16's client
cd applications/vgg16/client
#By defaults the client sends the request to ports [10001,10020] of the server.
python3 client_udp_multi_ports.py -H <HOST_ADDR> -N <NUMBER_OF_REQUESTS> -R <SENDING_RATE>
# To see help:
python3 client_udp_multi_ports.py -h
- KNN:
KNN's Server:
cd applications/knn/server
python3 server_knn_reporting.py <HOST_ADDR> -P <PORT>
# To see help:
python3 server_knn_reporting.py -h
KNN's Client:
cd applications/knn/client
#By defaults the client sends the request to ports [10001,10020] of the server.
python3 client_udp_multi_ports.py -H <HOST_ADDR> -N <NUMBER_OF_REQUESTS> -R <SENDING_RATE>
# To see help:
python3 client_udp_multi_ports.py -h
- DNS
DSN's Server:
cd applications/dns/server
python3 dns.py
DNS's client:
cd applications/dns/client
python dnsclient.py --server <SERVER_ADDR>:5053 -R <RATE> 'example.com'
cd SmartNIC-LB
sudo python3 lb.py -H <LB_ADDR or SmartNIC_ADDR> -P <PORT>
# To see the help:
python3 lb.py -h
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Apache License 2.0