{"id":25495954,"url":"https://github.com/opennetworkinglab/ngsdn-tutorial","last_synced_at":"2025-04-06T02:07:14.495Z","repository":{"id":42981054,"uuid":"205291370","full_name":"opennetworkinglab/ngsdn-tutorial","owner":"opennetworkinglab","description":"Hands-on tutorial to learn the building blocks of the Next-Gen SDN architecture","archived":false,"fork":false,"pushed_at":"2022-07-17T12:01:11.000Z","size":2227,"stargazers_count":333,"open_issues_count":41,"forks_count":187,"subscribers_count":23,"default_branch":"advanced","last_synced_at":"2025-03-30T01:04:09.118Z","etag":null,"topics":["gnmi","onos","openconfig","p4","p4runtime","stratum","yang"],"latest_commit_sha":null,"homepage":"https://www.opennetworking.org/ng-sdn/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opennetworkinglab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-30T02:43:43.000Z","updated_at":"2025-03-28T16:24:26.000Z","dependencies_parsed_at":"2022-08-12T10:10:56.112Z","dependency_job_id":null,"html_url":"https://github.com/opennetworkinglab/ngsdn-tutorial","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opennetworkinglab%2Fngsdn-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opennetworkinglab%2Fngsdn-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opennetworkinglab%2Fngsdn-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opennetworkinglab%2Fngsdn-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opennetworkinglab","download_url":"https://codeload.github.com/opennetworkinglab/ngsdn-tutorial/tar.gz/refs/heads/advanced","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423513,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnmi","onos","openconfig","p4","p4runtime","stratum","yang"],"created_at":"2025-02-19T00:52:48.648Z","updated_at":"2025-04-06T02:07:14.466Z","avatar_url":"https://github.com/opennetworkinglab.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Next-Gen SDN Tutorial (Advanced)\n\nWelcome to the Next-Gen SDN tutorial!\n\nThis tutorial is targeted at students and practitioners who want to learn about\nthe building blocks of the next-generation SDN (NG-SDN) architecture, such as:\n\n* Data plane programming and control via P4 and P4Runtime\n* Configuration via YANG, OpenConfig, and gNMI\n* Stratum switch OS\n* ONOS SDN controller\n\nTutorial sessions are organized around a sequence of hands-on exercises that\nshow how to build a leaf-spine data center fabric based on IPv6, using P4,\nStratum, and ONOS. Exercises assume an intermediate knowledge of the P4\nlanguage, and a basic knowledge of Java and Python. Participants will be\nprovided with a starter P4 program and ONOS app implementation. Exercises will\nfocus on concepts such as:\n\n* Using Stratum APIs (P4Runtime, gNMI, OpenConfig, gNOI)\n* Using ONOS with devices programmed with arbitrary P4 programs\n* Writing ONOS applications to provide the control plane logic\n  (bridging, routing, ECMP, etc.)\n* Testing using bmv2 in Mininet\n* PTF-based P4 unit tests\n\n## Basic vs. advanced version\n\nThis tutorial comes in two versions: basic (`master` branch), and advanced\n(this branch).\n\nThe basic version contains fewer exercises, and it does not assume prior\nknowledge of the P4 language. Instead, it provides a gentle introduction to it.\nCheck the `master` branch of this repo if you're interested in the basic\nversion.\n\nIf you're interested in the advanced version, keep reading.\n\n## Slides\n\nTutorial slides are available online:\n\u003chttp://bit.ly/adv-ngsdn-tutorial-slides\u003e\n\nThese slides provide an introduction to the topics covered in the tutorial. We\nsuggest you look at it before starting to work on the exercises.\n\n## System requirements\n\nIf you are taking this tutorial at an event organized by ONF, you should have\nreceived credentials to access the **ONF Cloud Tutorial Platform**, in which\ncase you can skip this section. Keep reading if you are interested in working on\nthe exercises on your laptop.\n\nTo facilitate access to the tools required to complete this tutorial, we provide\ntwo options for you to choose from:\n\n1. Download a pre-packaged VM with all included; **OR**\n2. Manually install Docker and other dependencies.\n\n### Option 1 - Download tutorial VM\n\nUse the following link to download the VM (4 GB):\n* \u003chttp://bit.ly/ngsdn-tutorial-ova\u003e\n\nThe VM is in .ova format and has been created using VirtualBox v5.2.32. To run\nthe VM you can use any modern virtualization system, although we recommend using\nVirtualBox. For instructions on how to get VirtualBox and import the VM, use the\nfollowing links:\n\n* \u003chttps://www.virtualbox.org/wiki/Downloads\u003e\n* \u003chttps://docs.oracle.com/cd/E26217_01/E26796/html/qs-import-vm.html\u003e\n\nAlternatively, you can use the scripts in [util/vm](util/vm) to build a VM on\nyour machine using Vagrant.\n\n**Recommended VM configuration:**\nThe current configuration of the VM is 4 GB of RAM and 4 core CPU. These are the\nrecommended minimum system requirements to complete the exercises. When\nimported, the VM takes approx. 8 GB of HDD space. For a smooth experience, we\nrecommend running the VM on a host system that has at least the double of\nresources.\n\n**VM user credentials:**\nUse credentials `sdn`/`rocks` to log in the Ubuntu system.\n\n### Option 2 - Manually install Docker and other dependencies\n\nAll exercises can be executed by installing the following dependencies:\n\n* Docker v1.13.0+ (with docker-compose)\n* make\n* Python 3\n* Bash-like Unix shell\n* Wireshark (optional)\n\n**Note for Windows users**: all scripts have been tested on macOS and Ubuntu.\nAlthough we think they should work on Windows, we have not tested it. For this\nreason, we advise Windows users to prefer Option 1.\n\n## Get this repo or pull latest changes\n\nTo work on the exercises you will need to clone this repo:\n\n    cd ~\n    git clone -b advanced https://github.com/opennetworkinglab/ngsdn-tutorial\n\nIf the `ngsdn-tutorial` directory is already present, make sure to update its\ncontent:\n\n    cd ~/ngsdn-tutorial\n    git pull origin advanced\n\n## Download / upgrade dependencies\n\nThe VM may have shipped with an older version of the dependencies than we would\nlike to use for the exercises. You can upgrade to the latest version using the\nfollowing command:\n\n    cd ~/ngsdn-tutorial\n    make deps\n\nThis command will download all necessary Docker images (~1.5 GB) allowing you to\nwork off-line. For this reason, we recommend running this step ahead of the\ntutorial, with a reliable Internet connection.\n\n## Using an IDE to work on the exercises\n\nDuring the exercises you will need to write code in multiple languages such as\nP4, Java, and Python. While the exercises do not prescribe the use of any\nspecific IDE or code editor, the **ONF Cloud Tutorial Platform** provides access\nto a web-based version of Visual Studio Code (VS Code).\n\nIf you are using the tutorial VM, you will find the Java IDE [IntelliJ IDEA\nCommunity Edition](https://www.jetbrains.com/idea/), already pre-loaded with\nplugins for P4 syntax highlighting and Python development. We suggest using\nIntelliJ IDEA especially when working on the ONOS app, as it provides code\ncompletion for all ONOS APIs.\n\n## Repo structure\n\nThis repo is structured as follows:\n\n * `p4src/` P4 implementation\n * `yang/` Yang model used in exercise 2\n * `app/` custom ONOS app Java implementation\n * `mininet/` Mininet script to emulate a 2x2 leaf-spine fabric topology of\n   `stratum_bmv2` devices\n * `util/` Utility scripts\n * `ptf/` P4 data plane unit tests based on Packet Test Framework (PTF)\n\n## Tutorial commands\n\nTo facilitate working on the exercises, we provide a set of make-based commands\nto control the different aspects of the tutorial. Commands will be introduced in\nthe exercises, here's a quick reference:\n\n| Make command        | Description                                            |\n|---------------------|------------------------------------------------------- |\n| `make deps`         | Pull and build all required dependencies               |\n| `make p4-build`     | Build P4 program                                       |\n| `make p4-test`      | Run PTF tests                                          |\n| `make start`        | Start Mininet and ONOS containers                      |\n| `make stop`         | Stop all containers                                    |\n| `make restart`      | Restart containers clearing any previous state         |\n| `make onos-cli`     | Access the ONOS CLI (password: `rocks`, Ctrl-D to exit)|\n| `make onos-log`     | Show the ONOS log                                      |\n| `make mn-cli`       | Access the Mininet CLI (Ctrl-D to exit)                |\n| `make mn-log`       | Show the Mininet log (i.e., the CLI output)            |\n| `make app-build`    | Build custom ONOS app                                  |\n| `make app-reload`   | Install and activate the ONOS app                      |\n| `make netcfg`       | Push netcfg.json file (network config) to ONOS         |\n\n## Exercises\n\nClick on the exercise name to see the instructions:\n\n 1. [P4Runtime basics](./EXERCISE-1.md)\n 2. [Yang, OpenConfig, and gNMI basics](./EXERCISE-2.md)\n 3. [Using ONOS as the control plane](./EXERCISE-3.md)\n 4. [Enabling ONOS built-in services](./EXERCISE-4.md)\n 5. [Implementing IPv6 routing with ECMP](./EXERCISE-5.md)\n 6. [Implementing SRv6](./EXERCISE-6.md)\n 7. [Trellis Basics](./EXERCISE-7.md)\n 8. [GTP termination with fabric.p4](./EXERCISE-8.md)\n\n## Solutions\n\nYou can find solutions for each exercise in the [solution](solution) directory.\nFeel free to compare your solution to the reference one whenever you feel stuck.\n\n[![Build Status](https://travis-ci.org/opennetworkinglab/ngsdn-tutorial.svg?branch=advanced)](https://travis-ci.org/opennetworkinglab/ngsdn-tutorial)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennetworkinglab%2Fngsdn-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopennetworkinglab%2Fngsdn-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennetworkinglab%2Fngsdn-tutorial/lists"}