From 236bd8e7d68c24faead46f388600ba3f424e7918 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 25 Mar 2019 13:09:29 +0100 Subject: [PATCH] Debug send ipv4 packets to controller --- doc/plan.org | 5 ++++- p4app/controller.py | 4 ++-- p4src/static-mapping.p4 | 8 +++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/plan.org b/doc/plan.org index 0ce8e37..d588a2c 100644 --- a/doc/plan.org +++ b/doc/plan.org @@ -398,7 +398,7 @@ 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 -***** try1: only packets on h1 + controller 2019-03-25 +***** DONE try1: only packets on h1 + controller -> wrong checksum 2019-03-25 + filename=static_nat64-2019-03-25-1121-h1.pcap + intf=h1-eth0 + mx h1 tcpdump -ni h1-eth0 -w static_nat64-2019-03-25-1121-h1.pcap @@ -421,6 +421,9 @@ 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 +****** Setup a default rule for the IPv4 world to debug on controller + *** TODO Get p4 VM / vagrant running **** DONE install libvirtd-daemon **** DONE install ebtables diff --git a/p4app/controller.py b/p4app/controller.py index 957e84b..79ccb53 100755 --- a/p4app/controller.py +++ b/p4app/controller.py @@ -421,12 +421,12 @@ class L2Controller(object): def recv_msg_cpu(self, pkg): packet = Ether(str(pkg)) - # self.debug_print_pkg(pkg) + if packet.type == 0x0800: pass elif packet.type == 0x86dd: - pass + self.debug_print_pkg(pkg) elif packet.type == 0x4242: cpu_header = CpuHeader(packet.payload) diff --git a/p4src/static-mapping.p4 b/p4src/static-mapping.p4 index 70b5bb3..fb8f384 100644 --- a/p4src/static-mapping.p4 +++ b/p4src/static-mapping.p4 @@ -27,9 +27,7 @@ control MyIngress(inout headers hdr, } action controller_debug() { - meta.task = TASK_DEBUG; - meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, meta); + controller_reply(TASK_DEBUG); } action controller_reply(task_t task) { @@ -308,7 +306,6 @@ control MyIngress(inout headers hdr, NoAction; } size = ROUTING_TABLE_SIZE; -// default_action = NoAction; default_action = controller_debug; } @@ -318,10 +315,11 @@ control MyIngress(inout headers hdr, } actions = { set_egress_port; + controller_debug; NoAction; } size = ROUTING_TABLE_SIZE; - default_action = NoAction; + default_action = controller_debug; } /********************** APPLYING TABLES ***********************************/