Class project at Johns Hopkins University: Implement Netchains using P4 and Python
- Execute
run_demo.sh
to start the Mininet CLI - Type
xterm h1
(you can substitute h1 with h2 or h3) - Execute
kv.py h1
on the xterm (again, substituting h1 with whatever host you're using). - Allowed commands are
put [key] [value]
andget [key]
. Use ctrl+C to exit.
Dr. Jin said during his office hour on May 8 to insert the keys in initialization time, since doing otherwise is difficult with how Mininet works. As a result, only keys between 0 to 199 are supported, so that starting up the demo wouldn't take a long time.
I didn't do the switch failure detection/recovery part.
- make_commands.py: Used to generate the command text files. Can be executed without command line arguments
- route.py: Setting up NetChain. Near the top are the hard-coded values of max_key and nb_vnodes that can be changed if needed. If they are changed, make_commands.py needs to be re-executed.
- topo.txt: The network setup
- topo.py: I've added a couple lines so that different switches receive different commands.
- kv.py: Sending and receiving packets that interacts with the NetChain key-value store.
- run_demo.sh: I was given this file from other parts of the assignment and I didn't touch it.
- p4src/source_routing.p4: P4 code that controls the router