ONOS-P4 Tutorial Hands-on Activity P4 Brigade Work Days, Seoul (Korea) September 18-29, 2017

Tutorial VM • Download (~4GB) • http://bit.ly/onos-p4-dev-vm

• Run • The VM is in .ova format and has been created using VirtualBox v5.1. • To run the VM you can use any modern virtualization system, although we recommend using VirtualBox. • To download VirtualBox and import the VM use the following links: • https://www.virtualbox.org/wiki/Downloads • https://docs.oracle.com/cd/E26217_01/E26796/html/qs-import-vm.html

System requirements • The current configuration of the VM is 6 GB of RAM and 4 core CPU, although this is the recommended configuration, it can be reduced if needed. • Minimum system requirements to build and run ONOS are 2 core CPU and 2 GB of RAM. • When imported, the VM takes approx. 8 GB of HDD space, however, you might need up to 15 GB to build and run ONOS.

Tutorial VM content • VM content • ONOS • P4 tools (p4c, BMv2, P4Runtime) • IntelliJ IDEA (Java IDE for ONOS)

• Credentials • User: “sdn” • Password: “rocks”

• Important: remember to set your keyboard settings:

Update onos • To complete the tutorial exercises you will need to download, build and run the latest development version of ONOS. • Once you are able to run the VM, open a terminal window or SSH into it and type the following commands: cd ~/onos git pull origin master buck build onos Building ONOS with the recommended system configuration takes approx. 10 minutes.

Exercise instructions

http://bit.ly/onos-p4-tutorial

Tutorial application • Under ~/onos/apps/p4-tutorial • Example pipeconf • Example pipeline-aware application • IcmpDropper

Main.p4 • Parsed headers: • Ethernet, IPv4

• Ingress pipeline with 2 tables • Table0

• Basic L2 forwarding capabilities • Actions • set_egress_port • send_to_cpu (packet-in) • drop

• Ip_proto_filter_table

• Filter (drop) packets based on IPv4 protocol code • ICMP, TCP, UDP, etc.

• Port counters • Packet-in/out

Main.json/p4info • Generated using p4c • Makefile available with command to generate them • Contains workaround for p4c/bmv2 bug

PipeconfFactory.java • Class that defines the pipeconf • 3 driver behaviours

• Interpreter (mandatory) • Pipeliner (default single table) • PortStatisticsDiscovery (used to read port counters)

• 2 extensions

• P4Info • BMv2 JSON

• Class activated by OSGi runtime

• @component • Pipeconf registered at component activation

PipelineInterpreterImpl.java • Criterion mapping

• IN_PORT, ETH_SRC, ETH_DST, ETH_TYPE

• Treatment mapping

• No instructions = drop • OUTPUT

• Switch physical ports • Controller • Other logical ports are not supported (e.g. FLOOD)

• Table ID mapping

• 0 = table0 • 1 = ip_proto_filter_table

• Packet I/O mapping

PortStatisticsDiscoveryImpl.java • Use P4RuntimeClient to read port counters from device • Specific to main.p4 program • Port counter names defined there • igr_port_counter (ingress) • egr_port_counter (egress)

IcmpDropper.java • Example applications • Registers a device listener • Installs 1 flow rule for each new device • Drop ICMP packets

• Flow rule uses PI Criterion/Instruction • Header field name and action name same as in main.p4

Environment LLDP Provider (link discovery)

Host Provider (host discovery)

ARP Proxy

ONOS

Mininet with custom script bmv2.py

Reactive forwarding

BMv2 Driver

BMv2’s BMv2’s simple_switch_target BMv2’s simple_switch_target simple_switch_grpc

ICMP Dropper

REGISTER

Tutorial Pipeconf

LLDP Provider • App ID: org.onosproject.lldpprovider • Provides means to discover network links by injecting LLDP packets in the network • Install packet request (flow rule) on each device • Match: ETH_TYPE = LLDP • Instructions: OUTPUT(CONTROLLER)

• Periodically issues LLDP packets via packet-out for each switch port

ARP Proxy • App ID: org.onosproject.proxyarp • Intercepts ARP requests sent by hosts via packet-in, generates ARP replies. I.e. ARP packets are not forwarded on the network, but are handled exclusively by the controller • Match: ETH_TYPE = ARP • Instructions: OUTPUT(CONTROLLER)

Host location provider • App ID: org.onosproject.hostprovider • Learns location of hosts by passively intercepting ARP packets • Mapping: ETH/IP addr ⟷ Switch-ID:Port-ID

• No rules installed, listens for packet requests installed by other applications (e.g. ARP proxy)

Reactive forwarding • App ID: org.onosproject.hostprovider • Intercepts IP packets for which there are no matching flow rules on the switch • If the location of the destination host is known, installs the necessary flow rule to forward subsequent packets • Otherwise, packet is flooded on all ports of the switch where it was received via packet-out • Flow rules • IP packet intercept

• Match: ETH_TYPE = IPv4, Instruction: OUTPUT(CONTROLLER)

• Forwarding

• Match: IN_PORT, ETH_SRC, ETH_DST, Instruction: OUTPUT(port)

Mininet script: bmv2.py • Provided with ONOS • Executes BMv2’s simple_switch_grpc inside Mininet • Automatically generates and push to ONOS the netcfg.json • Files located under /tmp

• Example command to use bmv2.py sudo -E mn --custom $BMV2_MN_PY \ --switch onosbmv2,loglevel=debug,pipeconfId=p4-tutorial-pipeconf --controller remote,ip= $BMV2_MN_PY env variable that points to the location of the bmv2.py script

2 Exercises • Look at the instructions here: http://bit.ly/onos-p4-tutorial • Exercise 1 • Run Mininet with BMv2, program devices with example pipeconf and use standard ONOS applications (pipeline-agnostic) to provide basic forwarding capabilities

• Exercise 2 • Load ICMP dropper application

Pointers • P4 Brigade • https://wiki.onosproject.org/x/2oS9

• Subscribe to the mailing list • Will share there slides and tutorial instructions

ONOS-P4 Tutorial Hands-on Activity -

To run the VM you can use any modern virtualization system, although we recommend ... Minimum system requirements to build and run ONOS are 2 core CPU.

242KB Sizes 159 Downloads 198 Views

Recommend Documents

FeynRules Tutorial
We will call mass eigenstates Φ1 and Φ2, and their masses M1 and M2, ... (3) where u and e are the SM up-quark and electron fields. Note that there is a Z2 symmetry ..... The kinetic terms for the fermions can be implemented in a similar way.

LaTeX Tutorial
To have formulas appear in their own paragraph, use matching $$'s to surround them. For example,. $$. \frac{x^n-1}{x-1} = \sum_{k=0}^{n-1}x^k. $$ becomes xn − 1 x − 1. = n−1. ∑ k=0 xk. Practice: Create your own document with both kinds of for

FeynRules Tutorial
The model we are considering depends on 9 new parameters, .... approach, and we start by opening a new notebook and load the FeynRules package (see the ...

ENVI Tutorial
Navigate to the Data\can_tm directory, select the file can_tmr.img from the list, and click. Open. .... From the ROI Tool dialog menu bar, select File > Restore ROIs.

Activity Tracker Steps, Calories and Distance The Activity Tracker ...
An algorithm, i.e, a set of rules to perform a calculation, is used to ... The information provided by the nuyu™ Activity Tracker and nuyu™ app is an estimate and ...

Little-Airport-Sticker-Activity-Book-Dover-Little-Activity-Books ...
Little-Airport-Sticker-Activity-Book-Dover-Little-Activity-Books-Stickers.pdf. Little-Airport-Sticker-Activity-Book-Dover-Little-Activity-Books-Stickers.pdf. Open.

Activity Pack 1: Imagine Activity for Grades K-2
This year's Doodle 4 Google competition theme is: If I could invent one thing to make the world a better place. We can think of no greater purpose for students to ...

Activity Pack 1: Imagine Activity for Grades 3-5
This year's Doodle 4 Google competition theme is: If I could invent one thing to make the world a better place. We can think of no greater purpose for students to show their creativity than to make the world better for others. It all starts with a li

Activity Tracker Steps, Calories and Distance The Activity Tracker ...
The information provided by the nuyu™ Activity Tracker and nuyu™ app is an estimate and is not a precise measurement. Factors such as where the activity ...

activity based activity based learning learning
through listening,. ➢ Thinking, ... for both multi grade and multi level. ❖Low Level Black Board serve as an effective tool .... Green. Maths. Maroon. Social Science.

Little-Airport-Sticker-Activity-Book-Dover-Little-Activity-Books ...
Page 1 of 8. o. "0. :z. us 10EE81. Eighth Semester B.E. Degree Examination, June/July 2017. Electrical Design Estimation and Costing. Time: 3 hrs. Max. Marks: 100. ote: 1.Answer FIVE full questions, selecting. at least TWO questions from each part. 2

Predicting drug activity - STEM
making it or testing it. The likelihood that a ... molecular model building they provide a good way of visualising molecules and beginning to ... From the website:.

Activity Pack 1: Imagine Activity for Grades 3-5
This year's Doodle 4 Google competition theme is: If I could invent one thing to .... You may want to add time during later rounds so that students have time to.

Activity Pack 1: Imagine 9-12 Activity
Encourage students to think about making the world worse for animals, the ... SyncSpace: SyncSpace is a collaborative whiteboard app available for tablets.

UNIT 2 ACTIVITY 3
Can move many passengers plus cargo. Used mostly for fun. 82 ... 6. The has wings and no. 5. The has a motor and no motor. A towplane helps it become airborne. wings. Only a few of ..... Lift Versus Weight 2" x 10" paper strips. Grades 1-3.

Activity Sheet 1
Which site was best? Why did you ... will then create your own presentation to show ... pictures. This can also be viewed on a Google Map on the UNEP website:.

Logarithms – Matching Activity
This activity will require a bit of advance preparation due to the fact that I could not figure out a way to rotate text and still type superscripts for exponents, subscripts for bases, etc. The next pages contain 18 problems involving introductory p

Activity Manager - IITA
Activity Manager - Feed the Future Malawi INVC Bridging Activity ... IITA is one of the world's leading research partners in finding solutions for ... Organize regular planning and review meetings with all partners and also ... Relevant experience in

TUTORIAL DOODLE.pdf
Page 3 of 9. TUTORIAL DOODLE.pdf. TUTORIAL DOODLE.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying TUTORIAL DOODLE.pdf. Page 1 of 9.

Tutorial MindMeister.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Whoops! There was a problem previewing this document. Retrying... Download. Connect ...