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