P4PI Testing over Ethernet

Hello, I’m new to P4PI.
I would like to test P4 applications over Ethernet as I noticed some issues with WiFi access point.
A simple ping (ping the P4PI over Ethernet) or loopback example (send Ethernet frame to P4 program and the P4 program sends it back to original PC )
Can you please guide me through the needed steps to connect the P4 program to the Ethernet port?


I am sorry that I have not practiced too much with P4PI so far, but while we wait for an answer, I will link this to your post at P4PI Github issues just in case it gets answered there.



Are you testing with the T4P4S or BMv2 in P4Pi? I tried with BMv2 in P4Pi via Ethernet connection and had some notes below.
1. Setup ethernet port with static ip on your PC
2. Setup static arp (arp -s )
3. Setup static ip on p4pi eth1/2 in same subnet as your PC
4. Route add -host <end device ip/32> eth1/2 on P4Pi
5. Check if P4Pi can ping your PC from eth1/2
6. Run p4 json file (simple_switch with p4runtime thriftport enabled) by open a new putty ssh and run runtime cli at root & add fwd commands from runtime:
root@p4pi:~# python3 runtime_CLI.py --thrift-port 9090
Obtaining JSON from switch…
Control utility for runtime P4 table manipulation
RuntimeCmd: help table_add
Add entry to a match table: table_add => [priority]

Hope the notes can help. :slight_smile:



Hello, I am new to P4pi and trying to run the bmv2 in Pi. Can anyone give a walkthrough to bmv2 in P4pi.


Please refer to this repo to run the bmv2 on P4Pi (p4pi/bmv2 at master · p4lang/p4pi · GitHub). The main difference between the BMv2 and T4P4S is when running the P4 code, you need to use the simple switch in BMv2: sudo simple_switch -i 0@eth0 basic_mirror.json

Hope it helps. :slight_smile:


Thank you for sharing the link but I can’t understand how to clone it in p4pi because it will have no internet connection during working so it shows that I can’t clone it. Thank you

I have followed the steps mentioned in the p4pi github repository for using bmv2 in p4pi but I am having trouble running the simple_switch in the bmv2.

Thank you in advance.