Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 1 | .. |onos_version| replace:: 1.12.2 |
| 2 | |
Zack Williams | 553a363 | 2019-08-09 17:14:43 -0700 | [diff] [blame] | 3 | Installation |
| 4 | ************ |
| 5 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 6 | Topology |
| 7 | ======== |
| 8 | Trellis supports various topology, from a single switch to a full multi-stage leaf-spine fabric. |
Zack Williams | 553a363 | 2019-08-09 17:14:43 -0700 | [diff] [blame] | 9 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 10 | - **Single switch**: This is the minimum Trellis setup. In this setup, all servers are connected to a single switch. |
| 11 | - **Paired switches**: Compared to single switch, it provides more redundancy in terms of server NIC failure and link failure. |
| 12 | - **Single-stage leaf-spine**: Compared to single switch, it offers more redundancy in terms of switch failure and provides better scalability. |
| 13 | - **Single-stage leaf-spine with paired switches**: It supports all the redundancy and scalability features mentioned above. |
| 14 | - **Multi-stage leaf-spine**: Multi-stage is specifically designed for telco service providers. |
| 15 | The first stage can be installed in the central office, while the second stage can be installed in a field office that is closer to the subscribers. |
| 16 | Two stages are typically connected via long distance optical transport. |
Zack Williams | 553a363 | 2019-08-09 17:14:43 -0700 | [diff] [blame] | 17 | |
Zack Williams | 553a363 | 2019-08-09 17:14:43 -0700 | [diff] [blame] | 18 | |
| 19 | Trellis in a Box (TiaB) |
| 20 | ======================= |
Charles Chan | 6025e9a | 2019-09-07 19:25:43 -0700 | [diff] [blame] | 21 | TiaB is a software emulated environment that allows people to run Trellis without hardware switches. |
| 22 | TiaB comes with a few Mininet scripts that emulate network topology from a simple 2x2 leaf-spine to a full multi-stage fabric. |
| 23 | The configurations corresponding to each topology are also packaged together such that you can start the environment right away. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 24 | |
| 25 | TiaB is currently hosted in a GitHub repository separated from ONOS. |
| 26 | The source code and user guide of TiaB can be found `here <https://github.com/opennetworkinglab/routing/tree/master/trellis>`_. |
| 27 | |
Charles Chan | 6025e9a | 2019-09-07 19:25:43 -0700 | [diff] [blame] | 28 | .. tip:: |
| 29 | TiaB is the most convenient and **recommended option for beginners who would like to quickly get some hands on experience** of Trellis. |
| 30 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 31 | |
| 32 | Hardware Requirements |
| 33 | ===================== |
| 34 | Following is a list of hardware that people from the ONF community have tested over time in lab trials. |
| 35 | |
| 36 | Switches |
| 37 | -------- |
| 38 | |
| 39 | 1G/10G models (with 40G uplinks) |
| 40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 41 | - OCP Accepted™ EdgeCore AS5712-54X |
| 42 | - OCP Accepted™ EdgeCore AS5812-54X |
| 43 | - QCT QuantaMesh T3048-LY8 |
| 44 | - Delta AG7648 |
| 45 | - Inventec D6254 (verified by Inventec) |
| 46 | |
| 47 | 25G models (with 100G uplinks) |
| 48 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 49 | - QuantaMesh BMS T7032-IX1/IX1B (with 25G breakout cable) |
| 50 | - Inventec D7054Q28B (verified by Inventec) |
| 51 | |
| 52 | 40G models |
| 53 | ^^^^^^^^^^ |
| 54 | - OCP Accepted™ EdgeCore AS6712-32X |
| 55 | |
| 56 | 100G models |
| 57 | ^^^^^^^^^^^ |
| 58 | - OCP Accepted™ EdgeCore AS7712-32X |
| 59 | - QCT QuantaMesh BMS T7032-IX1/IX1B |
| 60 | - OCP Accepted™ Inventec D7032Q28B (verified by Inventec) |
| 61 | |
| 62 | Commercially supported models |
| 63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 64 | Models listed here are not supported by ONF community. You should contact switch vendor for commercial support. |
| 65 | - OCP Accepted™ EdgeCore AS5912-54X |
| 66 | |
| 67 | |
| 68 | Servers |
| 69 | ------- |
| 70 | ONOS can be run on any x86 servers, with the following notes on memory and CPU allocation: |
| 71 | |
| 72 | - Memory |
| 73 | The memory requirement highly depends on the deployment scale. |
| 74 | In general, we suggest that each ONOS instance should get **at least 16G RAM**. |
| 75 | For production deployment at scale, we will definitely need not only more memory but also some fine tuning on JVM garbage collection mechanism. |
| 76 | - CPU |
| 77 | There are not much requirement on CPU. |
| 78 | In practice, we avoid running other CPU intensive processes/containers/VMs on the same physical machine where ONOS runs. |
| 79 | |
| 80 | |
| 81 | Install Controller - ONOS |
| 82 | ========================= |
| 83 | You could run Trellis with a `single instance of ONOS <https://wiki.onosproject.org/display/ONOS/Local+workflow>`_. But it is recommended to run ONOS as a cluster. |
| 84 | |
| 85 | The idea is to have a "build machine", where you host and build ONOS source code. But to launch it in operation you use other "target machines" (VMs, containers or servers). |
| 86 | Typically we use `STC <https://wiki.onosproject.org/pages/viewpage.action?pageId=12421025>`_ to launch ONOS ins 3 target machines which form a ONOS cluster. |
| 87 | |
| 88 | |
| 89 | Download ONOS |onos_version| |
| 90 | --------------------------------- |
| 91 | Trellis currently is released as part of ONOS and therefore it follows ONOS version number. |
| 92 | This document is written based on ONOS |onos_version|. |
| 93 | |
| 94 | You can find more information about how to setup build environment and fetch ONOS source code from `Development Environment Setup <https://wiki.onosproject.org/display/ONOS/Development+Environment+Setup>`_. |
| 95 | |
| 96 | |
| 97 | Prepare Your Target Machine |
| 98 | --------------------------- |
| 99 | Please refer to `target machines requirements <https://wiki.onosproject.org/display/ONOS/Cells+and+ONOS+test+scripts#CellsandONOStestscripts-Targetmachinesrequirements>`_ for details (you only have to do this once). |
| 100 | |
| 101 | You do not need to follow the directions for the "Mininet Target Machine" if you are using hardware switches. |
| 102 | |
| 103 | |
| 104 | Create a Cell File |
| 105 | -------------------- |
| 106 | We need to compose a cell file in order to give the information about target machines to the build machine. Please refer to `test cells <https://wiki.onosproject.org/display/ONOS/Cells+and+ONOS+test+scripts#CellsandONOStestscripts-TestCells>`_ for details. For example: |
| 107 | |
| 108 | .. code-block:: bash |
| 109 | |
| 110 | export ONOS_CELL=menlo |
| 111 | export OC1=10.128.0.216 |
| 112 | export OC2=10.128.0.217 |
| 113 | export OC3=10.128.0.218 |
| 114 | export ONOS_APPS=drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,hostprobingprovider,t3 |
| 115 | export ONOS_USER=admin |
| 116 | export ONOS_GROUP=admin |
| 117 | export ONOS_USE_SSH=true |
| 118 | export ONOS_WEB_USER=onos |
| 119 | export ONOS_WEB_PASS=rocks |
| 120 | |
| 121 | - ``OC1, OC2, OC3`` are the IP addresses of the 3 target machines where the ONOS cluster will be deployed. |
| 122 | - ``ONOS_APPS`` are the apps you want to automatically deploy at launch. |
| 123 | |
| 124 | - ``drivers`` includes drivers for various devices and pipelines. Always required. |
| 125 | - ``gui`` enables graphic user interface. Highly recommended. |
| 126 | - ``openflow`` is a meta app that loads ``openflow-base``, ``lldpprovider`` and ``hostprovider``. Always required. |
| 127 | - ``segmentrouting`` controls forwarding in the fabric. Always required. |
| 128 | - ``fpm`` (Forwarding Plane Manager) exchanges forwarding information with Quagga. Required if connecting to external router. |
| 129 | - ``dhcprelay`` relays DHCP packets between clients and servers. Required if using DHCP to configure IP addresses for hosts |
| 130 | - ``routeradvertisement`` periodically sends IPv6 router advertisement packets on configured interfaces. Required if using IPv6 |
| 131 | - ``hostprobingprovider`` probes and verifies locations of dual-homed hosts. Required if using dual-homing feature with paired switches |
| 132 | - ``t3`` (Trellis Troubleshooting Tool) is very useful for debugging. Highly recommended. |
| 133 | |
| 134 | - ``ONOS_USER`` is used to login to the target machines, |
| 135 | and the password is not required as you have setup the target machines for password-less access over ssh. |
| 136 | |
| 137 | Once that's done, you can use the ``cell`` command to load the cell file. |
| 138 | |
| 139 | .. code-block:: console |
| 140 | |
| 141 | $ source onos/tools/dev/bash_profile |
| 142 | $ cell menlo |
| 143 | |
| 144 | |
| 145 | Check Your Target Environment |
| 146 | ----------------------------- |
| 147 | Check if your environment is OK with ``stc prerequisites`` (you only have to do this once). |
| 148 | |
| 149 | .. code-block:: console |
| 150 | |
| 151 | $ stc prerequisites |
| 152 | 2017-02-07 12:10:23 Prerequisites started |
| 153 | 2017-02-07 12:10:23 Check-Passwordless-Login-1 started -- ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no admin@10.128.0.216 date |
| 154 | 2017-02-07 12:10:23 Check-ONOS-Bits started -- onos-check-bits |
| 155 | 2017-02-07 12:10:23 Check-Passwordless-Login-3 started -- ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no admin@10.128.0.218 date |
| 156 | 2017-02-07 12:10:23 Check-Passwordless-Login-2 started -- ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no admin@10.128.0.217 date |
| 157 | 2017-02-07 12:10:23 Check-Environment started -- test -n /Users/sauravdas/onos -a -n 10.128.0.* -a -n 10.128.0.216 |
| 158 | 2017-02-07 12:10:23 Check-Environment completed |
| 159 | 2017-02-07 12:10:23 Check-Passwordless-Login-1 completed |
| 160 | 2017-02-07 12:10:23 Check-Passwordless-Login-2 completed |
| 161 | 2017-02-07 12:10:23 Check-Passwordless-Login-3 completed |
| 162 | 2017-02-07 12:10:25 Check-ONOS-Bits completed |
| 163 | 2017-02-07 12:10:25 Prerequisites completed |
| 164 | 0:01 Passed! 6 steps succeeded |
| 165 | |
| 166 | |
| 167 | Launch STC Command |
| 168 | ------------------ |
| 169 | Finally launch with ``stc setup`` once you have built ONOS. Here is what it looks like when I launch |
| 170 | |
| 171 | .. code-block:: console |
| 172 | |
| 173 | $ stc setup |
| 174 | 2016-12-23 12:26:44 Setup started |
| 175 | 2016-12-23 12:26:44 Uninstall-3 started -- onos-uninstall 10.128.0.218 |
| 176 | 2016-12-23 12:26:44 Uninstall-2 started -- onos-uninstall 10.128.0.217 |
| 177 | 2016-12-23 12:26:44 Uninstall-1 started -- onos-uninstall 10.128.0.216 |
| 178 | 2016-12-23 12:26:44 Push-Bits-2 started -- onos-push-bits 10.128.0.217 |
| 179 | 2016-12-23 12:26:44 Push-Bits-3 started -- onos-push-bits 10.128.0.218 |
| 180 | 2016-12-23 12:26:44 Push-Bits-1 started -- onos-push-bits 10.128.0.216 |
| 181 | 2016-12-23 12:26:45 Push-Bits-1 completed |
| 182 | 2016-12-23 12:26:46 Push-Bits-2 completed |
| 183 | 2016-12-23 12:26:46 Push-Bits-3 completed |
| 184 | 2016-12-23 12:26:46 Uninstall-3 completed |
| 185 | 2016-12-23 12:26:46 Kill-3 started -- onos-kill 10.128.0.218 |
| 186 | 2016-12-23 12:26:46 Uninstall-2 completed |
| 187 | 2016-12-23 12:26:46 Kill-2 started -- onos-kill 10.128.0.217 |
| 188 | 2016-12-23 12:26:46 Uninstall-1 completed |
| 189 | 2016-12-23 12:26:46 Kill-1 started -- onos-kill 10.128.0.216 |
| 190 | 2016-12-23 12:26:46 Kill-3 completed |
| 191 | 2016-12-23 12:26:46 Install-3 started -- onos-install 10.128.0.218 |
| 192 | 2016-12-23 12:26:46 Kill-1 completed |
| 193 | 2016-12-23 12:26:46 Install-1 started -- onos-install 10.128.0.216 |
| 194 | 2016-12-23 12:26:46 Kill-2 completed |
| 195 | 2016-12-23 12:26:46 Install-2 started -- onos-install 10.128.0.217 |
| 196 | 2016-12-23 12:26:52 Install-2 completed |
| 197 | 2016-12-23 12:26:52 Secure-SSH-2 started -- onos-secure-ssh -u onos -p rocks 10.128.0.217 |
| 198 | 2016-12-23 12:26:52 Install-1 completed |
| 199 | 2016-12-23 12:26:52 Secure-SSH-1 started -- onos-secure-ssh -u onos -p rocks 10.128.0.216 |
| 200 | 2016-12-23 12:26:52 Install-3 completed |
| 201 | 2016-12-23 12:26:52 Secure-SSH-3 started -- onos-secure-ssh -u onos -p rocks 10.128.0.218 |
| 202 | 2016-12-23 12:27:07 Secure-SSH-1 completed |
| 203 | 2016-12-23 12:27:07 Wait-for-Start-1 started -- onos-wait-for-start 10.128.0.216 |
| 204 | 2016-12-23 12:27:09 Secure-SSH-3 completed |
| 205 | 2016-12-23 12:27:09 Wait-for-Start-3 started -- onos-wait-for-start 10.128.0.218 |
| 206 | 2016-12-23 12:27:13 Secure-SSH-2 completed |
| 207 | 2016-12-23 12:27:13 Wait-for-Start-2 started -- onos-wait-for-start 10.128.0.217 |
| 208 | 2016-12-23 12:27:14 Wait-for-Start-1 completed |
| 209 | 2016-12-23 12:27:14 Check-Components-1 started -- onos-check-components 10.128.0.216 |
| 210 | 2016-12-23 12:27:14 Check-Nodes-1 started -- onos-check-nodes 10.128.0.216 |
| 211 | 2016-12-23 12:27:14 Wait-for-Start-3 completed |
| 212 | 2016-12-23 12:27:14 Check-Nodes-3 started -- onos-check-nodes 10.128.0.218 |
| 213 | 2016-12-23 12:27:14 Check-Components-3 started -- onos-check-components 10.128.0.218 |
| 214 | 2016-12-23 12:27:16 Wait-for-Start-2 completed |
| 215 | 2016-12-23 12:27:16 Check-Nodes-2 started -- onos-check-nodes 10.128.0.217 |
| 216 | 2016-12-23 12:27:16 Check-Components-2 started -- onos-check-components 10.128.0.217 |
| 217 | 2016-12-23 12:27:18 Check-Nodes-1 completed |
| 218 | 2016-12-23 12:27:18 Check-Nodes-3 completed |
| 219 | 2016-12-23 12:27:19 Check-Nodes-2 completed |
| 220 | 2016-12-23 12:27:20 Check-Components-1 completed |
| 221 | 2016-12-23 12:27:20 Check-Apps-1 started -- onos-check-apps 10.128.0.216 drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,t3,hostprobingprovider includes |
| 222 | 2016-12-23 12:27:20 Check-Logs-1 started -- onos-check-logs 10.128.0.216 |
| 223 | 2016-12-23 12:27:20 Check-Components-3 completed |
| 224 | 2016-12-23 12:27:20 Check-Apps-3 started -- onos-check-apps 10.128.0.218 drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,t3,hostprobingprovider includes |
| 225 | 2016-12-23 12:27:20 Check-Logs-3 started -- onos-check-logs 10.128.0.218 |
| 226 | 2016-12-23 12:27:20 Check-Apps-1 completed |
| 227 | 2016-12-23 12:27:20 Check-Apps-3 completed |
| 228 | 2016-12-23 12:27:20 Check-Logs-1 completed |
| 229 | 2016-12-23 12:27:20 Check-Logs-3 completed |
| 230 | 2016-12-23 12:27:21 Check-Components-2 completed |
| 231 | 2016-12-23 12:27:21 Check-Logs-2 started -- onos-check-logs 10.128.0.217 |
| 232 | 2016-12-23 12:27:21 Check-Apps-2 started -- onos-check-apps 10.128.0.217 drivers,gui,openflow,segmentrouting,fpm,dhcprelay,routeradvertisement,t3,hostprobingprovider includes |
| 233 | 2016-12-23 12:27:21 Check-Apps-2 completed |
| 234 | 2016-12-23 12:27:21 Check-Logs-2 completed |
| 235 | 2016-12-23 12:27:21 Setup completed |
| 236 | 0:36 Passed! 31 steps succeeded |
| 237 | |
| 238 | |
| 239 | Useful Utilities |
| 240 | ---------------- |
| 241 | - Push network configuration to one particular instance of ONOS (all instances will automatically get the same configuration) |
| 242 | |
| 243 | .. code-block:: console |
| 244 | |
| 245 | $ onos-netcfg $OC1 network-cfg.json |
| 246 | |
| 247 | - Remotely log in to CLI of one particular ONOS instance |
| 248 | |
| 249 | .. code-block:: console |
| 250 | |
| 251 | $ onos $OC1 |
| 252 | |
| 253 | - Remotely access the log of one particular ONOS instance |
| 254 | |
| 255 | .. code-block:: console |
| 256 | |
| 257 | $ onos-log $OC1 |
| 258 | |
| 259 | |
| 260 | Install Switch OS - ONL |
| 261 | ======================= |
| 262 | The switches listed in the `Hardware Requirements`_ section are shipped with Open Networking Install Environment (ONIE) boot loader. |
| 263 | After booting up, we should see the ONIE prompt from console. |
| 264 | Here we assume that the management port on the switch already has Internet access. (via DHCP) |
| 265 | |
| 266 | |
| 267 | Enter ONIE |
| 268 | ---------- |
| 269 | |
| 270 | |
| 271 | Has no ONL or Has ONL 1.x previously installed |
| 272 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 273 | The way to install ONL 2.x is the same as ONL 1.x. |
| 274 | However, if you have no ONL installed or have older version of ONL, you might find it tricky to (re)install a newer version. |
| 275 | Here's the instruction: |
| 276 | |
| 277 | 1. Plug in the console cable and reboot the switch |
| 278 | 2. (If your boot loader is grub) When you see the boot menu, select **ONIE -> ONIE: Rescue** |
| 279 | 3. (If your boot loader is uboot) When you see **Hit any key to stop autoboot** instead of the boot menu, |
| 280 | press any key and then enter ``run onie_rescue`` to enter ONIE rescue mode. |
| 281 | |
| 282 | Has ONL 2.x previously installed |
| 283 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 284 | It would be much more easier to reboot into ONIE if you have a previously installed ONL 2. Simply run: |
| 285 | |
| 286 | |
| 287 | .. code-block:: console |
| 288 | |
| 289 | # onl-onie-boot-mode rescue |
| 290 | # reboot |
| 291 | |
| 292 | Available ONIE modes are: *install, rescue, uninstall, update, embed, diag, none*. |
| 293 | This can be helpful when you are in a normal ONL and want to upgrade your system. |
| 294 | |
| 295 | |
| 296 | Install ONL |
| 297 | ----------- |
| 298 | At the ONIE prompt, we need to download and install ONL. To fetch and install the latest compatible ONL, run: |
| 299 | |
| 300 | .. code-block:: console |
| 301 | |
| 302 | ONIE:/ # wget https://github.com/opencord/OpenNetworkLinux/releases/download/2017-10-19.2200-1211610/ONL-2.0.0_ONL-OS_2017-10-19.2200-1211610_AMD64_INSTALLED_INSTALLER |
| 303 | ONIE:/ # sh ONL-2.0.0_ONL-OS_2017-10-19.2200-1211610_AMD64_INSTALLED_INSTALLER |
| 304 | |
| 305 | **Checksum**: *sha256:2db316ea83f5dc761b9b11cc8542f153f092f3b49d82ffc0a36a2c41290f5421* |
| 306 | |
| 307 | The switch will automatically reboot into ONL after installation. Default login credential of ONL is: ``root/onl`` |
| 308 | |
| 309 | We might want to configure a fixed IP address for the management interface. |
| 310 | First edit ``/etc/network/interfaces`` and configure ``ma1``, which is the management interface. |
| 311 | |
| 312 | .. code-block:: text |
| 313 | |
| 314 | auto ma1 |
| 315 | iface ma1 inet static |
| 316 | address 10.128.10.128 |
| 317 | netmask 255.255.0.0 |
| 318 | gateway 10.128.0.1 |
| 319 | dns-nameservers 192.168.1.1 8.8.8.8 |
| 320 | |
| 321 | |
| 322 | Install Switch Agent - OF-DPA |
| 323 | ============================= |
| 324 | |
| 325 | |
| 326 | Community vs. Premium Version |
| 327 | ----------------------------- |
| 328 | The OF-DPA image we distribute for free with Trellis is a community version. |
| 329 | This documentation is also written based on the community version. |
| 330 | The community version has most of the features available and therefore it is good for small scale deployments such as lab trials. |
| 331 | However, we highly recommend you to get the premium version from Broadcom if you are aiming for production deployments at scale. |
| 332 | |
| 333 | |
| 334 | Install OF-DPA |
| 335 | -------------- |
| 336 | We need to use different OF-DPA images depending on the switch model you are using. |
| 337 | Please find the installer URL corresponding to each switch model in the `Vendor Specific Information`_ section. |
| 338 | |
| 339 | Copy the image to the switch and start the installation process by running: |
| 340 | |
| 341 | .. code-block:: console |
| 342 | |
| 343 | $ scp ${OFDPA_DEB} ${SWITCH_IP}:/root |
| 344 | $ dpkg -i --force-overwrite /root/${OFDPA_DEB} |
| 345 | |
| 346 | For example, assuming the OF-DPA image is ``ofdpa_3.0.5.5+accton1.7-1_amd64.deb`` and the switch management IP is ``10.128.0.201``, you should run: |
| 347 | |
| 348 | .. code-block:: console |
| 349 | |
| 350 | $ scp ofdpa_3.0.5.5+accton1.7-1_amd64.deb 10.128.0.201:/root |
| 351 | $ dpkg -i --force-overwrite /root/ofdpa_3.0.5.5+accton1.7-1_amd64.deb |
| 352 | |
| 353 | |
| 354 | Connect Switch to Controller |
| 355 | ============================ |
| 356 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 357 | .. caution:: |
| 358 | We are going to describe two different ways to start OF-DPA and OpenFlow agent in this section. |
| 359 | Some vendors use ``ofagentd`` service while others use old ``launcher`` app to start the agent. |
| 360 | Please check the `Vendor Specific Information`_ to understand which method you should use before continuing this section. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 361 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 362 | Use ofagentd service |
| 363 | -------------------- |
| 364 | |
| 365 | Launch with ofagentd |
| 366 | ^^^^^^^^^^^^^^^^^^^^ |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 367 | The OFDPA software and the Indigo agent are now a single process launched by Linux service. First of all, we need to configure **/etc/ofagent/ofagent.conf**. |
| 368 | Uncomment and edit the following line. Make sure all other lines stay commented. |
| 369 | |
| 370 | .. code-block:: bash |
| 371 | |
| 372 | OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>" |
| 373 | |
| 374 | We can choose to run OF-DPA in **debug mode** |
| 375 | |
| 376 | .. code-block:: bash |
| 377 | |
| 378 | OPT_ARGS="-d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>" |
| 379 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 380 | - To **start** the ofagent, run ``service ofagentd start`` |
| 381 | - To **stop** the agent, run ``service ofagentd stop`` |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 382 | - More ``ofagentapp`` options can be found by running ``ofagentapp --help`` |
| 383 | |
| 384 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 385 | Launch in listen mode with ofagentd |
| 386 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 387 | An optional ``-l`` parameter can be added for switch to listen on specific **IP:port**. |
| 388 | This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and control the switch. |
| 389 | |
| 390 | .. code-block:: bash |
| 391 | |
| 392 | OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port>" |
| 393 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 394 | Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to access switches in listen mode. |
| 395 | |
| 396 | Use launcher app |
| 397 | ---------------- |
| 398 | |
| 399 | Launch with launcher |
| 400 | ^^^^^^^^^^^^^^^^^^^^ |
| 401 | - To **start** OF-DPA and OpenFlow agent, run: |
| 402 | |
| 403 | .. code-block:: console |
| 404 | |
| 405 | # ./launcher ofagentapp -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> |
| 406 | |
| 407 | - We can choose to run OF-DPA in **debug mode** |
| 408 | |
| 409 | .. code-block:: console |
| 410 | |
| 411 | # ./launcher ofagentapp -d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> |
| 412 | |
| 413 | - To **stop** OF-DPA and OpenFlow agent, run: |
| 414 | |
| 415 | .. code-block:: consol |
| 416 | |
| 417 | # killall ofagentapp |
| 418 | |
| 419 | Launch in listen mode with launcher |
| 420 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 421 | An optional ``-l`` parameter can be added for switch to listen on specific **IP:port**. |
| 422 | This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and control the switch. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 423 | |
| 424 | .. code-block:: console |
| 425 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 426 | # ./launcher ofagentapp <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port> |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 427 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 428 | Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to access switches in listen mode. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 429 | |
| 430 | |
| 431 | Vendor Specific Information |
| 432 | =========================== |
| 433 | |
| 434 | |
| 435 | Edgecore |
| 436 | -------- |
| 437 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 438 | - **OF-DPA Image** |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 439 | - `EdgeCore 5712-54X / 5812-54X / 6712-32X / 7712-32X <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa_3.0.5.5%2Baccton1.7-1_amd64.deb>`_ - **Checksum**: *sha256:db228b6e79fb15f77497b59689235606b60abc157e72fc3356071bcc8dc4c01f* |
| 440 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 441 | - **Start OF-DPA and OpenFlow agent** |
| 442 | - Please refer to `Use ofagentd service`_ |
| 443 | |
| 444 | - **Configure Port Speed and Breakout** |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 445 | - By default all the switch ports are running at maximum speed. The port speed can be modified in **/etc/accton/ofdpa.conf** |
| 446 | |
| 447 | .. code-block:: text |
| 448 | |
| 449 | port_speed_1=1000 # configure front port 1 to run at 1G |
| 450 | |
| 451 | - We can also configure the same file to use break out cables on certain ports. |
| 452 | |
| 453 | .. code-block:: text |
| 454 | |
| 455 | port_mode_1=4x10g # configure front port 1 to break out from 40G to 4x10G |
| 456 | |
| 457 | OF-DPA service needs to be restarted after modifying this configuration. |
| 458 | |
| 459 | |
| 460 | QCT |
| 461 | --- |
| 462 | |
| 463 | - OF-DPA Image |
| 464 | - `QuantaMesh T3048-LY8 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ag7648_0.3.0.5.6_amd64.deb>`_ - **Checksum**: *sha256:f8201530b1452145c1a0956ea1d3c0402c3568d090553d0d7b3c91a79137da9e* |
| 465 | - `QuantaMesh T7032-IX1 / IX1B <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ix1_0.3.0.5.0-EA5-qct-01.00_amd64.deb>`_ **Checksum**: *sha256:278b8ffed8a8fc705a1b60d16f8e70377e78342a27a11568a1d80b1efd706a46* |
| 466 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 467 | - **Start OF-DPA and OpenFlow agent** |
| 468 | - Please refer to `Use launcher app`_ |
| 469 | |
| 470 | - Configure Port Speed and Breakout |
| 471 | The command ``client_drivshell`` can be used to configure the port speed. |
| 472 | Use the parameter ``ps`` to list all ports or ``ps <port number>`` to list one specific port. |
| 473 | |
| 474 | .. code-block:: console |
| 475 | |
| 476 | # client_drivshell ps 1 |
| 477 | Calling ofdpaBcmCommand rpc with command = "ps 1 ". |
| 478 | ena/ speed/ link auto STP lrn inter max loop |
| 479 | port link duplex scan neg? state pause discrd ops face frame back |
| 480 | xe0( 1) down 10G FD SW No Forward Untag F SFI 9412 |
| 481 | |
| 482 | Returned from ofdpaBcmCommand rpc with rc = 0. |
| 483 | |
| 484 | Then use the parameter ``port <port number> sp=<port speed>`` to change the port speed. |
| 485 | |
| 486 | .. code-block:: console |
| 487 | |
| 488 | # client_drivshell port xe0 sp=1000 |
| 489 | Calling ofdpaBcmCommand rpc with command = "port xe0 sp=1000 ". |
| 490 | |
| 491 | Returned from ofdpaBcmCommand rpc with rc = 0. |
| 492 | |
| 493 | # client_drivshell ps 1 |
| 494 | Calling ofdpaBcmCommand rpc with command = "ps 1 ". |
| 495 | ena/ speed/ link auto STP lrn inter max loop |
| 496 | port link duplex scan neg? state pause discrd ops face frame back |
| 497 | xe0( 1) down 1G FD SW No Forward Untag F GMII 9412 |
| 498 | |
| 499 | Returned from ofdpaBcmCommand rpc with rc = 0. |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 500 | |
| 501 | Delta |
| 502 | ----- |
| 503 | |
| 504 | - OF-DPA Image |
| 505 | - `Delta AG7648 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ly8_0.3.0.5.0-EA5-qct-01.01_amd64.deb>`_ - **Checksum**: *sha256:ddfc13cb98ca47291dce5e6938b1d65f0b99bbe77f0585e36ac0007017397f23* |
| 506 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 507 | - **Start OF-DPA and OpenFlow agent** |
| 508 | - Please refer to `Use launcher app`_ |
| 509 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 510 | - Special instructions to install ONL |
| 511 | Make sure ``/etc/machine.conf`` looks like the following in ONIE before running ONL installation script: |
| 512 | |
| 513 | .. code-block:: text |
| 514 | |
| 515 | onie_platform=x86_64-delta_<platform name>-r0 |
| 516 | onie_machine=delta_<platform name> |
| 517 | |
| 518 | After the installation of ONL, if you don't see '/usr/bin' in your PATH variable, please run the following command: |
| 519 | |
| 520 | .. code-block:: console |
| 521 | |
| 522 | # export PATH=$PATH:/usr/bin |
| 523 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 524 | |
| 525 | Useful Information |
| 526 | ================== |
| 527 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 528 | OF-DPA Commands |
| 529 | --------------- |
| 530 | There are some useful OF-DPA commands under ``/usr/bin/`` |
| 531 | |
| 532 | .. code-block:: text |
| 533 | |
| 534 | client_cfg_purge |
| 535 | client_debugcomp |
| 536 | client_drivshell |
| 537 | client_flowtable_dump |
| 538 | client_meter_dump |
| 539 | client_port_table_dump |
| 540 | client_tunnel_dump |
| 541 | client_classcolortable_dump |
| 542 | client_debuglvl |
| 543 | client_event |
| 544 | client_grouptable_dump |
| 545 | client_oam_dump |
| 546 | client_queue_config |
| 547 | |
| 548 | |
| 549 | ONL Boot Mode |
| 550 | ------------- |
| 551 | OFDPA offers two boot mode: **INSTALLED** and **SWI**. |
| 552 | |
| 553 | - In **INSTALLED** mode, ONL mounts the root filesystem from /dev/sdb7 which is a flash drive that persists everything even during a power cycle. |
| 554 | - In **SWI** mode, ONL will load the root filesystem from a read-only image (\*.swi) and put the modified files in an copy-on-write overlay filesystem. |
| 555 | The change will not be persisted during a power cycle. |
| 556 | The pros and cons are obvious. INSTALLED mode is more convenient while SWI mode is more error-safe. |
| 557 | |
| 558 | The boot mode will be determined by which image we used install ONL. We use the **INSTALLED** mode in this instruction for simplicity. |
| 559 | But we can still change it after the installation. Here's the instruction: |
| 560 | |
| 561 | .. code-block:: console |
| 562 | |
| 563 | # mount /mnt/onl/boot -o remount,rw |
| 564 | # sed -i 's/BOOTMODE=INSTALLED/BOOTMODE=SWI/g' /mnt/onl/boot/boot-config |
| 565 | # reboot |
| 566 | |
| 567 | |
| 568 | Persistence Mechanism |
| 569 | --------------------- |
| 570 | INSTALLED mode already persists everything for you. This section is mainly for SWI mode. |
| 571 | |
| 572 | The mechanism to persist files on the switch is different from ONL 1.x to ONL 2.x. |
| 573 | Following are the steps required to persist a file (e.g. OFDPA package) in ONL 2.x. |
| 574 | |
| 575 | - Files put in **/mnt/onl/data** will be persisted automatically. |
| 576 | - To install a deb package during start-up, put the deb file under **/mnt/onl/data/install-debs** folder and |
| 577 | create a plain text file **/mnt/onl/data/install-debs/list** with all the filename of the deb (e.g. ofdpa_3.0.5.5+accton1.7-1_amd64.deb) |
| 578 | - To execute some command during start-up, put the command in **/mnt/onl/data/rc.boot** |
| 579 | |
| 580 | .. code-block:: bash |
| 581 | |
| 582 | # set static ip and route (dhcp by default) |
| 583 | echo 'ip addr add 10.128.0.203/16 dev ma1' >> /mnt/onl/data/rc.boot |
| 584 | echo 'ip route add default via 10.128.0.1' >> /mnt/onl/data/rc.boot |
| 585 | # grant executable permission |
| 586 | chmod a+x /mnt/onl/data/rc.boot |
| 587 | |
| 588 | See `PersistWorkflow.md <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/PersistWorkflow.md>`_ for more detail. |
| 589 | |
| 590 | |
| 591 | Build a Customized ONL Image |
| 592 | ---------------------------- |
| 593 | Sometimes we need to build our own ONL image from source to include some extra files. (The most common case is a modified /etc/network/interfaces). |
| 594 | The instruction of build process has already been well-documented in ONL repo `Building.md <https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/Building.md>`_. |
| 595 | But you might find it a little bit tricky to inject some extra files. |
| 596 | To do that, you need to put the files under **$ONL_ROOT/builds/any/rootfs/jessie/common/overlay/** and then run the make command again. |
| 597 | |
| 598 | |
| 599 | Recovery from a Faulty ONL Install |
| 600 | ---------------------------------- |
| 601 | If, for some reason, the ONL install process fails, you may be brought to the grub rescue prompt upon reboot. |
| 602 | You may or may not find system files, or even basic grub rescue commands (i.e. 'help'). |
| 603 | There are two options for returning to a (known working) ONIE prompt. |
| 604 | |
| 605 | 1. **Reinstaller** - You should be able to acquire an ISO image for resetting the firmware to factory default from your switch vendor. |
| 606 | Once you have the ISO, you can either use PXE or a live USB to boot the switch into the image. |
| 607 | 2. **Manually boot to ONIE** - If the files are there, you can manually configure GRUB to load the necessary modules to boot back into ONIE. |
| 608 | |
| 609 | .. code-block:: console |
| 610 | |
| 611 | # This should be the partition on the ONIE partition on the AS6712. |
| 612 | # It might be hd1 or hd0. Change appropriately. |
| 613 | grub rescue> ls (hd0,gpt2)/ |
| 614 | ./ ../ lost+found/ onie/ grub/ grubenv |
| 615 | |
| 616 | # These instructions will load the kernel and ONIE initrd. |
| 617 | grub rescue> set prefix=(hd0,gpt2)/grub |
| 618 | grub rescue> set root=(hd0,gpt2) |
| 619 | grub rescue> insmod normal |
| 620 | grub rescue> insmod linux |
| 621 | grub rescue> ls /onie |
| 622 | ./ ../ vmlinuz-3.2.35-onie initrd.img-3.2.35-onie tools/ grub/ grub.d/ config/ |
| 623 | |
| 624 | # if the ",115200n8" is omitted, baud rate defaults to 9600. |
| 625 | grub rescue> linux /onie/vmlinuz-3.2.35-onie console=tty0 console=ttyS1,115200n8 |
| 626 | grub rescue> initrd /onie/initrd.img-3.2.35-onie |
| 627 | |
| 628 | # The system will not boot into ONIE and you can recover or re-install from there. |
| 629 | grub rescue> boot |
| 630 | |
| 631 | Once back at the ONIE prompt, you can try to install ONL by following the same steps again. |
| 632 | |
| 633 | |
Charles Chan | 19833d8 | 2019-09-07 20:49:14 -0700 | [diff] [blame] | 634 | Connect to Switch in Listen Mode |
| 635 | -------------------------------- |
| 636 | To connect to the switch in Listen Mode using **ovs-ofctl**, you can use commands such as |
| 637 | |
| 638 | .. code-block:: console |
| 639 | |
| 640 | $ ovs-ofctl -O OpenFlow13 show tcp:<ip>:<port> |
| 641 | $ ovs-ofctl -O OpenFlow13 dump-flows tcp:<ip>:<port> |
| 642 | $ ovs-ofctl -O OpenFlow13 dump-groups tcp:<ip>:<port> |
| 643 | $ ovs-ofctl -O OpenFlow13 add-flow tcp:<ip>:<port> table=60,priority=40000,eth_type=0x0800,ip_dst=55.55.55.55,actions=controller |
| 644 | |
| 645 | For more command, please see ``ovs-ofctl --help`` or the post `OpenvSwitch ovs-ofctl and OF-DPA <https://blog.pichuang.com.tw/20170106-ovs-ofctl-and-ofdpa/>`_. |
| 646 | |
| 647 | |
Charles Chan | dd26eeb | 2019-08-29 17:59:21 -0700 | [diff] [blame] | 648 | Reference |
| 649 | --------- |
| 650 | - `ONL/OF-DPA installation guide by Edgecore Networks <https://www.youtube.com/watch?v=mCUtkIc_hVI>`_ |
| 651 | - `ONL/OF-DPA cheat sheet by Phil Huang <https://blog.pichuang.com.tw/20170104-ofdpa-with-onl-cheat-sheet/>`_ |