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