Hello everyone,
I am working on a project using Mininet, BMv2 (simple_switch_grpc), and P4Runtime. My goal is to migrate from static table configuration (using s1-runtime.json files loaded at startup) to a dynamic Python controller.
The Problem: When I use the static JSON files, connectivity works fine (pingall succeeds). However, when I clear the static configuration and try to insert the exact same table entries using my Python P4Runtime script, the packets are dropped by the switch.
My Setup:
-
Topology: Simple linear or pod topology (h1 connected to s1).
-
P4 Program: Basic L3 forwarding. It has an
ipv4_lpmtable for routing and anipv4_srctable with adirect_counterfor stats. -
Controller: Python script using
p4runtime_lib.
P4 Snippet (Ingress):
**
table ipv4_lpm {
key = { hdr.ipv4.dstAddr: lpm; }
actions = { ipv4_forward; drop; NoAction; }
size = 1024;
default_action = NoAction();
}
Python Controller Logic:** I am connecting to the switch and inserting a forwarding rule for h2 (10.0.2.2):
Building the entry for dst=10.0.2.2 → output_port=2
table_entry = p4info_helper.buildTableEntry(
table_name=“MyIngress.ipv4_lpm”,
match_fields={
“hdr.ipv4.dstAddr”: [“10.0.2.2”, 32]
},
action_name=“MyIngress.ipv4_forward”,
action_params={
“dstAddr”: “00:00:00:00:02:00”,
“port”: 2
}
)
s1.WriteTableEntry(table_entry)
Behavior:
-
I run
h1 ping h2. -
The entry is successfully written to the switch (no errors in Python output).
-
However, ping fails.
My Question: Is it possible that I am missing the reverse path rule (for 10.0.1.1), causing the Echo Reply to be dropped? Or does P4Runtime require explicit handling of ARP packets if the static ARP entries from Mininet are not sufficient?
Any guidance on debugging P4Runtime table misses would be appreciated.
Thank you!