# netchain-p4
**Repository Path**: poohdang/netchain-p4
## Basic Information
- **Project Name**: netchain-p4
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-01-18
- **Last Updated**: 2024-01-18
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# NetChain
## 0. Introduction
BMV2-based implementation of NetChain for paper ["NetChain: Scale-Free Sub-RTT Coordination"](https://www.usenix.org/conference/nsdi18/presentation/jin) published in NSDI 2018.
## 1. Obtain required software
- 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
## 2. Content
- client
- client/nc_socket.py
- client/receiver.py
- clinet/set_arp.sh
- controller
- controller/config
- controller/config/topo.txt
- controller/config/vring.txt
- controller/config/config.xml
- controller/config/commands[_1,_2,_3]*.txt
- controller/nc_config.py
- controller/p4_mininet.py
- controller/run_test.py
- controller/exe_cmd.py
- controller/fail_recovery.py
- controller/plot.py
- p4src
- p4src/includes
- p4src/includes/checksum.p4
- p4src/includes/defines.p4
- p4src/includes/headers.p4
- p4src/includes/parsers.p4
- p4src/netchain.p4
- p4src/routing.p4
- logs
- .gitignore
- README.md
## 3. How to run
- 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].