BMV2-based implementation of NetChain for paper "NetChain: Scale-Free Sub-RTT Coordination" published in NSDI 2018.
- Firstly, you need to get the p4 compiler from Github, and install required dependencies.
git clone https://github.com/p4lang/p4c-bm.git p4c-bmv2
cd p4c-bmv2
sudo pip install -r requirements.txt - Secondly, you need to get the behavior model of p4 from github, install dependencies and compile the behavior model.
git clone https://github.com/p4lang/behavioral-model.git bmv2
cd bmv2
install_deps.sh
./autogen.sh
./configure
make - Finally, you need to install some other tools which are used in this simulation.
sudo apt-get install mininet python-ipaddr
sudo pip install scapy thrift networkx
- client
- client/nc_socket.py
- client/receiver.py
- clinet/set_arp.sh
- client/nc_socket.py
- controller
- controller/config
- controller/config/topo.txt
- controller/config/vring.txt
- controller/config/config.xml
- controller/config/commands[_1,_2,_3]*.txt
- controller/config/topo.txt
- controller/nc_config.py
- controller/p4_mininet.py
- controller/run_test.py
- controller/exe_cmd.py
- controller/fail_recovery.py
- controller/plot.py
- controller/config
- p4src
- p4src/includes
- p4src/includes/checksum.p4
- p4src/includes/defines.p4
- p4src/includes/headers.p4
- p4src/includes/parsers.p4
- p4src/includes/checksum.p4
- p4src/netchain.p4
- p4src/routing.p4
- p4src/includes
- logs
- .gitignore
- README.md
- Install required software and dependency for P4 (P4-14).
- Make sure the directory informations are correct in
controller/config/config.xml.
- Go to directory controller, you can simply run program in normal mode:
sudo python run_test.py normal.
- Or you can run program in failure recovery mode:
sudo python run_test.py failure.
- The program produces results for failure recovery at logs/. The format of the files is
[number of virtual groups].tmp_[read/write]_[send/receive].log.
- You can draw figures by running:
python plot.py [number of virtual groups].