Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

[ #001 ] - Cookbook: P4 development workflow

Expand
titleP4 in a nutsgellnutshell

Based on what we mentioned, what "P4 Domain specific language" brings to you ? Concretely:

  1. you can write a program as you would in C or C++ but you'd have to follow P4 language specification. (The current is P4_16, there is also a previous P4_14 specification)
  2. that program is compiled with a p4 compiler in P4_16 or P4_14. (similar to C++14/C++11) 
  3. Resulting compilation artifacts can be then loaded into an equipment implementing a P4 model commonly called a P4 target that is able to interpret/run p4 binaries. Here we will be using BMv2, a softwarized P4 target intended for learning.


Warning
titleTake away

The specificities are:

  • This P4 program is YOUR program
  • This P4 program allows you to define the YOUR OWN packet processing logic

In short, you can now program:

« how a packet that comes into your system, is processed and goes out your system»


Info
titleDiagram packet processing description

The diagram above depicts 2 perspectives: 

  • P4 program development workflow
    • It starts by writing your P4 program using your favorite editor
    • compile your program with the P4 compiler of your target
    • load your program into the P4 target
  • my_program.p4 packet progressing logic: "all packets arriving at port 4 are switched/forwarded to port 8"
    • In this example, the switch has 8 ports
    • A ingress packet arrives at port 4
    • the ingress port is then checked
    • If it is port 4, then the packet is switched to port 8
    • my_program.p4 does not implement a default condition, so all the packets not arriving on port 4 are then dropped
    • the ingress packets arrived with a header with charateristics set by the previous node
    • if needed my_program.p4 is able to set modify the egress packet header for further processing by the next network node (Example of Inband network Telemetry)


...

Expand
titleP4 rationale

RARE project objective is to provide a networking solution to Research & Education institution use cases. While we witnessed the birth of several control plane such as GNU Zebra, Bird, exaBGP, etc. The common point of these softwares is that they don't have the capability (yet) to be coupled easily with a hardware dataplane. Simply put, these software control plane cannot be used without specific/important development in order to run on an equipment able to forward nx100GE links at a high Mpps rate. 

There have been attempts with DPDK and other kernel bypass mechanism, that enabled higher throughput processing capability, but this is not comparable to commercial/vendor equipment's packet processing power. 

P4:

  • opens you the door to software AND hardware dataplane programmability
  • gives you the possibility to implement YOUR own packet processing algorithm 
Info
titleRARE contro plane: freeRouter

In RARE project we are using a software control plane called freeRouter:

  • It is an open source control planeIt has been developed and maintained by Csaba MATE, who is working for KIFU the Hungarian NREN
  • It has been deployed since 2014 and benefits from hours of production in various environment
  • Interworking has been extensively and continuously tested with major equipment vendors
  • Last but not least Csaba freeRouter's maintainer is included in the RARE team which allowed Rapid Application development and prototyping in order to build control plane and P4 dataplane communication.


...