Added OVSDB doc outline for M3.
[docs.git] / manuals / developer-guide / src / main / asciidoc / vtn.adoc
1 === Virtual Tenant Network (VTN)
2
3 ==== OpenDaylight Virtual Tenant Network (VTN) Overview
4
5 OpenDaylight Virtual Tenant Network (VTN) is an application that provides multi-tenant virtual network on an SDN controller.
6
7 Conventionally, huge investment in the network systems and operating expenses are needed because the network is configured as a silo for each department and system. Therefore various network appliances must be installed for each tenant and those boxes cannot be shared with others. It is a heavy work to design, implement and operate the entire complex network.
8 The uniqueness of VTN is a logical abstraction plane. This enables the complete separation of logical plane from physical plane. Users can design and deploy any desired network without knowing the physical network topology or bandwidth restrictions.
9 VTN allows the users to define the network with a look and feel of conventional L2/L3 network. Once the network is designed on VTN, it will automatically be mapped into underlying physical network, and then configured on the individual switch leveraging SDN control protocol. The definition of logical plane makes it possible not only to hide the complexity of the underlying network but also to better manage network resources. It achieves reducing reconfiguration time of network services and minimizing network configuration errors.OpenDaylight Virtual Tenant Network (VTN) is an application that provides multi-tenant virtual network on an SDN controller. It provides API for creating a common virtual network irrespective of the physical network.
10
11 It is implemented as two major components
12
13 * <<_vtn_coordinator>>
14 * <<_vtn_manager>>
15
16 .VTN Architecture
17 image::vtn/vtn-overview.png[]
18
19 ===== VTN Coordinator
20
21 The VTN coordinator is an external application that provides a REST interface to user to use the VTN Virtualization. It interacts with VTN Manager plugin to implement the user configuration. It is also capable of multiple controller orchestration.realizes Virtual Tenant Network (VTN) provisioning in OpenDaylight Controllers (ODC). In the OpenDaylight architecture VTN Coordinator is part of the network application, orchestration and services layer. VTN Co ordinator has been implemented as an external application to the OpenDaylight controller. This component is responsible for the VTN virtualization. VTN Coordinator will use the REST interface exposed by the VTN Manger to realize the virtual network using the OpenDaylight controller. It uses OpenDaylight APIs (REST) to construct the virtual network in ODCs. It provides REST APIs for northbound VTN applications and supports virtual networks spanning across multiple ODCs by coordinating across ODCs.
22
23 .VTN Coordinator Architecture
24 image::vtn/vtn-coordinator-architecture.png[]
25
26 VTN Co ordinator has the following components:
27
28 * VTN API - VTN Web API module provides the north bound REST API interface for VTN applications. For more information about VTN API, see <<_vtn_service_java_api_library>>.
29 * Transaction Co ordinator(TC) - The TC module is a two Phase commit coordinator module that provides the two phase commit coordination functionality for VTN coordinator components.
30 * Unified Provider Physical Layer (UPPL) - The UPPL module is a physical network provisioning/monitoring module. This module is a sub component of the VTN coordinator and provides the physical network provisioning and monitoring functionality.
31 * Unified Provider Logical Layer (UPLL) - The UPLL is a virtual network provisioning/monitoring module. This module is a a sub component of the VTN coordinator and provides the Virtual network provisioning and monitoring functionality.
32 * OpenDaylight Controller Driver (ODC Driver) - The OpenDaylight controller interface Module is a sub component of the VTN coordinator and provides mechanisms to provision and monitor virtual networks in the OpenDaylight controller.
33
34 ====== Communication Framework
35
36 You could communication with and from the VTN using the following: +
37
38 * *Internal communication*
39
40 ** Proprietary IPC framework
41
42 * *External communication*
43
44 ** North Bound – REST API
45 ** South Bound – OpenDaylight API
46
47 ===== VTN Manager
48 A OpenDayLight Controller Plugin that interacts with other modules to implement the components of the VTN model. It also provides a REST interface to configure VTN components in ODL controller.VTN Manager is implemented as one plugin to the OpenDayLight controller. This provides a REST interface to create/update/delete VTN components. The user command in VTN Coordinator is translated as REST API to VTN Manager by the ODC Driver component. In addition to the above mentioned role, it also provides an implementation to the Openstack L2 Network Functions API.
49
50 .VTN Manager Architecture
51 image::vtn/vtn-manager-architecture.png[]
52
53 ====== Function Outline
54
55 The table identifies the functions and the interface used by VTN Components:
56
57 [options="header"]
58 |===
59 | Component | Interface | Purpose
60 | VTN Manager |RESTful API | Configure VTN Virtualization model components in OpenDayLight
61 | VTN Manager | Neutron API implementation | Handle Networks API from OpenStack (Neutron Interface)
62 | VTN Co ordinator | RESTful API |
63 (1) Uses the Restful interface of VTN Manager and configures VTN Virtualization model components in OpenDayLight. +
64 (2) Handles multiple controller orchestration. +
65 (3) Provides API to read the physical network details. See https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):VTN_Coordinator:RestApi:L2_Network_Example_Using_VTN_Virtualization[samples] for usage.
66 --
67 |===
68
69 ===== OpenDaylight Virtual Tenant Network (VTN) API Overview
70
71 The VTN API module is a sub component of the VTN coordinator and provides the north bound REST API interface for VTN applications It consists of two subcomponents:
72
73 * <<_web_server>>
74 * <<_vtn_service_java_api_library>>
75
76 .VTN Coordinator Architecture
77 image::vtn/vtn-coordinator-api-architecture.png[]
78
79 ====== Web Server
80
81 The Web Server module handles the REST APIs received from the VTN applications. It translates the REST APIs to the appropriate Java APIs.
82
83 The main functions of this module are:
84
85 * Starts via the startup script catalina.sh.
86 * VTN Application sends HTTP request to Web server in XML or JSON format.
87 * Creates a session and acquire a read/write lock.
88 * Invokes the <<_vtn_service_java_api_library>> corresponding to the specified URI.
89 * Returns the response to the VTN Application.
90
91 *WebServer Class Details*
92
93 The table below lists the classes available for Web Server module and its descriptions:
94
95 [options="header"]
96 |===
97 | Class Name | Description
98 | InitManager |It is a singleton class for executing the acquisition of configuration information from properties file, log initialization, initialization of <<_vtn_service_java_api_library>>. +
99 Executed by init() of VtnServiceWebAPIServlet.
100 | ConfigurationManager | Maintains the configuration information acquired from properties file.
101 | VtnServiceCommonUtil | Utility class
102 | VtnServiceWebUtil | Utility class
103 | VtnServiceWebAPIServlet | Receives HTTP request from VTN Application and calls the method of corresponding VtnServiceWebAPIHandler. +
104 Inherits class HttpServlet, and overrides doGet(), doPut(), doDelete(), doPost().
105 | VtnServiceWebAPIHandler | Creates JsonObject(com.google.gson) from HTTP request, and calls method of corresponding VtnServiceWebAPIController.
106 | VtnServiceWebAPIController | Creates RestResource() class and calls UPLL API/UPPL API through Java API.
107 At the time of calling UPLL API/UPPL API, performs the creation/deletion of session, acquisition/release of configuration mode, acquisition/release of read lock by TC API through Java API.
108 | DataConverter | Converts  HTTP request to JsonObject and JsonXML to JSON. |
109 |===
110
111 ====== VTN Service Java API Library
112
113 It provides the Java API library to communicate with the lower layer modules in the VTN coordinator.
114
115 The main functions of this library are: +
116
117 * Creates an IPC client session to the lower layer.
118 * Converts the request to IPC framework format.
119 * Invokes the lower layer API (i.e. UPPL API, UPLL API, TC API).
120 * Returns the response from the lower layer to the web server
121
122 * VTN Service Java API LIbrary Class Details*
123
124 The table below lists the classes available for VTN Service Java API library module and its descriptions:
125
126 [options="header"]
127 |===
128 | Class Name | Description
129 | VtnServiceInitManager |It is a Singleton class for executing the acquisition of configuration information from properties file, log initialization.
130 Executed by init() of Web API Servlet.
131 | VtnServiceConfiguration | Class to maintain the configuration information acquired from properties file.
132 | IpcConnPool | Class that mains Connection pool of IPC.
133 | IpcChannelConnection | Class that mains Connections of IPC.
134 | RestResource | The class that will be interface for Web API Servlet. Implementation of Interface VtnServiceResource.
135 | AnnotationReflect | Performs the mapping of path filed value of RestRsource class and xxxResource class.
136 | xxxResource | The class that is created according to the path filed value of RestResource.
137 (vtnResource, VBridgeResource etc) Inherits abstract class AbstractResource.
138 | xxxResourceValidator CommonValidator | The class that performs the appropriateness check of values specified in the path, query, request field of RestResource class.
139 |IpcPhysicalResponseFactory  | The class to create JsonObject from the response received from <<_vtn_unified_provider_logical_layer_upll>>.
140 | IpcRequestProcessor | Sends request to <<_vtn_unified_provider_logical_layer_upll>>  or <<_vtn_unified_provider_logical_layer_upll>> through proprietary IPC Framework.
141  UPLL API and UPPL APIs are implemented on proprietary IPC Framework, and request/response is defined by special interface called as Key Interface.
142 | IpcRequestPacket | The class that maintains the request to be sent to <<_vtn_unified_provider_logical_layer_upll>>/<<_vtn_unified_provider_logical_layer_upll>>.
143 | IpcStructFactory | The class to create Key Structure and Value Structure that will be included in the request to be sent to <<_vtn_unified_provider_logical_layer_upll>>/<<_vtn_unified_provider_logical_layer_upll>>.
144 |===
145
146 ===== VTN Transaction Coordinator (TC) Overview
147
148 The TC module provides the two phase commit coordination functionality for VTN coordinator components. It consists of two subcomponents
149
150 * Transaction Coordinator (TC)
151 * Transaction Coordinator Library (TCLIB)
152
153 .VTN Transaction Co ordinator (TC) Architecture
154 image::vtn/vtn-tc-architecture.png[]
155
156 ====== Transaction Coordinator (TC)
157
158 The Transaction Coordinator module implements the two phase commit operation.
159
160 The main functions of this module are:
161
162 * TC is started from uncd daemon during startup of VTN coordinator.
163 * Responsible for two phase commit operation in VTN
164 * Receives requests from <<_vtn_service_java_api_library>> during Commit and Audit operations.
165 * Invokes lower layer TCLIB API (i.e. UPLL API, UPPL API or ODC Driver API) via IPC framework.
166
167 *Transaction Coordinator (TC) Class Details*
168
169 The table below lists the classes available for TC module and its descriptions:
170
171 [options="header"]
172 |===
173 | Class Name | Description
174 | TcModule | Main interface which offers the services to VTN Service library. It also handles state transitions.
175 | TcOperations | Base class that services every operation request in TC.
176 | TcMsg  | The message to be sent for every operation has different characteristics based on the type of message.
177 This base class will provide methods to handle different types of messages to the intended recipients.
178 | TcLock  | The exclusion control class, an object of TcLock is contained in TcModule and used for every operation.
179 | TcDbHandler  | Utility class for TC database operations.
180 | TcTaskqUtil | Utility class for taskq used in TC for driver triggered audit and read operations.
181 |===
182
183 ====== Transaction Coordinator Library
184
185 It provides the Java API library to communicate with the lower layer modules in the VTN coordinator.
186
187 The main functions of this library are: +
188
189 * TCLIB will be loaded as a module in UPLL, UPPL and ODC Driver daemon.
190 * Responsible for handling messages to the daemons from TC.
191 * The daemons will install their handler with TCLIB, the handlers will be invoked on receiving messages from TC.
192
193 *Transaction Co ordinator Library Class Details*
194
195 The table below lists the classes available for Transaction Co ordinator library module and its descriptions:
196
197 [options="header"]
198 |===
199 | Class Name | Description
200 | TcLibModule  | Main class which handles requests from TC module.
201 | TcLibInterface  | Abstract class which every module implements to interact with TC module. Member of TcLibModule.
202 | TcLiBMsgUtil  | Internal utility class for extracting session attributes of every request from TC.
203 |===
204
205 ===== VTN OpenDaylight Controller Driver (ODC Driver) Overview
206
207 The ODC driver module is a sub component of the VTN coordinator and provides mechanisms to provision and monitor virtual networks and monitor physical networks in the OpenDaylight controller. ODC driver is started during startup of VTN coordinator It consists of two sub components:
208
209 * Common Driver Framework (CDF)
210 * ODC Driver
211
212 .VTN ODC Driver Architecture
213 image::vtn/vtn-coordinator-odc-driver-architecture.png[]
214
215 ====== Common Driver Framework (CDF)
216
217 CDF provides a controller independent processing of the messages sent from UPLL and UPPL modules.
218
219 The main functions of the CDF module are:
220
221 * Isolate the driver modules from processing messages sent by UPLL and UPPLmodules.
222 * Provide interfaces to the driver module to install their commands for various operations on the controller (eg: VTN creation).
223 * Provide controller management and support different types of controllers.
224 * Parse messages and invoke driver methods with appropriate parameters.
225 * Provide interface for different drivers to install command handlers.
226 * Simplify transaction processing with simplified transaction functions for vote and commit operations.
227 * Support for parallel update operation across many controllers.
228 * The framework can be extended to support all driver modules in a common daemon or individual daemons.
229
230 CDF is implemented using the following modules:
231
232 * *vtndrvintf*: Implements the features of CDF listed above.
233
234 *Class Details*
235 The following table lists the class details for vtndrvintf module:
236
237 [options="header"]
238 |===
239 | Class Name | Description
240 | VtnDrvIntf | Inherited from Module class and provides the entry point for messages from platform.
241 Provides interfaces to add drivers for different types of controllers.
242 | KtHandler  | Abstract interface for handling different message types.
243 | KtRequestHandler  | Template implementation of KtHandler to process all messages from platform.
244 | DriverTxnInterface | Common transaction handling for drivers.
245 | ControllerFramework | Provides methods to add/delete/update Controllers to the VTN Coordinator.
246 Periodic monitoring of controllers
247 |===
248
249 * *vtncacheutil*: Utility module that provides interfaces for caching configuration entries to validate as a whole and then later commit
250
251 *Class Details*
252 The following table lists the class details for vtncacheutil module:
253
254 [options="header"]
255 |===
256 | Class Name | Description
257 | keytree  | Cache container that provides interfaces to append config to cache.
258 | CommonIterator   | Provides methods to iterate the elements in cache, the option to iterate in VTN hierarchical order is also available.
259 |===
260
261 ====== ODC Driver
262
263 The ODC driver module implements the interfaces for controller connection management and virtual network provisioning and monitoring in the ODC controller. The request will be translated to the appropriate REST APIs and sent to the controller.
264 ODC driver is capable of translating the VTN Operations as Commands to VTN Manager in the ODL.
265
266 The above features are implemented using these modules
267
268 * *restjsonutil*: Utility module that provides services for JSON build/parse and handling REST Request/Response.
269
270 The following table lists the class details for restjsonutil module:
271
272 [options="header"]
273 |===
274 | Class Name | Description
275 | HttpClient | Interface to set up and maintain a connection to an HTTP Web service
276 | RestClient | Interface to handle request/response on a REST Interface
277 | JsonBuildParse | Interface for building/parsing the JSON strings for communication
278 |===
279
280 * *odcdriver*:
281
282 ** Implements the interfaces exposed by CDF
283 ** Registers the driver for controllers of type : ODC (OpenDaylight Controllers)
284 ** Uses the restjsonutil to communicate
285
286 The following table lists the class details for restjsonutil module:
287
288 [options="header"]
289 |===
290 | Class Name | Description
291 | OdcModule  | Module implementation of odc driver, registers itself as diver for controllers of ODL type
292 | ODCController  | Implements the various methods according to the features of the ODL Controller.
293 | ODCVTNCommand  | Handle Create/Update/Delete/Read requests for VTN.
294 | ODCVBRCommand  | Handle Create/Update/Delete/Read requests for vBridge .
295 | ODCVBRIfCommand | Handle Create/Update/Delete/Read requests for vBridge interfaces.
296 |===
297
298 ===== VTN Unified Provider Logical Layer (UPLL)
299
300 The UPLL module is a sub component of the VTN coordinator and provides the Virtual network provisioning and monitoring functionality. It consists of two sub components:
301
302 * UPLL
303 * DAL
304
305 .VTN UPLL Architecture
306 image::vtn/vtn-upll-architecture.png[]
307
308 ====== UPLL Functionalities
309
310 The main functions of this module are:
311
312 * UPLL is started from lgcnwd daemon during startup of VTN coordinator.
313 * Interacts with TC, UPPL and ODC Driver using IPC framework.
314 * Receives virtual network configuration Create/Update/Delete/Read requests from VTN service.
315 * Maintains the startup, candidate, and running configurations and state information in an external database
316 * Performs the Setup/Commit/Abort operations as instructed by TC.
317 * Connects to southbound controllers via ODC Driver.
318 * Constructs and maintains the virtual network topology using the configuration and notifications (events and alarms) received from controller platforms.
319 * Supports Audit and Import functionality for the virtual network configurations.
320
321 *UPLL Class Details*
322
323 The table below lists the classes available for UPLL module and its descriptions:
324
325 [options="header"]
326 |===
327 | Class Name | Description
328 | UpllConfigSvc | UpllConfigService is a service layer implementation for UPLL. It provides UPLL service to VTN Service and handles all service requests. It also registers with UPPL and Drivers for notifications.
329 | UpllIpcEventHandler | Handler for IPC events.
330 | UpllConfigMgr | UpllConfigMgr is the core implementation class for configuration services and   transaction services including audit and import.
331 | TcLibIntfImpl | This an implementation class which implements the TcLibInterface provided by TC. This implementation class, for each virtual function, will invoke corresponding UpllConfigMgr function.
332 | MoCfgServiceIntf | Interface class for Edit/Read/Control operations.
333 | MoTxServiceIntf | Interface class for normal transaction operations.
334 | MoAuditServiceIntf | Interface class for audit operations.
335 | MoImportServiceIntf | Interface class for import operations.
336 | MoDbServiceIntf | Interface class for database operations.
337 | MoManager | Base class for Key tree specific implementation.
338 | CtrlrMgr| Stores the controllers as notified by Physical. UPLL stores the controller type and "invalid config" alarm status against each known controller type.
339 | ConfigVal | Class for value structure of any key type. This class allows list of values to be specified.
340 | ConfigKeyVal | Handler for IPC events
341 | UpllConfigMgr | Class for additional data after the request/response header in messages corresponding to configuration operations. This class allows nesting of key types and values. For one key type many values can be specified and sequence of such <key, value, …> tuples can be encapsulated with one ConfigKeyVal
342 | ConfigNotification | Implements config notification.
343 | ConfigNotifier | Implements buffering and sending of config notifications. Also provides API for OperStatus change notification.
344 | IpcUtil | Provides various IPC wrappers over the IPC framework.
345 | IpctSt | Provides wrappers for data sent over IPC.
346 | Key type specific classes | Implements the Key type handling functionality for all key types.
347 |===
348
349 ====== DAL Functionalities
350
351 The DAL Module implements the abstraction layer for the Database.
352
353 *DAL Class Details*
354
355 The table below lists the classes available for DAL module and its descriptions:
356
357 [options="header"]
358 |===
359 | Class Name | Description
360 | DalBindColumnInfo | Contains column_info for each column_index ( column_index, app_data_type, dal_data_type, app_array_size). Contains bind_info (app_out_addr, db_in_out_addr, db_match_addr, io_type). Allocates memory in DB and copies input/match application data. Copies result from DB to application data.
361 | DalBindInfo | Contains bind_info for all columns in a table (table_index, list of DalBindColumnInfo. Provides API to UPLL to bind the input/output/match address to DB And to copy result back to application.
362 | DalCursor | Holds cursor information. Holds cursor data to fetch result one by one in case of multi-result query. Provides API to UPLL to fetch the result from cursor and destroy the cursor. Creation of cursor will be done in DalOdbcMgr based on the Query API.
363 | DalQueryBuilder | Contains list of Query Templates and generates Query based on user inputs.
364 | DalErrorHandler |Process SQL errors and maps to corresponding DB result code.
365 | DalOdbcMgr | Provides APIs to UPLL for Connection/Disconnection, Commit/Rollback operation, Cursor fetch/Close cursor, All Single/Multiple result queries Diff, Copy Queries.
366 |===
367
368 ===== VTN Unified Provider Physical Layer (UPPL)
369
370 The UPPL module is a sub component of the VTN coordinator and provides the Physical network provisioning and monitoring functionality.
371
372 .VTN UPPL Architecture
373 image::vtn/vtn-coordinator-uppl-architecture.png[]
374
375 ====== UPPL Functionalities
376
377 UPPL provides the following functionalities:
378
379 * UPPL is started from phynwd daemon during startup of VTN coordinator.
380 * Interacts with TC, UPLL and ODC Driver using IPC framework
381 * Receives Controller, Domain and Boundary Create/Update/Delete/Read requests from VTN Services
382 * Maintains the startup, candidate, and running configurations and state information in an external database
383 * Performs the setup/commit/abort operations as instructed by TC.
384 * Connects to southbound controllers via ODC Driver
385 * Constructs physical topology using the notifications (events and alarms) from controller platform.
386 * Informs UPLL about the controller addition/deletion and operational status changes of physical topology objects.
387
388 *UPPL Class Details*
389
390 The table below lists the classes available for UPPL module and its descriptions:
391
392 [options="header"]
393 |===
394 | Class Name| Description
395 | PhysicalLayer | It’s a singleton class which will instantiate other UPPL’s classes. This class will be inherited from base module in order to use the Core features and IPC service handlers.
396 | PhysicalCore | Class that is responsible for processing requests from https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Transaction_Coordinator#Transaction_Coordinator%7C[VTN Transaction Coordinator].
397 It also: +
398
399 *  Processes the configuration and capability file. +
400 *  Responsible for sending alarm to node manager. +
401 *  Responsible for receiving requests from north bound. +
402 | IPCConnectionManager | It is responsible for processing the requests received via IPC framework. It contains separate classes to process request from VTN_Service_Java_API_library, Unified Provider Logical Layer (UPLL), OpenDaylight Controller Driver. For more information about the modules mentioned, see https://wiki.opendaylight.org/view/Release/Hydrogen/VTN/Developer_Guide[VTN Co ordinator Architecture]
403 | ODBCManager | It is a singleton class which performs all database services.
404 | InternalTransactionCoordinator | It is responsible for parsing the IPC structures and forward it to the various request classes like ConfigurationRequest, ReadRequest, ImportRequest etc.
405 | ConfigurationRequest | It is responsible to process the Create, Delete and Update operations received from <<_vtn_service_java_api_library>>.
406 | ReadRequest | It is responsible to process all the read operations.
407 | Kt_Base, Kt_State_Base and respective Kt classes | These classes perform the functionality required for individual key type.
408 | TransactionRequest | It is responsible for performing the various functions required for each phase of the Transaction Request received from Transaction Coordinator during User Commit/Abort.
409 | AuditRequest | It is responsible for performing functions related to audit request.
410 | ImportRequest | It is responsible for performing functions related to import request.
411 | SystemStateChangeRequest | It is responsible for performing functions when <<_vtn_coordinator>> state is moved to active or standby.
412 | DBConfigurationRequest |It is responsible for processing various Database operations like Save/Clear/Abort
413 |===
414
415 ===== Usage Examples
416 *  https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):VTN_Coordinator:RestApi:How_to_configure_L2_Network_with_Single_Controller[L2 Network using Single Controller]