Introduction to P4 ONOS-P4 Brigade Work Days, Seoul (Korea) September 18-29, 2017

What is P4? • Open-source domain-specific language (DSL) for programmable dataplanes • Protocol independent • Support for a variety of targets: ASICs, FPGAs, NICs, software • Field reconfigurable: add/remove capabilities to switches after they are deployed

• Based on the well known Match+Action forwarding model • 2 versions of the language: P4_14, P4_16 • We focus on P4_16

Outline • Programmable switch architecture • Workflow • P4 tools • p4c (compiler) • BMv2 (reference software switch) • P4Runtime (control plane framework)

Not covering the language, we will reverse engineer the example program during the hands-on

P4 Paradigm

OpenFlow or legacy

PISA: Protocol-Independent Switch Architecture Programmer declares the headers that should be recognized and their order in the packet

Slide courtesy: Vladimir Gurevich, P4_16 Tutorial. P4 Workshop 2017

Programmer defines the tables and the exact processing algorithm

Programmer declares how the output packet will look on the wire

Mapping a simple logical pipeline on PISA

Ethernet address table

Slide courtesy: Vladimir Gurevich, P4_16 Tutorial. P4 Workshop 2017

IPv4 address table

IPv6 address table

ACL filter table

P4 programs

my_program.p4 Defines the processing of each block

switch_arch.p4

Defines which blocks are available and the interface of each block

P416 terminology • P4 Target

• An embodiment of a specific hardware or software implementation • E.g. Barefoot’s Tofino chip, Netronome’s SmartNICs, BMv2 software switch, etc.

• P4 Architecture

• Set of P4-programmable components, externs, fixed components and their interfaces available to the P4 programmer • E.g. PISA architecture, ingress/egress pipeline architecture, etc. • Expressed as a P4 program Community-developed P416 Language

P416 Core Library

Vendor-supplied Architecture definition

Extern libraries

Portable Switch Architecture (PSA) • Community-developed architecture

• https://github.com/p4lang/p4-spec/tree/master/p4-16/psa

• Describes common capabilities of a network switch

• Which process and forward packets across multiple interface ports

• 6 programmable P4 blocks + 2 fixed-function blocks • P414 constructs removed from P416 now defined as PSA-specific externs • Counters, meters, stateful registers, hash functions, etc.

Workflow overview Control plane

p4c my_program.p4

P4 Compiler

arch.p4

Target-specific configuration/binary

Manufacturer supplied

P4Runtime

LOAD

Tables

Extern objects

BMv2

Data plane

p4c • https://github.com/p4lang/p4c • Open-source front-end compiler Compiler$data$flow • Support multiple back-ends (vendor-supplied)

• Generate code for ASICs, NICs, FPGAs, software switches and other targets • Some of them are open-source (BMv2, eBPF)

P414

P414 parser

v1 IR

ebpf back*end

C$code

mid* end

BMv2 back*end

JSON

mid* end

your own backend

target* specific code

convert IR

P416

mid* end

P416 parser

Slide courtesy: M. Budiu, C. Doss. The architecture of the P4_16 compiler. P4 Workshop 2017

frontend

IR

BMv2 • https://github.com/p4lang/behavioral-model • BMv2 = Behavioral-Model version 2 • User-space software switch to emulate a P4 data plane • Aimed at being 100% conformant to the P4 specification • Performance is non-goal, i.e. low throughput • Architecture-independent • Mostly generic code which can be used to implement any P4 target • Some targets provided as part of the repo, e.g. simple_router, simple_switch

BMv2’s simple_switch target

Parser

Packets Ingress pipeline

Multicast groups management

Packet Replication Engine (PRE)

configure

p4c-bm-ss my_program.p4

p4c compiler with simple_switch back-end

my_program.json

Table management Thrift-based RPC API

Egress pipeline

Deparser

Table management

P4Runtime • https://github.com/p4lang/PI • Framework for runtime control of P4-enabled devices • Developed by the p4.org API WG • Specification is still work-in-progress by API WG

Remote controller (e.g. ONOS) p4runtime.proto (interface)

• Specifically targeted for remote controllers • Protobuf + gRPC implementation

• P4 program-independent

• API doesn’t change with the P4 program

• Enables field-reconfigurability

• Ability to push a new P4 program to the device

Program-independent control server (gRPC) HW/SW target (e.g. BMv2 simple_switch, tofino chip, etc.)

Switch

p4runtime.proto • Allow interacting with entities defined in a P4 program • Tables, counters, meters, externs, etc.

• Bidirectional stream channel

• For packet-ins/outs, mastership updates, etc.

• P4 architecture-independent

• Easily extensible to support vendor-specific externs • Hardcoded support for PSA

Refers to P4 entities by integer IDs. How to get such IDs?

P4Runtime workflow P4Runtime PI Interface Workflow

switch.p4

• P4Info proto

• captures target-independent P4 program attributes • defines numeric IDs for P4 tables, actions, params, ● P4Info proto ○ captures target-independent P4 program attributes etc. ○

defines IDs for P4 tables, actions, params, etc.

• Target config ●

p4c front-end

IR

P4Info

IR = P4 compiler intermediate representation

• P4Info + device-specific configuration (e.g. BMv2’s ● Target Config JSON, Tofino binary, etc.) ○



p4c back-end

P4Info + P4-program mapping to silicon

target config

P4Runtime defines the PI interface ○

Refers to P4 entities by integer IDs coming from P4Info

rpc Controller Front-end p4runtime protos

Slide courtesy: S. Abdi, W. Mohsin, Y. Yetim, A. Ghaffarkhah. P4 Program-Dependent Controller Interface for SDN Applications. P4 Workshop 2017

PI

P4Runtime Interface

Switch 3

P4Info example P4Info Example action set_vrf(bit<32> id) { meta.vrf_id = id; } table vrf_classifier_table { key = { hdr.ethernet.etherType : exact; hdr.ethernet.srcAddr : ternary; smeta.ingress_port: exact; } actions = { set_vrf; } default_action = set_vrf(0); }

action id: 16777233 param id: 50336000

p4c front-end

table id: 33554433 match_field id: 67108875 match_type: EXACT match_field id: 67108864 match_type: TERNARY match_field id: 67108870 match_type: EXACT action_ref id: 16777233

vrf.p4 vrf.p4 Slide courtesy: S. Abdi, W. Mohsin, Y. Yetim, A. Ghaffarkhah. P4 Program-Dependent Controller Interface for SDN Applications. P4 Workshop 2017

P4Info for vrf.p4 P4Info for vrf.p4

4

PIP4Runtime example Proto Example action set_vrf(bit<32> id) { meta.vrf_id = id; } table vrf_classifier_table { key = { hdr.ethernet.etherType : exact; hdr.ethernet.srcAddr : ternary; smeta.ingress_port: exact; } actions = { set_vrf; } default_action = set_vrf(0); }

vrf.p4

table_entry { table_id: 33554433 match { field_id: 67108875 exact { value: \x08\x00 } } match { field_id: 67108870 exact { value: \x00\x00\x00\x00\x11\x01 } } ...

... table_action { action { action_id: 16777233 params { param_id: 50336000 value: \x00\x00\x00\x70 } } } }

PI message instance

Slide courtesy: S. Abdi, W. Mohsin, Y. Yetim, A. Ghaffarkhah. P4 Program-Dependent Controller Interface for SDN Applications. P4 Workshop 2017

5

Questions?

Introduction to P4 -

Open-source domain-specific language (DSL) for programmable ... E.g. PISA architecture, ingress/egress pipeline architecture, etc. ... Compiler$data$flow. P416.

2MB Sizes 56 Downloads 250 Views

Recommend Documents

P4.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. P4.pdf. P4.pdf.

P4. FOTONOVELA.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.

p4.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. p4.pdf. p4.pdf.

P4-2_Comparison_of_OS.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item.

Camur II P4 Quick
The P4 Quick node is made for monitoring of electrochemical reference electrodes ... recording types Monitor, Monitor Extended and Decay in Camur II software.

P4-4_Virtual_Machine-VirtualBox.pdf
Currently, Oracle provides the one extension pack, which can be found at. http://www.virtualbox.org and provides the following added functional-ity: a. The virtual USB 2.0 (EHCI) device; see chapter 3.10.1, USB settings, page 53. b. VirtualBox Remote

Citizenship Education P4-P6.pdf
Unit 1: Peace-building and Democratic Living. Unit 2: Social Auditing. TIME ALLOCATION. Primary 4 – 6: Citizenship education is allocated 5 periods a week, ...

Audience Response P4(V2).pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Audience ...

P4 support in ONOS -
Architecture overview. Pipeline-agnostic ... Pack together data and code necessary to let ONOS: ○ Understand a .... key characteristics to the ONOS platform ...

P4 recommend a computer system for a given business purpose.pdf ...
Page 1 of 15. SULIT 55/1. SCIENCE. Ogos 2012. 1 jam. Kertas ini mengandungi 29 halaman bercetak. 55/1 © 2012 Hak Cipta BPSBPSK [Lihat Halaman ...

pdf-1453\introduction-to-psychoneuroimmunology-introduction-to ...
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. pdf-1453\introduction-to-psychoneuroimmunology-introduction-to-psychoneuroimmunology-.pdf. pdf-1453\introduction-to-psychoneuroimmunology-introduction-to-

TLKT1220-Mandate-2016-Aug-p4-Notebook.pdf
Grace Glastonbury. I love the song “Go Make a Diff'rence” in More Voices. My life experiences have. taught me that I am the hands and feet of God in this world, ...

P4 recommend a computer system for a given business purpose.pdf ...
Windows 7 with 1GHz or faster with 32-bit for the games as they only use 32 bit and a 64-bit version. of windows 7 would be a waste of RAM, windows 7 will need 1 GB of RAM to run the OS. The Hard. drive will need 16GB free on the drive for the OS als

pdf-1483\mechanixedge-p1-p4-ase-certification-test-preparation ...
... the apps below to open or edit this item. pdf-1483\mechanixedge-p1-p4-ase-certification-test-pr ... on-study-guide-parts-specialist-p-by-mechanixedge.pdf.

p4 Grade 5 Memory Box Book Report.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. p4 Grade 5 ...

SUPPLEMENTAL BID BULLETIN NO. 2016-02-P4 ...
inconsistent with this Bid Bulletin are hereby superseded and modified accordingly. For information and guidance of all concerned. 24 February 2016. (Sgd) ENRIQUE E. ANGELES, JR. BAC Chairman. (Sgd) VIRGINIA F. FLORES. (Sgd) SALOME P. MANUEL. BAC Vic

P4 describe the features and functions of information systems.pdf ...
Page 2 of 2. P4 describe the features and functions of information systems.pdf. P4 describe the features and functions of information systems.pdf. Open. Extract.

ACCA - P4 Advanced Financial Management - Revision Kit 2016 ...
Page 1 of 498. Free access. to our Exam. Success site. Look inside. ACCA APPROVED. CONTENT PROVIDER. Contact us. BPP House. 142-144 Uxbridge ...