using odd veths for packet injection and sniffing in examples

This commit is contained in:
Antonin Bas
2015-11-15 21:36:45 -08:00
parent ca39826949
commit e81db93021
5 changed files with 7 additions and 7 deletions

View File

@@ -24,9 +24,9 @@ We provide a small demo to let you test the program. It consists of the
following scripts:
- [run_switch.sh] (run_switch.sh): compile the P4 program and starts the switch,
also configures the data plane by running the CLI [commands] (commands.txt)
- [receive.py] (receive.py): sniff packets on port 3 (veth6) and print a hexdump
- [receive.py] (receive.py): sniff packets on port 3 (veth7) and print a hexdump
of them
- [send_one.py] (send_one.py): send one simple IPv4 packet on port 0 (veth0)
- [send_one.py] (send_one.py): send one simple IPv4 packet on port 0 (veth1)
If you take a look at [commands.txt] (commands.txt), you'll notice the following
command: `mirroring_add 250 3`. This means that all the cloned packets with

View File

@@ -1,3 +1,3 @@
from scapy.all import *
sniff(iface = "veth6", prn = lambda x: hexdump(x))
sniff(iface = "veth7", prn = lambda x: hexdump(x))

View File

@@ -3,4 +3,4 @@ from scapy.all import *
p = Ether(dst="aa:bb:cc:dd:ee:ff") / IP(dst="10.0.1.10") / TCP() / "aaaaaaaaaaaaaaaaaaa"
# p.show()
hexdump(p)
sendp(p, iface = "veth0")
sendp(p, iface = "veth1")