Updating check_switch_started in p4runtime_switch.py (#85)

The previous implementation had a race conditiona between the
socket check and the BMv2 startup. Sometimes, if the check happen
just before (or as) BMv2 was trying to bind the port, it would
not be able to bind it. This solution uses psutil's equivalent
to 'netstat' to determine whether is BMv2 has bound the port yet.

Also, some minor README and comment improvements.
This commit is contained in:
Brian O'Connor
2017-11-08 11:48:15 -08:00
committed by Robert Soule
parent b2161b8a27
commit b41473fcc0
4 changed files with 40 additions and 20 deletions

View File

@@ -5,7 +5,7 @@
In this exercise, we will be using P4 Runtime to send flow entries to the
switch instead of using the switch's CLI. We will be building on the same P4
program that you used in the [basic_tunnel](../basic_tunnel) exercise. The
P4 program has be renamed to `advanced_tunnel.py` and has been augmented
P4 program has been renamed to `advanced_tunnel.py` and has been augmented
with two counters (`ingressTunnelCounter`, `egressTunnelCounter`) and
two new actions (`myTunnel_ingress`, `myTunnel_egress`).
@@ -20,7 +20,7 @@ necessary to tunnel traffic between host 1 and 2.
## Step 1: Run the (incomplete) starter code
The starter code for this assignment is in a file called `mycontroller.py`,
and it will install only some of the rules that you need tunnel traffic between
and it will install only some of the rules that you need to tunnel traffic between
two hosts.
Let's first compile the new P4 program, start the network, use `mycontroller.py`