Updated example usage of VTN API.
[docs.git] / manuals / user-guide / src / main / asciidoc / vtn / VTN_Overview.adoc
1 === VTN Overview
2
3 OpenDaylight Virtual Tenant Network (VTN) is an application that provides multi-tenant virtual network on an SDN controller.
4
5 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. So, 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.
6
7 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.
8
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.
10
11 .VTN Overview
12 image::vtn/VTN_Overview.jpg[VTN Overview ,width= 500]
13
14 It is implemented as two major components
15
16 * <<_vtn_manager,VTN Manager>>
17 * <<_vtn_coordinator,VTN Coordinator>>
18
19 ==== VTN Manager
20 An 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.
21
22 ===== Features Overview
23
24 * *odl-vtn-manager* provides VTN Manager's JAVA API.
25 * *odl-vtn-manager-rest* provides VTN Manager's REST API.
26 * *odl-vtn-manager-neutron* provides the integration with Neutron interface.
27
28 ===== REST API
29
30 VTN Manager provides REST API for virtual network functions.
31
32 Here is an example of how to create a virtual tenant network.
33
34 ----
35  curl --user "admin":"admin" -H "Accept: application/json" -H \
36  "Content-type: application/json" -X POST \
37  http://localhost:8282/controller/nb/v2/vtn/default/vtns/Tenant1 \
38  -d '{"description": "My First Virtual Tenant Network"}'
39 ----
40
41 You can check the list of all tenants by executing the following command.
42
43 ----
44  curl --user "admin":"admin" -H "Accept: application/json" -H \
45  "Content-type: application/json" -X GET \
46  http://localhost:8282/controller/nb/v2/vtn/default/vtns
47 ----
48
49 REST API documentation for VTN Manager, please refer: https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-master/lastSuccessfulBuild/artifact/manager/northbound/target/site/wsdocs/rest.html
50
51 ==== VTN Coordinator
52
53 The VTN Coordinator is an external application that provides a REST interface for a 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. It 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 Coordinator 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.
54
55 For VTN Coordinator REST API, please refer: https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:VTN_Coordinator:RestApi
56
57 ==== Network Virtualization Function
58
59 The user first defines a VTN. Then, the user maps the VTN to a physical network, which enables communication to take place according to the VTN definition. With the VTN definition, L2 and L3 transfer functions and flow-based traffic control functions (filtering and redirect) are possible.
60
61 ==== Virtual Network Construction
62
63 The following table shows the elements which make up the VTN.
64 In the VTN, a virtual network is constructed using virtual nodes (vBridge, vRouter) and virtual interfaces and links.
65 It is possible to configure a network which has L2 and L3 transfer function, by connecting the virtual intrefaces made on virtual nodes via virtual links.
66
67 [cols="2*"]
68 |===
69 |vBridge
70 |The logical representation of L2 switch function.
71
72 |vRouter
73 |The logical representation of router function.
74
75 |vTep
76 |The logical representation of Tunnel End Point - TEP.
77
78 |vTunnel
79 |The logical representation of Tunnel.
80
81 |vBypass
82 |The logical representation of connectivity between controlled networks.
83
84 |Virtual interface
85 |The representation of end point on the virtual node.
86
87 |Virtual Linkv(vLink)
88 |The logical representation of L1 connectivity between virtual interfaces.
89 |===
90
91 The following figure shows an example of a constructed virtual network. VRT is defined as the vRouter, BR1 and BR2 are defined as vBridges. interfaces of the vRouter and vBridges are connected using vLinks.
92
93 .VTN Construction
94 image::vtn/VTN_Construction.jpg[VTN Construction ,width= 500]
95
96
97 ==== Mapping of Physical Network Resources
98
99 Map physical network resources to the constructed virtual network. Mapping identifies which virtual network each packet transmitted or received by an OpenFlow switch belongs to, as well as which interface in the OpenFlow switch transmits or receives that packet.
100 There are two mapping methods. When a packet is received from the OFS, port mapping is first searched for the corresponding mapping definition, then VLAN mapping is searched, and the packet is mapped to the relevant vBridge according to the first matching mapping.
101
102 [cols="2*"]
103 |===
104 |Port mapping
105 |Maps physical network resources to an interface of vBridge using Switch ID, Port ID and VLAN ID of the incoming L2 frame. Untagged frame mapping is also supported.
106
107 |VLAN mapping
108 |Maps physical network resources to a vBridge using VLAN ID of the incoming L2 frame.Maps physical resources of a particular switch to a vBridge using switch ID and VLAN ID of the incoming L2 frame.
109
110 |MAC mapping
111 |Maps physical resources to an interface of vBridge using MAC address of the incoming L2 frame(The initial contribution does not include this method).
112 |===
113
114 VTN can learn the terminal information from a terminal that is connected to a switch which is mapped to VTN. Further, it is possible to refer that terminal information on the VTN.
115
116 * Learning terminal information
117   VTN learns the information of a terminal that belongs to VTN. It will store the MAC address and VLAN ID of the terminal in relation to the port of the switch.
118 * Aging of terminal information
119   Terminal information, learned by the VTN, will be maintained until the packets from terminal keep flowing in VTN. If the terminal gets disconnected from the VTN, then the aging timer will start clicking and the terminal information will be maintained till timeout.
120
121 The following figure shows an example of mapping. An interface of BR1 is mapped to port GBE0/1 of OFS1 using port mapping. Packets received from GBE0/1 of OFS1 are regarded as those from the corresponding interface of BR1.
122 BR2 is mapped to VLAN 200 using VLAN mapping.
123 Packets with VLAN tag 200 received from any ports of any OFSs are regarded as those from an interface of BR2.
124
125 .VTN Mapping
126 image::vtn/VTN_Mapping.jpg[VTN Mapping]
127
128 ==== vBridge Functions
129
130 The vBridge provides the bridge function that transfers a packet to the intended virtual port according to the destination MAC address.
131 The vBridge looks up the MAC address table and transmits the packet to the corresponding virtual interface when the destination MAC address has been learned. When the destination MAC address has not been learned, it transmits the packet to all virtual interfaces other than the receiving port (flooding).
132 MAC addresses are learned as follows.
133
134 * MAC address learning
135   The vBridge learns the MAC address of the connected host. The source MAC address of each received frame is mapped to the receiving virtual interface, and this MAC address is stored in the MAC address table created on a per-vBridge basis.
136 * MAC address aging
137   The MAC address stored in the MAC address table is retained as long as the host returns the ARP reply. After the host is disconnected, the address is retained until the aging timer times out.
138 To have the vBridge learn MAC addresses statically, you can register MAC addresses manually.
139
140 ==== vRouter Functions
141
142 The vRouter transfers IPv4 packets between vBridges. The vRouter supports routing, ARP learning, and ARP aging functions. The following outlines the functions.
143
144 * Routing function
145   When an IP address is registered with a virtual interface of the vRouter, the default routing information for that interface is registered. It is also possible to statically register routing information for a virtual interface.
146 * ARP learning function
147   The vRouter associates a destination IP address, MAC address and a virtual interface, based on an ARP request to its host or a reply packet for an ARP request, and maintains this information in an ARP table prepared for each routing domain. The registered ARP entry is retained until the aging timer, described later, times out. The vRouter transmits an ARP request on an individual aging timer basis and deletes the associated entry from the ARP table if no reply is returned. For static ARP learning, you can register ARP entry information manually.
148 *DHCP relay agent function
149   The vRouter also provides the DHCP relay agent function.
150
151 ==== Flow Filter Functions
152
153 Flow Filter function is similar to ACL. It is possible to allow or prohibit communication with only certain kind of packets that meet a particular condition. Also, it can perform a processing called Redirection - WayPoint routing, which is different from the existing ACL.
154 Flow Filter can be applied to any interface of a vNode within VTN, and it is possible to the control the packets that pass interface.
155 The match conditions that could be specified in Flow Filter are as follows. It is also possible to specify a combination of multiple conditions.
156
157 * Source MAC address
158 * Destination MAC address
159 * MAC ether type
160 * VLAN Priority
161 * Source IP address
162 * Destination IP address
163 * DSCP
164 * IP Protocol
165 * TCP/UDP source port
166 * TCP/UDP destination port
167 * ICMP type
168 * ICMP code
169
170 The types of Action that can be applied on packets that match the Flow Filter conditions are given in the following table.
171 It is possible to make only those packets, which match a particular condition, to pass through a particular server by specifying Redirection in Action. E.g., path of flow can be changed for each packet sent from a particular terminal, depending upon the destination IP address.
172 VLAN priority control and DSCP marking are also supported.
173
174
175 [cols="2*"]
176 |===
177 | Pass
178 | Pass particular packets matching the specified conditions.
179
180 | Drop
181 | Discards particular packets matching the specified conditions.
182
183 | Redirection
184 | Redirects the packet to a desired virtual interface. Both Transparent Redirection (not changing MAC address) and Router Redirection (changing MAC address) are supported.
185 |===
186
187 The following figure shows an example of how the flow filter function works.
188
189 If there is any matching condition specified by flow filter when a packet being transferred within a virtual network goes through a virtual interface, the function evaluates the matching condition to see whether the packet matches it.
190 If the packet matches the condition, the function applies the matching action specified by flow filter. In the example shown in the figure, the function evaluates the matching condition at BR1 and discards the packet if it matches the condition.
191
192 .VTN FlowFilter
193 image::vtn/VTN_Flow_Filter.jpg[width=500]
194
195 ==== Multiple SDN Controller Coordination
196
197 With the network abstractions, VTN enables to configure virtual network across multiple SDN controllers. This provides highly scalable network system.
198
199 VTN can be created on each SDN controller. If users would like to manage those multiple VTNs with one policy, those VTNs can be integrated to a single VTN.
200
201 As a use case, this feature is deployed to multi data center environment. Even if those data centers are geographically separated and controlled with different controllers, a single policy virtual network can be realized with VTN.
202
203 Also, one can easily add a new SDN Controller to an existing VTN or delete a particular SDN Controller from VTN.
204
205 In addition to this, one can define a VTN which covers both OpenFlow network and Overlay network at the same time.
206
207 Flow Filter, which is set on the VTN, will be automatically applied on the newly added SDN Controller.
208
209 ==== Coordination between OpenFlow Network and L2/L3 Network
210
211 It is possible to configure VTN on an environment where there is mix of L2/L3 switches as well. L2/L3 switch will be shown on VTN as vBypass. Flow Filter or policing cannot be configured for a vBypass. However, it is possible to treat it as a virtual node inside VTN.
212
213 ==== Virtual Tenant Network (VTN) API
214
215 VTN provides Web APIs. They are implemented by REST architecture and provide the access to resources within VTN that are identified by URI.
216 User can perform the operations like GET/PUT/POST/DELETE against the virtual network resources (e.g. vBridge or vRouter) by sending a message to VTN through HTTPS communication in XML or JSON format.
217
218 .VTN API
219 image::vtn/VTN_API.jpg[VTN API]
220
221 ===== Function Outline
222
223 VTN provides following operations for various network resources.
224
225 [cols="5*"]
226 |===
227 | Resources
228 | GET
229 | POST
230 | PUT
231 | DELETE
232
233 | VTN
234 | Yes
235 | Yes
236 | Yes
237 | Yes
238
239 | vBridge
240 | Yes
241 | Yes
242 | Yes
243 | Yes
244
245 | vRouter
246 | Yes
247 | Yes
248 | Yes
249 | Yes
250
251 | vTep
252 | Yes
253 | Yes
254 | Yes
255 | Yes
256
257 | vTunnel
258 | Yes
259 | Yes
260 | Yes
261 | Yes
262
263 | vBypass
264 | Yes
265 | Yes
266 | Yes
267 | Yes
268
269 | vLink
270 | Yes
271 | Yes
272 | Yes
273 | Yes
274
275 | Interface
276 | Yes
277 | Yes
278 | Yes
279 | Yes
280
281 | Port map
282 | Yes
283 | No
284 | Yes
285 | Yes
286
287 | Vlan map
288 | Yes
289 | Yes
290 | Yes
291 | Yes
292
293 | Flowfilter (ACL/redirect)
294 | Yes
295 | Yes
296 | Yes
297 | Yes
298
299 | Controller information
300 | Yes
301 | Yes
302 | Yes
303 | Yes
304
305 | Physical topology information
306 | Yes
307 | No
308 | No
309 | No
310
311 | Alarm information
312 | Yes
313 | No
314 | No
315 | No
316 |===
317
318 ===== Example usage
319
320 The following is an example of the usage to construct a virtual network.
321
322 * Create VTN
323
324 ----
325    curl --user admin:adminpass -X POST -H 'content-type: application/json'  \
326   -d '{"vtn":{"vtn_name":"VTN1"}}' http://172.1.0.1:8083/vtn-webapi/vtns.json
327 ----
328 * Create Controller Information
329
330 ----
331    curl --user admin:adminpass -X POST -H 'content-type: application/json'  \
332   -d '{"controller": {"controller_id":"CONTROLLER1","ipaddr":"172.1.0.1","type":"odc","username":"admin", \
333   "password":"admin","version":"1.0"}}' http://172.1.0.1:8083/vtn-webapi/controllers.json
334 ----
335 * Create vBridge under VTN
336
337 ----
338   curl --user admin:adminpass -X POST -H 'content-type: application/json' \
339   -d '{"vbridge":{"vbr_name":"VBR1","controller_id": "CONTROLLER1","domain_id": "(DEFAULT)"}}' \
340   http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges.json
341 ----
342 * Create the interface under vBridge
343
344 ----
345   curl --user admin:adminpass -X POST -H 'content-type: application/json' \
346   -d '{"interface":{"if_name":"IF1"}}' http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges/VBR1/interfaces.json
347 ----