A working modification to simple_switch.cpp is show in simple_switch_target/simple_switch.cpp. All modifications are within:
#if LOSSRADAR_ENABLE
#endif
The modification includs adding customized hash functions (the simple switch does not expose enough hash functions), and exposing the timestamp when packet arrive at the ingress pipeline (this is exposed by intrinsic_metadata.ingress_global_timestamp, but when I use that, the switch just does not work, so I add my own metadata).
-
Feed the p4 code (p4src/lossradar_switch.p4) to the p4c_bm.
p4c-bmv2 p4src/lossradar_switch.p4 --json lossradar_switch.json
-
Build the simple_switch target in bmv2, with the modification provided in simple_switch_target/simple_switch.cpp.
-
Create a mininet, with the topology described in topo.txt
-
Set up the table rules, described in commands.txt
Please refer to the CoNext' 16 paper.