Updates to basic_tunnel and basic (#78)

* Adding initial implementation of basic_encap example

* Updated basic_encap example to count the number of valid packets

* Updated basic_encap example to put encapsulation layer after Ethernet
header.

* Added solution file for basic_encap example

* Changed the name of the basic_encap example to basic_tunnel and called
the new header myTunnel. Also changed the myTunnel field names slightly.

* Updated the README file for the basic_tunnel exercise. Also added topo.pdf
image to serve as a reference during implementation.

* Updated basic/README.md to point to basic_tunnel as the next exercise.

* Updated the README for basic to point to basic_tunnel.

Updated the starter code for basic_tunnel to look like basic
solution with todo comments.

Updated send.py and receive.py to be able to send both plain IP
packets and tunneled IP packets.

Updated basic_tunnel.p4 to have same control flow as p4runtime
exercise.
This commit is contained in:
sibanez12
2017-11-03 21:03:06 -07:00
committed by Robert Soule
parent 66c2cba1b5
commit 6c82b6fbe7
8 changed files with 128 additions and 125 deletions

View File

@@ -143,11 +143,15 @@ control MyIngress(inout headers hdr,
}
apply {
if (hdr.myTunnel.isValid()) {
myTunnel_exact.apply();
} else if (hdr.ipv4.isValid()) {
if (hdr.ipv4.isValid() && !hdr.myTunnel.isValid()) {
// Process only non-tunneled IPv4 packets
ipv4_lpm.apply();
}
if (hdr.myTunnel.isValid()) {
// process tunneled packets
myTunnel_exact.apply();
}
}
}