In this experiment, 2 physical workers and 1 switch is used.
$ git clone https://github.com/ATP-NSDI/switchML.git
If you are using physical switch, compile the switch program then jump to Terminal 2 directly.
$ $TOOLS/p4_build.sh $REPO_SWITCHML/p4src/switchml.p4
# (Optional) for software Tofino behavior model
$ cd $SDE/run_tofino_model.sh -p switchml
$ cd $SDE
$ $SDE/run_switchd.sh -p switchml
$ $SDE/run_p4_tests.sh -t $REPO_SWITCHML/ptf/ -p switchml
$ $TOOLS/run_pd_rpc.py -p switchml $REPO_SWITCHML/run_pd_rpc/setup.py
$ cd $REPO_SWITCHML/client/
$ make
# Usage: ./app [MyID] [Num of Worker] [AppID]
$ sudo ./app 0 2 1
# Usage: ./app [MyID] [Num of Worker] [AppID]
$ sudo ./app 1 2 1
Then you can switch to Terminal 4/5 to see the bandwidth report.