This repository is the code that simulates the paco protocol and compares the paco protocol with the openflow protocol. The p414 code that implements the paco protocol can be seen in paco.p4.
It total include 3 experiments.
All of the three experiments hava same topology(as the following picture show). But only paco compares with openflow experiment uses controller.
To run the experiments, you need first install the Requirements
The experimental environment was built on ubuntu14.04
- download and install bmv2
git clone https://github.com/p4lang/behavioral-model.git
cd behavioral-model
git checkout 1.2.0
./install_deps.sh
./autogen.sh
./configure
make
[sudo] make install
- download and install p4c-bm
git clone https://github.com/p4lang/p4c-bm.git
cd p4c-bm
git checkout 1.2.0
sudo pip install -r requirements.txt
sudo python setup.py install
- download and install mininet
git clone https://github.com/mininet/mininet.git
cd mininet
git checkout 2.2.1
./util/install.sh
- download and install OpenVswitch
# get the source code
wget http://openvswitch.org/releases/openvswitch-2.4.0.tar.gz
tar -zxvf openvswitch-2.4.0.tar.gz
cd openvswitch-2.4.0
# Check the existing version and delete it, note that everyone's version may be different
lsmod | grep openvswitch
rmmod openvswitch
find / -name openvswitch.ko –print
rm /lib/modules/*-generic/extra/openvswitch.ko
# build and install ovs
sh boot.sh
./configure --with-linux=/lib/modules/`uname -r`/build
make
make install
make modules_install
/sbin/modprobe openvswitch
mkdir -p /usr/local/etc/openvswitch
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema 2>/dev/null
ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
--private-key=db:Open_vSwitch,SSL,private_key \
--certificate=db:Open_vSwitch,SSL,certificate \
--bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \
--pidfile --detach
ovs-vsctl --no-wait init
ovs-vswitchd --pidfile --detach
# note: every time you want to run ovs you should run the last three commands again.
# For your convenience, you'd better put them in ovs_start.sh
- install python2 and scapy
apt-get install python
pip install scapy
The first experiment is to simulates the paco protocol. The code is on the
masterbranch.
- Preparations:
- Change the
BMV2_PATHandP4C_BM_PATHvariables inbuild.shto your own - Change the
BMV2_PATHandP4C_BM_PATHvariables inrun_demo.shto your own
- Change the
- run
build.shto build p4 code, then openpaco.jsonand searchorder, then change it like:
"order": [
"cpu_header",
"ethernet",
"paco_head",
"ipv4"
]
- run
run_demo.shstart the experimental environment - after mininet is started, run
xterm h1 h2in mininet CLI to start the console for h1 and h2 - Start the sniffing tool such as wireshark
- in h2 console, run
receive.pyto receive packets. - in h1 console, run
send.pyto send packets. At the same time, the sniffing tool will sniff the packet, and you can analyze whether the packet is transmitted according to the paco protocol. - to exit.
- exit sniffing tool
- close the console of h1 and h2
- exit mininet CLI
- run
sudo mn -cto clear mininet
this experiment is to test the delay of the link when the switch runs the paco protocol.
the experiment steps are same to paco simulate experiment, you can analysis the time delay after run
send.py
This experiment is to compare the link delay of the switch when running the openflow protocol.
The code is on the
openflow-time-delaybranch.
- Preparations:
- Change the
BMV2_PATHandP4C_BM_PATHvariables inbuild.shto your own - Change the
BMV2_PATHandP4C_BM_PATHvariables inrun_demo.shto your own
- Change the
- run
build.shto build p4 code, then openpaco.jsonand searchorder, then change it like:
"order": [
"cpu_header",
"ethernet",
"paco_head",
"ipv4"
]
- run
run_demo.shstart the experimental environment - open a new terminal, run
default_commands.shto install default flows. - open a new terminal, run
cpu.pyas controller. - after mininet is started, run
xterm h1 h2in mininet CLI to start the console for h1 and h2 - Start the sniffing tool such as wireshark
- in h2 console, run
receive.pyto receive packets. - in h1 console, run
send.pyto send packets. At the same time, the sniffing tool will sniff the packet, and you can analyze whether the packet is transmitted according to the paco protocol. - to exit.
- exit sniffing tool
- close the console of h1 and h2
- exit
cpu.py - exit mininet CLI
- run
sudo mn -cto clear mininet
