|
1 | | -# ngsdn-tutorial |
| 1 | +# Next-Gen SDN Tutorial |
| 2 | + |
| 3 | +Welcome to Next-Gen SDN tutorial! |
| 4 | + |
| 5 | +This tutorial is targeted to developers who want to learn the basics of the |
| 6 | +building blocks of the NG-SDN architecture, such as: |
| 7 | + |
| 8 | +* Data plane programming and control via P4 and P4Runtime |
| 9 | +* Configuration via OpenConfig and gNMI |
| 10 | +* Stratum |
| 11 | +* ONOS |
| 12 | + |
| 13 | +The tutorial is organized around a sequence of hands-on exercises that show how |
| 14 | +to build an IPv6-based leaf-spine data center fabric. |
| 15 | + |
| 16 | +## Slides |
| 17 | + |
| 18 | +TODO |
| 19 | + |
| 20 | +Tutorial slides are available [online](ADD SLIDES URL). These slides provide an |
| 21 | +introduction to each exercise. We suggest you look at it before starting to work |
| 22 | +on the exercises. |
| 23 | + |
| 24 | +## Tutorial VM |
| 25 | + |
| 26 | +TODO |
| 27 | + |
| 28 | +To complete the exercises, you will need to download and run this tutorial VM |
| 29 | +(XX GB): |
| 30 | + * ADD LINK TO VM |
| 31 | + |
| 32 | +To run the VM you can use any modern x86 virtualization system. The VM has been |
| 33 | +tested with VirtualBox v6.0.6. To download VirtualBox and import the VM use the |
| 34 | +following links: |
| 35 | + |
| 36 | + * https://www.virtualbox.org/wiki/Downloads |
| 37 | + * https://docs.oracle.com/cd/E26217_01/E26796/html/qs-import-vm.html |
| 38 | + |
| 39 | +### Recommended system requirements |
| 40 | + |
| 41 | +The VM is configured with 4 GB of RAM and 4 CPU cores, while the disk has size |
| 42 | +of approx. 8 GB. These are the recommended minimum requirements to be able to |
| 43 | +run Ubuntu along with a Mininet network of 1-10 BMv2 devices controlled by 1 |
| 44 | +ONOS instance. For a flawless experience, we recommend running the VM on a host |
| 45 | +system that has at least the double of resources. |
| 46 | + |
| 47 | +### Use Docker instead of VM |
| 48 | + |
| 49 | +TODO Add instructions to skip downloading the VM but use Docker instead. |
| 50 | + |
| 51 | +### VM user credentials |
| 52 | + |
| 53 | +Use the following credentials to log in the Ubuntu system: |
| 54 | + |
| 55 | + * **Username:** `sdn` |
| 56 | + * **Password:** `rocks` |
| 57 | + |
| 58 | +### Get this tutorial repo |
| 59 | + |
| 60 | +To work on the exercises you will need to clone this repo inside the VM: |
| 61 | + |
| 62 | + cd ~ |
| 63 | + git clone https://github.com/opennetworkinglab/ngsdn-tutorial |
| 64 | + |
| 65 | +If the `tutorial` directory is already present, make sure to update its |
| 66 | +content: |
| 67 | + |
| 68 | + cd ~/ngsdn-tutorial |
| 69 | + git pull origin master |
| 70 | + |
| 71 | +### Download / upgrade dependencies |
| 72 | + |
| 73 | +The VM may have shipped with an older version of the dependencies than we would |
| 74 | +like to use for the exercises. You can upgrade to the latest version used for |
| 75 | +the tutorial using the following command: |
| 76 | + |
| 77 | + cd ~/ngsdn-tutorial |
| 78 | + make pull-deps |
| 79 | + |
| 80 | +This command will download all necessary dependencies from the Internet, |
| 81 | +allowing you to work off-line on the exercises. For this reason, we recommend |
| 82 | +running this step ahead of the tutorial with a reliable Internet connection. |
| 83 | + |
| 84 | + |
| 85 | +## Using an IDE to work on the exercises |
| 86 | + |
| 87 | +During the exercises you will need to write code in multiple languages such as |
| 88 | +P4, Python and Java. While the exercises do not prescribe the use of any |
| 89 | +specific IDE or code editor, the tutorial VM comes with Java IDE [IntelliJ IDEA |
| 90 | +Community Edition](https://www.jetbrains.com/idea/), already pre-loaded with |
| 91 | +plugins for P4 syntax highlighting and Python development. We suggest using |
| 92 | +IntelliJ IDEA especially when working on the ONOS app, as it provides code |
| 93 | +completion for all ONOS APIs. |
| 94 | + |
| 95 | +## Repo structure |
| 96 | + |
| 97 | +FIXME |
| 98 | + |
| 99 | +This repo is structured as follows: |
| 100 | + |
| 101 | + * `p4src/` P4 implementation |
| 102 | + * `app/` ONOS app Java implementation |
| 103 | + * `mininet/` Mininet script to emulate a 2x2 leaf-spine fabric topology of |
| 104 | + `stratum_bmv2` devices |
| 105 | + * `util/` Utilities (such as p4runtime-sh) |
| 106 | + |
| 107 | +## Tutorial commands |
| 108 | + |
| 109 | +To facilitate working on the exercises, we provide a set of make-based commands |
| 110 | +to control the different aspects of the tutorial. Commands will be introduced in |
| 111 | +the exercises, here's a quick reference: |
| 112 | + |
| 113 | +| Make command | Description | |
| 114 | +|---------------------|------------------------------------------------------- | |
| 115 | +| `make pull-deps` | Pull all required dependencies | |
| 116 | +| `make p4-build ` | Build the P4 program | |
| 117 | +| `make app-build ` | Build ONOS app | |
| 118 | +| `make start` | Start containers (`mininet` and `onos`) | |
| 119 | +| `make stop` | Stop and remove all containers | |
| 120 | +| `make onos-cli` | Access the ONOS CLI (password: `rocks`, Ctrl+D to exit)| |
| 121 | +| `make onos-ui` | Open the ONOS Web UI (user `onos` password `rocks`) | |
| 122 | +| `make mn-cli` | Access the Mininet CLI (Ctrl+P Ctrl+Q to exit) | |
| 123 | +| `make onos-log` | Show the ONOS log | |
| 124 | +| `make mn-log` | Show the Mininet log (i.e., the CLI output) | |
| 125 | +| `make netcfg` | Push netcfg.json file (network config) to ONOS | |
| 126 | +| `make app-reload` | Install and activate the ONOS app | |
| 127 | +| `make reset` | Reset the tutorial environment (to start from scratch) | |
| 128 | + |
| 129 | +### P4Runtime shell |
| 130 | + |
| 131 | +TODO add description |
| 132 | + |
| 133 | +Usage: |
| 134 | + |
| 135 | +```bash |
| 136 | +./util/p4rt-sh --grpc-addr localhost:50001 --config p4src/build/p4info.txt,p4src/build/bmv2.json |
| 137 | +``` |
| 138 | + |
| 139 | +## Exercises |
| 140 | + |
| 141 | +Click on the exercise name to see the instructions: |
| 142 | + |
| 143 | + 1. [P4 and P4Runtime basics](./EXERCISE-1.md) |
| 144 | + 2. [OpenConfig and gNMI Basic](./EXERCISE-2.md) |
| 145 | + 3. [Running ONOS](./EXERCISE-3.md) |
| 146 | + 4. [Modify ONOS app](./EXERCISE-4.md) |
| 147 | + |
| 148 | +## Solutions |
| 149 | + |
| 150 | +TODO do we really need this? |
| 151 | + |
| 152 | +You can find solutions for each exercise in the [solution](solution) directory. |
| 153 | +Feel free to compare your implementation to the reference one whenever you feel |
| 154 | +stuck. To use the solution code that is provided, simply use the same **make** |
| 155 | +commands in the solution directory. |
0 commit comments