diff --git a/doc/plan.org b/doc/plan.org index a09c1b4..dd121bb 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -138,6 +138,8 @@ | | Again checksum errors in NDP answer | | | | Added debug code to send table ID towards controller | | | | | | +| 2019-03-26 | | | +| | Find out where packet is stuck | | | | | | | 2019-03-28 | Meet Laurent #4 | | | | - Router solicitation for finding router on startup! | | @@ -174,16 +176,6 @@ | 2019-08-01 | Latest start writing documentation | | | 2019-08-21 | hand in thesis | | * Topics / Tasks -** Admin -*** DONE Clarify PDF / form with Denise Spicher: free form description -*** TODO Create task description to be handed in mystudies -*** DONE Create list of tasks / initial brainstorming -*** TODO Get OK from Ueli Maurer that thesis is valid in Information Security Area -*** TODO Find out how-when-whom-where to meet / define schedule -*** TODO Latex and/or org-mode for the thesis? -*** TODO Add initial milestones -**** 180d plan -**** 25w ** Thesis implementation *** DONE Setup test VM for P4: 2a0a:e5c0:2:12:400:f0ff:fea9:c3e3 *** DONE Get feature list of jool @@ -191,7 +183,121 @@ *** DONE Setup P4 base / structure *** DONE Create minimal controller for populating tables *** DONE Checkout / review egress settings +*** DONE Create Basis to translate ipv6 --> ipv4 with a (freely programmable) prefix; test ping6_switch +**** DONE Insert prefix into switch: v6_networks +**** 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 +>>> a = ipaddress.ip_network("2001:db8::/32") +>>> b = ipaddress.ip_address("10.0.0.1") +>>> a[int(b)] +IPv6Address('2001:db8::a00:1') +**** 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 +INFO:main:Trying to reach 10.0.0.1 (64:ff9b::a00:1) from h1 +sudo: unable to resolve host ubuntu +PING 64:ff9b::a00:1(64:ff9b::a00:1) 56 data bytes + +--- 64:ff9b::a00:1 ping statistics --- +1 packets transmitted, 0 received, 100% packet loss, time 0ms + +p4@ubuntu:~/master-thesis/p4app$ +\x00\x00\x00 :\xff\xfe\x80\x00\x00\x00\x00\x00\x00\x02\x00\n\xff\xfe\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B\x87\x00\x08+\x00\x00\x00\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B\x01\x01\x00\x00\n\x00\x00\x01' |>> +DEBUG:main:cpu = > +DEBUG:main:reassambled=>>> +DEBUG:main:INCOMING: > +DEBUG:main:cpu = > +DEBUG:main:reassambled=>>> +DEBUG:main:INCOMING: > +DEBUG:main:cpu = > +DEBUG:main:reassambled=>>> + +**** DONE Debug why neighbor discover does not work anymore +***** log +p4@ubuntu:~$ mx h1 tcpdump -lni any +sudo: unable to resolve host ubuntu +tcpdump: verbose output suppressed, use -v or -vv for full protocol decode +listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes + +19:57:53.258805 IP6 fe80::200:aff:fe00:1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8::42, length 32 +19:57:54.256924 IP6 2001:db8::1 > 2001:db8::1: ICMP6, destination unreachable, unreachable address 64:ff9b::a00:1, length 112 + +EBUG:main:INCOMING: > +DEBUG:main:cpu = > +DEBUG:main:reassambled=>>> +INFO:main:Doing neighbor solicitation +DEBUG:main:OUTGOING: >>> +DEBUG:main:INCOMING: >>> + + +After removing noise: + +DEBUG:main:reassambled=>>> +DEBUG:main:reassambled=>>> +DEBUG:main:reassambled=>>> +DEBUG:main:reassambled=>>> +DEBUG:main:reassambled=>>> + +***** Do we have routing for fe80::/10? Probably not. Shouldn't we see it in the controller then? +***** NDP is controller only! +**** DONE Finish NDP in switch +***** DONE Need to set R/S/O bits +***** DONE Need to parse R/S/O bits +**** DONE Maybe merge v6_address and v6_networks - /128 is the same +**** DONE Implement address learning? -> not at the moment +**** DONE Not sure whether we should react on router solicitation -> not at the moment + - Using static routes -> should do the job +**** DONE Implement the calculation +Currently offset + ip address +**** DONE Sketch the flow for session handling for icmp6 w/o packet loss + - switch receives icmp6 packet for known prefix + - controller needs to create session entry (?) + +Not sure what I meant to do here - closing. +**** DONE Create table entry for mapping v4->v6 [net] +**** DONE Create table entry for mapping v6->v4 [net] *** TODO Implement ICMP <-> ICMP6 translation +**** 2019-02-28 / icmp testing / first NDP steps +***** pinging in router mode: nothing shown in the controller, multicast forwarded -> "ok" + + root@ubuntu:~/master-thesis/p4app# ping6 -c1 2001:db8:61::42 + PING 2001:db8:61::42(2001:db8:61::42) 56 data bytes + From 2001:db8:61::1 icmp_seq=1 Destination unreachable: Address unreachable + + --- 2001:db8:61::42 ping statistics --- + 1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms + + root@ubuntu:~/master-thesis/p4app# + + + sudo: unable to resolve host ubuntu + tcpdump: verbose output suppressed, use -v or -vv for full protocol decode + listening on h1-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes + 09:47:07.191569 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 + 09:47:08.190331 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 + 09:47:09.190279 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 +***** DONE special rule for ff02::1:ff00:42 + + Semi works, replies are there, but host still retries: + + p4@ubuntu:~/master-thesis$ h=1; mx h$h tcpdump -lni h$h-eth0 + sudo: unable to resolve host ubuntu + tcpdump: verbose output suppressed, use -v or -vv for full protocol decode + listening on h1-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes + 09:58:04.786979 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 + 09:58:04.793560 IP6 2001:db8:61::42 > 2001:db8:61::1: ICMP6, neighbor advertisement, tgt is 2001:db8:61::42, length 32 + 09:58:05.786311 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 + 09:58:05.790506 IP6 2001:db8:61::42 > 2001:db8:61::1: ICMP6, neighbor advertisement, tgt is 2001:db8:61::42, length 32 + 09:58:06.786254 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 + 09:58:06.792325 IP6 2001:db8:61::42 > 2001:db8:61::1: ICMP6, neighbor advertisement, tgt is 2001:db8:61::42, length 32 + + + Maybe checksums? **** DONE Parse icmp **** DONE Parse icmpv6 **** DONE Add (static) egress configuration @@ -317,88 +423,7 @@ sudo: unable to resolve host ubuntu fe80::/64 dev h1-eth0 proto kernel metric 256 pref medium default via 2001:db8::42 dev h1-eth0 metric 1024 pref medium p4@ubuntu:~/master-thesis$ -**** Implement IPv4 side handling -***** TODO Make switch answer icmp echo request for -***** TODO Add default route for v4 hosts -**** DONE Basis to translate ipv6 --> ipv4 with a (freely programmable) prefix; test ping6_switch -***** DONE Insert prefix into switch: v6_networks -***** 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 ->>> a = ipaddress.ip_network("2001:db8::/32") ->>> b = ipaddress.ip_address("10.0.0.1") ->>> a[int(b)] -IPv6Address('2001:db8::a00:1') -***** 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 -INFO:main:Trying to reach 10.0.0.1 (64:ff9b::a00:1) from h1 -sudo: unable to resolve host ubuntu -PING 64:ff9b::a00:1(64:ff9b::a00:1) 56 data bytes - ---- 64:ff9b::a00:1 ping statistics --- -1 packets transmitted, 0 received, 100% packet loss, time 0ms - -p4@ubuntu:~/master-thesis/p4app$ -\x00\x00\x00 :\xff\xfe\x80\x00\x00\x00\x00\x00\x00\x02\x00\n\xff\xfe\x00\x00\x01 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B\x87\x00\x08+\x00\x00\x00\x00 \x01\r\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B\x01\x01\x00\x00\n\x00\x00\x01' |>> -DEBUG:main:cpu = > -DEBUG:main:reassambled=>>> -DEBUG:main:INCOMING: > -DEBUG:main:cpu = > -DEBUG:main:reassambled=>>> -DEBUG:main:INCOMING: > -DEBUG:main:cpu = > -DEBUG:main:reassambled=>>> - -***** DONE Debug why neighbor discover does not work anymore -****** log - p4@ubuntu:~$ mx h1 tcpdump -lni any - sudo: unable to resolve host ubuntu - tcpdump: verbose output suppressed, use -v or -vv for full protocol decode - listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes - - 19:57:53.258805 IP6 fe80::200:aff:fe00:1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8::42, length 32 - 19:57:54.256924 IP6 2001:db8::1 > 2001:db8::1: ICMP6, destination unreachable, unreachable address 64:ff9b::a00:1, length 112 - - EBUG:main:INCOMING: > - DEBUG:main:cpu = > - DEBUG:main:reassambled=>>> - INFO:main:Doing neighbor solicitation - DEBUG:main:OUTGOING: >>> - DEBUG:main:INCOMING: >>> - - - After removing noise: - - DEBUG:main:reassambled=>>> - DEBUG:main:reassambled=>>> - DEBUG:main:reassambled=>>> - DEBUG:main:reassambled=>>> - DEBUG:main:reassambled=>>> - -****** Do we have routing for fe80::/10? Probably not. Shouldn't we see it in the controller then? -****** NDP is controller only! -***** DONE Finish NDP in switch -****** DONE Need to set R/S/O bits -****** DONE Need to parse R/S/O bits -***** DONE Maybe merge v6_address and v6_networks - /128 is the same -***** DONE Implement address learning? -> not at the moment -***** DONE Not sure whether we should react on router solicitation -> not at the moment - - Using static routes -> should do the job -***** DONE Implement the calculation -Currently offset + ip address -***** DONE Sketch the flow for session handling for icmp6 w/o packet loss - - switch receives icmp6 packet for known prefix - - controller needs to create session entry (?) - -Not sure what I meant to do here - closing. -***** DONE Create table entry for mapping v4->v6 [net] -***** DONE Create table entry for mapping v6->v4 [net] -**** TODO Translate icmp <-> icmp6: test v6_static_mapping +**** TODO ping6ing an emulated ipv6 host / Translate icmp <-> icmp6: test v6_static_mapping ***** DONE try1: only packets on h1 + controller -> wrong checksum 2019-03-25 + filename=static_nat64-2019-03-25-1121-h1.pcap + intf=h1-eth0 @@ -422,7 +447,7 @@ that the checksum code DOES NOT work on the task field! Problem: task field might be overriden for controller use in different table -> need different task field! -***** try2: checksum ok, but no packets on h3 +***** TODO try2: checksum ok, but no packets on h3 ****** DONE Setup a default rule for the IPv4 world to debug on controller Still not seeing the converted packet, however seeing icmp6_ns packets which should not be there: @@ -441,7 +466,9 @@ DEBUG:main:v6 reassambled= "ok" - -root@ubuntu:~/master-thesis/p4app# ping6 -c1 2001:db8:61::42 -PING 2001:db8:61::42(2001:db8:61::42) 56 data bytes -From 2001:db8:61::1 icmp_seq=1 Destination unreachable: Address unreachable - ---- 2001:db8:61::42 ping statistics --- -1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms - -root@ubuntu:~/master-thesis/p4app# - - -sudo: unable to resolve host ubuntu -tcpdump: verbose output suppressed, use -v or -vv for full protocol decode -listening on h1-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes -09:47:07.191569 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 -09:47:08.190331 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 -09:47:09.190279 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 -*** TODO special rule for ff02::1:ff00:42 - -Semi works, replies are there, but host still retries: - -p4@ubuntu:~/master-thesis$ h=1; mx h$h tcpdump -lni h$h-eth0 -sudo: unable to resolve host ubuntu -tcpdump: verbose output suppressed, use -v or -vv for full protocol decode -listening on h1-eth0, link-type EN10MB (Ethernet), capture size 262144 bytes -09:58:04.786979 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 -09:58:04.793560 IP6 2001:db8:61::42 > 2001:db8:61::1: ICMP6, neighbor advertisement, tgt is 2001:db8:61::42, length 32 -09:58:05.786311 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 -09:58:05.790506 IP6 2001:db8:61::42 > 2001:db8:61::1: ICMP6, neighbor advertisement, tgt is 2001:db8:61::42, length 32 -09:58:06.786254 IP6 2001:db8:61::1 > ff02::1:ff00:42: ICMP6, neighbor solicitation, who has 2001:db8:61::42, length 32 -09:58:06.792325 IP6 2001:db8:61::42 > 2001:db8:61::1: ICMP6, neighbor advertisement, tgt is 2001:db8:61::42, length 32 - - -Maybe checksums? + As the IPv4 header does not allow embedding IPv6 addresses due to size + limitations, embedding the destination address in a secondary header + might be necessary (possibly encapsulated in UDP). diff --git a/p4app/controller.py b/p4app/controller.py index b9ca3ad..0d46fe6 100755 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -491,7 +491,10 @@ if __name__ == "__main__": import sys import os + sw_name = "s1" + controller = L2Controller(sw_name) controller.commandline() + if controller.args.debug: log.setLevel(logging.DEBUG) elif controller.args.verbose: @@ -502,9 +505,6 @@ if __name__ == "__main__": log.info("Booting...") log.debug("Debug enabled.") - sw_name = "s1" - controller = L2Controller(sw_name) - controller.config() controller.run_cpu_port_loop()