Add checksum marker

This commit is contained in:
Nico Schottelius 2019-03-25 12:56:54 +01:00
parent 6f989617ff
commit 905f51fba3
2 changed files with 39 additions and 16 deletions

View file

@ -133,7 +133,9 @@
| | Writing down double LPM problem | | | | Writing down double LPM problem | |
| | Removing source network support, documenting limitation | | | | Removing source network support, documenting limitation | |
| | Rewriting code to use multiple NAT64 destinations | | | | Rewriting code to use multiple NAT64 destinations | |
| | New test.py v6_static_mapping tests | |
| | | | | | | |
| | Again checksum errors in NDP answer | |
| | | | | | | |
| | | | | | | |
| 2019-03-28 | Meet Laurent #4 | | | 2019-03-28 | Meet Laurent #4 | |
@ -317,15 +319,15 @@ p4@ubuntu:~/master-thesis$
**** Implement IPv4 side handling **** Implement IPv4 side handling
***** TODO Make switch answer icmp echo request for ***** TODO Make switch answer icmp echo request for
***** TODO Add default route for v4 hosts ***** TODO Add default route for v4 hosts
**** TODO Translate ipv6 --> ipv4 with a (freely programmable) prefix **** DONE Basis to translate ipv6 --> ipv4 with a (freely programmable) prefix; test ping6_switch
***** DONE Insert prefix into switch: v6_networks ***** DONE Insert prefix into switch: v6_networks
***** TODO Support multiple ipv6 source networks: need new table w/ 2 keys! -> later ***** DONE Support multiple ipv6 source networks: need new table w/ 2 keys! -> not at the moment
***** DONE Write test.py to generate correct destination packets ***** DONE Write test.py to generate correct destination packets
>>> a = ipaddress.ip_network("2001:db8::/32") >>> a = ipaddress.ip_network("2001:db8::/32")
>>> b = ipaddress.ip_address("10.0.0.1") >>> b = ipaddress.ip_address("10.0.0.1")
>>> a[int(b)] >>> a[int(b)]
IPv6Address('2001:db8::a00:1') IPv6Address('2001:db8::a00:1')
***** Using test.py, new NDP packets been seen, bur zero icmp on the outgoing side ***** DONE Using test.py, new NDP packets been seen, bur zero icmp on the outgoing side
p4@ubuntu:~/master-thesis/p4app$ python test.py --method v6_static_mapping --debug p4@ubuntu:~/master-thesis/p4app$ python test.py --method v6_static_mapping --debug
INFO:main:Trying to reach 10.0.0.1 (64:ff9b::a00:1) from h1 INFO:main:Trying to reach 10.0.0.1 (64:ff9b::a00:1) from h1
sudo: unable to resolve host ubuntu sudo: unable to resolve host ubuntu
@ -379,21 +381,42 @@ DEBUG:main:reassambled=<Ether dst=00:00:0a:00:00:42 src=00:00:0a:00:00:01 type=
****** Do we have routing for fe80::/10? Probably not. Shouldn't we see it in the controller then? ****** Do we have routing for fe80::/10? Probably not. Shouldn't we see it in the controller then?
****** NDP is controller only! ****** NDP is controller only!
***** TODO Finish NDP in switch ***** DONE Finish NDP in switch
****** TODO Need to set R/S/O bits ****** DONE Need to set R/S/O bits
****** TODO Need to parse R/S/O bits ****** DONE Need to parse R/S/O bits
***** TODO Maybe merge v6_address and v6_networks - /128 is the same ***** DONE Maybe merge v6_address and v6_networks - /128 is the same
***** TODO Implement address learning? ***** DONE Implement address learning? -> not at the moment
***** TODO Not sure whether we should react on router solicitation ***** DONE Not sure whether we should react on router solicitation -> not at the moment
- Using static routes -> should do the job - Using static routes -> should do the job
***** TODO Implement the calculation ***** DONE Implement the calculation
***** TODO Sketch the flow for session handling for icmp6 w/o packet loss Currently offset + ip address
***** DONE Sketch the flow for session handling for icmp6 w/o packet loss
- switch receives icmp6 packet for known prefix - switch receives icmp6 packet for known prefix
- controller needs to create session entry (?) - controller needs to create session entry (?)
**** TODO Translate icmp <-> icmp6 Not sure what I meant to do here - closing.
**** TODO Create table entry for mapping v4->v6 [net] ***** DONE Create table entry for mapping v4->v6 [net]
**** TODO Create table entry for mapping v6->v4 [net] ***** DONE Create table entry for mapping v6->v4 [net]
**** TODO Translate icmp <-> icmp6: test v6_static_mapping
***** try1: only packets on h1 + controller 2019-03-25
+ filename=static_nat64-2019-03-25-1121-h1.pcap
+ intf=h1-eth0
+ mx h1 tcpdump -ni h1-eth0 -w static_nat64-2019-03-25-1121-h1.pcap
tcpdump: listening on h1-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C10 packets captured
10 packets received by filter
0 packets dropped by kernel
DEBUG:main:reassambled=<Ether dst=33:33:ff:00:00:42 src=00:00:0a:00:00:01 type=0x86dd |<IPv6 version=6 tc=0 fl=0 plen=32 nh=ICMPv6 hlim=255 src=fe80::200:aff:fe00:1 dst=ff02::1:ff00:42 |<ICMPv6ND_NS type=Neighbor Solicitation code=0 cksum=0x37df res=0 tgt=2001:db8::42 |<ICMPv6NDOptSrcLLAddr type=1 len=1 lladdr=00:00:0a:00:00:01 |>>>>
DEBUG:main:reassambled=<Ether dst=33:33:ff:00:00:42 src=00:00:0a:00:00:01 type=0x86dd |<IPv6 version=6 tc=0 fl=0 plen=32 nh=ICMPv6 hlim=255 src=fe80::200:aff:fe00:1 dst=ff02::1:ff00:42 |<ICMPv6ND_NS type=Neighbor Solicitation code=0 cksum=0x37df res=0 tgt=2001:db8::42 |<ICMPv6NDOptSrcLLAddr type=1 len=1 lladdr=00:00:0a:00:00:01 |>>>>
DEBUG:main:reassambled=<Ether dst=33:33:ff:00:00:42 src=00:00:0a:00:00:01 type=0x86dd |<IPv6 version=6 tc=0 fl=0 plen=32 nh=ICMPv6 hlim=255 src=2001:db8::1 dst=ff02::1:ff00:42 |<ICMPv6ND_NS type=Neighbor Solicitation code=0 cksum=0x13a7 res=0 tgt=2001:db8::42 |<ICMPv6NDOptSrcLLAddr type=1 len=1 lladdr=00:00:0a:00:00:01 |>>>>
DEBUG:main:reassambled=<Ether dst=33:33:ff:00:00:42 src=00:00:0a:00:00:01 type=0x86dd |<IPv6 version=6 tc=0 fl=0 plen=32 nh=ICMPv6 hlim=255 src=2001:db8::1 dst=ff02::1:ff00:42 |<ICMPv6ND_NS type=Neighbor Solicitation code=0 cksum=0x13a7 res=0 tgt=2001:db8::42 |<ICMPv6NDOptSrcLLAddr type=1 len=1 lladdr=00:00:0a:00:00:01 |>>>>
DEBUG:main:reassambled=<Ether dst=33:33:ff:00:00:42 src=00:00:0a:00:00:01 type=0x86dd |<IPv6 version=6 tc=0 fl=0 plen=32 nh=ICMPv6 hlim=255 src=2001:db8::1 dst=ff02::1:ff00:42 |<ICMPv6ND_NS type=Neighbor Solicitation code=0 cksum=0x13a7 res=0 tgt=2001:db8::42 |<ICMPv6NDOptSrcLLAddr type=1 len=1 lladdr=00:00:0a:00:00:01 |>>>>
That looks like NDP is not working again. Why: checksum seems to be
incorrect according to wireshark. Why? Checksum is the SAME as in the
request -> probably not updated.
*** TODO Get p4 VM / vagrant running *** TODO Get p4 VM / vagrant running
**** DONE install libvirtd-daemon **** DONE install libvirtd-daemon
**** DONE install ebtables **** DONE install ebtables

View file

@ -16,7 +16,7 @@ control MyIngress(inout headers hdr,
inout metadata meta, inout metadata meta,
inout standard_metadata_t standard_metadata) { inout standard_metadata_t standard_metadata) {
/********************** ACTIONS ***********************************/ /********************** GENERAL ACTIONS ***********************************/
action drop() { action drop() {
mark_to_drop(); mark_to_drop();
@ -172,7 +172,7 @@ control MyIngress(inout headers hdr,
/* 2. ICMP6 changes */ /* 2. ICMP6 changes */
hdr.icmp6.type = ICMP6_NA; hdr.icmp6.type = ICMP6_NA;
hdr.icmp6.code = 0; hdr.icmp6.code = 0;
// checksum is calculated in deparser hdr.icmp6.checksum = 42; // checksum is calculated in deparser - marking with 42 to see whether it is calculated
/* 3. icmp6/neighbor advertisement: values taken from real world answers */ /* 3. icmp6/neighbor advertisement: values taken from real world answers */
hdr.icmp6_na_ns.router = 0; hdr.icmp6_na_ns.router = 0;