Merge "Migrate NatApp dev docs to rst"
[docs.git] / docs / user-guide / virtual-tenant-network-(vtn).rst
1 Virtual Tenant Network (VTN)
2 ============================
3
4 VTN Overview
5 ------------
6
7 OpenDaylight Virtual Tenant Network (VTN) is an application that
8 provides multi-tenant virtual network on an SDN controller.
9
10 Conventionally, huge investment in the network systems and operating
11 expenses are needed because the network is configured as a silo for each
12 department and system. So, various network appliances must be installed
13 for each tenant and those boxes cannot be shared with others. It is a
14 heavy work to design, implement and operate the entire complex network.
15
16 The uniqueness of VTN is a logical abstraction plane. This enables the
17 complete separation of logical plane from physical plane. Users can
18 design and deploy any desired network without knowing the physical
19 network topology or bandwidth restrictions.
20
21 VTN allows the users to define the network with a look and feel of
22 conventional L2/L3 network. Once the network is designed on VTN, it will
23 automatically be mapped into underlying physical network, and then
24 configured on the individual switch leveraging SDN control protocol. The
25 definition of logical plane makes it possible not only to hide the
26 complexity of the underlying network but also to better manage network
27 resources. It achieves reducing reconfiguration time of network services
28 and minimizing network configuration errors.
29
30 .. figure:: ./images/vtn/VTN_Overview.jpg
31    :alt: VTN Overview
32
33    VTN Overview
34
35 It is implemented as two major components
36
37 -  `VTN Manager <#_vtn_manager>`__
38
39 -  `VTN Coordinator <#_vtn_coordinator>`__
40
41 VTN Manager
42 ~~~~~~~~~~~
43
44 An OpenDaylight Plugin that interacts with other modules to implement
45 the components of the VTN model. It also provides a REST interface to
46 configure VTN components in OpenDaylight. VTN Manager is implemented as
47 one plugin to the OpenDaylight. This provides a REST interface to
48 create/update/delete VTN components. The user command in VTN Coordinator
49 is translated as REST API to VTN Manager by the OpenDaylight Driver
50 component. In addition to the above mentioned role, it also provides an
51 implementation to the OpenStack L2 Network Functions API.
52
53 Features Overview
54 ^^^^^^^^^^^^^^^^^
55
56 -  **odl-vtn-manager** provides VTN Manager’s JAVA API.
57
58 -  **odl-vtn-manager-rest** provides VTN Manager’s REST API.
59
60 -  **odl-vtn-manager-neutron** provides the integration with Neutron
61    interface.
62
63 REST API
64 ^^^^^^^^
65
66 VTN Manager provides REST API for virtual network functions.
67
68 Here is an example of how to create a virtual tenant network.
69
70 ::
71
72      curl --user "admin":"admin" -H "Accept: application/json" -H \
73      "Content-type: application/json" -X POST \
74      http://localhost:8181/restconf/operations/vtn:update-vtn \
75      -d '{"input":{"tenant-name":"vtn1"}}'
76
77 You can check the list of all tenants by executing the following
78 command.
79
80 ::
81
82      curl --user "admin":"admin" -H "Accept: application/json" -H \
83      "Content-type: application/json" -X GET \
84      http://localhost:8181/restconf/operational/vtn:vtns
85
86 REST Conf documentation for VTN Manager, please refer to:
87 https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/apidocs/index.html
88
89
90 VTN Coordinator
91 ~~~~~~~~~~~~~~~
92
93 The VTN Coordinator is an external application that provides a REST
94 interface for an user to use OpenDaylight VTN Virtualization. It
95 interacts with VTN Manager plugin to implement the user configuration.
96 It is also capable of multiple OpenDaylight orchestration. It realizes
97 Virtual Tenant Network (VTN) provisioning in OpenDaylight instances. In
98 the OpenDaylight architecture VTN Coordinator is part of the network
99 application, orchestration and services layer. VTN Coordinator will use
100 the REST interface exposed by the VTN Manger to realize the virtual
101 network using OpenDaylight. It uses OpenDaylight APIs (REST) to
102 construct the virtual network in OpenDaylight instances. It provides
103 REST APIs for northbound VTN applications and supports virtual networks
104 spanning across multiple OpenDaylight by coordinating across
105 OpenDaylight.
106
107 For VTN Coordinator REST API, please refer to:
108 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:VTN_Coordinator:RestApi
109
110 Network Virtualization Function
111 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112
113 The user first defines a VTN. Then, the user maps the VTN to a physical
114 network, which enables communication to take place according to the VTN
115 definition. With the VTN definition, L2 and L3 transfer functions and
116 flow-based traffic control functions (filtering and redirect) are
117 possible.
118
119 Virtual Network Construction
120 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121
122 The following table shows the elements which make up the VTN. In the
123 VTN, a virtual network is constructed using virtual nodes (vBridge,
124 vRouter) and virtual interfaces and links. It is possible to configure a
125 network which has L2 and L3 transfer function, by connecting the virtual
126 intrefaces made on virtual nodes via virtual links.
127
128 +--------------------------------------+--------------------------------------+
129 | vBridge                              | The logical representation of L2     |
130 |                                      | switch function.                     |
131 +--------------------------------------+--------------------------------------+
132 | vRouter                              | The logical representation of router |
133 |                                      | function.                            |
134 +--------------------------------------+--------------------------------------+
135 | vTep                                 | The logical representation of Tunnel |
136 |                                      | End Point - TEP.                     |
137 +--------------------------------------+--------------------------------------+
138 | vTunnel                              | The logical representation of        |
139 |                                      | Tunnel.                              |
140 +--------------------------------------+--------------------------------------+
141 | vBypass                              | The logical representation of        |
142 |                                      | connectivity between controlled      |
143 |                                      | networks.                            |
144 +--------------------------------------+--------------------------------------+
145 | Virtual interface                    | The representation of end point on   |
146 |                                      | the virtual node.                    |
147 +--------------------------------------+--------------------------------------+
148 | Virtual Linkv(vLink)                 | The logical representation of L1     |
149 |                                      | connectivity between virtual         |
150 |                                      | interfaces.                          |
151 +--------------------------------------+--------------------------------------+
152
153 The following figure shows an example of a constructed virtual network.
154 VRT is defined as the vRouter, BR1 and BR2 are defined as vBridges.
155 interfaces of the vRouter and vBridges are connected using vLinks.
156
157 .. figure:: ./images/vtn/VTN_Construction.jpg
158    :alt: VTN Construction
159
160    VTN Construction
161
162 Mapping of Physical Network Resources
163 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164
165 Map physical network resources to the constructed virtual network.
166 Mapping identifies which virtual network each packet transmitted or
167 received by an OpenFlow switch belongs to, as well as which interface in
168 the OpenFlow switch transmits or receives that packet. There are two
169 mapping methods. When a packet is received from the OFS, port mapping is
170 first searched for the corresponding mapping definition, then VLAN
171 mapping is searched, and the packet is mapped to the relevant vBridge
172 according to the first matching mapping.
173
174 +--------------------------------------+--------------------------------------+
175 | Port mapping                         | Maps physical network resources to   |
176 |                                      | an interface of vBridge using Switch |
177 |                                      | ID, Port ID and VLAN ID of the       |
178 |                                      | incoming L2 frame. Untagged frame    |
179 |                                      | mapping is also supported.           |
180 +--------------------------------------+--------------------------------------+
181 | VLAN mapping                         | Maps physical network resources to a |
182 |                                      | vBridge using VLAN ID of the         |
183 |                                      | incoming L2 frame.Maps physical      |
184 |                                      | resources of a particular switch to  |
185 |                                      | a vBridge using switch ID and VLAN   |
186 |                                      | ID of the incoming L2 frame.         |
187 +--------------------------------------+--------------------------------------+
188 | MAC mapping                          | Maps physical resources to an        |
189 |                                      | interface of vBridge using MAC       |
190 |                                      | address of the incoming L2 frame(The |
191 |                                      | initial contribution does not        |
192 |                                      | include this method).                |
193 +--------------------------------------+--------------------------------------+
194
195 VTN can learn the terminal information from a terminal that is connected
196 to a switch which is mapped to VTN. Further, it is possible to refer
197 that terminal information on the VTN.
198
199 -  Learning terminal information VTN learns the information of a
200    terminal that belongs to VTN. It will store the MAC address and VLAN
201    ID of the terminal in relation to the port of the switch.
202
203 -  Aging of terminal information Terminal information, learned by the
204    VTN, will be maintained until the packets from terminal keep flowing
205    in VTN. If the terminal gets disconnected from the VTN, then the
206    aging timer will start clicking and the terminal information will be
207    maintained till timeout.
208
209 The following figure shows an example of mapping. An interface of BR1 is
210 mapped to port GBE0/1 of OFS1 using port mapping. Packets received from
211 GBE0/1 of OFS1 are regarded as those from the corresponding interface of
212 BR1. BR2 is mapped to VLAN 200 using VLAN mapping. Packets with VLAN tag
213 200 received from any ports of any OFSs are regarded as those from an
214 interface of BR2.
215
216 .. figure:: ./images/vtn/VTN_Mapping.jpg
217    :alt: VTN Mapping
218
219    VTN Mapping
220
221 vBridge Functions
222 ~~~~~~~~~~~~~~~~~
223
224 The vBridge provides the bridge function that transfers a packet to the
225 intended virtual port according to the destination MAC address. The
226 vBridge looks up the MAC address table and transmits the packet to the
227 corresponding virtual interface when the destination MAC address has
228 been learned. When the destination MAC address has not been learned, it
229 transmits the packet to all virtual interfaces other than the receiving
230 port (flooding). MAC addresses are learned as follows.
231
232 -  MAC address learning The vBridge learns the MAC address of the
233    connected host. The source MAC address of each received frame is
234    mapped to the receiving virtual interface, and this MAC address is
235    stored in the MAC address table created on a per-vBridge basis.
236
237 -  MAC address aging The MAC address stored in the MAC address table is
238    retained as long as the host returns the ARP reply. After the host is
239    disconnected, the address is retained until the aging timer times
240    out. To have the vBridge learn MAC addresses statically, you can
241    register MAC addresses manually.
242
243 vRouter Functions
244 ~~~~~~~~~~~~~~~~~
245
246 The vRouter transfers IPv4 packets between vBridges. The vRouter
247 supports routing, ARP learning, and ARP aging functions. The following
248 outlines the functions.
249
250 -  Routing function When an IP address is registered with a virtual
251    interface of the vRouter, the default routing information for that
252    interface is registered. It is also possible to statically register
253    routing information for a virtual interface.
254
255 -  ARP learning function The vRouter associates a destination IP
256    address, MAC address and a virtual interface, based on an ARP request
257    to its host or a reply packet for an ARP request, and maintains this
258    information in an ARP table prepared for each routing domain. The
259    registered ARP entry is retained until the aging timer, described
260    later, times out. The vRouter transmits an ARP request on an
261    individual aging timer basis and deletes the associated entry from
262    the ARP table if no reply is returned. For static ARP learning, you
263    can register ARP entry information manually.
264
265 -  DHCP relay agent function The vRouter also provides the DHCP relay
266    agent function.
267
268 Flow Filter Functions
269 ~~~~~~~~~~~~~~~~~~~~~
270
271 Flow Filter function is similar to ACL. It is possible to allow or
272 prohibit communication with only certain kind of packets that meet a
273 particular condition. Also, it can perform a processing called
274 Redirection - WayPoint routing, which is different from the existing
275 ACL. Flow Filter can be applied to any interface of a vNode within VTN,
276 and it is possible to the control the packets that pass interface. The
277 match conditions that could be specified in Flow Filter are as follows.
278 It is also possible to specify a combination of multiple conditions.
279
280 -  Source MAC address
281
282 -  Destination MAC address
283
284 -  MAC ether type
285
286 -  VLAN Priority
287
288 -  Source IP address
289
290 -  Destination IP address
291
292 -  DSCP
293
294 -  IP Protocol
295
296 -  TCP/UDP source port
297
298 -  TCP/UDP destination port
299
300 -  ICMP type
301
302 -  ICMP code
303
304 The types of Action that can be applied on packets that match the Flow
305 Filter conditions are given in the following table. It is possible to
306 make only those packets, which match a particular condition, to pass
307 through a particular server by specifying Redirection in Action. E.g.,
308 path of flow can be changed for each packet sent from a particular
309 terminal, depending upon the destination IP address. VLAN priority
310 control and DSCP marking are also supported.
311
312 +--------------------------------------+--------------------------------------+
313 | Action                               | Function                             |
314 +--------------------------------------+--------------------------------------+
315 | Pass                                 | Pass particular packets matching the |
316 |                                      | specified conditions.                |
317 +--------------------------------------+--------------------------------------+
318 | Drop                                 | Discards particular packets matching |
319 |                                      | the specified conditions.            |
320 +--------------------------------------+--------------------------------------+
321 | Redirection                          | Redirects the packet to a desired    |
322 |                                      | virtual interface. Both Transparent  |
323 |                                      | Redirection (not changing MAC        |
324 |                                      | address) and Router Redirection      |
325 |                                      | (changing MAC address) are           |
326 |                                      | supported.                           |
327 +--------------------------------------+--------------------------------------+
328
329 The following figure shows an example of how the flow filter function
330 works.
331
332 If there is any matching condition specified by flow filter when a
333 packet being transferred within a virtual network goes through a virtual
334 interface, the function evaluates the matching condition to see whether
335 the packet matches it. If the packet matches the condition, the function
336 applies the matching action specified by flow filter. In the example
337 shown in the figure, the function evaluates the matching condition at
338 BR1 and discards the packet if it matches the condition.
339
340 .. figure:: ./images/vtn/VTN_Flow_Filter.jpg
341    :alt: VTN FlowFilter
342
343    VTN FlowFilter
344
345 Multiple SDN Controller Coordination
346 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347
348 With the network abstractions, VTN enables to configure virtual network
349 across multiple SDN controllers. This provides highly scalable network
350 system.
351
352 VTN can be created on each SDN controller. If users would like to manage
353 those multiple VTNs with one policy, those VTNs can be integrated to a
354 single VTN.
355
356 As a use case, this feature is deployed to multi data center
357 environment. Even if those data centers are geographically separated and
358 controlled with different controllers, a single policy virtual network
359 can be realized with VTN.
360
361 Also, one can easily add a new SDN Controller to an existing VTN or
362 delete a particular SDN Controller from VTN.
363
364 In addition to this, one can define a VTN which covers both OpenFlow
365 network and Overlay network at the same time.
366
367 Flow Filter, which is set on the VTN, will be automatically applied on
368 the newly added SDN Controller.
369
370 Coordination between OpenFlow Network and L2/L3 Network
371 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372
373 It is possible to configure VTN on an environment where there is mix of
374 L2/L3 switches as well. L2/L3 switch will be shown on VTN as vBypass.
375 Flow Filter or policing cannot be configured for a vBypass. However, it
376 is possible to treat it as a virtual node inside VTN.
377
378 Virtual Tenant Network (VTN) API
379 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
380
381 VTN provides Web APIs. They are implemented by REST architecture and
382 provide the access to resources within VTN that are identified by URI.
383 User can perform the operations like GET/PUT/POST/DELETE against the
384 virtual network resources (e.g. vBridge or vRouter) by sending a message
385 to VTN through HTTPS communication in XML or JSON format.
386
387 .. figure:: ./images/vtn/VTN_API.jpg
388    :alt: VTN API
389
390    VTN API
391
392 Function Outline
393 ^^^^^^^^^^^^^^^^
394
395 VTN provides following operations for various network resources.
396
397 +----------------+----------------+----------------+----------------+----------------+
398 | Resources      | GET            | POST           | PUT            | DELETE         |
399 +----------------+----------------+----------------+----------------+----------------+
400 | VTN            | Yes            | Yes            | Yes            | Yes            |
401 +----------------+----------------+----------------+----------------+----------------+
402 | vBridge        | Yes            | Yes            | Yes            | Yes            |
403 +----------------+----------------+----------------+----------------+----------------+
404 | vRouter        | Yes            | Yes            | Yes            | Yes            |
405 +----------------+----------------+----------------+----------------+----------------+
406 | vTep           | Yes            | Yes            | Yes            | Yes            |
407 +----------------+----------------+----------------+----------------+----------------+
408 | vTunnel        | Yes            | Yes            | Yes            | Yes            |
409 +----------------+----------------+----------------+----------------+----------------+
410 | vBypass        | Yes            | Yes            | Yes            | Yes            |
411 +----------------+----------------+----------------+----------------+----------------+
412 | vLink          | Yes            | Yes            | Yes            | Yes            |
413 +----------------+----------------+----------------+----------------+----------------+
414 | Interface      | Yes            | Yes            | Yes            | Yes            |
415 +----------------+----------------+----------------+----------------+----------------+
416 | Port map       | Yes            | No             | Yes            | Yes            |
417 +----------------+----------------+----------------+----------------+----------------+
418 | Vlan map       | Yes            | Yes            | Yes            | Yes            |
419 +----------------+----------------+----------------+----------------+----------------+
420 | Flowfilter     | Yes            | Yes            | Yes            | Yes            |
421 | (ACL/redirect) |                |                |                |                |
422 +----------------+----------------+----------------+----------------+----------------+
423 | Controller     | Yes            | Yes            | Yes            | Yes            |
424 | information    |                |                |                |                |
425 +----------------+----------------+----------------+----------------+----------------+
426 | Physical       | Yes            | No             | No             | No             |
427 | topology       |                |                |                |                |
428 | information    |                |                |                |                |
429 +----------------+----------------+----------------+----------------+----------------+
430 | Alarm          | Yes            | No             | No             | No             |
431 | information    |                |                |                |                |
432 +----------------+----------------+----------------+----------------+----------------+
433
434 Example usage
435 ^^^^^^^^^^^^^
436
437 The following is an example of the usage to construct a virtual network.
438
439 -  Create VTN
440
441 ::
442
443        curl --user admin:adminpass -X POST -H 'content-type: application/json'  \
444       -d '{"vtn":{"vtn_name":"VTN1"}}' http://172.1.0.1:8083/vtn-webapi/vtns.json
445
446 -  Create Controller Information
447
448 ::
449
450        curl --user admin:adminpass -X POST -H 'content-type: application/json'  \
451       -d '{"controller": {"controller_id":"CONTROLLER1","ipaddr":"172.1.0.1","type":"odc","username":"admin", \
452       "password":"admin","version":"1.0"}}' http://172.1.0.1:8083/vtn-webapi/controllers.json
453
454 -  Create vBridge under VTN
455
456 ::
457
458       curl --user admin:adminpass -X POST -H 'content-type: application/json' \
459       -d '{"vbridge":{"vbr_name":"VBR1","controller_id": "CONTROLLER1","domain_id": "(DEFAULT)"}}' \
460       http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges.json
461
462 -  Create the interface under vBridge
463
464 ::
465
466       curl --user admin:adminpass -X POST -H 'content-type: application/json' \
467       -d '{"interface":{"if_name":"IF1"}}' http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges/VBR1/interfaces.json
468
469 VTN OpenStack Configuration
470 ---------------------------
471
472 This guide describes how to set up OpenStack for integration with
473 OpenDaylight Controller.
474
475 While OpenDaylight Controller provides several ways to integrate with
476 OpenStack, this guide focus on the way which uses VTN features available
477 on OpenDaylight. In the integration, VTN Manager work as network service
478 provider for OpenStack.
479
480 VTN Manager features, enable OpenStack to work in pure OpenFlow
481 environment in which all switches in data plane are OpenFlow switch.
482
483 Requirements
484 ~~~~~~~~~~~~
485
486 -  OpenDaylight Controller. (VTN features must be installed)
487
488 -  OpenStack Control Node.
489
490 -  OpenStack Compute Node.
491
492 -  OpenFlow Switch like mininet(Not Mandatory).
493
494 The VTN features support multiple OpenStack nodes. You can deploy
495 multiple OpenStack Compute Nodes. In management plane, OpenDaylight
496 Controller, OpenStack nodes and OpenFlow switches should communicate
497 with each other. In data plane, Open vSwitches running in OpenStack
498 nodes should communicate with each other through a physical or logical
499 OpenFlow switches. The core OpenFlow switches are not mandatory.
500 Therefore, you can directly connect to the Open vSwitch’s.
501
502 .. figure:: ./images/vtn/OpenStack_Demo_Picture.png
503    :alt: Openstack Overview
504
505    Openstack Overview
506
507 Sample Configuration
508 ~~~~~~~~~~~~~~~~~~~~
509
510 Below steps depicts the configuration of single OpenStack Control node
511 and OpenStack Compute node setup. Our test setup is as follows
512
513 .. figure:: ./images/vtn/vtn_devstack_setup.png
514    :alt: LAB Setup
515
516    LAB Setup
517
518 **Server Preparation**
519
520 -  Install Ubuntu 14.04 LTS in two servers (OpenStack Control node and
521    Compute node respectively)
522
523 -  While installing, Ubuntu mandates creation of a User, we created the
524    user "stack"(We will use the same user for running devstack)
525
526 -  Proceed with the below mentioned User Settings and Network Settings
527    in both the Control and Compute nodes.
528
529 **User Settings for devstack** - Login to both servers - Disable Ubuntu
530 Firewall
531
532 ::
533
534     sudo ufw disable
535
536 -  Install the below packages (optional, provides ifconfig and route
537    coammnds, handy for debugging!!)
538
539    ::
540
541        sudo apt-get install net-tools
542
543 -  Edit sudo vim /etc/sudoers and add an entry as follows
544
545    ::
546
547        stack ALL=(ALL) NOPASSWD: ALL
548
549 **Network Settings** - Checked the output of ifconfig -a, two interfaces
550 were listed eth0 and eth1 as indicated in the image above. - We had
551 connected eth0 interface to the Network where OpenDaylight is reachable.
552 - eth1 interface in both servers were connected to a different network
553 to act as data plane for the VM’s created using the OpenStack. -
554 Manually edited the file : sudo vim /etc/network/interfaces and made
555 entries as follows
556
557 ::
558
559      stack@ubuntu-devstack:~/devstack$ cat /etc/network/interfaces
560      # This file describes the network interfaces available on your system
561      # and how to activate them. For more information, see interfaces(5).
562      # The loop-back network interface
563      auto lo
564      iface lo inet loopback
565      # The primary network interface
566      auto eth0
567      iface eth0 inet static
568           address <IP_ADDRESS_TO_REACH_ODL>
569           netmask <NET_MASK>
570           broadcast <BROADCAST_IP_ADDRESS>
571           gateway <GATEWAY_IP_ADDRESS>
572     auto eth1
573     iface eth1 inet static
574          address <IP_ADDRESS_UNIQ>
575          netmask <NETMASK>
576
577 .. note::
578
579     Please ensure that the eth0 interface is the default route and it is
580     able to reach the ODL\_IP\_ADDRESS NOTE: The entries for eth1 are
581     not mandatory, If not set, we may have to manually do "ifup eth1"
582     after the stacking is complete to activate the interface
583
584 **Finalize the user and network settings** - Please reboot both nodes
585 after the user and network settings to have the network settings applied
586 to the network - Login again and check the output of ifconfig to ensure
587 that both interfaces are listed
588
589 OpenDaylight Settings and Execution
590 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
591
592 VTN Configuration for OpenStack Integration:
593 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
594
595 -  VTN uses the configuration parameters from "90-vtn-neutron.xml" file
596    for the OpenStack integration.
597
598 -  These values will be set for the OpenvSwitch, in all the
599    participating OpenStack nodes.
600
601 -  A configuration file "90-vtn-neutron.xml" will be generated
602    automatically by following the below steps,
603
604 -  Download the latest Boron karaf distribution from the below link,
605
606    ::
607
608        http://www.opendaylight.org/software/downloads
609
610 -  cd "distribution-karaf-0.5.0-Boron" and run karaf by using the
611    following command "./bin/karaf".
612
613 -  Install the below feature to generate "90-vtn-neutron.xml"
614
615 ::
616
617      feature:install odl-vtn-manager-neutron
618
619 -  Logout from the karaf console and Check "90-vtn-neutron.xml" file
620    from the following path
621    "distribution-karaf-0.5.0-Boron/etc/opendaylight/karaf/".
622
623 -  The contents of "90-vtn-neutron.xml" should be as follows:
624
625 bridgename=br-int portname=eth1 protocols=OpenFlow13 failmode=secure
626
627 -  The values of the configuration parameters must be changed based on
628    the user environment.
629
630 -  Especially, "portname" should be carefully configured, because if the
631    value is wrong, OpenDaylight fails to forward packets.
632
633 -  Other parameters works fine as is for general use cases.
634
635    -  bridgename
636
637       -  The name of the bridge in Open vSwitch, that will be created by
638          OpenDaylight Controller.
639
640       -  It must be "br-int".
641
642    -  portname
643
644       -  The name of the port that will be created in the vbridge in
645          Open vSwitch.
646
647       -  This must be the same name of the interface of OpenStack Nodes
648          which is used for interconnecting OpenStack Nodes in data
649          plane.(in our case:eth1)
650
651       -  By default, if 90-vtn-neutron.xml is not created, VTN uses
652          ens33 as portname.
653
654    -  protocols
655
656       -  OpenFlow protocol through which OpenFlow Switch and Controller
657          communicate.
658
659       -  The values can be OpenFlow13 or OpenFlow10.
660
661    -  failmode
662
663       -  The value can be "standalone" or "secure".
664
665       -  Please use "secure" for general use cases.
666
667 Start ODL Controller
668 ^^^^^^^^^^^^^^^^^^^^
669
670 -  Please refer to the Installation Pages to run ODL with VTN Feature
671    enabled.
672
673 -  After running ODL Controller, please ensure ODL Controller listens to
674    the ports:6633,6653, 6640 and 8080
675
676 -  Please allow the ports in firewall for the devstack to be able to
677    communicate with ODL Controller.
678
679 .. note::
680
681     -  6633/6653 - OpenFlow Ports
682
683     -  6640 - OVS Manager Port
684
685     -  8080 - Port for REST API
686
687 Devstack Setup
688 ~~~~~~~~~~~~~~
689
690 Get Devstack (All nodes)
691 ^^^^^^^^^^^^^^^^^^^^^^^^
692
693 -  Install git application using
694
695    -  sudo apt-get install git
696
697 -  Get devstack
698
699    -  git clone https://git.openstack.org/openstack-dev/devstack;
700
701 -  Switch to stable/Juno Version branch
702
703    -  cd devstack
704
705       ::
706
707           git checkout stable/juno
708
709 .. note::
710
711     If you want to use stable/kilo Version branch, Please execute the
712     below command in devstack folder
713
714 ::
715
716     git checkout stable/kilo
717
718 .. note::
719
720     If you want to use stable/liberty Version branch, Please execute the
721     below command in devstack folder
722
723 ::
724
725     git checkout stable/liberty
726
727 Stack Control Node
728 ^^^^^^^^^^^^^^^^^^
729
730 -  local.conf:
731
732 -  cd devstack in the controller node
733
734 -  Copy the contents of local.conf for juno (devstack control node) from
735    https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack
736    and save it as "local.conf" in the "devstack".
737
738 -  Copy the contents of local.conf for kilo and liberty (devstack
739    control node) from
740    https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack_post_juno_versions
741    and save it as "local.conf" in the "devstack".
742
743 -  Please modify the IP Address values as required.
744
745 -  Stack the node
746
747    ::
748
749        ./stack.sh
750
751 Verify Control Node stacking
752 ''''''''''''''''''''''''''''
753
754 -  stack.sh prints out Horizon is now available at
755    `http://<CONTROL\_NODE\_IP\_ADDRESS>:8080/ <http://<CONTROL_NODE_IP_ADDRESS>:8080/>`__
756
757 -  Execute the command *sudo ovs-vsctl show* in the control node
758    terminal and verify if the bridge *br-int* is created.
759
760 -  Typical output of the ovs-vsctl show is indicated below:
761
762 ::
763
764     e232bbd5-096b-48a3-a28d-ce4a492d4b4f
765        Manager "tcp:192.168.64.73:6640"
766            is_connected: true
767        Bridge br-int
768            Controller "tcp:192.168.64.73:6633"
769                is_connected: true
770            fail_mode: secure
771            Port "eth1"
772               Interface "eth1"
773        ovs_version: "2.0.2"
774
775 Stack Compute Node
776 ^^^^^^^^^^^^^^^^^^
777
778 -  local.conf:
779
780 -  cd devstack in the controller node
781
782 -  Copy the contents of local.conf for juno (devstack compute node) from
783    https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack
784    and save it as "local.conf" in the "devstack".
785
786 -  Copy the contents of local.conf file for kilo and liberty (devstack
787    compute node) from
788    https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack_post_juno_versions
789    and save it as "local.conf" in the "devstack".
790
791 -  Please modify the IP Address values as required.
792
793 -  Stack the node
794
795    ::
796
797        ./stack.sh
798
799 Verify Compute Node Stacking
800 ''''''''''''''''''''''''''''
801
802 -  stack.sh prints out This is your host ip:
803    <COMPUTE\_NODE\_IP\_ADDRESS>
804
805 -  Execute the command *sudo ovs-vsctl show* in the control node
806    terminal and verify if the bridge *br-int* is created.
807
808 -  The output of the ovs-vsctl show will be similar to the one seen in
809    control node.
810
811 Additional Verifications
812 ^^^^^^^^^^^^^^^^^^^^^^^^
813
814 -  Please visit the OpenDaylight DLUX GUI after stacking all the nodes,
815    `http://<ODL\_IP\_ADDRESS>:8181/index.html <http://<ODL_IP_ADDRESS>:8181/index.html>`__.
816    The switches, topology and the ports that are currently read can be
817    validated.
818
819 ::
820
821     http://<controller-ip>:8181/index.html
822
823     **Tip**
824
825     If the interconnected between the Open vSwitch is not seen, Please
826     bring up the interface for the dataplane manually using the below
827     comamnd
828
829 ::
830
831     ifup <interface_name>
832
833 -  Please Accept Promiscuous mode in the networks involving the
834    interconnect.
835
836 Create VM from Devstack Horizon GUI
837 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
838
839 -  Login to
840    `http://<CONTROL\_NODE\_IP>:8080/ <http://<CONTROL_NODE_IP>:8080/>`__
841    to check the horizon GUI.
842
843 .. figure:: ./images/vtn/OpenStackGui.png
844    :alt: Horizon GUI
845
846    Horizon GUI
847
848 Enter the value for User Name as admin and enter the value for Password
849 as labstack.
850
851 -  We should first ensure both the hypervisors(control node and compute
852    node) are mapped under hypervisors by clicking on Hpervisors tab.
853
854 .. figure:: ./images/vtn/Hypervisors.png
855    :alt: Hypervisors
856
857    Hypervisors
858
859 -  Create a new Network from Horizon GUI.
860
861 -  Click on Networks Tab.
862
863 -  click on the Create Network button.
864
865 .. figure:: ./images/vtn/Create_Network.png
866    :alt: Create Network
867
868    Create Network
869
870 -  A popup screen will appear.
871
872 -  Enter network name and click Next button.
873
874 .. figure:: ./images/vtn/Creare_Network_Step_1.png
875    :alt: Step 1
876
877    Step 1
878
879 -  Create a sub network by giving Network Address and click Next button
880    .
881
882 .. figure:: ./images/vtn/Create_Network_Step_2.png
883    :alt: Step 2
884
885    Step 2
886
887 -  Specify the additional details for subnetwork (please refer the image
888    for your reference).
889
890 .. figure:: ./images/vtn/Create_Network_Step_3.png
891    :alt: Step 3
892
893    Step 3
894
895 -  Click Create button
896
897 -  Create VM Instance
898
899 -  Navigate to Instances tab in the GUI.
900
901 .. figure:: ./images/vtn/Instance_Creation.png
902    :alt: Instance Creation
903
904    Instance Creation
905
906 -  Click on Launch Instances button.
907
908 .. figure:: ./images/vtn/Launch_Instance.png
909    :alt: Launch Instance
910
911    Launch Instance
912
913 -  Click on Details tab to enter the VM details.For this demo we are
914    creating Ten VM’s(instances).
915
916 -  In the Networking tab, we must select the network,for this we need to
917    drag and drop the Available networks to Selected Networks (i.e.,)
918    Drag vtn1 we created from Available networks to Selected Networks and
919    click Launch to create the instances.
920
921 .. figure:: ./images/vtn/Launch_Instance_network.png
922    :alt: Launch Network
923
924    Launch Network
925
926 -  Ten VM’s will be created.
927
928 .. figure:: ./images/vtn/Load_All_Instances.png
929    :alt: Load All Instances
930
931    Load All Instances
932
933 -  Click on any VM displayed in the Instances tab and click the Console
934    tab.
935
936 .. figure:: ./images/vtn/Instance_Console.png
937    :alt: Instance Console
938
939    Instance Console
940
941 -  Login to the VM console and verify with a ping command.
942
943 .. figure:: ./images/vtn/Instance_ping.png
944    :alt: Ping
945
946    Ping
947
948 Verification of Control and Compute Node after VM creation
949 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
950
951 -  Every time a new VM is created, more interfaces are added to the
952    br-int bridge in Open vSwitch.
953
954 -  Use *sudo ovs-vsctl show* to list the number of interfaces added.
955
956 -  Please visit the DLUX GUI to list the new nodes in every switch.
957
958 Getting started with DLUX
959 ^^^^^^^^^^^^^^^^^^^^^^^^^
960
961 Ensure that you have created a topology and enabled MD-SAL feature in
962 the Karaf distribution before you use DLUX for network management.
963
964 Logging In
965 ^^^^^^^^^^
966
967 To log in to DLUX, after installing the application: \* Open a browser
968 and enter the login URL. If you have installed DLUX as a stand-alone,
969 then the login URL is http://localhost:9000/DLUX/index.html. However if
970 you have deployed DLUX with Karaf, then the login URL is
971 `http://\\<your <http://\<your>`__ IP\\>:8181/dlux/index.html. \* Login
972 to the application with user ID and password credentials as admin.
973 NOTE:admin is the only user type available for DLUX in this release.
974
975 Working with DLUX
976 ^^^^^^^^^^^^^^^^^
977
978 To get a complete DLUX feature list, install restconf, odl l2 switch,
979 and switch while you start the DLUX distribution.
980
981 .. figure:: ./images/vtn/Dlux_login.png
982    :alt: DLUX\_GUI
983
984    DLUX\_GUI
985
986 .. note::
987
988     DLUX enables only those modules, whose APIs are responding. If you
989     enable just the MD-SAL in beginning and then start dlux, only MD-SAL
990     related tabs will be visible. While using the GUI if you enable
991     AD-SAL karaf features, those tabs will appear automatically.
992
993 Viewing Network Statistics
994 ^^^^^^^^^^^^^^^^^^^^^^^^^^
995
996 The Nodes module on the left pane enables you to view the network
997 statistics and port information for the switches in the network. \* To
998 use the Nodes module: \*\* Select Nodeson the left pane.
999
1000 ::
1001
1002     The right pane displays atable that lists all the nodes, node connectors and the statistics.
1003
1004 -  Enter a node ID in the Search Nodes tab to search by node connectors.
1005
1006 -  Click on the Node Connector number to view details such as port ID,
1007    port name, number of ports per switch, MAC Address, and so on.
1008
1009 -  Click Flows in the Statistics column to view Flow Table Statistics
1010    for the particular node like table ID, packet match, active flows and
1011    so on.
1012
1013 -  Click Node Connectors to view Node Connector Statistics for the
1014    particular node ID.
1015
1016 Viewing Network Topology
1017 ^^^^^^^^^^^^^^^^^^^^^^^^
1018
1019 To view network topology: \* Select Topology on the left pane. You will
1020 view the graphical representation on the right pane.
1021
1022 ::
1023
1024     In the diagram
1025     blue boxes represent the switches,black represents the hosts available, and lines represents how switches are connected.
1026
1027 .. note::
1028
1029     DLUX UI does not provide ability to add topology information. The
1030     Topology should be created using an open flow plugin. Controller
1031     stores this information in the database and displays on the DLUX
1032     page, when the you connect to the controller using OpenFlow.
1033
1034 .. figure:: ./images/vtn/Dlux_topology.png
1035    :alt: Topology
1036
1037    Topology
1038
1039 OpenStack PackStack Installation Steps
1040 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1041
1042 -  Please go through the below wiki page for OpenStack PackStack
1043    installation steps.
1044
1045    -  https://wiki.opendaylight.org/view/Release/Lithium/VTN/User_Guide/Openstack_Packstack_Support
1046
1047 References
1048 ~~~~~~~~~~
1049
1050 -  http://devstack.org/guides/multinode-lab.html
1051
1052 -  https://wiki.opendaylight.org/view/File:Vtn_demo_hackfest_2014_march.pdf
1053
1054 VTN Manager Usage Examples
1055 --------------------------
1056
1057 How to provision virtual L2 Network
1058 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1059
1060 Overview
1061 ^^^^^^^^
1062
1063 This page explains how to provision virtual L2 network using VTN
1064 Manager. This page targets Boron release, so the procedure described
1065 here does not work in other releases.
1066
1067 .. figure:: ./images/vtn/How_to_provision_virtual_L2_network.png
1068    :alt: Virtual L2 network for host1 and host3
1069
1070    Virtual L2 network for host1 and host3
1071
1072 Requirements
1073 ^^^^^^^^^^^^
1074
1075 Mininet
1076 '''''''
1077
1078 -  To provision OpenFlow switches, this page uses Mininet. Mininet
1079    details and set-up can be referred at the following page:
1080    https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
1081
1082 -  Start Mininet and create three switches(s1, s2, and s3) and four
1083    hosts(h1, h2, h3, and h4) in it.
1084
1085 ::
1086
1087      mininet@mininet-vm:~$ sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
1088
1089 .. note::
1090
1091     Replace "192.168.0.100" with the IP address of OpenDaylight
1092     controller based on your environment.
1093
1094 -  you can check the topology that you have created by executing "net"
1095    command in the Mininet console.
1096
1097 ::
1098
1099      mininet> net
1100      h1 h1-eth0:s2-eth1
1101      h2 h2-eth0:s2-eth2
1102      h3 h3-eth0:s3-eth1
1103      h4 h4-eth0:s3-eth2
1104      s1 lo:  s1-eth1:s2-eth3 s1-eth2:s3-eth3
1105      s2 lo:  s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
1106      s3 lo:  s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
1107
1108 -  In this guide, you will provision the virtual L2 network to establish
1109    communication between h1 and h3.
1110
1111 Configuration
1112 ^^^^^^^^^^^^^
1113
1114 To provision the virtual L2 network for the two hosts (h1 and h3),
1115 execute REST API provided by VTN Manager as follows. It uses curl
1116 command to call the REST API.
1117
1118 -  Create a virtual tenant named vtn1 by executing `the update-vtn
1119    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1120
1121 ::
1122
1123     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1124
1125 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1126    `the update-vbridge
1127    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1128
1129 ::
1130
1131     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1"}}'
1132
1133 -  Create two interfaces into the virtual bridge by executing `the
1134    update-vinterface
1135    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1136
1137 ::
1138
1139     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1"}}'
1140
1141 ::
1142
1143     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2"}}'
1144
1145 -  Configure two mappings on the created interfaces by executing `the
1146    set-port-map
1147    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1148
1149    -  The interface if1 of the virtual bridge will be mapped to the port
1150       "s2-eth1" of the switch "openflow:2" of the Mininet.
1151
1152       -  The h1 is connected to the port "s2-eth1".
1153
1154    -  The interface if2 of the virtual bridge will be mapped to the port
1155       "s3-eth1" of the switch "openflow:3" of the Mininet.
1156
1157       -  The h3 is connected to the port "s3-eth1".
1158
1159 ::
1160
1161     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:2", "port-name":"s2-eth1"}}'
1162
1163 ::
1164
1165     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth1"}}'
1166
1167 Verification
1168 ^^^^^^^^^^^^
1169
1170 -  Please execute ping from h1 to h3 to verify if the virtual L2 network
1171    for h1 and h3 is provisioned successfully.
1172
1173 ::
1174
1175      mininet> h1 ping h3
1176      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
1177      64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=243 ms
1178      64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.341 ms
1179      64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.078 ms
1180      64 bytes from 10.0.0.3: icmp_seq=4 ttl=64 time=0.079 ms
1181
1182 -  You can also verify the configuration by executing the following REST
1183    API. It shows all configuration in VTN Manager.
1184
1185 ::
1186
1187     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/
1188
1189 -  The result of the command should be like this.
1190
1191 ::
1192
1193     {
1194       "vtns": {
1195         "vtn": [
1196         {
1197           "name": "vtn1",
1198             "vtenant-config": {
1199               "idle-timeout": 300,
1200               "hard-timeout": 0
1201             },
1202             "vbridge": [
1203             {
1204               "name": "vbr1",
1205               "bridge-status": {
1206                 "state": "UP",
1207                 "path-faults": 0
1208               },
1209               "vbridge-config": {
1210                 "age-interval": 600
1211               },
1212               "vinterface": [
1213               {
1214                 "name": "if2",
1215                 "vinterface-status": {
1216                   "entity-state": "UP",
1217                   "state": "UP",
1218                   "mapped-port": "openflow:3:3"
1219                 },
1220                 "vinterface-config": {
1221                   "enabled": true
1222                 },
1223                 "port-map-config": {
1224                   "vlan-id": 0,
1225                   "port-name": "s3-eth1",
1226                   "node": "openflow:3"
1227                 }
1228               },
1229               {
1230                 "name": "if1",
1231                 "vinterface-status": {
1232                   "entity-state": "UP",
1233                   "state": "UP",
1234                   "mapped-port": "openflow:2:1"
1235                 },
1236                 "vinterface-config": {
1237                   "enabled": true
1238                 },
1239                 "port-map-config": {
1240                   "vlan-id": 0,
1241                   "port-name": "s2-eth1",
1242                   "node": "openflow:2"
1243                 }
1244               }
1245               ]
1246             }
1247           ]
1248         }
1249         ]
1250       }
1251     }
1252
1253 Cleaning Up
1254 ^^^^^^^^^^^
1255
1256 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
1257    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
1258
1259 ::
1260
1261     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1262
1263 How To Test Vlan-Map In Mininet Environment
1264 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1265
1266 Overview
1267 ^^^^^^^^
1268
1269 This page explains how to test Vlan-map in a multi host scenario using
1270 mininet. This page targets Boron release, so the procedure described
1271 here does not work in other releases.
1272
1273 .. figure:: ./images/vtn/vlanmap_using_mininet.png
1274    :alt: Example that demonstrates vlanmap testing in Mininet
1275    Environment
1276
1277    Example that demonstrates vlanmap testing in Mininet Environment
1278
1279 Requirements
1280 ^^^^^^^^^^^^
1281
1282 Save the mininet script given below as vlan\_vtn\_test.py and run the
1283 mininet script in the mininet environment where Mininet is installed.
1284
1285 Mininet Script
1286 ^^^^^^^^^^^^^^
1287
1288 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
1289
1290 -  Run the mininet script
1291
1292 ::
1293
1294     sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
1295
1296 .. note::
1297
1298     Replace "192.168.64.13" with the IP address of OpenDaylight
1299     controller based on your environment.
1300
1301 -  You can check the topology that you have created by executing "net"
1302    command in the Mininet console.
1303
1304 ::
1305
1306      mininet> net
1307      h1 h1-eth0.200:s1-eth1
1308      h2 h2-eth0.300:s2-eth2
1309      h3 h3-eth0.200:s2-eth3
1310      h4 h4-eth0.300:s2-eth4
1311      h5 h5-eth0.200:s3-eth2
1312      h6 h6-eth0.300:s3-eth3
1313      s1 lo:  s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
1314      s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
1315      s3 lo:  s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
1316      c0
1317
1318 Configuration
1319 ^^^^^^^^^^^^^
1320
1321 To test vlan-map, execute REST API provided by VTN Manager as follows.
1322
1323 -  Create a virtual tenant named vtn1 by executing `the update-vtn
1324    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1325
1326 ::
1327
1328     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1329
1330 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1331    `the update-vbridge
1332    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1333
1334 ::
1335
1336     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
1337
1338 -  Configure a vlan map with vlanid 200 for vBridge vbr1 by executing
1339    `the add-vlan-map
1340    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vlan-map.html#add-vlan-map>`__.
1341
1342 ::
1343
1344     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vlan-map:add-vlan-map -d '{"input":{"vlan-id":200,"tenant-name":"vtn1","bridge-name":"vbr1"}}'
1345
1346 -  Create a virtual bridge named vbr2 in the tenant vtn1 by executing
1347    `the update-vbridge
1348    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1349
1350 ::
1351
1352     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr2"}}'
1353
1354 -  Configure a vlan map with vlanid 300 for vBridge vbr2 by executing
1355    `the add-vlan-map
1356    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vlan-map.html#add-vlan-map>`__.
1357
1358 ::
1359
1360     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vlan-map:add-vlan-map -d '{"input":{"vlan-id":300,"tenant-name":"vtn1","bridge-name":"vbr2"}}'
1361
1362 Verification
1363 ^^^^^^^^^^^^
1364
1365 -  Please execute pingall in mininet environment to view the host
1366    reachability.
1367
1368 ::
1369
1370      mininet> pingall
1371      Ping: testing ping reachability
1372      h1 -> X h3 X h5 X
1373      h2 -> X X h4 X h6
1374      h3 -> h1 X X h5 X
1375      h4 -> X h2 X X h6
1376      h5 -> h1 X h3 X X
1377      h6 -> X h2 X h4 X
1378
1379 -  You can also verify the configuration by executing the following REST
1380    API. It shows all configurations in VTN Manager.
1381
1382 ::
1383
1384     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1385
1386 -  The result of the command should be like this.
1387
1388 ::
1389
1390     {
1391       "vtns": {
1392         "vtn": [
1393         {
1394           "name": "vtn1",
1395             "vtenant-config": {
1396               "hard-timeout": 0,
1397               "idle-timeout": 300,
1398               "description": "creating vtn"
1399             },
1400             "vbridge": [
1401             {
1402               "name": "vbr2",
1403               "vbridge-config": {
1404                 "age-interval": 600,
1405                 "description": "creating vbr2"
1406               },
1407               "bridge-status": {
1408                 "state": "UP",
1409                 "path-faults": 0
1410               },
1411               "vlan-map": [
1412               {
1413                 "map-id": "ANY.300",
1414                 "vlan-map-config": {
1415                   "vlan-id": 300
1416                 },
1417                 "vlan-map-status": {
1418                   "active": true
1419                 }
1420               }
1421               ]
1422             },
1423             {
1424               "name": "vbr1",
1425               "vbridge-config": {
1426                 "age-interval": 600,
1427                 "description": "creating vbr1"
1428               },
1429               "bridge-status": {
1430                 "state": "UP",
1431                 "path-faults": 0
1432               },
1433               "vlan-map": [
1434               {
1435                 "map-id": "ANY.200",
1436                 "vlan-map-config": {
1437                   "vlan-id": 200
1438                 },
1439                 "vlan-map-status": {
1440                   "active": true
1441                 }
1442               }
1443               ]
1444             }
1445           ]
1446         }
1447         ]
1448       }
1449     }
1450
1451 Cleaning Up
1452 ^^^^^^^^^^^
1453
1454 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
1455    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
1456
1457 ::
1458
1459     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1460
1461 How To Configure Service Function Chaining using VTN Manager
1462 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1463
1464 Overview
1465 ^^^^^^^^
1466
1467 This page explains how to configure VTN Manager for Service Chaining.
1468 This page targets Boron release, so the procedure described here
1469 does not work in other releases.
1470
1471 .. figure:: ./images/vtn/Service_Chaining_With_One_Service.png
1472    :alt: Service Chaining With One Service
1473
1474    Service Chaining With One Service
1475
1476 Requirements
1477 ^^^^^^^^^^^^
1478
1479 -  Please refer to the `Installation
1480    Pages <https://wiki.opendaylight.org/view/VTN:Boron:Installation_Guide>`__
1481    to run ODL with VTN Feature enabled.
1482
1483 -  Please ensure Bridge-Utils package is installed in mininet
1484    environment before running the mininet script.
1485
1486 -  To install Bridge-Utils package run sudo apt-get install bridge-utils
1487    (assuming Ubuntu is used to run mininet, If not then this is not
1488    required).
1489
1490 -  Save the mininet script given below as topo\_handson.py and run the
1491    mininet script in the mininet environment where Mininet is installed.
1492
1493 Mininet Script
1494 ^^^^^^^^^^^^^^
1495
1496 -  `Script for emulating network with multiple
1497    hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet>`__.
1498
1499 -  Before executing the mininet script, please confirm Controller is up
1500    and running.
1501
1502 -  Run the mininet script.
1503
1504 -  Replace <path> and <Controller IP> based on your environment
1505
1506 ::
1507
1508     sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
1509
1510 ::
1511
1512      mininet> net
1513      h11 h11-eth0:s1-eth1
1514      h12 h12-eth0:s1-eth2
1515      h21 h21-eth0:s2-eth1
1516      h22 h22-eth0:s2-eth2
1517      h23 h23-eth0:s2-eth3
1518      srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
1519      srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
1520      s1 lo:  s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
1521      s2 lo:  s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
1522      s3 lo:  s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
1523      s4 lo:  s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
1524
1525 Configurations
1526 ^^^^^^^^^^^^^^
1527
1528 Mininet
1529 '''''''
1530
1531 -  Please follow the below steps to configure the network in mininet as
1532    in the below image:
1533
1534 .. figure:: ./images/vtn/Mininet_Configuration.png
1535    :alt: Mininet Configuration
1536
1537    Mininet Configuration
1538
1539 Configure service nodes
1540 '''''''''''''''''''''''
1541
1542 -  Please execute the following commands in the mininet console where
1543    mininet script is executed.
1544
1545 ::
1546
1547      mininet> srvc1 ip addr del 10.0.0.6/8 dev srvc1-eth0
1548      mininet> srvc1 brctl addbr br0
1549      mininet> srvc1 brctl addif br0 srvc1-eth0
1550      mininet> srvc1 brctl addif br0 srvc1-eth1
1551      mininet> srvc1 ifconfig br0 up
1552      mininet> srvc1 tc qdisc add dev srvc1-eth1 root netem delay 200ms
1553      mininet> srvc2 ip addr del 10.0.0.7/8 dev srvc2-eth0
1554      mininet> srvc2 brctl addbr br0
1555      mininet> srvc2 brctl addif br0 srvc2-eth0
1556      mininet> srvc2 brctl addif br0 srvc2-eth1
1557      mininet> srvc2 ifconfig br0 up
1558      mininet> srvc2 tc qdisc add dev srvc2-eth1 root netem delay 300ms
1559
1560 Controller
1561 ^^^^^^^^^^
1562
1563 Multi-Tenancy
1564 '''''''''''''
1565
1566 -  Please execute the below commands to configure the network topology
1567    in the controller as in the below image:
1568
1569 .. figure:: ./images/vtn/Tenant2.png
1570    :alt: Tenant2
1571
1572    Tenant2
1573
1574 Please execute the below commands in controller
1575 '''''''''''''''''''''''''''''''''''''''''''''''
1576
1577 .. note::
1578
1579     The below commands are for the difference in behavior of Manager in
1580     Boron topology. The Link below has the details for this bug:
1581     https://bugs.opendaylight.org/show_bug.cgi?id=3818.
1582
1583 ::
1584
1585     curl --user admin:admin -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X PUT http://localhost:8181/restconf/config/vtn-static-topology:vtn-static-topology/static-edge-ports -d '{"static-edge-ports": {"static-edge-port": [ {"port": "openflow:3:3"}, {"port": "openflow:3:4"}, {"port": "openflow:4:3"}, {"port": "openflow:4:4"}]}}'
1586
1587 -  Create a virtual tenant named vtn1 by executing `the update-vtn
1588    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1589
1590 ::
1591
1592     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1","update-mode":"CREATE","operation":"SET","description":"creating vtn","idle-timeout":300,"hard-timeout":0}}'
1593
1594 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1595    `the update-vbridge
1596    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1597
1598 ::
1599
1600     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"creating vbr","tenant-name":"vtn1","bridge-name":"vbr1"}}'
1601
1602 -  Create interface if1 into the virtual bridge vbr1 by executing `the
1603    update-vinterface
1604    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1605
1606 ::
1607
1608     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif1 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
1609
1610 -  Configure port mapping on the interface by executing `the
1611    set-port-map
1612    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1613
1614    -  The interface if1 of the virtual bridge will be mapped to the port
1615       "s1-eth2" of the switch "openflow:1" of the Mininet.
1616
1617       -  The h12 is connected to the port "s1-eth2".
1618
1619 ::
1620
1621     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","node":"openflow:1","port-name":"s1-eth2"}}'
1622
1623 -  Create interface if2 into the virtual bridge vbr1 by executing `the
1624    update-vinterface
1625    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1626
1627 ::
1628
1629     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif2 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
1630
1631 -  Configure port mapping on the interface by executing `the
1632    set-port-map
1633    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1634
1635    -  The interface if2 of the virtual bridge will be mapped to the port
1636       "s2-eth2" of the switch "openflow:2" of the Mininet.
1637
1638       -  The h22 is connected to the port "s2-eth2".
1639
1640 ::
1641
1642     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2","node":"openflow:2","port-name":"s2-eth2"}}'
1643
1644 -  Create interface if3 into the virtual bridge vbr1 by executing `the
1645    update-vinterface
1646    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1647
1648 ::
1649
1650     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif3 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if3"}}'
1651
1652 -  Configure port mapping on the interfaces by executing `the
1653    set-port-map
1654    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1655
1656    -  The interface if3 of the virtual bridge will be mapped to the port
1657       "s2-eth3" of the switch "openflow:2" of the Mininet.
1658
1659       -  The h23 is connected to the port "s2-eth3".
1660
1661 ::
1662
1663     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if3","node":"openflow:2","port-name":"s2-eth3"}}'
1664
1665 Traffic filtering
1666 ^^^^^^^^^^^^^^^^^
1667
1668 -  Create flowcondition named cond\_1 by executing `the
1669    set-flow-condition
1670    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1671
1672    -  For option source and destination-network, get inet address of
1673       host h12(src) and h22(dst) from mininet.
1674
1675 ::
1676
1677     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"index":1,"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.2/32","destination-network":"10.0.0.4/32"}}]}}'
1678
1679 -  Flow filter demonstration with DROP action-type. Create Flowfilter in
1680    VBR Interface if1 by executing `the set-flow-filter
1681    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1682
1683 ::
1684
1685     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","index":10,"vtn-drop-filter":{}}]}}'
1686
1687 Service Chaining
1688 ^^^^^^^^^^^^^^^^
1689
1690 With One Service
1691 ''''''''''''''''
1692
1693 -  Please execute the below commands to configure the network topology
1694    which sends some specific traffic via a single service(External
1695    device) in the controller as in the below image:
1696
1697 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_LLD.png
1698    :alt: Service Chaining With One Service LLD
1699
1700    Service Chaining With One Service LLD
1701
1702 -  Create a virtual terminal named vt\_srvc1\_1 in the tenant vtn1 by
1703    executing `the update-vterminal
1704    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1705
1706 ::
1707
1708     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc1_1","description":"Creating vterminal"}}'
1709
1710 -  Create interface IF into the virtual terminal vt\_srvc1\_1 by
1711    executing `the update-vinterface
1712    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1713
1714 ::
1715
1716     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc1_1","interface-name":"IF"}}'
1717
1718 -  Configure port mapping on the interfaces by executing `the
1719    set-port-map
1720    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1721
1722    -  The interface IF of the virtual terminal will be mapped to the
1723       port "s3-eth3" of the switch "openflow:3" of the Mininet.
1724
1725       -  The h12 is connected to the port "s3-eth3".
1726
1727 ::
1728
1729     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc1_1","interface-name":"IF","node":"openflow:3","port-name":"s3-eth3"}}'
1730
1731 -  Create a virtual terminal named vt\_srvc1\_2 in the tenant vtn1 by
1732    executing `the update-vterminal
1733    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1734
1735 ::
1736
1737     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","description":"Creating vterminal"}}'
1738
1739 -  Create interface IF into the virtual terminal vt\_srvc1\_2 by
1740    executing `the update-vinterface
1741    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1742
1743 ::
1744
1745     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF"}}'
1746
1747 -  Configure port mapping on the interfaces by executing `the
1748    set-port-map
1749    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1750
1751    -  The interface IF of the virtual terminal will be mapped to the
1752       port "s4-eth3" of the switch "openflow:4" of the Mininet.
1753
1754       -  The h22 is connected to the port "s4-eth3".
1755
1756 ::
1757
1758     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","node":"openflow:4","port-name":"s4-eth3"}}'
1759
1760 -  Create flowcondition named cond\_1 by executing `the
1761    set-flow-condition
1762    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1763
1764    -  For option source and destination-network, get inet address of
1765       host h12(src) and h22(dst) from mininet.
1766
1767 ::
1768
1769     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"index":1,"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.2/32","destination-network":"10.0.0.4/32"}}]}}'
1770
1771 -  Create flowcondition named cond\_any by executing `the
1772    set-flow-condition
1773    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1774
1775 ::
1776
1777     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_any","vtn-flow-match":[{"index":1}]}}'
1778
1779 -  Flow filter demonstration with redirect action-type. Create
1780    Flowfilter in virtual terminal vt\_srvc1\_2 interface IF by executing
1781    `the set-flow-filter
1782    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1783
1784    -  Flowfilter redirects vt\_srvc1\_2 to bridge1-IF2
1785
1786 ::
1787
1788     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"bridge-name":"vbr1","interface-name":"if2"},"output":"true"}}]}}'
1789
1790 -  Flow filter demonstration with redirect action-type. Create
1791    Flowfilter in vbridge vbr1 interface if1 by executing `the
1792    set-flow-filter
1793    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1794
1795    -  Flow filter redirects Bridge1-IF1 to vt\_srvc1\_1
1796
1797 ::
1798
1799     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","index":10,"vtn-redirect-filter":{"redirect-destination":{"terminal-name":"vt_srvc1_1","interface-name":"IF"},"output":"true"}}]}}'
1800
1801 Verification
1802 ^^^^^^^^^^^^
1803
1804 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_Verification.png
1805    :alt: Service Chaining With One Service
1806
1807    Service Chaining With One Service
1808
1809 -  Ping host12 to host22 to view the host rechability, a delay of 200ms
1810    will be taken to reach host22 as below.
1811
1812 ::
1813
1814      mininet> h12 ping h22
1815      PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1816      64 bytes from 10.0.0.4: icmp_seq=35 ttl=64 time=209 ms
1817      64 bytes from 10.0.0.4: icmp_seq=36 ttl=64 time=201 ms
1818      64 bytes from 10.0.0.4: icmp_seq=37 ttl=64 time=200 ms
1819      64 bytes from 10.0.0.4: icmp_seq=38 ttl=64 time=200 ms
1820
1821 With two services
1822 '''''''''''''''''
1823
1824 -  Please execute the below commands to configure the network topology
1825    which sends some specific traffic via two services(External device)
1826    in the controller as in the below image.
1827
1828 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services_LLD.png
1829    :alt: Service Chaining With Two Services LLD
1830
1831    Service Chaining With Two Services LLD
1832
1833 -  Create a virtual terminal named vt\_srvc2\_1 in the tenant vtn1 by
1834    executing `the update-vterminal
1835    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1836
1837 ::
1838
1839     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc2_1","description":"Creating vterminal"}}'
1840
1841 -  Create interface IF into the virtual terminal vt\_srvc2\_1 by
1842    executing `the update-vinterface
1843    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1844
1845 ::
1846
1847     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc2_1","interface-name":"IF"}}'
1848
1849 -  Configure port mapping on the interfaces by executing `the
1850    set-port-map
1851    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1852
1853    -  The interface IF of the virtual terminal will be mapped to the
1854       port "s3-eth4" of the switch "openflow:3" of the Mininet.
1855
1856       -  The host h12 is connected to the port "s3-eth4".
1857
1858 ::
1859
1860     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc2_1","interface-name":"IF","node":"openflow:3","port-name":"s3-eth4"}}'
1861
1862 -  Create a virtual terminal named vt\_srvc2\_2 in the tenant vtn1 by
1863    executing `the update-vterminal
1864    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1865
1866 ::
1867
1868     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","description":"Creating vterminal"}}'
1869
1870 -  Create interfaces IF into the virtual terminal vt\_srvc2\_2 by
1871    executing `the update-vinterface
1872    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1873
1874 ::
1875
1876     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF"}}'
1877
1878 -  Configure port mapping on the interfaces by executing `the
1879    set-port-map
1880    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1881
1882    -  The interface IF of the virtual terminal will be mapped to the
1883       port "s4-eth4" of the switch "openflow:4" of the mininet.
1884
1885       -  The host h22 is connected to the port "s4-eth4".
1886
1887 ::
1888
1889     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF","node":"openflow:4","port-name":"s4-eth4"}}'
1890
1891 -  Flow filter demonstration with redirect action-type. Create
1892    Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1893    `the set-flow-filter
1894    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1895
1896    -  Flow filter redirects vt\_srvc2\_2 to Bridge1-IF2.
1897
1898 ::
1899
1900     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"bridge-name":"vbr1","interface-name":"if2"},"output":"true"}}]}}'
1901
1902 -  Flow filter demonstration with redirect action-type. Create
1903    Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1904    `the set-flow-filter
1905    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1906
1907    -  Flow filter redirects vt\_srvc1\_2 to vt\_srvc2\_1.
1908
1909 ::
1910
1911     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"terminal-name":"vt_srvc2_1","interface-name":"IF"},"output":"true"}}]}}'
1912
1913 Verification
1914 ^^^^^^^^^^^^
1915
1916 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services.png
1917    :alt: Service Chaining With Two Service
1918
1919    Service Chaining With Two Service
1920
1921 -  Ping host12 to host22 to view the host rechability, a delay of 500ms
1922    will be taken to reach host22 as below.
1923
1924 ::
1925
1926      mininet> h12 ping h22
1927      PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1928      64 bytes from 10.0.0.4: icmp_seq=1 ttl=64 time=512 ms
1929      64 bytes from 10.0.0.4: icmp_seq=2 ttl=64 time=501 ms
1930      64 bytes from 10.0.0.4: icmp_seq=3 ttl=64 time=500 ms
1931      64 bytes from 10.0.0.4: icmp_seq=4 ttl=64 time=500 ms
1932
1933 -  You can verify the configuration by executing the following REST API.
1934    It shows all configuration in VTN Manager.
1935
1936 ::
1937
1938     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1939
1940 ::
1941
1942     {
1943       "vtn": [
1944       {
1945         "name": "vtn1",
1946           "vtenant-config": {
1947             "hard-timeout": 0,
1948             "idle-timeout": 300,
1949             "description": "creating vtn"
1950           },
1951           "vbridge": [
1952           {
1953             "name": "vbr1",
1954             "vbridge-config": {
1955               "age-interval": 600,
1956               "description": "creating vbr"
1957             },
1958             "bridge-status": {
1959               "state": "UP",
1960               "path-faults": 0
1961             },
1962             "vinterface": [
1963             {
1964               "name": "if1",
1965               "vinterface-status": {
1966                 "mapped-port": "openflow:1:2",
1967                 "state": "UP",
1968                 "entity-state": "UP"
1969               },
1970               "port-map-config": {
1971                 "vlan-id": 0,
1972                 "node": "openflow:1",
1973                 "port-name": "s1-eth2"
1974               },
1975               "vinterface-config": {
1976                 "description": "Creating vbrif1 interface",
1977                 "enabled": true
1978               },
1979               "vinterface-input-filter": {
1980                 "vtn-flow-filter": [
1981                 {
1982                   "index": 10,
1983                   "condition": "cond_1",
1984                   "vtn-redirect-filter": {
1985                     "output": true,
1986                     "redirect-destination": {
1987                       "terminal-name": "vt_srvc1_1",
1988                       "interface-name": "IF"
1989                     }
1990                   }
1991                 }
1992                 ]
1993               }
1994             },
1995             {
1996               "name": "if2",
1997               "vinterface-status": {
1998                 "mapped-port": "openflow:2:2",
1999                 "state": "UP",
2000                 "entity-state": "UP"
2001               },
2002               "port-map-config": {
2003                 "vlan-id": 0,
2004                 "node": "openflow:2",
2005                 "port-name": "s2-eth2"
2006               },
2007               "vinterface-config": {
2008                 "description": "Creating vbrif2 interface",
2009                 "enabled": true
2010               }
2011             },
2012             {
2013               "name": "if3",
2014               "vinterface-status": {
2015                 "mapped-port": "openflow:2:3",
2016                 "state": "UP",
2017                 "entity-state": "UP"
2018               },
2019               "port-map-config": {
2020                 "vlan-id": 0,
2021                 "node": "openflow:2",
2022                 "port-name": "s2-eth3"
2023               },
2024               "vinterface-config": {
2025                 "description": "Creating vbrif3 interface",
2026                 "enabled": true
2027               }
2028             }
2029             ]
2030           }
2031         ],
2032           "vterminal": [
2033           {
2034             "name": "vt_srvc2_2",
2035             "bridge-status": {
2036               "state": "UP",
2037               "path-faults": 0
2038             },
2039             "vinterface": [
2040             {
2041               "name": "IF",
2042               "vinterface-status": {
2043                 "mapped-port": "openflow:4:4",
2044                 "state": "UP",
2045                 "entity-state": "UP"
2046               },
2047               "port-map-config": {
2048                 "vlan-id": 0,
2049                 "node": "openflow:4",
2050                 "port-name": "s4-eth4"
2051               },
2052               "vinterface-config": {
2053                 "description": "Creating vterminal IF",
2054                 "enabled": true
2055               },
2056               "vinterface-input-filter": {
2057                 "vtn-flow-filter": [
2058                 {
2059                   "index": 10,
2060                   "condition": "cond_any",
2061                   "vtn-redirect-filter": {
2062                     "output": true,
2063                     "redirect-destination": {
2064                       "bridge-name": "vbr1",
2065                       "interface-name": "if2"
2066                     }
2067                   }
2068                 }
2069                 ]
2070               }
2071             }
2072             ],
2073               "vterminal-config": {
2074                 "description": "Creating vterminal"
2075               }
2076           },
2077           {
2078             "name": "vt_srvc1_1",
2079             "bridge-status": {
2080               "state": "UP",
2081               "path-faults": 0
2082             },
2083             "vinterface": [
2084             {
2085               "name": "IF",
2086               "vinterface-status": {
2087                 "mapped-port": "openflow:3:3",
2088                 "state": "UP",
2089                 "entity-state": "UP"
2090               },
2091               "port-map-config": {
2092                 "vlan-id": 0,
2093                 "node": "openflow:3",
2094                 "port-name": "s3-eth3"
2095               },
2096               "vinterface-config": {
2097                 "description": "Creating vterminal IF",
2098                 "enabled": true
2099               }
2100             }
2101             ],
2102               "vterminal-config": {
2103                 "description": "Creating vterminal"
2104               }
2105           },
2106           {
2107             "name": "vt_srvc1_2",
2108             "bridge-status": {
2109               "state": "UP",
2110               "path-faults": 0
2111             },
2112             "vinterface": [
2113             {
2114               "name": "IF",
2115               "vinterface-status": {
2116                 "mapped-port": "openflow:4:3",
2117                 "state": "UP",
2118                 "entity-state": "UP"
2119               },
2120               "port-map-config": {
2121                 "vlan-id": 0,
2122                 "node": "openflow:4",
2123                 "port-name": "s4-eth3"
2124               },
2125               "vinterface-config": {
2126                 "description": "Creating vterminal IF",
2127                 "enabled": true
2128               },
2129               "vinterface-input-filter": {
2130                 "vtn-flow-filter": [
2131                 {
2132                   "index": 10,
2133                   "condition": "cond_any",
2134                   "vtn-redirect-filter": {
2135                     "output": true,
2136                     "redirect-destination": {
2137                       "terminal-name": "vt_srvc2_1",
2138                       "interface-name": "IF"
2139                     }
2140                   }
2141                 }
2142                 ]
2143               }
2144             }
2145             ],
2146               "vterminal-config": {
2147                 "description": "Creating vterminal"
2148               }
2149           },
2150           {
2151             "name": "vt_srvc2_1",
2152             "bridge-status": {
2153               "state": "UP",
2154               "path-faults": 0
2155             },
2156             "vinterface": [
2157             {
2158               "name": "IF",
2159               "vinterface-status": {
2160                 "mapped-port": "openflow:3:4",
2161                 "state": "UP",
2162                 "entity-state": "UP"
2163               },
2164               "port-map-config": {
2165                 "vlan-id": 0,
2166                 "node": "openflow:3",
2167                 "port-name": "s3-eth4"
2168               },
2169               "vinterface-config": {
2170                 "description": "Creating vterminal IF",
2171                 "enabled": true
2172               }
2173             }
2174             ],
2175               "vterminal-config": {
2176                 "description": "Creating vterminal"
2177               }
2178           }
2179         ]
2180       }
2181       ]
2182     }
2183
2184 Cleaning Up
2185 ^^^^^^^^^^^
2186
2187 -  To clean up both VTN and flowconditions.
2188
2189 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
2190    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2191
2192 ::
2193
2194     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2195
2196 -  You can delete the flowcondition cond\_1 and cond\_any by executing
2197    `the remove-flow-condition
2198    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
2199
2200 ::
2201
2202     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
2203
2204 ::
2205
2206     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_any"}}'
2207
2208 How To View Dataflows
2209 ~~~~~~~~~~~~~~~~~~~~~
2210
2211 Overview
2212 ^^^^^^^^
2213
2214 This page explains how to view Dataflows using VTN Manager. This page
2215 targets Boron release, so the procedure described here does not work
2216 in other releases.
2217
2218 Dataflow feature enables retrieval and display of data flows in the
2219 OpenFlow network. The data flows can be retrieved based on an OpenFlow
2220 switch or a switch port or a L2 source host.
2221
2222 The flow information provided by this feature are
2223
2224 -  Location of virtual node which maps the incoming packet and outgoing
2225    packets.
2226
2227 -  Location of physical switch port where incoming and outgoing packets
2228    is sent and received.
2229
2230 -  A sequence of physical route info which represents the packet route
2231    in the physical network.
2232
2233 Configuration
2234 ^^^^^^^^^^^^^
2235
2236 -  To view Dataflow information, configure with VLAN Mapping
2237    https://wiki.opendaylight.org/view/VTN:Mananger:How_to_test_Vlan-map_using_mininet.
2238
2239 Verification
2240 ^^^^^^^^^^^^
2241
2242 After creating vlan mapping configuration from the above page, execute
2243 as below in mininet to get switch details.
2244
2245 ::
2246
2247      mininet> net
2248      h1 h1-eth0.200:s1-eth1
2249      h2 h2-eth0.300:s2-eth2
2250      h3 h3-eth0.200:s2-eth3
2251      h4 h4-eth0.300:s2-eth4
2252      h5 h5-eth0.200:s3-eth2
2253      h6 h6-eth0.300:s3-eth3
2254      s1 lo:  s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
2255      s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
2256      s3 lo:  s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
2257      c0
2258      mininet>
2259
2260 Please execute ping from h1 to h3 to check hosts reachability.
2261
2262 ::
2263
2264      mininet> h1 ping h3
2265      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2266      64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=11.4 ms
2267      64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.654 ms
2268      64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.093 ms
2269
2270 Parallely execute below Restconf command to get data flow information of
2271 node "openflow:1" and its port "s1-eth1".
2272
2273 -  Get the Dataflows information by executing `the get-data-flow
2274    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow.html#get-data-flow>`__.
2275
2276 ::
2277
2278     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow:get-data-flow -d '{"input":{"tenant-name":"vtn1","mode":"DETAIL","node":"openflow:1","data-flow-port":{"port-id":"1","port-name":"s1-eth1"}}}'
2279
2280 ::
2281
2282     {
2283       "output": {
2284         "data-flow-info": [
2285         {
2286           "averaged-data-flow-stats": {
2287             "packet-count": 1.1998800119988002,
2288               "start-time": 1455241209151,
2289               "end-time": 1455241219152,
2290               "byte-count": 117.58824117588242
2291           },
2292             "physical-route": [
2293             {
2294               "physical-ingress-port": {
2295                 "port-name": "s2-eth3",
2296                 "port-id": "3"
2297               },
2298               "physical-egress-port": {
2299                 "port-name": "s2-eth1",
2300                 "port-id": "1"
2301               },
2302               "node": "openflow:2",
2303               "order": 0
2304             },
2305             {
2306               "physical-ingress-port": {
2307                 "port-name": "s1-eth2",
2308                 "port-id": "2"
2309               },
2310               "physical-egress-port": {
2311                 "port-name": "s1-eth1",
2312                 "port-id": "1"
2313               },
2314               "node": "openflow:1",
2315               "order": 1
2316             }
2317           ],
2318             "data-egress-node": {
2319               "bridge-name": "vbr1",
2320               "tenant-name": "vtn1"
2321             },
2322             "hard-timeout": 0,
2323             "idle-timeout": 300,
2324             "data-flow-stats": {
2325               "duration": {
2326                 "nanosecond": 640000000,
2327                 "second": 362
2328               },
2329               "packet-count": 134,
2330               "byte-count": 12932
2331             },
2332             "data-egress-port": {
2333               "node": "openflow:1",
2334               "port-name": "s1-eth1",
2335               "port-id": "1"
2336             },
2337             "data-ingress-node": {
2338               "bridge-name": "vbr1",
2339               "tenant-name": "vtn1"
2340             },
2341             "data-ingress-port": {
2342               "node": "openflow:2",
2343               "port-name": "s2-eth3",
2344               "port-id": "3"
2345             },
2346             "creation-time": 1455240855753,
2347             "data-flow-match": {
2348               "vtn-ether-match": {
2349                 "vlan-id": 200,
2350                 "source-address": "6a:ff:e2:81:86:bb",
2351                 "destination-address": "26:9f:82:70:ec:66"
2352               }
2353             },
2354             "virtual-route": [
2355             {
2356               "reason": "VLANMAPPED",
2357               "virtual-node-path": {
2358                 "bridge-name": "vbr1",
2359                 "tenant-name": "vtn1"
2360               },
2361               "order": 0
2362             },
2363             {
2364               "reason": "FORWARDED",
2365               "virtual-node-path": {
2366                 "bridge-name": "vbr1",
2367                 "tenant-name": "vtn1"
2368               },
2369               "order": 1
2370             }
2371           ],
2372             "flow-id": 16
2373         },
2374         {
2375           "averaged-data-flow-stats": {
2376             "packet-count": 1.1998800119988002,
2377             "start-time": 1455241209151,
2378             "end-time": 1455241219152,
2379             "byte-count": 117.58824117588242
2380           },
2381           "physical-route": [
2382           {
2383             "physical-ingress-port": {
2384               "port-name": "s1-eth1",
2385               "port-id": "1"
2386             },
2387             "physical-egress-port": {
2388               "port-name": "s1-eth2",
2389               "port-id": "2"
2390             },
2391             "node": "openflow:1",
2392             "order": 0
2393           },
2394           {
2395             "physical-ingress-port": {
2396               "port-name": "s2-eth1",
2397               "port-id": "1"
2398             },
2399             "physical-egress-port": {
2400               "port-name": "s2-eth3",
2401               "port-id": "3"
2402             },
2403             "node": "openflow:2",
2404             "order": 1
2405           }
2406           ],
2407             "data-egress-node": {
2408               "bridge-name": "vbr1",
2409               "tenant-name": "vtn1"
2410             },
2411             "hard-timeout": 0,
2412             "idle-timeout": 300,
2413             "data-flow-stats": {
2414               "duration": {
2415                 "nanosecond": 587000000,
2416                 "second": 362
2417               },
2418               "packet-count": 134,
2419               "byte-count": 12932
2420             },
2421             "data-egress-port": {
2422               "node": "openflow:2",
2423               "port-name": "s2-eth3",
2424               "port-id": "3"
2425             },
2426             "data-ingress-node": {
2427               "bridge-name": "vbr1",
2428               "tenant-name": "vtn1"
2429             },
2430             "data-ingress-port": {
2431               "node": "openflow:1",
2432               "port-name": "s1-eth1",
2433               "port-id": "1"
2434             },
2435             "creation-time": 1455240855747,
2436             "data-flow-match": {
2437               "vtn-ether-match": {
2438                 "vlan-id": 200,
2439                 "source-address": "26:9f:82:70:ec:66",
2440                 "destination-address": "6a:ff:e2:81:86:bb"
2441               }
2442             },
2443             "virtual-route": [
2444             {
2445               "reason": "VLANMAPPED",
2446               "virtual-node-path": {
2447                 "bridge-name": "vbr1",
2448                 "tenant-name": "vtn1"
2449               },
2450               "order": 0
2451             },
2452             {
2453               "reason": "FORWARDED",
2454               "virtual-node-path": {
2455                 "bridge-name": "vbr1",
2456                 "tenant-name": "vtn1"
2457               },
2458               "order": 1
2459             }
2460           ],
2461             "flow-id": 15
2462         }
2463         ]
2464       }
2465     }
2466
2467 How To Create Mac Map In VTN
2468 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2469
2470 Overview
2471 ^^^^^^^^
2472
2473 -  This page demonstrates Mac Mapping. This demonstration aims at
2474    enabling communication between two hosts and denying communication of
2475    particular host by associating a Vbridge to the hosts and configuring
2476    Mac Mapping (mac address) to the Vbridge.
2477
2478 -  This page targets Boron release, so the procedure described here
2479    does not work in other releases.
2480
2481 .. figure:: ./images/vtn/Single_Controller_Mapping.png
2482    :alt: Single Controller Mapping
2483
2484    Single Controller Mapping
2485
2486 Requirement
2487 ^^^^^^^^^^^
2488
2489 Configure mininet and create a topology
2490 '''''''''''''''''''''''''''''''''''''''
2491
2492 -  `Script for emulating network with multiple
2493    hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_Multiple_Hosts_for_Service_Function_Chain>`__.
2494
2495 -  Before executing the mininet script, please confirm Controller is up
2496    and running.
2497
2498 -  Run the mininet script.
2499
2500 -  Replace <path> and <Controller IP> based on your environment.
2501
2502 ::
2503
2504     sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
2505
2506 ::
2507
2508     mininet> net
2509     h11 h11-eth0:s1-eth1
2510     h12 h12-eth0:s1-eth2
2511     h21 h21-eth0:s2-eth1
2512     h22 h22-eth0:s2-eth2
2513     h23 h23-eth0:s2-eth3
2514     srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
2515     srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
2516     s1 lo:  s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
2517     s2 lo:  s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
2518     s3 lo:  s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
2519     s4 lo:  s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
2520
2521 Configuration
2522 ^^^^^^^^^^^^^
2523
2524 To create Mac Map in VTN, execute REST API provided by VTN Manager as
2525 follows. It uses curl command to call REST API.
2526
2527 -  Create a virtual tenant named Tenant1 by executing `the update-vtn
2528    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
2529
2530 ::
2531
2532     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2533
2534 -  Create a virtual bridge named vBridge1 in the tenant Tenant1 by
2535    executing `the update-vbridge
2536    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
2537
2538 ::
2539
2540     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"Tenant1","bridge-name":"vBridge1"}}'
2541
2542 -  Configuring Mac Mappings on the vBridge1 by giving the mac address of
2543    host h12 and host h22 as follows to allow the communication by
2544    executing `the set-mac-map
2545    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-mac-map.html#set-mac-map>`__.
2546
2547 ::
2548
2549     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-mac-map:set-mac-map -d '{"input":{"operation":"SET","allowed-hosts":["de:05:40:c4:96:76@0","62:c5:33:bc:d7:4e@0"],"tenant-name":"Tenant1","bridge-name":"vBridge1"}}'
2550
2551 .. note::
2552
2553     Mac Address of host h12 and host h22 can be obtained with the
2554     following command in mininet.
2555
2556 ::
2557
2558      mininet> h12 ifconfig
2559      h12-eth0  Link encap:Ethernet  HWaddr 62:c5:33:bc:d7:4e
2560      inet addr:10.0.0.2  Bcast:10.255.255.255  Mask:255.0.0.0
2561      inet6 addr: fe80::60c5:33ff:febc:d74e/64 Scope:Link
2562
2563 ::
2564
2565      mininet> h22 ifconfig
2566      h22-eth0  Link encap:Ethernet  HWaddr de:05:40:c4:96:76
2567      inet addr:10.0.0.4  Bcast:10.255.255.255  Mask:255.0.0.0
2568      inet6 addr: fe80::dc05:40ff:fec4:9676/64 Scope:Link
2569
2570 -  MAC Mapping will not be activated just by configuring it, a two end
2571    communication needs to be established to activate Mac Mapping.
2572
2573 -  Ping host h22 from host h12 in mininet, the ping will not happen
2574    between the hosts as only one way activation is enabled.
2575
2576 ::
2577
2578      mininet> h12 ping h22
2579      PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2580      From 10.0.0.2 icmp_seq=1 Destination Host Unreachable
2581      From 10.0.0.2 icmp_seq=2 Destination Host Unreachable
2582
2583 -  Ping host h12 from host h22 in mininet, now the ping communication
2584    will take place as the two end communication is enabled.
2585
2586 ::
2587
2588      mininet> h22 ping h12
2589      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
2590      64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=91.8 ms
2591      64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.510 ms
2592
2593 -  After two end communication enabled, now host h12 can ping host h22
2594
2595 ::
2596
2597      mininet> h12 ping h22
2598      PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2599      64 bytes from 10.0.0.4: icmp_req=1 ttl=64 time=0.780 ms
2600      64 bytes from 10.0.0.4: icmp_req=2 ttl=64 time=0.079 ms
2601
2602 Verification
2603 ^^^^^^^^^^^^
2604
2605 -  To view the configured Mac Map of allowed host execute the following
2606    command.
2607
2608 ::
2609
2610     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/Tenant1/vbridge/vBridge1/mac-map
2611
2612 ::
2613
2614     {
2615       "mac-map": {
2616         "mac-map-status": {
2617           "mapped-host": [
2618           {
2619             "mac-address": "c6:44:22:ba:3e:72",
2620               "vlan-id": 0,
2621               "port-id": "openflow:1:2"
2622           },
2623           {
2624             "mac-address": "f6:e0:43:b6:3a:b7",
2625             "vlan-id": 0,
2626             "port-id": "openflow:2:2"
2627           }
2628           ]
2629         },
2630           "mac-map-config": {
2631             "allowed-hosts": {
2632               "vlan-host-desc-list": [
2633               {
2634                 "host": "c6:44:22:ba:3e:72@0"
2635               },
2636               {
2637                 "host": "f6:e0:43:b6:3a:b7@0"
2638               }
2639               ]
2640             }
2641           }
2642       }
2643     }
2644
2645 .. note::
2646
2647     When Deny is configured a broadcast message is sent to all the hosts
2648     connected to the vBridge, so a two end communication need not be
2649     establihed like allow, the hosts can communicate directly without
2650     any two way communication enabled.
2651
2652 1. To Deny host h23 communication from hosts connected on vBridge1, the
2653    following configuration can be applied.
2654
2655 ::
2656
2657     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-mac-map:set-mac-map -d '{"input":{"operation": "SET", "denied-hosts": ["0a:d3:ea:3d:8f:a5@0"],"tenant-name": "Tenant1","bridge-name": "vBridge1"}}'
2658
2659 Cleaning Up
2660 ^^^^^^^^^^^
2661
2662 -  You can delete the virtual tenant Tenant1 by executing `the
2663    remove-vtn
2664    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2665
2666 ::
2667
2668     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2669
2670 How To Configure Flowfilters
2671 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2672
2673 Overview
2674 ^^^^^^^^
2675
2676 -  This page explains how to provision flowfilter using VTN Manager.
2677    This page targets Boron release, so the procedure described here
2678    does not work in other releases.
2679
2680 -  The flow-filter function discards, permits, or redirects packets of
2681    the traffic within a VTN, according to specified flow conditions. The
2682    table below lists the actions to be applied when a packet matches the
2683    condition:
2684
2685 +-----------------------+----------------------------------------------------+
2686 | Action                | Function                                           |
2687 +=======================+====================================================+
2688 | Pass                  | | Permits the packet to pass along the determined  |
2689 |                       |   path.                                            |
2690 |                       | | As options, packet transfer priority (set        |
2691 |                       |   priority) and DSCP change (set ip-dscp) is       |
2692 |                       |   specified.                                       |
2693 +-----------------------+----------------------------------------------------+
2694 | Drop                  | Discards the packet.                               |
2695 +-----------------------+----------------------------------------------------+
2696 | Redirect              | | Redirects the packet to a desired virtual        |
2697 |                       |   interface.                                       |
2698 |                       | | As an option, it is possible to change the MAC   |
2699 |                       |   address when the packet is transferred.          |
2700 +-----------------------+----------------------------------------------------+
2701
2702 .. figure:: ./images/vtn/flow_filter_example.png
2703    :alt: Flow Filter Example
2704
2705    Flow Filter Example
2706
2707 -  Following steps explain flow-filter function:
2708
2709    -  when a packet is transferred to an interface within a virtual
2710       network, the flow-filter function evaluates whether the
2711       transferred packet matches the condition specifed in the
2712       flow-list.
2713
2714    -  If the packet matches the condition, the flow-filter applies the
2715       flow-list matching action specified in the flow-filter.
2716
2717 Requirements
2718 ^^^^^^^^^^^^
2719
2720 To apply the packet filter, configure the following:
2721
2722 -  Create a flow condition.
2723
2724 -  Specify where to apply the flow-filter, for example VTN, vBridge, or
2725    interface of vBridge.
2726
2727 To provision OpenFlow switches, this page uses Mininet. Mininet details
2728 and set-up can be referred at the below page:
2729 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
2730
2731 Start Mininet, and create three switches (s1, s2, and s3) and four hosts
2732 (h1, h2, h3 and h4) in it.
2733
2734 ::
2735
2736     sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
2737
2738 .. note::
2739
2740     Replace "192.168.0.100" with the IP address of OpenDaylight
2741     controller based on your environment.
2742
2743 You can check the topology that you have created by executing "net"
2744 command in the Mininet console.
2745
2746 ::
2747
2748      mininet> net
2749      h1 h1-eth0:s2-eth1
2750      h2 h2-eth0:s2-eth2
2751      h3 h3-eth0:s3-eth1
2752      h4 h4-eth0:s3-eth2
2753      s1 lo:  s1-eth1:s2-eth3 s1-eth2:s3-eth3
2754      s2 lo:  s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
2755      s3 lo:  s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
2756
2757 In this guide, you will provision flowfilters to establish communication
2758 between h1 and h3.
2759
2760 Configuration
2761 ^^^^^^^^^^^^^
2762
2763 To provision the virtual L2 network for the two hosts (h1 and h3),
2764 execute REST API provided by VTN Manager as follows. It uses curl
2765 command to call the REST API.
2766
2767 -  Create a virtual tenant named vtn1 by executing `the update-vtn
2768    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
2769
2770 ::
2771
2772     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2773
2774 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
2775    `the update-vbridge
2776    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
2777
2778 ::
2779
2780     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
2781
2782 -  Create two interfaces into the virtual bridge by executing `the
2783    update-vinterface
2784    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
2785
2786 ::
2787
2788     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
2789
2790 ::
2791
2792     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
2793
2794 -  Configure two mappings on the interfaces by executing `the
2795    set-port-map
2796    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
2797
2798    -  The interface if1 of the virtual bridge will be mapped to the port
2799       "s2-eth1" of the switch "openflow:2" of the Mininet.
2800
2801       -  The h1 is connected to the port "s2-eth1".
2802
2803    -  The interface if2 of the virtual bridge will be mapped to the port
2804       "s3-eth1" of the switch "openflow:3" of the Mininet.
2805
2806       -  The h3 is connected to the port "s3-eth1".
2807
2808 ::
2809
2810     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:2", "port-name":"s2-eth1"}}'
2811
2812 ::
2813
2814     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth1"}}'
2815
2816 -  Create flowcondition named cond\_1 by executing `the
2817    set-flow-condition
2818    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
2819
2820    -  For option source and destination-network, get inet address of
2821       host h1 and h3 from mininet.
2822
2823 ::
2824
2825     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.3/32"},"index":"1"}]}}'
2826
2827 -  Flowfilter can be applied either in VTN, VBR or VBR Interfaces. Here
2828    in this page we provision flowfilter with VBR Interface and
2829    demonstrate with action type drop and then pass.
2830
2831 -  Flow filter demonstration with DROP action-type. Create Flowfilter in
2832    VBR Interface if1 by executing `the set-flow-filter
2833    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
2834
2835 ::
2836
2837     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input": {"tenant-name": "vtn1", "bridge-name": "vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","vtn-drop-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]}}'
2838
2839 Verification of the drop filter
2840 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2841
2842 -  Please execute ping from h1 to h3. As we have applied the action type
2843    "drop" , ping should fail with no packet flows between hosts h1 and
2844    h3 as below,
2845
2846 ::
2847
2848      mininet> h1 ping h3
2849
2850 Configuration for pass filter
2851 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2852
2853 -  Update the flow filter to pass the packets by executing `the
2854    set-flow-filter
2855    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
2856
2857 ::
2858
2859     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input": {"tenant-name": "vtn1", "bridge-name": "vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]}}'
2860
2861 Verification For Packets Success
2862 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2863
2864 -  As we have applied action type PASS now ping should happen between
2865    hosts h1 and h3.
2866
2867 ::
2868
2869      mininet> h1 ping h3
2870      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2871      64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
2872      64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
2873      64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
2874
2875 -  You can also verify the configurations by executing the following
2876    REST API. It shows all configuration in VTN Manager.
2877
2878 ::
2879
2880     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/vtn1
2881
2882 ::
2883
2884     {
2885       "vtn": [
2886       {
2887         "name": "vtn1",
2888           "vtenant-config": {
2889             "hard-timeout": 0,
2890             "idle-timeout": 300,
2891             "description": "creating vtn"
2892           },
2893           "vbridge": [
2894           {
2895             "name": "vbr1",
2896             "vbridge-config": {
2897               "age-interval": 600,
2898               "description": "creating vBridge1"
2899             },
2900             "bridge-status": {
2901               "state": "UP",
2902               "path-faults": 0
2903             },
2904             "vinterface": [
2905             {
2906               "name": "if1",
2907               "vinterface-status": {
2908                 "mapped-port": "openflow:2:1",
2909                 "state": "UP",
2910                 "entity-state": "UP"
2911               },
2912               "port-map-config": {
2913                 "vlan-id": 0,
2914                 "node": "openflow:2",
2915                 "port-name": "s2-eth1"
2916               },
2917               "vinterface-config": {
2918                 "description": "Creating if1 interface",
2919                 "enabled": true
2920               },
2921               "vinterface-input-filter": {
2922                 "vtn-flow-filter": [
2923                 {
2924                   "index": 1,
2925                   "condition": "cond_1",
2926                   "vtn-flow-action": [
2927                   {
2928                     "order": 1,
2929                     "vtn-set-inet-src-action": {
2930                       "ipv4-address": "10.0.0.1/32"
2931                     }
2932                   },
2933                   {
2934                     "order": 2,
2935                     "vtn-set-inet-dst-action": {
2936                       "ipv4-address": "10.0.0.3/32"
2937                     }
2938                   }
2939                   ],
2940                     "vtn-pass-filter": {}
2941                 },
2942                 {
2943                   "index": 10,
2944                   "condition": "cond_1",
2945                   "vtn-drop-filter": {}
2946                 }
2947                 ]
2948               }
2949             },
2950             {
2951               "name": "if2",
2952               "vinterface-status": {
2953                 "mapped-port": "openflow:3:1",
2954                 "state": "UP",
2955                 "entity-state": "UP"
2956               },
2957               "port-map-config": {
2958                 "vlan-id": 0,
2959                 "node": "openflow:3",
2960                 "port-name": "s3-eth1"
2961               },
2962               "vinterface-config": {
2963                 "description": "Creating if2 interface",
2964                 "enabled": true
2965               }
2966             }
2967             ]
2968           }
2969         ]
2970       }
2971       ]
2972     }
2973
2974 Cleaning Up
2975 ^^^^^^^^^^^
2976
2977 -  To clean up both VTN and flowcondition.
2978
2979 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
2980    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2981
2982 ::
2983
2984     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2985
2986 -  You can delete the flowcondition cond\_1 by executing `the
2987    remove-flow-condition
2988    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
2989
2990 ::
2991
2992     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
2993
2994 How to use VTN to change the path of the packet flow
2995 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2996
2997 Overview
2998 ^^^^^^^^
2999
3000 -  This page explains how to create specific VTN Pathmap using VTN
3001    Manager. This page targets Boron release, so the procedure
3002    described here does not work in other releases.
3003
3004 .. figure:: ./images/vtn/Pathmap.png
3005    :alt: Pathmap
3006
3007    Pathmap
3008
3009 Requirement
3010 ^^^^^^^^^^^
3011
3012 -  Save the mininet script given below as pathmap\_test.py and run the
3013    mininet script in the mininet environment where Mininet is installed.
3014
3015 -  Create topology using the below mininet script:
3016
3017 ::
3018
3019      from mininet.topo import Topo
3020      class MyTopo( Topo ):
3021         "Simple topology example."
3022         def __init__( self ):
3023             "Create custom topo."
3024             # Initialize topology
3025             Topo.__init__( self )
3026             # Add hosts and switches
3027             leftHost = self.addHost( 'h1' )
3028             rightHost = self.addHost( 'h2' )
3029             leftSwitch = self.addSwitch( 's1' )
3030             middleSwitch = self.addSwitch( 's2' )
3031             middleSwitch2 = self.addSwitch( 's4' )
3032             rightSwitch = self.addSwitch( 's3' )
3033             # Add links
3034             self.addLink( leftHost, leftSwitch )
3035             self.addLink( leftSwitch, middleSwitch )
3036             self.addLink( leftSwitch, middleSwitch2 )
3037             self.addLink( middleSwitch, rightSwitch )
3038             self.addLink( middleSwitch2, rightSwitch )
3039             self.addLink( rightSwitch, rightHost )
3040      topos = { 'mytopo': ( lambda: MyTopo() ) }
3041
3042 -  After creating new file with the above script start the mininet as
3043    below,
3044
3045 ::
3046
3047     sudo mn --controller=remote,ip=10.106.138.124 --custom pathmap_test.py --topo mytopo
3048
3049 .. note::
3050
3051     Replace "10.106.138.124" with the IP address of OpenDaylight
3052     controller based on your environment.
3053
3054 ::
3055
3056      mininet> net
3057      h1 h1-eth0:s1-eth1
3058      h2 h2-eth0:s3-eth3
3059      s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
3060      s2 lo:  s2-eth1:s1-eth2 s2-eth2:s3-eth1
3061      s3 lo:  s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
3062      s4 lo:  s4-eth1:s1-eth3 s4-eth2:s3-eth2
3063      c0
3064
3065 -  Generate traffic by pinging between host h1 and host h2 before
3066    creating the portmaps respectively.
3067
3068 ::
3069
3070      mininet> h1 ping h2
3071      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3072      From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
3073      From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
3074      From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
3075      From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
3076
3077 Configuration
3078 ^^^^^^^^^^^^^
3079
3080 -  To change the path of the packet flow, execute REST API provided by
3081    VTN Manager as follows. It uses curl command to call the REST API.
3082
3083 -  Create a virtual tenant named vtn1 by executing `the update-vtn
3084    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
3085
3086 ::
3087
3088     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3089
3090 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
3091    `the update-vbridge
3092    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
3093
3094 ::
3095
3096     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
3097
3098 -  Create two interfaces into the virtual bridge by executing `the
3099    update-vinterface
3100    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
3101
3102 ::
3103
3104     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
3105
3106 ::
3107
3108     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
3109
3110 -  Configure two mappings on the interfaces by executing `the
3111    set-port-map
3112    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
3113
3114    -  The interface if1 of the virtual bridge will be mapped to the port
3115       "s2-eth1" of the switch "openflow:1" of the Mininet.
3116
3117       -  The h1 is connected to the port "s1-eth1".
3118
3119    -  The interface if2 of the virtual bridge will be mapped to the port
3120       "s3-eth1" of the switch "openflow:3" of the Mininet.
3121
3122       -  The h3 is connected to the port "s3-eth3".
3123
3124 ::
3125
3126     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:1", "port-name":"s1-eth1"}}'
3127
3128 ::
3129
3130     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth3"}}'
3131
3132 -  Genarate traffic by pinging between host h1 and host h2 after
3133    creating the portmaps respectively.
3134
3135 ::
3136
3137      mininet> h1 ping h2
3138      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3139      64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.861 ms
3140      64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.101 ms
3141      64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.101 ms
3142
3143 -  Get the Dataflows information by executing `the get-data-flow
3144    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow.html#get-data-flow>`__.
3145
3146 ::
3147
3148     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow:get-data-flow -d '{"input":{"tenant-name":"vtn1","mode":"DETAIL","node":"openflow:1","data-flow-port":{"port-id":1,"port-name":"s1-eth1"}}}'
3149
3150 -  Create flowcondition named cond\_1 by executing `the
3151    set-flow-condition
3152    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
3153
3154    -  For option source and destination-network, get inet address of
3155       host h1 or host h2 from mininet
3156
3157 ::
3158
3159     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.2/32"},"index":"1"}]}}'
3160
3161 -  Create pathmap with flowcondition cond\_1 by executing `the
3162    set-path-map
3163    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-path-map.html#set-path-map>`__.
3164
3165 ::
3166
3167     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-map:set-path-map -d '{"input":{"tenant-name":"vtn1","path-map-list":[{"condition":"cond_1","policy":"1","index": "1","idle-timeout":"300","hard-timeout":"0"}]}}'
3168
3169 -  Create pathpolicy by executing `the set-path-policy
3170    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-path-policy.html#set-path-policy>`__.
3171
3172 ::
3173
3174     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-policy:set-path-policy -d '{"input":{"operation":"SET","id": "1","default-cost": "10000","vtn-path-cost": [{"port-desc":"openflow:1,3,s1-eth3","cost":"1000"},{"port-desc":"openflow:4,2,s4-eth2","cost":"1000"},{"port-desc":"openflow:3,3,s3-eth3","cost":"100000"}]}}'
3175
3176 Verification
3177 ^^^^^^^^^^^^
3178
3179 -  Before applying Path policy get node information by executing get
3180    dataflow command.
3181
3182 ::
3183
3184     "data-flow-info": [
3185     {
3186       "physical-route": [
3187       {
3188         "physical-ingress-port": {
3189           "port-name": "s3-eth3",
3190             "port-id": "3"
3191         },
3192           "physical-egress-port": {
3193             "port-name": "s3-eth1",
3194             "port-id": "1"
3195           },
3196           "node": "openflow:3",
3197           "order": 0
3198       },
3199       {
3200         "physical-ingress-port": {
3201           "port-name": "s2-eth2",
3202           "port-id": "2"
3203         },
3204         "physical-egress-port": {
3205           "port-name": "s2-eth1",
3206           "port-id": "1"
3207         },
3208         "node": "openflow:2",
3209         "order": 1
3210       },
3211       {
3212         "physical-ingress-port": {
3213           "port-name": "s1-eth2",
3214           "port-id": "2"
3215         },
3216         "physical-egress-port": {
3217           "port-name": "s1-eth1",
3218           "port-id": "1"
3219         },
3220         "node": "openflow:1",
3221         "order": 2
3222       }
3223       ],
3224         "data-egress-node": {
3225           "interface-name": "if1",
3226           "bridge-name": "vbr1",
3227           "tenant-name": "vtn1"
3228         },
3229         "data-egress-port": {
3230           "node": "openflow:1",
3231           "port-name": "s1-eth1",
3232           "port-id": "1"
3233         },
3234         "data-ingress-node": {
3235           "interface-name": "if2",
3236           "bridge-name": "vbr1",
3237           "tenant-name": "vtn1"
3238         },
3239         "data-ingress-port": {
3240           "node": "openflow:3",
3241           "port-name": "s3-eth3",
3242           "port-id": "3"
3243         },
3244         "flow-id": 32
3245       },
3246     }
3247
3248 -  After applying Path policy get node information by executing get
3249    dataflow command.
3250
3251 ::
3252
3253     "data-flow-info": [
3254     {
3255       "physical-route": [
3256       {
3257         "physical-ingress-port": {
3258           "port-name": "s1-eth1",
3259             "port-id": "1"
3260         },
3261           "physical-egress-port": {
3262             "port-name": "s1-eth3",
3263             "port-id": "3"
3264           },
3265           "node": "openflow:1",
3266           "order": 0
3267       },
3268       {
3269         "physical-ingress-port": {
3270           "port-name": "s4-eth1",
3271           "port-id": "1"
3272         },
3273         "physical-egress-port": {
3274           "port-name": "s4-eth2",
3275           "port-id": "2"
3276         },
3277         "node": "openflow:4",
3278         "order": 1
3279       },
3280       {
3281         "physical-ingress-port": {
3282           "port-name": "s3-eth2",
3283           "port-id": "2"
3284         },
3285         "physical-egress-port": {
3286           "port-name": "s3-eth3",
3287           "port-id": "3"
3288         },
3289         "node": "openflow:3",
3290         "order": 2
3291       }
3292       ],
3293         "data-egress-node": {
3294           "interface-name": "if2",
3295           "bridge-name": "vbr1",
3296           "tenant-name": "vtn1"
3297         },
3298         "data-egress-port": {
3299           "node": "openflow:3",
3300           "port-name": "s3-eth3",
3301           "port-id": "3"
3302         },
3303         "data-ingress-node": {
3304           "interface-name": "if1",
3305           "bridge-name": "vbr1",
3306           "tenant-name": "vtn1"
3307         },
3308         "data-ingress-port": {
3309           "node": "openflow:1",
3310           "port-name": "s1-eth1",
3311           "port-id": "1"
3312         },
3313     }
3314
3315 Cleaning Up
3316 ^^^^^^^^^^^
3317
3318 -  To clean up both VTN and flowcondition.
3319
3320 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
3321    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
3322
3323 ::
3324
3325     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3326
3327 -  You can delete the flowcondition cond\_1 by executing `the
3328    remove-flow-condition
3329    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
3330
3331 ::
3332
3333     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
3334
3335 VTN Coordinator Usage Examples
3336 ------------------------------
3337
3338 How to configure L2 Network with Single Controller
3339 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3340
3341 Overview
3342 ^^^^^^^^
3343
3344 This example provides the procedure to demonstrate configuration of VTN
3345 Coordinator with L2 network using VTN Virtualization(single controller).
3346 Here is the Example for vBridge Interface Mapping with Single Controller
3347 using mininet. mininet details and set-up can be referred at below URL:
3348 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
3349
3350 .. figure:: ./images/vtn/vtn-single-controller-topology-example.png
3351    :alt: EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3352
3353    EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3354
3355 Requirements
3356 ^^^^^^^^^^^^
3357
3358 -  Configure mininet and create a topology:
3359
3360 ::
3361
3362     mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3363
3364 -  mininet> net
3365
3366 ::
3367
3368      s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1
3369      s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0
3370      h1 h1-eth0:s1-eth1
3371      h2 h2-eth0:s2-eth2
3372
3373 Configuration
3374 ^^^^^^^^^^^^^
3375
3376 -  Create a Controller named controllerone and mention its ip-address in
3377    the below create-controller command.
3378
3379 ::
3380
3381     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.0.0.2", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3382
3383 -  Create a VTN named vtn1 by executing the create-vtn command
3384
3385 ::
3386
3387     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3388
3389 -  Create a vBridge named vBridge1 in the vtn1 by executing the
3390    create-vbr command.
3391
3392 ::
3393
3394      curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3395
3396 -  Create two Interfaces named if1 and if2 into the vBridge1
3397
3398 ::
3399
3400     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3401
3402 ::
3403
3404     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3405
3406 -  Get the list of logical ports configured
3407
3408 ::
3409
3410     Curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/controllerone/domains/\(DEFAULT\)/logical_ports.json
3411
3412 -  Configure two mappings on each of the interfaces by executing the
3413    below command.
3414
3415 The interface if1 of the virtual bridge will be mapped to the port
3416 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3417 to the port "s2-eth1".
3418
3419 The interface if2 of the virtual bridge will be mapped to the port
3420 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3421 to the port "s3-eth1".
3422
3423 ::
3424
3425     curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
3426     curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
3427
3428 Verification
3429 ^^^^^^^^^^^^
3430
3431 Please verify whether the Host1 and Host3 are pinging.
3432
3433 -  Send packets from Host1 to Host3
3434
3435 ::
3436
3437      mininet> h1 ping h3
3438      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
3439      64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.780 ms
3440      64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.079 ms
3441
3442 How to configure L2 Network with Multiple Controllers
3443 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3444
3445 -  This example provides the procedure to demonstrate configuration of
3446    VTN Coordinator with L2 network using VTN Virtualization Here is the
3447    Example for vBridge Interface Mapping with Multi-controller using
3448    mininet.
3449
3450 .. figure:: ./images/vtn/MutiController_Example_diagram.png
3451    :alt: EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3452
3453    EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3454
3455 Requirements
3456 ^^^^^^^^^^^^
3457
3458 -  Configure multiple controllers using the mininet script given below:
3459    https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:Scripts:Mininet#Network_with_multiple_switches_and_OpenFlow_controllers
3460
3461 Configuration
3462 ^^^^^^^^^^^^^
3463
3464 -  Create a VTN named vtn3 by executing the create-vtn command
3465
3466 ::
3467
3468     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"vtn" : {"vtn_name":"vtn3"}}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3469
3470 -  Create two Controllers named odc1 and odc2 with its ip-address in the
3471    below create-controller command.
3472
3473 ::
3474
3475     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"controller": {"controller_id": "odc1", "ipaddr":"10.100.9.52", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3476
3477 ::
3478
3479     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"controller": {"controller_id": "odc2", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3480
3481 -  Create two vBridges in the VTN like, vBridge1 in Controller1 and
3482    vBridge2 in Controller2
3483
3484 ::
3485
3486      curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr1","controller_id":"odc1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges.json
3487
3488 ::
3489
3490     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"vbridge" : {"vbr_name":"vbr2","controller_id":"odc2","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges.json
3491
3492 -  Create two Interfaces if1, if2 for the two vBridges vbr1 and vbr2.
3493
3494 ::
3495
3496     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
3497
3498 ::
3499
3500     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
3501
3502 ::
3503
3504     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
3505
3506 ::
3507
3508     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
3509
3510 -  Get the list of logical ports configured
3511
3512 ::
3513
3514     curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/odc1/domains/\(DEFAULT\)/logical_ports/detail.json
3515
3516 -  Create boundary and vLink for the two controllers
3517
3518 ::
3519
3520     curl --user admin:adminpass -H 'content-type: application/json'   -X POST -d '{"boundary": {"boundary_id": "b1", "link": {"controller1_id": "odc1", "domain1_id": "(DEFAULT)", "logical_port1_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth3", "controller2_id": "odc2", "domain2_id": "(DEFAULT)", "logical_port2_id": "PP-OF:00:00:00:00:00:00:00:04-s4-eth3"}}}' http://127.0.0.1:8083/vtn-webapi/boundaries.json
3521
3522 ::
3523
3524     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"vlink": {"vlk_name": "vlink1" , "vnode1_name": "vbr1", "if1_name":"if2", "vnode2_name": "vbr2", "if2_name": "if2", "boundary_map": {"boundary_id":"b1","vlan_id": "50"}}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vlinks.json
3525
3526 -  Configure two mappings on each of the interfaces by executing the
3527    below command.
3528
3529 The interface if1 of the vbr1 will be mapped to the port "s2-eth2" of
3530 the switch "openflow:2" of the Mininet. The h2 is connected to the port
3531 "s2-eth2".
3532
3533 The interface if2 of the vbr2 will be mapped to the port "s5-eth2" of
3534 the switch "openflow:5" of the Mininet. The h6 is connected to the port
3535 "s5-eth2".
3536
3537 ::
3538
3539     curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces/if1/portmap.json
3540
3541 ::
3542
3543     curl --user admin:adminpass -H 'content-type: application/json'  -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:05-s5-eth2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces/if1/portmap.json
3544
3545 Verification
3546 ^^^^^^^^^^^^
3547
3548 Please verify whether Host h2 and Host h6 are pinging.
3549
3550 -  Send packets from h2 to h6
3551
3552 ::
3553
3554     mininet> h2 ping h6
3555
3556 ::
3557
3558      PING 10.0.0.6 (10.0.0.3) 56(84) bytes of data.
3559      64 bytes from 10.0.0.6: icmp_req=1 ttl=64 time=0.780 ms
3560      64 bytes from 10.0.0.6: icmp_req=2 ttl=64 time=0.079 ms
3561
3562 How To Test Vlan-Map In Mininet Environment
3563 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3564
3565 Overview
3566 ^^^^^^^^
3567
3568 This example explains how to test vlan-map in a multi host scenario.
3569
3570 .. figure:: ./images/vtn/vlanmap_using_mininet.png
3571    :alt: Example that demonstrates vlanmap testing in Mininet
3572    Environment
3573
3574    Example that demonstrates vlanmap testing in Mininet Environment
3575
3576 Requirements
3577 ^^^^^^^^^^^^
3578
3579 -  Save the mininet script given below as vlan\_vtn\_test.py and run the
3580    mininet script in the mininet environment where Mininet is installed.
3581
3582 Mininet Script
3583 ^^^^^^^^^^^^^^
3584
3585 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
3586
3587 -  Run the mininet script
3588
3589 ::
3590
3591     sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
3592
3593 Configuration
3594 ^^^^^^^^^^^^^
3595
3596 Please follow the below steps to test a vlan map using mininet:
3597
3598 -  Create a Controller named controllerone and mention its ip-address in
3599    the below create-controller command.
3600
3601 ::
3602
3603     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.0.0.2", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers
3604
3605 -  Create a VTN named vtn1 by executing the create-vtn command
3606
3607 ::
3608
3609     curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3610
3611 -  Create a vBridge named vBridge1 in the vtn1 by executing the
3612    create-vbr command.
3613
3614 ::
3615
3616     curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3617
3618 -  Create a vlan map with vlanid 200 for vBridge vBridge1
3619
3620 ::
3621
3622     curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vlanmap" : {"vlan_id": 200 }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/vlanmaps.json
3623
3624 -  Create a vBridge named vBridge2 in the vtn1 by executing the
3625    create-vbr command.
3626
3627 ::
3628
3629     curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vbridge" : {"vbr_name":"vBridge2","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3630
3631 -  Create a vlan map with vlanid 300 for vBridge vBridge2
3632
3633 ::
3634
3635     curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vlanmap" : {"vlan_id": 300 }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge2/vlanmaps.json
3636
3637 Verification
3638 ^^^^^^^^^^^^
3639
3640 Ping all in mininet environment to view the host reachability.
3641
3642 ::
3643
3644     mininet> pingall
3645     Ping: testing ping reachability
3646     h1 -> X h3 X h5 X
3647     h2 -> X X h4 X h6
3648     h3 -> h1 X X h5 X
3649     h4 -> X h2 X X h6
3650     h5 -> h1 X h3 X X
3651     h6 -> X h2 X h4 X
3652
3653 How To View Specific VTN Station Information.
3654 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3655
3656 This example demonstrates on how to view a specific VTN Station
3657 information.
3658
3659 .. figure:: ./images/vtn/vtn_stations.png
3660    :alt: EXAMPLE DEMONSTRATING VTN STATIONS
3661
3662    EXAMPLE DEMONSTRATING VTN STATIONS
3663
3664 Requirement
3665 ^^^^^^^^^^^
3666
3667 -  Configure mininet and create a topology:
3668
3669 ::
3670
3671      $ sudo mn --custom /home/mininet/mininet/custom/topo-2sw-2host.py --controller=remote,ip=10.100.9.61 --topo mytopo
3672     mininet> net
3673
3674      s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1
3675      s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0
3676      h1 h1-eth0:s1-eth1
3677      h2 h2-eth0:s2-eth2
3678
3679 -  Generate traffic by pinging between hosts h1 and h2 after configuring
3680    the portmaps respectively
3681
3682 ::
3683
3684      mininet> h1 ping h2
3685      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3686      64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=16.7 ms
3687      64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=13.2 ms
3688
3689 Configuration
3690 ^^^^^^^^^^^^^
3691
3692 -  Create a Controller named controllerone and mention its ip-address in
3693    the below create-controller command
3694
3695 ::
3696
3697     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3698
3699 -  Create a VTN named vtn1 by executing the create-vtn command
3700
3701 ::
3702
3703     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3704
3705 -  Create a vBridge named vBridge1 in the vtn1 by executing the
3706    create-vbr command.
3707
3708 ::
3709
3710     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3711
3712 -  Create two Interfaces named if1 and if2 into the vBridge1
3713
3714 ::
3715
3716     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3717     curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3718
3719 -  Configure two mappings on each of the interfaces by executing the
3720    below command.
3721
3722 The interface if1 of the virtual bridge will be mapped to the port
3723 "s1-eth1" of the switch "openflow:1" of the Mininet. The h1 is connected
3724 to the port "s1-eth1".
3725
3726 The interface if2 of the virtual bridge will be mapped to the port
3727 "s1-eth2" of the switch "openflow:1" of the Mininet. The h2 is connected
3728 to the port "s1-eth2".
3729
3730 ::
3731
3732     curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
3733     curl -v --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth2"}}' http://17.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
3734
3735 -  Get the VTN stations information
3736
3737 ::
3738
3739     curl -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
3740
3741 Verification
3742 ^^^^^^^^^^^^
3743
3744 ::
3745
3746     curl -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
3747     {
3748        "vtnstations": [
3749            {
3750                "domain_id": "(DEFAULT)",
3751                "interface": {},
3752                "ipaddrs": [
3753                    "10.0.0.2"
3754                ],
3755                "macaddr": "b2c3.06b8.2dac",
3756                "no_vlan_id": "true",
3757                "port_name": "s2-eth2",
3758                "station_id": "178195618445172",
3759                "switch_id": "00:00:00:00:00:00:00:02",
3760                "vnode_name": "vBridge1",
3761                "vnode_type": "vbridge",
3762                "vtn_name": "vtn1"
3763            },
3764            {
3765                "domain_id": "(DEFAULT)",
3766                "interface": {},
3767                "ipaddrs": [
3768                    "10.0.0.1"
3769                ],
3770                "macaddr": "ce82.1b08.90cf",
3771                "no_vlan_id": "true",
3772                "port_name": "s1-eth1",
3773                "station_id": "206130278144207",
3774                "switch_id": "00:00:00:00:00:00:00:01",
3775                "vnode_name": "vBridge1",
3776                "vnode_type": "vbridge",
3777                "vtn_name": "vtn1"
3778            }
3779        ]
3780     }
3781
3782 How To View Dataflows in VTN
3783 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3784
3785 This example demonstrates on how to view a specific VTN Dataflow
3786 information.
3787
3788 Configuration
3789 ^^^^^^^^^^^^^
3790
3791 The same Configuration as Vlan Mapping
3792 Example(\ https://wiki.opendaylight.org/view/VTN:Coordinator:Beryllium:HowTos:How_To_test_vlanmap_using_mininet)
3793
3794 Verification
3795 ^^^^^^^^^^^^
3796
3797 Get the VTN Dataflows information
3798
3799 ::
3800
3801     curl -X GET -H 'content-type: application/json' --user 'admin:adminpass' "http://127.0.0.1:8083/vtn-webapi/dataflows?controller_id=controllerone&srcmacaddr=924c.e4a3.a743&vlan_id=300&switch_id=openflow:2&port_name=s2-eth1"
3802
3803 ::
3804
3805     {
3806        "dataflows": [
3807            {
3808                "controller_dataflows": [
3809                    {
3810                        "controller_id": "controllerone",
3811                        "controller_type": "odc",
3812                        "egress_domain_id": "(DEFAULT)",
3813                        "egress_port_name": "s3-eth3",
3814                        "egress_station_id": "3",
3815                        "egress_switch_id": "00:00:00:00:00:00:00:03",
3816                        "flow_id": "29",
3817                        "ingress_domain_id": "(DEFAULT)",
3818                        "ingress_port_name": "s2-eth2",
3819                        "ingress_station_id": "2",
3820                        "ingress_switch_id": "00:00:00:00:00:00:00:02",
3821                        "match": {
3822                            "macdstaddr": [
3823                                "4298.0959.0e0b"
3824                            ],
3825                            "macsrcaddr": [
3826                                "924c.e4a3.a743"
3827                            ],
3828                            "vlan_id": [
3829                                "300"
3830                            ]
3831                        },
3832                        "pathinfos": [
3833                            {
3834                                "in_port_name": "s2-eth2",
3835                                "out_port_name": "s2-eth1",
3836                                "switch_id": "00:00:00:00:00:00:00:02"
3837                            },
3838                            {
3839                                "in_port_name": "s1-eth2",
3840                                "out_port_name": "s1-eth3",
3841                                "switch_id": "00:00:00:00:00:00:00:01"
3842                            },
3843                            {
3844                                "in_port_name": "s3-eth1",
3845                                "out_port_name": "s3-eth3",
3846                                "switch_id": "00:00:00:00:00:00:00:03"
3847                            }
3848                        ]
3849                    }
3850                ],
3851                "reason": "success"
3852            }
3853        ]
3854     }
3855
3856 How To Configure Flow Filters Using VTN
3857 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3858
3859 Overview
3860 ^^^^^^^^
3861
3862 The flow-filter function discards, permits, or redirects packets of the
3863 traffic within a VTN, according to specified flow conditions The table
3864 below lists the actions to be applied when a packet matches the
3865 condition:
3866
3867 +--------------------------------------+--------------------------------------+
3868 | Action                               | Function                             |
3869 +--------------------------------------+--------------------------------------+
3870 | Pass                                 | Permits the packet to pass. As       |
3871 |                                      | options, packet transfer priority    |
3872 |                                      | (set priority) and DSCP change (se t |
3873 |                                      | ip-dscp) is specified.               |
3874 +--------------------------------------+--------------------------------------+
3875 | Drop                                 | Discards the packet.                 |
3876 +--------------------------------------+--------------------------------------+
3877 | Redirect                             | Redirects the packet to a desired    |
3878 |                                      | virtual interface. As an option, it  |
3879 |                                      | is possible to change the MAC        |
3880 |                                      | address when the packet is           |
3881 |                                      | transferred.                         |
3882 +--------------------------------------+--------------------------------------+
3883
3884 .. figure:: ./images/vtn/flow_filter_example.png
3885    :alt: Flow Filter
3886
3887    Flow Filter
3888
3889 Following steps explain flow-filter function:
3890
3891 -  When a packet is transferred to an interface within a virtual
3892    network, the flow-filter function evaluates whether the transferred
3893    packet matches the condition specified in the flow-list.
3894
3895 -  If the packet matches the condition, the flow-filter applies the
3896    flow-list matching action specified in the flow-filter.
3897
3898 Requirements
3899 ^^^^^^^^^^^^
3900
3901 To apply the packet filter, configure the following:
3902
3903 -  Create a flow-list and flow-listentry.
3904
3905 -  Specify where to apply the flow-filter, for example VTN, vBridge, or
3906    interface of vBridge.
3907
3908 Configure mininet and create a topology:
3909
3910 ::
3911
3912     $  mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree
3913
3914 Please generate the following topology
3915
3916 ::
3917
3918     $  mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3919     mininet> net
3920     c0
3921     s1 lo:  s1-eth1:s2-eth3 s1-eth2:s3-eth3
3922     s2 lo:  s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
3923     s3 lo:  s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
3924     h1 h1-eth0:s2-eth1
3925     h2 h2-eth0:s2-eth2
3926     h3 h3-eth0:s3-eth1
3927     h4 h4-eth0:s3-eth2
3928
3929 Configuration
3930 ^^^^^^^^^^^^^
3931
3932 -  Create a Controller named controller1 and mention its ip-address in
3933    the below create-controller command.
3934
3935 ::
3936
3937     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controller1", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers
3938
3939 -  Create a VTN named vtn\_one by executing the create-vtn command
3940
3941 ::
3942
3943     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn_one","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3944
3945 -  Create a vBridge named vbr\_two in the vtn1 by executing the
3946    create-vbr command.
3947
3948 ::
3949
3950     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr_one^C"controller_id":"controller1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges.json
3951     curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" :
3952     {"vbr_name":"vbr_two","controller_id":"controller1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges.json
3953
3954 -  Create two Interfaces named if1 and if2 into the vbr\_two
3955
3956 ::
3957
3958     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces.json
3959     curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces.json
3960
3961 -  Get the list of logical ports configured
3962
3963 ::
3964
3965     curl --user admin:adminpass -H 'content-type: application/json' -X GET  http://127.0.0.1:8083/vtn-webapi/controllers/controllerone/domains/\(DEFAULT\)/logical_ports.json
3966
3967 -  Configure two mappings on each of the interfaces by executing the
3968    below command.
3969
3970 The interface if1 of the virtual bridge will be mapped to the port
3971 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3972 to the port "s2-eth1".
3973
3974 The interface if2 of the virtual bridge will be mapped to the port
3975 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3976 to the port "s3-eth1".
3977
3978 ::
3979
3980     curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if1/portmap.json
3981     curl -v --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if2/portmap.json
3982
3983 -  Create Flowlist
3984
3985 ::
3986
3987     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"flowlist": {"fl_name": "flowlist1", "ip_version":"IP"}}' http://127.0.0.1:8083/vtn-webapi/flowlists.json
3988
3989 -  Create Flowlistentry
3990
3991 ::
3992
3993     curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"flowlistentry": {"seqnum": "233","macethertype": "0x8000","ipdstaddr": "10.0.0.3","ipdstaddrprefix": "2","ipsrcaddr": "10.0.0.2","ipsrcaddrprefix": "2","ipproto": "17","ipdscp": "55","icmptypenum":"232","icmpcodenum": "232"}}' http://127.0.0.1:8083/vtn-webapi/flowlists/flowlist1/flowlistentries.json
3994
3995 -  Create vBridge Interface Flowfilter
3996
3997 ::
3998
3999     curl --user admin:adminpass -X POST -H 'content-type: application/json' -d '{"flowfilter" : {"ff_type": "in"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if1/flowfilters.json
4000
4001 Flow filter demonstration with DROP action-type
4002 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4003
4004 ::
4005
4006     curl --user admin:adminpass -X POST -H 'content-type: application/json' -d '{"flowfilterentry": {"seqnum": "233", "fl_name": "flowlist1", "action_type":"drop", "priority":"3", "dscp":"55" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if1/flowfilters/in/flowfilterentries.json
4007
4008 Verification
4009 ^^^^^^^^^^^^
4010
4011 As we have applied the action type "drop" , ping should fail.
4012
4013 ::
4014
4015     mininet> h1 ping h3
4016     PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4017     From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
4018     From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
4019
4020 Flow filter demonstration with PASS action-type
4021 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4022
4023 ::
4024
4025     curl --user admin:adminpass -X PUT -H 'content-type: application/json' -d '{"flowfilterentry": {"seqnum": "233", "fl_name": "flowlist1", "action_type":"pass", "priority":"3", "dscp":"55" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if1/flowfilters/in/flowfilterentries/233.json
4026
4027 Verification
4028 ^^^^^^^^^^^^
4029
4030 ::
4031
4032     mininet> h1 ping h3
4033     PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
4034     64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
4035     64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
4036     64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
4037
4038 How To Use VTN To Make Packets Take Different Paths
4039 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4040
4041 This example demonstrates on how to create a specific VTN Path Map
4042 information.
4043
4044 .. figure:: ./images/vtn/Pathmap.png
4045    :alt: PathMap
4046
4047    PathMap
4048
4049 Requirement
4050 ^^^^^^^^^^^
4051
4052 -  Save the mininet script given below as pathmap\_test.py and run the
4053    mininet script in the mininet environment where Mininet is installed.
4054
4055 -  Create topology using the below mininet script:
4056
4057 ::
4058
4059      from mininet.topo import Topo
4060      class MyTopo( Topo ):
4061         "Simple topology example."
4062         def __init__( self ):
4063             "Create custom topo."
4064             # Initialize topology
4065             Topo.__init__( self )
4066             # Add hosts and switches
4067             leftHost = self.addHost( 'h1' )
4068             rightHost = self.addHost( 'h2' )
4069             leftSwitch = self.addSwitch( 's1' )
4070             middleSwitch = self.addSwitch( 's2' )
4071             middleSwitch2 = self.addSwitch( 's4' )
4072             rightSwitch = self.addSwitch( 's3' )
4073             # Add links
4074             self.addLink( leftHost, leftSwitch )
4075             self.addLink( leftSwitch, middleSwitch )
4076             self.addLink( leftSwitch, middleSwitch2 )
4077             self.addLink( middleSwitch, rightSwitch )
4078             self.addLink( middleSwitch2, rightSwitch )
4079             self.addLink( rightSwitch, rightHost )
4080      topos = { 'mytopo': ( lambda: MyTopo() ) }
4081
4082 ::
4083
4084      mininet> net
4085      c0
4086      s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
4087      s2 lo:  s2-eth1:s1-eth2 s2-eth2:s3-eth1
4088      s3 lo:  s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
4089      s4 lo:  s4-eth1:s1-eth3 s4-eth2:s3-eth2
4090      h1 h1-eth0:s1-eth1
4091      h2 h2-eth0:s3-eth3
4092
4093 -  Generate traffic by pinging between hosts h1 and h2 before creating
4094    the portmaps respectively
4095
4096 ::
4097
4098       mininet> h1 ping h2
4099       PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4100       From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
4101       From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
4102       From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
4103       From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
4104
4105 Configuration
4106 ^^^^^^^^^^^^^
4107
4108 -  Create a Controller named controller1 and mention its ip-address in
4109    the below create-controller command.
4110
4111 ::
4112
4113     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"controller": {"controller_id": "odc", "ipaddr":"10.100.9.42", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
4114
4115 -  Create a VTN named vtn1 by executing the create-vtn command
4116
4117 ::
4118
4119     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
4120
4121 -  Create a vBridge named vBridge1 in the vtn1 by executing the
4122    create-vbr command.
4123
4124 ::
4125
4126     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"odc","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
4127
4128 -  Create two Interfaces named if1 and if2 into the vBridge1
4129
4130 ::
4131
4132     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
4133     curl --user admin:adminpass -H 'content-type: application/json'  -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
4134
4135 -  Configure two mappings on each of the interfaces by executing the
4136    below command.
4137
4138 The interface if1 of the virtual bridge will be mapped to the port
4139 "s1-eth1" of the switch "openflow:1" of the Mininet. The h1 is connected
4140 to the port "s1-eth1".
4141
4142 The interface if2 of the virtual bridge will be mapped to the port
4143 "s3-eth3" of the switch "openflow:3" of the Mininet. The h2 is connected
4144 to the port "s3-eth3".
4145
4146 ::
4147
4148     curl --user admin:adminpass -H 'content-type: application/json'  -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
4149     curl --user admin:adminpass -H 'content-type: application/json'  -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth3"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
4150
4151 -  Generate traffic by pinging between hosts h1 and h2 after creating
4152    the portmaps respectively
4153
4154 ::
4155
4156       mininet> h1 ping h2
4157       PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4158       64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=36.4 ms
4159       64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.880 ms
4160       64 bytes from 10.0.0.2: icmp_req=3 ttl=64 time=0.073 ms
4161       64 bytes from 10.0.0.2: icmp_req=4 ttl=64 time=0.081 ms
4162
4163 -  Get the VTN Dataflows information
4164
4165 ::
4166
4167     curl -X GET -H 'content-type: application/json' --user 'admin:adminpass' "http://127.0.0.1:8083/vtn-webapi/dataflows?&switch_id=00:00:00:00:00:00:00:01&port_name=s1-eth1&controller_id=odc&srcmacaddr=de3d.7dec.e4d2&no_vlan_id=true"
4168
4169 -  Create a Flowcondition in the VTN
4170
4171 **(The flowconditions, pathmap and pathpolicy commands have to be
4172 executed in the controller).**
4173
4174 ::
4175
4176     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.2/32"},"index":"1"}]}}'
4177
4178 -  Create a Pathmap in the VTN
4179
4180 ::
4181
4182     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-map:set-path-map -d '{"input":{"tenant-name":"vtn1","path-map-list":[{"condition":"cond_1","policy":"1","index": "1","idle-timeout":"300","hard-timeout":"0"}]}}'
4183
4184 -  Get the Path policy information
4185
4186 ::
4187
4188     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-policy:set-path-policy -d '{"input":{"operation":"SET","id": "1","default-cost": "10000","vtn-path-cost": [{"port-desc":"openflow:1,3,s1-eth3","cost":"1000"},{"port-desc":"openflow:4,2,s4-eth2","cost":"100000"},{"port-desc":"openflow:3,3,s3-eth3","cost":"10000"}]}}'
4189
4190 Verification
4191 ^^^^^^^^^^^^
4192
4193 -  Before applying Path policy information in the VTN
4194
4195 ::
4196
4197     {
4198             "pathinfos": [
4199                 {
4200                   "in_port_name": "s1-eth1",
4201                   "out_port_name": "s1-eth3",
4202                   "switch_id": "openflow:1"
4203                 },
4204                 {
4205                   "in_port_name": "s4-eth1",
4206                   "out_port_name": "s4-eth2",
4207                   "switch_id": "openflow:4"
4208                 },
4209                 {
4210                    "in_port_name": "s3-eth2",
4211                    "out_port_name": "s3-eth3",
4212                    "switch_id": "openflow:3"
4213                 }
4214                          ]
4215     }
4216
4217 -  After applying Path policy information in the VTN
4218
4219 ::
4220
4221     {
4222         "pathinfos": [
4223                 {
4224                   "in_port_name": "s1-eth1",
4225                   "out_port_name": "s1-eth2",
4226                   "switch_id": "openflow:1"
4227                 },
4228                 {
4229                   "in_port_name": "s2-eth1",
4230                   "out_port_name": "s2-eth2",
4231                   "switch_id": "openflow:2"
4232                 },
4233                 {
4234                    "in_port_name": "s3-eth1",
4235                    "out_port_name": "s3-eth3",
4236                    "switch_id": "openflow:3"
4237                 }
4238                          ]
4239     }
4240
4241 VTN Coordinator(Troubleshooting HowTo)
4242 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4243
4244 Overview
4245 ^^^^^^^^
4246
4247 This page demonstrates Installation troubleshooting steps of VTN
4248 Coordinator. OpenDaylight VTN provides multi-tenant virtual network
4249 functions on OpenDaylight controllers. OpenDaylight VTN consists of two
4250 parts:
4251
4252 -  VTN Coordinator.
4253
4254 -  VTN Manager.
4255
4256 VTN Coordinator orchestrates multiple VTN Managers running in
4257 OpenDaylight Controllers, and provides VTN Applications with VTN API.
4258 VTN Manager is OSGi bundles running in OpenDaylight Controller. Current
4259 VTN Manager supports only OpenFlow switches. It handles PACKET\_IN
4260 messages, sends PACKET\_OUT messages, manages host information, and
4261 installs flow entries into OpenFlow switches to provide VTN Coordinator
4262 with virtual network functions. The requirements for installing these
4263 two are different.Therefore, we recommend that you install VTN Manager
4264 and VTN Coordinator in different machines.
4265
4266 List of installation Troubleshooting How to’s
4267 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4268
4269 -  https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Installation:VTN_Coordinator
4270
4271 **After executing db\_setup, you have encountered the error "Failed to
4272 setup database"?**
4273
4274 The error could be due to the below reasons
4275
4276 -  Access Restriction
4277
4278 The user who owns /usr/local/vtn/ directory and installs VTN
4279 Coordinator, can only start db\_setup. Example :
4280
4281 ::
4282
4283       The directory should appear as below (assuming the user as "vtn"):
4284       # ls -l /usr/local/
4285         drwxr-xr-x. 12 vtn  vtn  4096 Mar 14 21:53 vtn
4286       If the user doesnot own /usr/local/vtn/ then, please run the below command (assuming the username as vtn),
4287                   chown -R vtn:vtn /usr/local/vtn
4288
4289 -  Postgres not Present
4290
4291 ::
4292
4293     1. In case of Fedora/CentOS/RHEL, please check if /usr/pgsql/<version> directory is present and also ensure the commands initdb, createdb,pg_ctl,psql are working. If, not please re-install postgres packages
4294     2. In case of Ubuntu, check if /usr/lib/postgres/<version> directory is present and check for the commands as in the previous step.
4295
4296 -  Not enough space to create tables
4297
4298 ::
4299
4300     Please check df -k and ensure enough free space is available.
4301
4302 -  If the above steps do not solve the problem, please refer to the log
4303    file for the exact problem
4304
4305 ::
4306
4307     /usr/local/vtn/var/dbm/unc_setup_db.log for the exact error.
4308
4309 -  list of VTN Coordinator processes
4310
4311 -  Run the below command ensure the Coordinator daemons are running.
4312
4313 ::
4314
4315            Command:     /usr/local/vtn/bin/unc_dmctl status
4316            Name              Type           IPC Channel       PID
4317         -----------       -----------      --------------     ------
4318             drvodcd         DRIVER           drvodcd           15972
4319             lgcnwd         LOGICAL           lgcnwd            16010
4320             phynwd         PHYSICAL          phynwd            15996
4321
4322 -  Issue the curl command to fetch version and ensure the process is
4323    able to respond.
4324
4325 **How to debug a startup failure?.**
4326
4327 The following activities take place in order during startup
4328
4329 -  Database server is started after setting virtual memory to required
4330    value,Any database startup errors will be reflected in any of the
4331    below logs.
4332
4333 ::
4334
4335              /usr/local/vtn/var/dbm/unc_db_script.log.
4336              /usr/local/vtn/var/db/pg_log/postgresql-*.log (the pattern will have the date)
4337
4338 -  uncd daemon is kicked off, The daemon in turn kicks off the rest of
4339    the daemons.
4340
4341 ::
4342
4343       Any  uncd startup failures will be reflected in /usr/local/vtn/var/uncd/uncd_start.err.
4344
4345 After setting up the apache tomcat server, what are the aspects that should be checked.
4346 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
4347
4348 **Please check if catalina is running..**
4349
4350 ::
4351
4352         The command ps -ef | grep catalina | grep -v grep should list a catalina process
4353
4354 **If you encounter an erroneous situation where the REST API is always
4355 failing..**
4356
4357 ::
4358
4359       Please ensure the firewall settings for port:8181 (Beryllium release) or port:8083 (Post Beryllium release) and enable the same.
4360
4361 **How to debug a REST API returning a failure message?.**
4362
4363 Please check the /usr/share/java/apache-tomcat-7.0.39/logs/core/core.log
4364 for failure details.
4365
4366 **REST API for VTN configuration fails, how to debug?.**
4367
4368 The default log level for all daemons is "INFO", to debug the situation
4369 TRACE or DEBUG logs may be needed. To increase the log level for
4370 individual daemons, please use the commands suggested below
4371
4372 ::
4373
4374       /usr/local/vtn/bin/lgcnw_control loglevel trace -- upll daemon log
4375        /usr/local/vtn/bin/phynw_control loglevel trace -- uppl daemon log
4376        /usr/local/vtn/bin/unc_control loglevel trace -- uncd daemon log
4377        /usr/local/vtn/bin/drvodc_control loglevel trace -- Driver daemon log
4378
4379 After setting the log levels, the operation can be repeated and the log
4380 files can be referred for debugging.
4381
4382 **Problems while Installing PostgreSQL due to openssl.**
4383
4384 Errors may occur when trying to install postgreSQL rpms. Recently
4385 PostgreSQL has upgraded all their binaries to use the latest openssl
4386 versions with fix for http://en.wikipedia.org/wiki/Heartbleed Please
4387 upgrade the openssl package to the latest version and re-install. For
4388 RHEL 6.1/6.4 : If you have subscription, Please use the same and update
4389 the rpms. The details are available in the following link
4390 https://access.redhat.com/site/solutions/781793 ACCESS-REDHAT
4391
4392 ::
4393
4394       rpm -Uvh http://mirrors.kernel.org/centos/6/os/x86_64/Packages/openssl-1.0.1e-15.el6.x86_64.rpm
4395       rpm -ivh http://mirrors.kernel.org/centos/6/os/x86_64/Packages/openssl-devel-1.0.1e-15.el6.x86_64.rpm
4396
4397 For other linux platforms, Please do yum update, the public respositroes
4398 will have the latest openssl, please install the same.
4399
4400 Support for Microsoft SCVMM 2012 R2 with ODL VTN
4401 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4402
4403 Introduction
4404 ^^^^^^^^^^^^
4405
4406 System Center Virtual Machine Manager (SCVMM) is Microsoft’s virtual
4407 machine support center for window’s based emulations. SCVMM is a
4408 management solution for the virtualized data center. You can use it to
4409 configure and manage your virtualization host, networking, and storage
4410 resources in order to create and deploy virtual machines and services to
4411 private clouds that you have created.
4412
4413 The VSEM Provider is a plug-in to bridge between SCVMM and OpenDaylight.
4414
4415 Microsoft Hyper-V is a server virtualization developed by Microsoft,
4416 which provides virtualization services through hypervisor-based
4417 emulations.
4418
4419 .. figure:: ./images/vtn/setup_diagram_SCVMM.png
4420    :alt: Set-Up Diagram
4421
4422    Set-Up Diagram
4423
4424 **The topology used in this set-up is:**
4425
4426 -  A SCVMM with VSEM Provider installed and a running VTN Coordinator
4427    and OpenDaylight with VTN Feature installed.
4428
4429 -  PF1000 virtual switch extension has been installed in the two Hyper-V
4430    servers as it implements the OpenFlow capability in Hyper-V.
4431
4432 -  Three OpenFlow switches simulated using mininet and connected to
4433    Hyper-V.
4434
4435 -  Four VM’s hosted using SCVMM.
4436
4437 **It is implemented as two major components:**
4438
4439 -  SCVMM
4440
4441 -  OpenDaylight (VTN Feature)
4442
4443 -  VTN Coordinator
4444
4445 VTN Coordinator
4446 ^^^^^^^^^^^^^^^
4447
4448 OpenDaylight VTN as Network Service provider for SCVMM where VSEM
4449 provider is added in the Network Service which will handle all requests
4450 from SCVMM and communicate with the VTN Coordinator. It is used to
4451 manage the network virtualization provided by OpenDaylight.
4452
4453 Installing HTTPS in VTN Coordinator
4454 '''''''''''''''''''''''''''''''''''
4455
4456 -  System Center Virtual Machine Manager (SCVMM) supports only https
4457    protocol.
4458
4459 **Apache Portable Runtime (APR) Installation Steps**
4460
4461 -  Enter the command "yum install **apr**" in VTN Coordinator installed
4462    machine.
4463
4464 -  In /usr/bin, create a soft link as "ln –s /usr/bin/apr-1-config
4465    /usr/bin/apr-config".
4466
4467 -  Extract tomcat under "/usr/share/java" by using the below command
4468    "tar -xvf apache-tomcat-8.0.27.tar.gz –C /usr/share/java".
4469
4470 .. note::
4471
4472     Please go through the bleow link to download
4473     apache-tomcat-8.0.27.tar.gz file,
4474     https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.27/bin/
4475
4476 -  Please go to the directory "cd
4477    /usr/share/java/apache-tomcat-8.0.27/bin and unzip tomcat-native.gz
4478    using this command "tar -xvf tomcat-native.gz".
4479
4480 -  Go to the directory "cd
4481    /usr/share/java/apache-tomcat-8.0.27/bin/tomcat-native-1.1.33-src/jni/native".
4482
4483 -  Enter the command "./configure --with-os-type=bin
4484    --with-apr=/usr/bin/apr-config".
4485
4486 -  Enter the command "make" and "make install".
4487
4488 -  Apr libraries are successfully installed in "/usr/local/apr/lib".
4489
4490 **Enable HTTP/HTTPS in VTN Coordinator**
4491
4492 Enter the command "firewall-cmd --zone=public --add-port=8083/tcp
4493 --permanent" and "firewall-cmd --reload" to enable firewall settings in
4494 server.
4495
4496 **Create a CA’s private key and a self-signed certificate in server**
4497
4498 -  Execute the following command "openssl req -x509 -days 365
4499    -extensions v3\_ca -newkey rsa:2048 –out /etc/pki/CA/cacert.pem
4500    –keyout /etc/pki/CA/private/cakey.pem" in a single line.
4501
4502 +-----------------------+----------------------------------------------------+
4503 | Argument              | Description                                        |
4504 +=======================+====================================================+
4505 | Country Name          | | Specify the country code.                        |
4506 |                       | | For example, JP                                  |
4507 +-----------------------+----------------------------------------------------+
4508 | State or Province     | | Specify the state or province.                   |
4509 | Name                  | | For example, Tokyo                               |
4510 +-----------------------+----------------------------------------------------+
4511 | Locality Name         | | Locality Name                                    |
4512 |                       | | For example, Chuo-Ku                             |
4513 +-----------------------+----------------------------------------------------+
4514 | Organization Name     | Specify the company.                               |
4515 +-----------------------+----------------------------------------------------+
4516 | Organizational Unit   | Specify the department, division, or the like.     |
4517 | Name                  |                                                    |
4518 +-----------------------+----------------------------------------------------+
4519 | Common Name           | Specify the host name.                             |
4520 +-----------------------+----------------------------------------------------+
4521 | Email Address         | Specify the e-mail address.                        |
4522 +-----------------------+----------------------------------------------------+
4523
4524 -  Execute the following commands: "touch /etc/pki/CA/index.txt" and
4525    "echo 00 > /etc/pki/CA/serial" in server after setting your CA’s
4526    private key.
4527
4528 **Create a private key and a CSR for web server**
4529
4530 -  Execute the following command "openssl req -new -newkey rsa:2048 -out
4531    csr.pem –keyout /usr/local/vtn/tomcat/conf/key.pem" in a single line.
4532
4533 -  Enter the PEM pass phrase: Same password you have given in CA’s
4534    private key PEM pass phrase.
4535
4536 +-----------------------+----------------------------------------------------+
4537 | Argument              | Description                                        |
4538 +=======================+====================================================+
4539 | Country Name          | | Specify the country code.                        |
4540 |                       | | For example, JP                                  |
4541 +-----------------------+----------------------------------------------------+
4542 | State or Province     | | Specify the state or province.                   |
4543 | Name                  | | For example, Tokyo                               |
4544 +-----------------------+----------------------------------------------------+
4545 | Locality Name         | | Locality Name                                    |
4546 |                       | | For example, Chuo-Ku                             |
4547 +-----------------------+----------------------------------------------------+
4548 | Organization Name     | Specify the company.                               |
4549 +-----------------------+----------------------------------------------------+
4550 | Organizational Unit   | Specify the department, division, or the like.     |
4551 | Name                  |                                                    |
4552 +-----------------------+----------------------------------------------------+
4553 | Common Name           | Specify the host name.                             |
4554 +-----------------------+----------------------------------------------------+
4555 | Email Address         | Specify the e-mail address.                        |
4556 +-----------------------+----------------------------------------------------+
4557 | A challenge password  | Specify the challenge password.                    |
4558 +-----------------------+----------------------------------------------------+
4559 | An optional company   | Specify an optional company name.                  |
4560 | name                  |                                                    |
4561 +-----------------------+----------------------------------------------------+
4562
4563 **Create a certificate for web server**
4564
4565 -  Execute the following command "openssl ca –in csr.pem –out
4566    /usr/local/vtn/tomcat/conf/cert.pem –days 365 –batch" in a single
4567    line.
4568
4569 -  Enter pass phrase for /etc/pki/CA/private/cakey.pem: Same password
4570    you have given in CA’s private key PEM pass phrase.
4571
4572 -  Open the tomcat file using "vim /usr/local/vtn/tomcat/bin/tomcat".
4573
4574 -  Include the line " TOMCAT\_PROPS="$TOMCAT\_PROPS
4575    -Djava.library.path=\\"/usr/local/apr/lib\\"" " in 131th line and
4576    save the file.
4577
4578 **Edit server.xml file and restart the server**
4579
4580 -  Open the server.xml file using "vim
4581    /usr/local/vtn/tomcat/conf/server.xml" and add the below lines.
4582
4583    ::
4584
4585        <Connector port="${vtn.port}" protocol="HTTP/1.1" SSLEnabled="true"
4586        maxThreads="150" scheme="https" secure="true"
4587        SSLCertificateFile="/usr/local/vtn/tomcat/conf/cert.pem"
4588        SSLCertificateKeyFile="/usr/local/vtn/tomcat/conf/key.pem"
4589        SSLPassword=same password you have given in CA's private key PEM pass phrase
4590        connectionTimeout="20000" />
4591
4592 -  Save the file and restart the server.
4593
4594 -  To stop vtn use the following command.
4595
4596    ::
4597
4598        /usr/local/vtn/bin/vtn_stop
4599
4600 -  To start vtn use the following command.
4601
4602    ::
4603
4604        /usr/local/vtn/bin/vtn_start
4605
4606 -  Copy the created CA certificate from cacert.pem to cacert.crt by
4607    using the following command,
4608
4609    ::
4610
4611        openssl x509 –in /etc/pki/CA/cacert.pem –out cacert.crt
4612
4613    **Checking the HTTP and HTTPS connection from client**
4614
4615 -  You can check the HTTP connection by using the following command:
4616
4617    ::
4618
4619        curl -X GET -H 'contenttype:application/json' -H 'username:admin' -H 'password:adminpass' http://<server IP address>:8083/vtn-webapi/api_version.json
4620
4621 -  You can check the HTTPS connection by using the following command:
4622
4623    ::
4624
4625        curl -X GET -H 'contenttype:application/json' -H 'username:admin' -H 'password:adminpass' https://<server IP address>:8083/vtn-webapi/api_version.json --cacert /etc/pki/CA/cacert.pem
4626
4627 -  The response should be like this for both HTTP and HTTPS:
4628
4629    ::
4630
4631        {"api_version":{"version":"V1.4"}}
4632
4633 Prerequisites to create Network Service in SCVMM machine, Please follow the below steps
4634 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4635
4636 1.  Please go through the below link to download VSEM Provider zip file,
4637     https://nexus.opendaylight.org/content/groups/public/org/opendaylight/vtn/application/vtnmanager-vsemprovider/1.2.0-Boron/vtnmanager-vsemprovider-1.2.0-Boron-bin.zip
4638
4639 2.  Unzip the vtnmanager-vsemprovider-1.2.0-Boron-bin.zip file
4640     anywhere in your SCVMM machine.
4641
4642 3.  Stop SCVMM service from **"service manager→tools→servers→select
4643     system center virtual machine manager"** and click stop.
4644
4645 4.  Go to **"C:/Program Files"** in your SCVMM machine. Inside
4646     **"C:/Program Files"**, create a folder named as **"ODLProvider"**.
4647
4648 5.  Inside **"C:/Program Files/ODLProvider"**, create a folder named as
4649     "Module" in your SCVMM machine.
4650
4651 6.  Inside "C:/Program Files/ODLProvider/Module", Create two folders
4652     named as **"Odl.VSEMProvider"** and **"VSEMOdlUI"** in your SCVMM
4653     machine.
4654
4655 7.  Copy the **"VSEMOdl.dll"** file from
4656     **"ODL\_SCVMM\_PROVIDER/ODL\_VSEM\_PROVIDER"** to **"C:/Program
4657     Files/ODLProvider/Module/Odl.VSEMProvider"** in your SCVMM machine.
4658
4659 8.  Copy the **"VSEMOdlProvider.psd1"** file from
4660     **"application/vsemprovider/VSEMOdlProvider/VSEMOdlProvider.psd1"**
4661     to **"C:/Program Files/ODLProvider/Module/Odl.VSEMProvider"** in
4662     your SCVMM machine.
4663
4664 9.  Copy the **"VSEMOdlUI.dll"** file from
4665     **"ODL\_SCVMM\_PROVIDER/ODL\_VSEM\_PROVIDER\_UI"** to **"C:/Program
4666     Files/ODLProvider/Module/VSEMOdlUI"** in your SCVMM machine.
4667
4668 10. Copy the **"VSEMOdlUI.psd1"** file from
4669     **"application/vsemprovider/VSEMOdlUI"** to **"C:/Program
4670     Files/ODLProvider/Module/VSEMOdlUI"** in your SCVMM machine.
4671
4672 11. Copy the **"reg\_entry.reg"** file from
4673     **"ODL\_SCVMM\_PROVIDER/Register\_settings"** to your SCVMM desktop
4674     and double click the **"reg\_entry.reg"** file to install registry
4675     entry in your SCVMM machine.
4676
4677 12. Download **"PF1000.msi"** from this link,
4678     https://www.pf-info.com/License/en/index.php?url=index/index_non_buyer
4679     and place into **"C:/Program Files/Switch Extension Drivers"** in
4680     your SCVMM machine.
4681
4682 13. Start SCVMM service from **"service manager→tools→servers→select
4683     system center virtual machine manager"** and click start.
4684
4685 System Center Virtual Machine Manager (SCVMM)
4686 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4687
4688 It supports two major features:
4689
4690 -  Failover Clustering
4691
4692 -  Live Migration
4693
4694 Failover Clustering
4695 '''''''''''''''''''
4696
4697 A single Hyper-V can host a number of virtual machines. If the host were
4698 to fail then all of the virtual machines that are running on it will
4699 also fail, thereby resulting in a major outage. Failover clustering
4700 treats individual virtual machines as clustered resources. If a host
4701 were to fail then clustered virtual machines are able to fail over to a
4702 different Hyper-V server where they can continue to run.
4703
4704 Live Migration
4705 ''''''''''''''
4706
4707 Live Migration is used to migrate the running virtual machines from one
4708 Hyper-V server to another Hyper-V server without any interruptions.
4709 Please go through the below video for more details,
4710
4711 -  https://youtu.be/34YMOTzbNJM
4712
4713 SCVMM User Guide
4714 ^^^^^^^^^^^^^^^^
4715
4716 -  Please go through the below link for SCVMM user guide:
4717    https://wiki.opendaylight.org/images/c/ca/ODL_SCVMM_USER_GUIDE_final.pdf
4718
4719 -  Please go through the below links for more details
4720
4721    -  OpenDaylight SCVMM VTN Integration: https://youtu.be/iRt4dxtiz94
4722
4723    -  OpenDaylight Congestion Control with SCVMM VTN:
4724       https://youtu.be/34YMOTzbNJM
4725