Developer Resources

The following software is available to the open source community to write and test P4 programs.

Repositories on

 - P4 Model Repository
 - Includes 3 example P4 programs
     - simple_router (A simple P4 program showing just ethernet+ipv4 packet switching)
     - basic_routing (A basic L2/L3 switch)
     - dc_example (A light version of a Data Center Switch)
 - Soft Switch Model
 - Mininet integration (Allows for building a simple network topology using the simple_router model)

 - P4 compiler front-end (confirming to spec v1.0.2)
 - P4 compiler back-end for P4 Soft Switch Model
 - P4 Table Graph generator
All of the above code is available at

Try it!

If you plan to play with the sample P4 programs, build and run them, start with the p4factory repository.

If you plan to write a compiler back end for new targets, look at the p4-hlir repository.

p4c-behavioral and p4c-graphs are examples of back ends for two different targets, a soft switch model and a table graph respectively.


Stay tuned for information on submitting patches. In the mean time please join and participate in discussions on the P4 Developer mailing list. Details below.

Developer Community