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