Updates the examples to use the new build scripts (except Hula). (#74)
* Added Makefile and topology.jsons for all examples. * use branch * Updated MRI exercise (#73) * Updated MRI exercise * Updated basic_tunnel.p4 for changes to p4 lang * updated other examples
This commit is contained in:
1
P4D2_2017_Fall/exercises/load_balance/Makefile
Normal file
1
P4D2_2017_Fall/exercises/load_balance/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
include ../../utils/Makefile
|
||||
@@ -24,7 +24,7 @@ up a switch in Mininet to test its behavior.
|
||||
|
||||
1. In your shell, run:
|
||||
```bash
|
||||
./run.sh
|
||||
make
|
||||
```
|
||||
This will:
|
||||
* compile `load_balance.p4`, and
|
||||
@@ -64,7 +64,7 @@ with parameters supplied by the control plane as part of the rule.
|
||||
|
||||
In this exercise, the control plane logic has already been
|
||||
implemented. As part of bringing up the Mininet instance, the
|
||||
`run.sh` script will install packet-processing rules in the tables of
|
||||
`make` script will install packet-processing rules in the tables of
|
||||
each switch. These are defined in the `s1-commands.txt` file.
|
||||
|
||||
**Important:** A P4 program also defines the interface between the
|
||||
@@ -112,12 +112,12 @@ messages, some should be received by each server.
|
||||
|
||||
There are several ways that problems might manifest:
|
||||
|
||||
1. `load_balance.p4` fails to compile. In this case, `run.sh` will
|
||||
1. `load_balance.p4` fails to compile. In this case, `make` will
|
||||
report the error emitted from the compiler and stop.
|
||||
|
||||
2. `load_balance.p4` compiles but does not support the control plane
|
||||
rules in the `sX-commands.txt` files that `run.sh` tries to install
|
||||
using the BMv2 CLI. In this case, `run.sh` will report these errors
|
||||
rules in the `sX-commands.txt` files that `make` tries to install
|
||||
using the BMv2 CLI. In this case, `make` will report these errors
|
||||
to `stderr`. Use these error messages to fix your `load_balance.p4`
|
||||
implementation.
|
||||
|
||||
@@ -129,7 +129,7 @@ detailed and can help pinpoint logic errors in your implementation.
|
||||
|
||||
#### Cleaning up Mininet
|
||||
|
||||
In the latter two cases above, `run.sh` may leave a Mininet instance
|
||||
In the latter two cases above, `make` may leave a Mininet instance
|
||||
running in the background. Use the following command to clean up
|
||||
these instances:
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"program": "load_balance.p4",
|
||||
"language": "p4-16",
|
||||
"targets": {
|
||||
"multiswitch": {
|
||||
"auto-control-plane": true,
|
||||
"cli": true,
|
||||
"pcap_dump": true,
|
||||
"bmv2_log": true,
|
||||
"links": [["h1", "s1"], ["s1", "s2"], ["s1", "s3"], ["s3", "s2"], ["s2", "h2"], ["s3", "h3"]],
|
||||
"hosts": {
|
||||
"h1": {
|
||||
},
|
||||
"h2": {
|
||||
},
|
||||
"h3": {
|
||||
}
|
||||
},
|
||||
"switches": {
|
||||
"s1": {
|
||||
"entries": "s1-commands.txt"
|
||||
},
|
||||
"s2": {
|
||||
"entries": "s2-commands.txt"
|
||||
},
|
||||
"s3": {
|
||||
"entries": "s3-commands.txt"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
P4APPRUNNER=../../utils/p4apprunner.py
|
||||
mkdir -p build
|
||||
tar -czf build/p4app.tgz * --exclude='build'
|
||||
sudo python $P4APPRUNNER p4app.tgz --build-dir ./build
|
||||
16
P4D2_2017_Fall/exercises/load_balance/topology.json
Normal file
16
P4D2_2017_Fall/exercises/load_balance/topology.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"hosts": [
|
||||
"h1",
|
||||
"h2",
|
||||
"h3"
|
||||
],
|
||||
"switches": {
|
||||
"s1": { "cli_input" : "s1-commands.txt" },
|
||||
"s2": { "cli_input" : "s2-commands.txt" },
|
||||
"s3": { "cli_input" : "s3-commands.txt" }
|
||||
},
|
||||
"links": [
|
||||
["h1", "s1"], ["s1", "s2"], ["s1", "s3"],
|
||||
["s3", "s2"], ["s2", "h2"], ["s3", "h3"]
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user