Problems regarding p4 program on my linux machine

Hey, all first of all I am new to this so bear with me.
I have installed all p4c compiler, BMV2, p4Runtime, etc on my Ubuntu 20.04 machine.

I have done all tutorial programs given in the GitHub repository, but they all seem to use Mininet or scapy for packet sending.

I have compiled my program using the p4c compiler

Compiled Using

p4c-bm2-ss --p4v 16 -o program.json --p4runtime-file test.p4info --p4runtime-format text program.p4

but when I run it on the bmv2 with log console on and on simple switch target I can see that every packet is getting the No Action() even for Basic forwarding program.

I am giving my wifi as interface 1 and my ethernet port as interface 2 but it always seem to revert the packet back to interface 1 can someone tell me what I am doing wrong?

Also suppose I want to make a simple p4Runtime based Python Controller where can I learn it and is there any sample codes for it?

Hi @TurboTron

  1. I suppose NoAction is the default action defined in your table/s. So a packet does not hit any flow entry defined in your flow table/s. I suggest you to start to play with an environment were you have the full control, e.g, generating packets via scapy or other tools that allow you to know/manage all the headers fields.

  2. Here an example for the P4Runtime controller tutorials/exercises/p4runtime/mycontroller.py at master · p4lang/tutorials · GitHub

Hi @DavideS Thanks for the reply,

Q1] Do we need just need to run the Controller or I need to run two separate terminals one running Bmv2 and another running Controller.py
Q2] Can you tell me how to set meter rates in the Controller?.
Q3] Also is it viable to set interfaces the way I did?

  1. 2 separate terminal
  2. I think no, this should be done when you star the switch

Hey @DavideS How to set the meter rates in P4 programming without the help of other txt file like the direct_commands.txt,etc given in the tutorial