diff --git a/doc/plan.org b/doc/plan.org index dd121bb..0738494 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -467,6 +467,15 @@ 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 +INFO:main:unhandled reassambled=>> from table TABLE_V4_NETWORKS +**** TODO Solve logic problem: Valid headers +- If ipv6 header is valid && nat64 will be made and afterwards v4 egress needs to be applied +- If ipv4 header is valid && nat46 will be made and afterwards v6 egress needs to be applied + **** 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 971c30f..c2634d9 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -335,11 +335,16 @@ control MyIngress(inout headers hdr, apply { if(hdr.ipv6.isValid()) { icmp6.apply(); /* icmp6 echo, icmp6 ndp */ - nat64.apply(); /* translating */ + if(nat64.apply().hit) { /* translating */ + v4_networks.apply(); /* apply egress */ + exit; /* no further v6 processing */ + } v6_networks.apply(); /* egress / routing */ - } - if(hdr.ipv4.isValid()) { - nat46.apply(); /* v4->v6 */ + } else if(hdr.ipv4.isValid()) { + if(nat46.apply().hit) { /* v4->v6 */ + v6_networks.apply(); /* Now apply v6 egress */ + exit; /* no further v4 processing */ + } v4_networks.apply(); /* routing, egress */ } } diff --git a/pcap/static_nat64-2019-03-26-2107-h1.pcap b/pcap/static_nat64-2019-03-26-2107-h1.pcap new file mode 100644 index 0000000..8fb4a1e Binary files /dev/null and b/pcap/static_nat64-2019-03-26-2107-h1.pcap differ diff --git a/pcap/static_nat64-2019-03-26-2107-h3.pcap b/pcap/static_nat64-2019-03-26-2107-h3.pcap new file mode 100644 index 0000000..e69de29