# Problems regarding p4 program on my linux machine

**URL:** <https://forum.p4.org/t/problems-regarding-p4-program-on-my-linux-machine/1107>\
**Category:** Uncategorized\
**Created:** [March 4, 2024, 9:30am UTC](https://forum.p4.org/t/problems-regarding-p4-program-on-my-linux-machine/1107 "2024-03-04T09:30:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TurboTron](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@TurboTron](https://forum.p4.org/u/TurboTron)\
**Post date:** [March 4, 2024, 9:30am UTC](https://forum.p4.org/t/problems-regarding-p4-program-on-my-linux-machine/1107/1 "2024-03-04T09:30:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DavideS](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/davides/32/120_2.png) [@DavideS](https://forum.p4.org/u/DavideS)\
**Post date:** [March 4, 2024, 9:59am UTC](https://forum.p4.org/t/problems-regarding-p4-program-on-my-linux-machine/1107/2 "2024-03-04T09:59:27Z")

</div>

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](https://github.com/p4lang/tutorials/blob/master/exercises/p4runtime/mycontroller.py)

---

<div class="post-metadata">

**Author:** ![TurboTron](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@TurboTron](https://forum.p4.org/u/TurboTron)\
**Post date:** [March 4, 2024, 10:13am UTC](https://forum.p4.org/t/problems-regarding-p4-program-on-my-linux-machine/1107/3 "2024-03-04T10:13:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DavideS](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/davides/32/120_2.png) [@DavideS](https://forum.p4.org/u/DavideS)\
**Post date:** [March 4, 2024, 10:23am UTC](https://forum.p4.org/t/problems-regarding-p4-program-on-my-linux-machine/1107/4 "2024-03-04T10:23:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TurboTron](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@TurboTron](https://forum.p4.org/u/TurboTron)\
**Post date:** [March 4, 2024, 11:12am UTC](https://forum.p4.org/t/problems-regarding-p4-program-on-my-linux-machine/1107/5 "2024-03-04T11:12:11Z")

</div>

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
