add bin/ with test script for sending 1 packet

This commit is contained in:
Nico Schottelius 2019-06-04 19:41:57 +02:00
parent 5e10401f96
commit ead0276527
2 changed files with 51 additions and 1 deletions

21
bin/send_packet.py Normal file
View file

@ -0,0 +1,21 @@
#!/usr/bin/python3
import sys
from scapy.all import *
if __name__ == '__main__':
iface = sys.argv[1]
e = Ether(src="02:53:55:42:45:01",
dst='ff:ff:ff:ff:ff:ff')
i = IPv6(src = "2001:db8:42::1",
dst = "2001:db8::2")
t = TCP(dport=80, sport=random.randint(49152,65535))
d = "A"
pkg = e / i / t / d
sendp(pkg, iface=iface, verbose=True)

View file

@ -2899,7 +2899,7 @@ SimpleSumeSwitch(
**** TODO mirroring ethernet
***** no packets seen on source interface
**** TODO sending data to switch port 1
***** figuring out which is port 1: nf0
***** DONE figuring out which is port 1: nf0
expected
actual
@ -2914,6 +2914,35 @@ actual
< 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000040010000 >
< 0000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000001010000 >
***** TODO Testing packets: does not arrive on nf0
4: nf0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:53:55:4d:45:00 brd ff:ff:ff:ff:ff:ff
inet6 fe80::53:55ff:fe4d:4500/64 scope link
valid_lft forever preferred_lft forever
5: nf1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 02:53:55:4d:45:01 brd ff:ff:ff:ff:ff:ff
inet6 2001:db8::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::53:55ff:fe4d:4501/64 scope link
valid_lft forever preferred_lft forever
6: nf2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:53:55:4d:45:02 brd ff:ff:ff:ff:ff:ff
7: nf3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 02:53:55:4d:45:03 brd ff:ff:ff:ff:ff:ff
root@rainbow:~# tcpdump -ni nf0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on nf0, link-type EN10MB (Ethernet), capture size 262144 bytes
[19:27] rainbow:~% sudo -i
root@rainbow:~# tcpdump -ni nf1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on nf1, link-type EN10MB (Ethernet), capture size 262144 bytes
19:28:36.720431 IP6 2001:db8::1 > ff02::1:ff00:2: ICMP6, neighbor solicitation, who has 2001:db8::2, length 32
19:28:37.725181 IP6 2001:db8::1 > ff02::1:ff00:2: ICMP6, neighbor solicitation, who has 2001:db8::2, length 32
19:28:38.749195 IP6 2001:db8::1 > ff02::1:ff00:2: ICMP6, neighbor solicitation, who has 2001:db8::2, length 32
*** TODO Create either HDL or PX for supporting payload checksum
https://github.com/NetFPGA/P4-NetFPGA-public/issues/13
https://github.com/NetFPGA/P4-NetFPGA-public/issues/13#issuecomment-490431016