Charles Chan | 2caff7b | 2021-10-11 20:25:16 -0700 | [diff] [blame^] | 1 | .. _onos_network_config: |
| 2 | |
Charles Chan | caebcf3 | 2021-09-20 22:17:52 -0700 | [diff] [blame] | 3 | Network Configuration |
| 4 | ===================== |
Wailok Shum | 2f05cd3 | 2021-09-30 22:18:19 +0800 | [diff] [blame] | 5 | SD-Fabric uses several different types of network configurations. |
| 6 | We only focus on ``devices`` and ``ports`` configuration in this section. |
| 7 | With these configured properly, SD-Fabric can provide basic L2/L3 connectivity. |
| 8 | |
| 9 | See :ref:`advanced-features` for advanced feature configurations. |
| 10 | |
| 11 | Device Configuration |
| 12 | -------------------- |
| 13 | Each 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 | |
| 91 | Bridging and Unicast Routing |
| 92 | ---------------------------- |
| 93 | |
| 94 | .. attention:: |
| 95 | - VLAN **4094** is reserved for unconfigured ports (e.g. spine facing ports) |
| 96 | |
| 97 | Access Ports |
| 98 | ^^^^^^^^^^^^ |
| 99 | |
| 100 | The 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 | |
| 121 | The example above shows two ports (12 and 16) on switch ``of:204`` that have |
| 122 | been assigned to VLAN 10 using the ``vlan-untagged`` keyword. |
| 123 | |
| 124 | It simply means that packets come in and leave out of these switches untagged, |
| 125 | but internally they are assigned VLAN 10 and they belong to the bridging domain |
| 126 | defined for VLAN 10. |
| 127 | |
| 128 | ``name`` is used to associate the interface with a globally unique, user |
| 129 | friendly name. It can be omitted. |
| 130 | |
| 131 | With the configuration shown above, the packets will always be bridged, but |
| 132 | they cannot be routed out of the VLAN (e.g. to other subnets). To add the |
| 133 | capability to route out of VLAN 10, we need to add a subnet/gateway IP (similar |
| 134 | to `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 | |
| 158 | In this example, VLAN 10 is associated with subnet ``10.0.1.0/24``, and the |
| 159 | gateway IP for hosts in this subnet is ``10.0.1.254/32``. |
| 160 | |
| 161 | When the desire is to route out of a VLAN, this assignment is currently |
| 162 | necessary 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 | |
| 178 | Tagged Ports |
| 179 | ^^^^^^^^^^^^ |
| 180 | Tagged 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 | |
| 196 | The configuration above for port 24 on switch of:204 shows two VLANs 20 and 40 |
| 197 | configured on that port, with corresponding subnets and gateway IPs. |
| 198 | |
| 199 | Note that there is no specific ordering required in the ``ips`` or |
| 200 | ``vlan-tagged`` arrays to correlate the VLANs to their corresponding subnets. |
| 201 | |
| 202 | In a future release, we will correlate VLAN and subnets configuration in a more |
| 203 | readable way. |
| 204 | |
| 205 | Native VLAN on Tagged Ports |
| 206 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 207 | |
| 208 | An additional configuration ``vlan-native`` possible on tagged ports includes |
| 209 | the ability to specify a VLAN (and thus a bridging domain) for incoming |
| 210 | untagged packets. |
| 211 | |
| 212 | Typically, such configuration in trunk ports in traditional networks is |
| 213 | referred 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 | |
| 230 | Note that it is also necessary to configure the subnet/gateway IP corresponding |
| 231 | to the native VLAN if you wish to route out of that VLAN. |
| 232 | |
| 233 | Configuring interface for IPv6 |
| 234 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 235 | |
| 236 | It 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 | |
| 257 | IPv6 Router Advertisement |
| 258 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 259 | |
| 260 | Router Advertisement overview |
| 261 | """"""""""""""""""""""""""""" |
| 262 | |
| 263 | Router advertisement application is for enabling **Router Advertisement** and |
| 264 | **Router Solicitation** functionalities supported by IPv6 routers. |
| 265 | |
| 266 | More details are available in `RFC 4861 <https://tools.ietf.org/html/rfc4861>`_. |
| 267 | |
| 268 | Application identifies which IPv6 interfaces are currently configured in the |
| 269 | system and it will try to send out **unsolicited Router Advertisement** (RA) |
| 270 | messages from these interfaces. |
| 271 | |
| 272 | Each such RA message will have two mandatory options named **Source link-layer |
| 273 | address** and **MTU**. |
| 274 | |
| 275 | Additional RA option **prefix** can be enabled using component configuration |
| 276 | **raGlobalPrefixConfStatus**. |
| 277 | |
| 278 | Application also processes **Router Solicitations** (RS) sent from hosts. Upon |
| 279 | receiving RS on a particular interface application stops RA transmission in |
| 280 | that interface and immediately sends RA targeted to the solicited host. After |
| 281 | that application continues unsolicited RA transmission on that interface. |
| 282 | |
| 283 | Activate and configure RA |
| 284 | """"""""""""""""""""""""" |
| 285 | |
| 286 | RA application can be activated from CLI by running |
| 287 | |
| 288 | .. code-block:: console |
| 289 | |
| 290 | onos> app activate routeradvertisement |
| 291 | |
| 292 | Behavior of RA application is controlled by ONOS component configuration |
| 293 | subsystem 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 | |
| 312 | To 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 | |
| 318 | Prefix details are picked up from network interface configuration. |
| 319 | |
| 320 | RA app will filter out link-local IPs while preparing prefixes. |
| 321 | |
| 322 | For 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 | |
| 339 | Global prefix configuration |
| 340 | """"""""""""""""""""""""""" |
| 341 | |
| 342 | In some cases, users may want to have a set of global prefix **advertised on |
| 343 | all edge interfaces**. |
| 344 | |
| 345 | Such prefixes can be configured in **devices** section of network configuration |
| 346 | in 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 | |
| 364 | Notes about interface config |
| 365 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 366 | |
| 367 | There is no need to configure ports on switches that are meant to connect to |
| 368 | other switches. |
| 369 | |
| 370 | The VLAN (untagged or tagged) configuration is only meant for ports that are |
| 371 | connected to hosts (edge ports). |
| 372 | |
| 373 | .. image:: ../images/config-vlan.png |
| 374 | |
| 375 | Furthermore, note that the same VLAN can be configured on multiple ToRs - e.g. |
| 376 | VLAN 20 in the figure above. |
| 377 | |
| 378 | However this does not mean that the ports are in the same bridging domain, |
| 379 | because in the fabric, the communication between ToRs is through a routed |
| 380 | network. |
| 381 | |
| 382 | In other words, a host on VLAN 20 (untagged or tagged) connected to one ToR can |
| 383 | communicate with another host on VLAN 20 (untagged or tagged) connected to a |
| 384 | different ToR, but the MAC addresses will change as the traffic goes through a |
| 385 | routed network. |
| 386 | |
| 387 | Please do not use this feature to connect switches in unsupported topologies as |
| 388 | shown in the example below. |
| 389 | |
| 390 | The fabric is not designed to be one big Ethernet fabric. The bridging domain |
| 391 | is restricted to within one ToR. |
| 392 | |
| 393 | If the bridging domain is extended across two ToRs directly linked to each |
| 394 | other, there is a chance of loops. |
| 395 | |
| 396 | In other words, the ToRs/Leafs are not standalone 802.1Q bridges, and should |
| 397 | not be used as such. |
| 398 | |
| 399 | .. image:: ../images/config-vlan-invalid.png |