• Stars
    star
    319
  • Rank 131,461 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hands-on tutorial to learn the building blocks of the Next-Gen SDN architecture

Next-Gen SDN Tutorial (Advanced)

Welcome to the Next-Gen SDN tutorial!

This tutorial is targeted at students and practitioners who want to learn about the building blocks of the next-generation SDN (NG-SDN) architecture, such as:

  • Data plane programming and control via P4 and P4Runtime
  • Configuration via YANG, OpenConfig, and gNMI
  • Stratum switch OS
  • ONOS SDN controller

Tutorial sessions are organized around a sequence of hands-on exercises that show how to build a leaf-spine data center fabric based on IPv6, using P4, Stratum, and ONOS. Exercises assume an intermediate knowledge of the P4 language, and a basic knowledge of Java and Python. Participants will be provided with a starter P4 program and ONOS app implementation. Exercises will focus on concepts such as:

  • Using Stratum APIs (P4Runtime, gNMI, OpenConfig, gNOI)
  • Using ONOS with devices programmed with arbitrary P4 programs
  • Writing ONOS applications to provide the control plane logic (bridging, routing, ECMP, etc.)
  • Testing using bmv2 in Mininet
  • PTF-based P4 unit tests

Basic vs. advanced version

This tutorial comes in two versions: basic (master branch), and advanced (this branch).

The basic version contains fewer exercises, and it does not assume prior knowledge of the P4 language. Instead, it provides a gentle introduction to it. Check the master branch of this repo if you're interested in the basic version.

If you're interested in the advanced version, keep reading.

Slides

Tutorial slides are available online: http://bit.ly/adv-ngsdn-tutorial-slides

These slides provide an introduction to the topics covered in the tutorial. We suggest you look at it before starting to work on the exercises.

System requirements

If you are taking this tutorial at an event organized by ONF, you should have received credentials to access the ONF Cloud Tutorial Platform, in which case you can skip this section. Keep reading if you are interested in working on the exercises on your laptop.

To facilitate access to the tools required to complete this tutorial, we provide two options for you to choose from:

  1. Download a pre-packaged VM with all included; OR
  2. Manually install Docker and other dependencies.

Option 1 - Download tutorial VM

Use the following link to download the VM (4 GB):

The VM is in .ova format and has been created using VirtualBox v5.2.32. To run the VM you can use any modern virtualization system, although we recommend using VirtualBox. For instructions on how to get VirtualBox and import the VM, use the following links:

Alternatively, you can use the scripts in util/vm to build a VM on your machine using Vagrant.

Recommended VM configuration: The current configuration of the VM is 4 GB of RAM and 4 core CPU. These are the recommended minimum system requirements to complete the exercises. When imported, the VM takes approx. 8 GB of HDD space. For a smooth experience, we recommend running the VM on a host system that has at least the double of resources.

VM user credentials: Use credentials sdn/rocks to log in the Ubuntu system.

Option 2 - Manually install Docker and other dependencies

All exercises can be executed by installing the following dependencies:

  • Docker v1.13.0+ (with docker-compose)
  • make
  • Python 3
  • Bash-like Unix shell
  • Wireshark (optional)

Note for Windows users: all scripts have been tested on macOS and Ubuntu. Although we think they should work on Windows, we have not tested it. For this reason, we advise Windows users to prefer Option 1.

Get this repo or pull latest changes

To work on the exercises you will need to clone this repo:

cd ~
git clone -b advanced https://github.com/opennetworkinglab/ngsdn-tutorial

If the ngsdn-tutorial directory is already present, make sure to update its content:

cd ~/ngsdn-tutorial
git pull origin advanced

Download / upgrade dependencies

The VM may have shipped with an older version of the dependencies than we would like to use for the exercises. You can upgrade to the latest version using the following command:

cd ~/ngsdn-tutorial
make deps

This command will download all necessary Docker images (~1.5 GB) allowing you to work off-line. For this reason, we recommend running this step ahead of the tutorial, with a reliable Internet connection.

Using an IDE to work on the exercises

During the exercises you will need to write code in multiple languages such as P4, Java, and Python. While the exercises do not prescribe the use of any specific IDE or code editor, the ONF Cloud Tutorial Platform provides access to a web-based version of Visual Studio Code (VS Code).

If you are using the tutorial VM, you will find the Java IDE IntelliJ IDEA Community Edition, already pre-loaded with plugins for P4 syntax highlighting and Python development. We suggest using IntelliJ IDEA especially when working on the ONOS app, as it provides code completion for all ONOS APIs.

Repo structure

This repo is structured as follows:

  • p4src/ P4 implementation
  • yang/ Yang model used in exercise 2
  • app/ custom ONOS app Java implementation
  • mininet/ Mininet script to emulate a 2x2 leaf-spine fabric topology of stratum_bmv2 devices
  • util/ Utility scripts
  • ptf/ P4 data plane unit tests based on Packet Test Framework (PTF)

Tutorial commands

To facilitate working on the exercises, we provide a set of make-based commands to control the different aspects of the tutorial. Commands will be introduced in the exercises, here's a quick reference:

Make command Description
make deps Pull and build all required dependencies
make p4-build Build P4 program
make p4-test Run PTF tests
make start Start Mininet and ONOS containers
make stop Stop all containers
make restart Restart containers clearing any previous state
make onos-cli Access the ONOS CLI (password: rocks, Ctrl-D to exit)
make onos-log Show the ONOS log
make mn-cli Access the Mininet CLI (Ctrl-D to exit)
make mn-log Show the Mininet log (i.e., the CLI output)
make app-build Build custom ONOS app
make app-reload Install and activate the ONOS app
make netcfg Push netcfg.json file (network config) to ONOS

Exercises

Click on the exercise name to see the instructions:

  1. P4Runtime basics
  2. Yang, OpenConfig, and gNMI basics
  3. Using ONOS as the control plane
  4. Enabling ONOS built-in services
  5. Implementing IPv6 routing with ECMP
  6. Implementing SRv6
  7. Trellis Basics
  8. GTP termination with fabric.p4

Solutions

You can find solutions for each exercise in the solution directory. Feel free to compare your solution to the reference one whenever you feel stuck.

Build Status

More Repositories

1

onos

Open Network Operating System
Java
1,186
star
2

flowvisor

FlowVisor - A network hypervisor
Java
164
star
3

onos-p4-tutorial

DEPRECATED - Please check the more recent NG-SDN tutorial (advanced branch): https://github.com/opennetworkinglab/ngsdn-tutorial/tree/advanced
Java
51
star
4

onos-app-samples

Sample applications for onos
Java
47
star
5

OnosSystemTest

Open Networking Lab Test Repository
Python
32
star
6

onos-kubernetes

Examples and other collateral for deploying ONOS clusters using Kubernetes.
Shell
23
star
7

routing

Mirror of https://gerrit.onosproject.org/#/admin/projects/routing
Python
21
star
8

p4mn-docker

P4Runtime-enabled Mininet Docker image that uses BMv2 simple_switch_grpc as the default switch
Python
19
star
9

aether-onramp

Makefile
17
star
10

int-host-reporter

User space agent and eBPF programs that provide INT support to end hosts
Go
15
star
11

fabric-p4test

PTF-based data plane tests for ONOS fabric.p4
Python
15
star
12

stratum-onos-demo

Stratum+ONOS demo @ ONF Connect 2019 & EuroP4 '19
Java
13
star
13

sdfabric-tutorial

Python
11
star
14

ODTN-emulator

Emulator for the ODTN project.
Python
8
star
15

mininet

Mininet - a network emulator for rapid SDN prototyping
6
star
16

spring-open

Java
6
star
17

onos-yang-tools

Java
5
star
18

aether-5gc

Makefile
5
star
19

micro-onos-demo

Scripts and various tools to run the ONF Connect ยตONOS demo
Shell
5
star
20

timesheetsdb

DARPA time-sheets app back-end
TypeScript
4
star
21

onos-operator

Operator for creating and managing ONOS clusters on Kubernetes
Go
4
star
22

trellis-control

Java
3
star
23

onos-stc

System Test Coordinator
Java
2
star
24

cord-config

Configuration files for CORD
HTML
2
star
25

sdfabric-onos

Shell
2
star
26

spring-open-cli

Python
2
star
27

flowvisor-test

FlowVisor Testing Framework
2
star
28

p4c-docker

Dockerfile
2
star
29

sdfabric-utils

Collection of utilities for running SD-Fabric
Python
2
star
30

jdvue

Java Package Dependency viewer
HTML
2
star
31

trellis-t3

Java
1
star
32

fabric-plumber

Simple application to automatically plumb host mesh connectivity using simple p4 fabric pipeline.
Java
1
star
33

onos-warden

Service for managing shared test cell resources within the lab; includes server and OSX client app utility.
Go
1
star
34

aether-sriov

Makefile
1
star
35

onos-loxi

Mirror of https://gerrit.onosproject.org/#/admin/projects/onos-loxi
Python
1
star
36

tassen

Next-generation BNG CUPS API based on P4Runtime, gNMI, and OpenConfig
Go
1
star
37

onos-apps-list

The repository contains a list of descriptions of the ONOS apps
1
star
38

timesheetsui

DARPA time-sheets UI
TypeScript
1
star
39

aether-k8s

Makefile
1
star
40

aether-amp

Makefile
1
star
41

aether-docs

Python
1
star