blob: 73177bb0e43b6a110d62f87390b23af363ea39bb [file] [log] [blame]
Charles Chan756db002020-06-27 18:57:06 -07001.. |onos_version| replace:: 2.2.3
Charles Chandd26eeb2019-08-29 17:59:21 -07002
Charles Chan78a737f2019-09-12 13:55:22 -07003Installation Guide
4******************
Zack Williams553a3632019-08-09 17:14:43 -07005
Charles Chan4d5ee192019-09-09 23:08:36 -07006Building a Hardware Pod
7=======================
8See :doc:`Supported Hardware <supported-hardware>` for details.
Charles Chandd26eeb2019-08-29 17:59:21 -07009
10
11Install Controller - ONOS
12=========================
Charles Chandd26eeb2019-08-29 17:59:21 -070013
Zack Williamsd63d35b2020-06-23 14:12:46 -070014You could run Trellis with a `single instance of ONOS
15<https://wiki.onosproject.org/display/ONOS/Local+workflow>`_. But it is
16recommended to run ONOS as a cluster.
17
18The idea is to have a "build machine", where you host and build ONOS source
19code. But to launch it in operation you use other "target machines" (VMs,
20containers or servers).
21
22Typically we use `STC
23<https://wiki.onosproject.org/pages/viewpage.action?pageId=12421025>`_ to
24launch ONOS ins 3 target machines which form a ONOS cluster.
Charles Chandd26eeb2019-08-29 17:59:21 -070025
26
27Download ONOS |onos_version|
Charles Chan756db002020-06-27 18:57:06 -070028----------------------------
Charles Chandd26eeb2019-08-29 17:59:21 -070029
Zack Williamsd63d35b2020-06-23 14:12:46 -070030Trellis currently is released as part of ONOS and therefore it follows ONOS
31version number. This document is written based on ONOS |onos_version|.
32
33You can find more information about how to setup build environment and fetch
34ONOS source code from `Development Environment Setup
35<https://wiki.onosproject.org/display/ONOS/Development+Environment+Setup>`_.
Charles Chandd26eeb2019-08-29 17:59:21 -070036
37
38Prepare Your Target Machine
39---------------------------
Charles Chandd26eeb2019-08-29 17:59:21 -070040
Zack Williamsd63d35b2020-06-23 14:12:46 -070041Please refer to `target machines requirements
42<https://wiki.onosproject.org/x/twAQ>`_ for details (you only have to do this
43once).
44
45You do not need to follow the directions for the "Mininet Target Machine" if
46you are using hardware switches.
Charles Chandd26eeb2019-08-29 17:59:21 -070047
48
49Create a Cell File
50--------------------
Zack Williamsd63d35b2020-06-23 14:12:46 -070051
52We need to compose a cell file in order to give the information about target
53machines to the build machine. Please refer to `test cells
54<https://wiki.onosproject.org/x/twAQ>`_ for details. For example:
Charles Chandd26eeb2019-08-29 17:59:21 -070055
56.. code-block:: bash
57
58 export ONOS_CELL=menlo
59 export OC1=10.128.0.216
60 export OC2=10.128.0.217
61 export OC3=10.128.0.218
Charles Chan756db002020-06-27 18:57:06 -070062 export ONOS_APPS=drivers,gui,hostprovider,lldpprovider,fpm,dhcprelay,routeradvertisement,hostprobingprovider,netcfghostprovider
Charles Chandd26eeb2019-08-29 17:59:21 -070063 export ONOS_USER=admin
64 export ONOS_GROUP=admin
65 export ONOS_USE_SSH=true
66 export ONOS_WEB_USER=onos
67 export ONOS_WEB_PASS=rocks
68
Zack Williamsd63d35b2020-06-23 14:12:46 -070069- ``OC1, OC2, OC3`` are the IP addresses of the 3 target machines where the
70 ONOS cluster will be deployed.
71
Charles Chandd26eeb2019-08-29 17:59:21 -070072- ``ONOS_APPS`` are the apps you want to automatically deploy at launch.
73
Zack Williamsd63d35b2020-06-23 14:12:46 -070074 - ``drivers`` includes drivers for various devices and pipelines. Always
75 required.
Charles Chandd26eeb2019-08-29 17:59:21 -070076
Zack Williamsd63d35b2020-06-23 14:12:46 -070077 - ``gui`` enables graphic user interface. Highly recommended.
78
Charles Chan756db002020-06-27 18:57:06 -070079 - ``hostprovider`` discovers hosts via ARP and NDP
Zack Williamsd63d35b2020-06-23 14:12:46 -070080
Charles Chan756db002020-06-27 18:57:06 -070081 - ``lldpprovider`` discovers links via LLDP
Zack Williamsd63d35b2020-06-23 14:12:46 -070082
83 - ``fpm`` (Forwarding Plane Manager) exchanges forwarding information with
84 Quagga. Required if connecting to external router.
85
86 - ``dhcprelay`` relays DHCP packets between clients and servers. Required
87 if using DHCP to configure IP addresses for hosts
88
89 - ``routeradvertisement`` periodically sends IPv6 router advertisement
90 packets on configured interfaces. Required if using IPv6
91
92 - ``hostprobingprovider`` probes and verifies locations of dual-homed
93 hosts. Required if using dual-homing feature with paired switches
94
Charles Chan756db002020-06-27 18:57:06 -070095 - ``netcfghostprovider`` reads hosts information from network config and add them to the host service.
96 Required if we want to statically configure some hosts.
Zack Williamsd63d35b2020-06-23 14:12:46 -070097
98- ``ONOS_USER`` is used to login to the target machines, and the password is
99 not required as you have setup the target machines for password-less access
100 over ssh.
Charles Chandd26eeb2019-08-29 17:59:21 -0700101
102Once that's done, you can use the ``cell`` command to load the cell file.
103
104.. code-block:: console
105
106 $ source onos/tools/dev/bash_profile
107 $ cell menlo
108
109
110Check Your Target Environment
111-----------------------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700112
Charles Chandd26eeb2019-08-29 17:59:21 -0700113Check if your environment is OK with ``stc prerequisites`` (you only have to do this once).
114
115.. code-block:: console
116
117 $ stc prerequisites
118 2017-02-07 12:10:23 Prerequisites started
119 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
120 2017-02-07 12:10:23 Check-ONOS-Bits started -- onos-check-bits
121 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
122 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
123 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
124 2017-02-07 12:10:23 Check-Environment completed
125 2017-02-07 12:10:23 Check-Passwordless-Login-1 completed
126 2017-02-07 12:10:23 Check-Passwordless-Login-2 completed
127 2017-02-07 12:10:23 Check-Passwordless-Login-3 completed
128 2017-02-07 12:10:25 Check-ONOS-Bits completed
129 2017-02-07 12:10:25 Prerequisites completed
130 0:01 Passed! 6 steps succeeded
131
132
133Launch STC Command
134------------------
135Finally launch with ``stc setup`` once you have built ONOS. Here is what it looks like when I launch
136
137.. code-block:: console
138
139 $ stc setup
140 2016-12-23 12:26:44 Setup started
141 2016-12-23 12:26:44 Uninstall-3 started -- onos-uninstall 10.128.0.218
142 2016-12-23 12:26:44 Uninstall-2 started -- onos-uninstall 10.128.0.217
143 2016-12-23 12:26:44 Uninstall-1 started -- onos-uninstall 10.128.0.216
144 2016-12-23 12:26:44 Push-Bits-2 started -- onos-push-bits 10.128.0.217
145 2016-12-23 12:26:44 Push-Bits-3 started -- onos-push-bits 10.128.0.218
146 2016-12-23 12:26:44 Push-Bits-1 started -- onos-push-bits 10.128.0.216
147 2016-12-23 12:26:45 Push-Bits-1 completed
148 2016-12-23 12:26:46 Push-Bits-2 completed
149 2016-12-23 12:26:46 Push-Bits-3 completed
150 2016-12-23 12:26:46 Uninstall-3 completed
151 2016-12-23 12:26:46 Kill-3 started -- onos-kill 10.128.0.218
152 2016-12-23 12:26:46 Uninstall-2 completed
153 2016-12-23 12:26:46 Kill-2 started -- onos-kill 10.128.0.217
154 2016-12-23 12:26:46 Uninstall-1 completed
155 2016-12-23 12:26:46 Kill-1 started -- onos-kill 10.128.0.216
156 2016-12-23 12:26:46 Kill-3 completed
157 2016-12-23 12:26:46 Install-3 started -- onos-install 10.128.0.218
158 2016-12-23 12:26:46 Kill-1 completed
159 2016-12-23 12:26:46 Install-1 started -- onos-install 10.128.0.216
160 2016-12-23 12:26:46 Kill-2 completed
161 2016-12-23 12:26:46 Install-2 started -- onos-install 10.128.0.217
162 2016-12-23 12:26:52 Install-2 completed
163 2016-12-23 12:26:52 Secure-SSH-2 started -- onos-secure-ssh -u onos -p rocks 10.128.0.217
164 2016-12-23 12:26:52 Install-1 completed
165 2016-12-23 12:26:52 Secure-SSH-1 started -- onos-secure-ssh -u onos -p rocks 10.128.0.216
166 2016-12-23 12:26:52 Install-3 completed
167 2016-12-23 12:26:52 Secure-SSH-3 started -- onos-secure-ssh -u onos -p rocks 10.128.0.218
168 2016-12-23 12:27:07 Secure-SSH-1 completed
169 2016-12-23 12:27:07 Wait-for-Start-1 started -- onos-wait-for-start 10.128.0.216
170 2016-12-23 12:27:09 Secure-SSH-3 completed
171 2016-12-23 12:27:09 Wait-for-Start-3 started -- onos-wait-for-start 10.128.0.218
172 2016-12-23 12:27:13 Secure-SSH-2 completed
173 2016-12-23 12:27:13 Wait-for-Start-2 started -- onos-wait-for-start 10.128.0.217
174 2016-12-23 12:27:14 Wait-for-Start-1 completed
175 2016-12-23 12:27:14 Check-Components-1 started -- onos-check-components 10.128.0.216
176 2016-12-23 12:27:14 Check-Nodes-1 started -- onos-check-nodes 10.128.0.216
177 2016-12-23 12:27:14 Wait-for-Start-3 completed
178 2016-12-23 12:27:14 Check-Nodes-3 started -- onos-check-nodes 10.128.0.218
179 2016-12-23 12:27:14 Check-Components-3 started -- onos-check-components 10.128.0.218
180 2016-12-23 12:27:16 Wait-for-Start-2 completed
181 2016-12-23 12:27:16 Check-Nodes-2 started -- onos-check-nodes 10.128.0.217
182 2016-12-23 12:27:16 Check-Components-2 started -- onos-check-components 10.128.0.217
183 2016-12-23 12:27:18 Check-Nodes-1 completed
184 2016-12-23 12:27:18 Check-Nodes-3 completed
185 2016-12-23 12:27:19 Check-Nodes-2 completed
186 2016-12-23 12:27:20 Check-Components-1 completed
187 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
188 2016-12-23 12:27:20 Check-Logs-1 started -- onos-check-logs 10.128.0.216
189 2016-12-23 12:27:20 Check-Components-3 completed
190 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
191 2016-12-23 12:27:20 Check-Logs-3 started -- onos-check-logs 10.128.0.218
192 2016-12-23 12:27:20 Check-Apps-1 completed
193 2016-12-23 12:27:20 Check-Apps-3 completed
194 2016-12-23 12:27:20 Check-Logs-1 completed
195 2016-12-23 12:27:20 Check-Logs-3 completed
196 2016-12-23 12:27:21 Check-Components-2 completed
197 2016-12-23 12:27:21 Check-Logs-2 started -- onos-check-logs 10.128.0.217
198 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
199 2016-12-23 12:27:21 Check-Apps-2 completed
200 2016-12-23 12:27:21 Check-Logs-2 completed
201 2016-12-23 12:27:21 Setup completed
202 0:36 Passed! 31 steps succeeded
203
204
205Useful Utilities
206----------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700207
208- Push network configuration to one particular instance of ONOS (all instances
209 will automatically get the same configuration)
Charles Chandd26eeb2019-08-29 17:59:21 -0700210
211 .. code-block:: console
212
213 $ onos-netcfg $OC1 network-cfg.json
214
215- Remotely log in to CLI of one particular ONOS instance
216
217 .. code-block:: console
218
219 $ onos $OC1
220
221- Remotely access the log of one particular ONOS instance
222
223 .. code-block:: console
224
225 $ onos-log $OC1
226
227
Charles Chan756db002020-06-27 18:57:06 -0700228Install Trellis apps
229====================
230
231Starting from ONOS 2.5, Trellis apps have been extracted from ONOS repo.
232Therefore, those apps needs to be installed and activated additionally.
233
234trellis-control
235---------------
236
237``segmentrouting`` forwards the traffic in the fabric. **Mandatory**.
238
239For details, check the README at `trellis-control repo
240<https://github.com/opennetworkinglab/trellis-control>`_.
241
242
243trellis-t3
244----------
245
246``t3`` (Trellis Troubleshooting Tool) is very useful for debugging. **Optional** but highly recommended.
247
248For details, check the README at `trellis-t3 repo
249<https://github.com/opennetworkinglab/trellis-t3>`_.
250
251
Zack Williams879046f2020-07-17 17:30:14 -0700252Install switch-specific apps
Charles Chan756db002020-06-27 18:57:06 -0700253============================
254
255There are a few switch-specific apps that need to be installed and activated additionally
256based on the type of switch you are using.
257It is possible to support a hybrid deployment in which you have different switch types.
258In that case, simply enable the apps required by each type of switches.
259
260OF-DPA and OVS
261--------------
262
263.. code-block:: console
264
265 app activate org.onosproject.openflow
266
267
268BMV2 with Stratum
269-----------------
270
271.. code-block:: console
272
273 app activate org.onosproject.drivers.bmv2
274 app activate org.onosproject.pipelines.fabric
275
276Tofino with Stratum
277-------------------
278
279.. code-block:: console
280
281 app activate org.onosproject.drivers.barefoot
282
283In addition, we need to build, install and activate ``fabric-tofino`` app, which is hosted in a separate repo.
284
285For details, check the README at `fabric-tofino repo
286<https://github.com/opencord/fabric-tofino>`_.
287
288
Charles Chandd26eeb2019-08-29 17:59:21 -0700289Install Switch OS - ONL
290=======================
Charles Chandd26eeb2019-08-29 17:59:21 -0700291
Zack Williamsd63d35b2020-06-23 14:12:46 -0700292The switches listed in the :doc:`Supported Hardware <supported-hardware>` are
293shipped with Open Networking Install Environment (ONIE) boot loader.
294
295After booting up, we should see the ONIE prompt from console.
296
297Here we assume that the management port on the switch already has Internet
298access. (via DHCP)
Charles Chandd26eeb2019-08-29 17:59:21 -0700299
300Enter ONIE
301----------
302
303
304Has no ONL or Has ONL 1.x previously installed
305^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williamsd63d35b2020-06-23 14:12:46 -0700306
Charles Chandd26eeb2019-08-29 17:59:21 -0700307The way to install ONL 2.x is the same as ONL 1.x.
Zack Williamsd63d35b2020-06-23 14:12:46 -0700308
309However, if you have no ONL installed or have older version of ONL, you might
310find it tricky to (re)install a newer version.
311
Charles Chandd26eeb2019-08-29 17:59:21 -0700312Here's the instruction:
313
314 1. Plug in the console cable and reboot the switch
Zack Williamsd63d35b2020-06-23 14:12:46 -0700315
316 2. (If your boot loader is grub) When you see the boot menu, select **ONIE
317 -> ONIE: Rescue**
318
319 3. (If your boot loader is uboot) When you see **Hit any key to stop
320 autoboot** instead of the boot menu, press any key and then enter
321 ``run onie_rescue`` to enter ONIE rescue mode.
Charles Chandd26eeb2019-08-29 17:59:21 -0700322
323Has ONL 2.x previously installed
324^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williamsd63d35b2020-06-23 14:12:46 -0700325
326It would be much more easier to reboot into ONIE if you have a previously
327installed ONL 2. Simply run:
Charles Chandd26eeb2019-08-29 17:59:21 -0700328
329
330.. code-block:: console
331
332 # onl-onie-boot-mode rescue
333 # reboot
334
335Available ONIE modes are: *install, rescue, uninstall, update, embed, diag, none*.
336This can be helpful when you are in a normal ONL and want to upgrade your system.
337
338
339Install ONL
340-----------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700341
342At the ONIE prompt, we need to download and install ONL. To be able to
343download ONL the management interface needs to have an IP. ONIE will try to
344obtain IP address from DHCP. In the case where DHCP service is not available,
345please configure it manually:
346
Andrea Campanella2a5d7ce2020-01-21 10:56:50 +0100347.. code-block:: console
348
349 ip addr add <IP>/<Netmask> dev <interface>
350 route add default gw <Gateway>
351 echo "nameserver 8.8.8.8" > /etc/resolv.conf
352
353To fetch and install the latest compatible ONL, run:
Charles Chandd26eeb2019-08-29 17:59:21 -0700354
355.. code-block:: console
356
357 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
358 ONIE:/ # sh ONL-2.0.0_ONL-OS_2017-10-19.2200-1211610_AMD64_INSTALLED_INSTALLER
359
360**Checksum**: *sha256:2db316ea83f5dc761b9b11cc8542f153f092f3b49d82ffc0a36a2c41290f5421*
361
Zack Williamsd63d35b2020-06-23 14:12:46 -0700362The switch will automatically reboot into ONL after installation. Default login
363credential of ONL is: ``root/onl``
Charles Chandd26eeb2019-08-29 17:59:21 -0700364
Zack Williamsd63d35b2020-06-23 14:12:46 -0700365We might want to configure a fixed IP address for the management interface in
366ONL.
367
368First edit ``/etc/network/interfaces`` and configure ``ma1``, which is the
369management interface.
Charles Chandd26eeb2019-08-29 17:59:21 -0700370
371.. code-block:: text
372
373 auto ma1
374 iface ma1 inet static
375 address 10.128.10.128
376 netmask 255.255.0.0
377 gateway 10.128.0.1
378 dns-nameservers 192.168.1.1 8.8.8.8
379
380
381Install Switch Agent - OF-DPA
382=============================
383
Charles Chan64adc382019-09-09 18:15:02 -0700384.. note::
385 **Community vs. Premium Version**
Charles Chandd26eeb2019-08-29 17:59:21 -0700386
Charles Chan64adc382019-09-09 18:15:02 -0700387 The OF-DPA image we distribute for free with Trellis is a community version.
Zack Williamsd63d35b2020-06-23 14:12:46 -0700388
Charles Chan64adc382019-09-09 18:15:02 -0700389 This documentation is also written based on the community version.
Zack Williamsd63d35b2020-06-23 14:12:46 -0700390
391 The **community version** has most of the features available and therefore
392 it is **good for small scale deployments** such as lab trials.
393
394 However, we highly recommend you to get the **premium version** from
395 Broadcom if you are aiming for **production deployments at scale**.
Charles Chandd26eeb2019-08-29 17:59:21 -0700396
397
398Install OF-DPA
399--------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700400
401We need to use different OF-DPA images depending on the switch model you are
402using.
403
404Please find the installer URL corresponding to each switch model in the `Vendor
405Specific Information`_ section.
Charles Chandd26eeb2019-08-29 17:59:21 -0700406
407Copy the image to the switch and start the installation process by running:
408
409.. code-block:: console
410
411 $ scp ${OFDPA_DEB} ${SWITCH_IP}:/root
412 $ dpkg -i --force-overwrite /root/${OFDPA_DEB}
413
Zack Williamsd63d35b2020-06-23 14:12:46 -0700414For example, assuming the OF-DPA image is
415``ofdpa_3.0.5.5+accton1.7-1_amd64.deb`` and the switch management IP is
416``10.128.0.201``, you should run:
Charles Chandd26eeb2019-08-29 17:59:21 -0700417
418.. code-block:: console
419
420 $ scp ofdpa_3.0.5.5+accton1.7-1_amd64.deb 10.128.0.201:/root
421 $ dpkg -i --force-overwrite /root/ofdpa_3.0.5.5+accton1.7-1_amd64.deb
422
423
424Connect Switch to Controller
425============================
426
Charles Chan19833d82019-09-07 20:49:14 -0700427.. caution::
Zack Williamsd63d35b2020-06-23 14:12:46 -0700428 We are going to describe two different ways to start OF-DPA and OpenFlow
429 agent in this section.
430
431 Some vendors use ``ofagentd`` service while others use old ``launcher`` app
432 to start the agent.
433
434 Please check the `Vendor Specific Information`_ to understand which method
435 you should use before continuing this section.
Charles Chandd26eeb2019-08-29 17:59:21 -0700436
Charles Chan19833d82019-09-07 20:49:14 -0700437Use ofagentd service
438--------------------
439
440Launch with ofagentd
441^^^^^^^^^^^^^^^^^^^^
Zack Williamsd63d35b2020-06-23 14:12:46 -0700442The OFDPA software and the Indigo agent are now a single process launched by
443Linux service. First of all, we need to configure
444**/etc/ofagent/ofagent.conf**. Uncomment and edit the following line. Make
445sure all other lines stay commented.
Charles Chandd26eeb2019-08-29 17:59:21 -0700446
447.. code-block:: bash
448
449 OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>"
450
451We can choose to run OF-DPA in **debug mode**
452
453.. code-block:: bash
454
455 OPT_ARGS="-d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>"
456
Charles Chan19833d82019-09-07 20:49:14 -0700457- To **start** the ofagent, run ``service ofagentd start``
Zack Williamsd63d35b2020-06-23 14:12:46 -0700458
Charles Chan19833d82019-09-07 20:49:14 -0700459- To **stop** the agent, run ``service ofagentd stop``
Zack Williamsd63d35b2020-06-23 14:12:46 -0700460
Charles Chandd26eeb2019-08-29 17:59:21 -0700461- More ``ofagentapp`` options can be found by running ``ofagentapp --help``
462
463
Charles Chan19833d82019-09-07 20:49:14 -0700464Launch in listen mode with ofagentd
465^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williamsd63d35b2020-06-23 14:12:46 -0700466
467An optional ``-l`` parameter can be added for switch to listen on specific
468**IP:port**.
469
470This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and
471control the switch.
Charles Chandd26eeb2019-08-29 17:59:21 -0700472
473.. code-block:: bash
474
475 OPT_ARGS="-t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port>"
476
Zack Williamsd63d35b2020-06-23 14:12:46 -0700477Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to
478access switches in listen mode.
Charles Chan19833d82019-09-07 20:49:14 -0700479
480Use launcher app
481----------------
482
483Launch with launcher
484^^^^^^^^^^^^^^^^^^^^
485- To **start** OF-DPA and OpenFlow agent, run:
486
487 .. code-block:: console
488
489 # ./launcher ofagentapp -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>
490
491- We can choose to run OF-DPA in **debug mode**
492
493 .. code-block:: console
494
495 # ./launcher ofagentapp -d 2 -c 2 -c 4 -t <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid>
496
497- To **stop** OF-DPA and OpenFlow agent, run:
498
Zack Williams4d900762020-01-21 11:00:35 -0700499 .. code-block:: console
Charles Chan19833d82019-09-07 20:49:14 -0700500
501 # killall ofagentapp
502
503Launch in listen mode with launcher
504^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williamsd63d35b2020-06-23 14:12:46 -0700505
506An optional ``-l`` parameter can be added for switch to listen on specific
507**IP:port**.
508
509This allows us to use tools like **ovs-ofctl** or **dpctl** to connect and
510control the switch.
Charles Chandd26eeb2019-08-29 17:59:21 -0700511
512.. code-block:: console
513
Charles Chan19833d82019-09-07 20:49:14 -0700514 # ./launcher ofagentapp <controller_ip_1> -t <controller_ip_2> -t <controller_ip_3> -i <dpid> -l <ip>:<port>
Charles Chandd26eeb2019-08-29 17:59:21 -0700515
Zack Williamsd63d35b2020-06-23 14:12:46 -0700516Please refer to `Connect to Switch in Listen Mode`_ to learn more about how to
517access switches in listen mode.
Charles Chandd26eeb2019-08-29 17:59:21 -0700518
519
520Vendor Specific Information
521===========================
522
523
524Edgecore
525--------
526
Charles Chan19833d82019-09-07 20:49:14 -0700527- **OF-DPA Image**
Zack Williamsd63d35b2020-06-23 14:12:46 -0700528
529 - `EdgeCore 5712-54X / 5812-54X / 6712-32X / 7712-32X
530 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa_3.0.5.5%2Baccton1.7-1_amd64.deb>`_
531 **Checksum**: *sha256:db228b6e79fb15f77497b59689235606b60abc157e72fc3356071bcc8dc4c01f*
Charles Chandd26eeb2019-08-29 17:59:21 -0700532
Charles Chan19833d82019-09-07 20:49:14 -0700533- **Start OF-DPA and OpenFlow agent**
Zack Williamsd63d35b2020-06-23 14:12:46 -0700534
Charles Chan19833d82019-09-07 20:49:14 -0700535 - Please refer to `Use ofagentd service`_
536
537- **Configure Port Speed and Breakout**
Zack Williamsd63d35b2020-06-23 14:12:46 -0700538
539 - By default all the switch ports are running at maximum speed. The port
540 speed can be modified in **/etc/accton/ofdpa.conf**
Charles Chandd26eeb2019-08-29 17:59:21 -0700541
542 .. code-block:: text
543
544 port_speed_1=1000 # configure front port 1 to run at 1G
545
546 - We can also configure the same file to use break out cables on certain ports.
547
548 .. code-block:: text
549
550 port_mode_1=4x10g # configure front port 1 to break out from 40G to 4x10G
551
552 OF-DPA service needs to be restarted after modifying this configuration.
553
Charles Chandd26eeb2019-08-29 17:59:21 -0700554QCT
555---
556
557- OF-DPA Image
Zack Williamsd63d35b2020-06-23 14:12:46 -0700558
559 - `QuantaMesh T3048-LY8
560 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ag7648_0.3.0.5.6_amd64.deb>`_
561 **Checksum**: *sha256:f8201530b1452145c1a0956ea1d3c0402c3568d090553d0d7b3c91a79137da9e*
562
563 - `QuantaMesh T7032-IX1 / IX1B
564 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ix1_0.3.0.5.0-EA5-qct-01.00_amd64.deb>`_
565 **Checksum**: *sha256:278b8ffed8a8fc705a1b60d16f8e70377e78342a27a11568a1d80b1efd706a46*
Charles Chandd26eeb2019-08-29 17:59:21 -0700566
Charles Chan19833d82019-09-07 20:49:14 -0700567- **Start OF-DPA and OpenFlow agent**
568 - Please refer to `Use launcher app`_
569
570- Configure Port Speed and Breakout
Zack Williamsd63d35b2020-06-23 14:12:46 -0700571
Charles Chan19833d82019-09-07 20:49:14 -0700572 The command ``client_drivshell`` can be used to configure the port speed.
Zack Williamsd63d35b2020-06-23 14:12:46 -0700573
574 Use the parameter ``ps`` to list all ports or ``ps <port number>`` to list
575 one specific port.
Charles Chan19833d82019-09-07 20:49:14 -0700576
577 .. code-block:: console
578
579 # client_drivshell ps 1
580 Calling ofdpaBcmCommand rpc with command = "ps 1 ".
581 ena/ speed/ link auto STP lrn inter max loop
582 port link duplex scan neg? state pause discrd ops face frame back
583 xe0( 1) down 10G FD SW No Forward Untag F SFI 9412
584
585 Returned from ofdpaBcmCommand rpc with rc = 0.
586
Zack Williamsd63d35b2020-06-23 14:12:46 -0700587 Then use the parameter ``port <port number> sp=<port speed>`` to change the
588 port speed.
Charles Chan19833d82019-09-07 20:49:14 -0700589
590 .. code-block:: console
591
592 # client_drivshell port xe0 sp=1000
593 Calling ofdpaBcmCommand rpc with command = "port xe0 sp=1000 ".
594
595 Returned from ofdpaBcmCommand rpc with rc = 0.
596
597 # client_drivshell ps 1
598 Calling ofdpaBcmCommand rpc with command = "ps 1 ".
599 ena/ speed/ link auto STP lrn inter max loop
600 port link duplex scan neg? state pause discrd ops face frame back
601 xe0( 1) down 1G FD SW No Forward Untag F GMII 9412
602
603 Returned from ofdpaBcmCommand rpc with rc = 0.
Charles Chandd26eeb2019-08-29 17:59:21 -0700604
605Delta
606-----
607
608- OF-DPA Image
Zack Williamsd63d35b2020-06-23 14:12:46 -0700609
610 - `Delta AG7648
611 <https://raw.githubusercontent.com/onfsdn/atrium-docs/master/16A/ONOS/builds/ofdpa-ly8_0.3.0.5.0-EA5-qct-01.01_amd64.deb>`_
612 **Checksum**: *sha256:ddfc13cb98ca47291dce5e6938b1d65f0b99bbe77f0585e36ac0007017397f23*
Charles Chandd26eeb2019-08-29 17:59:21 -0700613
Charles Chan19833d82019-09-07 20:49:14 -0700614- **Start OF-DPA and OpenFlow agent**
Zack Williamsd63d35b2020-06-23 14:12:46 -0700615
Charles Chan19833d82019-09-07 20:49:14 -0700616 - Please refer to `Use launcher app`_
617
Charles Chandd26eeb2019-08-29 17:59:21 -0700618- Special instructions to install ONL
Zack Williamsd63d35b2020-06-23 14:12:46 -0700619
620 Make sure ``/etc/machine.conf`` looks like the following in ONIE before
621 running ONL installation script:
Charles Chandd26eeb2019-08-29 17:59:21 -0700622
623 .. code-block:: text
624
625 onie_platform=x86_64-delta_<platform name>-r0
626 onie_machine=delta_<platform name>
627
Zack Williamsd63d35b2020-06-23 14:12:46 -0700628 After the installation of ONL, if you don't see '/usr/bin' in your PATH
629 variable, please run the following command:
Charles Chandd26eeb2019-08-29 17:59:21 -0700630
631 .. code-block:: console
632
633 # export PATH=$PATH:/usr/bin
634
Charles Chandd26eeb2019-08-29 17:59:21 -0700635
636Useful Information
637==================
638
Charles Chandd26eeb2019-08-29 17:59:21 -0700639OF-DPA Commands
640---------------
641There are some useful OF-DPA commands under ``/usr/bin/``
642
643.. code-block:: text
644
645 client_cfg_purge
646 client_debugcomp
647 client_drivshell
648 client_flowtable_dump
649 client_meter_dump
650 client_port_table_dump
651 client_tunnel_dump
652 client_classcolortable_dump
653 client_debuglvl
654 client_event
655 client_grouptable_dump
656 client_oam_dump
657 client_queue_config
658
659
660ONL Boot Mode
661-------------
662OFDPA offers two boot mode: **INSTALLED** and **SWI**.
663
Zack Williamsd63d35b2020-06-23 14:12:46 -0700664- In **INSTALLED** mode, ONL mounts the root filesystem from ``/dev/sdb7``
665 which is a flash drive that persists everything even during a power cycle.
Charles Chandd26eeb2019-08-29 17:59:21 -0700666
Zack Williamsd63d35b2020-06-23 14:12:46 -0700667- In **SWI** mode, ONL will load the root filesystem from a read-only image
668 (``*.swi``) and put the modified files in an copy-on-write overlay filesystem.
669
670 The change will not be persisted during a power cycle.
671
672 The pros and cons are obvious. INSTALLED mode is more convenient while SWI
673 mode is more error-safe.
674
675The boot mode will be determined by which image we used install ONL. We use the
676**INSTALLED** mode in this instruction for simplicity. But we can still change
677it after the installation. Here's the instruction:
Charles Chandd26eeb2019-08-29 17:59:21 -0700678
679.. code-block:: console
680
681 # mount /mnt/onl/boot -o remount,rw
682 # sed -i 's/BOOTMODE=INSTALLED/BOOTMODE=SWI/g' /mnt/onl/boot/boot-config
683 # reboot
684
685
686Persistence Mechanism
687---------------------
Charles Chandd26eeb2019-08-29 17:59:21 -0700688
Zack Williamsd63d35b2020-06-23 14:12:46 -0700689INSTALLED mode already persists everything for you. This section is mainly for
690SWI mode.
691
692The mechanism to persist files on the switch is different from ONL 1.x to ONL
6932.x. Following are the steps required to persist a file (e.g. OFDPA package)
694in ONL 2.x.
Charles Chandd26eeb2019-08-29 17:59:21 -0700695
696- Files put in **/mnt/onl/data** will be persisted automatically.
Zack Williamsd63d35b2020-06-23 14:12:46 -0700697
698- To install a deb package during start-up, put the deb file under
699 **/mnt/onl/data/install-debs** folder and create a plain text file
700 **/mnt/onl/data/install-debs/list** with all the filename of the deb (e.g.
701 ``ofdpa_3.0.5.5+accton1.7-1_amd64.deb``)
702
703- To execute some command during start-up, put the command in
704 **/mnt/onl/data/rc.boot**
Charles Chandd26eeb2019-08-29 17:59:21 -0700705
706 .. code-block:: bash
707
708 # set static ip and route (dhcp by default)
709 echo 'ip addr add 10.128.0.203/16 dev ma1' >> /mnt/onl/data/rc.boot
710 echo 'ip route add default via 10.128.0.1' >> /mnt/onl/data/rc.boot
711 # grant executable permission
712 chmod a+x /mnt/onl/data/rc.boot
713
Zack Williamsd63d35b2020-06-23 14:12:46 -0700714See `PersistWorkflow.md
715<https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/PersistWorkflow.md>`_
716for more detail.
Charles Chandd26eeb2019-08-29 17:59:21 -0700717
718
719Build a Customized ONL Image
720----------------------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700721
722Sometimes we need to build our own ONL image from source to include some extra
723files. (The most common case is a modified /etc/network/interfaces).
724
725The instruction of build process has already been well-documented in ONL repo
726`Building.md
727<https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/docs/Building.md>`_.
728
Charles Chandd26eeb2019-08-29 17:59:21 -0700729But you might find it a little bit tricky to inject some extra files.
Zack Williamsd63d35b2020-06-23 14:12:46 -0700730
731To do that, you need to put the files under
732**$ONL_ROOT/builds/any/rootfs/jessie/common/overlay/** and then run the make
733command again.
Charles Chandd26eeb2019-08-29 17:59:21 -0700734
735
736Recovery from a Faulty ONL Install
737----------------------------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700738If, for some reason, the ONL install process fails, you may be brought to the
739grub rescue prompt upon reboot.
740
741You may or may not find system files, or even basic grub rescue commands (i.e.
742'help').
743
Charles Chandd26eeb2019-08-29 17:59:21 -0700744There are two options for returning to a (known working) ONIE prompt.
745
Zack Williamsd63d35b2020-06-23 14:12:46 -07007461. **Reinstaller** - You should be able to acquire an ISO image for resetting
747 the firmware to factory default from your switch vendor. Once you have the
748 ISO, you can either use PXE or a live USB to boot the switch into the image.
749
7502. **Manually boot to ONIE** - If the files are there, you can manually
751 configure GRUB to load the necessary modules to boot back into ONIE.
Charles Chandd26eeb2019-08-29 17:59:21 -0700752
753 .. code-block:: console
754
755 # This should be the partition on the ONIE partition on the AS6712.
756 # It might be hd1 or hd0. Change appropriately.
757 grub rescue> ls (hd0,gpt2)/
758 ./ ../ lost+found/ onie/ grub/ grubenv
759
760 # These instructions will load the kernel and ONIE initrd.
761 grub rescue> set prefix=(hd0,gpt2)/grub
762 grub rescue> set root=(hd0,gpt2)
763 grub rescue> insmod normal
764 grub rescue> insmod linux
765 grub rescue> ls /onie
766 ./ ../ vmlinuz-3.2.35-onie initrd.img-3.2.35-onie tools/ grub/ grub.d/ config/
767
768 # if the ",115200n8" is omitted, baud rate defaults to 9600.
769 grub rescue> linux /onie/vmlinuz-3.2.35-onie console=tty0 console=ttyS1,115200n8
770 grub rescue> initrd /onie/initrd.img-3.2.35-onie
771
772 # The system will not boot into ONIE and you can recover or re-install from there.
773 grub rescue> boot
774
Zack Williamsd63d35b2020-06-23 14:12:46 -0700775Once back at the ONIE prompt, you can try to install ONL by following the same
776steps again.
Charles Chandd26eeb2019-08-29 17:59:21 -0700777
778
Charles Chan19833d82019-09-07 20:49:14 -0700779Connect to Switch in Listen Mode
780--------------------------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700781
782To connect to the switch in Listen Mode using **ovs-ofctl**, you can use
783commands such as:
Charles Chan19833d82019-09-07 20:49:14 -0700784
785.. code-block:: console
786
787 $ ovs-ofctl -O OpenFlow13 show tcp:<ip>:<port>
788 $ ovs-ofctl -O OpenFlow13 dump-flows tcp:<ip>:<port>
789 $ ovs-ofctl -O OpenFlow13 dump-groups tcp:<ip>:<port>
790 $ ovs-ofctl -O OpenFlow13 add-flow tcp:<ip>:<port> table=60,priority=40000,eth_type=0x0800,ip_dst=55.55.55.55,actions=controller
791
Zack Williamsd63d35b2020-06-23 14:12:46 -0700792For more command, please see ``ovs-ofctl --help`` or the post `OpenvSwitch
793ovs-ofctl and OF-DPA
794<https://blog.pichuang.com.tw/20170106-ovs-ofctl-and-ofdpa/>`_.
Charles Chan19833d82019-09-07 20:49:14 -0700795
796
Charles Chandd26eeb2019-08-29 17:59:21 -0700797Reference
798---------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700799
800- `ONL/OF-DPA installation guide by Edgecore Networks
801 <https://www.youtube.com/watch?v=mCUtkIc_hVI>`_
802
803- `ONL/OF-DPA cheat sheet by Phil Huang
804 <https://blog.pichuang.com.tw/20170104-ofdpa-with-onl-cheat-sheet/>`_