Code Monkey home page Code Monkey logo

clickp4's Introduction

ClickP4 : A Police-Aware Modular Programming Architecture for P4

ClickP4, a modular programming architecture for P4, is proposed to provide simplicity for building P4 programs, flexibility for orchestrating program features and reliability for enforcing network policies.

Framework

The framework of ClickP4 is decomposed into four aspects: The core of ClickP4, the runtime context for modules, the modules that implement various device features And the protocol aspect defining the supported protocol format and header parser.

Core

The core defines the overall architecture of ClickP4, including the control nodes, the module inspector and the ClickP4 pipeline. Notice that the core doesn't provide any data plane functions.

Context

The runtime context for modules should be provided by module developers who want to expose parameters of their modules to other modules. ClickP4 adopts a logical namespace and all components defined in the modules are private to the modules. So we propose the global runtime context to act as a bridge between modules. And these modules can read and write the fields defined in the context, which provides an 'unsafe' way to transmit parameters.

Modules

Modules are programmed by network operators who want to create new features to improve their networks. And there is a standard ingress function (a control flow in fact) for every module. Besides developing modules from scratch, we also provide some classic modules which can be reused.

Protocol

The protocols defines the network protocol used in ClickP4.

Install

Install BMv2

$ git clone https://github.com/clickp4/behavioral-model
$ cd <bmv2 folder>
$ ./install_deps.sh
$ ./autogen.sh
$ ./configure
$ make -j8
$ sudo make install

or in the ClickP4 folder

$ make install-bmv2

Then you can have bmv2 in /bmv2

Tutorials

How to run ClickP4

Please follow these steps to build run a ClickP4 demo.

  1. Setup the virtual NICs and namespace.
$ cd <clickp4 folder>
$ make setup-veth
  1. Setup a ClickP4 module and compile the ClickP4 source code.
$ echo "l3_switch" >>config/modules
$ make compile

Then the P4 binary code "clickp4.json" is generated into the "build" folder.

  1. Run ClickP4 on BMv2 Firstly, check whether the "SWITCH_DIR" parameter in Makefile is right or change it to the right director.(TODO: This can be automatically done.)
make run
  1. Populate L3_switch
make populate-l3
  1. Test the reachability h1 and h2
$ sudo ip netns exec h1 bash
$ ping 10.0.0.2

How to build a module

Please go to SAMPLE-MODULE to find out more information.

How to add new protocols

Please go to SAMPLE-PROTOCOLnd out more information.

TODO

LOG

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.