Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 1 | .. _lab_setup: |
| 2 | |
| 3 | Hardware Setup of a VOLTHA Test Pod |
| 4 | =================================== |
| 5 | |
| 6 | Overview |
| 7 | -------- |
| 8 | |
| 9 | In a testing setup rather than using a real RG or BNG emulated ones are |
| 10 | deployed on a Linux development server: |
| 11 | |
| 12 | - The ``RG`` can be emulated by an ``lxc`` container (from now on ``client``) |
| 13 | - The ``BNG`` can be emulated by a Linux server |
Andrea Campanella | 882cfcc | 2021-02-04 10:53:57 +0100 | [diff] [blame] | 14 | - The ``AggSwitch`` is mandatory if control of the OLT is done with ``in-band`` mode, while |
| 15 | optional if the OLT is controlled out of band, in this case the NNI port of the OLT will go directly |
| 16 | into the emulated BNG linux server NIC card. |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 17 | |
| 18 | .. figure:: ../_static/voltha_lab_setup.png |
| 19 | :alt: VOLTHA Lab Setup |
| 20 | |
| 21 | VOLTHA Lab Setup |
| 22 | |
| 23 | *The image above represents the data plane connections in a LAB setup. |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 24 | It does not include the ``kubernetes`` cluster for simplicity, but the ``dev server`` |
| 25 | listed above can be one of your ``kubernetes`` nodes.* |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 26 | |
| 27 | What you’ll need to emulate E2E traffic is: |
| 28 | |
| 29 | - 1 x86 server with Ubuntu 16.04 and at least the following interfaces: |
| 30 | |
| 31 | - 1 1G Ethernet port |
| 32 | - 1 10G Ethernet port (this can be a second 1G interface as long as you have a media converter) |
| 33 | |
Matteo Scandolo | ef5d6f4 | 2020-07-27 16:46:38 -0700 | [diff] [blame] | 34 | .. _setting-up-a-client: |
| 35 | |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 36 | Setting up a client |
| 37 | ------------------- |
| 38 | |
| 39 | The first thing you need to do is to install ``lxd`` on your server. To do that |
Joey Armstrong | a2fa658 | 2023-04-07 11:03:36 -0400 | [diff] [blame] | 40 | you can follow `this guide <https://ubuntu.com/tutorials/setting-up-lxd-1604>`_ |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 41 | |
| 42 | Once ``lxd`` is successfully installed you need to initialize it with: |
| 43 | |
| 44 | .. code:: bash |
| 45 | |
| 46 | lxd init |
| 47 | |
| 48 | we recommend to use all the provided default values. |
| 49 | |
| 50 | Once ``lxd`` is initialized you can create a container and assign a physical |
| 51 | Ethernet interface to the container: |
| 52 | |
| 53 | .. code:: bash |
| 54 | |
| 55 | lxc launch ubuntu:16.04 <name> |
| 56 | lxc config device add <name> eth1 nic name=eth1 parent=<physical-intf> nictype=physical |
| 57 | |
| 58 | Where: |
| 59 | |
| 60 | - ``name`` is the desired container name. The convention used to identify which |
| 61 | RG container is connected to an ONU is to use the ONU serial number as the |
| 62 | lxc container name. |
| 63 | |
| 64 | - ``physical-intf`` is the name of the interface on the server where the ONU |
| 65 | is physically connected |
| 66 | |
| 67 | Once the container is created you can check it's state with with ``lxc list``: |
| 68 | |
| 69 | .. code:: bash |
| 70 | |
| 71 | +---------------+---------+--------------------+------+------------+-----------+ |
| 72 | | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | |
| 73 | +---------------+---------+--------------------+------+------------+-----------+ |
| 74 | | voltha-client | RUNNING | 10.63.3.144 (eth0) | | PERSISTENT | 0 | |
| 75 | +---------------+---------+--------------------+------+------------+-----------+ |
| 76 | |
| 77 | Please make sure the container has an assigned IP or we it won’t be able |
| 78 | to login and install the ``wpasupplicant`` tool inside the RG. |
| 79 | |
| 80 | Once the container is running you need to enter it for configuration. To access |
| 81 | the container run: ``lxc exec <name> /bin/bash`` |
| 82 | |
| 83 | Once inside: |
| 84 | |
| 85 | .. code:: bash |
| 86 | |
| 87 | # activate the interface |
| 88 | ip link set eth1 up |
Andrea Campanella | 458163b | 2022-04-11 14:19:25 +0200 | [diff] [blame] | 89 | |
| 90 | .. |
| 91 | |
| 92 | If you want to setup the container for the DT workflow please add a tagged interface to be used to send out traffic. |
| 93 | |
| 94 | .. code:: bash |
| 95 | |
| 96 | # setup tagged client interface |
| 97 | ip link add link eth1 name eth1.7 type vlan id 7 |
| 98 | ip link set eth1.7 up |
| 99 | |
| 100 | .. |
| 101 | |
| 102 | The container also requires some tools for testing |
| 103 | |
| 104 | .. code:: bash |
| 105 | |
Andrea Campanella | 3c4e526 | 2021-05-18 11:47:57 +0200 | [diff] [blame] | 106 | # install the required tools for testing |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 107 | apt update |
Andrea Campanella | 3c4e526 | 2021-05-18 11:47:57 +0200 | [diff] [blame] | 108 | apt install -y wpasupplicant jq netsniff-ng build-essential tcpdump |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 109 | |
| 110 | .. |
| 111 | |
Andrea Campanella | 3c4e526 | 2021-05-18 11:47:57 +0200 | [diff] [blame] | 112 | In the lxc container you also need to install iperf3. Iperf3 needs to be installed from source to have some |
| 113 | options used in VOLTHA tests. |
| 114 | |
| 115 | .. code:: bash |
| 116 | |
| 117 | git clone https://github.com/esnet/iperf.git -b 3.9 |
| 118 | cd iperf |
| 119 | ./configure && make && sudo make install |
| 120 | ldconfig |
| 121 | |
| 122 | .. |
| 123 | |
| 124 | NOTE: |
| 125 | |
| 126 | - ``wpasupplicant`` is a Linux tool to perform 802.1X authentication. `wpasupplicant documentation can be found here <https://help.ubuntu.com/community/WifiDocs/WPAHowTo>`_. |
| 127 | - ``jq`` is a linux tool to perform json parsing. `More information on jq <https://stedolan.github.io/jq/>`_ |
| 128 | - ``netsniff-ng`` installs maushezan, a linux tool to perform traffic generations. `More informations on mz <https://man7.org/linux/man-pages/man8/mausezahn.8.html>`_ |
| 129 | - ``iperf3`` is a linux tool to perform speed tests. `More information on iperf3 <https://iperf.fr/>`_ |
| 130 | |
| 131 | |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 132 | |
| 133 | Create a configuration file for ``wpasupplicant`` in |
| 134 | ``/etc/wpa_supplicant/wpa_supplicant.conf`` with the content: |
| 135 | |
| 136 | .. code:: text |
| 137 | |
| 138 | ctrl_interface=/var/run/wpa_supplicant |
| 139 | eapol_version=1 |
| 140 | ap_scan=0 |
| 141 | fast_reauth=1 |
| 142 | network={ |
| 143 | key_mgmt=WPA-EAP |
| 144 | eap=MD5 |
| 145 | identity="user" |
| 146 | password="password" |
| 147 | ca_cert="/etc/cert/cacert.pem" |
| 148 | client_cert="/etc/cert/client.pem" |
| 149 | private_key="/etc/cert/client.key" |
| 150 | private_key_passwd="whatever" |
| 151 | eapol_flags=3 |
| 152 | } |
| 153 | |
| 154 | .. |
| 155 | |
| 156 | NOTE: The configuration in this file is not really important if you are |
| 157 | using the ``freeradius`` server provided as part of the VOLTHA helm charts. |
| 158 | Do not worry if the certificates do not exist, they won’t affect |
| 159 | authentication as that is password based. |
| 160 | |
| 161 | At this point you’ll be able kickoff the authentication process (by |
| 162 | sending ``EAPOL`` packets into the system) with the command: |
| 163 | |
| 164 | .. code:: bash |
| 165 | |
| 166 | wpa_supplicant -i eth1 -Dwired -c /etc/wpa_supplicant/wpa_supplicant.conf |
| 167 | |
| 168 | If everything has been set up correctly, you should see output similar to this |
| 169 | in the VOLTHA logs: |
| 170 | |
| 171 | .. code:: bash |
| 172 | |
| 173 | cord@node1:~$ kubectl logs -f -n voltha vcore-0 | grep -E "packet_indication|packet-in" | grep 888e |
| 174 | 20180912T003237.453 DEBUG MainThread adapter_agent.send_packet_in {adapter_name: openolt, logical_port_no: 16, logical_device_id: 000100000a5a0097, packet: 0180c200000390e2ba82fa8281000ffb888e01000009020100090175736572000000000000000000000000000000000000000000000000000000000000000000, event: send-packet-in, instance_id: compose_voltha_1_1536712228, vcore_id: 0001} |
| 175 | |
| 176 | Setting up an emulated BNG on Linux |
| 177 | ----------------------------------- |
| 178 | |
| 179 | The emulated BNG needs to perform only two operations: ``DHCP`` and |
| 180 | ``NAT``. |
| 181 | |
| 182 | To setup a NAT router on an Ubuntu 16.04 server you can look at this |
| 183 | tutorial: |
Joey Armstrong | ae15c26 | 2023-03-29 15:36:28 -0400 | [diff] [blame] | 184 | http :// nairabytes.net/linux/how-to-set-up-a-nat-router-on-ubuntu-server-16-04 |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 185 | |
| 186 | To install a DHCP server you can follow this tutorial: |
Joey Armstrong | ae15c26 | 2023-03-29 15:36:28 -0400 | [diff] [blame] | 187 | http :// nairabytes.net/linux/how-to-install-a-dhcp-server-in-ubuntu-server-16-04 |
Zack Williams | 16042b6 | 2020-03-29 22:03:16 -0700 | [diff] [blame] | 188 | |
| 189 | Once the ``DHCP`` server is installed, you need to configure it. |
| 190 | |
| 191 | Create Q-in-Q interfaces |
| 192 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
| 193 | |
| 194 | On the interface that connects to the Agg Switch (upstream) you are |
| 195 | going to receive double tagged traffic, so you’ll need to create |
| 196 | interfaces to received it. |
| 197 | |
| 198 | Supposing that your subscriber is using ``s_tag=111``, ``c_tag=222`` and |
| 199 | the upstream interface name is ``eth2`` you can use this commands to |
| 200 | create it: |
| 201 | |
| 202 | .. code:: bash |
| 203 | |
| 204 | ip link set eth2 up |
| 205 | ip link add link eth2 name eth2.111 type vlan id 111 |
| 206 | ip link set eth2.111 up |
| 207 | ip link add link eth2.111 name eth2.111.222 type vlan id 222 |
| 208 | ip link set eth2.111.222 up |
| 209 | ip addr add 10.11.2.254/24 dev eth2.111.222 |
| 210 | |
| 211 | Then you’ll need to tell the ``dhcp`` server to listen on that |
| 212 | interface, you can do that by editing the file |
| 213 | ``/etc/default/isc-dhcp-server`` so that it looks like: |
| 214 | |
| 215 | .. code:: bash |
| 216 | |
| 217 | INTERFACES="eth2.111.222" |
| 218 | |
| 219 | .. |
| 220 | |
| 221 | NOTE that you can list multiple interfaces, separated by spaces, in |
| 222 | case you have multiple subscribers in your setup |
| 223 | |
| 224 | In the ``/etc/dhcp/dhcpd.conf`` config file, configure the IP address |
| 225 | range to assign to the double tagged interface: |
| 226 | |
| 227 | .. code:: text |
| 228 | |
| 229 | subnet 10.11.2.0 netmask 255.255.255.0 { |
| 230 | range 10.11.2.1 10.11.2.100; |
| 231 | option routers 10.11.2.254; |
| 232 | option domain-name-servers 8.8.8.8; |
| 233 | } |
Andrea Campanella | 882cfcc | 2021-02-04 10:53:57 +0100 | [diff] [blame] | 234 | |
Andrea Campanella | 3c4e526 | 2021-05-18 11:47:57 +0200 | [diff] [blame] | 235 | Other BNG required tools |
| 236 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
| 237 | |
| 238 | Some tools are required to perform data plane tests present in voltha-system-tests. |
| 239 | The following commands install them: |
| 240 | |
| 241 | .. code:: bash |
| 242 | |
| 243 | sudo apt update |
| 244 | sudo apt-get install -y jq netsniff-ng build-essential tcpdump |
| 245 | |
| 246 | .. |
| 247 | |
| 248 | In the BNG you also need to install ``iperf3``. ``Iperf3`` needs to be installed from source to have some |
| 249 | options used in the tests. |
| 250 | |
| 251 | .. code:: bash |
| 252 | |
| 253 | #remove existing installation if any |
| 254 | sudo service iperf3 stop |
| 255 | sudo apt-get remove --purge iperf3 |
| 256 | #Clone and install from source |
| 257 | git clone https://github.com/esnet/iperf.git -b 3.9 |
| 258 | cd iperf |
| 259 | ./configure && make && sudo make install |
| 260 | sudo ldconfig |
| 261 | |
| 262 | .. |
| 263 | |
| 264 | After installing ``iperf3`` on the BNG node it needs to be configured. |
| 265 | Create the ``iperf3.service`` file: |
| 266 | |
| 267 | .. code:: bash |
| 268 | |
| 269 | sudo vi /etc/systemd/system/iperf3.service |
| 270 | |
| 271 | .. |
| 272 | |
| 273 | Include this content in the newly created file: |
| 274 | |
| 275 | .. code:: text |
| 276 | |
| 277 | [Unit] |
| 278 | Description=iperf3 |
| 279 | [Service] |
| 280 | ExecStart=/usr/local/bin/iperf3 --server |
| 281 | [Install] |
| 282 | WantedBy=multi-user.target |
| 283 | |
| 284 | .. |
| 285 | |
| 286 | Start the ``iperf3`` service |
| 287 | |
| 288 | .. code:: bash |
| 289 | |
| 290 | sudo service iperf3 start |
| 291 | |
| 292 | .. |
| 293 | |
| 294 | Finally, check the ``iperf3`` service |
| 295 | |
| 296 | .. code:: bash |
| 297 | |
| 298 | sudo service iperf3 status |
| 299 | |
| 300 | .. |
| 301 | |
Andrea Campanella | 882cfcc | 2021-02-04 10:53:57 +0100 | [diff] [blame] | 302 | Configuration for in-band OLT control |
| 303 | ------------------------------------- |
| 304 | |
Joey Armstrong | ed6cedd | 2022-08-31 12:39:33 -0400 | [diff] [blame] | 305 | If OLT is being used in in-band connectivity mode, this |
Andrea Campanella | 882cfcc | 2021-02-04 10:53:57 +0100 | [diff] [blame] | 306 | `document <https://docs.google.com/document/d/1OKDJCPEFVTEythAFUS_I7Piew4jHmhk25llK6UF04Wg>`_ |
| 307 | details the configuration aspects in ONOS and the aggregation switch to |
Joey Armstrong | ed6cedd | 2022-08-31 12:39:33 -0400 | [diff] [blame] | 308 | trunk/switch in-band packets from the OLT to BNG or VOLTHA. |
Andrea Campanella | 882cfcc | 2021-02-04 10:53:57 +0100 | [diff] [blame] | 309 | |
| 310 | In-band OLT software upgrade |
| 311 | ------------------------------------- |
| 312 | If OLT with openolt agent is being used in in-band connectivity mode we provide the capability |
| 313 | to execute SW updates of the image present on the device, the |
| 314 | `README <https://github.com/opencord/openolt/tree/master/olt-sw-upgrade>`_ provides the required details. |