Of Tunnel creation Oper Implementation
[genius.git] / docs / ITM-design.rst
1 ================================
2 Internal Transport Manager (ITM)
3 ================================
4
5 Internal Transport Manager creates and maintains mesh of tunnels of
6 type VXLAN or GRE between Openflow switches forming an overlay
7 transport network. ITM also builds external tunnels towards DC
8 Gateway. ITM does not provide redundant tunnel support.
9
10 The diagram below gives a pictorial representation of the different
11 modules and data stores and their interactions.
12
13 .. image:: https://wiki.opendaylight.org/images/1/12/ITM_top_lvl.png
14
15
16 ITM Dependencies
17 ================
18 ITM mainly interacts with following other genius modules-
19
20 #. **Interface Manager** – For creating tunnel interfaces
21 #. **Aliveness Monitor** - For monitoring the tunnel interfaces
22 #. **MdSalUtil** – For openflow operations
23
24
25 Following picture shows interface manager dependencies
26
27 .. graphviz:: images/itm_dep.dot
28
29 Code Structure
30 ==============
31 As shown in the diagram, ITM has a common placeholder for various
32 datastore listeners, RPC implementation, config helpers. Config
33 helpers are responsible for creating / delete of Internal and
34 external tunnel.
35
36 .. image:: https://wiki.opendaylight.org/images/c/c3/Itmcodestructure.png
37
38 ITM Data Model
39 ==============
40
41 ITM uses the following data model to create and manage tunnel interfaces
42 Tunnels interfces are created by writing to Interface Manager’s Config DS.
43
44 itm.yang
45 ---------
46 follwoing datamodel is defined in `itm.yang <https://github.com/opendaylight/genius/blob/master/itm/itm-api/src/main/yang/itm.yang>`__
47 This DS stores the transport zone information populated through REST or Karaf CLI
48
49 |image33|
50
51 Itm-state.yang
52 --------------
53
54 This DS stores the tunnel end point information populated through
55 REST or Karaf CLI. The internal and external tunnel interfaces are
56 also stored here.
57
58 \ |image34|
59
60 Itm-rpc.yang
61 ------------
62
63 This Yang defines all the RPCs provided by ITM.
64
65 |image35|
66
67 Itm-config.yang
68 ~~~~~~~~~~~~~~~
69
70 |image36|
71
72 ITM Design
73 ==========
74
75 ITM uses the datastore job coordinator module for all its operations.
76
77 .. toctree::
78    :maxdepth: 1
79
80    datastore-job-coordinator
81
82 When tunnel end point are configured in ITM datastores by CLI or
83 REST, corresponding DTCNs are fired. ITM TransportZoneListener
84 listens to the . Based on the add/remove end point operation,
85 the transport zone listener queues the approporiate job ( ItmInternalTunnelAddWorker or
86 ItmInternalTunnelDeleteWorker) to the DataStoreJob Coordinator. Jobs
87 within transport zones are queued to be executed serially and jobs
88 across transport zones are done parallel.
89
90 Tunnel Building Logic
91 ---------------------
92
93 ITM will iterate over all the tunnel end points in each of the transport
94 zones and build the tunnels between every pair of tunnel end points in
95 the given transport zone. The type of the tunnel (GRE/VXLAN) will be
96 indicated in the YANG model as part of the transport zone.
97
98
99 ITM Operations
100 --------------
101
102     ITM builds the tunnel infrastructure and maintains them. ITM builds
103     two types of tunnels namely, internal tunnels between openflow
104     switches and external tunnels between openflow switches and an
105     external device such as datacenter gateway. These tunnels can be
106     Vxlan or GRE. The tunnel endpoints are configured using either
107     individual endpoint configuration or scheme based auto configuration
108     method or REST. ITM will iterate over all the tunnel end points in
109     each of the transport zones and build the tunnels between every pair
110     of tunnel end points in the given transport zone.
111
112 -  ITM creates tunnel interfaces in Interface manager Config DS.
113
114 -  Stores the tunnel mesh information in tunnel end point format in ITM
115    config DS
116
117 -  ITM stores the internal and external trunk interface names in
118    itm-state yang
119
120 -  Creates external tunnels to DC Gateway when VPN manager calls the
121    RPCs for creating tunnels towards DC gateway.
122
123    ITM depends on interface manager for the following functionality.
124
125 -  Provides interface to create tunnel interfaces
126
127 -  Provides configuration option to enable monitoring on tunnel
128    interfaces.
129
130 -  Registers tunnel interfaces with monitoring enabled with
131    alivenessmonitor.
132
133    ITM depends on Aliveness monitor for the following functionality.
134
135 -  Tunnel states for trunk interfaces are updated by alivenessmonitor.
136    Sets OperState for tunnel interfaces
137
138 RPCs
139 ----
140
141 The following are the RPCs supported by ITM
142
143 Get-tunnel-interface-id RPC
144 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
145
146 |image37|
147
148 Get-internal-or-external-interface-name
149 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150
151 |image38|
152
153 Get-external-tunnel-interface-name
154 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
155
156 |image39|
157
158 Build-external-tunnel-from-dpns
159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160
161 |image40|
162
163 Add-external-tunnel-endpoint
164 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
165
166 |image41|
167
168 Remove-external-tunnel-from-dpns
169 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170
171 |image42|
172
173 Remove-external-tunnel-endpoint
174 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
175
176 |image43|
177
178 Create-terminating-service-actions
179 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180
181 |image44|
182
183 Remove-terminating-service-actions
184 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
185
186 |image45|