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

@@ -6,7 +6,7 @@ import os
from scapy.all import sniff, sendp, hexdump, get_if_list, get_if_hwaddr
from scapy.all import Packet, IPOption
from scapy.all import ShortField, IntField, LongField, BitField, FieldListField, FieldLenField
from scapy.all import IP, UDP, Raw
from scapy.all import IP, TCP, UDP, Raw
from scapy.layers.inet import _IPOption_HDR
from myTunnel_header import MyTunnel
@@ -23,7 +23,7 @@ def get_if():
return iface
def handle_pkt(pkt):
if MyTunnel in pkt:
if MyTunnel in pkt or (TCP in pkt and pkt[TCP].dport == 1234):
print "got a packet"
pkt.show2()
# hexdump(pkt)