Add doc for debugging port status update
[netvirt.git] / docs / user-guide / l3vpn-service_-user-guide.rst
1 L3VPN Service: User Guide
2 =========================
3
4 Overview
5 --------
6
7 L3VPN Service in OpenDaylight provides a framework to create L3VPN based
8 on BGP-MP. It also helps to create Network Virtualization for DC Cloud
9 environment.
10
11 Modules & Interfaces
12 --------------------
13
14 L3VPN service can be realized using the following modules -
15
16 VPN Service Modules
17 ~~~~~~~~~~~~~~~~~~~
18
19 1. **VPN Manager** : Creates and manages VPNs and VPN Interfaces
20
21 2. **BGP Manager** : Configures BGP routing stack and provides interface
22    to routing services
23
24 3. **FIB Manager** : Provides interface to FIB, creates and manages
25    forwarding rules in Dataplane
26
27 4. **Nexthop Manager** : Creates and manages nexthop egress pointer,
28    creates egress rules in Dataplane
29
30 5. **Interface Manager** : Creates and manages different type of network
31    interfaces, e.g., VLAN, l3tunnel etc.,
32
33 6. **Id Manager** : Provides cluster-wide unique ID for a given key.
34    Used by different modules to get unique IDs for different entities.
35
36 7. **MD-SAL Util** : Provides interface to MD-SAL. Used by service
37    modules to access MD-SAL Datastore and services.
38
39 All the above modules can function independently and can be utilized by
40 other services as well.
41
42 Configuration Interfaces
43 ~~~~~~~~~~~~~~~~~~~~~~~~
44
45 The following modules expose configuration interfaces through which user
46 can configure L3VPN Service.
47
48 1. BGP Manager
49
50 2. VPN Manager
51
52 3. Interface Manager
53
54 4. FIB Manager
55
56 Configuration Interface Details
57 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
59 1. Data Node Path : */config/bgp:bgp-router/*
60
61    a. Fields :
62
63       i.  local-as-identifier
64
65       ii. local-as-number
66
67    b. REST Methods : GET, PUT, DELETE, POST
68
69 2. Data Node Path : */config/bgp:bgp-neighbors/*
70
71    a. Fields :
72
73       i. List of bgp-neighbor
74
75    b. REST Methods : GET, PUT, DELETE, POST
76
77 3. Data Node Path :
78    */config/bgp:bgp-neighbors/bgp-neighbor/``{as-number}``/*
79
80    a. Fields :
81
82       i.  as-number
83
84       ii. ip-address
85
86    b. REST Methods : GET, PUT, DELETE, POST
87
88 1. Data Node Path : */config/l3vpn:vpn-instances/*
89
90    a. Fields :
91
92       i. List of vpn-instance
93
94    b. REST Methods : GET, PUT, DELETE, POST
95
96 2. Data Node Path : */config/l3vpn:vpn-interfaces/vpn-instance*
97
98    a. Fields :
99
100       i.   name
101
102       ii.  route-distinguisher
103
104       iii. import-route-policy
105
106       iv.  export-route-policy
107
108    b. REST Methods : GET, PUT, DELETE, POST
109
110 3. Data Node Path : */config/l3vpn:vpn-interfaces/*
111
112    a. Fields :
113
114       i. List of vpn-interface
115
116    b. REST Methods : GET, PUT, DELETE, POST
117
118 4. Data Node Path : */config/l3vpn:vpn-interfaces/vpn-interface*
119
120    a. Fields :
121
122       i.  name
123
124       ii. vpn-instance-name
125
126    b. REST Methods : GET, PUT, DELETE, POST
127
128 5. Data Node Path :
129    */config/l3vpn:vpn-interfaces/vpn-interface/``{name}``/adjacency*
130
131    a. Fields :
132
133       i.  ip-address
134
135       ii. mac-address
136
137    b. REST Methods : GET, PUT, DELETE, POST
138
139 1. Data Node Path : */config/if:interfaces/interface*
140
141    a. Fields :
142
143       i.   name
144
145       ii.  type
146
147       iii. enabled
148
149       iv.  of-port-id
150
151       v.   tenant-id
152
153       vi.  base-interface
154
155    b. type specific fields
156
157       i.   when type = *l2vlan*
158
159            A. vlan-id
160
161       ii.  when type = *stacked\_vlan*
162
163            A. stacked-vlan-id
164
165       iii. when type = *l3tunnel*
166
167            A. tunnel-type
168
169            B. local-ip
170
171            C. remote-ip
172
173            D. gateway-ip
174
175       iv.  when type = *mpls*
176
177            A. list labelStack
178
179            B. num-labels
180
181    c. REST Methods : GET, PUT, DELETE, POST
182
183 1. Data Node Path : */config/odl-fib:fibEntries/vrfTables*
184
185    a. Fields :
186
187       i. List of vrfTables
188
189    b. REST Methods : GET, PUT, DELETE, POST
190
191 2. Data Node Path :
192    */config/odl-fib:fibEntries/vrfTables/``{routeDistinguisher}``/*
193
194    a. Fields :
195
196       i.  route-distinguisher
197
198       ii. list vrfEntries
199
200           A. destPrefix
201
202           B. label
203
204           C. nexthopAddress
205
206    b. REST Methods : GET, PUT, DELETE, POST
207
208 3. Data Node Path : */config/odl-fib:fibEntries/ipv4Table*
209
210    a. Fields :
211
212       i. list ipv4Entry
213
214          A. destPrefix
215
216          B. nexthopAddress
217
218    b. REST Methods : GET, PUT, DELETE, POST
219
220 Provisioning Sequence & Sample Configurations
221 ---------------------------------------------
222
223 Installation
224 ~~~~~~~~~~~~
225
226 1. Edit *etc/custom.properties* and set the following property:
227    *vpnservice.bgpspeaker.host.name = <bgpserver-ip>* *<bgpserver-ip>*
228    here refers to the IP address of the host where BGP is running.
229
230 2. Run ODL and install VPN Service *feature:install odl-vpnservice-core*
231
232 Use REST interface to configure L3VPN service
233
234 Pre-requisites:
235 ~~~~~~~~~~~~~~~
236
237 1. BGP stack with VRF support needs to installed and configured
238
239    a. *Configure BGP as specified in Step 1 below.*
240
241 2. Create pairs of GRE/VxLAN Tunnels (using ovsdb/ovs-vsctl) between
242    each switch and between each switch to the Gateway node
243
244    a. *Create *l3tunnel* interfaces corresponding to each tunnel in
245       interfaces DS as specified in Step 2 below.*
246
247 Step 1 : Configure BGP
248 ~~~~~~~~~~~~~~~~~~~~~~
249
250 1. Configure BGP Router
251 ^^^^^^^^^^^^^^^^^^^^^^^
252
253 **REST API** : *PUT /config/bgp:bgp-router/*
254
255 **Sample JSON Data**
256
257 .. code:: json
258
259     {
260         "bgp-router": {
261             "local-as-identifier": "10.10.10.10",
262             "local-as-number": 108
263         }
264     }
265
266 2. Configure BGP Neighbors
267 ^^^^^^^^^^^^^^^^^^^^^^^^^^
268
269 **REST API** : *PUT /config/bgp:bgp-neighbors/*
270
271 **Sample JSON Data**
272
273 .. code:: json
274
275       {
276          "bgp-neighbor" : [
277                 {
278                     "as-number": 105,
279                     "ip-address": "169.144.42.168"
280                 }
281            ]
282        }
283
284 Step 2 : Create Tunnel Interfaces
285 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
286
287 Create l3tunnel interfaces corresponding to all GRE/VxLAN tunnels
288 created with ovsdb (`refer Prerequisites <#prer>`__). Use following REST
289 Interface -
290
291 **REST API** : *PUT /config/if:interfaces/if:interfacce*
292
293 **Sample JSON Data**
294
295 .. code:: json
296
297     {
298         "interface": [
299             {
300                 "name" : "GRE_192.168.57.101_192.168.57.102",
301                 "type" : "odl-interface:l3tunnel",
302                 "odl-interface:tunnel-type": "odl-interface:tunnel-type-gre",
303                 "odl-interface:local-ip" : "192.168.57.101",
304                 "odl-interface:remote-ip" : "192.168.57.102",
305                 "odl-interface:portId" : "openflow:1:3",
306                 "enabled" : "true"
307             }
308         ]
309     }
310
311 Following is expected as a result of these configurations
312 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
313
314 1. Unique If-index is generated
315
316 2. *Interface-state* operational DS is updated
317
318 3. Corresponding Nexthop Group Entry is created
319
320 Step 3 : OS Create Neutron Ports and attach VMs
321 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
322
323 At this step user creates VMs.
324
325 Step 4 : Create VM Interfaces
326 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327
328 Create l2vlan interfaces corresponding to VM created in step 3
329
330 **REST API** : *PUT /config/if:interfaces/if:interface*
331
332 **Sample JSON Data**
333
334 .. code:: json
335
336     {
337         "interface": [
338             {
339                 "name" : "dpn1-dp1.2",
340                 "type" : "l2vlan",
341                 "odl-interface:of-port-id" : "openflow:1:2",
342                 "odl-interface:vlan-id" : "1",
343                 "enabled" : "true"
344             }
345         ]
346     }
347
348 Step 5: Create VPN Instance
349 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
350
351 **REST API** : *PUT /config/l3vpn:vpn-instances/l3vpn:vpn-instance/*
352
353 **Sample JSON Data**
354
355 .. code:: json
356
357     {
358       "vpn-instance": [
359         {
360             "description": "Test VPN Instance 1",
361             "vpn-instance-name": "testVpn1",
362             "ipv4-family": {
363                 "route-distinguisher": "4000:1",
364                 "export-route-policy": "4000:1,5000:1",
365                 "import-route-policy": "4000:1,5000:1",
366             }
367         }
368       ]
369     }
370
371 Following is expected as a result of these configurations
372 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
373
374 1. VPN ID is allocated and updated in data-store
375
376 2. Corresponding VRF is created in BGP
377
378 3. If there are vpn-interface configurations for this VPN, corresponding
379    action is taken as defined in step 5
380
381 Step 5 : Create VPN-Interface and Local Adjacency
382 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383
384 *this can be done in two steps as well*
385
386 1. Create vpn-interface
387 ^^^^^^^^^^^^^^^^^^^^^^^
388
389 **REST API** : *PUT /config/l3vpn:vpn-interfaces/l3vpn:vpn-interface/*
390
391 **Sample JSON Data**
392
393 .. code:: json
394
395     {
396       "vpn-interface": [
397         {
398           "vpn-instance-name": "testVpn1",
399           "name": "dpn1-dp1.2",
400         }
401       ]
402     }
403
404 .. note::
405
406     name here is the name of VM interface created in step 3, 4
407
408 2. Add Adjacencies on vpn-interafce
409 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
410
411 **REST API** : *PUT
412 /config/l3vpn:vpn-interfaces/l3vpn:vpn-interface/dpn1-dp1.3/adjacency*
413
414 **Sample JSON Data**
415
416 .. code:: json
417
418       {
419          "adjacency" : [
420                 {
421                     "ip-address" : "169.144.42.168",
422                     "mac-address" : "11:22:33:44:55:66"
423                 }
424            ]
425        }
426
427     its a list, user can define more than one adjacency on a
428     vpn\_interface
429
430 Above steps can be carried out in a single step as following
431
432 .. code:: json
433
434     {
435         "vpn-interface": [
436             {
437                 "vpn-instance-name": "testVpn1",
438                 "name": "dpn1-dp1.3",
439                 "odl-l3vpn:adjacency": [
440                     {
441                         "odl-l3vpn:mac_address": "11:22:33:44:55:66",
442                         "odl-l3vpn:ip_address": "11.11.11.2",
443                     }
444                 ]
445             }
446         ]
447     }
448
449 Following is expected as a result of these configurations
450 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
451
452 1. Prefix label is generated and stored in DS
453
454 2. Ingress table is programmed with flow corresponding to interface
455
456 3. Local Egress Group is created
457
458 4. Prefix is added to BGP for advertisement
459
460 5. BGP pushes route update to FIB YANG Interface
461
462 6. FIB Entry flow is added to FIB Table in OF pipeline
463