ecf2bad2593e3ad213aaf418cded748c39b213da
[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`
38
39 -  `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/
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.
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/
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 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 Environment
1275
1276    Example that demonstrates vlanmap testing in Mininet Environment
1277
1278 Requirements
1279 ^^^^^^^^^^^^
1280
1281 Save the mininet script given below as vlan\_vtn\_test.py and run the
1282 mininet script in the mininet environment where Mininet is installed.
1283
1284 Mininet Script
1285 ^^^^^^^^^^^^^^
1286
1287 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
1288
1289 -  Run the mininet script
1290
1291 ::
1292
1293     sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
1294
1295 .. note::
1296
1297     Replace "192.168.64.13" with the IP address of OpenDaylight
1298     controller based on your environment.
1299
1300 -  You can check the topology that you have created by executing "net"
1301    command in the Mininet console.
1302
1303 ::
1304
1305      mininet> net
1306      h1 h1-eth0.200:s1-eth1
1307      h2 h2-eth0.300:s2-eth2
1308      h3 h3-eth0.200:s2-eth3
1309      h4 h4-eth0.300:s2-eth4
1310      h5 h5-eth0.200:s3-eth2
1311      h6 h6-eth0.300:s3-eth3
1312      s1 lo:  s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
1313      s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
1314      s3 lo:  s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
1315      c0
1316
1317 Configuration
1318 ^^^^^^^^^^^^^
1319
1320 To test vlan-map, execute REST API provided by VTN Manager as follows.
1321
1322 -  Create a virtual tenant named vtn1 by executing `the update-vtn
1323    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1324
1325 ::
1326
1327     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1328
1329 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1330    `the update-vbridge
1331    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1332
1333 ::
1334
1335     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"}}'
1336
1337 -  Configure a vlan map with vlanid 200 for vBridge vbr1 by executing
1338    `the add-vlan-map
1339    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vlan-map.html#add-vlan-map>`__.
1340
1341 ::
1342
1343     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"}}'
1344
1345 -  Create a virtual bridge named vbr2 in the tenant vtn1 by executing
1346    `the update-vbridge
1347    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1348
1349 ::
1350
1351     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"}}'
1352
1353 -  Configure a vlan map with vlanid 300 for vBridge vbr2 by executing
1354    `the add-vlan-map
1355    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vlan-map.html#add-vlan-map>`__.
1356
1357 ::
1358
1359     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"}}'
1360
1361 Verification
1362 ^^^^^^^^^^^^
1363
1364 -  Please execute pingall in mininet environment to view the host
1365    reachability.
1366
1367 ::
1368
1369      mininet> pingall
1370      Ping: testing ping reachability
1371      h1 -> X h3 X h5 X
1372      h2 -> X X h4 X h6
1373      h3 -> h1 X X h5 X
1374      h4 -> X h2 X X h6
1375      h5 -> h1 X h3 X X
1376      h6 -> X h2 X h4 X
1377
1378 -  You can also verify the configuration by executing the following REST
1379    API. It shows all configurations in VTN Manager.
1380
1381 ::
1382
1383     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1384
1385 -  The result of the command should be like this.
1386
1387 ::
1388
1389     {
1390       "vtns": {
1391         "vtn": [
1392         {
1393           "name": "vtn1",
1394             "vtenant-config": {
1395               "hard-timeout": 0,
1396               "idle-timeout": 300,
1397               "description": "creating vtn"
1398             },
1399             "vbridge": [
1400             {
1401               "name": "vbr2",
1402               "vbridge-config": {
1403                 "age-interval": 600,
1404                 "description": "creating vbr2"
1405               },
1406               "bridge-status": {
1407                 "state": "UP",
1408                 "path-faults": 0
1409               },
1410               "vlan-map": [
1411               {
1412                 "map-id": "ANY.300",
1413                 "vlan-map-config": {
1414                   "vlan-id": 300
1415                 },
1416                 "vlan-map-status": {
1417                   "active": true
1418                 }
1419               }
1420               ]
1421             },
1422             {
1423               "name": "vbr1",
1424               "vbridge-config": {
1425                 "age-interval": 600,
1426                 "description": "creating vbr1"
1427               },
1428               "bridge-status": {
1429                 "state": "UP",
1430                 "path-faults": 0
1431               },
1432               "vlan-map": [
1433               {
1434                 "map-id": "ANY.200",
1435                 "vlan-map-config": {
1436                   "vlan-id": 200
1437                 },
1438                 "vlan-map-status": {
1439                   "active": true
1440                 }
1441               }
1442               ]
1443             }
1444           ]
1445         }
1446         ]
1447       }
1448     }
1449
1450 Cleaning Up
1451 ^^^^^^^^^^^
1452
1453 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
1454    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
1455
1456 ::
1457
1458     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1459
1460 How To Configure Service Function Chaining using VTN Manager
1461 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1462
1463 Overview
1464 ^^^^^^^^
1465
1466 This page explains how to configure VTN Manager for Service Chaining.
1467 This page targets Boron release, so the procedure described here
1468 does not work in other releases.
1469
1470 .. figure:: ./images/vtn/Service_Chaining_With_One_Service.png
1471    :alt: Service Chaining With One Service
1472
1473    Service Chaining With One Service
1474
1475 Requirements
1476 ^^^^^^^^^^^^
1477
1478 -  Please refer to the `Installation
1479    Pages <https://wiki.opendaylight.org/view/VTN:Boron:Installation_Guide>`__
1480    to run ODL with VTN Feature enabled.
1481
1482 -  Please ensure Bridge-Utils package is installed in mininet
1483    environment before running the mininet script.
1484
1485 -  To install Bridge-Utils package run sudo apt-get install bridge-utils
1486    (assuming Ubuntu is used to run mininet, If not then this is not
1487    required).
1488
1489 -  Save the mininet script given below as topo\_handson.py and run the
1490    mininet script in the mininet environment where Mininet is installed.
1491
1492 Mininet Script
1493 ^^^^^^^^^^^^^^
1494
1495 -  `Script for emulating network with multiple
1496    hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet>`__.
1497
1498 -  Before executing the mininet script, please confirm Controller is up
1499    and running.
1500
1501 -  Run the mininet script.
1502
1503 -  Replace <path> and <Controller IP> based on your environment
1504
1505 ::
1506
1507     sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
1508
1509 ::
1510
1511      mininet> net
1512      h11 h11-eth0:s1-eth1
1513      h12 h12-eth0:s1-eth2
1514      h21 h21-eth0:s2-eth1
1515      h22 h22-eth0:s2-eth2
1516      h23 h23-eth0:s2-eth3
1517      srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
1518      srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
1519      s1 lo:  s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
1520      s2 lo:  s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
1521      s3 lo:  s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
1522      s4 lo:  s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
1523
1524 Configurations
1525 ^^^^^^^^^^^^^^
1526
1527 Mininet
1528 '''''''
1529
1530 -  Please follow the below steps to configure the network in mininet as
1531    in the below image:
1532
1533 .. figure:: ./images/vtn/Mininet_Configuration.png
1534    :alt: Mininet Configuration
1535
1536    Mininet Configuration
1537
1538 Configure service nodes
1539 '''''''''''''''''''''''
1540
1541 -  Please execute the following commands in the mininet console where
1542    mininet script is executed.
1543
1544 ::
1545
1546      mininet> srvc1 ip addr del 10.0.0.6/8 dev srvc1-eth0
1547      mininet> srvc1 brctl addbr br0
1548      mininet> srvc1 brctl addif br0 srvc1-eth0
1549      mininet> srvc1 brctl addif br0 srvc1-eth1
1550      mininet> srvc1 ifconfig br0 up
1551      mininet> srvc1 tc qdisc add dev srvc1-eth1 root netem delay 200ms
1552      mininet> srvc2 ip addr del 10.0.0.7/8 dev srvc2-eth0
1553      mininet> srvc2 brctl addbr br0
1554      mininet> srvc2 brctl addif br0 srvc2-eth0
1555      mininet> srvc2 brctl addif br0 srvc2-eth1
1556      mininet> srvc2 ifconfig br0 up
1557      mininet> srvc2 tc qdisc add dev srvc2-eth1 root netem delay 300ms
1558
1559 Controller
1560 ^^^^^^^^^^
1561
1562 Multi-Tenancy
1563 '''''''''''''
1564
1565 -  Please execute the below commands to configure the network topology
1566    in the controller as in the below image:
1567
1568 .. figure:: ./images/vtn/Tenant2.png
1569    :alt: Tenant2
1570
1571    Tenant2
1572
1573 Please execute the below commands in controller
1574 '''''''''''''''''''''''''''''''''''''''''''''''
1575
1576 .. note::
1577
1578     The below commands are for the difference in behavior of Manager in
1579     Boron topology. The Link below has the details for this bug:
1580     https://bugs.opendaylight.org/show_bug.cgi?id=3818.
1581
1582 ::
1583
1584     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"}]}}'
1585
1586 -  Create a virtual tenant named vtn1 by executing `the update-vtn
1587    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1588
1589 ::
1590
1591     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}}'
1592
1593 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1594    `the update-vbridge
1595    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1596
1597 ::
1598
1599     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"}}'
1600
1601 -  Create interface if1 into the virtual bridge vbr1 by executing `the
1602    update-vinterface
1603    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1604
1605 ::
1606
1607     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"}}'
1608
1609 -  Configure port mapping on the interface by executing `the
1610    set-port-map
1611    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1612
1613    -  The interface if1 of the virtual bridge will be mapped to the port
1614       "s1-eth2" of the switch "openflow:1" of the Mininet.
1615
1616       -  The h12 is connected to the port "s1-eth2".
1617
1618 ::
1619
1620     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"}}'
1621
1622 -  Create interface if2 into the virtual bridge vbr1 by executing `the
1623    update-vinterface
1624    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1625
1626 ::
1627
1628     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"}}'
1629
1630 -  Configure port mapping on the interface by executing `the
1631    set-port-map
1632    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1633
1634    -  The interface if2 of the virtual bridge will be mapped to the port
1635       "s2-eth2" of the switch "openflow:2" of the Mininet.
1636
1637       -  The h22 is connected to the port "s2-eth2".
1638
1639 ::
1640
1641     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"}}'
1642
1643 -  Create interface if3 into the virtual bridge vbr1 by executing `the
1644    update-vinterface
1645    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1646
1647 ::
1648
1649     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"}}'
1650
1651 -  Configure port mapping on the interfaces by executing `the
1652    set-port-map
1653    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1654
1655    -  The interface if3 of the virtual bridge will be mapped to the port
1656       "s2-eth3" of the switch "openflow:2" of the Mininet.
1657
1658       -  The h23 is connected to the port "s2-eth3".
1659
1660 ::
1661
1662     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"}}'
1663
1664 Traffic filtering
1665 ^^^^^^^^^^^^^^^^^
1666
1667 -  Create flowcondition named cond\_1 by executing `the
1668    set-flow-condition
1669    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1670
1671    -  For option source and destination-network, get inet address of
1672       host h12(src) and h22(dst) from mininet.
1673
1674 ::
1675
1676     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"}}]}}'
1677
1678 -  Flow filter demonstration with DROP action-type. Create Flowfilter in
1679    VBR Interface if1 by executing `the set-flow-filter
1680    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1681
1682 ::
1683
1684     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":{}}]}}'
1685
1686 Service Chaining
1687 ^^^^^^^^^^^^^^^^
1688
1689 With One Service
1690 ''''''''''''''''
1691
1692 -  Please execute the below commands to configure the network topology
1693    which sends some specific traffic via a single service(External
1694    device) in the controller as in the below image:
1695
1696 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_LLD.png
1697    :alt: Service Chaining With One Service LLD
1698
1699    Service Chaining With One Service LLD
1700
1701 -  Create a virtual terminal named vt\_srvc1\_1 in the tenant vtn1 by
1702    executing `the update-vterminal
1703    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1704
1705 ::
1706
1707     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"}}'
1708
1709 -  Create interface IF into the virtual terminal vt\_srvc1\_1 by
1710    executing `the update-vinterface
1711    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1712
1713 ::
1714
1715     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"}}'
1716
1717 -  Configure port mapping on the interfaces by executing `the
1718    set-port-map
1719    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1720
1721    -  The interface IF of the virtual terminal will be mapped to the
1722       port "s3-eth3" of the switch "openflow:3" of the Mininet.
1723
1724       -  The h12 is connected to the port "s3-eth3".
1725
1726 ::
1727
1728     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"}}'
1729
1730 -  Create a virtual terminal named vt\_srvc1\_2 in the tenant vtn1 by
1731    executing `the update-vterminal
1732    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1733
1734 ::
1735
1736     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"}}'
1737
1738 -  Create interface IF into the virtual terminal vt\_srvc1\_2 by
1739    executing `the update-vinterface
1740    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1741
1742 ::
1743
1744     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"}}'
1745
1746 -  Configure port mapping on the interfaces by executing `the
1747    set-port-map
1748    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1749
1750    -  The interface IF of the virtual terminal will be mapped to the
1751       port "s4-eth3" of the switch "openflow:4" of the Mininet.
1752
1753       -  The h22 is connected to the port "s4-eth3".
1754
1755 ::
1756
1757     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"}}'
1758
1759 -  Create flowcondition named cond\_1 by executing `the
1760    set-flow-condition
1761    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1762
1763    -  For option source and destination-network, get inet address of
1764       host h12(src) and h22(dst) from mininet.
1765
1766 ::
1767
1768     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"}}]}}'
1769
1770 -  Create flowcondition named cond\_any by executing `the
1771    set-flow-condition
1772    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1773
1774 ::
1775
1776     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}]}}'
1777
1778 -  Flow filter demonstration with redirect action-type. Create
1779    Flowfilter in virtual terminal vt\_srvc1\_2 interface IF by executing
1780    `the set-flow-filter
1781    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1782
1783    -  Flowfilter redirects vt\_srvc1\_2 to bridge1-IF2
1784
1785 ::
1786
1787     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"}}]}}'
1788
1789 -  Flow filter demonstration with redirect action-type. Create
1790    Flowfilter in vbridge vbr1 interface if1 by executing `the
1791    set-flow-filter
1792    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1793
1794    -  Flow filter redirects Bridge1-IF1 to vt\_srvc1\_1
1795
1796 ::
1797
1798     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"}}]}}'
1799
1800 Verification
1801 ^^^^^^^^^^^^
1802
1803 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_Verification.png
1804    :alt: Service Chaining With One Service
1805
1806    Service Chaining With One Service
1807
1808 -  Ping host12 to host22 to view the host rechability, a delay of 200ms
1809    will be taken to reach host22 as below.
1810
1811 ::
1812
1813      mininet> h12 ping h22
1814      PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1815      64 bytes from 10.0.0.4: icmp_seq=35 ttl=64 time=209 ms
1816      64 bytes from 10.0.0.4: icmp_seq=36 ttl=64 time=201 ms
1817      64 bytes from 10.0.0.4: icmp_seq=37 ttl=64 time=200 ms
1818      64 bytes from 10.0.0.4: icmp_seq=38 ttl=64 time=200 ms
1819
1820 With two services
1821 '''''''''''''''''
1822
1823 -  Please execute the below commands to configure the network topology
1824    which sends some specific traffic via two services(External device)
1825    in the controller as in the below image.
1826
1827 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services_LLD.png
1828    :alt: Service Chaining With Two Services LLD
1829
1830    Service Chaining With Two Services LLD
1831
1832 -  Create a virtual terminal named vt\_srvc2\_1 in the tenant vtn1 by
1833    executing `the update-vterminal
1834    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1835
1836 ::
1837
1838     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"}}'
1839
1840 -  Create interface IF into the virtual terminal vt\_srvc2\_1 by
1841    executing `the update-vinterface
1842    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1843
1844 ::
1845
1846     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"}}'
1847
1848 -  Configure port mapping on the interfaces by executing `the
1849    set-port-map
1850    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1851
1852    -  The interface IF of the virtual terminal will be mapped to the
1853       port "s3-eth4" of the switch "openflow:3" of the Mininet.
1854
1855       -  The host h12 is connected to the port "s3-eth4".
1856
1857 ::
1858
1859     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"}}'
1860
1861 -  Create a virtual terminal named vt\_srvc2\_2 in the tenant vtn1 by
1862    executing `the update-vterminal
1863    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1864
1865 ::
1866
1867     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"}}'
1868
1869 -  Create interfaces IF into the virtual terminal vt\_srvc2\_2 by
1870    executing `the update-vinterface
1871    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1872
1873 ::
1874
1875     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"}}'
1876
1877 -  Configure port mapping on the interfaces by executing `the
1878    set-port-map
1879    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1880
1881    -  The interface IF of the virtual terminal will be mapped to the
1882       port "s4-eth4" of the switch "openflow:4" of the mininet.
1883
1884       -  The host h22 is connected to the port "s4-eth4".
1885
1886 ::
1887
1888     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"}}'
1889
1890 -  Flow filter demonstration with redirect action-type. Create
1891    Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1892    `the set-flow-filter
1893    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1894
1895    -  Flow filter redirects vt\_srvc2\_2 to Bridge1-IF2.
1896
1897 ::
1898
1899     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"}}]}}'
1900
1901 -  Flow filter demonstration with redirect action-type. Create
1902    Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1903    `the set-flow-filter
1904    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1905
1906    -  Flow filter redirects vt\_srvc1\_2 to vt\_srvc2\_1.
1907
1908 ::
1909
1910     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"}}]}}'
1911
1912 Verification
1913 ^^^^^^^^^^^^
1914
1915 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services.png
1916    :alt: Service Chaining With Two Service
1917
1918    Service Chaining With Two Service
1919
1920 -  Ping host12 to host22 to view the host rechability, a delay of 500ms
1921    will be taken to reach host22 as below.
1922
1923 ::
1924
1925      mininet> h12 ping h22
1926      PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1927      64 bytes from 10.0.0.4: icmp_seq=1 ttl=64 time=512 ms
1928      64 bytes from 10.0.0.4: icmp_seq=2 ttl=64 time=501 ms
1929      64 bytes from 10.0.0.4: icmp_seq=3 ttl=64 time=500 ms
1930      64 bytes from 10.0.0.4: icmp_seq=4 ttl=64 time=500 ms
1931
1932 -  You can verify the configuration by executing the following REST API.
1933    It shows all configuration in VTN Manager.
1934
1935 ::
1936
1937     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1938
1939 ::
1940
1941     {
1942       "vtn": [
1943       {
1944         "name": "vtn1",
1945           "vtenant-config": {
1946             "hard-timeout": 0,
1947             "idle-timeout": 300,
1948             "description": "creating vtn"
1949           },
1950           "vbridge": [
1951           {
1952             "name": "vbr1",
1953             "vbridge-config": {
1954               "age-interval": 600,
1955               "description": "creating vbr"
1956             },
1957             "bridge-status": {
1958               "state": "UP",
1959               "path-faults": 0
1960             },
1961             "vinterface": [
1962             {
1963               "name": "if1",
1964               "vinterface-status": {
1965                 "mapped-port": "openflow:1:2",
1966                 "state": "UP",
1967                 "entity-state": "UP"
1968               },
1969               "port-map-config": {
1970                 "vlan-id": 0,
1971                 "node": "openflow:1",
1972                 "port-name": "s1-eth2"
1973               },
1974               "vinterface-config": {
1975                 "description": "Creating vbrif1 interface",
1976                 "enabled": true
1977               },
1978               "vinterface-input-filter": {
1979                 "vtn-flow-filter": [
1980                 {
1981                   "index": 10,
1982                   "condition": "cond_1",
1983                   "vtn-redirect-filter": {
1984                     "output": true,
1985                     "redirect-destination": {
1986                       "terminal-name": "vt_srvc1_1",
1987                       "interface-name": "IF"
1988                     }
1989                   }
1990                 }
1991                 ]
1992               }
1993             },
1994             {
1995               "name": "if2",
1996               "vinterface-status": {
1997                 "mapped-port": "openflow:2:2",
1998                 "state": "UP",
1999                 "entity-state": "UP"
2000               },
2001               "port-map-config": {
2002                 "vlan-id": 0,
2003                 "node": "openflow:2",
2004                 "port-name": "s2-eth2"
2005               },
2006               "vinterface-config": {
2007                 "description": "Creating vbrif2 interface",
2008                 "enabled": true
2009               }
2010             },
2011             {
2012               "name": "if3",
2013               "vinterface-status": {
2014                 "mapped-port": "openflow:2:3",
2015                 "state": "UP",
2016                 "entity-state": "UP"
2017               },
2018               "port-map-config": {
2019                 "vlan-id": 0,
2020                 "node": "openflow:2",
2021                 "port-name": "s2-eth3"
2022               },
2023               "vinterface-config": {
2024                 "description": "Creating vbrif3 interface",
2025                 "enabled": true
2026               }
2027             }
2028             ]
2029           }
2030         ],
2031           "vterminal": [
2032           {
2033             "name": "vt_srvc2_2",
2034             "bridge-status": {
2035               "state": "UP",
2036               "path-faults": 0
2037             },
2038             "vinterface": [
2039             {
2040               "name": "IF",
2041               "vinterface-status": {
2042                 "mapped-port": "openflow:4:4",
2043                 "state": "UP",
2044                 "entity-state": "UP"
2045               },
2046               "port-map-config": {
2047                 "vlan-id": 0,
2048                 "node": "openflow:4",
2049                 "port-name": "s4-eth4"
2050               },
2051               "vinterface-config": {
2052                 "description": "Creating vterminal IF",
2053                 "enabled": true
2054               },
2055               "vinterface-input-filter": {
2056                 "vtn-flow-filter": [
2057                 {
2058                   "index": 10,
2059                   "condition": "cond_any",
2060                   "vtn-redirect-filter": {
2061                     "output": true,
2062                     "redirect-destination": {
2063                       "bridge-name": "vbr1",
2064                       "interface-name": "if2"
2065                     }
2066                   }
2067                 }
2068                 ]
2069               }
2070             }
2071             ],
2072               "vterminal-config": {
2073                 "description": "Creating vterminal"
2074               }
2075           },
2076           {
2077             "name": "vt_srvc1_1",
2078             "bridge-status": {
2079               "state": "UP",
2080               "path-faults": 0
2081             },
2082             "vinterface": [
2083             {
2084               "name": "IF",
2085               "vinterface-status": {
2086                 "mapped-port": "openflow:3:3",
2087                 "state": "UP",
2088                 "entity-state": "UP"
2089               },
2090               "port-map-config": {
2091                 "vlan-id": 0,
2092                 "node": "openflow:3",
2093                 "port-name": "s3-eth3"
2094               },
2095               "vinterface-config": {
2096                 "description": "Creating vterminal IF",
2097                 "enabled": true
2098               }
2099             }
2100             ],
2101               "vterminal-config": {
2102                 "description": "Creating vterminal"
2103               }
2104           },
2105           {
2106             "name": "vt_srvc1_2",
2107             "bridge-status": {
2108               "state": "UP",
2109               "path-faults": 0
2110             },
2111             "vinterface": [
2112             {
2113               "name": "IF",
2114               "vinterface-status": {
2115                 "mapped-port": "openflow:4:3",
2116                 "state": "UP",
2117                 "entity-state": "UP"
2118               },
2119               "port-map-config": {
2120                 "vlan-id": 0,
2121                 "node": "openflow:4",
2122                 "port-name": "s4-eth3"
2123               },
2124               "vinterface-config": {
2125                 "description": "Creating vterminal IF",
2126                 "enabled": true
2127               },
2128               "vinterface-input-filter": {
2129                 "vtn-flow-filter": [
2130                 {
2131                   "index": 10,
2132                   "condition": "cond_any",
2133                   "vtn-redirect-filter": {
2134                     "output": true,
2135                     "redirect-destination": {
2136                       "terminal-name": "vt_srvc2_1",
2137                       "interface-name": "IF"
2138                     }
2139                   }
2140                 }
2141                 ]
2142               }
2143             }
2144             ],
2145               "vterminal-config": {
2146                 "description": "Creating vterminal"
2147               }
2148           },
2149           {
2150             "name": "vt_srvc2_1",
2151             "bridge-status": {
2152               "state": "UP",
2153               "path-faults": 0
2154             },
2155             "vinterface": [
2156             {
2157               "name": "IF",
2158               "vinterface-status": {
2159                 "mapped-port": "openflow:3:4",
2160                 "state": "UP",
2161                 "entity-state": "UP"
2162               },
2163               "port-map-config": {
2164                 "vlan-id": 0,
2165                 "node": "openflow:3",
2166                 "port-name": "s3-eth4"
2167               },
2168               "vinterface-config": {
2169                 "description": "Creating vterminal IF",
2170                 "enabled": true
2171               }
2172             }
2173             ],
2174               "vterminal-config": {
2175                 "description": "Creating vterminal"
2176               }
2177           }
2178         ]
2179       }
2180       ]
2181     }
2182
2183 Cleaning Up
2184 ^^^^^^^^^^^
2185
2186 -  To clean up both VTN and flowconditions.
2187
2188 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
2189    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2190
2191 ::
2192
2193     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2194
2195 -  You can delete the flowcondition cond\_1 and cond\_any by executing
2196    `the remove-flow-condition
2197    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
2198
2199 ::
2200
2201     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"}}'
2202
2203 ::
2204
2205     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"}}'
2206
2207 How To View Dataflows
2208 ~~~~~~~~~~~~~~~~~~~~~
2209
2210 Overview
2211 ^^^^^^^^
2212
2213 This page explains how to view Dataflows using VTN Manager. This page
2214 targets Boron release, so the procedure described here does not work
2215 in other releases.
2216
2217 Dataflow feature enables retrieval and display of data flows in the
2218 OpenFlow network. The data flows can be retrieved based on an OpenFlow
2219 switch or a switch port or a L2 source host.
2220
2221 The flow information provided by this feature are
2222
2223 -  Location of virtual node which maps the incoming packet and outgoing
2224    packets.
2225
2226 -  Location of physical switch port where incoming and outgoing packets
2227    is sent and received.
2228
2229 -  A sequence of physical route info which represents the packet route
2230    in the physical network.
2231
2232 Configuration
2233 ^^^^^^^^^^^^^
2234
2235 -  To view Dataflow information, configure with VLAN Mapping
2236    https://wiki.opendaylight.org/view/VTN:Mananger:How_to_test_Vlan-map_using_mininet.
2237
2238 Verification
2239 ^^^^^^^^^^^^
2240
2241 After creating vlan mapping configuration from the above page, execute
2242 as below in mininet to get switch details.
2243
2244 ::
2245
2246      mininet> net
2247      h1 h1-eth0.200:s1-eth1
2248      h2 h2-eth0.300:s2-eth2
2249      h3 h3-eth0.200:s2-eth3
2250      h4 h4-eth0.300:s2-eth4
2251      h5 h5-eth0.200:s3-eth2
2252      h6 h6-eth0.300:s3-eth3
2253      s1 lo:  s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
2254      s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
2255      s3 lo:  s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
2256      c0
2257      mininet>
2258
2259 Please execute ping from h1 to h3 to check hosts reachability.
2260
2261 ::
2262
2263      mininet> h1 ping h3
2264      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2265      64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=11.4 ms
2266      64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.654 ms
2267      64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.093 ms
2268
2269 Parallely execute below Restconf command to get data flow information of
2270 node "openflow:1" and its port "s1-eth1".
2271
2272 -  Get the Dataflows information by executing `the get-data-flow
2273    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow.html#get-data-flow>`__.
2274
2275 ::
2276
2277     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"}}}'
2278
2279 ::
2280
2281     {
2282       "output": {
2283         "data-flow-info": [
2284         {
2285           "averaged-data-flow-stats": {
2286             "packet-count": 1.1998800119988002,
2287               "start-time": 1455241209151,
2288               "end-time": 1455241219152,
2289               "byte-count": 117.58824117588242
2290           },
2291             "physical-route": [
2292             {
2293               "physical-ingress-port": {
2294                 "port-name": "s2-eth3",
2295                 "port-id": "3"
2296               },
2297               "physical-egress-port": {
2298                 "port-name": "s2-eth1",
2299                 "port-id": "1"
2300               },
2301               "node": "openflow:2",
2302               "order": 0
2303             },
2304             {
2305               "physical-ingress-port": {
2306                 "port-name": "s1-eth2",
2307                 "port-id": "2"
2308               },
2309               "physical-egress-port": {
2310                 "port-name": "s1-eth1",
2311                 "port-id": "1"
2312               },
2313               "node": "openflow:1",
2314               "order": 1
2315             }
2316           ],
2317             "data-egress-node": {
2318               "bridge-name": "vbr1",
2319               "tenant-name": "vtn1"
2320             },
2321             "hard-timeout": 0,
2322             "idle-timeout": 300,
2323             "data-flow-stats": {
2324               "duration": {
2325                 "nanosecond": 640000000,
2326                 "second": 362
2327               },
2328               "packet-count": 134,
2329               "byte-count": 12932
2330             },
2331             "data-egress-port": {
2332               "node": "openflow:1",
2333               "port-name": "s1-eth1",
2334               "port-id": "1"
2335             },
2336             "data-ingress-node": {
2337               "bridge-name": "vbr1",
2338               "tenant-name": "vtn1"
2339             },
2340             "data-ingress-port": {
2341               "node": "openflow:2",
2342               "port-name": "s2-eth3",
2343               "port-id": "3"
2344             },
2345             "creation-time": 1455240855753,
2346             "data-flow-match": {
2347               "vtn-ether-match": {
2348                 "vlan-id": 200,
2349                 "source-address": "6a:ff:e2:81:86:bb",
2350                 "destination-address": "26:9f:82:70:ec:66"
2351               }
2352             },
2353             "virtual-route": [
2354             {
2355               "reason": "VLANMAPPED",
2356               "virtual-node-path": {
2357                 "bridge-name": "vbr1",
2358                 "tenant-name": "vtn1"
2359               },
2360               "order": 0
2361             },
2362             {
2363               "reason": "FORWARDED",
2364               "virtual-node-path": {
2365                 "bridge-name": "vbr1",
2366                 "tenant-name": "vtn1"
2367               },
2368               "order": 1
2369             }
2370           ],
2371             "flow-id": 16
2372         },
2373         {
2374           "averaged-data-flow-stats": {
2375             "packet-count": 1.1998800119988002,
2376             "start-time": 1455241209151,
2377             "end-time": 1455241219152,
2378             "byte-count": 117.58824117588242
2379           },
2380           "physical-route": [
2381           {
2382             "physical-ingress-port": {
2383               "port-name": "s1-eth1",
2384               "port-id": "1"
2385             },
2386             "physical-egress-port": {
2387               "port-name": "s1-eth2",
2388               "port-id": "2"
2389             },
2390             "node": "openflow:1",
2391             "order": 0
2392           },
2393           {
2394             "physical-ingress-port": {
2395               "port-name": "s2-eth1",
2396               "port-id": "1"
2397             },
2398             "physical-egress-port": {
2399               "port-name": "s2-eth3",
2400               "port-id": "3"
2401             },
2402             "node": "openflow:2",
2403             "order": 1
2404           }
2405           ],
2406             "data-egress-node": {
2407               "bridge-name": "vbr1",
2408               "tenant-name": "vtn1"
2409             },
2410             "hard-timeout": 0,
2411             "idle-timeout": 300,
2412             "data-flow-stats": {
2413               "duration": {
2414                 "nanosecond": 587000000,
2415                 "second": 362
2416               },
2417               "packet-count": 134,
2418               "byte-count": 12932
2419             },
2420             "data-egress-port": {
2421               "node": "openflow:2",
2422               "port-name": "s2-eth3",
2423               "port-id": "3"
2424             },
2425             "data-ingress-node": {
2426               "bridge-name": "vbr1",
2427               "tenant-name": "vtn1"
2428             },
2429             "data-ingress-port": {
2430               "node": "openflow:1",
2431               "port-name": "s1-eth1",
2432               "port-id": "1"
2433             },
2434             "creation-time": 1455240855747,
2435             "data-flow-match": {
2436               "vtn-ether-match": {
2437                 "vlan-id": 200,
2438                 "source-address": "26:9f:82:70:ec:66",
2439                 "destination-address": "6a:ff:e2:81:86:bb"
2440               }
2441             },
2442             "virtual-route": [
2443             {
2444               "reason": "VLANMAPPED",
2445               "virtual-node-path": {
2446                 "bridge-name": "vbr1",
2447                 "tenant-name": "vtn1"
2448               },
2449               "order": 0
2450             },
2451             {
2452               "reason": "FORWARDED",
2453               "virtual-node-path": {
2454                 "bridge-name": "vbr1",
2455                 "tenant-name": "vtn1"
2456               },
2457               "order": 1
2458             }
2459           ],
2460             "flow-id": 15
2461         }
2462         ]
2463       }
2464     }
2465
2466 How To Create Mac Map In VTN
2467 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2468
2469 Overview
2470 ^^^^^^^^
2471
2472 -  This page demonstrates Mac Mapping. This demonstration aims at
2473    enabling communication between two hosts and denying communication of
2474    particular host by associating a Vbridge to the hosts and configuring
2475    Mac Mapping (mac address) to the Vbridge.
2476
2477 -  This page targets Boron release, so the procedure described here
2478    does not work in other releases.
2479
2480 .. figure:: ./images/vtn/Single_Controller_Mapping.png
2481    :alt: Single Controller Mapping
2482
2483    Single Controller Mapping
2484
2485 Requirement
2486 ^^^^^^^^^^^
2487
2488 Configure mininet and create a topology
2489 '''''''''''''''''''''''''''''''''''''''
2490
2491 -  `Script for emulating network with multiple
2492    hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_Multiple_Hosts_for_Service_Function_Chain>`__.
2493
2494 -  Before executing the mininet script, please confirm Controller is up
2495    and running.
2496
2497 -  Run the mininet script.
2498
2499 -  Replace <path> and <Controller IP> based on your environment.
2500
2501 ::
2502
2503     sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
2504
2505 ::
2506
2507     mininet> net
2508     h11 h11-eth0:s1-eth1
2509     h12 h12-eth0:s1-eth2
2510     h21 h21-eth0:s2-eth1
2511     h22 h22-eth0:s2-eth2
2512     h23 h23-eth0:s2-eth3
2513     srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
2514     srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
2515     s1 lo:  s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
2516     s2 lo:  s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
2517     s3 lo:  s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
2518     s4 lo:  s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
2519
2520 Configuration
2521 ^^^^^^^^^^^^^
2522
2523 To create Mac Map in VTN, execute REST API provided by VTN Manager as
2524 follows. It uses curl command to call REST API.
2525
2526 -  Create a virtual tenant named Tenant1 by executing `the update-vtn
2527    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
2528
2529 ::
2530
2531     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2532
2533 -  Create a virtual bridge named vBridge1 in the tenant Tenant1 by
2534    executing `the update-vbridge
2535    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
2536
2537 ::
2538
2539     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"}}'
2540
2541 -  Configuring Mac Mappings on the vBridge1 by giving the mac address of
2542    host h12 and host h22 as follows to allow the communication by
2543    executing `the set-mac-map
2544    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-mac-map.html#set-mac-map>`__.
2545
2546 ::
2547
2548     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"}}'
2549
2550 .. note::
2551
2552     Mac Address of host h12 and host h22 can be obtained with the
2553     following command in mininet.
2554
2555 ::
2556
2557      mininet> h12 ifconfig
2558      h12-eth0  Link encap:Ethernet  HWaddr 62:c5:33:bc:d7:4e
2559      inet addr:10.0.0.2  Bcast:10.255.255.255  Mask:255.0.0.0
2560      inet6 addr: fe80::60c5:33ff:febc:d74e/64 Scope:Link
2561
2562 ::
2563
2564      mininet> h22 ifconfig
2565      h22-eth0  Link encap:Ethernet  HWaddr de:05:40:c4:96:76
2566      inet addr:10.0.0.4  Bcast:10.255.255.255  Mask:255.0.0.0
2567      inet6 addr: fe80::dc05:40ff:fec4:9676/64 Scope:Link
2568
2569 -  MAC Mapping will not be activated just by configuring it, a two end
2570    communication needs to be established to activate Mac Mapping.
2571
2572 -  Ping host h22 from host h12 in mininet, the ping will not happen
2573    between the hosts as only one way activation is enabled.
2574
2575 ::
2576
2577      mininet> h12 ping h22
2578      PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2579      From 10.0.0.2 icmp_seq=1 Destination Host Unreachable
2580      From 10.0.0.2 icmp_seq=2 Destination Host Unreachable
2581
2582 -  Ping host h12 from host h22 in mininet, now the ping communication
2583    will take place as the two end communication is enabled.
2584
2585 ::
2586
2587      mininet> h22 ping h12
2588      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
2589      64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=91.8 ms
2590      64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.510 ms
2591
2592 -  After two end communication enabled, now host h12 can ping host h22
2593
2594 ::
2595
2596      mininet> h12 ping h22
2597      PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2598      64 bytes from 10.0.0.4: icmp_req=1 ttl=64 time=0.780 ms
2599      64 bytes from 10.0.0.4: icmp_req=2 ttl=64 time=0.079 ms
2600
2601 Verification
2602 ^^^^^^^^^^^^
2603
2604 -  To view the configured Mac Map of allowed host execute the following
2605    command.
2606
2607 ::
2608
2609     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/Tenant1/vbridge/vBridge1/mac-map
2610
2611 ::
2612
2613     {
2614       "mac-map": {
2615         "mac-map-status": {
2616           "mapped-host": [
2617           {
2618             "mac-address": "c6:44:22:ba:3e:72",
2619               "vlan-id": 0,
2620               "port-id": "openflow:1:2"
2621           },
2622           {
2623             "mac-address": "f6:e0:43:b6:3a:b7",
2624             "vlan-id": 0,
2625             "port-id": "openflow:2:2"
2626           }
2627           ]
2628         },
2629           "mac-map-config": {
2630             "allowed-hosts": {
2631               "vlan-host-desc-list": [
2632               {
2633                 "host": "c6:44:22:ba:3e:72@0"
2634               },
2635               {
2636                 "host": "f6:e0:43:b6:3a:b7@0"
2637               }
2638               ]
2639             }
2640           }
2641       }
2642     }
2643
2644 .. note::
2645
2646     When Deny is configured a broadcast message is sent to all the hosts
2647     connected to the vBridge, so a two end communication need not be
2648     establihed like allow, the hosts can communicate directly without
2649     any two way communication enabled.
2650
2651 1. To Deny host h23 communication from hosts connected on vBridge1, the
2652    following configuration can be applied.
2653
2654 ::
2655
2656     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"}}'
2657
2658 Cleaning Up
2659 ^^^^^^^^^^^
2660
2661 -  You can delete the virtual tenant Tenant1 by executing `the
2662    remove-vtn
2663    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2664
2665 ::
2666
2667     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2668
2669 How To Configure Flowfilters
2670 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2671
2672 Overview
2673 ^^^^^^^^
2674
2675 -  This page explains how to provision flowfilter using VTN Manager.
2676    This page targets Boron release, so the procedure described here
2677    does not work in other releases.
2678
2679 -  The flow-filter function discards, permits, or redirects packets of
2680    the traffic within a VTN, according to specified flow conditions. The
2681    table below lists the actions to be applied when a packet matches the
2682    condition:
2683
2684 +-----------------------+----------------------------------------------------+
2685 | Action                | Function                                           |
2686 +=======================+====================================================+
2687 | Pass                  | | Permits the packet to pass along the determined  |
2688 |                       |   path.                                            |
2689 |                       | | As options, packet transfer priority (set        |
2690 |                       |   priority) and DSCP change (set ip-dscp) is       |
2691 |                       |   specified.                                       |
2692 +-----------------------+----------------------------------------------------+
2693 | Drop                  | Discards the packet.                               |
2694 +-----------------------+----------------------------------------------------+
2695 | Redirect              | | Redirects the packet to a desired virtual        |
2696 |                       |   interface.                                       |
2697 |                       | | As an option, it is possible to change the MAC   |
2698 |                       |   address when the packet is transferred.          |
2699 +-----------------------+----------------------------------------------------+
2700
2701 .. figure:: ./images/vtn/flow_filter_example.png
2702    :alt: Flow Filter Example
2703
2704    Flow Filter Example
2705
2706 -  Following steps explain flow-filter function:
2707
2708    -  when a packet is transferred to an interface within a virtual
2709       network, the flow-filter function evaluates whether the
2710       transferred packet matches the condition specifed in the
2711       flow-list.
2712
2713    -  If the packet matches the condition, the flow-filter applies the
2714       flow-list matching action specified in the flow-filter.
2715
2716 Requirements
2717 ^^^^^^^^^^^^
2718
2719 To apply the packet filter, configure the following:
2720
2721 -  Create a flow condition.
2722
2723 -  Specify where to apply the flow-filter, for example VTN, vBridge, or
2724    interface of vBridge.
2725
2726 To provision OpenFlow switches, this page uses Mininet. Mininet details
2727 and set-up can be referred at the below page:
2728 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
2729
2730 Start Mininet, and create three switches (s1, s2, and s3) and four hosts
2731 (h1, h2, h3 and h4) in it.
2732
2733 ::
2734
2735     sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
2736
2737 .. note::
2738
2739     Replace "192.168.0.100" with the IP address of OpenDaylight
2740     controller based on your environment.
2741
2742 You can check the topology that you have created by executing "net"
2743 command in the Mininet console.
2744
2745 ::
2746
2747      mininet> net
2748      h1 h1-eth0:s2-eth1
2749      h2 h2-eth0:s2-eth2
2750      h3 h3-eth0:s3-eth1
2751      h4 h4-eth0:s3-eth2
2752      s1 lo:  s1-eth1:s2-eth3 s1-eth2:s3-eth3
2753      s2 lo:  s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
2754      s3 lo:  s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
2755
2756 In this guide, you will provision flowfilters to establish communication
2757 between h1 and h3.
2758
2759 Configuration
2760 ^^^^^^^^^^^^^
2761
2762 To provision the virtual L2 network for the two hosts (h1 and h3),
2763 execute REST API provided by VTN Manager as follows. It uses curl
2764 command to call the REST API.
2765
2766 -  Create a virtual tenant named vtn1 by executing `the update-vtn
2767    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
2768
2769 ::
2770
2771     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2772
2773 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
2774    `the update-vbridge
2775    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
2776
2777 ::
2778
2779     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"}}'
2780
2781 -  Create two interfaces into the virtual bridge by executing `the
2782    update-vinterface
2783    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
2784
2785 ::
2786
2787     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"}}'
2788
2789 ::
2790
2791     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"}}'
2792
2793 -  Configure two mappings on the interfaces by executing `the
2794    set-port-map
2795    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
2796
2797    -  The interface if1 of the virtual bridge will be mapped to the port
2798       "s2-eth1" of the switch "openflow:2" of the Mininet.
2799
2800       -  The h1 is connected to the port "s2-eth1".
2801
2802    -  The interface if2 of the virtual bridge will be mapped to the port
2803       "s3-eth1" of the switch "openflow:3" of the Mininet.
2804
2805       -  The h3 is connected to the port "s3-eth1".
2806
2807 ::
2808
2809     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"}}'
2810
2811 ::
2812
2813     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"}}'
2814
2815 -  Create flowcondition named cond\_1 by executing `the
2816    set-flow-condition
2817    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
2818
2819    -  For option source and destination-network, get inet address of
2820       host h1 and h3 from mininet.
2821
2822 ::
2823
2824     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"}]}}'
2825
2826 -  Flowfilter can be applied either in VTN, VBR or VBR Interfaces. Here
2827    in this page we provision flowfilter with VBR Interface and
2828    demonstrate with action type drop and then pass.
2829
2830 -  Flow filter demonstration with DROP action-type. Create Flowfilter in
2831    VBR Interface if1 by executing `the set-flow-filter
2832    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
2833
2834 ::
2835
2836     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"}]}}'
2837
2838 Verification of the drop filter
2839 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2840
2841 -  Please execute ping from h1 to h3. As we have applied the action type
2842    "drop" , ping should fail with no packet flows between hosts h1 and
2843    h3 as below,
2844
2845 ::
2846
2847      mininet> h1 ping h3
2848
2849 Configuration for pass filter
2850 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2851
2852 -  Update the flow filter to pass the packets by executing `the
2853    set-flow-filter
2854    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
2855
2856 ::
2857
2858     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"}]}}'
2859
2860 Verification For Packets Success
2861 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2862
2863 -  As we have applied action type PASS now ping should happen between
2864    hosts h1 and h3.
2865
2866 ::
2867
2868      mininet> h1 ping h3
2869      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2870      64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
2871      64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
2872      64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
2873
2874 -  You can also verify the configurations by executing the following
2875    REST API. It shows all configuration in VTN Manager.
2876
2877 ::
2878
2879     curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/vtn1
2880
2881 ::
2882
2883     {
2884       "vtn": [
2885       {
2886         "name": "vtn1",
2887           "vtenant-config": {
2888             "hard-timeout": 0,
2889             "idle-timeout": 300,
2890             "description": "creating vtn"
2891           },
2892           "vbridge": [
2893           {
2894             "name": "vbr1",
2895             "vbridge-config": {
2896               "age-interval": 600,
2897               "description": "creating vBridge1"
2898             },
2899             "bridge-status": {
2900               "state": "UP",
2901               "path-faults": 0
2902             },
2903             "vinterface": [
2904             {
2905               "name": "if1",
2906               "vinterface-status": {
2907                 "mapped-port": "openflow:2:1",
2908                 "state": "UP",
2909                 "entity-state": "UP"
2910               },
2911               "port-map-config": {
2912                 "vlan-id": 0,
2913                 "node": "openflow:2",
2914                 "port-name": "s2-eth1"
2915               },
2916               "vinterface-config": {
2917                 "description": "Creating if1 interface",
2918                 "enabled": true
2919               },
2920               "vinterface-input-filter": {
2921                 "vtn-flow-filter": [
2922                 {
2923                   "index": 1,
2924                   "condition": "cond_1",
2925                   "vtn-flow-action": [
2926                   {
2927                     "order": 1,
2928                     "vtn-set-inet-src-action": {
2929                       "ipv4-address": "10.0.0.1/32"
2930                     }
2931                   },
2932                   {
2933                     "order": 2,
2934                     "vtn-set-inet-dst-action": {
2935                       "ipv4-address": "10.0.0.3/32"
2936                     }
2937                   }
2938                   ],
2939                     "vtn-pass-filter": {}
2940                 },
2941                 {
2942                   "index": 10,
2943                   "condition": "cond_1",
2944                   "vtn-drop-filter": {}
2945                 }
2946                 ]
2947               }
2948             },
2949             {
2950               "name": "if2",
2951               "vinterface-status": {
2952                 "mapped-port": "openflow:3:1",
2953                 "state": "UP",
2954                 "entity-state": "UP"
2955               },
2956               "port-map-config": {
2957                 "vlan-id": 0,
2958                 "node": "openflow:3",
2959                 "port-name": "s3-eth1"
2960               },
2961               "vinterface-config": {
2962                 "description": "Creating if2 interface",
2963                 "enabled": true
2964               }
2965             }
2966             ]
2967           }
2968         ]
2969       }
2970       ]
2971     }
2972
2973 Cleaning Up
2974 ^^^^^^^^^^^
2975
2976 -  To clean up both VTN and flowcondition.
2977
2978 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
2979    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2980
2981 ::
2982
2983     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2984
2985 -  You can delete the flowcondition cond\_1 by executing `the
2986    remove-flow-condition
2987    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
2988
2989 ::
2990
2991     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"}}'
2992
2993 How to use VTN to change the path of the packet flow
2994 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2995
2996 Overview
2997 ^^^^^^^^
2998
2999 -  This page explains how to create specific VTN Pathmap using VTN
3000    Manager. This page targets Boron release, so the procedure
3001    described here does not work in other releases.
3002
3003 .. figure:: ./images/vtn/Pathmap.png
3004    :alt: Pathmap
3005
3006    Pathmap
3007
3008 Requirement
3009 ^^^^^^^^^^^
3010
3011 -  Save the mininet script given below as pathmap\_test.py and run the
3012    mininet script in the mininet environment where Mininet is installed.
3013
3014 -  Create topology using the below mininet script:
3015
3016 ::
3017
3018      from mininet.topo import Topo
3019      class MyTopo( Topo ):
3020         "Simple topology example."
3021         def __init__( self ):
3022             "Create custom topo."
3023             # Initialize topology
3024             Topo.__init__( self )
3025             # Add hosts and switches
3026             leftHost = self.addHost( 'h1' )
3027             rightHost = self.addHost( 'h2' )
3028             leftSwitch = self.addSwitch( 's1' )
3029             middleSwitch = self.addSwitch( 's2' )
3030             middleSwitch2 = self.addSwitch( 's4' )
3031             rightSwitch = self.addSwitch( 's3' )
3032             # Add links
3033             self.addLink( leftHost, leftSwitch )
3034             self.addLink( leftSwitch, middleSwitch )
3035             self.addLink( leftSwitch, middleSwitch2 )
3036             self.addLink( middleSwitch, rightSwitch )
3037             self.addLink( middleSwitch2, rightSwitch )
3038             self.addLink( rightSwitch, rightHost )
3039      topos = { 'mytopo': ( lambda: MyTopo() ) }
3040
3041 -  After creating new file with the above script start the mininet as
3042    below,
3043
3044 ::
3045
3046     sudo mn --controller=remote,ip=10.106.138.124 --custom pathmap_test.py --topo mytopo
3047
3048 .. note::
3049
3050     Replace "10.106.138.124" with the IP address of OpenDaylight
3051     controller based on your environment.
3052
3053 ::
3054
3055      mininet> net
3056      h1 h1-eth0:s1-eth1
3057      h2 h2-eth0:s3-eth3
3058      s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
3059      s2 lo:  s2-eth1:s1-eth2 s2-eth2:s3-eth1
3060      s3 lo:  s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
3061      s4 lo:  s4-eth1:s1-eth3 s4-eth2:s3-eth2
3062      c0
3063
3064 -  Generate traffic by pinging between host h1 and host h2 before
3065    creating the portmaps respectively.
3066
3067 ::
3068
3069      mininet> h1 ping h2
3070      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3071      From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
3072      From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
3073      From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
3074      From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
3075
3076 Configuration
3077 ^^^^^^^^^^^^^
3078
3079 -  To change the path of the packet flow, execute REST API provided by
3080    VTN Manager as follows. It uses curl command to call the REST API.
3081
3082 -  Create a virtual tenant named vtn1 by executing `the update-vtn
3083    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
3084
3085 ::
3086
3087     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3088
3089 -  Create a virtual bridge named vbr1 in the tenant vtn1 by executing
3090    `the update-vbridge
3091    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
3092
3093 ::
3094
3095     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"}}'
3096
3097 -  Create two interfaces into the virtual bridge by executing `the
3098    update-vinterface
3099    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
3100
3101 ::
3102
3103     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"}}'
3104
3105 ::
3106
3107     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"}}'
3108
3109 -  Configure two mappings on the interfaces by executing `the
3110    set-port-map
3111    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
3112
3113    -  The interface if1 of the virtual bridge will be mapped to the port
3114       "s2-eth1" of the switch "openflow:1" of the Mininet.
3115
3116       -  The h1 is connected to the port "s1-eth1".
3117
3118    -  The interface if2 of the virtual bridge will be mapped to the port
3119       "s3-eth1" of the switch "openflow:3" of the Mininet.
3120
3121       -  The h3 is connected to the port "s3-eth3".
3122
3123 ::
3124
3125     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"}}'
3126
3127 ::
3128
3129     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"}}'
3130
3131 -  Genarate traffic by pinging between host h1 and host h2 after
3132    creating the portmaps respectively.
3133
3134 ::
3135
3136      mininet> h1 ping h2
3137      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3138      64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.861 ms
3139      64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.101 ms
3140      64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.101 ms
3141
3142 -  Get the Dataflows information by executing `the get-data-flow
3143    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow.html#get-data-flow>`__.
3144
3145 ::
3146
3147     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"}}}'
3148
3149 -  Create flowcondition named cond\_1 by executing `the
3150    set-flow-condition
3151    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
3152
3153    -  For option source and destination-network, get inet address of
3154       host h1 or host h2 from mininet
3155
3156 ::
3157
3158     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"}]}}'
3159
3160 -  Create pathmap with flowcondition cond\_1 by executing `the
3161    set-path-map
3162    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-path-map.html#set-path-map>`__.
3163
3164 ::
3165
3166     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"}]}}'
3167
3168 -  Create pathpolicy by executing `the set-path-policy
3169    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-path-policy.html#set-path-policy>`__.
3170
3171 ::
3172
3173     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"}]}}'
3174
3175 Verification
3176 ^^^^^^^^^^^^
3177
3178 -  Before applying Path policy get node information by executing get
3179    dataflow command.
3180
3181 ::
3182
3183     "data-flow-info": [
3184     {
3185       "physical-route": [
3186       {
3187         "physical-ingress-port": {
3188           "port-name": "s3-eth3",
3189             "port-id": "3"
3190         },
3191           "physical-egress-port": {
3192             "port-name": "s3-eth1",
3193             "port-id": "1"
3194           },
3195           "node": "openflow:3",
3196           "order": 0
3197       },
3198       {
3199         "physical-ingress-port": {
3200           "port-name": "s2-eth2",
3201           "port-id": "2"
3202         },
3203         "physical-egress-port": {
3204           "port-name": "s2-eth1",
3205           "port-id": "1"
3206         },
3207         "node": "openflow:2",
3208         "order": 1
3209       },
3210       {
3211         "physical-ingress-port": {
3212           "port-name": "s1-eth2",
3213           "port-id": "2"
3214         },
3215         "physical-egress-port": {
3216           "port-name": "s1-eth1",
3217           "port-id": "1"
3218         },
3219         "node": "openflow:1",
3220         "order": 2
3221       }
3222       ],
3223         "data-egress-node": {
3224           "interface-name": "if1",
3225           "bridge-name": "vbr1",
3226           "tenant-name": "vtn1"
3227         },
3228         "data-egress-port": {
3229           "node": "openflow:1",
3230           "port-name": "s1-eth1",
3231           "port-id": "1"
3232         },
3233         "data-ingress-node": {
3234           "interface-name": "if2",
3235           "bridge-name": "vbr1",
3236           "tenant-name": "vtn1"
3237         },
3238         "data-ingress-port": {
3239           "node": "openflow:3",
3240           "port-name": "s3-eth3",
3241           "port-id": "3"
3242         },
3243         "flow-id": 32
3244       },
3245     }
3246
3247 -  After applying Path policy get node information by executing get
3248    dataflow command.
3249
3250 ::
3251
3252     "data-flow-info": [
3253     {
3254       "physical-route": [
3255       {
3256         "physical-ingress-port": {
3257           "port-name": "s1-eth1",
3258             "port-id": "1"
3259         },
3260           "physical-egress-port": {
3261             "port-name": "s1-eth3",
3262             "port-id": "3"
3263           },
3264           "node": "openflow:1",
3265           "order": 0
3266       },
3267       {
3268         "physical-ingress-port": {
3269           "port-name": "s4-eth1",
3270           "port-id": "1"
3271         },
3272         "physical-egress-port": {
3273           "port-name": "s4-eth2",
3274           "port-id": "2"
3275         },
3276         "node": "openflow:4",
3277         "order": 1
3278       },
3279       {
3280         "physical-ingress-port": {
3281           "port-name": "s3-eth2",
3282           "port-id": "2"
3283         },
3284         "physical-egress-port": {
3285           "port-name": "s3-eth3",
3286           "port-id": "3"
3287         },
3288         "node": "openflow:3",
3289         "order": 2
3290       }
3291       ],
3292         "data-egress-node": {
3293           "interface-name": "if2",
3294           "bridge-name": "vbr1",
3295           "tenant-name": "vtn1"
3296         },
3297         "data-egress-port": {
3298           "node": "openflow:3",
3299           "port-name": "s3-eth3",
3300           "port-id": "3"
3301         },
3302         "data-ingress-node": {
3303           "interface-name": "if1",
3304           "bridge-name": "vbr1",
3305           "tenant-name": "vtn1"
3306         },
3307         "data-ingress-port": {
3308           "node": "openflow:1",
3309           "port-name": "s1-eth1",
3310           "port-id": "1"
3311         },
3312     }
3313
3314 Cleaning Up
3315 ^^^^^^^^^^^
3316
3317 -  To clean up both VTN and flowcondition.
3318
3319 -  You can delete the virtual tenant vtn1 by executing `the remove-vtn
3320    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
3321
3322 ::
3323
3324     curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3325
3326 -  You can delete the flowcondition cond\_1 by executing `the
3327    remove-flow-condition
3328    RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
3329
3330 ::
3331
3332     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"}}'
3333
3334 VTN Coordinator Usage Examples
3335 ------------------------------
3336
3337 How to configure L2 Network with Single Controller
3338 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3339
3340 Overview
3341 ^^^^^^^^
3342
3343 This example provides the procedure to demonstrate configuration of VTN
3344 Coordinator with L2 network using VTN Virtualization(single controller).
3345 Here is the Example for vBridge Interface Mapping with Single Controller
3346 using mininet. mininet details and set-up can be referred at below URL:
3347 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
3348
3349 .. figure:: ./images/vtn/vtn-single-controller-topology-example.png
3350    :alt: EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3351
3352    EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3353
3354 Requirements
3355 ^^^^^^^^^^^^
3356
3357 -  Configure mininet and create a topology:
3358
3359 ::
3360
3361     mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3362
3363 -  mininet> net
3364
3365 ::
3366
3367      s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1
3368      s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0
3369      h1 h1-eth0:s1-eth1
3370      h2 h2-eth0:s2-eth2
3371
3372 Configuration
3373 ^^^^^^^^^^^^^
3374
3375 -  Create a Controller named controllerone and mention its ip-address in
3376    the below create-controller command.
3377
3378 ::
3379
3380     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
3381
3382 -  Create a VTN named vtn1 by executing the create-vtn command
3383
3384 ::
3385
3386     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
3387
3388 -  Create a vBridge named vBridge1 in the vtn1 by executing the
3389    create-vbr command.
3390
3391 ::
3392
3393      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
3394
3395 -  Create two Interfaces named if1 and if2 into the vBridge1
3396
3397 ::
3398
3399     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
3400
3401 ::
3402
3403     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
3404
3405 -  Get the list of logical ports configured
3406
3407 ::
3408
3409     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
3410
3411 -  Configure two mappings on each of the interfaces by executing the
3412    below command.
3413
3414 The interface if1 of the virtual bridge will be mapped to the port
3415 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3416 to the port "s2-eth1".
3417
3418 The interface if2 of the virtual bridge will be mapped to the port
3419 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3420 to the port "s3-eth1".
3421
3422 ::
3423
3424     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
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:02-s2-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
3426
3427 Verification
3428 ^^^^^^^^^^^^
3429
3430 Please verify whether the Host1 and Host3 are pinging.
3431
3432 -  Send packets from Host1 to Host3
3433
3434 ::
3435
3436      mininet> h1 ping h3
3437      PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
3438      64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.780 ms
3439      64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.079 ms
3440
3441 How to configure L2 Network with Multiple Controllers
3442 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3443
3444 -  This example provides the procedure to demonstrate configuration of
3445    VTN Coordinator with L2 network using VTN Virtualization Here is the
3446    Example for vBridge Interface Mapping with Multi-controller using
3447    mininet.
3448
3449 .. figure:: ./images/vtn/MutiController_Example_diagram.png
3450    :alt: EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3451
3452    EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3453
3454 Requirements
3455 ^^^^^^^^^^^^
3456
3457 -  Configure multiple controllers using the mininet script given below:
3458    https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:Scripts:Mininet#Network_with_multiple_switches_and_OpenFlow_controllers
3459
3460 Configuration
3461 ^^^^^^^^^^^^^
3462
3463 -  Create a VTN named vtn3 by executing the create-vtn command
3464
3465 ::
3466
3467     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
3468
3469 -  Create two Controllers named odc1 and odc2 with its ip-address in the
3470    below create-controller command.
3471
3472 ::
3473
3474     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
3475
3476 ::
3477
3478     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
3479
3480 -  Create two vBridges in the VTN like, vBridge1 in Controller1 and
3481    vBridge2 in Controller2
3482
3483 ::
3484
3485      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
3486
3487 ::
3488
3489     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
3490
3491 -  Create two Interfaces if1, if2 for the two vBridges vbr1 and vbr2.
3492
3493 ::
3494
3495     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
3496
3497 ::
3498
3499     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
3500
3501 ::
3502
3503     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
3504
3505 ::
3506
3507     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
3508
3509 -  Get the list of logical ports configured
3510
3511 ::
3512
3513     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
3514
3515 -  Create boundary and vLink for the two controllers
3516
3517 ::
3518
3519     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
3520
3521 ::
3522
3523     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
3524
3525 -  Configure two mappings on each of the interfaces by executing the
3526    below command.
3527
3528 The interface if1 of the vbr1 will be mapped to the port "s2-eth2" of
3529 the switch "openflow:2" of the Mininet. The h2 is connected to the port
3530 "s2-eth2".
3531
3532 The interface if2 of the vbr2 will be mapped to the port "s5-eth2" of
3533 the switch "openflow:5" of the Mininet. The h6 is connected to the port
3534 "s5-eth2".
3535
3536 ::
3537
3538     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
3539
3540 ::
3541
3542     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
3543
3544 Verification
3545 ^^^^^^^^^^^^
3546
3547 Please verify whether Host h2 and Host h6 are pinging.
3548
3549 -  Send packets from h2 to h6
3550
3551 ::
3552
3553     mininet> h2 ping h6
3554
3555 ::
3556
3557      PING 10.0.0.6 (10.0.0.3) 56(84) bytes of data.
3558      64 bytes from 10.0.0.6: icmp_req=1 ttl=64 time=0.780 ms
3559      64 bytes from 10.0.0.6: icmp_req=2 ttl=64 time=0.079 ms
3560
3561 How To Test Vlan-Map In Mininet Environment
3562 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3563
3564 Overview
3565 ^^^^^^^^
3566
3567 This example explains how to test vlan-map in a multi host scenario.
3568
3569 .. figure:: ./images/vtn/vlanmap_using_mininet.png
3570    :alt: Example that demonstrates vlanmap testing in Mininet Environment
3571
3572    Example that demonstrates vlanmap testing in Mininet Environment
3573
3574 Requirements
3575 ^^^^^^^^^^^^
3576
3577 -  Save the mininet script given below as vlan\_vtn\_test.py and run the
3578    mininet script in the mininet environment where Mininet is installed.
3579
3580 Mininet Script
3581 ^^^^^^^^^^^^^^
3582
3583 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
3584
3585 -  Run the mininet script
3586
3587 ::
3588
3589     sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
3590
3591 Configuration
3592 ^^^^^^^^^^^^^
3593
3594 Please follow the below steps to test a vlan map using mininet:
3595
3596 -  Create a Controller named controllerone and mention its ip-address in
3597    the below create-controller command.
3598
3599 ::
3600
3601     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
3602
3603 -  Create a VTN named vtn1 by executing the create-vtn command
3604
3605 ::
3606
3607     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
3608
3609 -  Create a vBridge named vBridge1 in the vtn1 by executing the
3610    create-vbr command.
3611
3612 ::
3613
3614     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
3615
3616 -  Create a vlan map with vlanid 200 for vBridge vBridge1
3617
3618 ::
3619
3620     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
3621
3622 -  Create a vBridge named vBridge2 in the vtn1 by executing the
3623    create-vbr command.
3624
3625 ::
3626
3627     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
3628
3629 -  Create a vlan map with vlanid 300 for vBridge vBridge2
3630
3631 ::
3632
3633     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
3634
3635 Verification
3636 ^^^^^^^^^^^^
3637
3638 Ping all in mininet environment to view the host reachability.
3639
3640 ::
3641
3642     mininet> pingall
3643     Ping: testing ping reachability
3644     h1 -> X h3 X h5 X
3645     h2 -> X X h4 X h6
3646     h3 -> h1 X X h5 X
3647     h4 -> X h2 X X h6
3648     h5 -> h1 X h3 X X
3649     h6 -> X h2 X h4 X
3650
3651 How To View Specific VTN Station Information.
3652 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3653
3654 This example demonstrates on how to view a specific VTN Station
3655 information.
3656
3657 .. figure:: ./images/vtn/vtn_stations.png
3658    :alt: EXAMPLE DEMONSTRATING VTN STATIONS
3659
3660    EXAMPLE DEMONSTRATING VTN STATIONS
3661
3662 Requirement
3663 ^^^^^^^^^^^
3664
3665 -  Configure mininet and create a topology:
3666
3667 ::
3668
3669      $ sudo mn --custom /home/mininet/mininet/custom/topo-2sw-2host.py --controller=remote,ip=10.100.9.61 --topo mytopo
3670     mininet> net
3671
3672      s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1
3673      s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0
3674      h1 h1-eth0:s1-eth1
3675      h2 h2-eth0:s2-eth2
3676
3677 -  Generate traffic by pinging between hosts h1 and h2 after configuring
3678    the portmaps respectively
3679
3680 ::
3681
3682      mininet> h1 ping h2
3683      PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3684      64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=16.7 ms
3685      64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=13.2 ms
3686
3687 Configuration
3688 ^^^^^^^^^^^^^
3689
3690 -  Create a Controller named controllerone and mention its ip-address in
3691    the below create-controller command
3692
3693 ::
3694
3695     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
3696
3697 -  Create a VTN named vtn1 by executing the create-vtn command
3698
3699 ::
3700
3701     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
3702
3703 -  Create a vBridge named vBridge1 in the vtn1 by executing the
3704    create-vbr command.
3705
3706 ::
3707
3708     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
3709
3710 -  Create two Interfaces named if1 and if2 into the vBridge1
3711
3712 ::
3713
3714     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
3715     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
3716
3717 -  Configure two mappings on each of the interfaces by executing the
3718    below command.
3719
3720 The interface if1 of the virtual bridge will be mapped to the port
3721 "s1-eth1" of the switch "openflow:1" of the Mininet. The h1 is connected
3722 to the port "s1-eth1".
3723
3724 The interface if2 of the virtual bridge will be mapped to the port
3725 "s1-eth2" of the switch "openflow:1" of the Mininet. The h2 is connected
3726 to the port "s1-eth2".
3727
3728 ::
3729
3730     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
3731     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
3732
3733 -  Get the VTN stations information
3734
3735 ::
3736
3737     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"
3738
3739 Verification
3740 ^^^^^^^^^^^^
3741
3742 ::
3743
3744     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"
3745     {
3746        "vtnstations": [
3747            {
3748                "domain_id": "(DEFAULT)",
3749                "interface": {},
3750                "ipaddrs": [
3751                    "10.0.0.2"
3752                ],
3753                "macaddr": "b2c3.06b8.2dac",
3754                "no_vlan_id": "true",
3755                "port_name": "s2-eth2",
3756                "station_id": "178195618445172",
3757                "switch_id": "00:00:00:00:00:00:00:02",
3758                "vnode_name": "vBridge1",
3759                "vnode_type": "vbridge",
3760                "vtn_name": "vtn1"
3761            },
3762            {
3763                "domain_id": "(DEFAULT)",
3764                "interface": {},
3765                "ipaddrs": [
3766                    "10.0.0.1"
3767                ],
3768                "macaddr": "ce82.1b08.90cf",
3769                "no_vlan_id": "true",
3770                "port_name": "s1-eth1",
3771                "station_id": "206130278144207",
3772                "switch_id": "00:00:00:00:00:00:00:01",
3773                "vnode_name": "vBridge1",
3774                "vnode_type": "vbridge",
3775                "vtn_name": "vtn1"
3776            }
3777        ]
3778     }
3779
3780 How To View Dataflows in VTN
3781 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3782
3783 This example demonstrates on how to view a specific VTN Dataflow
3784 information.
3785
3786 Configuration
3787 ^^^^^^^^^^^^^
3788
3789 The same Configuration as Vlan Mapping
3790 Example(\ https://wiki.opendaylight.org/view/VTN:Coordinator:Beryllium:HowTos:How_To_test_vlanmap_using_mininet)
3791
3792 Verification
3793 ^^^^^^^^^^^^
3794
3795 Get the VTN Dataflows information
3796
3797 ::
3798
3799     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"
3800
3801 ::
3802
3803     {
3804        "dataflows": [
3805            {
3806                "controller_dataflows": [
3807                    {
3808                        "controller_id": "controllerone",
3809                        "controller_type": "odc",
3810                        "egress_domain_id": "(DEFAULT)",
3811                        "egress_port_name": "s3-eth3",
3812                        "egress_station_id": "3",
3813                        "egress_switch_id": "00:00:00:00:00:00:00:03",
3814                        "flow_id": "29",
3815                        "ingress_domain_id": "(DEFAULT)",
3816                        "ingress_port_name": "s2-eth2",
3817                        "ingress_station_id": "2",
3818                        "ingress_switch_id": "00:00:00:00:00:00:00:02",
3819                        "match": {
3820                            "macdstaddr": [
3821                                "4298.0959.0e0b"
3822                            ],
3823                            "macsrcaddr": [
3824                                "924c.e4a3.a743"
3825                            ],
3826                            "vlan_id": [
3827                                "300"
3828                            ]
3829                        },
3830                        "pathinfos": [
3831                            {
3832                                "in_port_name": "s2-eth2",
3833                                "out_port_name": "s2-eth1",
3834                                "switch_id": "00:00:00:00:00:00:00:02"
3835                            },
3836                            {
3837                                "in_port_name": "s1-eth2",
3838                                "out_port_name": "s1-eth3",
3839                                "switch_id": "00:00:00:00:00:00:00:01"
3840                            },
3841                            {
3842                                "in_port_name": "s3-eth1",
3843                                "out_port_name": "s3-eth3",
3844                                "switch_id": "00:00:00:00:00:00:00:03"
3845                            }
3846                        ]
3847                    }
3848                ],
3849                "reason": "success"
3850            }
3851        ]
3852     }
3853
3854 How To Configure Flow Filters Using VTN
3855 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3856
3857 Overview
3858 ^^^^^^^^
3859
3860 The flow-filter function discards, permits, or redirects packets of the
3861 traffic within a VTN, according to specified flow conditions The table
3862 below lists the actions to be applied when a packet matches the
3863 condition:
3864
3865 +--------------------------------------+--------------------------------------+
3866 | Action                               | Function                             |
3867 +--------------------------------------+--------------------------------------+
3868 | Pass                                 | Permits the packet to pass. As       |
3869 |                                      | options, packet transfer priority    |
3870 |                                      | (set priority) and DSCP change (se t |
3871 |                                      | ip-dscp) is specified.               |
3872 +--------------------------------------+--------------------------------------+
3873 | Drop                                 | Discards the packet.                 |
3874 +--------------------------------------+--------------------------------------+
3875 | Redirect                             | Redirects the packet to a desired    |
3876 |                                      | virtual interface. As an option, it  |
3877 |                                      | is possible to change the MAC        |
3878 |                                      | address when the packet is           |
3879 |                                      | transferred.                         |
3880 +--------------------------------------+--------------------------------------+
3881
3882 .. figure:: ./images/vtn/flow_filter_example.png
3883    :alt: Flow Filter
3884
3885    Flow Filter
3886
3887 Following steps explain flow-filter function:
3888
3889 -  When a packet is transferred to an interface within a virtual
3890    network, the flow-filter function evaluates whether the transferred
3891    packet matches the condition specified in the flow-list.
3892
3893 -  If the packet matches the condition, the flow-filter applies the
3894    flow-list matching action specified in the flow-filter.
3895
3896 Requirements
3897 ^^^^^^^^^^^^
3898
3899 To apply the packet filter, configure the following:
3900
3901 -  Create a flow-list and flow-listentry.
3902
3903 -  Specify where to apply the flow-filter, for example VTN, vBridge, or
3904    interface of vBridge.
3905
3906 Configure mininet and create a topology:
3907
3908 ::
3909
3910     $  mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree
3911
3912 Please generate the following topology
3913
3914 ::
3915
3916     $  mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3917     mininet> net
3918     c0
3919     s1 lo:  s1-eth1:s2-eth3 s1-eth2:s3-eth3
3920     s2 lo:  s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
3921     s3 lo:  s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
3922     h1 h1-eth0:s2-eth1
3923     h2 h2-eth0:s2-eth2
3924     h3 h3-eth0:s3-eth1
3925     h4 h4-eth0:s3-eth2
3926
3927 Configuration
3928 ^^^^^^^^^^^^^
3929
3930 -  Create a Controller named controller1 and mention its ip-address in
3931    the below create-controller command.
3932
3933 ::
3934
3935     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
3936
3937 -  Create a VTN named vtn\_one by executing the create-vtn command
3938
3939 ::
3940
3941     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
3942
3943 -  Create a vBridge named vbr\_two in the vtn1 by executing the
3944    create-vbr command.
3945
3946 ::
3947
3948     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
3949     curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" :
3950     {"vbr_name":"vbr_two","controller_id":"controller1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges.json
3951
3952 -  Create two Interfaces named if1 and if2 into the vbr\_two
3953
3954 ::
3955
3956     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
3957     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
3958
3959 -  Get the list of logical ports configured
3960
3961 ::
3962
3963     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
3964
3965 -  Configure two mappings on each of the interfaces by executing the
3966    below command.
3967
3968 The interface if1 of the virtual bridge will be mapped to the port
3969 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3970 to the port "s2-eth1".
3971
3972 The interface if2 of the virtual bridge will be mapped to the port
3973 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3974 to the port "s3-eth1".
3975
3976 ::
3977
3978     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
3979     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
3980
3981 -  Create Flowlist
3982
3983 ::
3984
3985     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
3986
3987 -  Create Flowlistentry
3988
3989 ::
3990
3991     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
3992
3993 -  Create vBridge Interface Flowfilter
3994
3995 ::
3996
3997     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
3998
3999 Flow filter demonstration with DROP action-type
4000 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4001
4002 ::
4003
4004     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
4005
4006 Verification
4007 ^^^^^^^^^^^^
4008
4009 As we have applied the action type "drop" , ping should fail.
4010
4011 ::
4012
4013     mininet> h1 ping h3
4014     PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4015     From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
4016     From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
4017
4018 Flow filter demonstration with PASS action-type
4019 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4020
4021 ::
4022
4023     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
4024
4025 Verification
4026 ^^^^^^^^^^^^
4027
4028 ::
4029
4030     mininet> h1 ping h3
4031     PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
4032     64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
4033     64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
4034     64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
4035
4036 How To Use VTN To Make Packets Take Different Paths
4037 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4038
4039 This example demonstrates on how to create a specific VTN Path Map
4040 information.
4041
4042 .. figure:: ./images/vtn/Pathmap.png
4043    :alt: PathMap
4044
4045    PathMap
4046
4047 Requirement
4048 ^^^^^^^^^^^
4049
4050 -  Save the mininet script given below as pathmap\_test.py and run the
4051    mininet script in the mininet environment where Mininet is installed.
4052
4053 -  Create topology using the below mininet script:
4054
4055 ::
4056
4057      from mininet.topo import Topo
4058      class MyTopo( Topo ):
4059         "Simple topology example."
4060         def __init__( self ):
4061             "Create custom topo."
4062             # Initialize topology
4063             Topo.__init__( self )
4064             # Add hosts and switches
4065             leftHost = self.addHost( 'h1' )
4066             rightHost = self.addHost( 'h2' )
4067             leftSwitch = self.addSwitch( 's1' )
4068             middleSwitch = self.addSwitch( 's2' )
4069             middleSwitch2 = self.addSwitch( 's4' )
4070             rightSwitch = self.addSwitch( 's3' )
4071             # Add links
4072             self.addLink( leftHost, leftSwitch )
4073             self.addLink( leftSwitch, middleSwitch )
4074             self.addLink( leftSwitch, middleSwitch2 )
4075             self.addLink( middleSwitch, rightSwitch )
4076             self.addLink( middleSwitch2, rightSwitch )
4077             self.addLink( rightSwitch, rightHost )
4078      topos = { 'mytopo': ( lambda: MyTopo() ) }
4079
4080 ::
4081
4082      mininet> net
4083      c0
4084      s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
4085      s2 lo:  s2-eth1:s1-eth2 s2-eth2:s3-eth1
4086      s3 lo:  s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
4087      s4 lo:  s4-eth1:s1-eth3 s4-eth2:s3-eth2
4088      h1 h1-eth0:s1-eth1
4089      h2 h2-eth0:s3-eth3
4090
4091 -  Generate traffic by pinging between hosts h1 and h2 before creating
4092    the portmaps respectively
4093
4094 ::
4095
4096       mininet> h1 ping h2
4097       PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4098       From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
4099       From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
4100       From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
4101       From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
4102
4103 Configuration
4104 ^^^^^^^^^^^^^
4105
4106 -  Create a Controller named controller1 and mention its ip-address in
4107    the below create-controller command.
4108
4109 ::
4110
4111     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
4112
4113 -  Create a VTN named vtn1 by executing the create-vtn command
4114
4115 ::
4116
4117     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
4118
4119 -  Create a vBridge named vBridge1 in the vtn1 by executing the
4120    create-vbr command.
4121
4122 ::
4123
4124     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
4125
4126 -  Create two Interfaces named if1 and if2 into the vBridge1
4127
4128 ::
4129
4130     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
4131     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
4132
4133 -  Configure two mappings on each of the interfaces by executing the
4134    below command.
4135
4136 The interface if1 of the virtual bridge will be mapped to the port
4137 "s1-eth1" of the switch "openflow:1" of the Mininet. The h1 is connected
4138 to the port "s1-eth1".
4139
4140 The interface if2 of the virtual bridge will be mapped to the port
4141 "s3-eth3" of the switch "openflow:3" of the Mininet. The h2 is connected
4142 to the port "s3-eth3".
4143
4144 ::
4145
4146     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
4147     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
4148
4149 -  Generate traffic by pinging between hosts h1 and h2 after creating
4150    the portmaps respectively
4151
4152 ::
4153
4154       mininet> h1 ping h2
4155       PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4156       64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=36.4 ms
4157       64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.880 ms
4158       64 bytes from 10.0.0.2: icmp_req=3 ttl=64 time=0.073 ms
4159       64 bytes from 10.0.0.2: icmp_req=4 ttl=64 time=0.081 ms
4160
4161 -  Get the VTN Dataflows information
4162
4163 ::
4164
4165     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"
4166
4167 -  Create a Flowcondition in the VTN
4168
4169 **(The flowconditions, pathmap and pathpolicy commands have to be
4170 executed in the controller).**
4171
4172 ::
4173
4174     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"}]}}'
4175
4176 -  Create a Pathmap in the VTN
4177
4178 ::
4179
4180     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"}]}}'
4181
4182 -  Get the Path policy information
4183
4184 ::
4185
4186     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"}]}}'
4187
4188 Verification
4189 ^^^^^^^^^^^^
4190
4191 -  Before applying Path policy information in the VTN
4192
4193 ::
4194
4195     {
4196             "pathinfos": [
4197                 {
4198                   "in_port_name": "s1-eth1",
4199                   "out_port_name": "s1-eth3",
4200                   "switch_id": "openflow:1"
4201                 },
4202                 {
4203                   "in_port_name": "s4-eth1",
4204                   "out_port_name": "s4-eth2",
4205                   "switch_id": "openflow:4"
4206                 },
4207                 {
4208                    "in_port_name": "s3-eth2",
4209                    "out_port_name": "s3-eth3",
4210                    "switch_id": "openflow:3"
4211                 }
4212                          ]
4213     }
4214
4215 -  After applying Path policy information in the VTN
4216
4217 ::
4218
4219     {
4220         "pathinfos": [
4221                 {
4222                   "in_port_name": "s1-eth1",
4223                   "out_port_name": "s1-eth2",
4224                   "switch_id": "openflow:1"
4225                 },
4226                 {
4227                   "in_port_name": "s2-eth1",
4228                   "out_port_name": "s2-eth2",
4229                   "switch_id": "openflow:2"
4230                 },
4231                 {
4232                    "in_port_name": "s3-eth1",
4233                    "out_port_name": "s3-eth3",
4234                    "switch_id": "openflow:3"
4235                 }
4236                          ]
4237     }
4238
4239 VTN Coordinator(Troubleshooting HowTo)
4240 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4241
4242 Overview
4243 ^^^^^^^^
4244
4245 This page demonstrates Installation troubleshooting steps of VTN
4246 Coordinator. OpenDaylight VTN provides multi-tenant virtual network
4247 functions on OpenDaylight controllers. OpenDaylight VTN consists of two
4248 parts:
4249
4250 -  VTN Coordinator.
4251
4252 -  VTN Manager.
4253
4254 VTN Coordinator orchestrates multiple VTN Managers running in
4255 OpenDaylight Controllers, and provides VTN Applications with VTN API.
4256 VTN Manager is OSGi bundles running in OpenDaylight Controller. Current
4257 VTN Manager supports only OpenFlow switches. It handles PACKET\_IN
4258 messages, sends PACKET\_OUT messages, manages host information, and
4259 installs flow entries into OpenFlow switches to provide VTN Coordinator
4260 with virtual network functions. The requirements for installing these
4261 two are different.Therefore, we recommend that you install VTN Manager
4262 and VTN Coordinator in different machines.
4263
4264 List of installation Troubleshooting How to’s
4265 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4266
4267 -  https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Installation:VTN_Coordinator
4268
4269 **After executing db\_setup, you have encountered the error "Failed to
4270 setup database"?**
4271
4272 The error could be due to the below reasons
4273
4274 -  Access Restriction
4275
4276 The user who owns /usr/local/vtn/ directory and installs VTN
4277 Coordinator, can only start db\_setup. Example :
4278
4279 ::
4280
4281       The directory should appear as below (assuming the user as "vtn"):
4282       # ls -l /usr/local/
4283         drwxr-xr-x. 12 vtn  vtn  4096 Mar 14 21:53 vtn
4284       If the user doesnot own /usr/local/vtn/ then, please run the below command (assuming the username as vtn),
4285                   chown -R vtn:vtn /usr/local/vtn
4286
4287 -  Postgres not Present
4288
4289 ::
4290
4291     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
4292     2. In case of Ubuntu, check if /usr/lib/postgres/<version> directory is present and check for the commands as in the previous step.
4293
4294 -  Not enough space to create tables
4295
4296 ::
4297
4298     Please check df -k and ensure enough free space is available.
4299
4300 -  If the above steps do not solve the problem, please refer to the log
4301    file for the exact problem
4302
4303 ::
4304
4305     /usr/local/vtn/var/dbm/unc_setup_db.log for the exact error.
4306
4307 -  list of VTN Coordinator processes
4308
4309 -  Run the below command ensure the Coordinator daemons are running.
4310
4311 ::
4312
4313            Command:     /usr/local/vtn/bin/unc_dmctl status
4314            Name              Type           IPC Channel       PID
4315         -----------       -----------      --------------     ------
4316             drvodcd         DRIVER           drvodcd           15972
4317             lgcnwd         LOGICAL           lgcnwd            16010
4318             phynwd         PHYSICAL          phynwd            15996
4319
4320 -  Issue the curl command to fetch version and ensure the process is
4321    able to respond.
4322
4323 **How to debug a startup failure?.**
4324
4325 The following activities take place in order during startup
4326
4327 -  Database server is started after setting virtual memory to required
4328    value,Any database startup errors will be reflected in any of the
4329    below logs.
4330
4331 ::
4332
4333              /usr/local/vtn/var/dbm/unc_db_script.log.
4334              /usr/local/vtn/var/db/pg_log/postgresql-*.log (the pattern will have the date)
4335
4336 -  uncd daemon is kicked off, The daemon in turn kicks off the rest of
4337    the daemons.
4338
4339 ::
4340
4341       Any  uncd startup failures will be reflected in /usr/local/vtn/var/uncd/uncd_start.err.
4342
4343 After setting up the apache tomcat server, what are the aspects that should be checked.
4344 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
4345
4346 **Please check if catalina is running..**
4347
4348 ::
4349
4350         The command ps -ef | grep catalina | grep -v grep should list a catalina process
4351
4352 **If you encounter an erroneous situation where the REST API is always
4353 failing..**
4354
4355 ::
4356
4357       Please ensure the firewall settings for port:8181 (Beryllium release) or port:8083 (Post Beryllium release) and enable the same.
4358
4359 **How to debug a REST API returning a failure message?.**
4360
4361 Please check the /usr/share/java/apache-tomcat-7.0.39/logs/core/core.log
4362 for failure details.
4363
4364 **REST API for VTN configuration fails, how to debug?.**
4365
4366 The default log level for all daemons is "INFO", to debug the situation
4367 TRACE or DEBUG logs may be needed. To increase the log level for
4368 individual daemons, please use the commands suggested below
4369
4370 ::
4371
4372       /usr/local/vtn/bin/lgcnw_control loglevel trace -- upll daemon log
4373        /usr/local/vtn/bin/phynw_control loglevel trace -- uppl daemon log
4374        /usr/local/vtn/bin/unc_control loglevel trace -- uncd daemon log
4375        /usr/local/vtn/bin/drvodc_control loglevel trace -- Driver daemon log
4376
4377 After setting the log levels, the operation can be repeated and the log
4378 files can be referred for debugging.
4379
4380 **Problems while Installing PostgreSQL due to openssl.**
4381
4382 Errors may occur when trying to install postgreSQL rpms. Recently
4383 PostgreSQL has upgraded all their binaries to use the latest openssl
4384 versions with fix for http://en.wikipedia.org/wiki/Heartbleed Please
4385 upgrade the openssl package to the latest version and re-install. For
4386 RHEL 6.1/6.4 : If you have subscription, Please use the same and update
4387 the rpms. The details are available in the following link
4388 https://access.redhat.com/site/solutions/781793 ACCESS-REDHAT
4389
4390 ::
4391
4392       rpm -Uvh http://mirrors.kernel.org/centos/6/os/x86_64/Packages/openssl-1.0.1e-15.el6.x86_64.rpm
4393       rpm -ivh http://mirrors.kernel.org/centos/6/os/x86_64/Packages/openssl-devel-1.0.1e-15.el6.x86_64.rpm
4394
4395 For other linux platforms, Please do yum update, the public respositroes
4396 will have the latest openssl, please install the same.
4397
4398 Support for Microsoft SCVMM 2012 R2 with ODL VTN
4399 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4400
4401 Introduction
4402 ^^^^^^^^^^^^
4403
4404 System Center Virtual Machine Manager (SCVMM) is Microsoft’s virtual
4405 machine support center for window’s based emulations. SCVMM is a
4406 management solution for the virtualized data center. You can use it to
4407 configure and manage your virtualization host, networking, and storage
4408 resources in order to create and deploy virtual machines and services to
4409 private clouds that you have created.
4410
4411 The VSEM Provider is a plug-in to bridge between SCVMM and OpenDaylight.
4412
4413 Microsoft Hyper-V is a server virtualization developed by Microsoft,
4414 which provides virtualization services through hypervisor-based
4415 emulations.
4416
4417 .. figure:: ./images/vtn/setup_diagram_SCVMM.png
4418    :alt: Set-Up Diagram
4419
4420    Set-Up Diagram
4421
4422 **The topology used in this set-up is:**
4423
4424 -  A SCVMM with VSEM Provider installed and a running VTN Coordinator
4425    and OpenDaylight with VTN Feature installed.
4426
4427 -  PF1000 virtual switch extension has been installed in the two Hyper-V
4428    servers as it implements the OpenFlow capability in Hyper-V.
4429
4430 -  Three OpenFlow switches simulated using mininet and connected to
4431    Hyper-V.
4432
4433 -  Four VM’s hosted using SCVMM.
4434
4435 **It is implemented as two major components:**
4436
4437 -  SCVMM
4438
4439 -  OpenDaylight (VTN Feature)
4440
4441 -  VTN Coordinator
4442
4443 VTN Coordinator
4444 ^^^^^^^^^^^^^^^
4445
4446 OpenDaylight VTN as Network Service provider for SCVMM where VSEM
4447 provider is added in the Network Service which will handle all requests
4448 from SCVMM and communicate with the VTN Coordinator. It is used to
4449 manage the network virtualization provided by OpenDaylight.
4450
4451 Installing HTTPS in VTN Coordinator
4452 '''''''''''''''''''''''''''''''''''
4453
4454 -  System Center Virtual Machine Manager (SCVMM) supports only https
4455    protocol.
4456
4457 **Apache Portable Runtime (APR) Installation Steps**
4458
4459 -  Enter the command "yum install **apr**" in VTN Coordinator installed
4460    machine.
4461
4462 -  In /usr/bin, create a soft link as "ln –s /usr/bin/apr-1-config
4463    /usr/bin/apr-config".
4464
4465 -  Extract tomcat under "/usr/share/java" by using the below command
4466    "tar -xvf apache-tomcat-8.0.27.tar.gz –C /usr/share/java".
4467
4468 .. note::
4469
4470     Please go through the bleow link to download
4471     apache-tomcat-8.0.27.tar.gz file,
4472     https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.27/bin/
4473
4474 -  Please go to the directory "cd
4475    /usr/share/java/apache-tomcat-8.0.27/bin and unzip tomcat-native.gz
4476    using this command "tar -xvf tomcat-native.gz".
4477
4478 -  Go to the directory "cd
4479    /usr/share/java/apache-tomcat-8.0.27/bin/tomcat-native-1.1.33-src/jni/native".
4480
4481 -  Enter the command "./configure --with-os-type=bin
4482    --with-apr=/usr/bin/apr-config".
4483
4484 -  Enter the command "make" and "make install".
4485
4486 -  Apr libraries are successfully installed in "/usr/local/apr/lib".
4487
4488 **Enable HTTP/HTTPS in VTN Coordinator**
4489
4490 Enter the command "firewall-cmd --zone=public --add-port=8083/tcp
4491 --permanent" and "firewall-cmd --reload" to enable firewall settings in
4492 server.
4493
4494 **Create a CA’s private key and a self-signed certificate in server**
4495
4496 -  Execute the following command "openssl req -x509 -days 365
4497    -extensions v3\_ca -newkey rsa:2048 –out /etc/pki/CA/cacert.pem
4498    –keyout /etc/pki/CA/private/cakey.pem" in a single line.
4499
4500 +-----------------------+----------------------------------------------------+
4501 | Argument              | Description                                        |
4502 +=======================+====================================================+
4503 | Country Name          | | Specify the country code.                        |
4504 |                       | | For example, JP                                  |
4505 +-----------------------+----------------------------------------------------+
4506 | State or Province     | | Specify the state or province.                   |
4507 | Name                  | | For example, Tokyo                               |
4508 +-----------------------+----------------------------------------------------+
4509 | Locality Name         | | Locality Name                                    |
4510 |                       | | For example, Chuo-Ku                             |
4511 +-----------------------+----------------------------------------------------+
4512 | Organization Name     | Specify the company.                               |
4513 +-----------------------+----------------------------------------------------+
4514 | Organizational Unit   | Specify the department, division, or the like.     |
4515 | Name                  |                                                    |
4516 +-----------------------+----------------------------------------------------+
4517 | Common Name           | Specify the host name.                             |
4518 +-----------------------+----------------------------------------------------+
4519 | Email Address         | Specify the e-mail address.                        |
4520 +-----------------------+----------------------------------------------------+
4521
4522 -  Execute the following commands: "touch /etc/pki/CA/index.txt" and
4523    "echo 00 > /etc/pki/CA/serial" in server after setting your CA’s
4524    private key.
4525
4526 **Create a private key and a CSR for web server**
4527
4528 -  Execute the following command "openssl req -new -newkey rsa:2048 -out
4529    csr.pem –keyout /usr/local/vtn/tomcat/conf/key.pem" in a single line.
4530
4531 -  Enter the PEM pass phrase: Same password you have given in CA’s
4532    private key PEM pass phrase.
4533
4534 +-----------------------+----------------------------------------------------+
4535 | Argument              | Description                                        |
4536 +=======================+====================================================+
4537 | Country Name          | | Specify the country code.                        |
4538 |                       | | For example, JP                                  |
4539 +-----------------------+----------------------------------------------------+
4540 | State or Province     | | Specify the state or province.                   |
4541 | Name                  | | For example, Tokyo                               |
4542 +-----------------------+----------------------------------------------------+
4543 | Locality Name         | | Locality Name                                    |
4544 |                       | | For example, Chuo-Ku                             |
4545 +-----------------------+----------------------------------------------------+
4546 | Organization Name     | Specify the company.                               |
4547 +-----------------------+----------------------------------------------------+
4548 | Organizational Unit   | Specify the department, division, or the like.     |
4549 | Name                  |                                                    |
4550 +-----------------------+----------------------------------------------------+
4551 | Common Name           | Specify the host name.                             |
4552 +-----------------------+----------------------------------------------------+
4553 | Email Address         | Specify the e-mail address.                        |
4554 +-----------------------+----------------------------------------------------+
4555 | A challenge password  | Specify the challenge password.                    |
4556 +-----------------------+----------------------------------------------------+
4557 | An optional company   | Specify an optional company name.                  |
4558 | name                  |                                                    |
4559 +-----------------------+----------------------------------------------------+
4560
4561 **Create a certificate for web server**
4562
4563 -  Execute the following command "openssl ca –in csr.pem –out
4564    /usr/local/vtn/tomcat/conf/cert.pem –days 365 –batch" in a single
4565    line.
4566
4567 -  Enter pass phrase for /etc/pki/CA/private/cakey.pem: Same password
4568    you have given in CA’s private key PEM pass phrase.
4569
4570 -  Open the tomcat file using "vim /usr/local/vtn/tomcat/bin/tomcat".
4571
4572 -  Include the line " TOMCAT\_PROPS="$TOMCAT\_PROPS
4573    -Djava.library.path=\\"/usr/local/apr/lib\\"" " in 131th line and
4574    save the file.
4575
4576 **Edit server.xml file and restart the server**
4577
4578 -  Open the server.xml file using "vim
4579    /usr/local/vtn/tomcat/conf/server.xml" and add the below lines.
4580
4581    ::
4582
4583        <Connector port="${vtn.port}" protocol="HTTP/1.1" SSLEnabled="true"
4584        maxThreads="150" scheme="https" secure="true"
4585        SSLCertificateFile="/usr/local/vtn/tomcat/conf/cert.pem"
4586        SSLCertificateKeyFile="/usr/local/vtn/tomcat/conf/key.pem"
4587        SSLPassword=same password you have given in CA's private key PEM pass phrase
4588        connectionTimeout="20000" />
4589
4590 -  Save the file and restart the server.
4591
4592 -  To stop vtn use the following command.
4593
4594    ::
4595
4596        /usr/local/vtn/bin/vtn_stop
4597
4598 -  To start vtn use the following command.
4599
4600    ::
4601
4602        /usr/local/vtn/bin/vtn_start
4603
4604 -  Copy the created CA certificate from cacert.pem to cacert.crt by
4605    using the following command,
4606
4607    ::
4608
4609        openssl x509 –in /etc/pki/CA/cacert.pem –out cacert.crt
4610
4611    **Checking the HTTP and HTTPS connection from client**
4612
4613 -  You can check the HTTP connection by using the following command:
4614
4615    ::
4616
4617        curl -X GET -H 'contenttype:application/json' -H 'username:admin' -H 'password:adminpass' http://<server IP address>:8083/vtn-webapi/api_version.json
4618
4619 -  You can check the HTTPS connection by using the following command:
4620
4621    ::
4622
4623        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
4624
4625 -  The response should be like this for both HTTP and HTTPS:
4626
4627    ::
4628
4629        {"api_version":{"version":"V1.4"}}
4630
4631 Prerequisites to create Network Service in SCVMM machine, Please follow the below steps
4632 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4633
4634 1.  Please go through the below link to download VSEM Provider zip file,
4635     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
4636
4637 2.  Unzip the vtnmanager-vsemprovider-1.2.0-Boron-bin.zip file
4638     anywhere in your SCVMM machine.
4639
4640 3.  Stop SCVMM service from **"service manager→tools→servers→select
4641     system center virtual machine manager"** and click stop.
4642
4643 4.  Go to **"C:/Program Files"** in your SCVMM machine. Inside
4644     **"C:/Program Files"**, create a folder named as **"ODLProvider"**.
4645
4646 5.  Inside **"C:/Program Files/ODLProvider"**, create a folder named as
4647     "Module" in your SCVMM machine.
4648
4649 6.  Inside "C:/Program Files/ODLProvider/Module", Create two folders
4650     named as **"Odl.VSEMProvider"** and **"VSEMOdlUI"** in your SCVMM
4651     machine.
4652
4653 7.  Copy the **"VSEMOdl.dll"** file from
4654     **"ODL\_SCVMM\_PROVIDER/ODL\_VSEM\_PROVIDER"** to **"C:/Program
4655     Files/ODLProvider/Module/Odl.VSEMProvider"** in your SCVMM machine.
4656
4657 8.  Copy the **"VSEMOdlProvider.psd1"** file from
4658     **"application/vsemprovider/VSEMOdlProvider/VSEMOdlProvider.psd1"**
4659     to **"C:/Program Files/ODLProvider/Module/Odl.VSEMProvider"** in
4660     your SCVMM machine.
4661
4662 9.  Copy the **"VSEMOdlUI.dll"** file from
4663     **"ODL\_SCVMM\_PROVIDER/ODL\_VSEM\_PROVIDER\_UI"** to **"C:/Program
4664     Files/ODLProvider/Module/VSEMOdlUI"** in your SCVMM machine.
4665
4666 10. Copy the **"VSEMOdlUI.psd1"** file from
4667     **"application/vsemprovider/VSEMOdlUI"** to **"C:/Program
4668     Files/ODLProvider/Module/VSEMOdlUI"** in your SCVMM machine.
4669
4670 11. Copy the **"reg\_entry.reg"** file from
4671     **"ODL\_SCVMM\_PROVIDER/Register\_settings"** to your SCVMM desktop
4672     and double click the **"reg\_entry.reg"** file to install registry
4673     entry in your SCVMM machine.
4674
4675 12. Download **"PF1000.msi"** from this link,
4676     https://www.pf-info.com/License/en/index.php?url=index/index_non_buyer
4677     and place into **"C:/Program Files/Switch Extension Drivers"** in
4678     your SCVMM machine.
4679
4680 13. Start SCVMM service from **"service manager→tools→servers→select
4681     system center virtual machine manager"** and click start.
4682
4683 System Center Virtual Machine Manager (SCVMM)
4684 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4685
4686 It supports two major features:
4687
4688 -  Failover Clustering
4689
4690 -  Live Migration
4691
4692 Failover Clustering
4693 '''''''''''''''''''
4694
4695 A single Hyper-V can host a number of virtual machines. If the host were
4696 to fail then all of the virtual machines that are running on it will
4697 also fail, thereby resulting in a major outage. Failover clustering
4698 treats individual virtual machines as clustered resources. If a host
4699 were to fail then clustered virtual machines are able to fail over to a
4700 different Hyper-V server where they can continue to run.
4701
4702 Live Migration
4703 ''''''''''''''
4704
4705 Live Migration is used to migrate the running virtual machines from one
4706 Hyper-V server to another Hyper-V server without any interruptions.
4707 Please go through the below video for more details,
4708
4709 -  https://youtu.be/34YMOTzbNJM
4710
4711 SCVMM User Guide
4712 ^^^^^^^^^^^^^^^^
4713
4714 -  Please go through the below link for SCVMM user guide:
4715    https://wiki.opendaylight.org/images/c/ca/ODL_SCVMM_USER_GUIDE_final.pdf
4716
4717 -  Please go through the below links for more details
4718
4719    -  OpenDaylight SCVMM VTN Integration: https://youtu.be/iRt4dxtiz94
4720
4721    -  OpenDaylight Congestion Control with SCVMM VTN:
4722       https://youtu.be/34YMOTzbNJM
4723