diff --git a/doc/plan.org b/doc/plan.org index 0738494..8affa87 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -467,7 +467,7 @@ DEBUG:main:v6 reassambled=>>> from table TABLE_V6_NETWORKS INFO:main:unhandled reassambled=>>> from table TABLE_V6_NETWORKS INFO:main:unhandled reassambled=>>> from table TABLE_NAT64 @@ -475,7 +475,13 @@ INFO:main:unhandled reassambled= pings h3 +***** DONE egress is correct, comes out at h3 +***** TODO protocol 58 is wrong -> should be 1 +**** TODO transform protocol specific: icmp6 -> icmp +**** TODO transform protocol specific: icmp -> icmp6 **** TODO Make switch answer IPv4 icmp echo request for **** TODO Add / check default route for v4 hosts *** TODO Get p4 VM / vagrant running diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index af00b49..0c52d42 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -71,11 +71,25 @@ control MyIngress(inout headers hdr, hdr.ipv4.src_addr = src; hdr.ipv4.ttl = hdr.ipv6.hop_limit; + hdr.ipv4.protocol = hdr.ipv6.next_header; + switch(hdr.ipv6.next_header) { + PROTO_ICMP6: { + nat64_icmp6; + } + } + hdr.ipv6.setInvalid(); } + action nat64_icmp6() + { + + hdr.ipv4.protocol = PROTO_ICMP; // overwrite generic same protocol assumption + + } + /* NAT46: protocol unspecific changes */ action nat46_generic(ipv6_addr_t src, ipv6_addr_t dst) { hdr.ipv6.setValid(); @@ -383,7 +397,4 @@ MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser() -) main; - - - // truncate((bit<32>)22); //ether+cpu header +) main; \ No newline at end of file