2 .. contents:: Table of Contents
9 https://git.opendaylight.org/gerrit/#/q/topic:of-tunnels
11 OF Tunnels feature adds support for flow based tunnels to allow
12 scalable overlay tunnels.
17 Today when tunnel interfaces are created, InterFaceManager [IFM] creates one
18 OVS port for each tunnel interface i.e. source-destination pair. For N devices
19 in a TransportZone this translates to N*(N-1) tunnel ports created across all
20 devices and N-1 ports in each device. This has obvious scale limitations.
24 This feature will support following use cases:
26 * Use case 1: Allow user to specify if they want to use flow based tunnels at
27 the time of configuration.
28 * Use case 2: Create single OVS Tunnel Interface if flow based tunnels are
29 configured and this is the first tunnel on this device/tep.
30 * Use case 3: Flow based and non flow based tunnels should be able to exist
31 in a given transport zone.
32 * Use case 4: On tep delete, if this is the last tunnel interface on this
33 tep/device and it is flow based tunnel, delete the OVS Tunnel Interface.
35 Following use cases will not be supported:
37 * Configuration of flow based and non-flow based tunnels of same type on the same device.
38 OVS requires one of the following: ``remote_ip``, ``local_ip``, ``type`` and ``key`` to
39 be unique. Currently we don't support multiple local_ip and key is always set to flow.
40 So ``remote_ip`` and ``type`` are the only unique identifiers. ``remote_ip=flow``
41 is a super set of ``remote_ip=<fixed-ip>`` and we can't have two interfaces with
42 all other fields same except this.
43 * Changing tunnel from one flow based to non-flow based at runtime. Such a
44 change will require deletion and addition of tep. This is inline with
45 existing model where tunnel-type cannot be changed at runtime.
46 * Configuration of Source IP for tunnel through flow. It will still be fixed. Though we're
47 adding option in IFM YANG for this, implementation for it won't be done till we get
52 ``OVS 2.0.0`` onwards allows configuration of flow based tunnels through
53 interface ``option:remote_ip=flow``. Currently this field is set to
54 IP address of the destination endpoint.
56 ``remote_ip=flow`` means tunnel destination IP will be set by an OpenFlow
57 action. This allows us to add different actions for different destinations
58 using the single OVS/OF port.
60 This change will add optional parameters to ITM and IFM YANG files to allow
61 OF Tunnels. Based on this option, ITM will configure IFM which in turn will
62 create tunnel ports in OVSDB.
66 OVSDB Plugin provides following field in Interface to configure options:
72 description "Port/Interface related optional input values";
75 description "Option name";
79 description "Option value";
83 For flow based tunnels we will set option name ``remote_ip`` to
88 Following new actions will be added to ``mdsalutil/ActionType.java``
93 Following new matches will be added to ``mdsalutil/NxMatchFieldType.java``
100 This change adds a new match in **Table0**. Today we match in ``in_port``
101 to determine which tunnel interface this pkt came in on. Since currently
102 each tunnel maps to a source-destination pair it tells us about source device.
103 For interfaces configured to use flow based tunnels this will add an
104 additional match for ``tun_src_ip``. So, ``in_port+tunnel_src_ip`` will
105 give us which tunnel interface this pkt belongs to.
107 When services call ``getEgressActions(), they will get one additional action,
108 ``set_tunnel_dest_ip`` before the ``output:ofport`` action.
112 Changes will be needed in ``itm.yang`` and ``odl-interface.yang`` to allow
113 configuring a tunnel as flow based or not.
117 A new parameter ``option-of-tunnel`` will be added to ``list-vteps``
121 :emphasize-lines: 12-15
124 key "dpn-id portname";
132 type inet:ip-address;
134 leaf option-of-tunnel {
140 Same parameter will also be added to ``tunnel-end-points`` in ``itm-state.yang``.
141 This will help eliminate need to retrieve information from TransportZones when configuring
145 :caption: itm-state.yang
146 :emphasize-lines: 11-14
148 list tunnel-end-points {
150 key "portname VLAN-ID ip-address tunnel-type";
151 /* Multiple tunnels on the same physical port but on different VLAN can be supported */
158 leaf option-of-tunnel {
165 This will allow to set OF Tunnels on per VTEP basis. So in a transport-zone
166 we can have some VTEPs (devices) that use OF Tunnels and others that don't.
167 Default of false means it will not impact existing behavior and will need to
168 be explicitly configured. Going forward we can choose to set default true.
172 We'll add a new ``tunnel-optional-params`` and add them to ``iftunnel``
175 :caption: odl-interface.yang
176 :emphasize-lines: 1-23
178 grouping tunnel-optional-params {
179 leaf tunnel-source-ip-flow {
184 leaf tunnel-remote-ip-flow {
189 list tunnel-options {
192 description "Tunnel Option name";
196 description "Option value";
202 The ``list tunnel-options`` is a list of key-value pairs of strings, similar to
203 options in OVSDB Plugin. These are not needed for OF Tunnels but is being added
204 to allow user to configure any other Interface options that OVS supports. Aim is to
205 enable developers and users try out newer options supported by OVS without needing to
206 add explicit support for it. Note that there is no counterpart for this option in
207 ``itm.yang``. Any options that we want to explicitly support will be added as a separate
208 option. This will allow us to do better validations for options that are needed for
209 our specific use cases.
215 augment "/if:interfaces/if:interface" {
216 ext:augment-identifier "if-tunnel";
217 when "if:type = 'ianaift:tunnel'";
220 uses tunnel-optional-params;
230 #. User: While adding tep user gives ``option-of-tunnel:true`` for tep being
232 #. ITM: When creating tunnel interfaces for this tep, if
233 ``option-of-tunnel:true``, set ``tunnel-remote-ip:true`` for the tunnel
235 #. IFM: If ``option-of-tunnel:true`` and this is first tunne on this device,
236 set ``option:remote_ip=flow`` when creating tunnel interface in OVSDB. Else,
237 set ``option:remote_ip=<destination-ip>``.
242 #. If ``tunnel-remote-ip:true`` and this is *last* tunnel on this device,
243 delete tunnel port in OVSDB. Else, do nothing.
244 #. If ``tunnel-remote-ip:false``, follow existing logic.
247 ---------------------
248 This change doesn't add or modify any configuration parameters.
250 Clustering considerations
251 -------------------------
252 Any clustering requirements are already addressed in ITM and IFM, no new
253 requirements added as part of this feature.
255 Other Infra considerations
256 --------------------------
259 Security considerations
260 -----------------------
263 Scale and Performance Impact
264 ----------------------------
265 This solution will help improve scale numbers by reducing no. of interfaces
266 created on devices as well as no. of interfaces and ports present in
267 ``inventory`` and ``network-topology``.
276 BFD monitoring will not work when OF Tunnels are used. Today BFD monitoring in
277 OVS relies on destination_ip configured in remote_ip when creating tunnel port
278 to determine target IP for BFD packets. If we use ``flow`` it won't know where
279 to send BFD packets. Unless OVS allows adding destination IP for BFD monitoring
280 on such tunnels, monitoring cannot be enabled.
284 LLDP/ARP based monitoring was considered for OF tunnels to overcome lack of BFD
285 monitoring but was rejected because LLDP/ARP based monitoring doesn't scale
286 well. Since driving requirement for this feature is scale setups, it didn't
287 make sense to use an unscalable solution for monitoring.
289 XML/CFG file based global knob to enable OF tunnels for all tunnel interfaces
290 was rejected due to inflexible nature of such a solution. Current solution
291 allows a more fine grained and device based configuration at runtime. Also,
292 wanted to avoid adding yet another global configuration knob.
299 This feature doesn't add any new karaf feature.
304 Adding TEPs to transport zone
305 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
307 For most users TEP Addition is the only configuration they need to do to create
308 tunnels using genius. The REST API to add TEPs with OF Tunnels is same as earlier
309 with one small addition.
311 **URL:** restconf/config/itm:transport-zones/
324 "prefix": "192.168.56.0/24",
330 "ip-address": "192.168.56.101",
331 "option-of-tunnel":"true"
334 "gateway-ip": "0.0.0.0"
337 "tunnel-type": "odl-interface:tunnel-type-vxlan"
343 Creating tunnel-interface directly in IFM
344 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
346 This use case is mainly for those who want to write applications using Genius and/or
347 want to create individual tunnel interfaces. Note that this is a simpler easy way to
348 create tunnels without needing to delve into how OVSDB Plugin creates tunnels.
350 Refer `Genius User Guide <http://docs.opendaylight.org/en/latest/user-guide/genius-user-guide.html#creating-overlay-tunnel-interfaces>`__
351 for more details on this.
353 **URL:** restconf/config/ietf-interfaces:interfaces
364 "name": "vxlan_tunnel",
365 "type": "iana-if-type:tunnel",
366 "odl-interface:tunnel-interface-type": "odl-interface:tunnel-type-vxlan",
367 "odl-interface:datapath-node-identifier": "1",
368 "odl-interface:tunnel-source": "192.168.56.101",
369 "odl-interface:tunnel-destination": "192.168.56.102",
370 "odl-interface:tunnel-remote-ip-flow": "true",
371 "odl-interface:monitor-enabled": false,
372 "odl-interface:monitor-interval": 10000,
383 A new boolean option, ``remoteIpFlow`` will be added to ``tep:add`` command.
386 :emphasize-lines: 7,24-25
390 adding a tunnel end point
393 tep:add [dpnId] [portNo] [vlanId] [ipAddress] [subnetMask] [gatewayIp] [transportZone]
412 Use flow for remote ip
424 <Vacancies available>
430 #. Add relevant match and actions to MDSALUtil
431 #. Add ``set_tunnel_dest_ip`` action to actions returned in
432 ``getEgressActions()`` for OF Tunnels.
433 #. Add match on ``tun_src_ip`` in **Table0** for OF Tunnels.
442 This doesn't add any new dependencies. This requires minimum of ``OVS 2.0.0``
443 which is already lower than required by some of other features.
445 This change is backwards compatible, so no impact on dependent projects.
446 Projects can choose to start using this when they want. However, there is a
447 known limitation with monitoring, refer Limitations section for details.
449 Following projects currently depend on Genius:
459 Appropriate UTs will be added for the new code coming in once framework is in place.
463 Integration tests will be added once IT framework for ITM and IFM is ready.
467 CSIT already has test cases for tunnels which test with non OF Tunnels. Similar test
468 cases will be added for OF Tunnels. Alternatively, some of the existing test cases
469 that use multiple teps can be tweaked to use OF Tunnels for one of them.
471 Following test cases will need to be added/expanded in Genius CSIT:
473 #. Create a TZ with more than one TEPs set to use OF Tunnels and test datapath.
474 #. Create a TZ with mix of OF and non OF Tunnels and test datapath.
475 #. Delete a TEP using OF Tunnels and add it again with non OF tunnels and test
477 #. Delete a TEP using non OF Tunnels and add it again with OF Tunnels and test
482 This will require changes to User Guide and Developer Guide.
484 User Guide will need to add information on how to add TEPs with flow based
487 Developer Guide will need to capture how to use changes in IFM to create
488 individual tunnel interfaces.
493 * https://wiki.opendaylight.org/view/Genius:Carbon_Release_Plan