ericthewry / netchain-p4

NetChain in P4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

net-chain

0. Introduction

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].

About

NetChain in P4

License:Apache License 2.0


Languages

Language:Python 78.6%Language:P4 21.0%Language:Shell 0.4%