blob: d5f5e104dcedd132f2305e1660304161697703f2 [file] [log] [blame]
Charles Chan9e5c6172019-09-07 11:24:54 -07001Bridging and Unicast Routing
2============================
3
Charles Chan33bac082019-09-12 01:07:51 -07004.. attention::
Charles Chan4ade88d2019-09-16 16:30:31 -07005 - VLAN **4090** is reserved for :doc:`pseudowire <pseudowire>` transport
Charles Chan33bac082019-09-12 01:07:51 -07006 - VLAN **4094** is reserved for unconfigured ports (e.g. spine facing ports)
7
Charles Chan9e5c6172019-09-07 11:24:54 -07008Access Ports
9------------
Zack Williamsd63d35b2020-06-23 14:12:46 -070010
Charles Chan9e5c6172019-09-07 11:24:54 -070011The necessary but minimum configuration for an access port is simply a VLAN.
12
13.. code-block:: json
Charles Chan9e5c6172019-09-07 11:24:54 -070014
15 {
16 "ports" : {
17 "of:0000000000000204/12" : {
18 "interfaces" : [{
19 "name" : "serverA-intf",
20 "vlan-untagged": 10
21 }]
22 },
23 "of:0000000000000204/16" : {
24 "interfaces" : [{
25 "name" : "serverB-intf",
26 "vlan-untagged": 10
27 }]
28 }
29 }
30 }
31
Zack Williamsd63d35b2020-06-23 14:12:46 -070032The example above shows two ports (12 and 16) on switch ``of:204`` that have
33been assigned to VLAN 10 using the ``vlan-untagged`` keyword.
34
Charles Chan9e5c6172019-09-07 11:24:54 -070035It simply means that packets come in and leave out of these switches untagged,
Zack Williamsd63d35b2020-06-23 14:12:46 -070036but internally they are assigned VLAN 10 and they belong to the bridging domain
37defined for VLAN 10.
Charles Chan9e5c6172019-09-07 11:24:54 -070038
Zack Williamsd63d35b2020-06-23 14:12:46 -070039``name`` is used to associate the interface with a globally unique, user
40friendly name. It can be omitted.
Charles Chan9e5c6172019-09-07 11:24:54 -070041
Zack Williamsd63d35b2020-06-23 14:12:46 -070042With the configuration shown above, the packets will always be bridged, but
43they cannot be routed out of the VLAN (e.g. to other subnets). To add the
44capability to route out of VLAN 10, we need to add a subnet/gateway IP (similar
45to `interface-vlans or SVIs in traditional networks
46<https://www.youtube.com/watch?v=bUXpmiJpGb0>`_).
Charles Chan9e5c6172019-09-07 11:24:54 -070047
48.. code-block:: json
Charles Chan9e5c6172019-09-07 11:24:54 -070049
50 {
51 "ports" : {
52 "of:0000000000000204/12" : {
53 "interfaces" : [{
54 "name" : "serverA-intf",
55 "ips" : [ "10.0.1.254/24"],
56 "vlan-untagged": 10
57 }]
58 },
59 "of:0000000000000204/16" : {
60 "interfaces" : [{
61 "name" : "serverB-intf",
62 "ips" : [ "10.0.1.254/24"],
63 "vlan-untagged": 10
64 }]
65 }
66 }
67 }
68
Zack Williamsd63d35b2020-06-23 14:12:46 -070069In this example, VLAN 10 is associated with subnet ``10.0.1.0/24``, and the
70gateway IP for hosts in this subnet is ``10.0.1.254/32``.
71
72When the desire is to route out of a VLAN, this assignment is currently
73necessary on all ports configured in the same VLAN.
Charles Chan9e5c6172019-09-07 11:24:54 -070074
75.. note::
Zack Williamsd63d35b2020-06-23 14:12:46 -070076 Typically we only expect a single subnet for a VLAN. Similar to traditional
77 networks, for us, a subnet == VLAN. Different VLANs should be configured in
78 different subnets.
79
80 In certain use-cases, it may be necessary to configure multiple subnets in
81 the same VLAN. This is possible by adding more subnet/gateway IPs in the
82 ``ips`` array.
Charles Chan9e5c6172019-09-07 11:24:54 -070083
Charles Chan33bac082019-09-12 01:07:51 -070084.. tip::
85 One subnet cannot be configured on multiple leaf switches.
Zack Williamsd63d35b2020-06-23 14:12:46 -070086
Charles Chan33bac082019-09-12 01:07:51 -070087 We usually configure one subnet for all the ports on the same leaf switch.
Charles Chan9e5c6172019-09-07 11:24:54 -070088
89Tagged Ports
90------------
91Tagged port configuration is similar.
92
93.. code-block:: json
Charles Chan9e5c6172019-09-07 11:24:54 -070094
95 {
96 "ports" : {
97 "of:0000000000000204/24" : {
98 "interfaces" : [{
99 "name" : "serverA-intf",
100 "ips" : [ "10.0.2.254/24", "10.0.4.254/24" ],
101 "vlan-tagged" : [ 20, 40 ]
102 }]
103 }
104 }
105 }
106
Zack Williamsd63d35b2020-06-23 14:12:46 -0700107The configuration above for port 24 on switch of:204 shows two VLANs 20 and 40
108configured on that port, with corresponding subnets and gateway IPs.
Charles Chan9e5c6172019-09-07 11:24:54 -0700109
Zack Williamsd63d35b2020-06-23 14:12:46 -0700110Note that there is no specific ordering required in the ``ips`` or
111``vlan-tagged`` arrays to correlate the VLANs to their corresponding subnets.
112
113In a future release, we will correlate VLAN and subnets configuration in a more
114readable way.
Charles Chan9e5c6172019-09-07 11:24:54 -0700115
116Native VLAN on Tagged Ports
117---------------------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700118
119An additional configuration ``vlan-native`` possible on tagged ports includes
120the ability to specify a VLAN (and thus a bridging domain) for incoming
121untagged packets.
122
123Typically, such configuration in trunk ports in traditional networks is
124referred to a native VLAN.
Charles Chan9e5c6172019-09-07 11:24:54 -0700125
126.. code-block:: json
Charles Chan9e5c6172019-09-07 11:24:54 -0700127
128 {
129 "ports" : {
130 "of:0000000000000204/24" : {
131 "interfaces" : [ {
132 "name" : "serverA-intf",
133 "ips" : [ "10.0.2.254/24", "10.0.4.254/24", "10.0.1.254/24" ],
134 "vlan-tagged" : [ 20, 40 ],
135 "vlan-native" : 10
136 }]
137 }
138 }
139 }
140
Zack Williamsd63d35b2020-06-23 14:12:46 -0700141Note that it is also necessary to configure the subnet/gateway IP corresponding
142to the native VLAN if you wish to route out of that VLAN.
Charles Chan9e5c6172019-09-07 11:24:54 -0700143
144Configuring interface for IPv6
145------------------------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700146
147It is similar to configure IPv6 routing. Simply replace the addresses in
148``ips`` with IPv6 addresses. For example:
Charles Chan9e5c6172019-09-07 11:24:54 -0700149
150.. code-block:: json
Charles Chan9e5c6172019-09-07 11:24:54 -0700151
152 {
153 "ports" : {
154 "of:0000000000000204/24" : {
155 "interfaces" : [ {
156 "name" : "serverA-intf",
157 "ips" : [ "10.0.2.254/24", "2000::1ff/120" ],
158 "vlan-tagged" : [ 20, 40 ]
159 }]
160 }
161 }
162 }
163
Charles Chanc65ac052020-08-05 11:58:07 -0700164.. note::
165 There is a known issue that breaks dynamic VLAN configuration.
166 Until the issue get resolved, you need to restart the switch agent to reinstall the flows.
Charles Chan9e5c6172019-09-07 11:24:54 -0700167
Charles Chan8d3ae672019-09-07 22:07:22 -0700168IPv6 Router Advertisement
169-------------------------
170
171Router Advertisement overview
172^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williamsd63d35b2020-06-23 14:12:46 -0700173
174Router advertisement application is for enabling **Router Advertisement** and
175**Router Solicitation** functionalities supported by IPv6 routers.
176
Charles Chan8d3ae672019-09-07 22:07:22 -0700177More details are available in `RFC 4861 <https://tools.ietf.org/html/rfc4861>`_.
178
Zack Williamsd63d35b2020-06-23 14:12:46 -0700179Application identifies which IPv6 interfaces are currently configured in the
180system and it will try to send out **unsolicited Router Advertisement** (RA)
181messages from these interfaces.
Charles Chan8d3ae672019-09-07 22:07:22 -0700182
Zack Williamsd63d35b2020-06-23 14:12:46 -0700183Each such RA message will have two mandatory options named **Source link-layer
184address** and **MTU**.
185
186Additional RA option **prefix** can be enabled using component configuration
187**raGlobalPrefixConfStatus**.
188
189Application also processes **Router Solicitations** (RS) sent from hosts. Upon
190receiving RS on a particular interface application stops RA transmission in
191that interface and immediately sends RA targeted to the solicited host. After
192that application continues unsolicited RA transmission on that interface.
Charles Chan8d3ae672019-09-07 22:07:22 -0700193
194Activate and configure RA
195^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williamsd63d35b2020-06-23 14:12:46 -0700196
Charles Chan8d3ae672019-09-07 22:07:22 -0700197RA application can be activated from CLI by running
198
199.. code-block:: console
200
201 onos> app activate routeradvertisement
202
Zack Williamsd63d35b2020-06-23 14:12:46 -0700203Behavior of RA application is controlled by ONOS component configuration
204subsystem and following are possible configuration options.
Charles Chan8d3ae672019-09-07 22:07:22 -0700205
206- ``raThreadDelay``: Delay between consecutive RA transmissions
Zack Williamsd63d35b2020-06-23 14:12:46 -0700207
Charles Chan8d3ae672019-09-07 22:07:22 -0700208- ``raPoolSize``: Capacity of thread pool to be used for RA transmissions
Zack Williamsd63d35b2020-06-23 14:12:46 -0700209
210- ``raFlagMbitStatus``: RA flag Managed address configuration
211 enabled/disabled
212
Charles Chan8d3ae672019-09-07 22:07:22 -0700213- ``raFlagObitStatus``: RA flag Other configuration enabled/disabled
Zack Williamsd63d35b2020-06-23 14:12:46 -0700214
215- ``raOptionPrefixStatus``: RA Option prefix is enabled/disabled. Router
216 prefixes will be available in RA only if this flag is true
217
218- ``raGlobalPrefixConfStatus``: Enable switch level global prefix
219 configuration.
220
221 Once raGlobalPrefixConfStatus is enabled, RA prefix option is generated
222 from port configuration of device, see for more details.
Charles Chan8d3ae672019-09-07 22:07:22 -0700223
Charles Chanc65ac052020-08-05 11:58:07 -0700224To set the options, following the command (example for raOptionPrefixStatus)
225
226.. code-block:: console
227
228 onos> cfg set org.onosproject.ra.RouterAdvertisementManager raOptionPrefixStatus true
229
Charles Chan8d3ae672019-09-07 22:07:22 -0700230Prefix details are picked up from network interface configuration.
Zack Williamsd63d35b2020-06-23 14:12:46 -0700231
Charles Chan8d3ae672019-09-07 22:07:22 -0700232RA app will filter out link-local IPs while preparing prefixes.
Zack Williamsd63d35b2020-06-23 14:12:46 -0700233
234For example, in following configuration, Prefix will include only
235**2001:0558:FF10:04C9::2:1ff/120**.
Charles Chan8d3ae672019-09-07 22:07:22 -0700236
237.. code-block:: json
238
239 {
240 "ports": {
241 "of:0000000000000018/16": {
242 "interfaces": [{
243 "ips": [ "192.168.114.1/24", "2001:0558:FF10:04C9::2:1ff/120", "FE80::4EA8:2AFF:FE24:8E5F/120" ],
244 "vlan-untagged": "11",
Charles Chanc65ac052020-08-05 11:58:07 -0700245 "name": "18-15"
Charles Chan8d3ae672019-09-07 22:07:22 -0700246 }]
247 }
248 }
249 }
250
251Global prefix configuration
252^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zack Williamsd63d35b2020-06-23 14:12:46 -0700253
254In some cases, users may want to have a set of global prefix **advertised on
255all edge interfaces**.
256
257Such prefixes can be configured in **devices** section of network configuration
258in the following way.
Charles Chan8d3ae672019-09-07 22:07:22 -0700259
260.. code-block:: json
261
262 {
263 "devices": {
264 "of:0000000000000018": {
265 "routeradvertisement" : {
266 "prefixes": [ "2001:0558:FF10:04C9::3:1ff/120"]
267 }
268 }
269 }
270 }
271
272.. note::
Zack Williamsd63d35b2020-06-23 14:12:46 -0700273 When global prefix is configured, RA app will ignore any prefixes
274 configured on switch interfaces.
Charles Chan8d3ae672019-09-07 22:07:22 -0700275
276Notes about interface config
277----------------------------
Zack Williamsd63d35b2020-06-23 14:12:46 -0700278
279There is no need to configure ports on switches that are meant to connect to
280other switches.
281
282The VLAN (untagged or tagged) configuration is only meant for ports that are
283connected to hosts (edge ports).
Charles Chan9e5c6172019-09-07 11:24:54 -0700284
Charles Chan20fabfb2019-09-07 11:24:54 -0700285.. image:: ../images/config-vlan.png
Charles Chan9e5c6172019-09-07 11:24:54 -0700286
Zack Williamsd63d35b2020-06-23 14:12:46 -0700287Furthermore, note that the same VLAN can be configured on multiple ToRs - e.g.
288vlan 20 in the figure above.
Charles Chan9e5c6172019-09-07 11:24:54 -0700289
Zack Williamsd63d35b2020-06-23 14:12:46 -0700290However this does not mean that the ports are in the same bridging domain,
291because in the fabric, the communication between ToRs is through a routed
292network.
293
294In other words, a host on VLAN 20 (untagged or tagged) connected to one ToR can
295communicate with another host on VLAN 20 (untagged or tagged) connected to a
296different ToR, but the MAC addresses will change as the traffic goes through a
297routed network.
298
299Please do not use this feature to connect switches in unsupported topologies as
300shown in the example below.
301
302The fabric is not designed to be one big Ethernet fabric. The bridging domain
303is restricted to within one ToR.
304
305If the bridging domain is extended across two ToRs directly linked to each
306other, there is a chance of loops.
307
308In other words, the ToRs/Leafs are not standalone 802.1Q bridges, and should
309not be used as such.
Charles Chan9e5c6172019-09-07 11:24:54 -0700310
Charles Chan20fabfb2019-09-07 11:24:54 -0700311.. image:: ../images/config-vlan-invalid.png