From 0ca0b94b1cd5d525d4ef06de6913ba1d2f455bd0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Mar 2019 13:12:06 +0100 Subject: [PATCH] +notes; Try shifting the cast into the parser --- doc/plan.org | 23 +++++++++++++++++++---- p4src/checksums.p4 | 4 +--- p4src/headers.p4 | 1 + p4src/parsers.p4 | 1 + 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index 47688cc..bd75a4f 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -67,6 +67,21 @@ | | - P4 checksum_with_payload | | | | - Reading scapy / inet6 | | | | - Further checksum tests -> required everywhere in IPv6 | | +| | - (partial) NDP working in controller | | +| | - icmp6 echo request working in controller | | +| | - Hosts can ping6 the switch | | +| | - Ran into P4 casting bug: https://github.com/p4lang/p4c/issues/1765 | | +| | | | +| | Next target: | | +| | - Focus on enabling the "Internet" with ICMP6 translation | | +| | | | +| | Next steps: | | +| | - Investigate again into checksumming with payload in P4 | | +| | - Answering icmp6 echo request *in* in the switch | | +| | - Translate icmp6 to icmp | | +| | - Translate icmp to icmp6 | | +| | | | +| | | | | | | | | | | | | 2019-03-08 | NAT46 1:1 table ICMP, ICMPv6 working | | @@ -113,10 +128,10 @@ **** DONE Parse icmp **** DONE Parse icmpv6 **** DONE Add (static) egress configuration -**** TODO Calculate ICMP6 checksums +**** DONE Calculate ICMP6 checksums in controller ***** Need to include the payload!?!! -**** TODO Implement minimal neighbor discovery -***** TODO For the switch +**** DONE Implement minimal neighbor discovery in controller +***** DONE For the switch ****** DONE Register IPv6 address in table ****** DONE Parse ICMPv6 up to neighbor solicitation -> no: checksum problem ****** DONE Use NDP (Neighbor Solicitation (NDP) , Neighbor Advertisement (NDP)) -> no: controller @@ -165,7 +180,7 @@ multicast address of the target address." ******* associate the "node" with the multicast group ID ***** If destination is within ff02::1:ff00:0/104, multicast -**** TODO Make switch answer icmp6 echo request for +**** DONE Make switch answer icmp6 echo request for **** TODO Make switch answer icmp echo request for **** TODO Add default route for v6 and v4 hosts **** TODO Translate icmp <-> icmp6 diff --git a/p4src/checksums.p4 b/p4src/checksums.p4 index 6f087da..3af0f81 100644 --- a/p4src/checksums.p4 +++ b/p4src/checksums.p4 @@ -21,13 +21,11 @@ control MyVerifyChecksum(inout headers hdr, inout metadata meta) { control MyComputeChecksum(inout headers hdr, inout metadata meta) { apply { - bit<32> icmp6_len = (bit<32>) hdr.ipv6.payload_length; - update_checksum_with_payload(meta.calc_icmp6_checksum, { hdr.ipv6.src_addr, /* 128 */ hdr.ipv6.dst_addr, /* 128 */ - icmp6_len, /* 32 */ + meta.cast_length, /* 32 */ 24w0, /* 24 0's */ PROTO_ICMP6 /* 8 */ }, diff --git a/p4src/headers.p4 b/p4src/headers.p4 index 165a850..3f64313 100644 --- a/p4src/headers.p4 +++ b/p4src/headers.p4 @@ -133,6 +133,7 @@ struct metadata { port_t ingress_port; task_t task; bit<16> tcp_length; + bit<32> cast_length; bool calc_icmp6_checksum; } diff --git a/p4src/parsers.p4 b/p4src/parsers.p4 index 4988ede..72bf8e6 100644 --- a/p4src/parsers.p4 +++ b/p4src/parsers.p4 @@ -37,6 +37,7 @@ parser MyParser(packet_in packet, state ipv6 { packet.extract(hdr.ipv6); meta.tcp_length = hdr.ipv6.payload_length; + meta.cast_length = () hdr.ipv6.payload_length; transition select(hdr.ipv6.next_header){ PROTO_TCP: tcp;