From 5f946ff6b6b527c3766b5a33b44359ce15230368 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 26 Mar 2019 21:13:34 +0000 Subject: [PATCH] +pcap: static_nat64-2019-03-26-2107-h1.pcap --- doc/plan.org | 9 +++++++++ p4src/static-mapping.p4 | 13 +++++++++---- pcap/static_nat64-2019-03-26-2107-h1.pcap | Bin 0 -> 856 bytes pcap/static_nat64-2019-03-26-2107-h3.pcap | 0 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 pcap/static_nat64-2019-03-26-2107-h1.pcap create mode 100644 pcap/static_nat64-2019-03-26-2107-h3.pcap 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 0000000000000000000000000000000000000000..8fb4a1ecfac704c750eafb0189b275feebf61339 GIT binary patch literal 856 zcmca|c+)~A1{MYcU}0bcawbig74uM*jlm7b24Q1kAi>1Iz{SA8*mgGo$YBt$`v0#1 z!~jWf{r?A)`43cq1ejVG(se+5Mxc=(ogaaw-UFH%1{4EfW8?n}3{EJfD&RGh5v0DI z!TdhRR0T%f9UvMCoRDqVXidl#blvEF>0ns;G685bx;iF^Uz|XGd1*_?7IagQLWpR; zNV*cT1C$FHWq^zQ orLCi@r*B|rWNcz;W)6xsw|G+hitefohQ^HvKwHtoonWa00Nz806951J literal 0 HcmV?d00001 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