├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .markdownlint.json ├── BuildONOSwithPINS.md ├── BuildTargetImage.md ├── CONTRIBUTING.md ├── Exercise1 └── README.md ├── Exercise2 ├── Figure1.svg └── README.md ├── Exercise3 ├── README.md ├── onf.p4info.pb.txt └── p4rt-client-setup.sh ├── Exercise4 ├── ONOS-Devices.png ├── ONOS-Flows.png ├── ONOS-Hosts.png ├── ONOS-Links.png ├── ONOS-Pending-Add.png ├── ONOS-Topology.png ├── README.md ├── flow-objectives.sh ├── forward-switch1-host1.json ├── forward-switch1-host2.json ├── forward-switch2-host1.json ├── forward-switch2-host2.json ├── next-switch1-host1.json ├── next-switch1-host2.json ├── next-switch2-host1.json ├── next-switch2-host2.json └── tutorial-netconfig.json ├── Exercise5 ├── PINS-Demo-Topology.png ├── README.md ├── leaf-arista-BF │ ├── config_db.json │ └── deploy.sh ├── leaf-arista-TH3 │ ├── config_db.json │ ├── deploy.sh │ ├── port_config.ini │ └── th3-a7060dx4-c32-32x400G.config.bcm ├── onos-topology │ └── netconfig.json ├── spine-accton-BF │ ├── config_db.json │ └── deploy.sh └── spine-arista-TH3 │ ├── config_db.json │ ├── deploy.sh │ ├── port_config.ini │ └── th3-a7060dx4-c32-32x400G.config.bcm ├── LICENSE ├── README.md └── References.md /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: [ main ] 5 | pull_request: 6 | branches: [ main ] 7 | jobs: 8 | test: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: markdownlint-cli 13 | uses: nosborn/github-action-markdown-cli@v3.0.1 14 | with: 15 | files: . 16 | config_file: .markdownlint.json 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "fenced-code-language": false, 3 | "first-line-h1": false, 4 | "line-length": { 5 | "code_block_line_length": 180 6 | }, 7 | "ol-prefix": false, 8 | "ul-indent": { 9 | "indent": 4 10 | } 11 | } -------------------------------------------------------------------------------- /BuildONOSwithPINS.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Build ONOS with PINS 8 | 9 | This section provides instructions to build ONOS and add the PINS driver and SAI 10 | pipeliner. You may use this to customize the SAI pipeliner for your network. 11 | 12 | ### Method 1 (recommended): Building ONOS with required PINS apps 13 | 14 | The Docker image that was used in Exercise 4 (`dmoro92/pins-onos:0.0.1`) is 15 | hosted on [Docker Hub](https://hub.docker.com/r/dmoro92/pins-onos/tags). 16 | 17 | If you'd like to build the image yourself, you can download the Dockerfile and 18 | supporting code from [Github](https://github.com/pins/pins-onos) and follow the 19 | instructions in the `README.md`. 20 | 21 | The following prerequisites are required: 22 | 23 | * Docker is running, and the build user has permissions to create and run 24 | containers/images 25 | * python 3 and python 3 pip 26 | * j2cli library (installed via pip) 27 | 28 | ### Method 2: Building ONOS separately 29 | 30 | You will need to run a single instance of ONOS. The ONOS wiki, [Single Instance 31 | Docker 32 | Deployment](https://wiki.onosproject.org/display/ONOS/Single+Instance+Docker+deployment), 33 | provides additional details. If you prefer to build ONOS yourself, follow the 34 | instructions in the [ONOS Github 35 | repository](https://github.com/opennetworkinglab/onos). 36 | 37 | * This docker run command will also pull the latest version of ONOS. 38 | 39 | ``` 40 | docker run --rm -t -d -p 8181:8181 -p 8101:8101 -p 5005:5005 -p 830:830 --name onos onosproject/onos:latest 41 | ``` 42 | 43 | * Verify that ONOS and p4rt are running. 44 | 45 | ``` 46 | docker ps 47 | ``` 48 | 49 | #### PINS ONOS Driver and SAI Pipeliner 50 | 51 | If you started ONOS using Method #2, use the following steps to build the 52 | SONiC/PINS driver and SAI pipeliner. They will need to be manually installed on 53 | the ONOS instance you just started. 54 | 55 | 1. Clone the PINS/sonic-onos-driver repository using one of the following: 56 | * HTTPS: `git clone https://github.com/pins/sonic-onos-driver.git` 57 | * SSH: `git clone git@github.com:pins/sonic-onos-driver.git` 58 | * GitHub CLI: `gh repo clone pins/sonic-onos-driver` 59 | 2. Go to the new directory: `cd sonic-onos-driver` 60 | 3. Run `make build_driver build_pipeliner` 61 | 4. Run `make push_driver push_pipeliner [ONOS_IP=$ONOS_IP_ADDR] 62 | [ONOS_PORT=$ONOS_API_PORT]` 63 | * `ONOS_IP` default value is `localhost` 64 | * `ONOS_PORT` default value is `8181` 65 | -------------------------------------------------------------------------------- /BuildTargetImage.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Build SONiC/PINS Target Image 8 | 9 | ### Initialize Build Environment 10 | 11 | This section provides instructions to build your target image. After you build 12 | your image, follow the instructions in [Exercise 1 - Deploy SONiC/PINS Target 13 | Image to Switches](./Exercise1). 14 | 15 | The following software is needed to build the image: `curl, zip, unzip, tar, 16 | python,` and `j2cli`. If you need to do a local build of the ONOS driver and SAI 17 | pipeline, you will also need `maven` and a Java JDK. 18 | 19 | 1. Clone the PINS/sonic-buildimage repository using one of the following: 20 | * HTTPS: `git clone https://github.com/sonic-net/sonic-buildimage.git` 21 | * SSH: `git clone git@github.com:sonic-net/sonic-buildimage.git` 22 | * Github CLI: `gh repo clone sonic-net/sonic-buildimage` 23 | 2. Change to the new directory: `cd sonic-buildimage` 24 | 3. Download submodules and checkout the correct commit number: `make init` 25 | 26 | ### Build Target Binary 27 | 28 | Configure your build variables (`$BUILD_VARS`) on the command line or in the 29 | `rules/config` file. Here are some examples: 30 | 31 | * Debian Buster is the currently supported version; hence use `NOJESSIE=1 32 | NOSTRETCH=1` 33 | * The default password for the admin user, `YourPaSsWoRd,` should be overridden 34 | with a local value. 35 | * Setting the cache method, `SONIC_DPKG_CACHE_METHOD=rwcache`, speeds up the 36 | build process (after the first time) by caching non-SONiC specific build 37 | products such as the Linux kernel. 38 | * Set `INCLUDE_P4RT=y` to build the P4RT app and configure the image to run it 39 | * `INCLUDE_P4RT` is the name in rules/config 40 | * `SONIC_INCLUDE_P4RT=y` is used on the command line 41 | * Confirm by looking at the `INCLUDE_P4RT` line in the build config when 42 | starting any build 43 | 44 | Sample values for `$DESIRED_PLATFORM` are `barefoot, broadcom, marvell, 45 | mellanox, cavium, centec, nephos, innovium, vs`. 46 | 47 | Run the make commands. 48 | 49 | 1. Configure the desired platform. \ 50 | `$BUILD_VARS make configure PLATFORM=$DESIRED_PLATFORM` 51 | 2. (Optional) Determine the target list for the configured PLATFORM. \ 52 | `$BUILD_VARS make list` 53 | * Many individual software targets are listed, as well as the platform 54 | target with the form: `target/sonic-$PLATFORM.bin` or 55 | `target/sonic-$PLATFORM.swi` 56 | 3. Build the target. \ 57 | `$BUILD_VARS make target/sonic-$PLATFORM.bin` 58 | 59 | Examples: 60 | 61 | ``` 62 | NOJESSIE=1 NOSTRETCH=1 make configure PLATFORM=barefoot 63 | 64 | NOJESSIE=1 NOSTRETCH=1 PASSWORD=passwd make target/sonic-barefoot.bin 65 | ``` 66 | 67 | ### Monitoring and Troubleshooting 68 | 69 | * Individual logs and artifacts 70 | * Deb target logs and artifacts will be in `target/deb/buster` 71 | * Python Deb target logs and artifacts will be in `target/python-debs` 72 | * Python Wheel target logs and artifacts will be in `target/python-wheels` 73 | * Docker backup files and logs, and the actual switch target file and log 74 | file will be in `target` 75 | * The first time you make a target will be very time-consuming. Use the 76 | `rwcache` option to speed up subsequent makes. 77 | * Due to race conditions, the build may fail. However, if you rerun the make 78 | command, it may succeed the second time. We have seen this for the `barefoot` 79 | target. 80 | * If an error occurs during SONiC build, try `make local_build_driver` and `make 81 | local_build_pipeliner.` \ 82 | We tested with JDK 11 / Maven 3.6.3 installed. If you want to use a newer JDK, 83 | you may also need a more recent Maven version (e.g., try JDK 17 / Maven 3.8). 84 | * Check the version of JDK: 85 | 86 | ``` 87 | java --version 88 | mvn --version 89 | ``` 90 | 91 | * To change version: 92 | 93 | ``` 94 | sudo update-java-alternatives -s java-1.11.0-openjdk-amd64 95 | ``` 96 | 97 | * To install maven and jdk, if they aren’t installed: 98 | 99 | ``` 100 | sudo apt update 101 | sudo apt install maven 102 | sudo apt install openjdk-11-jdk-headless 103 | ``` 104 | 105 | * Build the driver and pipeliner locally: 106 | 107 | ``` 108 | sudo make local_build_driver local_build_pipeliner 109 | ``` 110 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | # How to Contribute 8 | 9 | We'd love to accept your patches and contributions to this project. There are 10 | just a few small guidelines you need to follow. 11 | 12 | ## Contributor License Agreement 13 | 14 | Contributions to this project must be accompanied by a Contributor License 15 | Agreement. You (or your employer) retain the copyright to your contribution, 16 | this simply gives us permission to use and redistribute your contributions as 17 | part of the project. Head over to to see 18 | your current agreements on file or to sign a new one. 19 | 20 | You generally only need to submit a CLA once, so if you've already submitted one 21 | (even if it was for a different project), you probably don't need to do it 22 | again. 23 | 24 | ## Guides, Rules and Best Practices 25 | 26 | Feel free to directly contribute corrections or tips to the tutorial. 27 | 28 | If you'd like to contribute something more substantial (e.g. a new exercise), we 29 | would encourage you to first open up a new issue to discuss your proposal. 30 | 31 | ### Steps to successful PRs 32 | 33 | 1. Fork Stratum into your personal or organization account via the fork button 34 | on GitHub. 35 | 36 | 1. Make your changes. 37 | 38 | 1. Run the Markdown linter and fix any issues: 39 | 40 | ``` 41 | docker run -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest **/*.md 42 | ``` 43 | 44 | 1. Create a [Pull Request](https://github.com/stratum/stratum/compare). Consider 45 | [allowing maintainers](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) 46 | to make changes if you want direct assistance from maintainers. 47 | 48 | 1. Await review. Everyone can comment on code changes, but only Collaborators 49 | and above can give final review approval. **All changes must get at least one 50 | approval**. Join one of the [communication channels](https://wiki.opennetworking.org/display/COM/Stratum+Wiki+Home+Page) 51 | to request a review or to bring additional attention to your PR. 52 | 53 | ### VSCode tips 54 | 55 | There are two plugins that will help you keep your Markdown compliant: 56 | 57 | * [Reflow Markdown](https://marketplace.visualstudio.com/items?itemName=marvhen.reflow-markdown) 58 | * Press Alt-Q to reform a line, or Ctrl-A (select all) then Alt-Q to 59 | reformat the whole file) 60 | * [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) 61 | * Markdown errors are underlined in yellow in realtime 62 | * Check out the "Problems" panel at the bottom to see Markdown errors 63 | * Press Shift-Alt-F to fix some style issues 64 | 65 | ## Community Guidelines 66 | 67 | This project follows [Google's Open Source Community Guidelines](https://opensource.google.com/conduct/) 68 | and ONF's [Code of Conduct](CODE_OF_CONDUCT.md). 69 | -------------------------------------------------------------------------------- /Exercise1/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Exercise 1 - Deploy SONiC/PINS Target Image to Switches 8 | 9 | This exercise will take you through the deployment of the SONiC/PINS target 10 | image on your switches. If you have questions about SONiC deployment, see the 11 | [SONiC documentation](https://github.com/sonic-net/SONiC/wiki/). 12 | 13 | ### Get the SONiC/PINS Target Image(s) for Your Switches 14 | 15 | SONiC/PINS images for select targets are currently available on Github. There is 16 | one SONiC/PINS image per ASIC, so be sure to select the correct image for your 17 | switch. Most images end in `.bin`, except Arista switches, which end in `.swi`. 18 | 19 | You can either access the image directly on Github or copy the image to your 20 | local server or switch. This tutorial illustrates some of your choices, but 21 | getting the image is up to you. Your hardware vendor may have switch-specific 22 | instructions to acquire and load software. 23 | 24 | To copy the link from Github, go to [PINS 25 | releases](https://github.com/pins/sonic-buildimage-public/releases/tag/202106-10-27), 26 | select your target image, and copy the URL. 27 | 28 | Example URL for a Broadcom-based target image from Github: 29 | 30 | ``` 31 | https://github.com/pins/sonic-buildimage-public/releases/download/202106-10-27/sonic-broadcom.bin 32 | ``` 33 | 34 | *Note: The default username/password for PINS images on Github is:* 35 | `admin/admin` 36 | 37 | If you are a systems integrator and you are creating a custom image for your 38 | switch, you will need to follow the instructions in [Build SONiC/PINS Target 39 | Image](../BuildTargetImage.md). For help, please use the SONiC/PINS support 40 | channels. 41 | 42 | ### Installers 43 | 44 | Three installers are available to deploy the SONiC/PINS target image. 45 | 46 | 1. The SONiC installer upgrades a switch with SONiC installed to SONiC/PINS. 47 | (brownfield) \ 48 | Reference: [SONiC 49 | installer](https://github.com/sonic-net/SONiC/blob/master/doc/SONiC-User-Manual.md#3231-sonic-installer) 50 | 2. The ONIE installer bootstraps a switch without SONiC. If your switch does not 51 | have ONIE, you will need to install it first. (greenfield) \ 52 | Reference: [SONiC ONIE installation 53 | instructions](https://github.com/sonic-net/SONiC/blob/master/doc/SONiC-User-Manual.md#1121-install-sonic-onie-image) 54 | 3. The Aboot installer bootstraps Arista switches without SONiC. (greenfield) \ 55 | Reference: [SONiC EOS installation 56 | instructions](https://github.com/sonic-net/SONiC/blob/master/doc/SONiC-User-Manual.md#1122-install-sonic-eos-image) 57 | 58 | #### SONiC Installer 59 | 60 | Login via `ssh` to a switch that is running SONiC and use the `sonic-installer` 61 | application as root (or using `sudo`) to manage and upgrade target images. The 62 | new SONiC/PINS target image must be loaded on the switch or available on the 63 | network. 64 | 65 | `sonic-installer` 66 | | command | Description | 67 | |-------------------|--------------------------------------------------------| 68 | | cleanup | Remove installed images except *current* and *next*. | 69 | | install | Install image from local binary or URL. | 70 | | list | List installed images. | 71 | | remove | Uninstall an image. | 72 | | rollback-docker | Rollback docker image to the previous version. | 73 | | set-default | Choose the default image to boot from. | 74 | | set-next-boot | Choose an image for the next reboot (one-time action). | 75 | | upgrade-docker | Upgrade docker image from local binary or URL. | 76 | | verify-next-image | Verify the next image for a reboot. | 77 | 78 | 1. Install the SONiC/PINS target image directly from GitHub, or via HTTP on 79 | another server, or using a local image: 80 | 81 | ``` 82 | Switch$ sudo sonic-installer install 83 | ``` 84 | 85 | or 86 | 87 | ``` 88 | Switch$ sudo sonic-installer install http://$IMAGE_SERVER/$IMAGE_DIR/$IMAGE 89 | ``` 90 | 91 | or 92 | 93 | ``` 94 | Switch$ sudo sonic-installer install /home/admin/$IMAGE 95 | ``` 96 | 97 | 2. Reboot the switch for the “**Next**” image to run. 98 | 99 | ``` 100 | Switch$ sudo reboot now 101 | ``` 102 | 103 | Example: 104 | 105 | ``` 106 | Switch$ sudo sonic-installer install https://github.com/pins/sonic-buildimage-public/releases/download/202106-10-27/sonic-broadcom.bin 107 | New image will be installed, continue? [y/N]: y 108 | Downloading image... 109 | ...99%, 1030 MB, 10348 KB/s, 0 seconds left... 110 | 111 | Installing image SONiC-OS-pins_202106-10.27.21.0-59cbf5b58 and setting it as default... 112 | … 113 | Done 114 | 115 | Switch$ sudo sonic-installer list 116 | Current: SONiC-OS-pins_202106-10.27.21.0-59cbf5b58 117 | Next: SONiC-OS-pins_202106-10.27.21.0-59cbf5b58 118 | Available: 119 | SONiC-OS-pins_202106-10.27.21.0-59cbf5b58 120 | SONiC-OS-master.0-dirty-20220107.112242 121 | 122 | Switch$ sudo reboot now 123 | ``` 124 | 125 | #### ONIE Installer 126 | 127 | The ONIE installer does not necessarily have SSL installed to get a target image 128 | directly from GitHub. One alternative is to download the target image onto your 129 | server (e.g., `wget`) and run a web server (e.g., python’s `SimpleHTTPSever`) to 130 | give local access to the image (e.g., 131 | `http://${YOUR_IP}:8000/sonic-broadcom.bin`). 132 | 133 | 1. Make the target image accessible to ONIE on your switch. 134 | 135 | Example: 136 | 137 | ``` 138 | Server$ wget https://github.com/pins/sonic-buildimage-public/releases/download/202106-10-27/sonic-broadcom.bin 139 | Server$ python -m SimpleHTTPServer 140 | ``` 141 | 142 | 2. Instead of logging in to the switch via `ssh`, you will need to connect a 143 | console cable (e.g., USB, DB-9) from the switch to an adjacent computer. 144 | Then, open the console software (e.g., `screen` or `minicom`) and connect to 145 | the switch over the serial port. Note that the baud rate is switch-specific 146 | for the serial port you are using. 147 | 148 | Examples: 149 | 150 | ``` 151 | Server$ sudo screen /dev/ttyUSB0 115200 152 | Server$ sudo screen /dev/ttyUSB1 115200 153 | ``` 154 | 155 | If the `screen` program acts unexpectedly, use `Ctrl-a d` to exit `screen` 156 | and then reset the console connection. (unplug the cable) 157 | 158 | 3. Log in to the switch (default username/password is "admin/YourPaSsWoRd" for 159 | SONiC images and "admin/admin" for PINS images) and reboot. 160 | 161 | ``` 162 | Switch$ sudo reboot now 163 | ``` 164 | 165 | 4. Use the arrow key from the Grub menu to select `ONIE`, then select `ONIE 166 | Installer`. 167 | 5. When you see the message, “*ONIE Starting ONIE Service Discovery*,” enter the 168 | following command. 169 | 170 | ``` 171 | ONIE# onie-discovery-stop 172 | ``` 173 | 174 | 6. Install the target image. 175 | 176 | Example installation from ONF’s server (10.128.13.243) in step 1: 177 | 178 | ``` 179 | ONIE# onie-nos-install http://10.128.13.243:8000/sonic-broadcom.bin 180 | ``` 181 | 182 | 7. After the software is loaded, it will reboot and present you with a SONiC 183 | login prompt. 184 | 185 | #### Aboot Installer 186 | 187 | The Aboot installer does not necessarily have SSL installed to get a target 188 | image directly from GitHub. One alternative is to download the target image onto 189 | your server (e.g., `wget`) and run a web server (e.g., python’s 190 | `SimpleHTTPSever`) to give local access to the image (e.g., 191 | `http://${YOUR_IP}:8000/sonic-aboot.broadcom.swi).` 192 | 193 | 1. Make the target image accessible to Aboot on your switch. 194 | 195 | Example: 196 | 197 | ``` 198 | Server$ wget https://github.com/pins/sonic-buildimage-public/releases/download/202106-10-27/sonic-aboot.broadcom.swi 199 | Server$ python -m SimpleHTTPServer 200 | ``` 201 | 202 | 2. Instead of logging in to the switch via `ssh`, you will need to connect a 203 | console cable (e.g., USB, DB-9) from the switch to an adjacent computer. 204 | Then, open the console software (e.g., `screen` or `minicom`) and connect to 205 | the switch over the serial port. Note that the baud rate is switch-specific 206 | for the serial port you are using. 207 | 208 | Example: 209 | 210 | ``` 211 | Server$ sudo screen /dev/ttyUSB3 212 | ``` 213 | 214 | If the `screen` program acts unexpectedly, use `Ctrl-a d` to exit `screen` 215 | and then reset the console connection. (unplug the cable) 216 | 217 | 3. Log in to the switch (default username/password is "admin/YourPaSsWoRd" for 218 | SONiC images and "admin/admin" for PINS images) and reboot. 219 | 220 | ``` 221 | Switch$ sudo reboot now 222 | ``` 223 | 224 | NOTE: You can stop syslog messages with `sudo dmesg -D` 225 | 226 | 4. When prompted, hold down `Ctrl-c` to get to the Aboot menu. 227 | 5. Get an IP address for the switch by running a DHCP client, if necessary. 228 | 229 | ``` 230 | Aboot# udhcpc 231 | ``` 232 | 233 | 6. Follow switch-specific instructions from your hardware vendor to acquire and 234 | load software in the expected location. In this case, the image is expected 235 | to be in the `/mnt/flash` directory. \ 236 | Example: 237 | 238 | ``` 239 | Aboot# cd /mnt/flash 240 | Aboot# wget http://10.128.13.243:8000/sonic-aboot.broadcom.swi 241 | ``` 242 | 243 | 7. Boot the new image. 244 | 245 | ``` 246 | Aboot# boot sonic-aboot.broadcom.swi 247 | ``` 248 | 249 | 8. Once the software is loaded, it will reboot and present you with a SONiC 250 | login prompt. 251 | 252 | ### Validate SONiC/PINS Installation 253 | 254 | Log in to the switch and verify that the installation is correct. (NOTE: It may 255 | take 3 to 5 minutes for all containers to be up.) The examples below are from 256 | the configuration at ONF. 257 | 258 | 1. Verify that the installed version is the expected version of SONiC with PINS. 259 | 260 | ``` 261 | Switch$ show version 262 | SONiC Software Version: SONiC.pins_202106-10.27.21.0-59cbf5b58 263 | ``` 264 | 265 | 2. Verify that P4Runtime (P4RT) is running by checking that the container is up. 266 | 267 | ``` 268 | Switch$ docker ps 269 | 1ef0e269306a docker-sonic-p4rt:latest "/usr/local/bin/supe…" 6 days ago Up 6 days p4rt 270 | ``` 271 | 272 | 3. Verify that P4Runtime (P4RT) is running by checking that the container is up 273 | and bound to port 9559: 274 | 275 | ``` 276 | Switch$ sudo netstat -lpnt | grep p4rt 277 | tcp6 0 0 :::9559 :::* LISTEN 2346/p4rt 278 | ``` 279 | 280 | ### Troubleshooting 281 | 282 | If p4rt is not running correctly and you need to restart it, use the following 283 | command. 284 | 285 | ``` 286 | Switch$ sudo service p4rt restart 287 | ``` 288 | 289 | Use` show logging -f `to tail the log file and watch for errors. You may want to 290 | filter for p4rt: 291 | 292 | ``` 293 | Switch$ show logging -f | grep p4rt 294 | ``` 295 | 296 | If you see the following message, SONiC/PINS has gone into a critical state and 297 | will not accept any writes until the device is rebooted: 298 | 299 | ``` 300 | Sep 17 20:35:13.681725 pins-as7712-3 NOTICE p4rt#p4rt: :- CallLuaScript: Component p4rt:p4rt successfully updated state from UP to ERROR. 301 | ``` 302 | 303 | You can look at previous messages to determine why this occurred. One 304 | possibility is that ONOS is running in your network and pushing a different 305 | version of p4info to the switch. ***The P4 pipeline can only be pushed once 306 | before you configure the routes.*** If ONOS is running on a server connected to 307 | the switch, kill the docker container for ONOS. Regardless of the cause of a 308 | critical state, we recommend that you reboot your switches. 309 | 310 | The `pmon` and `snmp` processes will log numerous errors unless configured with 311 | NMS. To eliminate those errors, use the following command. 312 | 313 | ``` 314 | Switch$ show logging -f | grep -v pmon | grep -v snmp 315 | ``` 316 | 317 | Check `/etc/sonic/config_db.json` for interface configuration. A mismatched FEC 318 | prevents the interface from going to an UP/UP state. If you modify this file, 319 | use the `sudo config reload -y` command to restart the docker containers and 320 | incorporate the changes. 321 | 322 | The [Troubleshooting 323 | section](https://github.com/sonic-net/SONiC/blob/master/doc/SONiC-User-Manual.md#6-troubleshooting) 324 | of the SONiC User Manual is helpful if you run into problems. 325 | 326 | ### Note About Custom Configuration 327 | 328 | The primary SONiC configuration file, `/etc/sonic/config_db.json`, is specific 329 | to a switch/ASIC combination. If you get the SONiC/PINS image described above, 330 | you will have the default file for the target. Instead, you may get the 331 | configuration file from your switch vendor, or you may customize it yourself. As 332 | you follow this tutorial, you may notice extraneous hosts, devices, or links as 333 | SONiC tries to implement the configuration in `config_db.json`. 334 | 335 | This tutorial assumes you understand your network requirements, and you can 336 | choose to ignore any configuration that is not relevant to the exercises in this 337 | tutorial. Alternatively, you could remove any configuration not part of this 338 | tutorial. One example is BGP configuration commands, which are not part of these 339 | SDN exercises. You could edit the file to remove anything you don’t want to see, 340 | or you could use a simple script such as the following example to remove BGP 341 | from the configuration file on your switch. 342 | 343 | ``` 344 | cat /etc/sonic/config_db.json | jq 'del(.BGP_NEIGHBOR)|del(.INTERFACE)' | sudo tee /etc/sonic/config_db.json >/dev/null 345 | ``` 346 | 347 | The compiled P4 program, `onf.p4info.pb.txt`, contains ACLs. If your switch does 348 | not support ACLs, you will need to modify the P4 program and recompile it for 349 | your switch. 350 | -------------------------------------------------------------------------------- /Exercise2/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Exercise 2 - Configure Tutorial Network 8 | 9 | The tutorial configuration consists of a server (it can be a laptop), two 10 | switches, and two hosts, as shown in the following diagram. There are a variety 11 | of ways that you could implement this configuration, such as using two servers 12 | or using namespaces, lxc containers, or VMs on a single server. For simplicity, 13 | we show two separate hosts. 14 | 15 | This exercise will set up the host interfaces and internal routes. Then you will 16 | set up the SONiC switch interfaces. You will not be able to ping between the two 17 | hosts because the routes between the switches do not exist yet (we have not 18 | configured BGP or any other embedded control protocol). 19 | 20 | ### Figure 1 - Tutorial Sample Configuration 21 | 22 | ![drawing](Figure1.svg) 23 | 24 | ### Verify Connections 25 | 26 | Verify that the switch is wired correctly to the hosts and that the speed within 27 | each pair of connected interfaces matches. 28 | 29 | 1. Login (`ssh`) to each switch and check the interface speed and that the 30 | expected interfaces are up. Reference: [SONiC Interfaces command 31 | reference](https://github.com/sonic-net/sonic-utilities/blob/master/doc/Command-Reference.md#interfaces) 32 | 33 | ``` 34 | Switch$ show interfaces status 35 | 36 | Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC 37 | 38 | ----------- --------------- ------- ----- ----- ------------- ------ ------ ------- ------ ---------- 39 | Ethernet0 49,50,51,52 100G 9100 N/A hundredGigE1 routed up up N/A N/A 40 | Ethernet4 53,54,55,56 100G 9100 N/A hundredGigE2 routed down up N/A N/A 41 | … 42 | Ethernet100 117,118,119,120 100G 9100 N/A hundredGigE26 routed down up N/A N/A 43 | Ethernet104 121,122,123,124 100G 9100 N/A hundredGigE27 routed up up N/A N/A 44 | Ethernet108 125,126,127,128 100G 9100 N/A hundredGigE28 routed down up N/A N/A 45 | Ethernet112 1,2,3,4 100G 9100 N/A hundredGigE29 routed down up N/A N/A 46 | Ethernet116 5,6,7,8 100G 9100 N/A hundredGigE30 routed down up N/A N/A 47 | Ethernet120 9,10,11,12 40G 9100 N/A hundredGigE31 routed up up N/A N/A 48 | Ethernet124 13,14,15,16 100G 9100 N/A hundredGigE32 routed down up N/A N/A 49 | ``` 50 | 51 | 2. If an expected connection is down, login (`ssh`) to the host(s). One 52 | potential problem is that the host interface speed does not match the switch 53 | interface speed. Check the speed on the host and, if necessary, change the 54 | switch’s interface speed to match the host. 55 | 56 | ``` 57 | host1$ ethtool enp3s0f1 58 | host2$ ethtool enp3s0f0 59 | switch1$ sudo config interface speed Ethernet120 40000 60 | switch2$ sudo config interface speed Ethernet120 40000 61 | ``` 62 | 63 | 3. If the links are not up, set them to up. 64 | 65 | ``` 66 | host1$ sudo ip link set up enp3s0f1 67 | host2$ sudo ip link set up enp3s0f0 68 | ``` 69 | 70 | 4. Verify on both switches. 71 | 72 | ``` 73 | switch1$ show interfaces status 74 | switch2$ show interfaces status 75 | ``` 76 | 77 | ### Host Interfaces 78 | 79 | 1. On each host, set a new IP address and the outgoing route as needed for your 80 | network configuration (e.g., if using namespaces, set up a default route 81 | using the command, `ip route add default via 10.2.1.0`). 82 | 2. Then verify the IP address and route. 83 | 84 | Examples: 85 | 86 | ``` 87 | host1$ sudo ip address add 10.1.1.2/24 dev enp3s0f1 88 | host1$ sudo ip route add 10.2.2.0/24 via 10.1.1.1 89 | host1$ ip address 90 | 2: enp3s0f1: mtu 1500 qdisc mq state UP group default qlen 1000 91 | link/ether 40:a6:b7:28:be:d9 brd ff:ff:ff:ff:ff:ff 92 | inet 10.1.1.2/24 scope global enp3s0f1 93 | valid_lft forever preferred_lft forever 94 | inet6 fe80::42a6:b7ff:fe28:bed9/64 scope link 95 | valid_lft forever preferred_lft forever 96 | host1$ ip route 97 | 10.1.1.0/24 dev enp3s0f1 proto kernel scope link src 10.1.1.2 98 | 10.2.2.0/24 via 10.1.1.1 dev enp3s0f1 99 | host2$ sudo ip address add 10.2.2.2/24 dev enp3s0f0 100 | host2$ sudo ip route add 10.1.1.0/24 via 10.2.2.1 101 | host2$ ip address 102 | 2: enp3s0f0: mtu 1500 qdisc mq state UP group default qlen 1000 103 | link/ether 40:a6:b7:28:be:d8 brd ff:ff:ff:ff:ff:ff 104 | inet 10.2.2.2/24 scope global enp3s0f0 105 | valid_lft forever preferred_lft forever 106 | inet6 fe80::42a6:b7ff:fe28:bed8/64 scope link 107 | valid_lft forever preferred_lft forever 108 | host2$ ip route 109 | 10.1.1.0/24 via 10.2.2.1 dev enp3s0f0 110 | 10.2.2.0/24 dev enp3s0f0 proto kernel scope link src 10.2.2.2 111 | ``` 112 | 113 | ### Switch Interfaces 114 | 115 | 1. Configure the switch interfaces with IP addresses in the same subnet as the 116 | IP addresses in your hosts. If you need to reboot your switches in exercises 117 | 3 or 4, remember to repeat this step. 118 | 119 | ``` 120 | switch1$ sudo config interface ip add Ethernet120 10.1.1.1/24 121 | switch2$ sudo config interface ip add Ethernet120 10.2.2.1/24 122 | ``` 123 | 124 | 2. Verify on both switches. 125 | 126 | ``` 127 | switch1$ show ip interfaces 128 | Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP 129 | ----------- -------- ------------------- ------------ -------------- ------------- 130 | Ethernet120 10.1.1.1/24 up/up N/A N/A 131 | 132 | switch2$ show ip interfaces 133 | Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP 134 | ----------- -------- ------------------- ------------ -------------- ------------- 135 | Ethernet120 10.2.2.1/24 up/up N/A N/A 136 | ``` 137 | 138 | 3. Clearing counters will make it easier to monitor the traffic in this 139 | exercise. 140 | 141 | ``` 142 | switch1$ sonic-clear counters 143 | switch2$ sonic-clear counters 144 | ``` 145 | 146 | 4. We _cannot_ ping the new addresses because we have not set up a route yet. 147 | 148 | ``` 149 | host1$ ping 10.2.2.2 (doesn’t work) 150 | host2$ ping 10.1.1.2 (doesn’t work) 151 | ``` 152 | 153 | 5. Check interface counters and observe that the pings work in one direction. 154 | 155 | ``` 156 | switch1$ show interfaces counters 157 | switch2$ show interfaces counters 158 | ``` 159 | -------------------------------------------------------------------------------- /Exercise3/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Exercise 3 - Set Up Pipeline and Routes 8 | 9 | There are several ways to set up an SAI pipeline and routes. This exercise uses 10 | the [P4RT client](https://github.com/pins/p4rt-client), and the next exercise 11 | uses ONOS. The [P4RT shell](https://github.com/p4lang/p4runtime-shell) is 12 | another alternative not currently illustrated in this tutorial. For this 13 | exercise, we will use `p4rt-client` to isolate our initial SONiC behavior via 14 | the PINS P4Runtime interface. You will be able to ping between your two hosts 15 | through the PINS fabric at the end of this exercise. 16 | 17 | If you prefer to skip this exercise, you can move directly to [Exercise 4 - 18 | Deploy and Configure ONOS](../Exercise4) section and use flow objectives to set 19 | up the routes. 20 | 21 | ### Starting From Scratch 22 | 23 | This section contains tips to help you get a clean system, especially if you 24 | have run through these exercises previously. 25 | 26 | 1. Make sure that ONOS is not already running. 27 | 28 | ``` 29 | Server$ docker kill onos 30 | ``` 31 | 32 | 2. Make sure the option, `-default_vrf_id=vrf-0`, is _not_ in the `p4rt.sh` 33 | file. 34 | 35 | ``` 36 | Switch$ docker exec p4rt cat /usr/bin/p4rt.sh 37 | P4RT_ARGS=" -default_vrf_id=vrf-0 --alsologtostderr --logbuflevel=-1 " 38 | ``` 39 | 40 | 3. If it is there, remove it with the following command, verify, and reload the 41 | configuration. 42 | 43 | ``` 44 | Switch$ docker exec p4rt sed -i 's/ -default_vrf_id=vrf-0//g' /usr/bin/p4rt.sh 45 | Switch$ docker exec p4rt cat /usr/bin/p4rt.sh 46 | Switch$ sudo config reload -yf 47 | ``` 48 | 49 | If you reload the configuration on your switches or reboot them, review Exercise 50 | 2. Here is a summary of the commands you may need. 51 | 52 | 1. Are there any custom interface requirements, such as speed? 53 | 54 | ``` 55 | switch1$ sudo config interface speed Ethernet120 40000 56 | switch2$ sudo config interface speed Ethernet120 40000 57 | ``` 58 | 59 | 2. Reconfigure the interface IP address. 60 | 61 | ``` 62 | switch1$ sudo config interface ip add Ethernet120 10.1.1.1/24 63 | switch2$ sudo config interface ip add Ethernet120 10.2.2.1/24 64 | ``` 65 | 66 | 3. Verify switches and hosts, as you did in Exercise 2. 67 | 68 | ``` 69 | switch1$ show interfaces status 70 | switch1$ show ip interfaces 71 | switch2$ show interfaces status 72 | switch2$ show ip interfaces 73 | host1$ ip address 74 | host1$ ip route 75 | host2$ ip address 76 | host2$ ip route 77 | ``` 78 | 79 | ### Software for this Exercise 80 | 81 | 1. Download the files for Exercise3 or clone the repository, as described in 82 | [Software Used in Tutorial](../README.md#software-used-in-tutorial). 83 | 84 | 2. Go to the directory with the configuration files for Exercise3. 85 | 86 | ``` 87 | Server$ cd $TUTORIALS_PATH/Exercise3 88 | 89 | ``` 90 | 91 | There are two utilities used in this exercise, `p4rt-client` and `macToIpV6.` 92 | The `p4rt-client` configures the SAI layer of a SONiC-based switch via the 93 | P4Runtime Service. It can configure the switch, but it is not a runtime 94 | controller and cannot handle incoming packets. The `macToIpV6` utility takes 95 | a MAC address in the format `00:11:22:33:44:55` and prints the IPv6 link-local 96 | address to STDOUT. Linux and MacOS (Intel and M1) versions of these utilities 97 | are available for your server in 98 | [p4rt-client releases](https://github.com/pins/p4rt-client/releases). 99 | 100 | 3. To get Linux versions of these utilities, use the following commands: 101 | 102 | ``` 103 | Server$ wget https://github.com/pins/p4rt-client/releases/download/202112/p4rt-client 104 | Server$ wget https://github.com/pins/p4rt-client/releases/download/202112/macToIpV6 105 | ``` 106 | 107 | 4. Make sure the programs are executable. 108 | 109 | ``` 110 | Server$ cd $TUTORIALS_PATH/Exercise3 111 | Server$ chmod 0755 p4rt-client macToIpV6 112 | ``` 113 | 114 | ### p4rt-client Command Line Interface 115 | 116 | We will run `p4rt-client` commands (see 117 | [Usage](https://github.com/pins/p4rt-client#usage) or use `p4rt-client -help` ) 118 | on the server to configure routes in both directions. For convenience, here are 119 | the options we will use in this exercise: 120 | 121 | * `-pushP4Info` loads the P4 mapping file into the switch. This file contains 122 | references to tables and actions for the P4Runtime application. 123 | * `-addRouterInt` creates a virtual interface and map it to a physical interface 124 | * `-addNeighbor` defines an adjacent entity (e.g., switch, router, server) 125 | * `-addNextHop` creates a NextHop label for an interface and neighbor 126 | combination 127 | * `-addIpV4` creates a route entry and point it to a NextHop 128 | * `-destMAC`is the MAC address of the destination switch 129 | * `-egressPort` is the switch port to egress (default 10000) 130 | * `-neighborName` is the link-local address for `-destMAC` (use the `macToIpV6` 131 | conversion utility) 132 | * `-nextHopId` is the name to associate with the next hop entry 133 | * `-p4info` is the p4info text filename that describes the p4 application 134 | * `-routerInterface` is the name to give the router interface 135 | * `-routerPortId` is the port number to assign to the router interface port 136 | (default 9999999) 137 | * `-routerIntMac` is the MAC address of the source switch to be used for the 138 | router interface (e.g., 00:00:00:11:22:dd) 139 | * `-routedNetwork` is the IP address space (CIDR) for the host you want to 140 | connect to (e.g., 1.2.3.4/8) 141 | * `-server` is the IP address and port of the p4rt server on the switch 142 | 143 | The `p4rt-client` commands will add database entries to Redis DB that establish 144 | the routes on each switch. 145 | 146 | | p4rt-client Command | Resulting table entry in Redis | 147 | |--------------------------|----------------------------------| 148 | | Push P4 information | DEFINITION:ACL_ACL_INGRESS_TABLE | 149 | | Add the router interface | FIXED_ROUTER_INTERFACE_TABLE | 150 | | Add the router neighbor | FIXED_NEIGHBOR_TABLE | 151 | | Add the next hop | FIXED_NEXTHOP_TABLE | 152 | | Add the IPv4 address | FIXED_IPV4_TABLE | 153 | 154 | ### Setting Up Routes in the SONiC Redis Database 155 | 156 | 1. First, `ssh` into the switches, and you will not find any routes in the SONiC 157 | Redis database. 158 | 159 | ``` 160 | Switch$ redis-cli keys P4* 161 | (empty array) 162 | ``` 163 | 164 | 2. Edit the sample script file, `p4rt-client-setup.sh`, to reflect the routes 165 | available in your network. In our example, we set up routes through Ethernet0 166 | on the two switches. We did not use Ethernet104 in this example. 167 | 168 | ``` 169 | Server$ vim p4rt-client-setup.sh 170 | 171 | #!/bin/bash 172 | ./p4rt-client -pushP4Info -server=10.70.2.5:9559 -p4info=onf.p4info.pb.txt 173 | ./p4rt-client -addRouterInt -server 10.70.2.5:9559 -routerInterface="Ethernet0" -routerPortId=1000 -routerIntMAC="a8:2b:b5:f0:f0:f5" -egressPort="Ethernet0" 174 | ./p4rt-client -addNeighbor -server 10.70.2.5:9559 -routerInterface="Ethernet0" -neighborName="fe80::aa2b:b5ff:fef0:ede3" -destMAC="a8:2b:b5:f0:ed:e3" 175 | ./p4rt-client -addNextHop -server 10.70.2.5:9559 -routerInterface="Ethernet0" -neighborName="fe80::aa2b:b5ff:fef0:ede3" -nextHopId="as7712-3" 176 | ./p4rt-client -addIpV4 -server 10.70.2.5:9559 -routedNetwork=10.2.2.0/24 -nextHopId="as7712-3" 177 | 178 | ./p4rt-client -pushP4Info -server=10.70.2.6:9559 -p4info=onf.p4info.pb.txt 179 | ./p4rt-client -addRouterInt -server 10.70.2.6:9559 -routerInterface="Ethernet0" -routerPortId=1000 -routerIntMAC="a8:2b:b5:f0:ed:e3" -egressPort="Ethernet0" 180 | ./p4rt-client -addNeighbor -server 10.70.2.6:9559 -routerInterface="Ethernet0" -neighborName="fe80::aa2b:b5ff:fef0:f0f5" -destMAC="a8:2b:b5:f0:f0:f5" 181 | ./p4rt-client -addNextHop -server 10.70.2.6:9559 -routerInterface="Ethernet0" -neighborName="fe80::aa2b:b5ff:fef0:f0f5" -nextHopId="as7712-2" 182 | ./p4rt-client -addIpV4 -server 10.70.2.6:9559 -routedNetwork=10.1.1.0/24 -nextHopId="as7712-2" 183 | ``` 184 | 185 | 3. Run the script. 186 | 187 | ``` 188 | Server$ ./p4rt-client-setup.sh 189 | ``` 190 | 191 | 4. Check the routes in SONiC’s Redis DB on each switch. 192 | 193 | ``` 194 | switch1$ redis-cli keys P4* 195 | 1) "P4RT:FIXED_NEIGHBOR_TABLE:{\"match/neighbor_id\":\"fe80::aa2b:b5ff:fef0:ede3\",\"match/router_interface_id\":\"Ethernet0\"}" 196 | 2) "P4RT:FIXED_IPV4_TABLE:{\"match/ipv4_dst\":\"10.2.2.0/24\",\"match/vrf_id\":\"\"}" 197 | 3) "P4RT:DEFINITION:ACL_ACL_INGRESS_TABLE" 198 | 4) "P4RT:FIXED_ROUTER_INTERFACE_TABLE:{\"match/router_interface_id\":\"Ethernet0\"}" 199 | 5) "P4RT:FIXED_NEXTHOP_TABLE:{\"match/nexthop_id\":\"as7712-3\"}" 200 | 201 | switch2$ redis-cli keys P4* 202 | 1) "P4RT:FIXED_NEXTHOP_TABLE:{\"match/nexthop_id\":\"as7712-2\"}" 203 | 2) "P4RT:FIXED_ROUTER_INTERFACE_TABLE:{\"match/router_interface_id\":\"Ethernet0\"}" 204 | 3) "P4RT:DEFINITION:ACL_ACL_INGRESS_TABLE" 205 | 4) "P4RT:FIXED_IPV4_TABLE:{\"match/ipv4_dst\":\"10.1.1.0/24\",\"match/vrf_id\":\"\"}" 206 | 5) "P4RT:FIXED_NEIGHBOR_TABLE:{\"match/neighbor_id\":\"fe80::aa2b:b5ff:fef0:f0f5\",\"match/router_interface_id\":\"Ethernet0\"}" 207 | ``` 208 | 209 | **IMPORTANT: See the Troubleshooting section below if you do not see these five 210 | entries in Redis.** 211 | 212 | ### Generate Routed Traffic 213 | 214 | 1. Clearing counters will make it easier to monitor the traffic in this 215 | exercise. 216 | 217 | ``` 218 | switch1$ sonic-clear counters 219 | switch2$ sonic-clear counters 220 | ``` 221 | 222 | 2. Ping between the hosts, and they now work through the fabric. 223 | 224 | ``` 225 | host1$ ping 10.2.2.2 (works) 226 | host2$ ping 10.1.1.2 (works) 227 | ``` 228 | 229 | 3. Verify the ping traffic. 230 | 231 | ``` 232 | switch1$ show interfaces counters 233 | switch2$ show interfaces counters 234 | ``` 235 | 236 | ### Troubleshooting 237 | 238 | Try reloading the configuration on the switch and then reconfigure the switch 239 | interfaces as you did in [Exercise 2](../Exercise2). 240 | 241 | ``` 242 | Switch$ sudo config reload -yf 243 | ``` 244 | 245 | Try rebooting the switch and then verify connections and reconfigure the switch 246 | Interfaces as you did in Exercise 2. 247 | 248 | ``` 249 | Switch$ sudo reboot now 250 | ``` 251 | -------------------------------------------------------------------------------- /Exercise3/onf.p4info.pb.txt: -------------------------------------------------------------------------------- 1 | pkg_info { 2 | arch: "v1model" 3 | } 4 | tables { 5 | preamble { 6 | id: 33554503 7 | name: "ingress.l3_admit.l3_admit_table" 8 | alias: "l3_admit_table" 9 | annotations: "@p4runtime_role(\"sdn_controller\")" 10 | } 11 | match_fields { 12 | id: 1 13 | name: "dst_mac" 14 | annotations: "@format(MAC_ADDRESS)" 15 | bitwidth: 48 16 | match_type: TERNARY 17 | } 18 | match_fields { 19 | id: 2 20 | name: "in_port" 21 | match_type: OPTIONAL 22 | type_name { 23 | name: "port_id_t" 24 | } 25 | } 26 | action_refs { 27 | id: 16777224 28 | annotations: "@proto_id(1)" 29 | } 30 | action_refs { 31 | id: 21257015 32 | annotations: "@defaultonly" 33 | scope: DEFAULT_ONLY 34 | } 35 | const_default_action_id: 21257015 36 | size: 512 37 | } 38 | tables { 39 | preamble { 40 | id: 33554496 41 | name: "ingress.routing.neighbor_table" 42 | alias: "neighbor_table" 43 | annotations: "@p4runtime_role(\"sdn_controller\")" 44 | } 45 | match_fields { 46 | id: 1 47 | name: "router_interface_id" 48 | annotations: "@refers_to(router_interface_table , router_interface_id)" 49 | match_type: EXACT 50 | type_name { 51 | name: "router_interface_id_t" 52 | } 53 | } 54 | match_fields { 55 | id: 2 56 | name: "neighbor_id" 57 | match_type: EXACT 58 | type_name { 59 | name: "neighbor_id_t" 60 | } 61 | } 62 | action_refs { 63 | id: 16777217 64 | annotations: "@proto_id(1)" 65 | } 66 | action_refs { 67 | id: 21257015 68 | annotations: "@defaultonly" 69 | scope: DEFAULT_ONLY 70 | } 71 | const_default_action_id: 21257015 72 | size: 1024 73 | } 74 | tables { 75 | preamble { 76 | id: 33554497 77 | name: "ingress.routing.router_interface_table" 78 | alias: "router_interface_table" 79 | annotations: "@p4runtime_role(\"sdn_controller\")" 80 | } 81 | match_fields { 82 | id: 1 83 | name: "router_interface_id" 84 | match_type: EXACT 85 | type_name { 86 | name: "router_interface_id_t" 87 | } 88 | } 89 | action_refs { 90 | id: 16777218 91 | annotations: "@proto_id(1)" 92 | } 93 | action_refs { 94 | id: 21257015 95 | annotations: "@defaultonly" 96 | scope: DEFAULT_ONLY 97 | } 98 | const_default_action_id: 21257015 99 | size: 1024 100 | } 101 | tables { 102 | preamble { 103 | id: 33554498 104 | name: "ingress.routing.nexthop_table" 105 | alias: "nexthop_table" 106 | annotations: "@p4runtime_role(\"sdn_controller\")" 107 | } 108 | match_fields { 109 | id: 1 110 | name: "nexthop_id" 111 | match_type: EXACT 112 | type_name { 113 | name: "nexthop_id_t" 114 | } 115 | } 116 | action_refs { 117 | id: 16777219 118 | annotations: "@proto_id(1)" 119 | } 120 | action_refs { 121 | id: 21257015 122 | annotations: "@defaultonly" 123 | scope: DEFAULT_ONLY 124 | } 125 | const_default_action_id: 21257015 126 | size: 1024 127 | } 128 | tables { 129 | preamble { 130 | id: 33554499 131 | name: "ingress.routing.wcmp_group_table" 132 | alias: "wcmp_group_table" 133 | annotations: "@p4runtime_role(\"sdn_controller\")" 134 | annotations: "@oneshot" 135 | } 136 | match_fields { 137 | id: 1 138 | name: "wcmp_group_id" 139 | match_type: EXACT 140 | type_name { 141 | name: "wcmp_group_id_t" 142 | } 143 | } 144 | action_refs { 145 | id: 16777221 146 | annotations: "@proto_id(1)" 147 | } 148 | action_refs { 149 | id: 21257015 150 | annotations: "@defaultonly" 151 | scope: DEFAULT_ONLY 152 | } 153 | const_default_action_id: 21257015 154 | implementation_id: 299650760 155 | size: 4096 156 | } 157 | tables { 158 | preamble { 159 | id: 33554500 160 | name: "ingress.routing.ipv4_table" 161 | alias: "ipv4_table" 162 | annotations: "@p4runtime_role(\"sdn_controller\")" 163 | } 164 | match_fields { 165 | id: 1 166 | name: "vrf_id" 167 | match_type: EXACT 168 | type_name { 169 | name: "vrf_id_t" 170 | } 171 | } 172 | match_fields { 173 | id: 2 174 | name: "ipv4_dst" 175 | annotations: "@format(IPV4_ADDRESS)" 176 | bitwidth: 32 177 | match_type: LPM 178 | } 179 | action_refs { 180 | id: 16777222 181 | annotations: "@proto_id(1)" 182 | } 183 | action_refs { 184 | id: 16777221 185 | annotations: "@proto_id(2)" 186 | } 187 | action_refs { 188 | id: 16777220 189 | annotations: "@proto_id(3)" 190 | } 191 | const_default_action_id: 16777222 192 | size: 1024 193 | } 194 | tables { 195 | preamble { 196 | id: 33554501 197 | name: "ingress.routing.ipv6_table" 198 | alias: "ipv6_table" 199 | annotations: "@p4runtime_role(\"sdn_controller\")" 200 | } 201 | match_fields { 202 | id: 1 203 | name: "vrf_id" 204 | match_type: EXACT 205 | type_name { 206 | name: "vrf_id_t" 207 | } 208 | } 209 | match_fields { 210 | id: 2 211 | name: "ipv6_dst" 212 | annotations: "@format(IPV6_ADDRESS)" 213 | bitwidth: 128 214 | match_type: LPM 215 | } 216 | action_refs { 217 | id: 16777222 218 | annotations: "@proto_id(1)" 219 | } 220 | action_refs { 221 | id: 16777221 222 | annotations: "@proto_id(2)" 223 | } 224 | action_refs { 225 | id: 16777220 226 | annotations: "@proto_id(3)" 227 | } 228 | const_default_action_id: 16777222 229 | size: 1024 230 | } 231 | tables { 232 | preamble { 233 | id: 33554688 234 | name: "ingress.acl_ingress.acl_ingress_table" 235 | alias: "acl_ingress_table" 236 | annotations: "@p4runtime_role(\"sdn_controller\")" 237 | annotations: "@sai_acl(INGRESS)" 238 | } 239 | match_fields { 240 | id: 1 241 | name: "is_ip" 242 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IP)" 243 | bitwidth: 1 244 | match_type: OPTIONAL 245 | } 246 | match_fields { 247 | id: 2 248 | name: "is_ipv4" 249 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV4ANY)" 250 | bitwidth: 1 251 | match_type: OPTIONAL 252 | } 253 | match_fields { 254 | id: 3 255 | name: "is_ipv6" 256 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE / IPV6ANY)" 257 | bitwidth: 1 258 | match_type: OPTIONAL 259 | } 260 | match_fields { 261 | id: 4 262 | name: "ether_type" 263 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE)" 264 | bitwidth: 16 265 | match_type: TERNARY 266 | } 267 | match_fields { 268 | id: 5 269 | name: "dst_mac" 270 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_MAC)" 271 | annotations: "@format(MAC_ADDRESS)" 272 | bitwidth: 48 273 | match_type: TERNARY 274 | } 275 | match_fields { 276 | id: 6 277 | name: "src_ip" 278 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_IP)" 279 | annotations: "@format(IPV4_ADDRESS)" 280 | bitwidth: 32 281 | match_type: TERNARY 282 | } 283 | match_fields { 284 | id: 7 285 | name: "dst_ip" 286 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IP)" 287 | annotations: "@format(IPV4_ADDRESS)" 288 | bitwidth: 32 289 | match_type: TERNARY 290 | } 291 | match_fields { 292 | id: 8 293 | name: "src_ipv6" 294 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6)" 295 | annotations: "@format(IPV6_ADDRESS)" 296 | bitwidth: 128 297 | match_type: TERNARY 298 | } 299 | match_fields { 300 | id: 9 301 | name: "dst_ipv6" 302 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6)" 303 | annotations: "@format(IPV6_ADDRESS)" 304 | bitwidth: 128 305 | match_type: TERNARY 306 | } 307 | match_fields { 308 | id: 10 309 | name: "ip_protocol" 310 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL)" 311 | bitwidth: 8 312 | match_type: TERNARY 313 | } 314 | match_fields { 315 | id: 11 316 | name: "icmpv6_type" 317 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE)" 318 | bitwidth: 8 319 | match_type: TERNARY 320 | } 321 | match_fields { 322 | id: 12 323 | name: "icmp_type" 324 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE)" 325 | bitwidth: 8 326 | match_type: TERNARY 327 | } 328 | match_fields { 329 | id: 13 330 | name: "icmp_code" 331 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE)" 332 | bitwidth: 8 333 | match_type: TERNARY 334 | } 335 | match_fields { 336 | id: 14 337 | name: "l4_src_port" 338 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT)" 339 | bitwidth: 16 340 | match_type: TERNARY 341 | } 342 | match_fields { 343 | id: 15 344 | name: "l4_dst_port" 345 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT)" 346 | bitwidth: 16 347 | match_type: TERNARY 348 | } 349 | match_fields { 350 | id: 16 351 | name: "in_port" 352 | annotations: "@sai_field(SAI_ACL_TABLE_ATTR_FIELD_IN_PORT)" 353 | match_type: OPTIONAL 354 | type_name { 355 | name: "port_id_t" 356 | } 357 | } 358 | action_refs { 359 | id: 16777473 360 | annotations: "@proto_id(1)" 361 | } 362 | action_refs { 363 | id: 16777474 364 | annotations: "@proto_id(2)" 365 | } 366 | action_refs { 367 | id: 16777475 368 | annotations: "@proto_id(3)" 369 | } 370 | action_refs { 371 | id: 16777476 372 | annotations: "@proto_id(4)" 373 | } 374 | action_refs { 375 | id: 21257015 376 | annotations: "@defaultonly" 377 | scope: DEFAULT_ONLY 378 | } 379 | const_default_action_id: 21257015 380 | direct_resource_ids: 318767362 381 | direct_resource_ids: 352321792 382 | } 383 | tables { 384 | preamble { 385 | id: 33554502 386 | name: "ingress.mirroring_clone.mirror_session_table" 387 | alias: "mirror_session_table" 388 | annotations: "@p4runtime_role(\"sdn_controller\")" 389 | } 390 | match_fields { 391 | id: 1 392 | name: "mirror_session_id" 393 | match_type: EXACT 394 | type_name { 395 | name: "mirror_session_id_t" 396 | } 397 | } 398 | action_refs { 399 | id: 16777223 400 | annotations: "@proto_id(1)" 401 | } 402 | action_refs { 403 | id: 21257015 404 | annotations: "@defaultonly" 405 | scope: DEFAULT_ONLY 406 | } 407 | const_default_action_id: 21257015 408 | size: 2 409 | } 410 | tables { 411 | preamble { 412 | id: 33554504 413 | name: "ingress.mirroring_clone.mirror_port_to_pre_session_table" 414 | alias: "mirror_port_to_pre_session_table" 415 | annotations: "@p4runtime_role(\"packet_replication_engine_manager\")" 416 | } 417 | match_fields { 418 | id: 1 419 | name: "mirror_port" 420 | match_type: EXACT 421 | type_name { 422 | name: "port_id_t" 423 | } 424 | } 425 | action_refs { 426 | id: 16777225 427 | annotations: "@proto_id(1)" 428 | } 429 | action_refs { 430 | id: 21257015 431 | annotations: "@defaultonly" 432 | scope: DEFAULT_ONLY 433 | } 434 | const_default_action_id: 21257015 435 | size: 1024 436 | } 437 | actions { 438 | preamble { 439 | id: 21257015 440 | name: "NoAction" 441 | alias: "NoAction" 442 | annotations: "@noWarn(\"unused\")" 443 | } 444 | } 445 | actions { 446 | preamble { 447 | id: 16777224 448 | name: "ingress.l3_admit.admit_to_l3" 449 | alias: "admit_to_l3" 450 | } 451 | } 452 | actions { 453 | preamble { 454 | id: 17825802 455 | name: "ingress.hashing.select_ecmp_hash_algorithm" 456 | alias: "select_ecmp_hash_algorithm" 457 | annotations: "@sai_hash_algorithm(SAI_HASH_ALGORITHM_CRC_32LO)" 458 | annotations: "@sai_hash_seed(0)" 459 | annotations: "@sai_hash_offset(0)" 460 | } 461 | } 462 | actions { 463 | preamble { 464 | id: 16777227 465 | name: "ingress.hashing.compute_ecmp_hash_ipv4" 466 | alias: "compute_ecmp_hash_ipv4" 467 | annotations: "@sai_ecmp_hash(SAI_SWITCH_ATTR_ECMP_HASH_IPV4)" 468 | annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV4)" 469 | annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV4)" 470 | annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" 471 | annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" 472 | } 473 | } 474 | actions { 475 | preamble { 476 | id: 16777228 477 | name: "ingress.hashing.compute_ecmp_hash_ipv6" 478 | alias: "compute_ecmp_hash_ipv6" 479 | annotations: "@sai_ecmp_hash(SAI_SWITCH_ATTR_ECMP_HASH_IPV6)" 480 | annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_SRC_IPV6)" 481 | annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_DST_IPV6)" 482 | annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_SRC_PORT)" 483 | annotations: "@sai_native_hash_field(SAI_NATIVE_HASH_FIELD_L4_DST_PORT)" 484 | } 485 | } 486 | actions { 487 | preamble { 488 | id: 16777217 489 | name: "ingress.routing.set_dst_mac" 490 | alias: "set_dst_mac" 491 | } 492 | params { 493 | id: 1 494 | name: "dst_mac" 495 | annotations: "@format(MAC_ADDRESS)" 496 | bitwidth: 48 497 | } 498 | } 499 | actions { 500 | preamble { 501 | id: 16777218 502 | name: "ingress.routing.set_port_and_src_mac" 503 | alias: "set_port_and_src_mac" 504 | } 505 | params { 506 | id: 1 507 | name: "port" 508 | type_name { 509 | name: "port_id_t" 510 | } 511 | } 512 | params { 513 | id: 2 514 | name: "src_mac" 515 | annotations: "@format(MAC_ADDRESS)" 516 | bitwidth: 48 517 | } 518 | } 519 | actions { 520 | preamble { 521 | id: 16777219 522 | name: "ingress.routing.set_nexthop" 523 | alias: "set_nexthop" 524 | } 525 | params { 526 | id: 1 527 | name: "router_interface_id" 528 | annotations: "@refers_to(router_interface_table , router_interface_id)" 529 | annotations: "@refers_to(neighbor_table , router_interface_id)" 530 | type_name { 531 | name: "router_interface_id_t" 532 | } 533 | } 534 | params { 535 | id: 2 536 | name: "neighbor_id" 537 | annotations: "@refers_to(neighbor_table , neighbor_id)" 538 | type_name { 539 | name: "neighbor_id_t" 540 | } 541 | } 542 | } 543 | actions { 544 | preamble { 545 | id: 16777221 546 | name: "ingress.routing.set_nexthop_id" 547 | alias: "set_nexthop_id" 548 | } 549 | params { 550 | id: 1 551 | name: "nexthop_id" 552 | annotations: "@refers_to(nexthop_table , nexthop_id)" 553 | type_name { 554 | name: "nexthop_id_t" 555 | } 556 | } 557 | } 558 | actions { 559 | preamble { 560 | id: 16777222 561 | name: "ingress.routing.drop" 562 | alias: "drop" 563 | } 564 | } 565 | actions { 566 | preamble { 567 | id: 16777220 568 | name: "ingress.routing.set_wcmp_group_id" 569 | alias: "set_wcmp_group_id" 570 | } 571 | params { 572 | id: 1 573 | name: "wcmp_group_id" 574 | annotations: "@refers_to(wcmp_group_table , wcmp_group_id)" 575 | type_name { 576 | name: "wcmp_group_id_t" 577 | } 578 | } 579 | } 580 | actions { 581 | preamble { 582 | id: 16777473 583 | name: "ingress.acl_ingress.copy" 584 | alias: "copy" 585 | annotations: "@sai_action(SAI_PACKET_ACTION_COPY)" 586 | } 587 | params { 588 | id: 1 589 | name: "qos_queue" 590 | annotations: "@sai_action_param(QOS_QUEUE)" 591 | type_name { 592 | name: "qos_queue_t" 593 | } 594 | } 595 | } 596 | actions { 597 | preamble { 598 | id: 16777474 599 | name: "ingress.acl_ingress.trap" 600 | alias: "trap" 601 | annotations: "@sai_action(SAI_PACKET_ACTION_TRAP)" 602 | } 603 | params { 604 | id: 1 605 | name: "qos_queue" 606 | annotations: "@sai_action_param(QOS_QUEUE)" 607 | type_name { 608 | name: "qos_queue_t" 609 | } 610 | } 611 | } 612 | actions { 613 | preamble { 614 | id: 16777475 615 | name: "ingress.acl_ingress.forward" 616 | alias: "forward" 617 | annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" 618 | } 619 | } 620 | actions { 621 | preamble { 622 | id: 16777476 623 | name: "ingress.acl_ingress.mirror" 624 | alias: "mirror" 625 | annotations: "@sai_action(SAI_PACKET_ACTION_FORWARD)" 626 | } 627 | params { 628 | id: 1 629 | name: "mirror_session_id" 630 | annotations: "@sai_action_param(SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_INGRESS)" 631 | annotations: "@refers_to(mirror_session_table , mirror_session_id)" 632 | type_name { 633 | name: "mirror_session_id_t" 634 | } 635 | } 636 | } 637 | actions { 638 | preamble { 639 | id: 16777223 640 | name: "ingress.mirroring_clone.mirror_as_ipv4_erspan" 641 | alias: "mirror_as_ipv4_erspan" 642 | } 643 | params { 644 | id: 1 645 | name: "port" 646 | type_name { 647 | name: "port_id_t" 648 | } 649 | } 650 | params { 651 | id: 2 652 | name: "src_ip" 653 | annotations: "@format(IPV4_ADDRESS)" 654 | bitwidth: 32 655 | } 656 | params { 657 | id: 3 658 | name: "dst_ip" 659 | annotations: "@format(IPV4_ADDRESS)" 660 | bitwidth: 32 661 | } 662 | params { 663 | id: 4 664 | name: "src_mac" 665 | annotations: "@format(MAC_ADDRESS)" 666 | bitwidth: 48 667 | } 668 | params { 669 | id: 5 670 | name: "dst_mac" 671 | annotations: "@format(MAC_ADDRESS)" 672 | bitwidth: 48 673 | } 674 | params { 675 | id: 6 676 | name: "ttl" 677 | bitwidth: 8 678 | } 679 | params { 680 | id: 7 681 | name: "tos" 682 | bitwidth: 8 683 | } 684 | } 685 | actions { 686 | preamble { 687 | id: 16777225 688 | name: "ingress.mirroring_clone.set_pre_session" 689 | alias: "set_pre_session" 690 | } 691 | params { 692 | id: 1 693 | name: "id" 694 | bitwidth: 32 695 | } 696 | } 697 | action_profiles { 698 | preamble { 699 | id: 299650760 700 | name: "ingress.routing.wcmp_group_selector" 701 | alias: "wcmp_group_selector" 702 | } 703 | table_ids: 33554499 704 | with_selector: true 705 | size: 65536 706 | max_group_size: 1024 707 | } 708 | direct_counters { 709 | preamble { 710 | id: 318767362 711 | name: "ingress.acl_ingress.acl_ingress_counter" 712 | alias: "acl_ingress_counter" 713 | } 714 | spec { 715 | unit: BOTH 716 | } 717 | direct_table_id: 33554688 718 | } 719 | direct_meters { 720 | preamble { 721 | id: 352321792 722 | name: "ingress.acl_ingress.acl_ingress_meter" 723 | alias: "acl_ingress_meter" 724 | } 725 | spec { 726 | unit: BYTES 727 | } 728 | direct_table_id: 33554688 729 | } 730 | controller_packet_metadata { 731 | preamble { 732 | id: 81826293 733 | name: "packet_in" 734 | alias: "packet_in" 735 | annotations: "@controller_header(\"packet_in\")" 736 | } 737 | metadata { 738 | id: 1 739 | name: "ingress_port" 740 | type_name { 741 | name: "port_id_t" 742 | } 743 | } 744 | metadata { 745 | id: 2 746 | name: "target_egress_port" 747 | type_name { 748 | name: "port_id_t" 749 | } 750 | } 751 | } 752 | controller_packet_metadata { 753 | preamble { 754 | id: 76689799 755 | name: "packet_out" 756 | alias: "packet_out" 757 | annotations: "@controller_header(\"packet_out\")" 758 | } 759 | metadata { 760 | id: 1 761 | name: "egress_port" 762 | type_name { 763 | name: "port_id_t" 764 | } 765 | } 766 | metadata { 767 | id: 2 768 | name: "submit_to_ingress" 769 | bitwidth: 1 770 | } 771 | metadata { 772 | id: 3 773 | name: "unused_pad" 774 | bitwidth: 7 775 | } 776 | } 777 | type_info { 778 | new_types { 779 | key: "mirror_session_id_t" 780 | value { 781 | translated_type { 782 | sdn_string { 783 | } 784 | } 785 | } 786 | } 787 | new_types { 788 | key: "neighbor_id_t" 789 | value { 790 | translated_type { 791 | sdn_string { 792 | } 793 | } 794 | } 795 | } 796 | new_types { 797 | key: "nexthop_id_t" 798 | value { 799 | translated_type { 800 | sdn_string { 801 | } 802 | } 803 | } 804 | } 805 | new_types { 806 | key: "port_id_t" 807 | value { 808 | translated_type { 809 | sdn_string { 810 | } 811 | } 812 | } 813 | } 814 | new_types { 815 | key: "qos_queue_t" 816 | value { 817 | translated_type { 818 | sdn_string { 819 | } 820 | } 821 | } 822 | } 823 | new_types { 824 | key: "router_interface_id_t" 825 | value { 826 | translated_type { 827 | sdn_string { 828 | } 829 | } 830 | } 831 | } 832 | new_types { 833 | key: "vrf_id_t" 834 | value { 835 | translated_type { 836 | sdn_string { 837 | } 838 | } 839 | } 840 | } 841 | new_types { 842 | key: "wcmp_group_id_t" 843 | value { 844 | translated_type { 845 | sdn_string { 846 | } 847 | } 848 | } 849 | } 850 | } 851 | -------------------------------------------------------------------------------- /Exercise3/p4rt-client-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SW1=10.70.2.5 4 | SW2=10.70.2.6 5 | 6 | ./p4rt-client -pushP4Info -server $SW1:9559 -p4info=onf.p4info.pb.txt 7 | ./p4rt-client -addRouterInt -server $SW1:9559 -routerInterface="Ethernet0" -routerPortId=1000 -routerIntMAC="a8:2b:b5:f0:f0:f5" -egressPort="Ethernet0" 8 | ./p4rt-client -addNeighbor -server $SW1:9559 -routerInterface="Ethernet0" -neighborName="fe80::aa2b:b5ff:fef0:ede3" -destMAC="a8:2b:b5:f0:ed:e3" 9 | ./p4rt-client -addNextHop -server $SW1:9559 -routerInterface="Ethernet0" -neighborName="fe80::aa2b:b5ff:fef0:ede3" -nextHopId="switch2" 10 | ./p4rt-client -addIpV4 -server $SW1:9559 -routedNetwork=10.2.2.0/24 -nextHopId="switch2" 11 | 12 | ./p4rt-client -pushP4Info -server $SW2:9559 -p4info=onf.p4info.pb.txt 13 | ./p4rt-client -addRouterInt -server $SW2:9559 -routerInterface="Ethernet0" -routerPortId=1000 -routerIntMAC="a8:2b:b5:f0:ed:e3" -egressPort="Ethernet0" 14 | ./p4rt-client -addNeighbor -server $SW2:9559 -routerInterface="Ethernet0" -neighborName="fe80::aa2b:b5ff:fef0:f0f5" -destMAC="a8:2b:b5:f0:f0:f5" 15 | ./p4rt-client -addNextHop -server $SW2:9559 -routerInterface="Ethernet0" -neighborName="fe80::aa2b:b5ff:fef0:f0f5" -nextHopId="switch1" 16 | ./p4rt-client -addIpV4 -server $SW2:9559 -routedNetwork=10.1.1.0/24 -nextHopId="switch1" 17 | -------------------------------------------------------------------------------- /Exercise4/ONOS-Devices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pins/tutorials/ba42a5fb5455198a4811c099be4b45270c88cf8a/Exercise4/ONOS-Devices.png -------------------------------------------------------------------------------- /Exercise4/ONOS-Flows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pins/tutorials/ba42a5fb5455198a4811c099be4b45270c88cf8a/Exercise4/ONOS-Flows.png -------------------------------------------------------------------------------- /Exercise4/ONOS-Hosts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pins/tutorials/ba42a5fb5455198a4811c099be4b45270c88cf8a/Exercise4/ONOS-Hosts.png -------------------------------------------------------------------------------- /Exercise4/ONOS-Links.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pins/tutorials/ba42a5fb5455198a4811c099be4b45270c88cf8a/Exercise4/ONOS-Links.png -------------------------------------------------------------------------------- /Exercise4/ONOS-Pending-Add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pins/tutorials/ba42a5fb5455198a4811c099be4b45270c88cf8a/Exercise4/ONOS-Pending-Add.png -------------------------------------------------------------------------------- /Exercise4/ONOS-Topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pins/tutorials/ba42a5fb5455198a4811c099be4b45270c88cf8a/Exercise4/ONOS-Topology.png -------------------------------------------------------------------------------- /Exercise4/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Exercise 4 - Deploy and Configure ONOS 8 | 9 | With the topology in [Exercise2 - Figure 10 | 1](../Exercise2#figure-1---tutorial-sample-configuration), you will use the ONOS 11 | Controller and REST API to configure the pipeline and routes in this exercise. 12 | You will be able to ping between your two hosts through the PINS fabric at the 13 | end of this exercise. 14 | 15 | ### Starting From Scratch 16 | 17 | This section contains tips to help you start with a clean system, especially if 18 | you have run through these exercises previously. Don’t worry about simply going 19 | from Exercise 3, using the `p4rt-client`, to this exercise using ONOS. ONOS will 20 | clear the pipeline from the previous activity if the configuration is the same 21 | as in Exercise 3. If there are changes, just reload the configuration. 22 | 23 | #### VRF 24 | 25 | 1. Check the `p4rt.sh` file and make sure it has the option 26 | `-default_vrf_id=vrf-0`, which ONOS currently needs. 27 | 28 | ``` 29 | Switch$ docker exec p4rt cat /usr/bin/p4rt.sh 30 | P4RT_ARGS=" -default_vrf_id=vrf-0 --alsologtostderr --logbuflevel=-1 " 31 | ``` 32 | 33 | 2. If you do not see the VRF option, add it with the following command, verify, 34 | reload the configuration, and follow the re-configuration steps in the next 35 | section. 36 | 37 | ``` 38 | Switch$ docker exec p4rt sed -i 's/P4RT_ARGS="/P4RT_ARGS=" -default_vrf_id=vrf-0/' /usr/bin/p4rt.sh 39 | Switch$ docker exec p4rt cat /usr/bin/p4rt.sh 40 | Switch$ sudo config reload -yf 41 | ``` 42 | 43 | 3. After this exercise, if you go back to the `p4rt-client` or non-ONOS 44 | controller, you will need to remove the VRF option: 45 | 46 | ``` 47 | Switch$ docker exec p4rt sed -i 's/ -default_vrf_id=vrf-0//g' /usr/bin/p4rt.sh 48 | ``` 49 | 50 | #### Switch Reload or Reboot 51 | 52 | If you reload the configuration on your switches or reboot them, review 53 | [Exercise 2](../Exercise2). Here is a summary of the commands you may need. 54 | 55 | 1. Are there any custom interface requirements, such as speed? 56 | 57 | ``` 58 | switch1$ sudo config interface speed Ethernet120 40000 59 | switch2$ sudo config interface speed Ethernet120 40000 60 | ``` 61 | 62 | 2. Reconfigure the interface IP address. 63 | 64 | ``` 65 | switch1$ sudo config interface ip add Ethernet120 10.1.1.1/24 66 | switch2$ sudo config interface ip add Ethernet120 10.2.2.1/24 67 | ``` 68 | 69 | 3. Verify switches and hosts, as you did in Exercise 2. 70 | 71 | ``` 72 | switch1$ show interfaces status 73 | switch1$ show ip interfaces 74 | switch2$ show interfaces status 75 | switch2$ show ip interfaces 76 | host1$ ip address 77 | host1$ ip route 78 | host2$ ip address 79 | host2$ ip route 80 | ``` 81 | 82 | #### ONOS Already Running 83 | 84 | If you have already done this exercise, you will need to stop ONOS. 85 | 86 | ``` 87 | Server$ docker kill onos 88 | ``` 89 | 90 | ### Software for this Exercise 91 | 92 | There are eleven sample configuration files used in this exercise found in the 93 | PINS tutorials repository: `tutorial-netconfig.json, flow-objectives.sh, 94 | forward-switch1-host1.json, forward-switch1-host2.json, 95 | forward-switch2-host1.json, forward-switch2-host2.json, next-switch1-host1.json, 96 | next-switch1-host2.json, next-switch2-host1.json, next-switch2-host2.json,`and 97 | `onf.p4info.pb.txt.` 98 | 99 | 1. Download the files for Exercise 4 or clone the repository, as described in 100 | [Software Used in Tutorial](../README.md#software-used-in-tutorial). 101 | 2. Go to the directory with the configuration files for Exercise4. 102 | 103 | ``` 104 | Server$ cd $TUTORIALS_PATH/Exercise4 105 | ``` 106 | 107 | 3. Use the following command to pull and start ONOS with the PINS driver and SAI 108 | pipeliner installed. 109 | 110 | ``` 111 | Server$ docker run --rm -t -d -p 8181:8181 -p 8101:8101 -p 5005:5005 -p 830:830 --pull always --name onos dmoro92/pins-onos:0.0.1 112 | ``` 113 | 114 | 4. Verify that ONOS is running. 115 | 116 | ``` 117 | Server$ docker ps 118 | ``` 119 | 120 | OPTIONAL: You can use `ssh` port mapping to enable `localhost` if you are 121 | running ONOS on a remote machine. Then subsequent commands can use `localhost` 122 | instead of the full IP address. 123 | 124 | Example: `ssh -N -L 8181:localhost:8181 -L 8101:localhost:8101 pins-dev2` 125 | 126 | ### Configure ONOS 127 | 128 | The sample JSON configuration file, `tutorial-netconfig.json`, sets up routes 129 | through both switch connections, Ethernet0 and Ethernet104. You will need to 130 | customize the configuration file for your network topology. The file contains 131 | these elements: 132 | 133 | * _devices_: for each device in the network, define the management interface, 134 | routing, and port configuration (port discovery via gNMI is currently not 135 | supported for PINS devices). 136 | * _ports_: for every port in the topology, specify the PORT_ID as appears in 137 | the SONiC config DB. 138 | * _hosts_: host configuration is optional because hosts can be discovered by 139 | triggering an ARP request. 140 | 141 | 1. Edit the configuration file and push it to the network. There is no output 142 | unless the command fails. 143 | 144 | ``` 145 | Server$ vim tutorial-netconfig.json 146 | Server$ curl --fail -sSL --user karaf:karaf -X POST http://${YOUR_IP}:8181/onos/v1/network/configuration -H Content-type:application/json -d@tutorial-netconfig.json 147 | ``` 148 | 149 | 2. If you check the Redis database on your switches, only the ACL entries are 150 | set up. 151 | 152 | ``` 153 | Switch$ redis-cli keys P4* 154 | 1) "P4RT:ACL_ACL_INGRESS_TABLE:{\"match/ether_type\":\"0x88cc&0xffff\",\"priority\":40001}" 155 | 2) "P4RT:ACL_ACL_INGRESS_TABLE:{\"match/ether_type\":\"0x0806&0xffff\",\"priority\":30001}" 156 | 3) "P4RT:ACL_ACL_INGRESS_TABLE:{\"match/ether_type\":\"0x8942&0xffff\",\"priority\":40001}" 157 | 4) "P4RT:DEFINITION:ACL_ACL_INGRESS_TABLE" 158 | ``` 159 | 160 | NOTE: If your switch does not support ACLs, you will need to modify the P4 161 | program and recompile it for your switch so that the output file, 162 | `onf.p4info.pb.txt`, does not contain ACLs. 163 | 164 | 3. Verify that the configuration that you loaded is correct using the ONOS CLI. 165 | The output should match `tutorial-netconfig.json`, although it may be in a 166 | slightly different order. 167 | 168 | ``` 169 | Server$ docker exec -it onos /root/onos/apache-karaf-4.2.9/bin/client 170 | onos> netcfg 171 | { 172 | "devices" : { 173 | "device:switch1" : { 174 | "basic" : { 175 | "managementAddress" : "grpc://10.70.2.5:9559?device_id=183807201", 176 | "manufacturer" : "Edgecore", 177 | "hwVersion" : "AS7712", 178 | "driver" : "sonic", 179 | "pipeconf" : "org.onosproject.pipelines.sai", 180 | "locType" : "grid", 181 | "gridX" : 200, 182 | "gridY" : 600 183 | }, 184 | "ports" : { 185 | "0" : { 186 | "enabled" : true, 187 | "name" : "Ethernet0", 188 | "number" : 0, 189 | "removed" : false, 190 | "speed" : 100000, 191 | "type" : "copper" 192 | }, 193 | "104" : { 194 | "enabled" : true, 195 | "name" : "Ethernet104", 196 | "number" : 104, 197 | "removed" : false, 198 | "speed" : 100000, 199 | "type" : "copper" 200 | }, 201 | "120" : { 202 | "enabled" : true, 203 | "name" : "Ethernet120", 204 | "number" : 120, 205 | "removed" : false, 206 | "speed" : 40000, 207 | "type" : "copper" 208 | } 209 | } 210 | }, 211 | "device:switch2" : { 212 | "basic" : { 213 | "managementAddress" : "grpc://10.70.2.6:9559?device_id=183807201", 214 | "manufacturer" : "Edgecore", 215 | "hwVersion" : "AS7712", 216 | "driver" : "sonic", 217 | "pipeconf" : "org.onosproject.pipelines.sai", 218 | "locType" : "grid", 219 | "gridX" : 400, 220 | "gridY" : 600 221 | }, 222 | "ports" : { 223 | "0" : { 224 | "enabled" : true, 225 | "name" : "Ethernet0", 226 | "number" : 0, 227 | "removed" : false, 228 | "speed" : 100000, 229 | "type" : "copper" 230 | }, 231 | "104" : { 232 | "enabled" : true, 233 | "name" : "Ethernet104", 234 | "number" : 104, 235 | "removed" : false, 236 | "speed" : 100000, 237 | "type" : "copper" 238 | }, 239 | "120" : { 240 | "enabled" : true, 241 | "name" : "Ethernet120", 242 | "number" : 120, 243 | "removed" : false, 244 | "speed" : 100000, 245 | "type" : "copper" 246 | } 247 | } 248 | } 249 | }, 250 | "layouts" : { }, 251 | "hosts" : { 252 | "00:07:43:4B:7F:50/None" : { 253 | "basic" : { 254 | "name" : "host2", 255 | "allowed" : true, 256 | "locType" : "grid", 257 | "gridX" : 400, 258 | "gridY" : 800, 259 | "ips" : [ "10.2.2.2" ], 260 | "locations" : [ "device:switch2/120" ] 261 | } 262 | }, 263 | "40:A6:B7:28:BE:D8/None" : { 264 | "basic" : { 265 | "name" : "host1", 266 | "allowed" : true, 267 | "locType" : "grid", 268 | "gridX" : 200, 269 | "gridY" : 800, 270 | "ips" : [ "10.1.1.2" ], 271 | "locations" : [ "device:switch1/120" ] 272 | } 273 | } 274 | }, 275 | "links" : { }, 276 | "apps" : { 277 | "org.onosproject.provider.lldp" : { 278 | "suppression" : { 279 | "deviceTypes" : [ "ROADM", "OTN", "FIBER_SWITCH", "OPTICAL_AMPLIFIER", "OLS", "TERMINAL_DEVICE" ], 280 | "annotation" : "{\"no-lldp\":null}" 281 | } 282 | } 283 | }, 284 | "ports" : { }, 285 | "regions" : { } 286 | } 287 | ``` 288 | 289 | 4. You are not able to ping between your hosts because the flow objectives have 290 | not been set up. 291 | 292 | ``` 293 | host1$ ping 10.2.2.2 (doesn't work) 294 | host2$ ping 10.1.1.2 (doesn't work) 295 | ``` 296 | 297 | ### Using Flow Objectives and the REST API 298 | 299 | We will show you two ways to access the REST API to create flow objectives: 300 | `curl` and the Swagger UI. 301 | 302 | #### Curl Example 303 | 304 | The script file, `flow-objectives.sh,` contains eight `curl` commands, one for 305 | each flow objective. The corresponding JSON files contain commands to set up 306 | routes in both directions between the hosts through both switches. 307 | 308 | Example `curl` command to set up part of a flow objective: 309 | 310 | ``` 311 | curl -X POST -u karaf:karaf -H "Content-Type: application/json" -d @forward-switch1-host1.json http://10.128.13.243:8181/onos/v1/flowobjectives/device:switch1/forward?appId=org.onosproject.rest 312 | ``` 313 | 314 | 1. Edit the corresponding eight JSON files (e.g., 315 | `forward-switch1-host1.json`and`next-switch2-host2.json)` to match your 316 | network topology. 317 | 318 | ``` 319 | Server$ vim forward-*.json next-*.json 320 | ``` 321 | 322 | 2. Run the flow objectives script. There is no output unless the script fails. 323 | 324 | ``` 325 | Server$ ./flow-objectives.sh 326 | ``` 327 | 328 | 3. Validate the Redis database and ONOS setup, as described in subsequent 329 | sections. 330 | 331 | #### Swagger UI Example (optional alternative) 332 | 333 | If you are familiar with swagger docs and would prefer to use them instead of 334 | the provided script, here are the steps you could follow. 335 | 336 | 1. Point your browser to `http://${YOUR_IP}:8181/onos/v1/docs` 337 | 2. Use `flowobjective/{deviceid}/forward` and `flowobjective/{deviceid}/next` 338 | 3. Choose an `appID.` We used `org.onosproject.rest` in our sample script. 339 | 4. Choose the `deviceIDs` for your devices and make sure you use the same 340 | identifier in the JSON streams. For example, we used `device:switch1` and 341 | `device:switch2`. 342 | 5. Create your JSON streams. Be sure that the `nextId` in the forward stream 343 | matches the `id` in the next stream. See the eight JSON example files that we 344 | used. 345 | 346 | ### Validate the Redis Database 347 | 348 | Using `redis-cli` on the individual switches, you can see the P4RT additions to 349 | the SONiC database. 350 | 351 | ``` 352 | Switch$ redis-cli keys P4* 353 | 1) "P4RT:FIXED_IPV4_TABLE:{\"match/ipv4_dst\":\"10.1.1.0/24\",\"match/vrf_id\":\"\"}" 354 | 2) "P4RT:FIXED_WCMP_GROUP_TABLE:{\"match/wcmp_group_id\":\"101\"}" 355 | 3) "P4RT:ACL_ACL_INGRESS_TABLE:{\"match/ether_type\":\"0x0806&0xffff\",\"priority\":30001}" 356 | 4) "P4RT:FIXED_ROUTER_INTERFACE_TABLE:{\"match/router_interface_id\":\"device:switch1/Ethernet104\"}" 357 | 5) "P4RT:ACL_ACL_INGRESS_TABLE:{\"match/ether_type\":\"0x8942&0xffff\",\"priority\":40001}" 358 | 6) "P4RT:FIXED_ROUTER_INTERFACE_TABLE:{\"match/router_interface_id\":\"device:switch1/Ethernet0\"}" 359 | 7) "P4RT:FIXED_NEIGHBOR_TABLE:{\"match/neighbor_id\":\"fe80::aa2b:b5ff:fef0:ede3\",\"match/router_interface_id\":\"device:switch1/Ethernet0\"}" 360 | 8) "P4RT:FIXED_NEIGHBOR_TABLE:{\"match/neighbor_id\":\"fe80::aa2b:b5ff:fef0:ede3\",\"match/router_interface_id\":\"device:switch1/Ethernet104\"}" 361 | 9) "P4RT:FIXED_IPV4_TABLE:{\"match/ipv4_dst\":\"10.2.2.0/24\",\"match/vrf_id\":\"\"}" 362 | 10) "P4RT:FIXED_WCMP_GROUP_TABLE:{\"match/wcmp_group_id\":\"100\"}" 363 | 11) "P4RT:DEFINITION:ACL_ACL_INGRESS_TABLE" 364 | 12) "P4RT:FIXED_NEXTHOP_TABLE:{\"match/nexthop_id\":\"fe80::aa2b:b5ff:fef0:ede3@device:switch1/Ethernet0\"}" 365 | 13) "P4RT:ACL_ACL_INGRESS_TABLE:{\"match/ether_type\":\"0x88cc&0xffff\",\"priority\":40001}" 366 | 14) "P4RT:FIXED_NEXTHOP_TABLE:{\"match/nexthop_id\":\"fe80::aa2b:b5ff:fef0:ede3@device:switch1/Ethernet104\"}" 367 | 15) "P4RT:FIXED_NEXTHOP_TABLE:{\"match/nexthop_id\":\"fe80::42a6:b7ff:fe28:bed8@device:switch1/Ethernet120\"}" 368 | 16) "P4RT:FIXED_NEIGHBOR_TABLE:{\"match/neighbor_id\":\"fe80::42a6:b7ff:fe28:bed8\",\"match/router_interface_id\":\"device:switch1/Ethernet120\"}" 369 | 17) "P4RT:FIXED_ROUTER_INTERFACE_TABLE:{\"match/router_interface_id\":\"device:switch1/Ethernet120\"}" 370 | ``` 371 | 372 | **IMPORTANT: See the Troubleshooting section below if you do not see similar 373 | entries in Redis.** 374 | 375 | ### Validate the Setup in ONOS 376 | 377 | Using the ONOS GUI, look at the topology, devices, links, hosts, and flow 378 | entries. 379 | 380 | 1. Point your browser to the ONOS GUI, 381 | `http://${YOUR_IP}:8181/onos/ui/login.html` 382 | 383 | ONF Example (user/pw: onos/rocks): 384 | 385 | ``` 386 | [http://10.128.13.243:8181/onos/ui/login.html](http://10.128.13.243:8181/onos/ui/login.html) 387 | ``` 388 | 389 | Alternately, you could use the ONOS CLI either via ssh or docker: 390 | 391 | ``` 392 | Server$ ssh -p 8101 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null onos@localhost 393 | Server$ docker exec -it onos /root/onos/apache-karaf-4.2.9/bin/client 394 | ``` 395 | 396 | 2. Verify the topology. 397 | 398 | a) Toggle host-visibility (4th icon from the left in the top row of the 399 | pullout panel on the left) to see the hosts (10.1.1.2 and 10.2.2.2). 400 | 401 | b) Click on the switch to see the device panel on the right. 402 | 403 | c) Click the 2nd icon from the left to see the configured flows. 404 | 405 | d) Explore other parts of the ONOS GUI. Use the question mark (?) in the 406 | upper right corner for help. 407 | 408 | ![alt_text](ONOS-Topology.png "ONOS Topology") 409 | 410 | 3. Verify the flow entries. 411 | 412 | ![alt_text](ONOS-Flows.png "Flows") 413 | 414 | 4. Verify the devices. 415 | 416 | ![alt_text](ONOS-Devices.png "Devices") 417 | 418 | 5. Verify the links. 419 | 420 | ![alt_text](ONOS-Links.png "Links") 421 | 422 | 6. Verify the hosts. 423 | 424 | ![alt_text](ONOS-Hosts.png "Hosts") 425 | 426 | 7. Clearing counters will make it easier to monitor the traffic in this 427 | exercise. 428 | 429 | ``` 430 | switch1$ sonic-clear counters 431 | switch2$ sonic-clear counters 432 | ``` 433 | 434 | 8. Ping between the hosts and see that they now work through the fabric. 435 | 436 | ``` 437 | host1$ ping 10.2.2.2 (works) 438 | host2$ ping 10.1.1.2 (works) 439 | ``` 440 | 441 | 9. Verify the ping traffic. 442 | 443 | ``` 444 | switch1$ show interfaces counters 445 | switch2$ show interfaces counters 446 | ``` 447 | 448 | ### Troubleshooting 449 | 450 | If the IPV4_TABLE entries did not get added, follow the instructions for adding 451 | the default [VRF](#VRF) to `p4rt`. Any of the following can indicate missing 452 | entries: 453 | 454 | 1. a “pending” state in the ONOS flow entries 455 | 2. missing from Redis DB (`redis-cli keys P4* | grep IPV4`) 456 | 457 | ![alt_text](ONOS-Pending-Add.png "Pending Add`") 458 | 459 | 3. messages such as the following in the log file (`show logging | grep p4rt)` 460 | 461 | * `WARN [WriteResponseImpl] Unable to INSERT table entry on device:as7712-3: 462 | NOT_FOUND [OrchAgent] No VRF found with name 'vrf-0' (:0)` 463 | * `sonic INFO p4rt#/supervisord: p4rt message: "[OrchAgent] No VRF found with 464 | name \'vrf-0\'"` 465 | 466 | For other errors, try reloading the configuration on the switch and then 467 | reconfigure the switch interfaces as you did in [Exercise 2](../Exercise2). 468 | 469 | ``` 470 | Switch$ sudo config reload -yf 471 | ``` 472 | 473 | You may need to reboot the switch. Then you will need to verify connections and 474 | reconfigure the switch Interfaces as you did in [Exercise 2](../Exercise2). 475 | 476 | ``` 477 | Switch$ sudo reboot now 478 | ``` 479 | -------------------------------------------------------------------------------- /Exercise4/flow-objectives.sh: -------------------------------------------------------------------------------- 1 | ONOS_PASSWORD=karaf 2 | ONOS_USER=karaf 3 | ONOS_IP=127.0.0.1 4 | ONOS_PORT=8181 5 | 6 | curl -X POST -u ${ONOS_USER}:${ONOS_PASSWORD} -H "Content-Type: application/json" -d @forward-switch1-host1.json http://${ONOS_IP}:${ONOS_PORT}/onos/v1/flowobjectives/device:switch1/forward?appId=org.onosproject.rest 7 | curl -X POST -u ${ONOS_USER}:${ONOS_PASSWORD} -H "Content-Type: application/json" -d @forward-switch1-host2.json http://${ONOS_IP}:${ONOS_PORT}/onos/v1/flowobjectives/device:switch1/forward?appId=org.onosproject.rest 8 | curl -X POST -u ${ONOS_USER}:${ONOS_PASSWORD} -H "Content-Type: application/json" -d @next-switch1-host1.json http://${ONOS_IP}:${ONOS_PORT}/onos/v1/flowobjectives/device:switch1/next?appId=org.onosproject.rest 9 | curl -X POST -u ${ONOS_USER}:${ONOS_PASSWORD} -H "Content-Type: application/json" -d @next-switch1-host2.json http://${ONOS_IP}:${ONOS_PORT}/onos/v1/flowobjectives/device:switch1/next?appId=org.onosproject.rest 10 | curl -X POST -u ${ONOS_USER}:${ONOS_PASSWORD} -H "Content-Type: application/json" -d @forward-switch2-host1.json http://${ONOS_IP}:${ONOS_PORT}/onos/v1/flowobjectives/device:switch2/forward?appId=org.onosproject.rest 11 | curl -X POST -u ${ONOS_USER}:${ONOS_PASSWORD} -H "Content-Type: application/json" -d @forward-switch2-host2.json http://${ONOS_IP}:${ONOS_PORT}/onos/v1/flowobjectives/device:switch2/forward?appId=org.onosproject.rest 12 | curl -X POST -u ${ONOS_USER}:${ONOS_PASSWORD} -H "Content-Type: application/json" -d @next-switch2-host1.json http://${ONOS_IP}:${ONOS_PORT}/onos/v1/flowobjectives/device:switch2/next?appId=org.onosproject.rest 13 | curl -X POST -u ${ONOS_USER}:${ONOS_PASSWORD} -H "Content-Type: application/json" -d @next-switch2-host2.json http://${ONOS_IP}:${ONOS_PORT}/onos/v1/flowobjectives/device:switch2/next?appId=org.onosproject.rest 14 | -------------------------------------------------------------------------------- /Exercise4/forward-switch1-host1.json: -------------------------------------------------------------------------------- 1 | { 2 | "flag": "SPECIFIC", 3 | "priority": 40000, 4 | "timeout": 0, 5 | "isPermanent": true, 6 | "deviceId": "device:switch1", 7 | "operation": "ADD", 8 | "selector": { 9 | "criteria": [ 10 | { 11 | "type": "IPV4_DST", 12 | "ip": "10.1.1.0/24" 13 | }, 14 | { 15 | "type": "ETH_TYPE", 16 | "ethType": "0x0800" 17 | } 18 | ] 19 | }, 20 | "nextId" : 101 21 | } 22 | -------------------------------------------------------------------------------- /Exercise4/forward-switch1-host2.json: -------------------------------------------------------------------------------- 1 | { 2 | "flag": "SPECIFIC", 3 | "priority": 40000, 4 | "timeout": 0, 5 | "isPermanent": true, 6 | "deviceId": "device:switch1", 7 | "operation": "ADD", 8 | "selector": { 9 | "criteria": [ 10 | { 11 | "type": "IPV4_DST", 12 | "ip": "10.2.2.0/24" 13 | }, 14 | { 15 | "type": "ETH_TYPE", 16 | "ethType": "0x0800" 17 | } 18 | ] 19 | }, 20 | "nextId" : 100 21 | } 22 | -------------------------------------------------------------------------------- /Exercise4/forward-switch2-host1.json: -------------------------------------------------------------------------------- 1 | { 2 | "flag": "SPECIFIC", 3 | "priority": 40000, 4 | "timeout": 0, 5 | "isPermanent": true, 6 | "deviceId": "device:switch2", 7 | "operation": "ADD", 8 | "selector": { 9 | "criteria": [ 10 | { 11 | "type": "IPV4_DST", 12 | "ip": "10.1.1.0/24" 13 | }, 14 | { 15 | "type": "ETH_TYPE", 16 | "ethType": "0x0800" 17 | } 18 | ] 19 | }, 20 | "nextId" : 200 21 | } 22 | -------------------------------------------------------------------------------- /Exercise4/forward-switch2-host2.json: -------------------------------------------------------------------------------- 1 | { 2 | "flag": "SPECIFIC", 3 | "priority": 40000, 4 | "timeout": 0, 5 | "isPermanent": true, 6 | "deviceId": "device:switch2", 7 | "operation": "ADD", 8 | "selector": { 9 | "criteria": [ 10 | { 11 | "type": "IPV4_DST", 12 | "ip": "10.2.2.0/24" 13 | }, 14 | { 15 | "type": "ETH_TYPE", 16 | "ethType": "0x0800" 17 | } 18 | ] 19 | }, 20 | "nextId" : 201 21 | } 22 | -------------------------------------------------------------------------------- /Exercise4/next-switch1-host1.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "HASHED", 3 | "id": 101, 4 | "priority": 400000, 5 | "timeout": 0, 6 | "isPermanent": true, 7 | "deviceId": "device:switch1", 8 | "operation": "ADD", 9 | "treatments": [ 10 | { 11 | "instructions": [ 12 | { 13 | "type": "L2MODIFICATION", 14 | "subtype": "ETH_SRC", 15 | "mac": "a8:2b:b5:f0:f0:f5" 16 | }, 17 | { 18 | "type": "L2MODIFICATION", 19 | "subtype": "ETH_DST", 20 | "mac": "40:a6:b7:28:be:d8" 21 | }, 22 | { 23 | "type": "OUTPUT", 24 | "port": "120" 25 | } 26 | ] 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /Exercise4/next-switch1-host2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "HASHED", 3 | "id": 100, 4 | "priority": 400000, 5 | "timeout": 0, 6 | "isPermanent": true, 7 | "deviceId": "device:switch1", 8 | "operation": "ADD", 9 | "treatments": [ 10 | { 11 | "instructions": [ 12 | { 13 | "type": "L2MODIFICATION", 14 | "subtype": "ETH_SRC", 15 | "mac": "a8:2b:b5:f0:f0:f5" 16 | }, 17 | { 18 | "type": "L2MODIFICATION", 19 | "subtype": "ETH_DST", 20 | "mac": "a8:2b:b5:f0:ed:e3" 21 | }, 22 | { 23 | "type": "OUTPUT", 24 | "port": "0" 25 | } 26 | ] 27 | }, 28 | { 29 | "instructions": [ 30 | { 31 | "type": "L2MODIFICATION", 32 | "subtype": "ETH_SRC", 33 | "mac": "a8:2b:b5:f0:f0:f5" 34 | }, 35 | { 36 | "type": "L2MODIFICATION", 37 | "subtype": "ETH_DST", 38 | "mac": "a8:2b:b5:f0:ed:e3" 39 | }, 40 | { 41 | "type": "OUTPUT", 42 | "port": "104" 43 | } 44 | ] 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /Exercise4/next-switch2-host1.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "HASHED", 3 | "id": 200, 4 | "priority": 400000, 5 | "timeout": 0, 6 | "isPermanent": true, 7 | "deviceId": "device:switch2", 8 | "operation": "ADD", 9 | "treatments": [ 10 | { 11 | "instructions": [ 12 | { 13 | "type": "L2MODIFICATION", 14 | "subtype": "ETH_DST", 15 | "mac": "a8:2b:b5:f0:f0:f5" 16 | }, 17 | { 18 | "type": "L2MODIFICATION", 19 | "subtype": "ETH_SRC", 20 | "mac": "a8:2b:b5:f0:ed:e3" 21 | }, 22 | { 23 | "type": "OUTPUT", 24 | "port": "0" 25 | } 26 | ] 27 | }, 28 | { 29 | "instructions": [ 30 | { 31 | "type": "L2MODIFICATION", 32 | "subtype": "ETH_DST", 33 | "mac": "a8:2b:b5:f0:f0:f5" 34 | }, 35 | { 36 | "type": "L2MODIFICATION", 37 | "subtype": "ETH_SRC", 38 | "mac": "a8:2b:b5:f0:ed:e3" 39 | }, 40 | { 41 | "type": "OUTPUT", 42 | "port": "104" 43 | } 44 | ] 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /Exercise4/next-switch2-host2.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "HASHED", 3 | "id": 201, 4 | "priority": 400000, 5 | "timeout": 0, 6 | "isPermanent": true, 7 | "deviceId": "device:switch2", 8 | "operation": "ADD", 9 | "treatments": [ 10 | { 11 | "instructions": [ 12 | { 13 | "type": "L2MODIFICATION", 14 | "subtype": "ETH_SRC", 15 | "mac": "a8:2b:b5:f0:ed:e3" 16 | }, 17 | { 18 | "type": "L2MODIFICATION", 19 | "subtype": "ETH_DST", 20 | "mac": "00:07:43:4b:7f:50" 21 | }, 22 | { 23 | "type": "OUTPUT", 24 | "port": "120" 25 | } 26 | ] 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /Exercise4/tutorial-netconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "devices": { 3 | "device:switch1": { 4 | "ports": { 5 | "0": { 6 | "enabled": true, 7 | "name": "Ethernet0", 8 | "number": 0, 9 | "removed": false, 10 | "speed": 100000, 11 | "type": "copper" 12 | }, 13 | "104": { 14 | "enabled": true, 15 | "name": "Ethernet104", 16 | "number": 104, 17 | "removed": false, 18 | "speed": 100000, 19 | "type": "copper" 20 | }, 21 | "120": { 22 | "enabled": true, 23 | "name": "Ethernet120", 24 | "number": 120, 25 | "removed": false, 26 | "speed": 40000, 27 | "type": "copper" 28 | } 29 | }, 30 | "basic": { 31 | "managementAddress": "grpc://10.70.2.5:9559?device_id=183807201", 32 | "manufacturer": "Edgecore", 33 | "hwVersion":"AS7712", 34 | "driver": "sonic", 35 | "pipeconf": "org.onosproject.pipelines.sai", 36 | "locType": "grid", 37 | "gridX": 200, 38 | "gridY": 600 39 | } 40 | }, 41 | "device:switch2": { 42 | "ports": { 43 | "0": { 44 | "enabled": true, 45 | "name": "Ethernet0", 46 | "number": 0, 47 | "removed": false, 48 | "speed": 100000, 49 | "type": "copper" 50 | }, 51 | "104": { 52 | "enabled": true, 53 | "name": "Ethernet104", 54 | "number": 104, 55 | "removed": false, 56 | "speed": 100000, 57 | "type": "copper" 58 | }, 59 | "120": { 60 | "enabled": true, 61 | "name": "Ethernet120", 62 | "number": 120, 63 | "removed": false, 64 | "speed": 100000, 65 | "type": "copper" 66 | } 67 | }, 68 | "basic": { 69 | "managementAddress": "grpc://10.70.2.6:9559?device_id=183807201", 70 | "manufacturer": "Edgecore", 71 | "hwVersion":"AS7712", 72 | "driver": "sonic", 73 | "pipeconf": "org.onosproject.pipelines.sai", 74 | "locType": "grid", 75 | "gridX": 400, 76 | "gridY": 600 77 | } 78 | } 79 | }, 80 | "hosts" : { 81 | "40:a6:b7:28:be:d8/None": { 82 | "basic": { 83 | "name": "host1", 84 | "allowed": true, 85 | "locType": "grid", 86 | "gridX": 200, 87 | "gridY": 800, 88 | "ips": [ 89 | "10.1.1.2" 90 | ], 91 | "locations": [ 92 | "device:switch1/120" 93 | ] 94 | } 95 | }, 96 | "00:07:43:4b:7f:50/None": { 97 | "basic": { 98 | "name": "host2", 99 | "allowed": true, 100 | "locType": "grid", 101 | "gridX": 400, 102 | "gridY": 800, 103 | "ips": [ 104 | "10.2.2.2" 105 | ], 106 | "locations": [ 107 | "device:switch2/120" 108 | ] 109 | } 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Exercise5/PINS-Demo-Topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pins/tutorials/ba42a5fb5455198a4811c099be4b45270c88cf8a/Exercise5/PINS-Demo-Topology.png -------------------------------------------------------------------------------- /Exercise5/README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Exercise 5 - PINS Fabric Demonstration 8 | 9 | PINS launched at the OCP Global Summit in November 2021. If you have not already 10 | watched the [complete video](https://www.youtube.com/watch?v=iZuWdiV9dnc) of the 11 | demonstration, here is a link that jumps to the beginning of the [Weighted Cost 12 | MultiPath (WCMP) Demo](https://www.youtube.com/watch?v=iZuWdiV9dnc&t=271s) (link 13 | starts at 4:43 and lasts 6:18 minutes). 14 | 15 | This demonstration brings P4 and SDN to SONiC, using ONOS for a control plane to 16 | manage routes and set up the flow objectives. It is a pure play SDN solution 17 | that uses a multi-purpose L2/L3 leaf-spine switching fabric without traditional 18 | control protocols such as BGP. The SDN Controller (ONOS) is decoupled from the 19 | data plane and runs the segment routing application that powers Trellis and 20 | SD-Fabric. (Normally, the segment routing application relies on MPLS rules in 21 | the spines, but we use IPv4 routes in this case.) The result is that the fabric 22 | acts as one big router. For more information on the switch pipeline, you can 23 | find the P4 SAI tables here: 24 | [sonic-net/sonic-pins/sai_p4](https://github.com/sonic-net/sonic-pins/tree/main/sai_p4/instantiations/google). 25 | The `middleblock.p4` instantiation of the SAI pipeline is close to what we used 26 | for our demonstration. 27 | 28 | The PINS demonstration topology is a 2x2 leaf-spine fabric and server(s) with 29 | the following setup: 30 | 31 | * 4 PINS switches connected in a 2x2 leaf-spine topology 32 | * _Spine_: Arista 7060DX4-C32, Broadcom Tomahawk3 33 | * _Spine_: Accton Wedge100BF-32X, Intel Barefoot Tofino 34 | * _Leaf_: Arista 7060DX4-C32, Broadcom Tomahawk3 35 | * _Leaf_: Arista 7170-64C, Intel Barefoot Tofino 36 | * Server: 37 | * A server (could be a laptop) must run ONOS with access to the management 38 | network of the switches. 39 | * Hosts are on the two leaf devices. Instead of physical hosts, network 40 | namespaces or mac vlan interfaces can emulate hosts on a server. We used 41 | namespaces in our demo. 42 | 43 | ### Figure 2 - PINS Demonstration Topology 44 | 45 | ![alt_text](PINS-Demo-Topology.png "PINS Demo Topology") 46 | 47 | ### Create a PINS Demonstration on Your Network (Advanced) 48 | 49 | If you have access to four switches to create this demonstration, you can 50 | download the PINS demonstration software and experiment on your network. 51 | 52 | WCMP depends on your network topology. In the future, we will have tools such as 53 | gNMI to determine route weights and enable WCMP. For now, you have to choose the 54 | weights manually, as we did in the demonstration. Then use the config files 55 | found in the demonstration software to achieve WCMP in your network. 56 | 57 | There are five folders containing configuration files in this exercise, one for 58 | each switch/ASIC combination and one for ONOS. Each switch needs a 59 | `config_db.json` file. The switches that contain a Broadcom ASIC also require 60 | `port_config.ini` and `*.config.bcm` to implement SAI. 61 | 62 | 1. `spine-arista-TH3`: Arista 7060DX4-C32, Broadcom Tomahawk3 63 | 2. `spine-accton-BF`: Accton Wedge100BF-32X, Intel Barefoot Tofino 64 | 3. `leaf-arista-TH3`: Arista 7060DX4-C32, Broadcom Tomahawk3 65 | 4. `leaf-arista-BF`: Arista 7170-64C, Intel Barefoot Tofino 66 | 5. `onos-topology`: ONOS configuration file, `netconfig.json`, for segment 67 | routing and gRPC connections (i.e. the P4Runtime connection) 68 | 69 | The docker container with ONOS that you got in Exercise 4 has the PINS driver 70 | and SAI pipeliner installed. There are two pipelines in 71 | `org.onosproject.pipelines.sai` and `org.onosproject.pipelines.sai_fixed`. The 72 | latter does not include ACLs. If your topology has other requirements and you 73 | need to create other pipelines, explore the [SONiC ONOS 74 | Driver](https://github.com/pins/sonic-onos-driver) repository, especially the 75 | [loader](https://github.com/pins/sonic-onos-driver/blob/main/pipeliner/src/main/java/org/onosproject/pipelines/sai/SaiPipeconfLoader.java). 76 | You will also need follow the instructions in [Build ONOS with 77 | PINS](../BuildONOSwithPINS) instead of using the docker image we built for you 78 | in Exercise 4. 79 | -------------------------------------------------------------------------------- /Exercise5/leaf-arista-BF/config_db.json: -------------------------------------------------------------------------------- 1 | { 2 | "DEVICE_METADATA": { 3 | "localhost": { 4 | "hwsku": "Arista-7170-64C", 5 | "platform": "x86_64-arista_7170_64c", 6 | "mac": "00:1c:73:14:2e:29", 7 | "hostname": "pins-aristabf", 8 | "type": "LeafRouter", 9 | "bgp_asn": "65100" 10 | } 11 | }, 12 | "PORT": { 13 | "Ethernet0": { 14 | "id": "0", 15 | "lanes": "0,1,2,3", 16 | "alias": "Ethernet1/1", 17 | "speed": "100000", 18 | "index": "1", 19 | "admin_status": "up", 20 | "mtu": "9100" 21 | }, 22 | "Ethernet4": { 23 | "id": "4", 24 | "lanes": "4,5,6,7", 25 | "alias": "Ethernet2/1", 26 | "speed": "100000", 27 | "index": "2", 28 | "admin_status": "up", 29 | "mtu": "9100" 30 | }, 31 | "Ethernet8": { 32 | "id": "8", 33 | "lanes": "8,9,10,11", 34 | "alias": "Ethernet3/1", 35 | "speed": "100000", 36 | "index": "3", 37 | "admin_status": "up", 38 | "mtu": "9100" 39 | }, 40 | "Ethernet12": { 41 | "id": "12", 42 | "lanes": "12,13,14,15", 43 | "alias": "Ethernet4/1", 44 | "speed": "100000", 45 | "index": "4", 46 | "admin_status": "up", 47 | "mtu": "9100" 48 | }, 49 | "Ethernet16": { 50 | "id": "16", 51 | "lanes": "16,17,18,19", 52 | "alias": "Ethernet5/1", 53 | "speed": "100000", 54 | "index": "5", 55 | "admin_status": "up", 56 | "mtu": "9100" 57 | }, 58 | "Ethernet20": { 59 | "id": "20", 60 | "lanes": "20,21,22,23", 61 | "alias": "Ethernet6/1", 62 | "speed": "100000", 63 | "index": "6", 64 | "admin_status": "up", 65 | "mtu": "9100" 66 | }, 67 | "Ethernet24": { 68 | "id": "24", 69 | "lanes": "24,25,26,27", 70 | "alias": "Ethernet7/1", 71 | "speed": "100000", 72 | "index": "7", 73 | "admin_status": "up", 74 | "mtu": "9100" 75 | }, 76 | "Ethernet28": { 77 | "id": "28", 78 | "lanes": "28,29,30,31", 79 | "alias": "Ethernet8/1", 80 | "speed": "100000", 81 | "index": "8", 82 | "admin_status": "up", 83 | "mtu": "9100" 84 | }, 85 | "Ethernet32": { 86 | "id": "32", 87 | "lanes": "32,33,34,35", 88 | "alias": "Ethernet9/1", 89 | "speed": "100000", 90 | "index": "9", 91 | "admin_status": "up", 92 | "mtu": "9100" 93 | }, 94 | "Ethernet36": { 95 | "id": "36", 96 | "lanes": "36,37,38,39", 97 | "alias": "Ethernet10/1", 98 | "speed": "100000", 99 | "index": "10", 100 | "admin_status": "up", 101 | "mtu": "9100" 102 | }, 103 | "Ethernet40": { 104 | "id": "40", 105 | "lanes": "40,41,42,43", 106 | "alias": "Ethernet11/1", 107 | "speed": "100000", 108 | "index": "11", 109 | "admin_status": "up", 110 | "mtu": "9100" 111 | }, 112 | "Ethernet44": { 113 | "id": "44", 114 | "lanes": "44,45,46,47", 115 | "alias": "Ethernet12/1", 116 | "speed": "100000", 117 | "index": "12", 118 | "admin_status": "up", 119 | "mtu": "9100" 120 | }, 121 | "Ethernet48": { 122 | "id": "48", 123 | "lanes": "48,49,50,51", 124 | "alias": "Ethernet13/1", 125 | "speed": "100000", 126 | "index": "13", 127 | "admin_status": "up", 128 | "mtu": "9100" 129 | }, 130 | "Ethernet52": { 131 | "id": "52", 132 | "lanes": "52,53,54,55", 133 | "alias": "Ethernet14/1", 134 | "speed": "100000", 135 | "index": "14", 136 | "admin_status": "up", 137 | "mtu": "9100" 138 | }, 139 | "Ethernet56": { 140 | "id": "56", 141 | "lanes": "56,57,58,59", 142 | "alias": "Ethernet15/1", 143 | "speed": "100000", 144 | "index": "15", 145 | "admin_status": "up", 146 | "mtu": "9100" 147 | }, 148 | "Ethernet60": { 149 | "id": "60", 150 | "lanes": "60,61,62,63", 151 | "alias": "Ethernet16/1", 152 | "speed": "100000", 153 | "index": "16", 154 | "admin_status": "up", 155 | "mtu": "9100" 156 | }, 157 | "Ethernet64": { 158 | "id": "64", 159 | "lanes": "64,65,66,67", 160 | "alias": "Ethernet17/1", 161 | "speed": "100000", 162 | "index": "17", 163 | "admin_status": "up", 164 | "mtu": "9100" 165 | }, 166 | "Ethernet68": { 167 | "id": "68", 168 | "lanes": "68,69,70,71", 169 | "alias": "Ethernet18/1", 170 | "speed": "100000", 171 | "index": "18", 172 | "admin_status": "up", 173 | "mtu": "9100" 174 | }, 175 | "Ethernet72": { 176 | "id": "72", 177 | "lanes": "72,73,74,75", 178 | "alias": "Ethernet19/1", 179 | "speed": "100000", 180 | "index": "19", 181 | "admin_status": "up", 182 | "mtu": "9100" 183 | }, 184 | "Ethernet76": { 185 | "id": "76", 186 | "lanes": "76,77,78,79", 187 | "alias": "Ethernet20/1", 188 | "speed": "100000", 189 | "index": "20", 190 | "admin_status": "up", 191 | "mtu": "9100" 192 | }, 193 | "Ethernet80": { 194 | "id": "80", 195 | "lanes": "80,81,82,83", 196 | "alias": "Ethernet21/1", 197 | "speed": "100000", 198 | "index": "21", 199 | "admin_status": "up", 200 | "mtu": "9100" 201 | }, 202 | "Ethernet84": { 203 | "id": "84", 204 | "lanes": "84,85,86,87", 205 | "alias": "Ethernet22/1", 206 | "speed": "100000", 207 | "index": "22", 208 | "admin_status": "up", 209 | "mtu": "9100" 210 | }, 211 | "Ethernet88": { 212 | "id": "88", 213 | "lanes": "88,89,90,91", 214 | "alias": "Ethernet23/1", 215 | "speed": "100000", 216 | "index": "23", 217 | "admin_status": "up", 218 | "mtu": "9100" 219 | }, 220 | "Ethernet92": { 221 | "id": "92", 222 | "lanes": "92,93,94,95", 223 | "alias": "Ethernet24/1", 224 | "speed": "100000", 225 | "index": "24", 226 | "admin_status": "up", 227 | "mtu": "9100" 228 | }, 229 | "Ethernet96": { 230 | "id": "96", 231 | "lanes": "96,97,98,99", 232 | "alias": "Ethernet25/1", 233 | "speed": "100000", 234 | "index": "25", 235 | "admin_status": "up", 236 | "mtu": "9100" 237 | }, 238 | "Ethernet100": { 239 | "id": "100", 240 | "lanes": "100,101,102,103", 241 | "alias": "Ethernet26/1", 242 | "speed": "100000", 243 | "index": "26", 244 | "admin_status": "up", 245 | "mtu": "9100" 246 | }, 247 | "Ethernet104": { 248 | "id": "104", 249 | "lanes": "104,105,106,107", 250 | "alias": "Ethernet27/1", 251 | "speed": "100000", 252 | "index": "27", 253 | "admin_status": "up", 254 | "mtu": "9100" 255 | }, 256 | "Ethernet108": { 257 | "id": "108", 258 | "lanes": "108,109,110,111", 259 | "alias": "Ethernet28/1", 260 | "speed": "100000", 261 | "index": "28", 262 | "admin_status": "up", 263 | "mtu": "9100" 264 | }, 265 | "Ethernet112": { 266 | "id": "112", 267 | "lanes": "112,113,114,115", 268 | "alias": "Ethernet29/1", 269 | "speed": "100000", 270 | "index": "29", 271 | "admin_status": "up", 272 | "mtu": "9100" 273 | }, 274 | "Ethernet116": { 275 | "id": "116", 276 | "lanes": "116,117,118,119", 277 | "alias": "Ethernet30/1", 278 | "speed": "100000", 279 | "index": "30", 280 | "admin_status": "up", 281 | "mtu": "9100" 282 | }, 283 | "Ethernet120": { 284 | "id": "120", 285 | "lanes": "120,121,122,123", 286 | "alias": "Ethernet31/1", 287 | "speed": "100000", 288 | "index": "31", 289 | "admin_status": "up", 290 | "mtu": "9100" 291 | }, 292 | "Ethernet124": { 293 | "id": "124", 294 | "lanes": "124,125,126,127", 295 | "alias": "Ethernet32/1", 296 | "speed": "100000", 297 | "index": "32", 298 | "admin_status": "up", 299 | "mtu": "9100" 300 | }, 301 | "Ethernet128": { 302 | "id": "128", 303 | "lanes": "128,129,130,131", 304 | "alias": "Ethernet33/1", 305 | "speed": "100000", 306 | "index": "33", 307 | "admin_status": "up", 308 | "mtu": "9100" 309 | }, 310 | "Ethernet132": { 311 | "id": "132", 312 | "lanes": "132,133,134,135", 313 | "alias": "Ethernet34/1", 314 | "speed": "100000", 315 | "index": "34", 316 | "admin_status": "up", 317 | "mtu": "9100" 318 | }, 319 | "Ethernet136": { 320 | "id": "136", 321 | "lanes": "136,137,138,139", 322 | "alias": "Ethernet35/1", 323 | "speed": "100000", 324 | "index": "35", 325 | "admin_status": "up", 326 | "mtu": "9100" 327 | }, 328 | "Ethernet140": { 329 | "id": "140", 330 | "lanes": "140,141,142,143", 331 | "alias": "Ethernet36/1", 332 | "speed": "100000", 333 | "index": "36", 334 | "admin_status": "up", 335 | "mtu": "9100" 336 | }, 337 | "Ethernet144": { 338 | "id": "144", 339 | "lanes": "144,145,146,147", 340 | "alias": "Ethernet37/1", 341 | "speed": "100000", 342 | "index": "37", 343 | "admin_status": "up", 344 | "mtu": "9100" 345 | }, 346 | "Ethernet148": { 347 | "id": "148", 348 | "lanes": "148,149,150,151", 349 | "alias": "Ethernet38/1", 350 | "speed": "100000", 351 | "index": "38", 352 | "admin_status": "up", 353 | "mtu": "9100" 354 | }, 355 | "Ethernet152": { 356 | "id": "152", 357 | "lanes": "152,153,154,155", 358 | "alias": "Ethernet39/1", 359 | "speed": "100000", 360 | "index": "39", 361 | "admin_status": "up", 362 | "mtu": "9100" 363 | }, 364 | "Ethernet156": { 365 | "id": "156", 366 | "lanes": "156,157,158,159", 367 | "alias": "Ethernet40/1", 368 | "speed": "100000", 369 | "index": "40", 370 | "admin_status": "up", 371 | "mtu": "9100" 372 | }, 373 | "Ethernet160": { 374 | "id": "160", 375 | "lanes": "160,161,162,163", 376 | "alias": "Ethernet41/1", 377 | "speed": "100000", 378 | "index": "41", 379 | "admin_status": "up", 380 | "mtu": "9100" 381 | }, 382 | "Ethernet164": { 383 | "id": "164", 384 | "lanes": "164,165,166,167", 385 | "alias": "Ethernet42/1", 386 | "speed": "100000", 387 | "index": "42", 388 | "admin_status": "up", 389 | "mtu": "9100" 390 | }, 391 | "Ethernet168": { 392 | "id": "168", 393 | "lanes": "168,169,170,171", 394 | "alias": "Ethernet43/1", 395 | "speed": "100000", 396 | "index": "43", 397 | "admin_status": "up", 398 | "mtu": "9100" 399 | }, 400 | "Ethernet172": { 401 | "id": "172", 402 | "lanes": "172,173,174,175", 403 | "alias": "Ethernet44/1", 404 | "speed": "100000", 405 | "index": "44", 406 | "admin_status": "up", 407 | "mtu": "9100" 408 | }, 409 | "Ethernet176": { 410 | "id": "176", 411 | "lanes": "176,177,178,179", 412 | "alias": "Ethernet45/1", 413 | "speed": "100000", 414 | "index": "45", 415 | "admin_status": "up", 416 | "mtu": "9100" 417 | }, 418 | "Ethernet180": { 419 | "id": "180", 420 | "lanes": "180,181,182,183", 421 | "alias": "Ethernet46/1", 422 | "speed": "100000", 423 | "index": "46", 424 | "admin_status": "up", 425 | "mtu": "9100" 426 | }, 427 | "Ethernet184": { 428 | "id": "184", 429 | "lanes": "184,185,186,187", 430 | "alias": "Ethernet47/1", 431 | "speed": "100000", 432 | "index": "47", 433 | "admin_status": "up", 434 | "mtu": "9100" 435 | }, 436 | "Ethernet188": { 437 | "id": "188", 438 | "lanes": "188,189,190,191", 439 | "alias": "Ethernet48/1", 440 | "speed": "100000", 441 | "index": "48", 442 | "admin_status": "up", 443 | "mtu": "9100" 444 | }, 445 | "Ethernet192": { 446 | "id": "192", 447 | "lanes": "192,193,194,195", 448 | "alias": "Ethernet49/1", 449 | "speed": "100000", 450 | "index": "49", 451 | "admin_status": "up", 452 | "mtu": "9100" 453 | }, 454 | "Ethernet196": { 455 | "id": "196", 456 | "lanes": "196,197,198,199", 457 | "alias": "Ethernet50/1", 458 | "speed": "100000", 459 | "index": "50", 460 | "admin_status": "up", 461 | "mtu": "9100" 462 | }, 463 | "Ethernet200": { 464 | "id": "200", 465 | "lanes": "200,201,202,203", 466 | "alias": "Ethernet51/1", 467 | "speed": "100000", 468 | "index": "51", 469 | "admin_status": "up", 470 | "mtu": "9100" 471 | }, 472 | "Ethernet204": { 473 | "id": "204", 474 | "lanes": "204,205,206,207", 475 | "alias": "Ethernet52/1", 476 | "speed": "100000", 477 | "index": "52", 478 | "admin_status": "up", 479 | "mtu": "9100" 480 | }, 481 | "Ethernet208": { 482 | "id": "208", 483 | "lanes": "208,209,210,211", 484 | "alias": "Ethernet53/1", 485 | "speed": "100000", 486 | "index": "53", 487 | "admin_status": "up", 488 | "mtu": "9100" 489 | }, 490 | "Ethernet212": { 491 | "id": "212", 492 | "lanes": "212,213,214,215", 493 | "alias": "Ethernet54/1", 494 | "speed": "100000", 495 | "index": "54", 496 | "admin_status": "up", 497 | "mtu": "9100" 498 | }, 499 | "Ethernet216": { 500 | "id": "216", 501 | "lanes": "216,217,218,219", 502 | "alias": "Ethernet55/1", 503 | "speed": "100000", 504 | "index": "55", 505 | "admin_status": "up", 506 | "mtu": "9100" 507 | }, 508 | "Ethernet220": { 509 | "id": "220", 510 | "lanes": "220,221,222,223", 511 | "alias": "Ethernet56/1", 512 | "speed": "100000", 513 | "index": "56", 514 | "admin_status": "up", 515 | "mtu": "9100" 516 | }, 517 | "Ethernet224": { 518 | "id": "224", 519 | "lanes": "224,225,226,227", 520 | "alias": "Ethernet57/1", 521 | "speed": "100000", 522 | "index": "57", 523 | "admin_status": "up", 524 | "mtu": "9100" 525 | }, 526 | "Ethernet228": { 527 | "id": "228", 528 | "lanes": "228,229,230,231", 529 | "alias": "Ethernet58/1", 530 | "speed": "100000", 531 | "index": "58", 532 | "admin_status": "up", 533 | "mtu": "9100" 534 | }, 535 | "Ethernet232": { 536 | "id": "232", 537 | "lanes": "232,233,234,235", 538 | "alias": "Ethernet59/1", 539 | "speed": "100000", 540 | "index": "59", 541 | "admin_status": "up", 542 | "mtu": "9100" 543 | }, 544 | "Ethernet236": { 545 | "id": "236", 546 | "lanes": "236,237,238,239", 547 | "alias": "Ethernet60/1", 548 | "speed": "100000", 549 | "index": "60", 550 | "admin_status": "up", 551 | "mtu": "9100" 552 | }, 553 | "Ethernet240": { 554 | "id": "240", 555 | "lanes": "240,241,242,243", 556 | "alias": "Ethernet61/1", 557 | "speed": "100000", 558 | "index": "61", 559 | "admin_status": "up", 560 | "mtu": "9100" 561 | }, 562 | "Ethernet244": { 563 | "id": "244", 564 | "lanes": "244,245,246,247", 565 | "alias": "Ethernet62/1", 566 | "speed": "100000", 567 | "index": "62", 568 | "admin_status": "up", 569 | "mtu": "9100" 570 | }, 571 | "Ethernet248": { 572 | "id": "248", 573 | "lanes": "248,249,250,251", 574 | "alias": "Ethernet63/1", 575 | "speed": "100000", 576 | "index": "63", 577 | "admin_status": "up", 578 | "mtu": "9100" 579 | }, 580 | "Ethernet252": { 581 | "id": "252", 582 | "lanes": "252,253,254,255", 583 | "alias": "Ethernet64/1", 584 | "speed": "100000", 585 | "index": "64", 586 | "admin_status": "up", 587 | "mtu": "9100" 588 | } 589 | }, 590 | "LOOPBACK_INTERFACE": { 591 | "Loopback0|10.1.0.1/32": {} 592 | }, 593 | "DEVICE_NEIGHBOR": {}, 594 | "INTERFACE": {}, 595 | "KDUMP": { 596 | "config": { 597 | "enabled": "false", 598 | "num_dumps": "3", 599 | "memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M" 600 | } 601 | } 602 | } 603 | -------------------------------------------------------------------------------- /Exercise5/leaf-arista-BF/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | sudo cp config_db.json /etc/sonic/ 4 | -------------------------------------------------------------------------------- /Exercise5/leaf-arista-TH3/config_db.json: -------------------------------------------------------------------------------- 1 | { 2 | "DEVICE_METADATA": { 3 | "localhost": { 4 | "hwsku": "Arista-7060DX4-C32", 5 | "platform": "x86_64-arista_7060dx4_32", 6 | "mac": "fc:bd:67:2b:c8:f8", 7 | "hostname": "sonic", 8 | "type": "LeafRouter", 9 | "bgp_asn": "65100" 10 | } 11 | }, 12 | "PORT": { 13 | "Ethernet0": { 14 | "lanes": "1,2,3,4,5,6,7,8", 15 | "alias": "Ethernet1/1", 16 | "index": "1", 17 | "id" : "0", 18 | "speed": "400000", 19 | "admin_status": "up", 20 | "mtu": "9100" 21 | }, 22 | "Ethernet8": { 23 | "lanes": "9,10,11,12,13,14,15,16", 24 | "alias": "Ethernet2/1", 25 | "index": "2", 26 | "id" : "8", 27 | "speed": "400000", 28 | "admin_status": "up", 29 | "mtu": "9100" 30 | }, 31 | "Ethernet16": { 32 | "lanes": "17,18", 33 | "alias": "Ethernet3/1", 34 | "index": "3", 35 | "id" : "16", 36 | "speed": "50000", 37 | "admin_status": "up", 38 | "mtu": "9100" 39 | }, 40 | "Ethernet20": { 41 | "lanes": "21,22", 42 | "alias": "Ethernet3/5", 43 | "index": "3", 44 | "id" : "20", 45 | "speed": "50000", 46 | "admin_status": "up", 47 | "mtu": "9100" 48 | }, 49 | "Ethernet24": { 50 | "lanes": "25,26,27,28,29,30,31,32", 51 | "alias": "Ethernet4/1", 52 | "index": "4", 53 | "id" : "24", 54 | "speed": "400000", 55 | "admin_status": "up", 56 | "mtu": "9100" 57 | }, 58 | "Ethernet32": { 59 | "lanes": "33,34,35,36,37,38,39,40", 60 | "alias": "Ethernet5/1", 61 | "index": "5", 62 | "id" : "32", 63 | "speed": "400000", 64 | "admin_status": "up", 65 | "mtu": "9100" 66 | }, 67 | "Ethernet40": { 68 | "lanes": "41,42,43,44,45,46,47,48", 69 | "alias": "Ethernet6/1", 70 | "index": "6", 71 | "id" : "40", 72 | "speed": "400000", 73 | "admin_status": "up", 74 | "mtu": "9100" 75 | }, 76 | "Ethernet48": { 77 | "lanes": "49,50,51,52,53,54,55,56", 78 | "alias": "Ethernet7/1", 79 | "index": "7", 80 | "id" : "48", 81 | "speed": "400000", 82 | "admin_status": "up", 83 | "mtu": "9100" 84 | }, 85 | "Ethernet56": { 86 | "lanes": "57,58,59,60,61,62,63,64", 87 | "alias": "Ethernet8/1", 88 | "index": "8", 89 | "id" : "56", 90 | "speed": "400000", 91 | "admin_status": "up", 92 | "mtu": "9100" 93 | }, 94 | "Ethernet64": { 95 | "lanes": "65,66,67,68,69,70,71,72", 96 | "alias": "Ethernet9/1", 97 | "index": "9", 98 | "id" : "64", 99 | "speed": "400000", 100 | "admin_status": "up", 101 | "mtu": "9100" 102 | }, 103 | "Ethernet72": { 104 | "lanes": "73,74,75,76,77,78,79,80", 105 | "alias": "Ethernet10/1", 106 | "index": "10", 107 | "id" : "72", 108 | "speed": "400000", 109 | "admin_status": "up", 110 | "mtu": "9100" 111 | }, 112 | "Ethernet80": { 113 | "lanes": "81,82,83,84,85,86,87,88", 114 | "alias": "Ethernet11/1", 115 | "index": "11", 116 | "id" : "80", 117 | "speed": "400000", 118 | "admin_status": "up", 119 | "mtu": "9100" 120 | }, 121 | "Ethernet88": { 122 | "lanes": "89,90,91,92,93,94,95,96", 123 | "alias": "Ethernet12/1", 124 | "index": "12", 125 | "id" : "88", 126 | "speed": "400000", 127 | "admin_status": "up", 128 | "mtu": "9100" 129 | }, 130 | "Ethernet96": { 131 | "lanes": "97,98,99,100,101,102,103,104", 132 | "alias": "Ethernet13/1", 133 | "index": "13", 134 | "id" : "96", 135 | "speed": "400000", 136 | "admin_status": "up", 137 | "mtu": "9100" 138 | }, 139 | "Ethernet104": { 140 | "lanes": "105,106,107,108,109,110,111,112", 141 | "alias": "Ethernet14/1", 142 | "index": "14", 143 | "id" : "104", 144 | "speed": "400000", 145 | "admin_status": "up", 146 | "mtu": "9100" 147 | }, 148 | "Ethernet112": { 149 | "lanes": "113,114,115,116,117,118,119,120", 150 | "alias": "Ethernet15/1", 151 | "index": "15", 152 | "id" : "112", 153 | "speed": "400000", 154 | "admin_status": "up", 155 | "mtu": "9100" 156 | }, 157 | "Ethernet120": { 158 | "lanes": "121,122,123,124,125,126,127,128", 159 | "alias": "Ethernet16/1", 160 | "index": "16", 161 | "id" : "120", 162 | "speed": "400000", 163 | "admin_status": "up", 164 | "mtu": "9100" 165 | }, 166 | "Ethernet128": { 167 | "lanes": "129,130,131,132,133,134,135,136", 168 | "alias": "Ethernet17/1", 169 | "index": "17", 170 | "id" : "128", 171 | "speed": "400000", 172 | "admin_status": "up", 173 | "mtu": "9100" 174 | }, 175 | "Ethernet136": { 176 | "lanes": "137,138,139,140,141,142,143,144", 177 | "alias": "Ethernet18/1", 178 | "index": "18", 179 | "id" : "136", 180 | "speed": "400000", 181 | "admin_status": "up", 182 | "mtu": "9100" 183 | }, 184 | "Ethernet144": { 185 | "lanes": "145,146,147,148,149,150,151,152", 186 | "alias": "Ethernet19/1", 187 | "index": "19", 188 | "id" : "144", 189 | "speed": "400000", 190 | "admin_status": "up", 191 | "mtu": "9100" 192 | }, 193 | "Ethernet152": { 194 | "lanes": "153,154,155,156,157,158,159,160", 195 | "alias": "Ethernet20/1", 196 | "index": "20", 197 | "id" : "152", 198 | "speed": "400000", 199 | "admin_status": "up", 200 | "mtu": "9100" 201 | }, 202 | "Ethernet160": { 203 | "lanes": "161,162,163,164,165,166,167,168", 204 | "alias": "Ethernet21/1", 205 | "index": "21", 206 | "id" : "160", 207 | "speed": "400000", 208 | "admin_status": "up", 209 | "mtu": "9100" 210 | }, 211 | "Ethernet168": { 212 | "lanes": "169,170,171,172,173,174,175,176", 213 | "alias": "Ethernet22/1", 214 | "index": "22", 215 | "id" : "168", 216 | "speed": "400000", 217 | "admin_status": "up", 218 | "mtu": "9100" 219 | }, 220 | "Ethernet176": { 221 | "lanes": "177,178,179,180,181,182,183,184", 222 | "alias": "Ethernet23/1", 223 | "index": "23", 224 | "id" : "176", 225 | "speed": "400000", 226 | "admin_status": "up", 227 | "mtu": "9100" 228 | }, 229 | "Ethernet184": { 230 | "lanes": "185,186,187,188,189,190,191,192", 231 | "alias": "Ethernet24/1", 232 | "index": "24", 233 | "id" : "184", 234 | "speed": "400000", 235 | "admin_status": "up", 236 | "mtu": "9100" 237 | }, 238 | "Ethernet192": { 239 | "lanes": "193,194,195,196,197,198,199,200", 240 | "alias": "Ethernet25/1", 241 | "index": "25", 242 | "id" : "192", 243 | "speed": "400000", 244 | "admin_status": "up", 245 | "mtu": "9100" 246 | }, 247 | "Ethernet200": { 248 | "lanes": "201,202,203,204,205,206,207,208", 249 | "alias": "Ethernet26/1", 250 | "index": "26", 251 | "id" : "200", 252 | "speed": "400000", 253 | "admin_status": "up", 254 | "mtu": "9100" 255 | }, 256 | "Ethernet208": { 257 | "lanes": "209,210,211,212,213,214,215,216", 258 | "alias": "Ethernet27/1", 259 | "index": "27", 260 | "id" : "208", 261 | "speed": "400000", 262 | "admin_status": "up", 263 | "mtu": "9100" 264 | }, 265 | "Ethernet216": { 266 | "lanes": "217,218,219,220,221,222,223,224", 267 | "alias": "Ethernet28/1", 268 | "index": "28", 269 | "id" : "216", 270 | "speed": "400000", 271 | "admin_status": "up", 272 | "mtu": "9100" 273 | }, 274 | "Ethernet224": { 275 | "lanes": "225,226,227,228", 276 | "alias": "Ethernet29/1", 277 | "index": "29", 278 | "id" : "224", 279 | "speed": "100000", 280 | "admin_status": "up", 281 | "mtu": "9100" 282 | }, 283 | "Ethernet228": { 284 | "lanes": "229,230,231,232", 285 | "alias": "Ethernet29/5", 286 | "index": "29", 287 | "id" : "228", 288 | "speed": "100000", 289 | "admin_status": "up", 290 | "mtu": "9100" 291 | }, 292 | "Ethernet232": { 293 | "lanes": "233,234,235,236,237,238,239,240", 294 | "alias": "Ethernet30/1", 295 | "index": "30", 296 | "id" : "232", 297 | "speed": "400000", 298 | "admin_status": "up", 299 | "mtu": "9100" 300 | }, 301 | "Ethernet240": { 302 | "lanes": "241,242,243,244", 303 | "alias": "Ethernet31/1", 304 | "index": "31", 305 | "id" : "240", 306 | "speed": "100000", 307 | "admin_status": "up", 308 | "mtu": "9100" 309 | }, 310 | "Ethernet244": { 311 | "lanes": "245,246,247,248", 312 | "alias": "Ethernet31/5", 313 | "index": "31", 314 | "id" : "244", 315 | "speed": "100000", 316 | "admin_status": "up", 317 | "mtu": "9100" 318 | }, 319 | "Ethernet248": { 320 | "lanes": "249,250,251,252,253,254,255,256", 321 | "alias": "Ethernet32/1", 322 | "index": "34", 323 | "id" : "248", 324 | "speed": "400000", 325 | "admin_status": "up", 326 | "mtu": "9100" 327 | }, 328 | "Ethernet256": { 329 | "lanes": "258", 330 | "alias": "Ethernet33", 331 | "index": "35", 332 | "id" : "256", 333 | "speed": "10000", 334 | "admin_status": "up", 335 | "mtu": "9100" 336 | }, 337 | "Ethernet260": { 338 | "lanes": "257", 339 | "alias": "Ethernet34", 340 | "index": "36", 341 | "id" : "260", 342 | "speed": "10000", 343 | "admin_status": "up", 344 | "mtu": "9100" 345 | } 346 | }, 347 | "LOOPBACK_INTERFACE": { 348 | "Loopback0|10.1.0.1/32": {} 349 | }, 350 | "BGP_NEIGHBOR": {}, 351 | "DEVICE_NEIGHBOR": {}, 352 | "INTERFACE": {}, 353 | "KDUMP": { 354 | "config": { 355 | "enabled": "false", 356 | "num_dumps": "3", 357 | "memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M" 358 | } 359 | } 360 | } 361 | -------------------------------------------------------------------------------- /Exercise5/leaf-arista-TH3/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | sudo cp config_db.json /etc/sonic/ 4 | sudo cp port_config.ini /usr/share/sonic/device/x86_64-arista_7060dx4_32/Arista-7060DX4-C32 5 | sudo cp th3-a7060dx4-c32-32x400G.config.bcm /usr/share/sonic/device/x86_64-arista_7060dx4_32/Arista-7060DX4-C32 6 | -------------------------------------------------------------------------------- /Exercise5/leaf-arista-TH3/port_config.ini: -------------------------------------------------------------------------------- 1 | # name lanes alias index speed 2 | Ethernet0 1,2,3,4,5,6,7,8 Ethernet1/1 1 400000 3 | Ethernet8 9,10,11,12,13,14,15,16 Ethernet2/1 2 400000 4 | Ethernet16 17,18 Ethernet3/1 3 50000 5 | Ethernet20 21,22 Ethernet3/5 3 50000 6 | Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 4 400000 7 | Ethernet32 33,34,35,36,37,38,39,40 Ethernet5/1 5 400000 8 | Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 6 400000 9 | Ethernet48 49,50,51,52,53,54,55,56 Ethernet7/1 7 400000 10 | Ethernet56 57,58,59,60,61,62,63,64 Ethernet8/1 8 400000 11 | Ethernet64 65,66,67,68,69,70,71,72 Ethernet9/1 9 400000 12 | Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 10 400000 13 | Ethernet80 81,82,83,84,85,86,87,88 Ethernet11/1 11 400000 14 | Ethernet88 89,90,91,92,93,94,95,96 Ethernet12/1 12 400000 15 | Ethernet96 97,98,99,100,101,102,103,104 Ethernet13/1 13 400000 16 | Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 14 400000 17 | Ethernet112 113,114,115,116,117,118,119,120 Ethernet15/1 15 400000 18 | Ethernet120 121,122,123,124,125,126,127,128 Ethernet16/1 16 400000 19 | Ethernet128 129,130,131,132,133,134,135,136 Ethernet17/1 17 400000 20 | Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 18 400000 21 | Ethernet144 145,146,147,148,149,150,151,152 Ethernet19/1 19 400000 22 | Ethernet152 153,154,155,156,157,158,159,160 Ethernet20/1 20 400000 23 | Ethernet160 161,162,163,164,165,166,167,168 Ethernet21/1 21 400000 24 | Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 22 400000 25 | Ethernet176 177,178,179,180,181,182,183,184 Ethernet23/1 23 400000 26 | Ethernet184 185,186,187,188,189,190,191,192 Ethernet24/1 24 400000 27 | Ethernet192 193,194,195,196,197,198,199,200 Ethernet25/1 25 400000 28 | Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 26 400000 29 | Ethernet208 209,210,211,212,213,214,215,216 Ethernet27/1 27 400000 30 | Ethernet216 217,218,219,220,221,222,223,224 Ethernet28/1 28 400000 31 | Ethernet224 225,226,227,228 Ethernet29/1 29 100000 32 | Ethernet228 229,230,231,232 Ethernet29/5 29 100000 33 | Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 30 400000 34 | Ethernet240 241,242,243,244 Ethernet31/1 31 100000 35 | Ethernet244 245,246,247,248 Ethernet31/5 31 100000 36 | Ethernet248 249,250,251,252,253,254,255,256 Ethernet32/1 32 400000 37 | Ethernet256 258 Ethernet33 33 10000 38 | Ethernet260 257 Ethernet34 34 10000 39 | -------------------------------------------------------------------------------- /Exercise5/leaf-arista-TH3/th3-a7060dx4-c32-32x400G.config.bcm: -------------------------------------------------------------------------------- 1 | arl_clean_timeout_usec=15000000 2 | asf_mem_profile.0=2 3 | bcm_num_cos.0=8 4 | bcm_stat_flags=1 5 | bcm_stat_jumbo.0=9236 6 | cdma_timeout_usec.0=15000000 7 | disable_pcie_firmware_check.0=1 8 | dma_desc_timeout_usec.0=15000000 9 | dpr_clock_frequency.0=1000 10 | l2xmsg_mode.0=1 11 | l2_mem_entries.0=8192 12 | l3_alpm_enable.0=2 13 | l3_mem_entries.0=16384 14 | max_vp_lags.0=0 15 | miim_intr_enable.0=0 16 | module_64ports.0=1 17 | multicast_l2_range.0=511 18 | oversubscribe_mode=1 19 | parity_correction=1 20 | parity_enable=1 21 | pbmp_xport_xe.0=0x3ffffffffffffffffffffffffffffffffffffffe 22 | phy_an_c37_38.0=2 23 | phy_an_c37_118.0=2 24 | phy_an_c73_1.0=1 25 | phy_an_c73_2.0=1 26 | phy_an_c73_3.0=1 27 | phy_an_c73_4.0=1 28 | phy_an_c73_20.0=1 29 | phy_an_c73_21.0=1 30 | phy_an_c73_22.0=1 31 | phy_an_c73_23.0=1 32 | phy_an_c73_38.0=0 33 | phy_an_c73_40.0=1 34 | phy_an_c73_41.0=1 35 | phy_an_c73_42.0=1 36 | phy_an_c73_43.0=1 37 | phy_an_c73_60.0=1 38 | phy_an_c73_61.0=1 39 | phy_an_c73_62.0=1 40 | phy_an_c73_63.0=1 41 | phy_an_c73_80.0=1 42 | phy_an_c73_81.0=1 43 | phy_an_c73_82.0=1 44 | phy_an_c73_83.0=1 45 | phy_an_c73_100.0=1 46 | phy_an_c73_101.0=1 47 | phy_an_c73_102.0=1 48 | phy_an_c73_103.0=1 49 | phy_an_c73_118.0=0 50 | phy_an_c73_120.0=1 51 | phy_an_c73_121.0=1 52 | phy_an_c73_122.0=1 53 | phy_an_c73_123.0=1 54 | phy_an_c73_140.0=1 55 | phy_an_c73_141.0=1 56 | phy_an_c73_142.0=1 57 | phy_an_c73_143.0=1 58 | phy_chain_rx_lane_map_physical{1.0}=0x42537160 59 | phy_chain_rx_lane_map_physical{9.0}=0x60715342 60 | phy_chain_rx_lane_map_physical{17.0}=0x06173425 61 | phy_chain_rx_lane_map_physical{25.0}=0x02471356 62 | phy_chain_rx_lane_map_physical{33.0}=0x27160534 63 | phy_chain_rx_lane_map_physical{41.0}=0x02461357 64 | phy_chain_rx_lane_map_physical{49.0}=0x26150437 65 | phy_chain_rx_lane_map_physical{57.0}=0x02461357 66 | phy_chain_rx_lane_map_physical{65.0}=0x27140536 67 | phy_chain_rx_lane_map_physical{73.0}=0x02471356 68 | phy_chain_rx_lane_map_physical{81.0}=0x27140536 69 | phy_chain_rx_lane_map_physical{89.0}=0x02471356 70 | phy_chain_rx_lane_map_physical{97.0}=0x02461357 71 | phy_chain_rx_lane_map_physical{105.0}=0x57124603 72 | phy_chain_rx_lane_map_physical{113.0}=0x17243506 73 | phy_chain_rx_lane_map_physical{121.0}=0x46315720 74 | phy_chain_rx_lane_map_physical{129.0}=0x60534271 75 | phy_chain_rx_lane_map_physical{137.0}=0x02461357 76 | phy_chain_rx_lane_map_physical{145.0}=0x27140536 77 | phy_chain_rx_lane_map_physical{153.0}=0x50271463 78 | phy_chain_rx_lane_map_physical{161.0}=0x31652074 79 | phy_chain_rx_lane_map_physical{169.0}=0x02461357 80 | phy_chain_rx_lane_map_physical{177.0}=0x26140537 81 | phy_chain_rx_lane_map_physical{185.0}=0x02461357 82 | phy_chain_rx_lane_map_physical{193.0}=0x26140537 83 | phy_chain_rx_lane_map_physical{201.0}=0x02461357 84 | phy_chain_rx_lane_map_physical{209.0}=0x27140536 85 | phy_chain_rx_lane_map_physical{217.0}=0x02641357 86 | phy_chain_rx_lane_map_physical{225.0}=0x60734251 87 | phy_chain_rx_lane_map_physical{233.0}=0x31462057 88 | phy_chain_rx_lane_map_physical{241.0}=0x60715342 89 | phy_chain_rx_lane_map_physical{249.0}=0x35216047 90 | phy_chain_rx_lane_map_physical{257.0}=0x3210 91 | phy_chain_rx_polarity_flip_physical{1.0}=0x1 92 | phy_chain_rx_polarity_flip_physical{2.0}=0x0 93 | phy_chain_rx_polarity_flip_physical{3.0}=0x0 94 | phy_chain_rx_polarity_flip_physical{4.0}=0x1 95 | phy_chain_rx_polarity_flip_physical{5.0}=0x0 96 | phy_chain_rx_polarity_flip_physical{6.0}=0x1 97 | phy_chain_rx_polarity_flip_physical{7.0}=0x1 98 | phy_chain_rx_polarity_flip_physical{8.0}=0x0 99 | phy_chain_rx_polarity_flip_physical{9.0}=0x1 100 | phy_chain_rx_polarity_flip_physical{10.0}=0x0 101 | phy_chain_rx_polarity_flip_physical{11.0}=0x0 102 | phy_chain_rx_polarity_flip_physical{12.0}=0x1 103 | phy_chain_rx_polarity_flip_physical{13.0}=0x0 104 | phy_chain_rx_polarity_flip_physical{14.0}=0x1 105 | phy_chain_rx_polarity_flip_physical{15.0}=0x1 106 | phy_chain_rx_polarity_flip_physical{16.0}=0x0 107 | phy_chain_rx_polarity_flip_physical{17.0}=0x0 108 | phy_chain_rx_polarity_flip_physical{18.0}=0x0 109 | phy_chain_rx_polarity_flip_physical{19.0}=0x1 110 | phy_chain_rx_polarity_flip_physical{20.0}=0x0 111 | phy_chain_rx_polarity_flip_physical{21.0}=0x0 112 | phy_chain_rx_polarity_flip_physical{22.0}=0x1 113 | phy_chain_rx_polarity_flip_physical{23.0}=0x1 114 | phy_chain_rx_polarity_flip_physical{24.0}=0x1 115 | phy_chain_rx_polarity_flip_physical{25.0}=0x0 116 | phy_chain_rx_polarity_flip_physical{26.0}=0x1 117 | phy_chain_rx_polarity_flip_physical{27.0}=0x0 118 | phy_chain_rx_polarity_flip_physical{28.0}=0x0 119 | phy_chain_rx_polarity_flip_physical{29.0}=0x0 120 | phy_chain_rx_polarity_flip_physical{30.0}=0x1 121 | phy_chain_rx_polarity_flip_physical{31.0}=0x1 122 | phy_chain_rx_polarity_flip_physical{32.0}=0x0 123 | phy_chain_rx_polarity_flip_physical{33.0}=0x1 124 | phy_chain_rx_polarity_flip_physical{34.0}=0x1 125 | phy_chain_rx_polarity_flip_physical{35.0}=0x0 126 | phy_chain_rx_polarity_flip_physical{36.0}=0x0 127 | phy_chain_rx_polarity_flip_physical{37.0}=0x1 128 | phy_chain_rx_polarity_flip_physical{38.0}=0x1 129 | phy_chain_rx_polarity_flip_physical{39.0}=0x0 130 | phy_chain_rx_polarity_flip_physical{40.0}=0x0 131 | phy_chain_rx_polarity_flip_physical{41.0}=0x0 132 | phy_chain_rx_polarity_flip_physical{42.0}=0x1 133 | phy_chain_rx_polarity_flip_physical{43.0}=0x1 134 | phy_chain_rx_polarity_flip_physical{44.0}=0x0 135 | phy_chain_rx_polarity_flip_physical{45.0}=0x0 136 | phy_chain_rx_polarity_flip_physical{46.0}=0x1 137 | phy_chain_rx_polarity_flip_physical{47.0}=0x1 138 | phy_chain_rx_polarity_flip_physical{48.0}=0x0 139 | phy_chain_rx_polarity_flip_physical{49.0}=0x0 140 | phy_chain_rx_polarity_flip_physical{50.0}=0x0 141 | phy_chain_rx_polarity_flip_physical{51.0}=0x1 142 | phy_chain_rx_polarity_flip_physical{52.0}=0x0 143 | phy_chain_rx_polarity_flip_physical{53.0}=0x0 144 | phy_chain_rx_polarity_flip_physical{54.0}=0x1 145 | phy_chain_rx_polarity_flip_physical{55.0}=0x0 146 | phy_chain_rx_polarity_flip_physical{56.0}=0x0 147 | phy_chain_rx_polarity_flip_physical{57.0}=0x0 148 | phy_chain_rx_polarity_flip_physical{58.0}=0x1 149 | phy_chain_rx_polarity_flip_physical{59.0}=0x1 150 | phy_chain_rx_polarity_flip_physical{60.0}=0x0 151 | phy_chain_rx_polarity_flip_physical{61.0}=0x0 152 | phy_chain_rx_polarity_flip_physical{62.0}=0x1 153 | phy_chain_rx_polarity_flip_physical{63.0}=0x1 154 | phy_chain_rx_polarity_flip_physical{64.0}=0x0 155 | phy_chain_rx_polarity_flip_physical{65.0}=0x1 156 | phy_chain_rx_polarity_flip_physical{66.0}=0x1 157 | phy_chain_rx_polarity_flip_physical{67.0}=0x0 158 | phy_chain_rx_polarity_flip_physical{68.0}=0x0 159 | phy_chain_rx_polarity_flip_physical{69.0}=0x1 160 | phy_chain_rx_polarity_flip_physical{70.0}=0x1 161 | phy_chain_rx_polarity_flip_physical{71.0}=0x0 162 | phy_chain_rx_polarity_flip_physical{72.0}=0x0 163 | phy_chain_rx_polarity_flip_physical{73.0}=0x1 164 | phy_chain_rx_polarity_flip_physical{74.0}=0x1 165 | phy_chain_rx_polarity_flip_physical{75.0}=0x0 166 | phy_chain_rx_polarity_flip_physical{76.0}=0x0 167 | phy_chain_rx_polarity_flip_physical{77.0}=0x0 168 | phy_chain_rx_polarity_flip_physical{78.0}=0x1 169 | phy_chain_rx_polarity_flip_physical{79.0}=0x1 170 | phy_chain_rx_polarity_flip_physical{80.0}=0x0 171 | phy_chain_rx_polarity_flip_physical{81.0}=0x1 172 | phy_chain_rx_polarity_flip_physical{82.0}=0x1 173 | phy_chain_rx_polarity_flip_physical{83.0}=0x0 174 | phy_chain_rx_polarity_flip_physical{84.0}=0x0 175 | phy_chain_rx_polarity_flip_physical{85.0}=0x1 176 | phy_chain_rx_polarity_flip_physical{86.0}=0x1 177 | phy_chain_rx_polarity_flip_physical{87.0}=0x0 178 | phy_chain_rx_polarity_flip_physical{88.0}=0x0 179 | phy_chain_rx_polarity_flip_physical{89.0}=0x1 180 | phy_chain_rx_polarity_flip_physical{90.0}=0x1 181 | phy_chain_rx_polarity_flip_physical{91.0}=0x0 182 | phy_chain_rx_polarity_flip_physical{92.0}=0x0 183 | phy_chain_rx_polarity_flip_physical{93.0}=0x0 184 | phy_chain_rx_polarity_flip_physical{94.0}=0x1 185 | phy_chain_rx_polarity_flip_physical{95.0}=0x1 186 | phy_chain_rx_polarity_flip_physical{96.0}=0x0 187 | phy_chain_rx_polarity_flip_physical{97.0}=0x0 188 | phy_chain_rx_polarity_flip_physical{98.0}=0x1 189 | phy_chain_rx_polarity_flip_physical{99.0}=0x1 190 | phy_chain_rx_polarity_flip_physical{100.0}=0x1 191 | phy_chain_rx_polarity_flip_physical{101.0}=0x1 192 | phy_chain_rx_polarity_flip_physical{102.0}=0x0 193 | phy_chain_rx_polarity_flip_physical{103.0}=0x0 194 | phy_chain_rx_polarity_flip_physical{104.0}=0x0 195 | phy_chain_rx_polarity_flip_physical{105.0}=0x1 196 | phy_chain_rx_polarity_flip_physical{106.0}=0x1 197 | phy_chain_rx_polarity_flip_physical{107.0}=0x0 198 | phy_chain_rx_polarity_flip_physical{108.0}=0x0 199 | phy_chain_rx_polarity_flip_physical{109.0}=0x0 200 | phy_chain_rx_polarity_flip_physical{110.0}=0x1 201 | phy_chain_rx_polarity_flip_physical{111.0}=0x1 202 | phy_chain_rx_polarity_flip_physical{112.0}=0x0 203 | phy_chain_rx_polarity_flip_physical{113.0}=0x1 204 | phy_chain_rx_polarity_flip_physical{114.0}=0x1 205 | phy_chain_rx_polarity_flip_physical{115.0}=0x0 206 | phy_chain_rx_polarity_flip_physical{116.0}=0x1 207 | phy_chain_rx_polarity_flip_physical{117.0}=0x1 208 | phy_chain_rx_polarity_flip_physical{118.0}=0x0 209 | phy_chain_rx_polarity_flip_physical{119.0}=0x1 210 | phy_chain_rx_polarity_flip_physical{120.0}=0x1 211 | phy_chain_rx_polarity_flip_physical{121.0}=0x1 212 | phy_chain_rx_polarity_flip_physical{122.0}=0x0 213 | phy_chain_rx_polarity_flip_physical{123.0}=0x0 214 | phy_chain_rx_polarity_flip_physical{124.0}=0x1 215 | phy_chain_rx_polarity_flip_physical{125.0}=0x0 216 | phy_chain_rx_polarity_flip_physical{126.0}=0x1 217 | phy_chain_rx_polarity_flip_physical{127.0}=0x1 218 | phy_chain_rx_polarity_flip_physical{128.0}=0x0 219 | phy_chain_rx_polarity_flip_physical{129.0}=0x0 220 | phy_chain_rx_polarity_flip_physical{130.0}=0x0 221 | phy_chain_rx_polarity_flip_physical{131.0}=0x1 222 | phy_chain_rx_polarity_flip_physical{132.0}=0x0 223 | phy_chain_rx_polarity_flip_physical{133.0}=0x0 224 | phy_chain_rx_polarity_flip_physical{134.0}=0x1 225 | phy_chain_rx_polarity_flip_physical{135.0}=0x0 226 | phy_chain_rx_polarity_flip_physical{136.0}=0x0 227 | phy_chain_rx_polarity_flip_physical{137.0}=0x0 228 | phy_chain_rx_polarity_flip_physical{138.0}=0x1 229 | phy_chain_rx_polarity_flip_physical{139.0}=0x1 230 | phy_chain_rx_polarity_flip_physical{140.0}=0x0 231 | phy_chain_rx_polarity_flip_physical{141.0}=0x0 232 | phy_chain_rx_polarity_flip_physical{142.0}=0x1 233 | phy_chain_rx_polarity_flip_physical{143.0}=0x1 234 | phy_chain_rx_polarity_flip_physical{144.0}=0x0 235 | phy_chain_rx_polarity_flip_physical{145.0}=0x1 236 | phy_chain_rx_polarity_flip_physical{146.0}=0x1 237 | phy_chain_rx_polarity_flip_physical{147.0}=0x0 238 | phy_chain_rx_polarity_flip_physical{148.0}=0x0 239 | phy_chain_rx_polarity_flip_physical{149.0}=0x1 240 | phy_chain_rx_polarity_flip_physical{150.0}=0x1 241 | phy_chain_rx_polarity_flip_physical{151.0}=0x0 242 | phy_chain_rx_polarity_flip_physical{152.0}=0x0 243 | phy_chain_rx_polarity_flip_physical{153.0}=0x0 244 | phy_chain_rx_polarity_flip_physical{154.0}=0x1 245 | phy_chain_rx_polarity_flip_physical{155.0}=0x0 246 | phy_chain_rx_polarity_flip_physical{156.0}=0x1 247 | phy_chain_rx_polarity_flip_physical{157.0}=0x1 248 | phy_chain_rx_polarity_flip_physical{158.0}=0x0 249 | phy_chain_rx_polarity_flip_physical{159.0}=0x1 250 | phy_chain_rx_polarity_flip_physical{160.0}=0x0 251 | phy_chain_rx_polarity_flip_physical{161.0}=0x1 252 | phy_chain_rx_polarity_flip_physical{162.0}=0x1 253 | phy_chain_rx_polarity_flip_physical{163.0}=0x1 254 | phy_chain_rx_polarity_flip_physical{164.0}=0x1 255 | phy_chain_rx_polarity_flip_physical{165.0}=0x0 256 | phy_chain_rx_polarity_flip_physical{166.0}=0x0 257 | phy_chain_rx_polarity_flip_physical{167.0}=0x0 258 | phy_chain_rx_polarity_flip_physical{168.0}=0x0 259 | phy_chain_rx_polarity_flip_physical{169.0}=0x0 260 | phy_chain_rx_polarity_flip_physical{170.0}=0x1 261 | phy_chain_rx_polarity_flip_physical{171.0}=0x1 262 | phy_chain_rx_polarity_flip_physical{172.0}=0x0 263 | phy_chain_rx_polarity_flip_physical{173.0}=0x0 264 | phy_chain_rx_polarity_flip_physical{174.0}=0x1 265 | phy_chain_rx_polarity_flip_physical{175.0}=0x1 266 | phy_chain_rx_polarity_flip_physical{176.0}=0x0 267 | phy_chain_rx_polarity_flip_physical{177.0}=0x0 268 | phy_chain_rx_polarity_flip_physical{178.0}=0x0 269 | phy_chain_rx_polarity_flip_physical{179.0}=0x0 270 | phy_chain_rx_polarity_flip_physical{180.0}=0x0 271 | phy_chain_rx_polarity_flip_physical{181.0}=0x1 272 | phy_chain_rx_polarity_flip_physical{182.0}=0x1 273 | phy_chain_rx_polarity_flip_physical{183.0}=0x0 274 | phy_chain_rx_polarity_flip_physical{184.0}=0x0 275 | phy_chain_rx_polarity_flip_physical{185.0}=0x0 276 | phy_chain_rx_polarity_flip_physical{186.0}=0x1 277 | phy_chain_rx_polarity_flip_physical{187.0}=0x1 278 | phy_chain_rx_polarity_flip_physical{188.0}=0x0 279 | phy_chain_rx_polarity_flip_physical{189.0}=0x0 280 | phy_chain_rx_polarity_flip_physical{190.0}=0x1 281 | phy_chain_rx_polarity_flip_physical{191.0}=0x1 282 | phy_chain_rx_polarity_flip_physical{192.0}=0x0 283 | phy_chain_rx_polarity_flip_physical{193.0}=0x0 284 | phy_chain_rx_polarity_flip_physical{194.0}=0x0 285 | phy_chain_rx_polarity_flip_physical{195.0}=0x0 286 | phy_chain_rx_polarity_flip_physical{196.0}=0x0 287 | phy_chain_rx_polarity_flip_physical{197.0}=0x1 288 | phy_chain_rx_polarity_flip_physical{198.0}=0x1 289 | phy_chain_rx_polarity_flip_physical{199.0}=0x0 290 | phy_chain_rx_polarity_flip_physical{200.0}=0x0 291 | phy_chain_rx_polarity_flip_physical{201.0}=0x0 292 | phy_chain_rx_polarity_flip_physical{202.0}=0x1 293 | phy_chain_rx_polarity_flip_physical{203.0}=0x1 294 | phy_chain_rx_polarity_flip_physical{204.0}=0x0 295 | phy_chain_rx_polarity_flip_physical{205.0}=0x0 296 | phy_chain_rx_polarity_flip_physical{206.0}=0x1 297 | phy_chain_rx_polarity_flip_physical{207.0}=0x1 298 | phy_chain_rx_polarity_flip_physical{208.0}=0x0 299 | phy_chain_rx_polarity_flip_physical{209.0}=0x1 300 | phy_chain_rx_polarity_flip_physical{210.0}=0x1 301 | phy_chain_rx_polarity_flip_physical{211.0}=0x0 302 | phy_chain_rx_polarity_flip_physical{212.0}=0x0 303 | phy_chain_rx_polarity_flip_physical{213.0}=0x1 304 | phy_chain_rx_polarity_flip_physical{214.0}=0x1 305 | phy_chain_rx_polarity_flip_physical{215.0}=0x0 306 | phy_chain_rx_polarity_flip_physical{216.0}=0x0 307 | phy_chain_rx_polarity_flip_physical{217.0}=0x0 308 | phy_chain_rx_polarity_flip_physical{218.0}=0x1 309 | phy_chain_rx_polarity_flip_physical{219.0}=0x1 310 | phy_chain_rx_polarity_flip_physical{220.0}=0x0 311 | phy_chain_rx_polarity_flip_physical{221.0}=0x0 312 | phy_chain_rx_polarity_flip_physical{222.0}=0x1 313 | phy_chain_rx_polarity_flip_physical{223.0}=0x1 314 | phy_chain_rx_polarity_flip_physical{224.0}=0x0 315 | phy_chain_rx_polarity_flip_physical{225.0}=0x0 316 | phy_chain_rx_polarity_flip_physical{226.0}=0x0 317 | phy_chain_rx_polarity_flip_physical{227.0}=0x1 318 | phy_chain_rx_polarity_flip_physical{228.0}=0x0 319 | phy_chain_rx_polarity_flip_physical{229.0}=0x0 320 | phy_chain_rx_polarity_flip_physical{230.0}=0x1 321 | phy_chain_rx_polarity_flip_physical{231.0}=0x0 322 | phy_chain_rx_polarity_flip_physical{232.0}=0x0 323 | phy_chain_rx_polarity_flip_physical{233.0}=0x0 324 | phy_chain_rx_polarity_flip_physical{234.0}=0x1 325 | phy_chain_rx_polarity_flip_physical{235.0}=0x1 326 | phy_chain_rx_polarity_flip_physical{236.0}=0x0 327 | phy_chain_rx_polarity_flip_physical{237.0}=0x1 328 | phy_chain_rx_polarity_flip_physical{238.0}=0x0 329 | phy_chain_rx_polarity_flip_physical{239.0}=0x0 330 | phy_chain_rx_polarity_flip_physical{240.0}=0x1 331 | phy_chain_rx_polarity_flip_physical{241.0}=0x1 332 | phy_chain_rx_polarity_flip_physical{242.0}=0x0 333 | phy_chain_rx_polarity_flip_physical{243.0}=0x0 334 | phy_chain_rx_polarity_flip_physical{244.0}=0x0 335 | phy_chain_rx_polarity_flip_physical{245.0}=0x0 336 | phy_chain_rx_polarity_flip_physical{246.0}=0x1 337 | phy_chain_rx_polarity_flip_physical{247.0}=0x1 338 | phy_chain_rx_polarity_flip_physical{248.0}=0x1 339 | phy_chain_rx_polarity_flip_physical{249.0}=0x1 340 | phy_chain_rx_polarity_flip_physical{250.0}=0x1 341 | phy_chain_rx_polarity_flip_physical{251.0}=0x0 342 | phy_chain_rx_polarity_flip_physical{252.0}=0x0 343 | phy_chain_rx_polarity_flip_physical{253.0}=0x0 344 | phy_chain_rx_polarity_flip_physical{254.0}=0x0 345 | phy_chain_rx_polarity_flip_physical{255.0}=0x1 346 | phy_chain_rx_polarity_flip_physical{256.0}=0x1 347 | phy_chain_rx_polarity_flip_physical{257.0}=0x0 348 | phy_chain_rx_polarity_flip_physical{258.0}=0x0 349 | phy_chain_tx_lane_map_physical{1.0}=0x30451627 350 | phy_chain_tx_lane_map_physical{9.0}=0x74532610 351 | phy_chain_tx_lane_map_physical{17.0}=0x51407362 352 | phy_chain_tx_lane_map_physical{25.0}=0x27160435 353 | phy_chain_tx_lane_map_physical{33.0}=0x65347021 354 | phy_chain_tx_lane_map_physical{41.0}=0x16072435 355 | phy_chain_tx_lane_map_physical{49.0}=0x75126430 356 | phy_chain_tx_lane_map_physical{57.0}=0x26071435 357 | phy_chain_tx_lane_map_physical{65.0}=0x75026431 358 | phy_chain_tx_lane_map_physical{73.0}=0x26071435 359 | phy_chain_tx_lane_map_physical{81.0}=0x75026431 360 | phy_chain_tx_lane_map_physical{89.0}=0x26071435 361 | phy_chain_tx_lane_map_physical{97.0}=0x03746521 362 | phy_chain_tx_lane_map_physical{105.0}=0x06142735 363 | phy_chain_tx_lane_map_physical{113.0}=0x56237014 364 | phy_chain_tx_lane_map_physical{121.0}=0x01426375 365 | phy_chain_tx_lane_map_physical{129.0}=0x12673450 366 | phy_chain_tx_lane_map_physical{137.0}=0x45062731 367 | phy_chain_tx_lane_map_physical{145.0}=0x56237014 368 | phy_chain_tx_lane_map_physical{153.0}=0x56012437 369 | phy_chain_tx_lane_map_physical{161.0}=0x76215430 370 | phy_chain_tx_lane_map_physical{169.0}=0x57362410 371 | phy_chain_tx_lane_map_physical{177.0}=0x76215430 372 | phy_chain_tx_lane_map_physical{185.0}=0x57362410 373 | phy_chain_tx_lane_map_physical{193.0}=0x76215430 374 | phy_chain_tx_lane_map_physical{201.0}=0x57362410 375 | phy_chain_tx_lane_map_physical{209.0}=0x76215430 376 | phy_chain_tx_lane_map_physical{217.0}=0x57261430 377 | phy_chain_tx_lane_map_physical{225.0}=0x65217430 378 | phy_chain_tx_lane_map_physical{233.0}=0x45063721 379 | phy_chain_tx_lane_map_physical{241.0}=0x75216430 380 | phy_chain_tx_lane_map_physical{249.0}=0x64275130 381 | phy_chain_tx_lane_map_physical{257.0}=0x3210 382 | phy_chain_tx_polarity_flip_physical{1.0}=0x1 383 | phy_chain_tx_polarity_flip_physical{2.0}=0x1 384 | phy_chain_tx_polarity_flip_physical{3.0}=0x0 385 | phy_chain_tx_polarity_flip_physical{4.0}=0x1 386 | phy_chain_tx_polarity_flip_physical{5.0}=0x1 387 | phy_chain_tx_polarity_flip_physical{6.0}=0x1 388 | phy_chain_tx_polarity_flip_physical{7.0}=0x1 389 | phy_chain_tx_polarity_flip_physical{8.0}=0x0 390 | phy_chain_tx_polarity_flip_physical{9.0}=0x1 391 | phy_chain_tx_polarity_flip_physical{10.0}=0x0 392 | phy_chain_tx_polarity_flip_physical{11.0}=0x1 393 | phy_chain_tx_polarity_flip_physical{12.0}=0x1 394 | phy_chain_tx_polarity_flip_physical{13.0}=0x0 395 | phy_chain_tx_polarity_flip_physical{14.0}=0x0 396 | phy_chain_tx_polarity_flip_physical{15.0}=0x1 397 | phy_chain_tx_polarity_flip_physical{16.0}=0x0 398 | phy_chain_tx_polarity_flip_physical{17.0}=0x1 399 | phy_chain_tx_polarity_flip_physical{18.0}=0x0 400 | phy_chain_tx_polarity_flip_physical{19.0}=0x0 401 | phy_chain_tx_polarity_flip_physical{20.0}=0x1 402 | phy_chain_tx_polarity_flip_physical{21.0}=0x0 403 | phy_chain_tx_polarity_flip_physical{22.0}=0x1 404 | phy_chain_tx_polarity_flip_physical{23.0}=0x1 405 | phy_chain_tx_polarity_flip_physical{24.0}=0x0 406 | phy_chain_tx_polarity_flip_physical{25.0}=0x1 407 | phy_chain_tx_polarity_flip_physical{26.0}=0x0 408 | phy_chain_tx_polarity_flip_physical{27.0}=0x0 409 | phy_chain_tx_polarity_flip_physical{28.0}=0x1 410 | phy_chain_tx_polarity_flip_physical{29.0}=0x0 411 | phy_chain_tx_polarity_flip_physical{30.0}=0x1 412 | phy_chain_tx_polarity_flip_physical{31.0}=0x1 413 | phy_chain_tx_polarity_flip_physical{32.0}=0x0 414 | phy_chain_tx_polarity_flip_physical{33.0}=0x0 415 | phy_chain_tx_polarity_flip_physical{34.0}=0x0 416 | phy_chain_tx_polarity_flip_physical{35.0}=0x0 417 | phy_chain_tx_polarity_flip_physical{36.0}=0x1 418 | phy_chain_tx_polarity_flip_physical{37.0}=0x1 419 | phy_chain_tx_polarity_flip_physical{38.0}=0x1 420 | phy_chain_tx_polarity_flip_physical{39.0}=0x1 421 | phy_chain_tx_polarity_flip_physical{40.0}=0x0 422 | phy_chain_tx_polarity_flip_physical{41.0}=0x0 423 | phy_chain_tx_polarity_flip_physical{42.0}=0x0 424 | phy_chain_tx_polarity_flip_physical{43.0}=0x1 425 | phy_chain_tx_polarity_flip_physical{44.0}=0x1 426 | phy_chain_tx_polarity_flip_physical{45.0}=0x0 427 | phy_chain_tx_polarity_flip_physical{46.0}=0x0 428 | phy_chain_tx_polarity_flip_physical{47.0}=0x1 429 | phy_chain_tx_polarity_flip_physical{48.0}=0x1 430 | phy_chain_tx_polarity_flip_physical{49.0}=0x1 431 | phy_chain_tx_polarity_flip_physical{50.0}=0x1 432 | phy_chain_tx_polarity_flip_physical{51.0}=0x1 433 | phy_chain_tx_polarity_flip_physical{52.0}=0x1 434 | phy_chain_tx_polarity_flip_physical{53.0}=0x0 435 | phy_chain_tx_polarity_flip_physical{54.0}=0x0 436 | phy_chain_tx_polarity_flip_physical{55.0}=0x1 437 | phy_chain_tx_polarity_flip_physical{56.0}=0x1 438 | phy_chain_tx_polarity_flip_physical{57.0}=0x0 439 | phy_chain_tx_polarity_flip_physical{58.0}=0x1 440 | phy_chain_tx_polarity_flip_physical{59.0}=0x0 441 | phy_chain_tx_polarity_flip_physical{60.0}=0x1 442 | phy_chain_tx_polarity_flip_physical{61.0}=0x0 443 | phy_chain_tx_polarity_flip_physical{62.0}=0x0 444 | phy_chain_tx_polarity_flip_physical{63.0}=0x1 445 | phy_chain_tx_polarity_flip_physical{64.0}=0x1 446 | phy_chain_tx_polarity_flip_physical{65.0}=0x1 447 | phy_chain_tx_polarity_flip_physical{66.0}=0x1 448 | phy_chain_tx_polarity_flip_physical{67.0}=0x0 449 | phy_chain_tx_polarity_flip_physical{68.0}=0x0 450 | phy_chain_tx_polarity_flip_physical{69.0}=0x0 451 | phy_chain_tx_polarity_flip_physical{70.0}=0x0 452 | phy_chain_tx_polarity_flip_physical{71.0}=0x1 453 | phy_chain_tx_polarity_flip_physical{72.0}=0x1 454 | phy_chain_tx_polarity_flip_physical{73.0}=0x0 455 | phy_chain_tx_polarity_flip_physical{74.0}=0x1 456 | phy_chain_tx_polarity_flip_physical{75.0}=0x0 457 | phy_chain_tx_polarity_flip_physical{76.0}=0x1 458 | phy_chain_tx_polarity_flip_physical{77.0}=0x0 459 | phy_chain_tx_polarity_flip_physical{78.0}=0x0 460 | phy_chain_tx_polarity_flip_physical{79.0}=0x1 461 | phy_chain_tx_polarity_flip_physical{80.0}=0x1 462 | phy_chain_tx_polarity_flip_physical{81.0}=0x1 463 | phy_chain_tx_polarity_flip_physical{82.0}=0x1 464 | phy_chain_tx_polarity_flip_physical{83.0}=0x0 465 | phy_chain_tx_polarity_flip_physical{84.0}=0x0 466 | phy_chain_tx_polarity_flip_physical{85.0}=0x0 467 | phy_chain_tx_polarity_flip_physical{86.0}=0x0 468 | phy_chain_tx_polarity_flip_physical{87.0}=0x1 469 | phy_chain_tx_polarity_flip_physical{88.0}=0x1 470 | phy_chain_tx_polarity_flip_physical{89.0}=0x0 471 | phy_chain_tx_polarity_flip_physical{90.0}=0x1 472 | phy_chain_tx_polarity_flip_physical{91.0}=0x0 473 | phy_chain_tx_polarity_flip_physical{92.0}=0x1 474 | phy_chain_tx_polarity_flip_physical{93.0}=0x0 475 | phy_chain_tx_polarity_flip_physical{94.0}=0x0 476 | phy_chain_tx_polarity_flip_physical{95.0}=0x1 477 | phy_chain_tx_polarity_flip_physical{96.0}=0x1 478 | phy_chain_tx_polarity_flip_physical{97.0}=0x0 479 | phy_chain_tx_polarity_flip_physical{98.0}=0x0 480 | phy_chain_tx_polarity_flip_physical{99.0}=0x0 481 | phy_chain_tx_polarity_flip_physical{100.0}=0x0 482 | phy_chain_tx_polarity_flip_physical{101.0}=0x1 483 | phy_chain_tx_polarity_flip_physical{102.0}=0x1 484 | phy_chain_tx_polarity_flip_physical{103.0}=0x1 485 | phy_chain_tx_polarity_flip_physical{104.0}=0x0 486 | phy_chain_tx_polarity_flip_physical{105.0}=0x1 487 | phy_chain_tx_polarity_flip_physical{106.0}=0x0 488 | phy_chain_tx_polarity_flip_physical{107.0}=0x0 489 | phy_chain_tx_polarity_flip_physical{108.0}=0x1 490 | phy_chain_tx_polarity_flip_physical{109.0}=0x1 491 | phy_chain_tx_polarity_flip_physical{110.0}=0x0 492 | phy_chain_tx_polarity_flip_physical{111.0}=0x1 493 | phy_chain_tx_polarity_flip_physical{112.0}=0x0 494 | phy_chain_tx_polarity_flip_physical{113.0}=0x0 495 | phy_chain_tx_polarity_flip_physical{114.0}=0x1 496 | phy_chain_tx_polarity_flip_physical{115.0}=0x0 497 | phy_chain_tx_polarity_flip_physical{116.0}=0x0 498 | phy_chain_tx_polarity_flip_physical{117.0}=0x1 499 | phy_chain_tx_polarity_flip_physical{118.0}=0x0 500 | phy_chain_tx_polarity_flip_physical{119.0}=0x0 501 | phy_chain_tx_polarity_flip_physical{120.0}=0x0 502 | phy_chain_tx_polarity_flip_physical{121.0}=0x0 503 | phy_chain_tx_polarity_flip_physical{122.0}=0x0 504 | phy_chain_tx_polarity_flip_physical{123.0}=0x1 505 | phy_chain_tx_polarity_flip_physical{124.0}=0x1 506 | phy_chain_tx_polarity_flip_physical{125.0}=0x1 507 | phy_chain_tx_polarity_flip_physical{126.0}=0x1 508 | phy_chain_tx_polarity_flip_physical{127.0}=0x0 509 | phy_chain_tx_polarity_flip_physical{128.0}=0x0 510 | phy_chain_tx_polarity_flip_physical{129.0}=0x0 511 | phy_chain_tx_polarity_flip_physical{130.0}=0x1 512 | phy_chain_tx_polarity_flip_physical{131.0}=0x0 513 | phy_chain_tx_polarity_flip_physical{132.0}=0x0 514 | phy_chain_tx_polarity_flip_physical{133.0}=0x1 515 | phy_chain_tx_polarity_flip_physical{134.0}=0x0 516 | phy_chain_tx_polarity_flip_physical{135.0}=0x0 517 | phy_chain_tx_polarity_flip_physical{136.0}=0x0 518 | phy_chain_tx_polarity_flip_physical{137.0}=0x0 519 | phy_chain_tx_polarity_flip_physical{138.0}=0x0 520 | phy_chain_tx_polarity_flip_physical{139.0}=0x1 521 | phy_chain_tx_polarity_flip_physical{140.0}=0x1 522 | phy_chain_tx_polarity_flip_physical{141.0}=0x1 523 | phy_chain_tx_polarity_flip_physical{142.0}=0x1 524 | phy_chain_tx_polarity_flip_physical{143.0}=0x0 525 | phy_chain_tx_polarity_flip_physical{144.0}=0x0 526 | phy_chain_tx_polarity_flip_physical{145.0}=0x0 527 | phy_chain_tx_polarity_flip_physical{146.0}=0x1 528 | phy_chain_tx_polarity_flip_physical{147.0}=0x0 529 | phy_chain_tx_polarity_flip_physical{148.0}=0x0 530 | phy_chain_tx_polarity_flip_physical{149.0}=0x1 531 | phy_chain_tx_polarity_flip_physical{150.0}=0x0 532 | phy_chain_tx_polarity_flip_physical{151.0}=0x0 533 | phy_chain_tx_polarity_flip_physical{152.0}=0x0 534 | phy_chain_tx_polarity_flip_physical{153.0}=0x0 535 | phy_chain_tx_polarity_flip_physical{154.0}=0x0 536 | phy_chain_tx_polarity_flip_physical{155.0}=0x0 537 | phy_chain_tx_polarity_flip_physical{156.0}=0x1 538 | phy_chain_tx_polarity_flip_physical{157.0}=0x0 539 | phy_chain_tx_polarity_flip_physical{158.0}=0x1 540 | phy_chain_tx_polarity_flip_physical{159.0}=0x1 541 | phy_chain_tx_polarity_flip_physical{160.0}=0x0 542 | phy_chain_tx_polarity_flip_physical{161.0}=0x0 543 | phy_chain_tx_polarity_flip_physical{162.0}=0x1 544 | phy_chain_tx_polarity_flip_physical{163.0}=0x1 545 | phy_chain_tx_polarity_flip_physical{164.0}=0x0 546 | phy_chain_tx_polarity_flip_physical{165.0}=0x0 547 | phy_chain_tx_polarity_flip_physical{166.0}=0x0 548 | phy_chain_tx_polarity_flip_physical{167.0}=0x0 549 | phy_chain_tx_polarity_flip_physical{168.0}=0x0 550 | phy_chain_tx_polarity_flip_physical{169.0}=0x1 551 | phy_chain_tx_polarity_flip_physical{170.0}=0x0 552 | phy_chain_tx_polarity_flip_physical{171.0}=0x0 553 | phy_chain_tx_polarity_flip_physical{172.0}=0x1 554 | phy_chain_tx_polarity_flip_physical{173.0}=0x0 555 | phy_chain_tx_polarity_flip_physical{174.0}=0x1 556 | phy_chain_tx_polarity_flip_physical{175.0}=0x1 557 | phy_chain_tx_polarity_flip_physical{176.0}=0x0 558 | phy_chain_tx_polarity_flip_physical{177.0}=0x0 559 | phy_chain_tx_polarity_flip_physical{178.0}=0x1 560 | phy_chain_tx_polarity_flip_physical{179.0}=0x1 561 | phy_chain_tx_polarity_flip_physical{180.0}=0x0 562 | phy_chain_tx_polarity_flip_physical{181.0}=0x0 563 | phy_chain_tx_polarity_flip_physical{182.0}=0x0 564 | phy_chain_tx_polarity_flip_physical{183.0}=0x0 565 | phy_chain_tx_polarity_flip_physical{184.0}=0x0 566 | phy_chain_tx_polarity_flip_physical{185.0}=0x1 567 | phy_chain_tx_polarity_flip_physical{186.0}=0x0 568 | phy_chain_tx_polarity_flip_physical{187.0}=0x0 569 | phy_chain_tx_polarity_flip_physical{188.0}=0x1 570 | phy_chain_tx_polarity_flip_physical{189.0}=0x0 571 | phy_chain_tx_polarity_flip_physical{190.0}=0x1 572 | phy_chain_tx_polarity_flip_physical{191.0}=0x1 573 | phy_chain_tx_polarity_flip_physical{192.0}=0x0 574 | phy_chain_tx_polarity_flip_physical{193.0}=0x0 575 | phy_chain_tx_polarity_flip_physical{194.0}=0x1 576 | phy_chain_tx_polarity_flip_physical{195.0}=0x1 577 | phy_chain_tx_polarity_flip_physical{196.0}=0x0 578 | phy_chain_tx_polarity_flip_physical{197.0}=0x0 579 | phy_chain_tx_polarity_flip_physical{198.0}=0x0 580 | phy_chain_tx_polarity_flip_physical{199.0}=0x0 581 | phy_chain_tx_polarity_flip_physical{200.0}=0x0 582 | phy_chain_tx_polarity_flip_physical{201.0}=0x1 583 | phy_chain_tx_polarity_flip_physical{202.0}=0x0 584 | phy_chain_tx_polarity_flip_physical{203.0}=0x0 585 | phy_chain_tx_polarity_flip_physical{204.0}=0x1 586 | phy_chain_tx_polarity_flip_physical{205.0}=0x0 587 | phy_chain_tx_polarity_flip_physical{206.0}=0x1 588 | phy_chain_tx_polarity_flip_physical{207.0}=0x1 589 | phy_chain_tx_polarity_flip_physical{208.0}=0x0 590 | phy_chain_tx_polarity_flip_physical{209.0}=0x0 591 | phy_chain_tx_polarity_flip_physical{210.0}=0x1 592 | phy_chain_tx_polarity_flip_physical{211.0}=0x1 593 | phy_chain_tx_polarity_flip_physical{212.0}=0x0 594 | phy_chain_tx_polarity_flip_physical{213.0}=0x0 595 | phy_chain_tx_polarity_flip_physical{214.0}=0x0 596 | phy_chain_tx_polarity_flip_physical{215.0}=0x0 597 | phy_chain_tx_polarity_flip_physical{216.0}=0x0 598 | phy_chain_tx_polarity_flip_physical{217.0}=0x0 599 | phy_chain_tx_polarity_flip_physical{218.0}=0x1 600 | phy_chain_tx_polarity_flip_physical{219.0}=0x0 601 | phy_chain_tx_polarity_flip_physical{220.0}=0x1 602 | phy_chain_tx_polarity_flip_physical{221.0}=0x0 603 | phy_chain_tx_polarity_flip_physical{222.0}=0x1 604 | phy_chain_tx_polarity_flip_physical{223.0}=0x1 605 | phy_chain_tx_polarity_flip_physical{224.0}=0x0 606 | phy_chain_tx_polarity_flip_physical{225.0}=0x0 607 | phy_chain_tx_polarity_flip_physical{226.0}=0x1 608 | phy_chain_tx_polarity_flip_physical{227.0}=0x1 609 | phy_chain_tx_polarity_flip_physical{228.0}=0x0 610 | phy_chain_tx_polarity_flip_physical{229.0}=0x0 611 | phy_chain_tx_polarity_flip_physical{230.0}=0x1 612 | phy_chain_tx_polarity_flip_physical{231.0}=0x1 613 | phy_chain_tx_polarity_flip_physical{232.0}=0x0 614 | phy_chain_tx_polarity_flip_physical{233.0}=0x0 615 | phy_chain_tx_polarity_flip_physical{234.0}=0x1 616 | phy_chain_tx_polarity_flip_physical{235.0}=0x1 617 | phy_chain_tx_polarity_flip_physical{236.0}=0x0 618 | phy_chain_tx_polarity_flip_physical{237.0}=0x1 619 | phy_chain_tx_polarity_flip_physical{238.0}=0x1 620 | phy_chain_tx_polarity_flip_physical{239.0}=0x0 621 | phy_chain_tx_polarity_flip_physical{240.0}=0x0 622 | phy_chain_tx_polarity_flip_physical{241.0}=0x0 623 | phy_chain_tx_polarity_flip_physical{242.0}=0x1 624 | phy_chain_tx_polarity_flip_physical{243.0}=0x1 625 | phy_chain_tx_polarity_flip_physical{244.0}=0x0 626 | phy_chain_tx_polarity_flip_physical{245.0}=0x0 627 | phy_chain_tx_polarity_flip_physical{246.0}=0x0 628 | phy_chain_tx_polarity_flip_physical{247.0}=0x1 629 | phy_chain_tx_polarity_flip_physical{248.0}=0x1 630 | phy_chain_tx_polarity_flip_physical{249.0}=0x1 631 | phy_chain_tx_polarity_flip_physical{250.0}=0x1 632 | phy_chain_tx_polarity_flip_physical{251.0}=0x0 633 | phy_chain_tx_polarity_flip_physical{252.0}=0x0 634 | phy_chain_tx_polarity_flip_physical{253.0}=0x0 635 | phy_chain_tx_polarity_flip_physical{254.0}=0x0 636 | phy_chain_tx_polarity_flip_physical{255.0}=0x1 637 | phy_chain_tx_polarity_flip_physical{256.0}=0x1 638 | phy_chain_tx_polarity_flip_physical{257.0}=0x0 639 | phy_chain_tx_polarity_flip_physical{258.0}=0x0 640 | portmap_1.0=1:400 641 | portmap_2.0=9:400 642 | portmap_3.0=17:50:2 643 | portmap_4.0=21:50:2 644 | portmap_5.0=25:400 645 | portmap_20.0=33:400 646 | portmap_21.0=41:400 647 | portmap_22.0=49:400 648 | portmap_23.0=57:400 649 | portmap_38.0=257:10 650 | portmap_40.0=65:400 651 | portmap_41.0=73:400 652 | portmap_42.0=81:400 653 | portmap_43.0=89:400 654 | portmap_60.0=97:400 655 | portmap_61.0=105:400 656 | portmap_62.0=113:400 657 | portmap_63.0=121:400 658 | portmap_80.0=129:400 659 | portmap_81.0=137:400 660 | portmap_82.0=145:400 661 | portmap_83.0=153:400 662 | portmap_100.0=161:400 663 | portmap_101.0=169:400 664 | portmap_102.0=177:400 665 | portmap_103.0=185:400 666 | portmap_118.0=258:10 667 | portmap_120.0=193:400 668 | portmap_121.0=201:400 669 | portmap_122.0=209:400 670 | portmap_123.0=217:400 671 | portmap_140.0=225:100:4 672 | portmap_141.0=229:100:4 673 | portmap_142.0=233:400 674 | portmap_143.0=241:100:4 675 | portmap_144.0=245:100:4 676 | portmap_145.0=249:400 677 | port_init_autoneg_1.0=0 678 | port_init_autoneg_2.0=0 679 | port_init_autoneg_3.0=0 680 | port_init_autoneg_4.0=0 681 | port_init_autoneg_20.0=0 682 | port_init_autoneg_21.0=0 683 | port_init_autoneg_22.0=0 684 | port_init_autoneg_23.0=0 685 | port_init_autoneg_38.0=0 686 | port_init_autoneg_40.0=0 687 | port_init_autoneg_41.0=0 688 | port_init_autoneg_42.0=0 689 | port_init_autoneg_43.0=0 690 | port_init_autoneg_60.0=0 691 | port_init_autoneg_61.0=0 692 | port_init_autoneg_62.0=0 693 | port_init_autoneg_63.0=0 694 | port_init_autoneg_80.0=0 695 | port_init_autoneg_81.0=0 696 | port_init_autoneg_82.0=0 697 | port_init_autoneg_83.0=0 698 | port_init_autoneg_100.0=0 699 | port_init_autoneg_101.0=0 700 | port_init_autoneg_102.0=0 701 | port_init_autoneg_103.0=0 702 | port_init_autoneg_118.0=0 703 | port_init_autoneg_120.0=0 704 | port_init_autoneg_121.0=0 705 | port_init_autoneg_122.0=0 706 | port_init_autoneg_123.0=0 707 | port_init_autoneg_140.0=0 708 | port_init_autoneg_141.0=0 709 | port_init_autoneg_142.0=0 710 | port_init_autoneg_143.0=0 711 | port_phy_addr_1.0=0xff 712 | port_phy_addr_2.0=0xff 713 | port_phy_addr_3.0=0xff 714 | port_phy_addr_4.0=0xff 715 | port_phy_addr_20.0=0xff 716 | port_phy_addr_21.0=0xff 717 | port_phy_addr_22.0=0xff 718 | port_phy_addr_23.0=0xff 719 | port_phy_addr_38.0=0xff 720 | port_phy_addr_40.0=0xff 721 | port_phy_addr_41.0=0xff 722 | port_phy_addr_42.0=0xff 723 | port_phy_addr_43.0=0xff 724 | port_phy_addr_60.0=0xff 725 | port_phy_addr_61.0=0xff 726 | port_phy_addr_62.0=0xff 727 | port_phy_addr_63.0=0xff 728 | port_phy_addr_80.0=0xff 729 | port_phy_addr_81.0=0xff 730 | port_phy_addr_82.0=0xff 731 | port_phy_addr_83.0=0xff 732 | port_phy_addr_100.0=0xff 733 | port_phy_addr_101.0=0xff 734 | port_phy_addr_102.0=0xff 735 | port_phy_addr_103.0=0xff 736 | port_phy_addr_118.0=0xff 737 | port_phy_addr_120.0=0xff 738 | port_phy_addr_121.0=0xff 739 | port_phy_addr_122.0=0xff 740 | port_phy_addr_123.0=0xff 741 | port_phy_addr_140.0=0xff 742 | port_phy_addr_141.0=0xff 743 | port_phy_addr_142.0=0xff 744 | port_phy_addr_143.0=0xff 745 | robust_hash_disable_egress_vlan.0=1 746 | robust_hash_disable_mpls.0=1 747 | robust_hash_disable_vlan.0=1 748 | tdma_timeout_usec.0=15000000 749 | tslam_timeout_usec.0=15000000 750 | 751 | # Tuning 752 | serdes_core_rx_polarity_flip_physical{1}=0x96 753 | serdes_core_rx_polarity_flip_physical{9}=0x69 754 | serdes_core_rx_polarity_flip_physical{17}=0x93 755 | serdes_core_rx_polarity_flip_physical{25}=0xd3 756 | serdes_core_rx_polarity_flip_physical{33}=0xcc 757 | serdes_core_rx_polarity_flip_physical{41}=0xc3 758 | serdes_core_rx_polarity_flip_physical{49}=0x99 759 | serdes_core_rx_polarity_flip_physical{57}=0xc3 760 | serdes_core_rx_polarity_flip_physical{65}=0xcc 761 | serdes_core_rx_polarity_flip_physical{73}=0xd2 762 | serdes_core_rx_polarity_flip_physical{81}=0xcc 763 | serdes_core_rx_polarity_flip_physical{89}=0xd2 764 | serdes_core_rx_polarity_flip_physical{97}=0xc3 765 | serdes_core_rx_polarity_flip_physical{105}=0xd2 766 | serdes_core_rx_polarity_flip_physical{113}=0x66 767 | serdes_core_rx_polarity_flip_physical{121}=0xf0 768 | serdes_core_rx_polarity_flip_physical{129}=0x99 769 | serdes_core_rx_polarity_flip_physical{137}=0xc3 770 | serdes_core_rx_polarity_flip_physical{145}=0xcc 771 | serdes_core_rx_polarity_flip_physical{153}=0x99 772 | serdes_core_rx_polarity_flip_physical{161}=0xd2 773 | serdes_core_rx_polarity_flip_physical{169}=0xc3 774 | serdes_core_rx_polarity_flip_physical{177}=0x8d 775 | serdes_core_rx_polarity_flip_physical{185}=0xc3 776 | serdes_core_rx_polarity_flip_physical{193}=0x8d 777 | serdes_core_rx_polarity_flip_physical{201}=0xc3 778 | serdes_core_rx_polarity_flip_physical{209}=0xcc 779 | serdes_core_rx_polarity_flip_physical{217}=0xc3 780 | serdes_core_rx_polarity_flip_physical{225}=0x66 781 | serdes_core_rx_polarity_flip_physical{233}=0xf 782 | serdes_core_rx_polarity_flip_physical{241}=0x69 783 | serdes_core_rx_polarity_flip_physical{249}=0x9a 784 | serdes_core_rx_polarity_flip_physical{257}=0x0 785 | serdes_core_tx_polarity_flip_physical{1}=0xac 786 | serdes_core_tx_polarity_flip_physical{9}=0xa9 787 | serdes_core_tx_polarity_flip_physical{17}=0x99 788 | serdes_core_tx_polarity_flip_physical{25}=0xc9 789 | serdes_core_tx_polarity_flip_physical{33}=0x4e 790 | serdes_core_tx_polarity_flip_physical{41}=0x39 791 | serdes_core_tx_polarity_flip_physical{49}=0xd1 792 | serdes_core_tx_polarity_flip_physical{57}=0xb1 793 | serdes_core_tx_polarity_flip_physical{65}=0xf0 794 | serdes_core_tx_polarity_flip_physical{73}=0xb1 795 | serdes_core_tx_polarity_flip_physical{81}=0xf0 796 | serdes_core_tx_polarity_flip_physical{89}=0xb1 797 | serdes_core_tx_polarity_flip_physical{97}=0x6e 798 | serdes_core_tx_polarity_flip_physical{105}=0xd8 799 | serdes_core_tx_polarity_flip_physical{113}=0xac 800 | serdes_core_tx_polarity_flip_physical{121}=0x6c 801 | serdes_core_tx_polarity_flip_physical{129}=0xac 802 | serdes_core_tx_polarity_flip_physical{137}=0x6c 803 | serdes_core_tx_polarity_flip_physical{145}=0xac 804 | serdes_core_tx_polarity_flip_physical{153}=0xe9 805 | serdes_core_tx_polarity_flip_physical{161}=0xa9 806 | serdes_core_tx_polarity_flip_physical{169}=0xc9 807 | serdes_core_tx_polarity_flip_physical{177}=0xa9 808 | serdes_core_tx_polarity_flip_physical{185}=0xc9 809 | serdes_core_tx_polarity_flip_physical{193}=0xa9 810 | serdes_core_tx_polarity_flip_physical{201}=0xc9 811 | serdes_core_tx_polarity_flip_physical{209}=0xa9 812 | serdes_core_tx_polarity_flip_physical{217}=0xe1 813 | serdes_core_tx_polarity_flip_physical{225}=0x69 814 | serdes_core_tx_polarity_flip_physical{233}=0x66 815 | serdes_core_tx_polarity_flip_physical{241}=0xe1 816 | serdes_core_tx_polarity_flip_physical{249}=0xc6 817 | serdes_core_tx_polarity_flip_physical{257}=0x0 818 | serdes_tx_taps_cd0=pam4:-28:124:-12:4:0:0 819 | serdes_tx_taps_cd1=pam4:-28:124:-12:4:0:0 820 | serdes_tx_taps_cd2=pam4:-28:124:-12:4:0:0 821 | serdes_tx_taps_cd3=pam4:-28:120:-4:4:0:0 822 | serdes_tx_taps_cd4=pam4:-28:120:-4:4:0:0 823 | serdes_tx_taps_cd5=pam4:-28:120:-4:4:0:0 824 | serdes_tx_taps_cd6=pam4:-28:120:-4:4:0:0 825 | serdes_tx_taps_cd7=pam4:-28:120:-4:4:0:0 826 | serdes_tx_taps_cd8=pam4:-28:120:-4:4:0:0 827 | serdes_tx_taps_cd9=pam4:-28:120:-4:4:0:0 828 | serdes_tx_taps_cd10=pam4:-28:124:0:4:0:0 829 | serdes_tx_taps_cd11=pam4:-28:124:0:4:0:0 830 | serdes_tx_taps_cd12=pam4:-28:124:0:4:0:0 831 | serdes_tx_taps_cd13=pam4:-28:124:0:4:0:0 832 | serdes_tx_taps_cd14=pam4:-28:124:0:4:0:0 833 | serdes_tx_taps_cd15=pam4:-28:124:0:4:0:0 834 | serdes_tx_taps_cd16=pam4:-28:124:0:4:0:0 835 | serdes_tx_taps_cd17=pam4:-28:124:0:4:0:0 836 | serdes_tx_taps_cd18=pam4:-28:124:0:4:0:0 837 | serdes_tx_taps_cd19=pam4:-28:124:0:4:0:0 838 | serdes_tx_taps_cd20=pam4:-28:124:0:4:0:0 839 | serdes_tx_taps_cd21=pam4:-28:124:0:4:0:0 840 | serdes_tx_taps_cd22=pam4:-28:120:-4:4:0:0 841 | serdes_tx_taps_cd23=pam4:-28:120:-4:4:0:0 842 | serdes_tx_taps_cd24=pam4:-28:120:-4:4:0:0 843 | serdes_tx_taps_cd25=pam4:-28:120:-4:4:0:0 844 | serdes_tx_taps_cd26=pam4:-28:120:-4:4:0:0 845 | serdes_tx_taps_cd27=pam4:-28:120:-4:4:0:0 846 | serdes_tx_taps_cd28=pam4:-28:120:-4:4:0:0 847 | serdes_tx_taps_cd29=pam4:-28:124:-12:4:0:0 848 | serdes_tx_taps_cd30=pam4:-28:124:-12:4:0:0 849 | serdes_tx_taps_cd31=pam4:-28:124:-12:4:0:0 850 | serdes_tx_taps_cd32=pam4:1:34:9:0:0:0 851 | serdes_tx_taps_cd33=pam4:1:34:9:0:0:0 852 | -------------------------------------------------------------------------------- /Exercise5/onos-topology/netconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "devices": { 3 | "device:aristaBF": { 4 | "ports": { 5 | "8": { 6 | "enabled": true, 7 | "name": "Ethernet8", 8 | "number": 8, 9 | "removed": false, 10 | "speed": 100000, 11 | "type": "copper" 12 | }, 13 | "24": { 14 | "enabled": true, 15 | "name": "Ethernet24", 16 | "number": 24, 17 | "removed": false, 18 | "speed": 100000, 19 | "type": "copper" 20 | }, 21 | "32": { 22 | "enabled": true, 23 | "name": "Ethernet32", 24 | "number": 32, 25 | "removed": false, 26 | "speed": 100000, 27 | "type": "copper" 28 | }, 29 | "112": { 30 | "enabled": true, 31 | "name": "Ethernet112", 32 | "number": 112, 33 | "removed": false, 34 | "speed": 100000, 35 | "type": "copper" 36 | }, 37 | "120": { 38 | "enabled": true, 39 | "name": "Ethernet120", 40 | "number": 120, 41 | "removed": false, 42 | "speed": 100000, 43 | "type": "copper" 44 | } 45 | }, 46 | "basic": { 47 | "managementAddress": "grpc://10.70.2.7:9559?device_id=183807201", 48 | "manufacturer": "Arista", 49 | "hwVersion":"7170-64c", 50 | "driver": "sonic", 51 | "pipeconf": "org.onosproject.pipelines.sai", 52 | "locType": "grid", 53 | "gridX": 750, 54 | "gridY": 600 55 | }, 56 | "segmentrouting": { 57 | "name": "aristabf", 58 | "ipv4NodeSid": 200, 59 | "ipv4Loopback": "192.168.0.200", 60 | "ipv6NodeSid": 201, 61 | "ipv6Loopback": "2000::c0a8:0200", 62 | "routerMac": "8c:ea:1b:17:64:0c", 63 | "isEdgeRouter": true, 64 | "adjacencySids": [] 65 | } 66 | }, 67 | "device:wedge100bf": { 68 | "ports": { 69 | "0": { 70 | "enabled": true, 71 | "name": "Ethernet0", 72 | "number": 0, 73 | "removed": false, 74 | "speed": 50000, 75 | "type": "copper" 76 | }, 77 | "8": { 78 | "enabled": true, 79 | "name": "Ethernet8", 80 | "number": 8, 81 | "removed": false, 82 | "speed": 50000, 83 | "type": "copper" 84 | }, 85 | "16": { 86 | "enabled": true, 87 | "name": "Ethernet16", 88 | "number": 16, 89 | "removed": false, 90 | "speed": 100000, 91 | "type": "copper" 92 | } 93 | }, 94 | "basic": { 95 | "managementAddress": "grpc://10.70.2.1:9559?device_id=183807201", 96 | "manufacturer": "Edgecore", 97 | "hwVersion":"Wedge100BF-32X", 98 | "driver": "sonic", 99 | "pipeconf": "org.onosproject.pipelines.sai", 100 | "locType": "grid", 101 | "gridX": 600, 102 | "gridY": 400 103 | }, 104 | "segmentrouting": { 105 | "name": "wedge100bf", 106 | "ipv4NodeSid": 100, 107 | "ipv4Loopback": "192.168.0.100", 108 | "ipv6NodeSid": 101, 109 | "ipv6Loopback": "2000::c0a8:0100", 110 | "routerMac": "00:90:fb:64:cc:9e", 111 | "isEdgeRouter": false, 112 | "adjacencySids": [] 113 | } 114 | }, 115 | "device:arista1": { 116 | "ports": { 117 | "0": { 118 | "enabled": true, 119 | "name": "Ethernet0", 120 | "number": 0, 121 | "removed": false, 122 | "speed": 400000, 123 | "type": "copper" 124 | }, 125 | "36": { 126 | "enabled": true, 127 | "name": "Ethernet36", 128 | "number": 36, 129 | "removed": false, 130 | "speed": 100000, 131 | "type": "copper" 132 | }, 133 | "52": { 134 | "enabled": true, 135 | "name": "Ethernet52", 136 | "number": 52, 137 | "removed": false, 138 | "speed": 100000, 139 | "type": "copper" 140 | } 141 | }, 142 | "basic": { 143 | "managementAddress": "grpc://10.70.2.3:9559?device_id=183807201", 144 | "manufacturer": "Arista", 145 | "hwVersion":"7060DX4-C32", 146 | "driver": "sonic", 147 | "pipeconf": "org.onosproject.pipelines.sai", 148 | "locType": "grid", 149 | "gridX": 350, 150 | "gridY": 400 151 | }, 152 | "segmentrouting": { 153 | "name": "arista1", 154 | "ipv4NodeSid": 110, 155 | "ipv4Loopback": "192.168.0.110", 156 | "ipv6NodeSid": 111, 157 | "ipv6Loopback": "2000::c0a8:0110", 158 | "routerMac": "fc:bd:67:2b:4b:08", 159 | "isEdgeRouter": false, 160 | "adjacencySids": [] 161 | } 162 | }, 163 | "device:arista2": { 164 | "ports": { 165 | "0": { 166 | "enabled": true, 167 | "name": "Ethernet0", 168 | "number": 0, 169 | "removed": false, 170 | "speed": 400000, 171 | "type": "copper" 172 | }, 173 | "16": { 174 | "enabled": true, 175 | "name": "Ethernet16", 176 | "number": 16, 177 | "removed": false, 178 | "speed": 50000, 179 | "type": "copper" 180 | }, 181 | "20": { 182 | "enabled": true, 183 | "name": "Ethernet20", 184 | "number": 20, 185 | "removed": false, 186 | "speed": 50000, 187 | "type": "copper" 188 | }, 189 | "240": { 190 | "enabled": true, 191 | "name": "Ethernet240", 192 | "number": 240, 193 | "removed": false, 194 | "speed": 100000, 195 | "type": "copper" 196 | }, 197 | "244": { 198 | "enabled": true, 199 | "name": "Ethernet244", 200 | "number": 244, 201 | "removed": false, 202 | "speed": 100000, 203 | "type": "copper" 204 | } 205 | }, 206 | "basic": { 207 | "managementAddress": "grpc://10.70.2.4:9559?device_id=183807201", 208 | "manufacturer": "Arista", 209 | "hwVersion":"7060DX4-C32", 210 | "driver": "sonic", 211 | "pipeconf": "org.onosproject.pipelines.sai", 212 | "locType": "grid", 213 | "gridX": 200, 214 | "gridY": 600 215 | }, 216 | "segmentrouting": { 217 | "name": "arista2", 218 | "ipv4NodeSid": 210, 219 | "ipv4Loopback": "192.168.0.210", 220 | "ipv6NodeSid": 211, 221 | "ipv6Loopback": "2000::c0a8:0210", 222 | "routerMac": "fc:bd:67:2b:c8:f8", 223 | "isEdgeRouter": true, 224 | "adjacencySids": [] 225 | } 226 | } 227 | }, 228 | "ports": { 229 | "device:aristaBF/112": { 230 | "interfaces": [ 231 | { 232 | "name": "server-ensf1", 233 | "ips": [ 234 | "172.16.101.254/24" 235 | ], 236 | "vlan-untagged": 10 237 | } 238 | ] 239 | }, 240 | "device:aristaBF/120": { 241 | "interfaces": [ 242 | { 243 | "name": "server-ensf0", 244 | "ips": [ 245 | "172.16.102.254/24" 246 | ], 247 | "vlan-untagged": 20 248 | } 249 | ] 250 | }, 251 | "device:arista2/240": { 252 | "interfaces": [ 253 | { 254 | "name": "server-enp152s0f1", 255 | "ips": [ 256 | "172.16.111.254/24" 257 | ], 258 | "vlan-untagged": 30 259 | } 260 | ] 261 | }, 262 | "device:arista2/244": { 263 | "interfaces": [ 264 | { 265 | "name": "server-enp152s0f0", 266 | "ips": [ 267 | "172.16.112.254/24" 268 | ], 269 | "vlan-untagged": 40 270 | } 271 | ] 272 | } 273 | }, 274 | "hosts": { 275 | "3C:EC:EF:77:5B:A6/None": { 276 | "basic": { 277 | "name": "host1", 278 | "locType": "grid", 279 | "gridX": 120, 280 | "gridY": 700 281 | } 282 | }, 283 | "3C:EC:EF:77:5B:A7/None": { 284 | "basic": { 285 | "name": "host2", 286 | "locType": "grid", 287 | "gridX": 280, 288 | "gridY": 700 289 | } 290 | }, 291 | "3C:EC:EF:77:5B:06/None": { 292 | "basic": { 293 | "name": "host3", 294 | "locType": "grid", 295 | "gridX": 670, 296 | "gridY": 700 297 | } 298 | }, 299 | "3C:EC:EF:77:5B:07/None": { 300 | "basic": { 301 | "name": "host4", 302 | "locType": "grid", 303 | "gridX": 830, 304 | "gridY": 700 305 | } 306 | } 307 | 308 | } 309 | } 310 | -------------------------------------------------------------------------------- /Exercise5/spine-accton-BF/config_db.json: -------------------------------------------------------------------------------- 1 | { 2 | "BGP_NEIGHBOR": {}, 3 | "DEVICE_METADATA": { 4 | "localhost": { 5 | "bgp_asn": "65100", 6 | "hostname": "sonic", 7 | "hwsku": "montara", 8 | "mac": "00:90:fb:64:cc:9e", 9 | "platform": "x86_64-accton_wedge100bf_32x-r0", 10 | "type": "LeafRouter" 11 | } 12 | }, 13 | "DEVICE_NEIGHBOR": {}, 14 | "INTERFACE": { 15 | }, 16 | "LOOPBACK_INTERFACE": { 17 | "Loopback0|10.1.0.1/32": {} 18 | }, 19 | "PORT": { 20 | "Ethernet0": { 21 | "admin_status": "up", 22 | "alias": "Ethernet0", 23 | "id" : "0", 24 | "autoneg": "0", 25 | "index": "1", 26 | "lanes": "0,1", 27 | "mtu": "9100", 28 | "speed": "50000" 29 | }, 30 | "Ethernet4": { 31 | "admin_status": "up", 32 | "alias": "Ethernet4", 33 | "id" : "4", 34 | "autoneg": "0", 35 | "index": "2", 36 | "lanes": "4,5,6,7", 37 | "mtu": "9100", 38 | "speed": "100000" 39 | }, 40 | "Ethernet8": { 41 | "admin_status": "up", 42 | "alias": "Ethernet8", 43 | "id" : "8", 44 | "autoneg": "0", 45 | "index": "3", 46 | "lanes": "8,9", 47 | "mtu": "9100", 48 | "speed": "50000" 49 | }, 50 | "Ethernet12": { 51 | "admin_status": "up", 52 | "alias": "Ethernet12", 53 | "id" : "12", 54 | "autoneg": "0", 55 | "index": "4", 56 | "lanes": "12,13,14,15", 57 | "mtu": "9100", 58 | "speed": "100000" 59 | }, 60 | "Ethernet16": { 61 | "admin_status": "up", 62 | "alias": "Ethernet16", 63 | "id" : "16", 64 | "autoneg": "0", 65 | "index": "5", 66 | "lanes": "16,17,18,19", 67 | "mtu": "9100", 68 | "speed": "100000" 69 | }, 70 | "Ethernet20": { 71 | "admin_status": "up", 72 | "alias": "Ethernet20", 73 | "id" : "20", 74 | "autoneg": "0", 75 | "index": "6", 76 | "lanes": "20,21,22,23", 77 | "mtu": "9100", 78 | "speed": "100000" 79 | }, 80 | "Ethernet24": { 81 | "admin_status": "up", 82 | "alias": "Ethernet24", 83 | "id" : "24", 84 | "autoneg": "0", 85 | "index": "7", 86 | "lanes": "24,25,26,27", 87 | "mtu": "9100", 88 | "speed": "100000" 89 | }, 90 | "Ethernet28": { 91 | "admin_status": "up", 92 | "alias": "Ethernet28", 93 | "id" : "28", 94 | "autoneg": "0", 95 | "index": "8", 96 | "lanes": "28,29,30,31", 97 | "mtu": "9100", 98 | "speed": "100000" 99 | }, 100 | "Ethernet32": { 101 | "admin_status": "up", 102 | "alias": "Ethernet32", 103 | "id" : "32", 104 | "autoneg": "0", 105 | "index": "9", 106 | "lanes": "32,33,34,35", 107 | "mtu": "9100", 108 | "speed": "100000" 109 | }, 110 | "Ethernet36": { 111 | "admin_status": "up", 112 | "alias": "Ethernet36", 113 | "id" : "36", 114 | "autoneg": "0", 115 | "index": "10", 116 | "lanes": "36,37,38,39", 117 | "mtu": "9100", 118 | "speed": "100000" 119 | }, 120 | "Ethernet40": { 121 | "admin_status": "up", 122 | "alias": "Ethernet40", 123 | "id" : "40", 124 | "autoneg": "0", 125 | "index": "11", 126 | "lanes": "40,41,42,43", 127 | "mtu": "9100", 128 | "speed": "100000" 129 | }, 130 | "Ethernet44": { 131 | "admin_status": "up", 132 | "alias": "Ethernet44", 133 | "id" : "44", 134 | "autoneg": "0", 135 | "index": "12", 136 | "lanes": "44,45,46,47", 137 | "mtu": "9100", 138 | "speed": "100000" 139 | }, 140 | "Ethernet48": { 141 | "admin_status": "up", 142 | "alias": "Ethernet48", 143 | "id" : "48", 144 | "autoneg": "0", 145 | "index": "13", 146 | "lanes": "48,49,50,51", 147 | "mtu": "9100", 148 | "speed": "100000" 149 | }, 150 | "Ethernet52": { 151 | "admin_status": "up", 152 | "alias": "Ethernet52", 153 | "id" : "54", 154 | "autoneg": "0", 155 | "index": "14", 156 | "lanes": "52,53,54,55", 157 | "mtu": "9100", 158 | "speed": "100000" 159 | }, 160 | "Ethernet56": { 161 | "admin_status": "up", 162 | "alias": "Ethernet56", 163 | "id" : "56", 164 | "autoneg": "0", 165 | "index": "15", 166 | "lanes": "56,57,58,59", 167 | "mtu": "9100", 168 | "speed": "100000" 169 | }, 170 | "Ethernet60": { 171 | "admin_status": "up", 172 | "alias": "Ethernet60", 173 | "id" : "60", 174 | "autoneg": "0", 175 | "index": "16", 176 | "lanes": "60,61,62,63", 177 | "mtu": "9100", 178 | "speed": "100000" 179 | }, 180 | "Ethernet64": { 181 | "admin_status": "up", 182 | "alias": "Ethernet64", 183 | "id" : "64", 184 | "autoneg": "0", 185 | "index": "17", 186 | "lanes": "64,65,66,67", 187 | "mtu": "9100", 188 | "speed": "100000" 189 | }, 190 | "Ethernet68": { 191 | "admin_status": "up", 192 | "alias": "Ethernet68", 193 | "id" : "68", 194 | "autoneg": "0", 195 | "index": "18", 196 | "lanes": "68,69,70,71", 197 | "mtu": "9100", 198 | "speed": "100000" 199 | }, 200 | "Ethernet72": { 201 | "admin_status": "up", 202 | "alias": "Ethernet72", 203 | "id" : "72", 204 | "autoneg": "0", 205 | "index": "19", 206 | "lanes": "72,73,74,75", 207 | "mtu": "9100", 208 | "speed": "100000" 209 | }, 210 | "Ethernet76": { 211 | "admin_status": "up", 212 | "alias": "Ethernet76", 213 | "id" : "76", 214 | "autoneg": "0", 215 | "index": "20", 216 | "lanes": "76,77,78,79", 217 | "mtu": "9100", 218 | "speed": "100000" 219 | }, 220 | "Ethernet80": { 221 | "admin_status": "up", 222 | "alias": "Ethernet80", 223 | "id" : "80", 224 | "autoneg": "0", 225 | "index": "21", 226 | "lanes": "80,81,82,83", 227 | "mtu": "9100", 228 | "speed": "100000" 229 | }, 230 | "Ethernet84": { 231 | "admin_status": "up", 232 | "alias": "Ethernet84", 233 | "id" : "84", 234 | "autoneg": "0", 235 | "index": "22", 236 | "lanes": "84,85,86,87", 237 | "mtu": "9100", 238 | "speed": "100000" 239 | }, 240 | "Ethernet88": { 241 | "admin_status": "up", 242 | "alias": "Ethernet88", 243 | "id" : "88", 244 | "autoneg": "0", 245 | "index": "23", 246 | "lanes": "88,89,90,91", 247 | "mtu": "9100", 248 | "speed": "100000" 249 | }, 250 | "Ethernet92": { 251 | "admin_status": "up", 252 | "alias": "Ethernet92", 253 | "id" : "92", 254 | "autoneg": "0", 255 | "index": "24", 256 | "lanes": "92,93,94,95", 257 | "mtu": "9100", 258 | "speed": "100000" 259 | }, 260 | "Ethernet96": { 261 | "admin_status": "up", 262 | "alias": "Ethernet96", 263 | "id" : "96", 264 | "autoneg": "0", 265 | "index": "25", 266 | "lanes": "96,97,98,99", 267 | "mtu": "9100", 268 | "speed": "100000" 269 | }, 270 | "Ethernet100": { 271 | "admin_status": "up", 272 | "alias": "Ethernet100", 273 | "id" : "100", 274 | "autoneg": "0", 275 | "index": "26", 276 | "lanes": "100,101,102,103", 277 | "mtu": "9100", 278 | "speed": "100000" 279 | }, 280 | "Ethernet104": { 281 | "admin_status": "up", 282 | "alias": "Ethernet104", 283 | "id" : "104", 284 | "autoneg": "0", 285 | "index": "27", 286 | "lanes": "104,105,106,107", 287 | "mtu": "9100", 288 | "speed": "100000" 289 | }, 290 | "Ethernet108": { 291 | "admin_status": "up", 292 | "alias": "Ethernet108", 293 | "id" : "108", 294 | "autoneg": "0", 295 | "index": "28", 296 | "lanes": "108,109,110,111", 297 | "mtu": "9100", 298 | "speed": "100000" 299 | }, 300 | "Ethernet112": { 301 | "admin_status": "up", 302 | "alias": "Ethernet112", 303 | "id" : "112", 304 | "autoneg": "0", 305 | "index": "29", 306 | "lanes": "112,113,114,115", 307 | "mtu": "9100", 308 | "speed": "100000" 309 | }, 310 | "Ethernet116": { 311 | "admin_status": "up", 312 | "alias": "Ethernet116", 313 | "id" : "116", 314 | "autoneg": "0", 315 | "index": "30", 316 | "lanes": "116,117,118,119", 317 | "mtu": "9100", 318 | "speed": "100000" 319 | }, 320 | "Ethernet120": { 321 | "admin_status": "up", 322 | "alias": "Ethernet120", 323 | "id" : "120", 324 | "autoneg": "0", 325 | "index": "31", 326 | "lanes": "120,121,122,123", 327 | "mtu": "9100", 328 | "speed": "100000" 329 | }, 330 | "Ethernet124": { 331 | "admin_status": "up", 332 | "alias": "Ethernet124", 333 | "id" : "124", 334 | "autoneg": "0", 335 | "index": "32", 336 | "lanes": "124,125,126,127", 337 | "mtu": "9100", 338 | "speed": "100000" 339 | } 340 | } 341 | } 342 | -------------------------------------------------------------------------------- /Exercise5/spine-accton-BF/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | sudo cp config_db.json /etc/sonic/ 4 | -------------------------------------------------------------------------------- /Exercise5/spine-arista-TH3/config_db.json: -------------------------------------------------------------------------------- 1 | { 2 | "DEVICE_METADATA": { 3 | "localhost": { 4 | "hwsku": "Arista-7060DX4-C32", 5 | "platform": "x86_64-arista_7060dx4_32", 6 | "mac": "fc:bd:67:2b:4b:08", 7 | "hostname": "sonic", 8 | "type": "LeafRouter", 9 | "bgp_asn": "65100" 10 | } 11 | }, 12 | "PORT": { 13 | "Ethernet0": { 14 | "lanes": "1,2,3,4,5,6,7,8", 15 | "alias": "Ethernet1/1", 16 | "index": "1", 17 | "id" : "0", 18 | "speed": "400000", 19 | "admin_status": "up", 20 | "mtu": "9100" 21 | }, 22 | "Ethernet8": { 23 | "lanes": "9,10,11,12,13,14,15,16", 24 | "alias": "Ethernet2/1", 25 | "index": "2", 26 | "id" : "8", 27 | "speed": "400000", 28 | "admin_status": "up", 29 | "mtu": "9100" 30 | }, 31 | "Ethernet16": { 32 | "lanes": "17,18,19,20,21,22,23,24", 33 | "alias": "Ethernet3/1", 34 | "index": "3", 35 | "id" : "16", 36 | "speed": "400000", 37 | "admin_status": "up", 38 | "mtu": "9100" 39 | }, 40 | "Ethernet24": { 41 | "lanes": "25,26,27,28,29,30,31,32", 42 | "alias": "Ethernet4/1", 43 | "index": "4", 44 | "id" : "24", 45 | "speed": "400000", 46 | "admin_status": "up", 47 | "mtu": "9100" 48 | }, 49 | "Ethernet32": { 50 | "lanes": "33,34,35,36", 51 | "alias": "Ethernet5/1", 52 | "index": "5", 53 | "id" : "32", 54 | "speed": "100000", 55 | "admin_status": "up", 56 | "mtu": "9100" 57 | }, 58 | "Ethernet36": { 59 | "lanes": "37,38,39,40", 60 | "alias": "Ethernet5/5", 61 | "index": "5", 62 | "id" : "36", 63 | "speed": "100000", 64 | "admin_status": "up", 65 | "mtu": "9100" 66 | }, 67 | "Ethernet40": { 68 | "lanes": "41,42,43,44,45,46,47,48", 69 | "alias": "Ethernet6/1", 70 | "index": "6", 71 | "id" : "40", 72 | "speed": "400000", 73 | "admin_status": "up", 74 | "mtu": "9100" 75 | }, 76 | "Ethernet48": { 77 | "lanes": "49,50,51,52", 78 | "alias": "Ethernet7/1", 79 | "index": "7", 80 | "id" : "48", 81 | "speed": "100000", 82 | "admin_status": "up", 83 | "mtu": "9100" 84 | }, 85 | "Ethernet52": { 86 | "lanes": "53,54,55,56", 87 | "alias": "Ethernet7/5", 88 | "index": "7", 89 | "id" : "52", 90 | "speed": "100000", 91 | "admin_status": "up", 92 | "mtu": "9100" 93 | }, 94 | "Ethernet56": { 95 | "lanes": "57,58,59,60,61,62,63,64", 96 | "alias": "Ethernet8/1", 97 | "index": "8", 98 | "id" : "56", 99 | "speed": "400000", 100 | "admin_status": "up", 101 | "mtu": "9100" 102 | }, 103 | "Ethernet64": { 104 | "lanes": "65,66,67,68,69,70,71,72", 105 | "alias": "Ethernet9/1", 106 | "index": "9", 107 | "id" : "64", 108 | "speed": "400000", 109 | "admin_status": "up", 110 | "mtu": "9100" 111 | }, 112 | "Ethernet72": { 113 | "lanes": "73,74,75,76,77,78,79,80", 114 | "alias": "Ethernet10/1", 115 | "index": "10", 116 | "id" : "72", 117 | "speed": "400000", 118 | "admin_status": "up", 119 | "mtu": "9100" 120 | }, 121 | "Ethernet80": { 122 | "lanes": "81,82,83,84,85,86,87,88", 123 | "alias": "Ethernet11/1", 124 | "index": "11", 125 | "id" : "80", 126 | "speed": "400000", 127 | "admin_status": "up", 128 | "mtu": "9100" 129 | }, 130 | "Ethernet88": { 131 | "lanes": "89,90,91,92,93,94,95,96", 132 | "alias": "Ethernet12/1", 133 | "index": "12", 134 | "id" : "88", 135 | "speed": "400000", 136 | "admin_status": "up", 137 | "mtu": "9100" 138 | }, 139 | "Ethernet96": { 140 | "lanes": "97,98,99,100,101,102,103,104", 141 | "alias": "Ethernet13/1", 142 | "index": "13", 143 | "id" : "96", 144 | "speed": "400000", 145 | "admin_status": "up", 146 | "mtu": "9100" 147 | }, 148 | "Ethernet104": { 149 | "lanes": "105,106,107,108,109,110,111,112", 150 | "alias": "Ethernet14/1", 151 | "index": "14", 152 | "id" : "104", 153 | "speed": "400000", 154 | "admin_status": "up", 155 | "mtu": "9100" 156 | }, 157 | "Ethernet112": { 158 | "lanes": "113,114,115,116,117,118,119,120", 159 | "alias": "Ethernet15/1", 160 | "index": "15", 161 | "id" : "112", 162 | "speed": "400000", 163 | "admin_status": "up", 164 | "mtu": "9100" 165 | }, 166 | "Ethernet120": { 167 | "lanes": "121,122,123,124,125,126,127,128", 168 | "alias": "Ethernet16/1", 169 | "index": "16", 170 | "id" : "120", 171 | "speed": "400000", 172 | "admin_status": "up", 173 | "mtu": "9100" 174 | }, 175 | "Ethernet128": { 176 | "lanes": "129,130,131,132,133,134,135,136", 177 | "alias": "Ethernet17/1", 178 | "index": "17", 179 | "id" : "128", 180 | "speed": "400000", 181 | "admin_status": "up", 182 | "mtu": "9100" 183 | }, 184 | "Ethernet136": { 185 | "lanes": "137,138,139,140,141,142,143,144", 186 | "alias": "Ethernet18/1", 187 | "index": "18", 188 | "id" : "136", 189 | "speed": "400000", 190 | "admin_status": "up", 191 | "mtu": "9100" 192 | }, 193 | "Ethernet144": { 194 | "lanes": "145,146,147,148,149,150,151,152", 195 | "alias": "Ethernet19/1", 196 | "index": "19", 197 | "id" : "144", 198 | "speed": "400000", 199 | "admin_status": "up", 200 | "mtu": "9100" 201 | }, 202 | "Ethernet152": { 203 | "lanes": "153,154,155,156,157,158,159,160", 204 | "alias": "Ethernet20/1", 205 | "index": "20", 206 | "id" : "152", 207 | "speed": "400000", 208 | "admin_status": "up", 209 | "mtu": "9100" 210 | }, 211 | "Ethernet160": { 212 | "lanes": "161,162,163,164,165,166,167,168", 213 | "alias": "Ethernet21/1", 214 | "index": "21", 215 | "id" : "160", 216 | "speed": "400000", 217 | "admin_status": "up", 218 | "mtu": "9100" 219 | }, 220 | "Ethernet168": { 221 | "lanes": "169,170,171,172,173,174,175,176", 222 | "alias": "Ethernet22/1", 223 | "index": "22", 224 | "id" : "168", 225 | "speed": "400000", 226 | "admin_status": "up", 227 | "mtu": "9100" 228 | }, 229 | "Ethernet176": { 230 | "lanes": "177,178,179,180,181,182,183,184", 231 | "alias": "Ethernet23/1", 232 | "index": "23", 233 | "id" : "176", 234 | "speed": "400000", 235 | "admin_status": "up", 236 | "mtu": "9100" 237 | }, 238 | "Ethernet184": { 239 | "lanes": "185,186,187,188,189,190,191,192", 240 | "alias": "Ethernet24/1", 241 | "index": "24", 242 | "id" : "184", 243 | "speed": "400000", 244 | "admin_status": "up", 245 | "mtu": "9100" 246 | }, 247 | "Ethernet192": { 248 | "lanes": "193,194,195,196,197,198,199,200", 249 | "alias": "Ethernet25/1", 250 | "index": "25", 251 | "id" : "192", 252 | "speed": "400000", 253 | "admin_status": "up", 254 | "mtu": "9100" 255 | }, 256 | "Ethernet200": { 257 | "lanes": "201,202,203,204,205,206,207,208", 258 | "alias": "Ethernet26/1", 259 | "index": "26", 260 | "id" : "200", 261 | "speed": "400000", 262 | "admin_status": "up", 263 | "mtu": "9100" 264 | }, 265 | "Ethernet208": { 266 | "lanes": "209,210,211,212,213,214,215,216", 267 | "alias": "Ethernet27/1", 268 | "index": "27", 269 | "id" : "208", 270 | "speed": "400000", 271 | "admin_status": "up", 272 | "mtu": "9100" 273 | }, 274 | "Ethernet216": { 275 | "lanes": "217,218,219,220,221,222,223,224", 276 | "alias": "Ethernet28/1", 277 | "index": "28", 278 | "id" : "216", 279 | "speed": "400000", 280 | "admin_status": "up", 281 | "mtu": "9100" 282 | }, 283 | "Ethernet224": { 284 | "lanes": "225,226,227,228", 285 | "alias": "Ethernet29/1", 286 | "index": "29", 287 | "id" : "224", 288 | "speed": "100000", 289 | "admin_status": "up", 290 | "mtu": "9100" 291 | }, 292 | "Ethernet228": { 293 | "lanes": "229,230,231,232", 294 | "alias": "Ethernet29/5", 295 | "index": "29", 296 | "id" : "228", 297 | "speed": "100000", 298 | "admin_status": "up", 299 | "mtu": "9100" 300 | }, 301 | "Ethernet232": { 302 | "lanes": "233,234,235,236,237,238,239,240", 303 | "alias": "Ethernet30/1", 304 | "index": "30", 305 | "id" : "232", 306 | "speed": "400000", 307 | "admin_status": "up", 308 | "mtu": "9100" 309 | }, 310 | "Ethernet240": { 311 | "lanes": "241,242,243,244", 312 | "alias": "Ethernet31/1", 313 | "index": "31", 314 | "id" : "240", 315 | "speed": "100000", 316 | "admin_status": "up", 317 | "mtu": "9100" 318 | }, 319 | "Ethernet244": { 320 | "lanes": "245,246,247,248", 321 | "alias": "Ethernet31/5", 322 | "index": "31", 323 | "id" : "244", 324 | "speed": "100000", 325 | "admin_status": "up", 326 | "mtu": "9100" 327 | }, 328 | "Ethernet248": { 329 | "lanes": "249,250,251,252,253,254,255,256", 330 | "alias": "Ethernet32/1", 331 | "index": "34", 332 | "id" : "248", 333 | "speed": "400000", 334 | "admin_status": "up", 335 | "mtu": "9100" 336 | }, 337 | "Ethernet256": { 338 | "lanes": "258", 339 | "alias": "Ethernet33", 340 | "index": "35", 341 | "id" : "256", 342 | "speed": "10000", 343 | "admin_status": "up", 344 | "mtu": "9100" 345 | }, 346 | "Ethernet260": { 347 | "lanes": "257", 348 | "alias": "Ethernet34", 349 | "index": "36", 350 | "id" : "260", 351 | "speed": "10000", 352 | "admin_status": "up", 353 | "mtu": "9100" 354 | } 355 | }, 356 | "LOOPBACK_INTERFACE": { 357 | "Loopback0|10.1.0.1/32": {} 358 | }, 359 | "BGP_NEIGHBOR": {}, 360 | "DEVICE_NEIGHBOR": {}, 361 | "INTERFACE": {}, 362 | "KDUMP": { 363 | "config": { 364 | "enabled": "false", 365 | "num_dumps": "3", 366 | "memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M" 367 | } 368 | } 369 | } 370 | -------------------------------------------------------------------------------- /Exercise5/spine-arista-TH3/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | sudo cp config_db.json /etc/sonic/ 4 | sudo cp port_config.ini /usr/share/sonic/device/x86_64-arista_7060dx4_32/Arista-7060DX4-C32 5 | sudo cp th3-a7060dx4-c32-32x400G.config.bcm /usr/share/sonic/device/x86_64-arista_7060dx4_32/Arista-7060DX4-C32 6 | -------------------------------------------------------------------------------- /Exercise5/spine-arista-TH3/port_config.ini: -------------------------------------------------------------------------------- 1 | # name lanes alias index speed 2 | Ethernet0 1,2,3,4,5,6,7,8 Ethernet1/1 1 400000 3 | Ethernet8 9,10,11,12,13,14,15,16 Ethernet2/1 2 400000 4 | Ethernet16 17,18,19,20,21,22,23,24 Ethernet3/1 3 400000 5 | Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 4 400000 6 | Ethernet32 33,34,35,36 Ethernet5/1 5 100000 7 | Ethernet36 37,38,39,40 Ethernet5/5 5 100000 8 | Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 6 400000 9 | Ethernet48 49,50,51,52 Ethernet7/1 7 100000 10 | Ethernet52 53,54,55,56 Ethernet7/5 7 100000 11 | Ethernet56 57,58,59,60,61,62,63,64 Ethernet8/1 8 400000 12 | Ethernet64 65,66,67,68,69,70,71,72 Ethernet9/1 9 400000 13 | Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 10 400000 14 | Ethernet80 81,82,83,84,85,86,87,88 Ethernet11/1 11 400000 15 | Ethernet88 89,90,91,92,93,94,95,96 Ethernet12/1 12 400000 16 | Ethernet96 97,98,99,100,101,102,103,104 Ethernet13/1 13 400000 17 | Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 14 400000 18 | Ethernet112 113,114,115,116,117,118,119,120 Ethernet15/1 15 400000 19 | Ethernet120 121,122,123,124,125,126,127,128 Ethernet16/1 16 400000 20 | Ethernet128 129,130,131,132,133,134,135,136 Ethernet17/1 17 400000 21 | Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 18 400000 22 | Ethernet144 145,146,147,148,149,150,151,152 Ethernet19/1 19 400000 23 | Ethernet152 153,154,155,156,157,158,159,160 Ethernet20/1 20 400000 24 | Ethernet160 161,162,163,164,165,166,167,168 Ethernet21/1 21 400000 25 | Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 22 400000 26 | Ethernet176 177,178,179,180,181,182,183,184 Ethernet23/1 23 400000 27 | Ethernet184 185,186,187,188,189,190,191,192 Ethernet24/1 24 400000 28 | Ethernet192 193,194,195,196,197,198,199,200 Ethernet25/1 25 400000 29 | Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 26 400000 30 | Ethernet208 209,210,211,212,213,214,215,216 Ethernet27/1 27 400000 31 | Ethernet216 217,218,219,220,221,222,223,224 Ethernet28/1 28 400000 32 | Ethernet224 225,226,227,228 Ethernet29/1 29 100000 33 | Ethernet228 229,230,231,232 Ethernet29/5 29 100000 34 | Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 30 400000 35 | Ethernet240 241,242,243,244 Ethernet31/1 31 100000 36 | Ethernet244 245,246,247,248 Ethernet31/5 31 100000 37 | Ethernet248 249,250,251,252,253,254,255,256 Ethernet32/1 32 400000 38 | Ethernet256 258 Ethernet33 33 10000 39 | Ethernet260 257 Ethernet34 34 10000 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Introduction 8 | 9 | Welcome to the PINS-ONOS tutorial! **P4 Integrated Network Stack** (PINS) is a 10 | project that provides components and modifications to SONiC, allowing P4 and 11 | P4Runtime (P4RT) to control the network stack remotely. The Open Compute Project 12 | (OCP) [summit in November 13 | 2021](https://opennetworking.org/events/ocp-global-summit-2021/) launched PINS 14 | ([talk video](https://www.youtube.com/watch?v=QOASuHSn7z8) (34:09), [talk 15 | slides](https://fntech.sfo2.digitaloceanspaces.com/PresentationMediaUploads/31/1993/OCP-PINS-2021-1c98a1591d51078fc4118646f5bd0e97.pdf), 16 | [complete demonstration video](https://www.youtube.com/watch?v=iZuWdiV9dnc) 17 | (10:49), and [demonstration 18 | slides](https://opennetworking.org/wp-content/uploads/2021/12/PINS-OCP-2021-Demo-Slides.pdf)). 19 | 20 | This tutorial targets students and practitioners who want to run a functional 21 | SDN stack on SONiC. This document describes the required components, 22 | configuration, and commands to observe the interactions between a PINS switch 23 | and the SDN control plane. 24 | 25 | ### Background 26 | 27 | #### Highlights 28 | 29 | The highlights of the PINS/SONiC project are: 30 | 31 | * **Opt-In Path Towards SDN**: incrementally implement new SDN functions in 32 | SONiC 33 | * **Hybrid Control Plane Support**: choose the network control plane and assign 34 | which parts run locally or remotely 35 | * **Familiar Interface**: model the SAI pipeline in P4 to control bridging, 36 | routing, ACLs, tunnels, and more 37 | * **Rapid Innovation**: develop new data plane features in P4 and expose them to 38 | control plane applications 39 | * **Automated Validation**: test and validate packet paths in the forwarding 40 | pipeline with P4Runtime 41 | 42 | #### Why would you want to add SDN functionality to SONiC? 43 | 44 | When you add SDN functionality to SONiC, you can enable hitless route sequencing 45 | and inline network functions such as load balancers and firewalls. But more 46 | importantly, you can optimize data center utilization by analyzing In-band 47 | Network Telemetry (INT) and implementing Weighted Cost MultiPath (WCMP, aka 48 | UCMP). 49 | 50 | #### What SDN functionality does PINS add to SONiC? 51 | 52 | SONiC is based on a Switch Abstraction Interface (SAI), a standardized interface 53 | to allow programming and managing switch ASICs in a vendor-independent fashion. 54 | PINS works on all existing SONiC targets using SAI features, including fixed 55 | functions (e.g., routing) and configurable ones (e.g., ACLs). PINS programs the 56 | SAI pipeline in P4, bringing SDN capabilities to SONiC. 57 | 58 | #### What components does PINS add to SONiC? 59 | 60 | SONiC is structured into various containers that communicate via a shared Redis 61 | instance through multiple logical databases. The PINS project adds capabilities 62 | to SONiC as described in the [PINS high-level design 63 | document](https://github.com/pins/SONiC/blob/pins-hld/doc/pins/pins_hld.md). 64 | [P4Runtime 65 | (P4RT)](https://github.com/pins/SONiC/blob/p4rt_hld/doc/pins/p4rt_app_hld.md) 66 | (code: [sonic-net/sonic-pins](https://github.com/sonic-net/sonic-pins)) is a new 67 | application running in its own container that receives P4 programming requests 68 | from an SDN controller and writes intents to new P4 tables. In 69 | [sonic-net/sonic-swss](https://github.com/sonic-net/sonic-swss), 70 | [P4Orch](https://github.com/pins/SONiC/blob/pins-hld/doc/pins/pins_hld.md#p4-orchagent) 71 | and [P4RT 72 | tables](https://github.com/pins/SONiC/blob/pins-hld/doc/pins/pins_hld.md#p4-appl-db-tables) 73 | were added to process database entries, create SAI objects, and add them to the 74 | ASIC database. PINS also introduces modifications to 75 | [sonic-net/sonic-swss-common](https://github.com/sonic-net/sonic-swss-common) and 76 | [sonic-net/sonic-buildimage](https://github.com/sonic-net/sonic-buildimage). 77 | 78 | ### Tutorial Outline 79 | 80 | The tutorial and hands-on exercises familiarize users with PINS 81 | ([webpage](https://opennetworking.org/pins/), [Working Group Github 82 | repositories](https://github.com/pins), 83 | [wiki](https://wiki.opennetworking.org/display/COM/PINS)). Activities assume a 84 | basic knowledge of SONiC ([webpage](https://sonic-net.github.io/SONiC/), [Github 85 | repository](https://github.com/sonic-net/SONiC/), 86 | [wiki](https://github.com/sonic-net/SONiC/wiki)) and SDN, including the [P4 87 | language](https://p4.org) and ONOS ([webpage](https://opennetworking.org/onos/), 88 | [wiki](https://wiki.onosproject.org/display/ONOS/ONOS)). We provide participants 89 | with configuration files and scripts. 90 | 91 | The exercises provide step-by-step instructions and validation as follows: 92 | 93 | 1. [Exercise 1 - Deploy SONiC/PINS Target Image](./Exercise1): deploy target 94 | images on your switches 95 | 2. [Exercise 2 - Configure Tutorial Network](./Exercise2): configure host and 96 | switch interfaces 97 | 3. [Exercise 3 - Set Up Pipeline and Routes](./Exercise3): set up connections 98 | using a simple command-line interface for P4Runtime. This exercise uses only 99 | one route between two switches. 100 | 4. [Exercise 4 - Deploy and Configure ONOS](./Exercise4): deploy ONOS on your 101 | server and push the network configuration using flow objectives instead of 102 | the p4rt-client in the previous exercise. This exercise enables ECMP with two 103 | routes between the two switches. 104 | 5. [Exercise 5 - PINS Fabric Demonstration](./Exercise5): This exercise explores 105 | the demonstration environment at the OCP summit. ONF implemented PINS on a 106 | 2x2 leaf-spine fabric and demonstrated WCMP using ONOS and SD-Fabric. 107 | 6. Appendix - References: [Other Examples and Tutorials](References.md) are 108 | provided for particular areas of interest (i.e., P4, P4Runtime, gNMI, 109 | OpenConfig, ONOS, SONiC). 110 | 7. Appendix - Build it Yourself: instructions to [build a SONiC/PINS target 111 | image](BuildTargetImage.md) and [build ONOS with PINS](BuildONOSwithPINS.md). 112 | 113 | ### Software Used in Tutorial 114 | 115 | To complete the exercises in this tutorial, you will use a variety of Linux and 116 | SONiC commands either directly or in the scripts we provide. Because there may 117 | be more than one way to view the same information, you may use alternate 118 | commands. Some of the software you’ll use include `docker`, `redis-cli`, and 119 | `curl`. 120 | 121 | For exercises 1 and 2, you will need to get the SONiC target images with PINS 122 | for your switches (`.swi` and/or `.bin`). If your switches do not have a 123 | previous version of SONiC installed, you will need to use the ONIE or Aboot 124 | installation software on your switch. 125 | 126 | Exercise 3 provides instructions to get `p4rt-client` and `macToIpv6`. Exercise 127 | 4 provides instructions to get an ONOS image with the PINS driver and pipeline 128 | installed. The [PINS tutorials repository](https://github.com/pins/tutorials) 129 | contains sample configuration files for the exercises. 130 | 131 | Download the configuration file examples from GitHub or clone the repository 132 | using one of the following: 133 | 134 | * HTTPS: `git clone https://github.com/pins/tutorials.git` 135 | * SSH: `git clone git@github.com:pins/tutorials.git` 136 | * GitHub CLI: `gh repo clone pins/tutorials` 137 | -------------------------------------------------------------------------------- /References.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | ## Other Tutorials and References 8 | 9 | ### References 10 | 11 | 1. P4Runtime (P4RT): [https://github.com/p4lang/p4runtime](https://github.com/p4lang/p4runtime) 12 | 2. OpenConfig: [https://www.openconfig.net/](https://www.openconfig.net/) 13 | 3. gNMI: [https://github.com/openconfig/gnmi](https://github.com/openconfig/gnmi) 14 | 4. SAI and P4RT: [P4 Programs and P4Info](https://github.com/pins/SONiC/blob/p4rt_hld/doc/pins/p4rt_app_hld.md#p4-programs--p4info) 15 | 5. Pipelines: [Pipelines - DevOps Build](https://dev.azure.com/mssonic/build/_build), 16 | and [SONiC Image Pipelines](https://sonic-build.azurewebsites.net/ui/sonic/pipelines) 17 | 6. Get a P4 compiler from Github, [p4c reference compiler](https://github.com/p4lang/p4c). 18 | 7. To generate a new p4info: [https://github.com/sonic-net/sonic-pins/blob/main/sai_p4/instantiations/google/update_p4program_derived_files.sh](https://github.com/sonic-net/sonic-pins/blob/main/sai_p4/instantiations/google/update_p4program_derived_files.sh) 19 | 20 | ### Other Examples and Tutorials 21 | 22 | 8. Trellis + Stratum example: [https://github.com/stratum/stratum/tree/main/tools/mininet/examples/trellis](https://github.com/stratum/stratum/tree/main/tools/mininet/examples/trellis) 23 | 9. Trellis in a Box environment: [https://github.com/opennetworkinglab/routing/tree/master/trellis](https://github.com/opennetworkinglab/routing/tree/master/trellis) 24 | 10. P4 tutorial: [https://github.com/p4lang/tutorials](https://github.com/p4lang/tutorials) 25 | 11. ONOS tutorials: [https://wiki.onosproject.org/display/ONOS/Tutorials](https://wiki.onosproject.org/display/ONOS/Tutorials) 26 | 12. SONiC Users: [https://github.com/sonic-net/SONiC/wiki/Quick-Start](https://github.com/sonic-net/SONiC/wiki/Quick-Start) 27 | 13. Next-Gen SDN tutorial: [https://github.com/opennetworkinglab/ngsdn-tutorial](https://github.com/opennetworkinglab/ngsdn-tutorial) 28 | 14. Stratum Getting Started tutorial: [https://github.com/stratum/tutorial](https://github.com/stratum/tutorial) 29 | --------------------------------------------------------------------------------