Collaborate with Yifan Lin.
Median trick is implemented on the 'median-trick' branch. (Only Tofino version).
git clone https://github.com/ZER0-Nu1L/Let-Me-Count.git
cd Let-Me-Count
git submodule update --initcd ./let-me-count.p4appsplit your terminal to several panes. (terminal0)
sudo make run(terminal1)
sudo make h1
./receive.py(terminal2)
sudo make h1
./send.py 10.0.1.1 "123"This release assumes that you have access to Barefoot SDE and that you have configured the basic environment.
cd ./let-me-count.tofinoPplit your terminal to several panes and execute . ~/tools/set_sde.bash for all of them.
(terminal1)
~/tools/p4_build.sh ./p4src/letmecount.p4(terminal2)(if on Tofino model)
sudo ~/tools/veth_setup.sh
$SDE/run_tofino_model.sh -p letmecount --log-dir ./logs
# ...
# In the end
sudo ~/tools/veth_teardown.sh(terminal3)
$SDE/run_switchd.sh -p letmecount(terminal4)
$SDE/run_bfshell.sh -b ./bfrt_python/setup.py [-i]Use -i to stay in the interactive mode after the script has been executed.
(terminal5)
sudo python ./pkt/recv.py veth2(terminal6)
# Reset
sudo python ./pkt/send.py --control_bit 0
# pktgen & replay
sudo python ./pkt/pktgen.py pkt/mypcap -n 1500
sudo tcpreplay -i veth1 -M 0.1 ./pkt/mypcap/test.pcap
# check
sudo python ./pkt/send.py --control_bit 1You can see demo below: