blob: dbe6426884580cbf2c645a7b264bceffea95e8e6 [file] [log] [blame]
Charles Chan2caff7b2021-10-11 20:25:16 -07001.. _onos_network_config:
2
Charles Chancaebcf32021-09-20 22:17:52 -07003Network Configuration
4=====================
Wailok Shum2f05cd32021-09-30 22:18:19 +08005SD-Fabric uses several different types of network configurations.
6We only focus on ``devices`` and ``ports`` configuration in this section.
7With these configured properly, SD-Fabric can provide basic L2/L3 connectivity.
8
9See :ref:`advanced-features` for advanced feature configurations.
10
11Device Configuration
12--------------------
13Each switch in SD-Fabric requires a device config.
14
15.. code-block:: json
16
17 {
18 "devices" : {
19 "device:leaf1" : {
20 "segmentrouting" : {
21 "ipv4NodeSid" : 101,
22 "ipv4Loopback" : "192.168.0.201",
23 "ipv6NodeSid" : 111,
24 "ipv6Loopback" : "2000::c0a8:0201",
25 "routerMac" : "00:00:00:00:02:01",
26 "isEdgeRouter" : true,
27 "adjacencySids" : []
28 },
29 "basic" : {
30 "name": "Leaf1",
31 "managementAddress": "grpc://10.128.100.51:9339?device_id=1",
32 "driver": "stratum-tofino",
33 "pipeconf": "org.stratumproject.fabric-spgw-int.montara_sde_9_5_0"
34 }
35 }
36 }
37 }
38
39- ``device:leaf1``: DPID of the device.
40
41- ``ipv4NodeSid``: IPv4 node segment ID, which is used as an MPLS label in
42 forwarding IPv4 traffic. Can be arbitrary and should be globally unique.
43
44- ``ipv4Loopback``: IPv4 loopback address. Can be arbitrary, should be globally
45 unique and should not be part of the same subnet(s) defined on the data plane
46 ports (see port config).
47
48- ``ipv6NodeSid``: IPv6 node segment ID, which is used as an MPLS label in
49 forwarding IPv6 traffic. Can be arbitrary and should be globally unique. Only
50 required when using IPv6.
51
52- ``ipv6Loopback``: IPv6 loopback address. Can be arbitrary, should be globally
53 unique and should not be part of the same subnet(s) defined on the data plane
54 ports (see port config). Only required when using IPv6.
55
56- ``routerMac``: Router MAC address. Can be arbitrary and should be globally
57 unique. This MAC address will be used to reply the ARP request for the
58 loopback IP or the Interface IP that will be introduced later. (We recommend
59 using the MAC address of the device's management interface as the router
60 MAC.)
61
62- ``isEdgeRouter``: True for leaf switches. False for spine switches.
63
64- ``adjacencySids``: Deprecated. Just put an empty array for now.
65
66- ``name``: Name of the device. It is an arbitrary name to identify the device easily.
67
68- ``managementAddress``: gRPC endpoint of the Stratum device and a numerical device ID.
69 The IP address can be replaced by domain name as well.
70
71- ``driver``: ``stratum-bmv2`` or ``stratum-tofino``, depending on which switch this is.
72
73- ``pipeconf``: A list of available pipeconfs can be dumped by running ``pipeconfs`` in ONOS CLI.
74 Select the pipeconf you would like to use for this device.
75
76.. caution::
77 We should avoid using reserved MPLS labels for ``ipv4NodeSid`` and
78 ``ipv6NodeSid``. Please check here for the reserved values:
79 http://www.iana.org/assignments/mpls-label-values/mpls-label-values.xhtml
80
81.. note::
82 Most of the SD-Fabric configurations support dynamic configuration updates.
83 Unfortunately, SD-Fabric currently **do not support dynamic device
84 configuration updates**. You will have to restart the device when if
85 corresponding device configuration changes.
86
87 Having said that, when introducing a completely new device in the network,
88 the device configurations pushed before the device's connection should
89 apply correctly.
90
91Bridging and Unicast Routing
92----------------------------
93
94.. attention::
95 - VLAN **4094** is reserved for unconfigured ports (e.g. spine facing ports)
96
97Access Ports
98^^^^^^^^^^^^
99
100The necessary but minimum configuration for an access port is simply a VLAN.
101
102.. code-block:: json
103
104 {
105 "ports" : {
106 "of:0000000000000204/12" : {
107 "interfaces" : [{
108 "name" : "serverA-intf",
109 "vlan-untagged": 10
110 }]
111 },
112 "of:0000000000000204/16" : {
113 "interfaces" : [{
114 "name" : "serverB-intf",
115 "vlan-untagged": 10
116 }]
117 }
118 }
119 }
120
121The example above shows two ports (12 and 16) on switch ``of:204`` that have
122been assigned to VLAN 10 using the ``vlan-untagged`` keyword.
123
124It simply means that packets come in and leave out of these switches untagged,
125but internally they are assigned VLAN 10 and they belong to the bridging domain
126defined for VLAN 10.
127
128``name`` is used to associate the interface with a globally unique, user
129friendly name. It can be omitted.
130
131With the configuration shown above, the packets will always be bridged, but
132they cannot be routed out of the VLAN (e.g. to other subnets). To add the
133capability to route out of VLAN 10, we need to add a subnet/gateway IP (similar
134to `interface-vlans or SVIs in traditional networks
135<https://www.youtube.com/watch?v=bUXpmiJpGb0>`_).
136
137.. code-block:: json
138
139 {
140 "ports" : {
141 "of:0000000000000204/12" : {
142 "interfaces" : [{
143 "name" : "serverA-intf",
144 "ips" : [ "10.0.1.254/24"],
145 "vlan-untagged": 10
146 }]
147 },
148 "of:0000000000000204/16" : {
149 "interfaces" : [{
150 "name" : "serverB-intf",
151 "ips" : [ "10.0.1.254/24"],
152 "vlan-untagged": 10
153 }]
154 }
155 }
156 }
157
158In this example, VLAN 10 is associated with subnet ``10.0.1.0/24``, and the
159gateway IP for hosts in this subnet is ``10.0.1.254/32``.
160
161When the desire is to route out of a VLAN, this assignment is currently
162necessary on all ports configured in the same VLAN.
163
164.. note::
165 Typically we only expect a single subnet for a VLAN. Similar to traditional
166 networks, for us, a subnet == VLAN. Different VLANs should be configured in
167 different subnets.
168
169 In certain use-cases, it may be necessary to configure multiple subnets in
170 the same VLAN. This is possible by adding more subnet/gateway IPs in the
171 ``ips`` array.
172
173.. tip::
174 One subnet cannot be configured on multiple leaf switches.
175
176 We usually configure one subnet for all the ports on the same leaf switch.
177
178Tagged Ports
179^^^^^^^^^^^^
180Tagged port configuration is similar.
181
182.. code-block:: json
183
184 {
185 "ports" : {
186 "of:0000000000000204/24" : {
187 "interfaces" : [{
188 "name" : "serverA-intf",
189 "ips" : [ "10.0.2.254/24", "10.0.4.254/24" ],
190 "vlan-tagged" : [ 20, 40 ]
191 }]
192 }
193 }
194 }
195
196The configuration above for port 24 on switch of:204 shows two VLANs 20 and 40
197configured on that port, with corresponding subnets and gateway IPs.
198
199Note that there is no specific ordering required in the ``ips`` or
200``vlan-tagged`` arrays to correlate the VLANs to their corresponding subnets.
201
202In a future release, we will correlate VLAN and subnets configuration in a more
203readable way.
204
205Native VLAN on Tagged Ports
206^^^^^^^^^^^^^^^^^^^^^^^^^^^
207
208An additional configuration ``vlan-native`` possible on tagged ports includes
209the ability to specify a VLAN (and thus a bridging domain) for incoming
210untagged packets.
211
212Typically, such configuration in trunk ports in traditional networks is
213referred to a native VLAN.
214
215.. code-block:: json
216
217 {
218 "ports" : {
219 "of:0000000000000204/24" : {
220 "interfaces" : [ {
221 "name" : "serverA-intf",
222 "ips" : [ "10.0.2.254/24", "10.0.4.254/24", "10.0.1.254/24" ],
223 "vlan-tagged" : [ 20, 40 ],
224 "vlan-native" : 10
225 }]
226 }
227 }
228 }
229
230Note that it is also necessary to configure the subnet/gateway IP corresponding
231to the native VLAN if you wish to route out of that VLAN.
232
233Configuring interface for IPv6
234^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
235
236It is similar to configure IPv6 routing. Simply replace the addresses in
237``ips`` with IPv6 addresses. For example:
238
239.. code-block:: json
240
241 {
242 "ports" : {
243 "of:0000000000000204/24" : {
244 "interfaces" : [ {
245 "name" : "serverA-intf",
246 "ips" : [ "10.0.2.254/24", "2000::1ff/120" ],
247 "vlan-tagged" : [ 20, 40 ]
248 }]
249 }
250 }
251 }
252
253.. note::
254 There is a known issue that breaks dynamic VLAN configuration.
255 Until the issue get resolved, you need to restart the switch agent to reinstall the flows.
256
257IPv6 Router Advertisement
258^^^^^^^^^^^^^^^^^^^^^^^^^
259
260Router Advertisement overview
261"""""""""""""""""""""""""""""
262
263Router advertisement application is for enabling **Router Advertisement** and
264**Router Solicitation** functionalities supported by IPv6 routers.
265
266More details are available in `RFC 4861 <https://tools.ietf.org/html/rfc4861>`_.
267
268Application identifies which IPv6 interfaces are currently configured in the
269system and it will try to send out **unsolicited Router Advertisement** (RA)
270messages from these interfaces.
271
272Each such RA message will have two mandatory options named **Source link-layer
273address** and **MTU**.
274
275Additional RA option **prefix** can be enabled using component configuration
276**raGlobalPrefixConfStatus**.
277
278Application also processes **Router Solicitations** (RS) sent from hosts. Upon
279receiving RS on a particular interface application stops RA transmission in
280that interface and immediately sends RA targeted to the solicited host. After
281that application continues unsolicited RA transmission on that interface.
282
283Activate and configure RA
284"""""""""""""""""""""""""
285
286RA application can be activated from CLI by running
287
288.. code-block:: console
289
290 onos> app activate routeradvertisement
291
292Behavior of RA application is controlled by ONOS component configuration
293subsystem and following are possible configuration options.
294
295- ``raThreadDelay``: Delay between consecutive RA transmissions
296
297- ``raPoolSize``: Capacity of thread pool to be used for RA transmissions
298
299- ``raFlagMbitStatus``: RA flag Managed address configuration
300 enabled/disabled
301
302- ``raFlagObitStatus``: RA flag Other configuration enabled/disabled
303
304- ``raOptionPrefixStatus``: RA Option prefix is enabled/disabled. Router
305 prefixes will be available in RA only if this flag is true
306
307- ``raGlobalPrefixConfStatus``: Enable switch level global prefix
308 configuration.
309 Once ``raGlobalPrefixConfStatus`` is enabled, RA prefix option is generated
310 from port configuration of device, see for more details.
311
312To set the options, following the command (example for ``raOptionPrefixStatus``)
313
314.. code-block:: console
315
316 onos> cfg set org.onosproject.ra.RouterAdvertisementManager raOptionPrefixStatus true
317
318Prefix details are picked up from network interface configuration.
319
320RA app will filter out link-local IPs while preparing prefixes.
321
322For example, in following configuration, Prefix will include only
323**2001:0558:FF10:04C9::2:1ff/120**.
324
325.. code-block:: json
326
327 {
328 "ports": {
329 "of:0000000000000018/16": {
330 "interfaces": [{
331 "ips": [ "192.168.114.1/24", "2001:0558:FF10:04C9::2:1ff/120", "FE80::4EA8:2AFF:FE24:8E5F/120" ],
332 "vlan-untagged": "11",
333 "name": "18-15"
334 }]
335 }
336 }
337 }
338
339Global prefix configuration
340"""""""""""""""""""""""""""
341
342In some cases, users may want to have a set of global prefix **advertised on
343all edge interfaces**.
344
345Such prefixes can be configured in **devices** section of network configuration
346in the following way.
347
348.. code-block:: json
349
350 {
351 "devices": {
352 "of:0000000000000018": {
353 "routeradvertisement" : {
354 "prefixes": [ "2001:0558:FF10:04C9::3:1ff/120"]
355 }
356 }
357 }
358 }
359
360.. note::
361 When global prefix is configured, RA app will ignore any prefixes
362 configured on switch interfaces.
363
364Notes about interface config
365^^^^^^^^^^^^^^^^^^^^^^^^^^^^
366
367There is no need to configure ports on switches that are meant to connect to
368other switches.
369
370The VLAN (untagged or tagged) configuration is only meant for ports that are
371connected to hosts (edge ports).
372
373.. image:: ../images/config-vlan.png
374
375Furthermore, note that the same VLAN can be configured on multiple ToRs - e.g.
376VLAN 20 in the figure above.
377
378However this does not mean that the ports are in the same bridging domain,
379because in the fabric, the communication between ToRs is through a routed
380network.
381
382In other words, a host on VLAN 20 (untagged or tagged) connected to one ToR can
383communicate with another host on VLAN 20 (untagged or tagged) connected to a
384different ToR, but the MAC addresses will change as the traffic goes through a
385routed network.
386
387Please do not use this feature to connect switches in unsupported topologies as
388shown in the example below.
389
390The fabric is not designed to be one big Ethernet fabric. The bridging domain
391is restricted to within one ToR.
392
393If the bridging domain is extended across two ToRs directly linked to each
394other, there is a chance of loops.
395
396In other words, the ToRs/Leafs are not standalone 802.1Q bridges, and should
397not be used as such.
398
399.. image:: ../images/config-vlan-invalid.png