added ECMP exercise for May 2016 P4 workshop

This commit is contained in:
Antonin Bas
2016-05-10 13:11:23 -07:00
parent f9ccd265f3
commit 547fc0a75f
31 changed files with 769 additions and 61 deletions

View File

@@ -1,13 +0,0 @@
# Python byte code
*.pyc
# Emacs
*~
# Compiled JSON
*.json
*.pcap
# Extracted solutions
solution/

View File

@@ -80,9 +80,9 @@ like this:
You need to tell us where you cloned the `bmv2` and `p4c-bm` repositories
:). Please update the values of the shell variables `BMV2_PATH` and
`P4C_BM_PATH` in the `env.sh` file - located in this directory. Note that if you
cloned both repositories in the same directory as this one (`tutorials`), you
will not need to change the value of the variables.
`P4C_BM_PATH` in the `env.sh` file - located in the root directory of this
repository. Note that if you cloned both repositories in the same directory as
this one (`tutorials`), you will not need to change the value of the variables.
That's all :)

View File

@@ -1,8 +0,0 @@
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# ---------------- EDIT THIS ------------------
BMV2_PATH=$THIS_DIR/../../bmv2
# e.g. BMV2_PATH=$THIS_DIR/../bmv2
P4C_BM_PATH=$THIS_DIR/../../p4c-bmv2
# e.g P4C_BM_PATH=$THIS_DIR/../p4c-bm
# ---------------- END ------------------

View File

@@ -16,7 +16,7 @@
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $THIS_DIR/../env.sh
source $THIS_DIR/../../env.sh
P4C_BM_SCRIPT=$P4C_BM_PATH/p4c_bm/__main__.py
@@ -30,8 +30,9 @@ CLI_PATH=$BMV2_PATH/tools/runtime_CLI.py
# process back in the foreground
set -m
$P4C_BM_SCRIPT p4src/simple_router.p4 --json simple_router.json
sudo echo "sudo" > /dev/null
sudo $BMV2_PATH/targets/simple_switch/simple_switch simple_router.json \
# This gets root permissions, and gives libtool the opportunity to "warm-up"
sudo $SWITCH_PATH >/dev/null 2>&1
sudo $SWITCH_PATH simple_router.json \
-i 0@veth0 -i 1@veth2 -i 2@veth4 -i 3@veth6 -i 4@veth8 \
--nanolog ipc:///tmp/bm-0-log.ipc \
--pcap &

View File

@@ -16,7 +16,7 @@
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $THIS_DIR/../env.sh
source $THIS_DIR/../../env.sh
P4C_BM_SCRIPT=$P4C_BM_PATH/p4c_bm/__main__.py
@@ -25,7 +25,9 @@ SWITCH_PATH=$BMV2_PATH/targets/simple_switch/simple_switch
CLI_PATH=$BMV2_PATH/tools/runtime_CLI.py
$P4C_BM_SCRIPT p4src/source_routing.p4 --json source_routing.json
# This gives libtool the opportunity to "warm-up"
sudo $SWITCH_PATH >/dev/null 2>&1
sudo PYTHONPATH=$PYTHONPATH:$BMV2_PATH/mininet/ python topo.py \
--behavioral-exe $BMV2_PATH/targets/simple_switch/simple_switch \
--behavioral-exe $SWITCH_PATH \
--json source_routing.json \
--cli $CLI_PATH