How to read & write Register via P4 Runtime? in a pipeconf, or an app.

850 views
Skip to first unread message
Assigned to me

Jianwei Mao

unread,
Apr 7, 2018, 5:25:40 AM4/7/18
to P4 brigade
Hello!


     Now, we can push and load flow rules, read counters to/from p4 device via p4 runtime.

     But, How can we read & write register via P4 Runtime? (in a pipeconf, or an application)

     I don't find an example in ONOS source code.


     In P4RuntimeClientImpl, I can not find a interface to Read / Write register.

     But, it seems p4runtime.proto supports this read/write action. Maybe this is work in the future? 




Thanks!

Mao

Carmelo Cascone

unread,
Apr 9, 2018, 2:05:57 PM4/9/18
to Jianwei Mao, P4 brigade
Hello Mao,

As you correctly noted, reading/writing registers has not been implemented yet in ONOS.

I just created a Jira issue for that:

It would be great if anyone in the community would like to help on this. I can offer guidance. I think to start it would be sufficient to add support for it in P4RuntimeClient, then we can think how to expose P4 registers to applications via the ONOS northbound APIs.

Thanks
Carmelo

--
You received this message because you are subscribed to the Google Groups "P4 brigade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+...@onosproject.org.
To post to this group, send email to briga...@onosproject.org.
Visit this group at https://groups.google.com/a/onosproject.org/group/brigade-p4/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/brigade-p4/70bd3ecc-5150-4eb1-9f95-10ba78109d86%40onosproject.org.
For more options, visit https://groups.google.com/a/onosproject.org/d/optout.

Frank Wang

unread,
Apr 12, 2018, 5:07:31 AM4/12/18
to Carmelo Cascone, Jianwei Mao, P4 brigade
Hi Carmelo,

I'd like to take care of this. I will start working on it as soon as possible.

Thanks,
Frank

Carmelo Cascone

unread,
Apr 12, 2018, 2:05:21 PM4/12/18
to Frank Wang, Jianwei Mao, P4 brigade

Jianwei Mao

unread,
Apr 14, 2018, 6:25:29 AM4/14/18
to Carmelo Cascone, Frank Wang, P4 brigade
Hi Carmelo, Frank,

    Good to know this work is proceeding! I'm busy for some paper things these day, so I'm afraid I can't lead the work now.

    However, if you need some helps, you can give me a message :)


Cheers~
Mao


Jianwei Mao
FNLab@BUPT, ONOS China Ambassador

Beijing University of Posts and Telecommunications
State Key Laboratory of Networking and Switching Technology

Sounds good.

Thanks, Frank!


Carmelo

To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+unsubscribe@onosproject.org.

--
You received this message because you are subscribed to the Google Groups "P4 brigade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+unsubscribe@onosproject.org.


 

--
You received this message because you are subscribed to the Google Groups "P4 brigade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+unsubscribe@onosproject.org.

--
You received this message because you are subscribed to the Google Groups "P4 brigade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+unsubscribe@onosproject.org.

To post to this group, send email to briga...@onosproject.org.
Visit this group at https://groups.google.com/a/onosproject.org/group/brigade-p4/.

calime...@gmail.com

unread,
Oct 28, 2019, 8:18:18 PM10/28/19
to P4 brigade
Hi carmelo

I would like to know if this functionality is working now in onos?


Thank you

Yanko Antonio Marin Muro

unread,
Oct 29, 2019, 2:51:55 PM10/29/19
to briga...@onosproject.org
Hello brigade-p4:

Hi all,
I'm new to P4 and started with the presentation of P4+ONOS and tutorial
exercises.
The ONOS Reactive Forwarding App intercepts IP packets for which there
are no matching flow rules on the switch and send this traffic to the
controller. This creates a  network latency. In some situations, the
traffic must be transmitted with the lowest latency.
How to proactively forward ICMP traffic to reduce network latency?
Thanks a lot in advance for your help,
Yanko.



Yanko Antonio Marin Muro

unread,
Oct 29, 2019, 2:53:16 PM10/29/19
to briga...@onosproject.org

Eder Ollora Zaballa

unread,
Oct 29, 2019, 3:10:30 PM10/29/19
to calime...@gmail.com, P4 brigade (brigade-p4@onosproject.org)
Hi,

As far as I can remember from ONF Connect and per ONOS 2.2 this is still not supported. I remember a slide from ONF Connect.

Check it at https://www.opennetworking.org/wp-content/uploads/2019/10/NG-SDN-Tutorial-Session-3.pdf, PDF page 16 or Slide 109.

Someone at ONF can correct me though.

Cheers,
--
You received this message because you are subscribed to the Google Groups "P4 brigade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+...@onosproject.org.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/brigade-p4/6b881a11-bbbf-496a-b454-657eb311d416%40onosproject.org.
winmail.dat

Eder Ollora Zaballa

unread,
Oct 29, 2019, 3:21:24 PM10/29/19
to Yanko Antonio Marin Muro, P4 brigade (brigade-p4@onosproject.org)
Hi Yanko,

As you have pointed out Reactive Forwarding install rules according to the packet forwarded by the switch, so that the controller checks (for instance) the destination IP or MAC and install forwarding rules accordingly. To have an application that proactively installs rules you can actually check the code in the Reactive Forwarding app but instead of waiting for a packet from the switch you install the rules right away. To create your own apps you could visit: https://wiki.onosproject.org/display/ONOS/Template+Application+Tutorial
Your rules might be somewhat static in the sense that you need to know the matching parameters (e.g. destination IP) and ports. To guide you on this you might (not sure) be able to proactively install some rules using the CLI or the REST interface before any traffic begins. Of course, as previously pointed, you would need to know IPs, maybe MACs (depends on your data plane tables) and also ports to which hosts are attached so that rules can be installed right away.
If you are new to P4 though you might want to check out the P4 tutorials from P4.org and find out how the rules are installed in the exercises (https://github.com/p4lang/tutorials) which uses another control plane based on Python. That might give a hint on how (from a functional perspective) you should do it with ONOS. Hope that helps a little.

Cheers,
--
You received this message because you are subscribed to the Google Groups "P4 brigade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+...@onosproject.org.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/brigade-p4/bdeae00f-d222-8e62-1ac5-75272be12000%40etecsa.cu.
winmail.dat

Yanko Antonio Marin Muro

unread,
Oct 30, 2019, 9:13:57 AM10/30/19
to briga...@onosproject.org
Hello Cheers,

Thank you so much for your suggestions.

Yanko.

El 29/10/19 a las 15:21, 'Eder Ollora Zaballa' via P4 brigade escribió:

Garegin Grigoryan

unread,
Sep 7, 2020, 1:08:31 PM9/7/20
to P4 brigade
Hello,

I wonder if there is a functionality for reading/writing registers via P4runtime?
Thank you.

Carmelo Cascone

unread,
Sep 8, 2020, 7:20:01 PM9/8/20
to Garegin Grigoryan, P4 brigade
Hi,

The P4Runtime API supports reading and writing P4 register externs (for v1model and PSA architectures), but support for it in ONOS is still pending (if that's what you're asking).

Contributions in this direction are certainly welcome.

Thanks
Carmelo

--
You received this message because you are subscribed to the Google Groups "P4 brigade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brigade-p4+...@onosproject.org.

Garegin Grigoryan

unread,
Sep 9, 2020, 8:29:44 AM9/9/20
to Carmelo Cascone, P4 brigade
Thanks!

Are there any examples of P4runtime code for reading/writing into registers?
Reply all
Reply to author
Forward
0 new messages