1 Virtual Tenant Network (VTN)
2 ============================
7 OpenDaylight Virtual Tenant Network (VTN) is an application that
8 provides multi-tenant virtual network on an SDN controller.
10 Conventionally, huge investment in the network systems and operating
11 expenses are needed because the network is configured as a silo for each
12 department and system. So, various network appliances must be installed
13 for each tenant and those boxes cannot be shared with others. It is a
14 heavy work to design, implement and operate the entire complex network.
16 The uniqueness of VTN is a logical abstraction plane. This enables the
17 complete separation of logical plane from physical plane. Users can
18 design and deploy any desired network without knowing the physical
19 network topology or bandwidth restrictions.
21 VTN allows the users to define the network with a look and feel of
22 conventional L2/L3 network. Once the network is designed on VTN, it will
23 automatically be mapped into underlying physical network, and then
24 configured on the individual switch leveraging SDN control protocol. The
25 definition of logical plane makes it possible not only to hide the
26 complexity of the underlying network but also to better manage network
27 resources. It achieves reducing reconfiguration time of network services
28 and minimizing network configuration errors.
30 .. figure:: ./images/vtn/VTN_Overview.jpg
35 It is implemented as two major components
37 - `VTN Manager <#_vtn_manager>`__
39 - `VTN Coordinator <#_vtn_coordinator>`__
44 An OpenDaylight Plugin that interacts with other modules to implement
45 the components of the VTN model. It also provides a REST interface to
46 configure VTN components in OpenDaylight. VTN Manager is implemented as
47 one plugin to the OpenDaylight. This provides a REST interface to
48 create/update/delete VTN components. The user command in VTN Coordinator
49 is translated as REST API to VTN Manager by the OpenDaylight Driver
50 component. In addition to the above mentioned role, it also provides an
51 implementation to the OpenStack L2 Network Functions API.
56 - **odl-vtn-manager** provides VTN Manager’s JAVA API.
58 - **odl-vtn-manager-rest** provides VTN Manager’s REST API.
60 - **odl-vtn-manager-neutron** provides the integration with Neutron
66 VTN Manager provides REST API for virtual network functions.
68 Here is an example of how to create a virtual tenant network.
72 curl --user "admin":"admin" -H "Accept: application/json" -H \
73 "Content-type: application/json" -X POST \
74 http://localhost:8181/restconf/operations/vtn:update-vtn \
75 -d '{"input":{"tenant-name":"vtn1"}}'
77 You can check the list of all tenants by executing the following
82 curl --user "admin":"admin" -H "Accept: application/json" -H \
83 "Content-type: application/json" -X GET \
84 http://localhost:8181/restconf/operational/vtn:vtns
86 REST API documentation for VTN Manager, please refer to:
87 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/
92 The VTN Coordinator is an external application that provides a REST
93 interface for an user to use OpenDaylight VTN Virtualization. It
94 interacts with VTN Manager plugin to implement the user configuration.
95 It is also capable of multiple OpenDaylight orchestration. It realizes
96 Virtual Tenant Network (VTN) provisioning in OpenDaylight instances. In
97 the OpenDaylight architecture VTN Coordinator is part of the network
98 application, orchestration and services layer. VTN Coordinator will use
99 the REST interface exposed by the VTN Manger to realize the virtual
100 network using OpenDaylight. It uses OpenDaylight APIs (REST) to
101 construct the virtual network in OpenDaylight instances. It provides
102 REST APIs for northbound VTN applications and supports virtual networks
103 spanning across multiple OpenDaylight by coordinating across
106 For VTN Coordinator REST API, please refer to:
107 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:VTN_Coordinator:RestApi
109 Network Virtualization Function
110 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112 The user first defines a VTN. Then, the user maps the VTN to a physical
113 network, which enables communication to take place according to the VTN
114 definition. With the VTN definition, L2 and L3 transfer functions and
115 flow-based traffic control functions (filtering and redirect) are
118 Virtual Network Construction
119 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121 The following table shows the elements which make up the VTN. In the
122 VTN, a virtual network is constructed using virtual nodes (vBridge,
123 vRouter) and virtual interfaces and links. It is possible to configure a
124 network which has L2 and L3 transfer function, by connecting the virtual
125 intrefaces made on virtual nodes via virtual links.
127 +--------------------------------------+--------------------------------------+
128 | vBridge | The logical representation of L2 |
129 | | switch function. |
130 +--------------------------------------+--------------------------------------+
131 | vRouter | The logical representation of router |
133 +--------------------------------------+--------------------------------------+
134 | vTep | The logical representation of Tunnel |
135 | | End Point - TEP. |
136 +--------------------------------------+--------------------------------------+
137 | vTunnel | The logical representation of |
139 +--------------------------------------+--------------------------------------+
140 | vBypass | The logical representation of |
141 | | connectivity between controlled |
143 +--------------------------------------+--------------------------------------+
144 | Virtual interface | The representation of end point on |
145 | | the virtual node. |
146 +--------------------------------------+--------------------------------------+
147 | Virtual Linkv(vLink) | The logical representation of L1 |
148 | | connectivity between virtual |
150 +--------------------------------------+--------------------------------------+
152 The following figure shows an example of a constructed virtual network.
153 VRT is defined as the vRouter, BR1 and BR2 are defined as vBridges.
154 interfaces of the vRouter and vBridges are connected using vLinks.
156 .. figure:: ./images/vtn/VTN_Construction.jpg
157 :alt: VTN Construction
161 Mapping of Physical Network Resources
162 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164 Map physical network resources to the constructed virtual network.
165 Mapping identifies which virtual network each packet transmitted or
166 received by an OpenFlow switch belongs to, as well as which interface in
167 the OpenFlow switch transmits or receives that packet. There are two
168 mapping methods. When a packet is received from the OFS, port mapping is
169 first searched for the corresponding mapping definition, then VLAN
170 mapping is searched, and the packet is mapped to the relevant vBridge
171 according to the first matching mapping.
173 +--------------------------------------+--------------------------------------+
174 | Port mapping | Maps physical network resources to |
175 | | an interface of vBridge using Switch |
176 | | ID, Port ID and VLAN ID of the |
177 | | incoming L2 frame. Untagged frame |
178 | | mapping is also supported. |
179 +--------------------------------------+--------------------------------------+
180 | VLAN mapping | Maps physical network resources to a |
181 | | vBridge using VLAN ID of the |
182 | | incoming L2 frame.Maps physical |
183 | | resources of a particular switch to |
184 | | a vBridge using switch ID and VLAN |
185 | | ID of the incoming L2 frame. |
186 +--------------------------------------+--------------------------------------+
187 | MAC mapping | Maps physical resources to an |
188 | | interface of vBridge using MAC |
189 | | address of the incoming L2 frame(The |
190 | | initial contribution does not |
191 | | include this method). |
192 +--------------------------------------+--------------------------------------+
194 VTN can learn the terminal information from a terminal that is connected
195 to a switch which is mapped to VTN. Further, it is possible to refer
196 that terminal information on the VTN.
198 - Learning terminal information VTN learns the information of a
199 terminal that belongs to VTN. It will store the MAC address and VLAN
200 ID of the terminal in relation to the port of the switch.
202 - Aging of terminal information Terminal information, learned by the
203 VTN, will be maintained until the packets from terminal keep flowing
204 in VTN. If the terminal gets disconnected from the VTN, then the
205 aging timer will start clicking and the terminal information will be
206 maintained till timeout.
208 The following figure shows an example of mapping. An interface of BR1 is
209 mapped to port GBE0/1 of OFS1 using port mapping. Packets received from
210 GBE0/1 of OFS1 are regarded as those from the corresponding interface of
211 BR1. BR2 is mapped to VLAN 200 using VLAN mapping. Packets with VLAN tag
212 200 received from any ports of any OFSs are regarded as those from an
215 .. figure:: ./images/vtn/VTN_Mapping.jpg
223 The vBridge provides the bridge function that transfers a packet to the
224 intended virtual port according to the destination MAC address. The
225 vBridge looks up the MAC address table and transmits the packet to the
226 corresponding virtual interface when the destination MAC address has
227 been learned. When the destination MAC address has not been learned, it
228 transmits the packet to all virtual interfaces other than the receiving
229 port (flooding). MAC addresses are learned as follows.
231 - MAC address learning The vBridge learns the MAC address of the
232 connected host. The source MAC address of each received frame is
233 mapped to the receiving virtual interface, and this MAC address is
234 stored in the MAC address table created on a per-vBridge basis.
236 - MAC address aging The MAC address stored in the MAC address table is
237 retained as long as the host returns the ARP reply. After the host is
238 disconnected, the address is retained until the aging timer times
239 out. To have the vBridge learn MAC addresses statically, you can
240 register MAC addresses manually.
245 The vRouter transfers IPv4 packets between vBridges. The vRouter
246 supports routing, ARP learning, and ARP aging functions. The following
247 outlines the functions.
249 - Routing function When an IP address is registered with a virtual
250 interface of the vRouter, the default routing information for that
251 interface is registered. It is also possible to statically register
252 routing information for a virtual interface.
254 - ARP learning function The vRouter associates a destination IP
255 address, MAC address and a virtual interface, based on an ARP request
256 to its host or a reply packet for an ARP request, and maintains this
257 information in an ARP table prepared for each routing domain. The
258 registered ARP entry is retained until the aging timer, described
259 later, times out. The vRouter transmits an ARP request on an
260 individual aging timer basis and deletes the associated entry from
261 the ARP table if no reply is returned. For static ARP learning, you
262 can register ARP entry information manually.
264 - DHCP relay agent function The vRouter also provides the DHCP relay
267 Flow Filter Functions
268 ~~~~~~~~~~~~~~~~~~~~~
270 Flow Filter function is similar to ACL. It is possible to allow or
271 prohibit communication with only certain kind of packets that meet a
272 particular condition. Also, it can perform a processing called
273 Redirection - WayPoint routing, which is different from the existing
274 ACL. Flow Filter can be applied to any interface of a vNode within VTN,
275 and it is possible to the control the packets that pass interface. The
276 match conditions that could be specified in Flow Filter are as follows.
277 It is also possible to specify a combination of multiple conditions.
281 - Destination MAC address
289 - Destination IP address
295 - TCP/UDP source port
297 - TCP/UDP destination port
303 The types of Action that can be applied on packets that match the Flow
304 Filter conditions are given in the following table. It is possible to
305 make only those packets, which match a particular condition, to pass
306 through a particular server by specifying Redirection in Action. E.g.,
307 path of flow can be changed for each packet sent from a particular
308 terminal, depending upon the destination IP address. VLAN priority
309 control and DSCP marking are also supported.
311 +--------------------------------------+--------------------------------------+
312 | Action | Function |
313 +--------------------------------------+--------------------------------------+
314 | Pass | Pass particular packets matching the |
315 | | specified conditions. |
316 +--------------------------------------+--------------------------------------+
317 | Drop | Discards particular packets matching |
318 | | the specified conditions. |
319 +--------------------------------------+--------------------------------------+
320 | Redirection | Redirects the packet to a desired |
321 | | virtual interface. Both Transparent |
322 | | Redirection (not changing MAC |
323 | | address) and Router Redirection |
324 | | (changing MAC address) are |
326 +--------------------------------------+--------------------------------------+
328 The following figure shows an example of how the flow filter function
331 If there is any matching condition specified by flow filter when a
332 packet being transferred within a virtual network goes through a virtual
333 interface, the function evaluates the matching condition to see whether
334 the packet matches it. If the packet matches the condition, the function
335 applies the matching action specified by flow filter. In the example
336 shown in the figure, the function evaluates the matching condition at
337 BR1 and discards the packet if it matches the condition.
339 .. figure:: ./images/vtn/VTN_Flow_Filter.jpg
344 Multiple SDN Controller Coordination
345 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347 With the network abstractions, VTN enables to configure virtual network
348 across multiple SDN controllers. This provides highly scalable network
351 VTN can be created on each SDN controller. If users would like to manage
352 those multiple VTNs with one policy, those VTNs can be integrated to a
355 As a use case, this feature is deployed to multi data center
356 environment. Even if those data centers are geographically separated and
357 controlled with different controllers, a single policy virtual network
358 can be realized with VTN.
360 Also, one can easily add a new SDN Controller to an existing VTN or
361 delete a particular SDN Controller from VTN.
363 In addition to this, one can define a VTN which covers both OpenFlow
364 network and Overlay network at the same time.
366 Flow Filter, which is set on the VTN, will be automatically applied on
367 the newly added SDN Controller.
369 Coordination between OpenFlow Network and L2/L3 Network
370 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372 It is possible to configure VTN on an environment where there is mix of
373 L2/L3 switches as well. L2/L3 switch will be shown on VTN as vBypass.
374 Flow Filter or policing cannot be configured for a vBypass. However, it
375 is possible to treat it as a virtual node inside VTN.
377 Virtual Tenant Network (VTN) API
378 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
380 VTN provides Web APIs. They are implemented by REST architecture and
381 provide the access to resources within VTN that are identified by URI.
382 User can perform the operations like GET/PUT/POST/DELETE against the
383 virtual network resources (e.g. vBridge or vRouter) by sending a message
384 to VTN through HTTPS communication in XML or JSON format.
386 .. figure:: ./images/vtn/VTN_API.jpg
394 VTN provides following operations for various network resources.
396 +----------------+----------------+----------------+----------------+----------------+
397 | Resources | GET | POST | PUT | DELETE |
398 +----------------+----------------+----------------+----------------+----------------+
399 | VTN | Yes | Yes | Yes | Yes |
400 +----------------+----------------+----------------+----------------+----------------+
401 | vBridge | Yes | Yes | Yes | Yes |
402 +----------------+----------------+----------------+----------------+----------------+
403 | vRouter | Yes | Yes | Yes | Yes |
404 +----------------+----------------+----------------+----------------+----------------+
405 | vTep | Yes | Yes | Yes | Yes |
406 +----------------+----------------+----------------+----------------+----------------+
407 | vTunnel | Yes | Yes | Yes | Yes |
408 +----------------+----------------+----------------+----------------+----------------+
409 | vBypass | Yes | Yes | Yes | Yes |
410 +----------------+----------------+----------------+----------------+----------------+
411 | vLink | Yes | Yes | Yes | Yes |
412 +----------------+----------------+----------------+----------------+----------------+
413 | Interface | Yes | Yes | Yes | Yes |
414 +----------------+----------------+----------------+----------------+----------------+
415 | Port map | Yes | No | Yes | Yes |
416 +----------------+----------------+----------------+----------------+----------------+
417 | Vlan map | Yes | Yes | Yes | Yes |
418 +----------------+----------------+----------------+----------------+----------------+
419 | Flowfilter | Yes | Yes | Yes | Yes |
420 | (ACL/redirect) | | | | |
421 +----------------+----------------+----------------+----------------+----------------+
422 | Controller | Yes | Yes | Yes | Yes |
423 | information | | | | |
424 +----------------+----------------+----------------+----------------+----------------+
425 | Physical | Yes | No | No | No |
427 | information | | | | |
428 +----------------+----------------+----------------+----------------+----------------+
429 | Alarm | Yes | No | No | No |
430 | information | | | | |
431 +----------------+----------------+----------------+----------------+----------------+
436 The following is an example of the usage to construct a virtual network.
442 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
443 -d '{"vtn":{"vtn_name":"VTN1"}}' http://172.1.0.1:8083/vtn-webapi/vtns.json
445 - Create Controller Information
449 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
450 -d '{"controller": {"controller_id":"CONTROLLER1","ipaddr":"172.1.0.1","type":"odc","username":"admin", \
451 "password":"admin","version":"1.0"}}' http://172.1.0.1:8083/vtn-webapi/controllers.json
453 - Create vBridge under VTN
457 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
458 -d '{"vbridge":{"vbr_name":"VBR1","controller_id": "CONTROLLER1","domain_id": "(DEFAULT)"}}' \
459 http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges.json
461 - Create the interface under vBridge
465 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
466 -d '{"interface":{"if_name":"IF1"}}' http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges/VBR1/interfaces.json
468 VTN OpenStack Configuration
469 ---------------------------
471 This guide describes how to set up OpenStack for integration with
472 OpenDaylight Controller.
474 While OpenDaylight Controller provides several ways to integrate with
475 OpenStack, this guide focus on the way which uses VTN features available
476 on OpenDaylight. In the integration, VTN Manager work as network service
477 provider for OpenStack.
479 VTN Manager features, enable OpenStack to work in pure OpenFlow
480 environment in which all switches in data plane are OpenFlow switch.
485 - OpenDaylight Controller. (VTN features must be installed)
487 - OpenStack Control Node.
489 - OpenStack Compute Node.
491 - OpenFlow Switch like mininet(Not Mandatory).
493 The VTN features support multiple OpenStack nodes. You can deploy
494 multiple OpenStack Compute Nodes. In management plane, OpenDaylight
495 Controller, OpenStack nodes and OpenFlow switches should communicate
496 with each other. In data plane, Open vSwitches running in OpenStack
497 nodes should communicate with each other through a physical or logical
498 OpenFlow switches. The core OpenFlow switches are not mandatory.
499 Therefore, you can directly connect to the Open vSwitch’s.
501 .. figure:: ./images/vtn/OpenStack_Demo_Picture.png
502 :alt: Openstack Overview
509 Below steps depicts the configuration of single OpenStack Control node
510 and OpenStack Compute node setup. Our test setup is as follows
512 .. figure:: ./images/vtn/vtn_devstack_setup.png
517 **Server Preparation**
519 - Install Ubuntu 14.04 LTS in two servers (OpenStack Control node and
520 Compute node respectively)
522 - While installing, Ubuntu mandates creation of a User, we created the
523 user "stack"(We will use the same user for running devstack)
525 - Proceed with the below mentioned User Settings and Network Settings
526 in both the Control and Compute nodes.
528 **User Settings for devstack** - Login to both servers - Disable Ubuntu
535 - Install the below packages (optional, provides ifconfig and route
536 coammnds, handy for debugging!!)
540 sudo apt-get install net-tools
542 - Edit sudo vim /etc/sudoers and add an entry as follows
546 stack ALL=(ALL) NOPASSWD: ALL
548 **Network Settings** - Checked the output of ifconfig -a, two interfaces
549 were listed eth0 and eth1 as indicated in the image above. - We had
550 connected eth0 interface to the Network where OpenDaylight is reachable.
551 - eth1 interface in both servers were connected to a different network
552 to act as data plane for the VM’s created using the OpenStack. -
553 Manually edited the file : sudo vim /etc/network/interfaces and made
558 stack@ubuntu-devstack:~/devstack$ cat /etc/network/interfaces
559 # This file describes the network interfaces available on your system
560 # and how to activate them. For more information, see interfaces(5).
561 # The loop-back network interface
563 iface lo inet loopback
564 # The primary network interface
566 iface eth0 inet static
567 address <IP_ADDRESS_TO_REACH_ODL>
569 broadcast <BROADCAST_IP_ADDRESS>
570 gateway <GATEWAY_IP_ADDRESS>
572 iface eth1 inet static
573 address <IP_ADDRESS_UNIQ>
578 Please ensure that the eth0 interface is the default route and it is
579 able to reach the ODL\_IP\_ADDRESS NOTE: The entries for eth1 are
580 not mandatory, If not set, we may have to manually do "ifup eth1"
581 after the stacking is complete to activate the interface
583 **Finalize the user and network settings** - Please reboot both nodes
584 after the user and network settings to have the network settings applied
585 to the network - Login again and check the output of ifconfig to ensure
586 that both interfaces are listed
588 OpenDaylight Settings and Execution
589 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
591 VTN Configuration for OpenStack Integration:
592 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
594 - VTN uses the configuration parameters from "90-vtn-neutron.xml" file
595 for the OpenStack integration.
597 - These values will be set for the OpenvSwitch, in all the
598 participating OpenStack nodes.
600 - A configuration file "90-vtn-neutron.xml" will be generated
601 automatically by following the below steps,
603 - Download the latest Beryllium karaf distribution from the below link,
607 http://www.opendaylight.org/software/downloads
609 - cd "distribution-karaf-0.4.0-Beryllium" and run karaf by using the
610 following command "./bin/karaf".
612 - Install the below feature to generate "90-vtn-neutron.xml"
616 feature:install odl-vtn-manager-neutron
618 - Logout from the karaf console and Check "90-vtn-neutron.xml" file
619 from the following path
620 "distribution-karaf-0.4.0-Beryllium/etc/opendaylight/karaf/".
622 - The contents of "90-vtn-neutron.xml" should be as follows:
624 bridgename=br-int portname=eth1 protocols=OpenFlow13 failmode=secure
626 - The values of the configuration parameters must be changed based on
627 the user environment.
629 - Especially, "portname" should be carefully configured, because if the
630 value is wrong, OpenDaylight fails to forward packets.
632 - Other parameters works fine as is for general use cases.
636 - The name of the bridge in Open vSwitch, that will be created by
637 OpenDaylight Controller.
639 - It must be "br-int".
643 - The name of the port that will be created in the vbridge in
646 - This must be the same name of the interface of OpenStack Nodes
647 which is used for interconnecting OpenStack Nodes in data
648 plane.(in our case:eth1)
650 - By default, if 90-vtn-neutron.xml is not created, VTN uses
655 - OpenFlow protocol through which OpenFlow Switch and Controller
658 - The values can be OpenFlow13 or OpenFlow10.
662 - The value can be "standalone" or "secure".
664 - Please use "secure" for general use cases.
669 - Please refer to the Installation Pages to run ODL with VTN Feature
672 - After running ODL Controller, please ensure ODL Controller listens to
673 the ports:6633,6653, 6640 and 8080
675 - Please allow the ports in firewall for the devstack to be able to
676 communicate with ODL Controller.
680 - 6633/6653 - OpenFlow Ports
682 - 6640 - OVS Manager Port
684 - 8080 - Port for REST API
689 Get Devstack (All nodes)
690 ^^^^^^^^^^^^^^^^^^^^^^^^
692 - Install git application using
694 - sudo apt-get install git
698 - git clone https://git.openstack.org/openstack-dev/devstack;
700 - Switch to stable/Juno Version branch
706 git checkout stable/juno
710 If you want to use stable/kilo Version branch, Please execute the
711 below command in devstack folder
715 git checkout stable/kilo
719 If you want to use stable/liberty Version branch, Please execute the
720 below command in devstack folder
724 git checkout stable/liberty
731 - cd devstack in the controller node
733 - Copy the contents of local.conf for juno (devstack control node) from
734 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack
735 and save it as "local.conf" in the "devstack".
737 - Copy the contents of local.conf for kilo and liberty (devstack
739 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack_post_juno_versions
740 and save it as "local.conf" in the "devstack".
742 - Please modify the IP Address values as required.
750 Verify Control Node stacking
751 ''''''''''''''''''''''''''''
753 - stack.sh prints out Horizon is now available at
754 `http://<CONTROL\_NODE\_IP\_ADDRESS>:8080/ <http://<CONTROL_NODE_IP_ADDRESS>:8080/>`__
756 - Execute the command *sudo ovs-vsctl show* in the control node
757 terminal and verify if the bridge *br-int* is created.
759 - Typical output of the ovs-vsctl show is indicated below:
763 e232bbd5-096b-48a3-a28d-ce4a492d4b4f
764 Manager "tcp:192.168.64.73:6640"
767 Controller "tcp:192.168.64.73:6633"
779 - cd devstack in the controller node
781 - Copy the contents of local.conf for juno (devstack compute node) from
782 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack
783 and save it as "local.conf" in the "devstack".
785 - Copy the contents of local.conf file for kilo and liberty (devstack
787 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack_post_juno_versions
788 and save it as "local.conf" in the "devstack".
790 - Please modify the IP Address values as required.
798 Verify Compute Node Stacking
799 ''''''''''''''''''''''''''''
801 - stack.sh prints out This is your host ip:
802 <COMPUTE\_NODE\_IP\_ADDRESS>
804 - Execute the command *sudo ovs-vsctl show* in the control node
805 terminal and verify if the bridge *br-int* is created.
807 - The output of the ovs-vsctl show will be similar to the one seen in
810 Additional Verifications
811 ^^^^^^^^^^^^^^^^^^^^^^^^
813 - Please visit the OpenDaylight DLUX GUI after stacking all the nodes,
814 `http://<ODL\_IP\_ADDRESS>:8181/index.html <http://<ODL_IP_ADDRESS>:8181/index.html>`__.
815 The switches, topology and the ports that are currently read can be
820 http://<controller-ip>:8181/index.html
824 If the interconnected between the Open vSwitch is not seen, Please
825 bring up the interface for the dataplane manually using the below
830 ifup <interface_name>
832 - Please Accept Promiscuous mode in the networks involving the
835 Create VM from Devstack Horizon GUI
836 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
839 `http://<CONTROL\_NODE\_IP>:8080/ <http://<CONTROL_NODE_IP>:8080/>`__
840 to check the horizon GUI.
842 .. figure:: ./images/vtn/OpenStackGui.png
847 Enter the value for User Name as admin and enter the value for Password
850 - We should first ensure both the hypervisors(control node and compute
851 node) are mapped under hypervisors by clicking on Hpervisors tab.
853 .. figure:: ./images/vtn/Hypervisors.png
858 - Create a new Network from Horizon GUI.
860 - Click on Networks Tab.
862 - click on the Create Network button.
864 .. figure:: ./images/vtn/Create_Network.png
869 - A popup screen will appear.
871 - Enter network name and click Next button.
873 .. figure:: ./images/vtn/Creare_Network_Step_1.png
878 - Create a sub network by giving Network Address and click Next button
881 .. figure:: ./images/vtn/Create_Network_Step_2.png
886 - Specify the additional details for subnetwork (please refer the image
889 .. figure:: ./images/vtn/Create_Network_Step_3.png
894 - Click Create button
898 - Navigate to Instances tab in the GUI.
900 .. figure:: ./images/vtn/Instance_Creation.png
901 :alt: Instance Creation
905 - Click on Launch Instances button.
907 .. figure:: ./images/vtn/Launch_Instance.png
908 :alt: Launch Instance
912 - Click on Details tab to enter the VM details.For this demo we are
913 creating Ten VM’s(instances).
915 - In the Networking tab, we must select the network,for this we need to
916 drag and drop the Available networks to Selected Networks (i.e.,)
917 Drag vtn1 we created from Available networks to Selected Networks and
918 click Launch to create the instances.
920 .. figure:: ./images/vtn/Launch_Instance_network.png
925 - Ten VM’s will be created.
927 .. figure:: ./images/vtn/Load_All_Instances.png
928 :alt: Load All Instances
932 - Click on any VM displayed in the Instances tab and click the Console
935 .. figure:: ./images/vtn/Instance_Console.png
936 :alt: Instance Console
940 - Login to the VM console and verify with a ping command.
942 .. figure:: ./images/vtn/Instance_ping.png
947 Verification of Control and Compute Node after VM creation
948 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
950 - Every time a new VM is created, more interfaces are added to the
951 br-int bridge in Open vSwitch.
953 - Use *sudo ovs-vsctl show* to list the number of interfaces added.
955 - Please visit the DLUX GUI to list the new nodes in every switch.
957 Getting started with DLUX
958 ^^^^^^^^^^^^^^^^^^^^^^^^^
960 Ensure that you have created a topology and enabled MD-SAL feature in
961 the Karaf distribution before you use DLUX for network management.
966 To log in to DLUX, after installing the application: \* Open a browser
967 and enter the login URL. If you have installed DLUX as a stand-alone,
968 then the login URL is http://localhost:9000/DLUX/index.html. However if
969 you have deployed DLUX with Karaf, then the login URL is
970 `http://\\<your <http://\<your>`__ IP\\>:8181/dlux/index.html. \* Login
971 to the application with user ID and password credentials as admin.
972 NOTE:admin is the only user type available for DLUX in this release.
977 To get a complete DLUX feature list, install restconf, odl l2 switch,
978 and switch while you start the DLUX distribution.
980 .. figure:: ./images/vtn/Dlux_login.png
987 DLUX enables only those modules, whose APIs are responding. If you
988 enable just the MD-SAL in beginning and then start dlux, only MD-SAL
989 related tabs will be visible. While using the GUI if you enable
990 AD-SAL karaf features, those tabs will appear automatically.
992 Viewing Network Statistics
993 ^^^^^^^^^^^^^^^^^^^^^^^^^^
995 The Nodes module on the left pane enables you to view the network
996 statistics and port information for the switches in the network. \* To
997 use the Nodes module: \*\* Select Nodeson the left pane.
1001 The right pane displays atable that lists all the nodes, node connectors and the statistics.
1003 - Enter a node ID in the Search Nodes tab to search by node connectors.
1005 - Click on the Node Connector number to view details such as port ID,
1006 port name, number of ports per switch, MAC Address, and so on.
1008 - Click Flows in the Statistics column to view Flow Table Statistics
1009 for the particular node like table ID, packet match, active flows and
1012 - Click Node Connectors to view Node Connector Statistics for the
1015 Viewing Network Topology
1016 ^^^^^^^^^^^^^^^^^^^^^^^^
1018 To view network topology: \* Select Topology on the left pane. You will
1019 view the graphical representation on the right pane.
1024 blue boxes represent the switches,black represents the hosts available, and lines represents how switches are connected.
1028 DLUX UI does not provide ability to add topology information. The
1029 Topology should be created using an open flow plugin. Controller
1030 stores this information in the database and displays on the DLUX
1031 page, when the you connect to the controller using openflow.
1033 .. figure:: ./images/vtn/Dlux_topology.png
1038 OpenStack PackStack Installation Steps
1039 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1041 - Please go through the below wiki page for OpenStack PackStack
1044 - https://wiki.opendaylight.org/view/Release/Lithium/VTN/User_Guide/Openstack_Packstack_Support
1049 - http://devstack.org/guides/multinode-lab.html
1051 - https://wiki.opendaylight.org/view/File:Vtn_demo_hackfest_2014_march.pdf
1053 VTN Manager Usage Examples
1054 --------------------------
1056 How to provision virtual L2 Network
1057 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1062 This page explains how to provision virtual L2 network using VTN
1063 Manager. This page targets Beryllium release, so the procedure described
1064 here does not work in other releases.
1066 .. figure:: ./images/vtn/How_to_provision_virtual_L2_network.png
1067 :alt: Virtual L2 network for host1 and host3
1069 Virtual L2 network for host1 and host3
1077 - To provision OpenFlow switches, this page uses Mininet. Mininet
1078 details and set-up can be referred at the following page:
1079 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
1081 - Start Mininet and create three switches(s1, s2, and s3) and four
1082 hosts(h1, h2, h3, and h4) in it.
1086 mininet@mininet-vm:~$ sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
1090 Replace "192.168.0.100" with the IP address of OpenDaylight
1091 controller based on your environment.
1093 - you can check the topology that you have created by executing "net"
1094 command in the Mininet console.
1103 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3
1104 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
1105 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
1107 - In this guide, you will provision the virtual L2 network to establish
1108 communication between h1 and h3.
1113 To provision the virtual L2 network for the two hosts (h1 and h3),
1114 execute REST API provided by VTN Manager as follows. It uses curl
1115 command to call the REST API.
1117 - Create a virtual tenant named vtn1 by executing `the update-vtn
1118 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#update-vtn>`__.
1122 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1124 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1126 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vbridge.html#update-vbridge>`__.
1130 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1"}}'
1132 - Create two interfaces into the virtual bridge by executing `the
1134 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
1138 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 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2"}}'
1144 - Configure two mappings on the created interfaces by executing `the
1146 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
1148 - The interface if1 of the virtual bridge will be mapped to the port
1149 "s2-eth1" of the switch "openflow:2" of the Mininet.
1151 - The h1 is connected to the port "s2-eth1".
1153 - The interface if2 of the virtual bridge will be mapped to the port
1154 "s3-eth1" of the switch "openflow:3" of the Mininet.
1156 - The h3 is connected to the port "s3-eth1".
1160 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 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"}}'
1169 - Please execute ping from h1 to h3 to verify if the virtual L2 network
1170 for h1 and h3 is provisioned successfully.
1175 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
1176 64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=243 ms
1177 64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.341 ms
1178 64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.078 ms
1179 64 bytes from 10.0.0.3: icmp_seq=4 ttl=64 time=0.079 ms
1181 - You can also verify the configuration by executing the following REST
1182 API. It shows all configuration in VTN Manager.
1186 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/
1188 - The result of the command should be like this.
1198 "idle-timeout": 300,
1214 "vinterface-status": {
1215 "entity-state": "UP",
1217 "mapped-port": "openflow:3:3"
1219 "vinterface-config": {
1222 "port-map-config": {
1224 "port-name": "s3-eth1",
1225 "node": "openflow:3"
1230 "vinterface-status": {
1231 "entity-state": "UP",
1233 "mapped-port": "openflow:2:1"
1235 "vinterface-config": {
1238 "port-map-config": {
1240 "port-name": "s2-eth1",
1241 "node": "openflow:2"
1255 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
1256 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#remove-vtn>`__.
1260 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1262 How To Test Vlan-Map In Mininet Environment
1263 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1268 This page explains how to test Vlan-map in a multi host scenario using
1269 mininet. This page targets Beryllium release, so the procedure described
1270 here does not work in other releases.
1272 .. figure:: ./images/vtn/vlanmap_using_mininet.png
1273 :alt: Example that demonstrates vlanmap testing in Mininet
1276 Example that demonstrates vlanmap testing in Mininet Environment
1281 Save the mininet script given below as vlan\_vtn\_test.py and run the
1282 mininet script in the mininet environment where Mininet is installed.
1287 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
1289 - Run the mininet script
1293 sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
1297 Replace "192.168.64.13" with the IP address of OpenDaylight
1298 controller based on your environment.
1300 - You can check the topology that you have created by executing "net"
1301 command in the Mininet console.
1306 h1 h1-eth0.200:s1-eth1
1307 h2 h2-eth0.300:s2-eth2
1308 h3 h3-eth0.200:s2-eth3
1309 h4 h4-eth0.300:s2-eth4
1310 h5 h5-eth0.200:s3-eth2
1311 h6 h6-eth0.300:s3-eth3
1312 s1 lo: s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
1313 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
1314 s3 lo: s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
1320 To test vlan-map, execute REST API provided by VTN Manager as follows.
1322 - Create a virtual tenant named vtn1 by executing `the update-vtn
1323 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#update-vtn>`__.
1327 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1329 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1331 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vbridge.html#update-vbridge>`__.
1335 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
1337 - Configure a vlan map with vlanid 200 for vBridge vbr1 by executing
1339 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vlan-map.html#add-vlan-map>`__.
1343 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vlan-map:add-vlan-map -d '{"input":{"vlan-id":200,"tenant-name":"vtn1","bridge-name":"vbr1"}}'
1345 - Create a virtual bridge named vbr2 in the tenant vtn1 by executing
1347 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vbridge.html#update-vbridge>`__.
1351 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr2"}}'
1353 - Configure a vlan map with vlanid 300 for vBridge vbr2 by executing
1355 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vlan-map.html#add-vlan-map>`__.
1359 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vlan-map:add-vlan-map -d '{"input":{"vlan-id":300,"tenant-name":"vtn1","bridge-name":"vbr2"}}'
1364 - Please execute pingall in mininet environment to view the host
1370 Ping: testing ping reachability
1378 - You can also verify the configuration by executing the following REST
1379 API. It shows all configurations in VTN Manager.
1383 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1385 - The result of the command should be like this.
1396 "idle-timeout": 300,
1397 "description": "creating vtn"
1403 "age-interval": 600,
1404 "description": "creating vbr2"
1412 "map-id": "ANY.300",
1413 "vlan-map-config": {
1416 "vlan-map-status": {
1425 "age-interval": 600,
1426 "description": "creating vbr1"
1434 "map-id": "ANY.200",
1435 "vlan-map-config": {
1438 "vlan-map-status": {
1453 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
1454 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#remove-vtn>`__.
1458 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1460 How To Configure Service Function Chaining using VTN Manager
1461 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1466 This page explains how to configure VTN Manager for Service Chaining.
1467 This page targets Beryllium release, so the procedure described here
1468 does not work in other releases.
1470 .. figure:: ./images/vtn/Service_Chaining_With_One_Service.png
1471 :alt: Service Chaining With One Service
1473 Service Chaining With One Service
1478 - Please refer to the `Installation
1479 Pages <https://wiki.opendaylight.org/view/VTN:Beryllium:Installation_Guide>`__
1480 to run ODL with VTN Feature enabled.
1482 - Please ensure Bridge-Utils package is installed in mininet
1483 environment before running the mininet script.
1485 - To install Bridge-Utils package run sudo apt-get install bridge-utils
1486 (assuming Ubuntu is used to run mininet, If not then this is not
1489 - Save the mininet script given below as topo\_handson.py and run the
1490 mininet script in the mininet environment where Mininet is installed.
1495 - `Script for emulating network with multiple
1496 hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet>`__.
1498 - Before executing the mininet script, please confirm Controller is up
1501 - Run the mininet script.
1503 - Replace <path> and <Controller IP> based on your environment
1507 sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
1512 h11 h11-eth0:s1-eth1
1513 h12 h12-eth0:s1-eth2
1514 h21 h21-eth0:s2-eth1
1515 h22 h22-eth0:s2-eth2
1516 h23 h23-eth0:s2-eth3
1517 srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
1518 srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
1519 s1 lo: s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
1520 s2 lo: s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
1521 s3 lo: s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
1522 s4 lo: s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
1530 - Please follow the below steps to configure the network in mininet as
1533 .. figure:: ./images/vtn/Mininet_Configuration.png
1534 :alt: Mininet Configuration
1536 Mininet Configuration
1538 Configure service nodes
1539 '''''''''''''''''''''''
1541 - Please execute the following commands in the mininet console where
1542 mininet script is executed.
1546 mininet> srvc1 ip addr del 10.0.0.6/8 dev srvc1-eth0
1547 mininet> srvc1 brctl addbr br0
1548 mininet> srvc1 brctl addif br0 srvc1-eth0
1549 mininet> srvc1 brctl addif br0 srvc1-eth1
1550 mininet> srvc1 ifconfig br0 up
1551 mininet> srvc1 tc qdisc add dev srvc1-eth1 root netem delay 200ms
1552 mininet> srvc2 ip addr del 10.0.0.7/8 dev srvc2-eth0
1553 mininet> srvc2 brctl addbr br0
1554 mininet> srvc2 brctl addif br0 srvc2-eth0
1555 mininet> srvc2 brctl addif br0 srvc2-eth1
1556 mininet> srvc2 ifconfig br0 up
1557 mininet> srvc2 tc qdisc add dev srvc2-eth1 root netem delay 300ms
1565 - Please execute the below commands to configure the network topology
1566 in the controller as in the below image:
1568 .. figure:: ./images/vtn/Tenant2.png
1573 Please execute the below commands in controller
1574 '''''''''''''''''''''''''''''''''''''''''''''''
1578 The below commands are for the difference in behavior of Manager in
1579 Beryllium topology. The Link below has the details for this bug:
1580 https://bugs.opendaylight.org/show_bug.cgi?id=3818.
1584 curl --user admin:admin -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X PUT http://localhost:8181/restconf/config/vtn-static-topology:vtn-static-topology/static-edge-ports -d '{"static-edge-ports": {"static-edge-port": [ {"port": "openflow:3:3"}, {"port": "openflow:3:4"}, {"port": "openflow:4:3"}, {"port": "openflow:4:4"}]}}'
1586 - Create a virtual tenant named vtn1 by executing `the update-vtn
1587 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#update-vtn>`__.
1591 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1","update-mode":"CREATE","operation":"SET","description":"creating vtn","idle-timeout":300,"hard-timeout":0}}'
1593 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1595 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vbridge.html#update-vbridge>`__.
1599 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"creating vbr","tenant-name":"vtn1","bridge-name":"vbr1"}}'
1601 - Create interface if1 into the virtual bridge vbr1 by executing `the
1603 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
1607 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif1 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
1609 - Configure port mapping on the interface by executing `the
1611 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
1613 - The interface if1 of the virtual bridge will be mapped to the port
1614 "s1-eth2" of the switch "openflow:1" of the Mininet.
1616 - The h12 is connected to the port "s1-eth2".
1620 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","node":"openflow:1","port-name":"s1-eth2"}}'
1622 - Create interface if2 into the virtual bridge vbr1 by executing `the
1624 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
1628 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif2 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
1630 - Configure port mapping on the interface by executing `the
1632 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
1634 - The interface if2 of the virtual bridge will be mapped to the port
1635 "s2-eth2" of the switch "openflow:2" of the Mininet.
1637 - The h22 is connected to the port "s2-eth2".
1641 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2","node":"openflow:2","port-name":"s2-eth2"}}'
1643 - Create interface if3 into the virtual bridge vbr1 by executing `the
1645 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
1649 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif3 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if3"}}'
1651 - Configure port mapping on the interfaces by executing `the
1653 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
1655 - The interface if3 of the virtual bridge will be mapped to the port
1656 "s2-eth3" of the switch "openflow:2" of the Mininet.
1658 - The h23 is connected to the port "s2-eth3".
1662 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if3","node":"openflow:2","port-name":"s2-eth3"}}'
1667 - Create flowcondition named cond\_1 by executing `the
1669 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#set-flow-condition>`__.
1671 - For option source and destination-network, get inet address of
1672 host h12(src) and h22(dst) from mininet.
1676 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"index":1,"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.2/32","destination-network":"10.0.0.4/32"}}]}}'
1678 - Flow filter demonstration with DROP action-type. Create Flowfilter in
1679 VBR Interface if1 by executing `the set-flow-filter
1680 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter>`__.
1684 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","index":10,"vtn-drop-filter":{}}]}}'
1692 - Please execute the below commands to configure the network topology
1693 which sends some specific traffic via a single service(External
1694 device) in the controller as in the below image:
1696 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_LLD.png
1697 :alt: Service Chaining With One Service LLD
1699 Service Chaining With One Service LLD
1701 - Create a virtual terminal named vt\_srvc1\_1 in the tenant vtn1 by
1702 executing `the update-vterminal
1703 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vterminal.html#update-vterminal>`__.
1707 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc1_1","description":"Creating vterminal"}}'
1709 - Create interface IF into the virtual terminal vt\_srvc1\_1 by
1710 executing `the update-vinterface
1711 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
1715 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc1_1","interface-name":"IF"}}'
1717 - Configure port mapping on the interfaces by executing `the
1719 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
1721 - The interface IF of the virtual terminal will be mapped to the
1722 port "s3-eth3" of the switch "openflow:3" of the Mininet.
1724 - The h12 is connected to the port "s3-eth3".
1728 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc1_1","interface-name":"IF","node":"openflow:3","port-name":"s3-eth3"}}'
1730 - Create a virtual terminal named vt\_srvc1\_2 in the tenant vtn1 by
1731 executing `the update-vterminal
1732 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vterminal.html#update-vterminal>`__.
1736 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","description":"Creating vterminal"}}'
1738 - Create interface IF into the virtual terminal vt\_srvc1\_2 by
1739 executing `the update-vinterface
1740 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
1744 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF"}}'
1746 - Configure port mapping on the interfaces by executing `the
1748 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
1750 - The interface IF of the virtual terminal will be mapped to the
1751 port "s4-eth3" of the switch "openflow:4" of the Mininet.
1753 - The h22 is connected to the port "s4-eth3".
1757 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","node":"openflow:4","port-name":"s4-eth3"}}'
1759 - Create flowcondition named cond\_1 by executing `the
1761 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#set-flow-condition>`__.
1763 - For option source and destination-network, get inet address of
1764 host h12(src) and h22(dst) from mininet.
1768 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"index":1,"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.2/32","destination-network":"10.0.0.4/32"}}]}}'
1770 - Create flowcondition named cond\_any by executing `the
1772 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#set-flow-condition>`__.
1776 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_any","vtn-flow-match":[{"index":1}]}}'
1778 - Flow filter demonstration with redirect action-type. Create
1779 Flowfilter in virtual terminal vt\_srvc1\_2 interface IF by executing
1780 `the set-flow-filter
1781 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter>`__.
1783 - Flowfilter redirects vt\_srvc1\_2 to bridge1-IF2
1787 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"bridge-name":"vbr1","interface-name":"if2"},"output":"true"}}]}}'
1789 - Flow filter demonstration with redirect action-type. Create
1790 Flowfilter in vbridge vbr1 interface if1 by executing `the
1792 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter>`__.
1794 - Flow filter redirects Bridge1-IF1 to vt\_srvc1\_1
1798 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","index":10,"vtn-redirect-filter":{"redirect-destination":{"terminal-name":"vt_srvc1_1","interface-name":"IF"},"output":"true"}}]}}'
1803 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_Verification.png
1804 :alt: Service Chaining With One Service
1806 Service Chaining With One Service
1808 - Ping host12 to host22 to view the host rechability, a delay of 200ms
1809 will be taken to reach host22 as below.
1813 mininet> h12 ping h22
1814 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1815 64 bytes from 10.0.0.4: icmp_seq=35 ttl=64 time=209 ms
1816 64 bytes from 10.0.0.4: icmp_seq=36 ttl=64 time=201 ms
1817 64 bytes from 10.0.0.4: icmp_seq=37 ttl=64 time=200 ms
1818 64 bytes from 10.0.0.4: icmp_seq=38 ttl=64 time=200 ms
1823 - Please execute the below commands to configure the network topology
1824 which sends some specific traffic via two services(External device)
1825 in the controller as in the below image.
1827 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services_LLD.png
1828 :alt: Service Chaining With Two Services LLD
1830 Service Chaining With Two Services LLD
1832 - Create a virtual terminal named vt\_srvc2\_1 in the tenant vtn1 by
1833 executing `the update-vterminal
1834 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vterminal.html#update-vterminal>`__.
1838 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc2_1","description":"Creating vterminal"}}'
1840 - Create interface IF into the virtual terminal vt\_srvc2\_1 by
1841 executing `the update-vinterface
1842 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
1846 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc2_1","interface-name":"IF"}}'
1848 - Configure port mapping on the interfaces by executing `the
1850 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
1852 - The interface IF of the virtual terminal will be mapped to the
1853 port "s3-eth4" of the switch "openflow:3" of the Mininet.
1855 - The host h12 is connected to the port "s3-eth4".
1859 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc2_1","interface-name":"IF","node":"openflow:3","port-name":"s3-eth4"}}'
1861 - Create a virtual terminal named vt\_srvc2\_2 in the tenant vtn1 by
1862 executing `the update-vterminal
1863 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vterminal.html#update-vterminal>`__.
1867 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","description":"Creating vterminal"}}'
1869 - Create interfaces IF into the virtual terminal vt\_srvc2\_2 by
1870 executing `the update-vinterface
1871 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
1875 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF"}}'
1877 - Configure port mapping on the interfaces by executing `the
1879 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
1881 - The interface IF of the virtual terminal will be mapped to the
1882 port "s4-eth4" of the switch "openflow:4" of the mininet.
1884 - The host h22 is connected to the port "s4-eth4".
1888 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF","node":"openflow:4","port-name":"s4-eth4"}}'
1890 - Flow filter demonstration with redirect action-type. Create
1891 Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1892 `the set-flow-filter
1893 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter>`__.
1895 - Flow filter redirects vt\_srvc2\_2 to Bridge1-IF2.
1899 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"bridge-name":"vbr1","interface-name":"if2"},"output":"true"}}]}}'
1901 - Flow filter demonstration with redirect action-type. Create
1902 Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1903 `the set-flow-filter
1904 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter>`__.
1906 - Flow filter redirects vt\_srvc1\_2 to vt\_srvc2\_1.
1910 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"terminal-name":"vt_srvc2_1","interface-name":"IF"},"output":"true"}}]}}'
1915 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services.png
1916 :alt: Service Chaining With Two Service
1918 Service Chaining With Two Service
1920 - Ping host12 to host22 to view the host rechability, a delay of 500ms
1921 will be taken to reach host22 as below.
1925 mininet> h12 ping h22
1926 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1927 64 bytes from 10.0.0.4: icmp_seq=1 ttl=64 time=512 ms
1928 64 bytes from 10.0.0.4: icmp_seq=2 ttl=64 time=501 ms
1929 64 bytes from 10.0.0.4: icmp_seq=3 ttl=64 time=500 ms
1930 64 bytes from 10.0.0.4: icmp_seq=4 ttl=64 time=500 ms
1932 - You can verify the configuration by executing the following REST API.
1933 It shows all configuration in VTN Manager.
1937 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1947 "idle-timeout": 300,
1948 "description": "creating vtn"
1954 "age-interval": 600,
1955 "description": "creating vbr"
1964 "vinterface-status": {
1965 "mapped-port": "openflow:1:2",
1967 "entity-state": "UP"
1969 "port-map-config": {
1971 "node": "openflow:1",
1972 "port-name": "s1-eth2"
1974 "vinterface-config": {
1975 "description": "Creating vbrif1 interface",
1978 "vinterface-input-filter": {
1979 "vtn-flow-filter": [
1982 "condition": "cond_1",
1983 "vtn-redirect-filter": {
1985 "redirect-destination": {
1986 "terminal-name": "vt_srvc1_1",
1987 "interface-name": "IF"
1996 "vinterface-status": {
1997 "mapped-port": "openflow:2:2",
1999 "entity-state": "UP"
2001 "port-map-config": {
2003 "node": "openflow:2",
2004 "port-name": "s2-eth2"
2006 "vinterface-config": {
2007 "description": "Creating vbrif2 interface",
2013 "vinterface-status": {
2014 "mapped-port": "openflow:2:3",
2016 "entity-state": "UP"
2018 "port-map-config": {
2020 "node": "openflow:2",
2021 "port-name": "s2-eth3"
2023 "vinterface-config": {
2024 "description": "Creating vbrif3 interface",
2033 "name": "vt_srvc2_2",
2041 "vinterface-status": {
2042 "mapped-port": "openflow:4:4",
2044 "entity-state": "UP"
2046 "port-map-config": {
2048 "node": "openflow:4",
2049 "port-name": "s4-eth4"
2051 "vinterface-config": {
2052 "description": "Creating vterminal IF",
2055 "vinterface-input-filter": {
2056 "vtn-flow-filter": [
2059 "condition": "cond_any",
2060 "vtn-redirect-filter": {
2062 "redirect-destination": {
2063 "bridge-name": "vbr1",
2064 "interface-name": "if2"
2072 "vterminal-config": {
2073 "description": "Creating vterminal"
2077 "name": "vt_srvc1_1",
2085 "vinterface-status": {
2086 "mapped-port": "openflow:3:3",
2088 "entity-state": "UP"
2090 "port-map-config": {
2092 "node": "openflow:3",
2093 "port-name": "s3-eth3"
2095 "vinterface-config": {
2096 "description": "Creating vterminal IF",
2101 "vterminal-config": {
2102 "description": "Creating vterminal"
2106 "name": "vt_srvc1_2",
2114 "vinterface-status": {
2115 "mapped-port": "openflow:4:3",
2117 "entity-state": "UP"
2119 "port-map-config": {
2121 "node": "openflow:4",
2122 "port-name": "s4-eth3"
2124 "vinterface-config": {
2125 "description": "Creating vterminal IF",
2128 "vinterface-input-filter": {
2129 "vtn-flow-filter": [
2132 "condition": "cond_any",
2133 "vtn-redirect-filter": {
2135 "redirect-destination": {
2136 "terminal-name": "vt_srvc2_1",
2137 "interface-name": "IF"
2145 "vterminal-config": {
2146 "description": "Creating vterminal"
2150 "name": "vt_srvc2_1",
2158 "vinterface-status": {
2159 "mapped-port": "openflow:3:4",
2161 "entity-state": "UP"
2163 "port-map-config": {
2165 "node": "openflow:3",
2166 "port-name": "s3-eth4"
2168 "vinterface-config": {
2169 "description": "Creating vterminal IF",
2174 "vterminal-config": {
2175 "description": "Creating vterminal"
2186 - To clean up both VTN and flowconditions.
2188 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
2189 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#remove-vtn>`__.
2193 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2195 - You can delete the flowcondition cond\_1 and cond\_any by executing
2196 `the remove-flow-condition
2197 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#remove-flow-condition>`__.
2201 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
2205 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_any"}}'
2207 How To View Dataflows
2208 ~~~~~~~~~~~~~~~~~~~~~
2213 This page explains how to view Dataflows using VTN Manager. This page
2214 targets Beryllium release, so the procedure described here does not work
2217 Dataflow feature enables retrieval and display of data flows in the
2218 openflow network. The data flows can be retrieved based on an openflow
2219 switch or a switch port or a L2 source host.
2221 The flow information provided by this feature are
2223 - Location of virtual node which maps the incoming packet and outgoing
2226 - Location of physical switch port where incoming and outgoing packets
2227 is sent and received.
2229 - A sequence of physical route info which represents the packet route
2230 in the physical network.
2235 - To view Dataflow information, configure with VLAN Mapping
2236 https://wiki.opendaylight.org/view/VTN:Mananger:How_to_test_Vlan-map_using_mininet.
2241 After creating vlan mapping configuration from the above page, execute
2242 as below in mininet to get switch details.
2247 h1 h1-eth0.200:s1-eth1
2248 h2 h2-eth0.300:s2-eth2
2249 h3 h3-eth0.200:s2-eth3
2250 h4 h4-eth0.300:s2-eth4
2251 h5 h5-eth0.200:s3-eth2
2252 h6 h6-eth0.300:s3-eth3
2253 s1 lo: s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
2254 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
2255 s3 lo: s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
2259 Please execute ping from h1 to h3 to check hosts reachability.
2264 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2265 64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=11.4 ms
2266 64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.654 ms
2267 64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.093 ms
2269 Parallely execute below Restconf command to get data flow information of
2270 node "openflow:1" and its port "s1-eth1".
2272 - Get the Dataflows information by executing `the get-data-flow
2273 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow.html#get-data-flow>`__.
2277 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow:get-data-flow -d '{"input":{"tenant-name":"vtn1","mode":"DETAIL","node":"openflow:1","data-flow-port":{"port-id":"1","port-name":"s1-eth1"}}}'
2285 "averaged-data-flow-stats": {
2286 "packet-count": 1.1998800119988002,
2287 "start-time": 1455241209151,
2288 "end-time": 1455241219152,
2289 "byte-count": 117.58824117588242
2293 "physical-ingress-port": {
2294 "port-name": "s2-eth3",
2297 "physical-egress-port": {
2298 "port-name": "s2-eth1",
2301 "node": "openflow:2",
2305 "physical-ingress-port": {
2306 "port-name": "s1-eth2",
2309 "physical-egress-port": {
2310 "port-name": "s1-eth1",
2313 "node": "openflow:1",
2317 "data-egress-node": {
2318 "bridge-name": "vbr1",
2319 "tenant-name": "vtn1"
2322 "idle-timeout": 300,
2323 "data-flow-stats": {
2325 "nanosecond": 640000000,
2328 "packet-count": 134,
2331 "data-egress-port": {
2332 "node": "openflow:1",
2333 "port-name": "s1-eth1",
2336 "data-ingress-node": {
2337 "bridge-name": "vbr1",
2338 "tenant-name": "vtn1"
2340 "data-ingress-port": {
2341 "node": "openflow:2",
2342 "port-name": "s2-eth3",
2345 "creation-time": 1455240855753,
2346 "data-flow-match": {
2347 "vtn-ether-match": {
2349 "source-address": "6a:ff:e2:81:86:bb",
2350 "destination-address": "26:9f:82:70:ec:66"
2355 "reason": "VLANMAPPED",
2356 "virtual-node-path": {
2357 "bridge-name": "vbr1",
2358 "tenant-name": "vtn1"
2363 "reason": "FORWARDED",
2364 "virtual-node-path": {
2365 "bridge-name": "vbr1",
2366 "tenant-name": "vtn1"
2374 "averaged-data-flow-stats": {
2375 "packet-count": 1.1998800119988002,
2376 "start-time": 1455241209151,
2377 "end-time": 1455241219152,
2378 "byte-count": 117.58824117588242
2382 "physical-ingress-port": {
2383 "port-name": "s1-eth1",
2386 "physical-egress-port": {
2387 "port-name": "s1-eth2",
2390 "node": "openflow:1",
2394 "physical-ingress-port": {
2395 "port-name": "s2-eth1",
2398 "physical-egress-port": {
2399 "port-name": "s2-eth3",
2402 "node": "openflow:2",
2406 "data-egress-node": {
2407 "bridge-name": "vbr1",
2408 "tenant-name": "vtn1"
2411 "idle-timeout": 300,
2412 "data-flow-stats": {
2414 "nanosecond": 587000000,
2417 "packet-count": 134,
2420 "data-egress-port": {
2421 "node": "openflow:2",
2422 "port-name": "s2-eth3",
2425 "data-ingress-node": {
2426 "bridge-name": "vbr1",
2427 "tenant-name": "vtn1"
2429 "data-ingress-port": {
2430 "node": "openflow:1",
2431 "port-name": "s1-eth1",
2434 "creation-time": 1455240855747,
2435 "data-flow-match": {
2436 "vtn-ether-match": {
2438 "source-address": "26:9f:82:70:ec:66",
2439 "destination-address": "6a:ff:e2:81:86:bb"
2444 "reason": "VLANMAPPED",
2445 "virtual-node-path": {
2446 "bridge-name": "vbr1",
2447 "tenant-name": "vtn1"
2452 "reason": "FORWARDED",
2453 "virtual-node-path": {
2454 "bridge-name": "vbr1",
2455 "tenant-name": "vtn1"
2466 How To Create Mac Map In VTN
2467 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2472 - This page demonstrates Mac Mapping. This demonstration aims at
2473 enabling communication between two hosts and denying communication of
2474 particular host by associating a Vbridge to the hosts and configuring
2475 Mac Mapping (mac address) to the Vbridge.
2477 - This page targets Beryllium release, so the procedure described here
2478 does not work in other releases.
2480 .. figure:: ./images/vtn/Single_Controller_Mapping.png
2481 :alt: Single Controller Mapping
2483 Single Controller Mapping
2488 Configure mininet and create a topology
2489 '''''''''''''''''''''''''''''''''''''''
2491 - `Script for emulating network with multiple
2492 hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_Multiple_Hosts_for_Service_Function_Chain>`__.
2494 - Before executing the mininet script, please confirm Controller is up
2497 - Run the mininet script.
2499 - Replace <path> and <Controller IP> based on your environment.
2503 sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
2508 h11 h11-eth0:s1-eth1
2509 h12 h12-eth0:s1-eth2
2510 h21 h21-eth0:s2-eth1
2511 h22 h22-eth0:s2-eth2
2512 h23 h23-eth0:s2-eth3
2513 srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
2514 srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
2515 s1 lo: s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
2516 s2 lo: s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
2517 s3 lo: s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
2518 s4 lo: s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
2523 To create Mac Map in VTN, execute REST API provided by VTN Manager as
2524 follows. It uses curl command to call REST API.
2526 - Create a virtual tenant named Tenant1 by executing `the update-vtn
2527 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#update-vtn>`__.
2531 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2533 - Create a virtual bridge named vBridge1 in the tenant Tenant1 by
2534 executing `the update-vbridge
2535 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vbridge.html#update-vbridge>`__.
2539 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"Tenant1","bridge-name":"vBridge1"}}'
2541 - Configuring Mac Mappings on the vBridge1 by giving the mac address of
2542 host h12 and host h22 as follows to allow the communication by
2543 executing `the set-mac-map
2544 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-mac-map.html#set-mac-map>`__.
2548 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-mac-map:set-mac-map -d '{"input":{"operation":"SET","allowed-hosts":["de:05:40:c4:96:76@0","62:c5:33:bc:d7:4e@0"],"tenant-name":"Tenant1","bridge-name":"vBridge1"}}'
2552 Mac Address of host h12 and host h22 can be obtained with the
2553 following command in mininet.
2557 mininet> h12 ifconfig
2558 h12-eth0 Link encap:Ethernet HWaddr 62:c5:33:bc:d7:4e
2559 inet addr:10.0.0.2 Bcast:10.255.255.255 Mask:255.0.0.0
2560 inet6 addr: fe80::60c5:33ff:febc:d74e/64 Scope:Link
2564 mininet> h22 ifconfig
2565 h22-eth0 Link encap:Ethernet HWaddr de:05:40:c4:96:76
2566 inet addr:10.0.0.4 Bcast:10.255.255.255 Mask:255.0.0.0
2567 inet6 addr: fe80::dc05:40ff:fec4:9676/64 Scope:Link
2569 - MAC Mapping will not be activated just by configuring it, a two end
2570 communication needs to be established to activate Mac Mapping.
2572 - Ping host h22 from host h12 in mininet, the ping will not happen
2573 between the hosts as only one way activation is enabled.
2577 mininet> h12 ping h22
2578 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2579 From 10.0.0.2 icmp_seq=1 Destination Host Unreachable
2580 From 10.0.0.2 icmp_seq=2 Destination Host Unreachable
2582 - Ping host h12 from host h22 in mininet, now the ping communication
2583 will take place as the two end communication is enabled.
2587 mininet> h22 ping h12
2588 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
2589 64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=91.8 ms
2590 64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.510 ms
2592 - After two end communication enabled, now host h12 can ping host h22
2596 mininet> h12 ping h22
2597 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2598 64 bytes from 10.0.0.4: icmp_req=1 ttl=64 time=0.780 ms
2599 64 bytes from 10.0.0.4: icmp_req=2 ttl=64 time=0.079 ms
2604 - To view the configured Mac Map of allowed host execute the following
2609 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/Tenant1/vbridge/vBridge1/mac-map
2618 "mac-address": "c6:44:22:ba:3e:72",
2620 "port-id": "openflow:1:2"
2623 "mac-address": "f6:e0:43:b6:3a:b7",
2625 "port-id": "openflow:2:2"
2631 "vlan-host-desc-list": [
2633 "host": "c6:44:22:ba:3e:72@0"
2636 "host": "f6:e0:43:b6:3a:b7@0"
2646 When Deny is configured a broadcast message is sent to all the hosts
2647 connected to the vBridge, so a two end communication need not be
2648 establihed like allow, the hosts can communicate directly without
2649 any two way communication enabled.
2651 1. To Deny host h23 communication from hosts connected on vBridge1, the
2652 following configuration can be applied.
2656 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-mac-map:set-mac-map -d '{"input":{"operation": "SET", "denied-hosts": ["0a:d3:ea:3d:8f:a5@0"],"tenant-name": "Tenant1","bridge-name": "vBridge1"}}'
2661 - You can delete the virtual tenant Tenant1 by executing `the
2663 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#remove-vtn>`__.
2667 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2669 How To Configure Flowfilters
2670 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2675 - This page explains how to provision flowfilter using VTN Manager.
2676 This page targets Beryllium release, so the procedure described here
2677 does not work in other releases.
2679 - The flow-filter function discards, permits, or redirects packets of
2680 the traffic within a VTN, according to specified flow conditions. The
2681 table below lists the actions to be applied when a packet matches the
2684 +-----------------------+----------------------------------------------------+
2685 | Action | Function |
2686 +=======================+====================================================+
2687 | Pass | | Permits the packet to pass along the determined |
2689 | | | As options, packet transfer priority (set |
2690 | | priority) and DSCP change (set ip-dscp) is |
2692 +-----------------------+----------------------------------------------------+
2693 | Drop | Discards the packet. |
2694 +-----------------------+----------------------------------------------------+
2695 | Redirect | | Redirects the packet to a desired virtual |
2697 | | | As an option, it is possible to change the MAC |
2698 | | address when the packet is transferred. |
2699 +-----------------------+----------------------------------------------------+
2701 .. figure:: ./images/vtn/flow_filter_example.png
2702 :alt: Flow Filter Example
2706 - Following steps explain flow-filter function:
2708 - when a packet is transferred to an interface within a virtual
2709 network, the flow-filter function evaluates whether the
2710 transferred packet matches the condition specifed in the
2713 - If the packet matches the condition, the flow-filter applies the
2714 flow-list matching action specified in the flow-filter.
2719 To apply the packet filter, configure the following:
2721 - Create a flow condition.
2723 - Specify where to apply the flow-filter, for example VTN, vBridge, or
2724 interface of vBridge.
2726 To provision OpenFlow switches, this page uses Mininet. Mininet details
2727 and set-up can be referred at the below page:
2728 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
2730 Start Mininet, and create three switches (s1, s2, and s3) and four hosts
2731 (h1, h2, h3 and h4) in it.
2735 sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
2739 Replace "192.168.0.100" with the IP address of OpenDaylight
2740 controller based on your environment.
2742 You can check the topology that you have created by executing "net"
2743 command in the Mininet console.
2752 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3
2753 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
2754 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
2756 In this guide, you will provision flowfilters to establish communication
2762 To provision the virtual L2 network for the two hosts (h1 and h3),
2763 execute REST API provided by VTN Manager as follows. It uses curl
2764 command to call the REST API.
2766 - Create a virtual tenant named vtn1 by executing `the update-vtn
2767 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#update-vtn>`__.
2771 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2773 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
2775 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vbridge.html#update-vbridge>`__.
2779 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
2781 - Create two interfaces into the virtual bridge by executing `the
2783 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
2787 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
2791 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
2793 - Configure two mappings on the interfaces by executing `the
2795 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
2797 - The interface if1 of the virtual bridge will be mapped to the port
2798 "s2-eth1" of the switch "openflow:2" of the Mininet.
2800 - The h1 is connected to the port "s2-eth1".
2802 - The interface if2 of the virtual bridge will be mapped to the port
2803 "s3-eth1" of the switch "openflow:3" of the Mininet.
2805 - The h3 is connected to the port "s3-eth1".
2809 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:2", "port-name":"s2-eth1"}}'
2813 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth1"}}'
2815 - Create flowcondition named cond\_1 by executing `the
2817 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#set-flow-condition>`__.
2819 - For option source and destination-network, get inet address of
2820 host h1 and h3 from mininet.
2824 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.3/32"},"index":"1"}]}}'
2826 - Flowfilter can be applied either in VTN, VBR or VBR Interfaces. Here
2827 in this page we provision flowfilter with VBR Interface and
2828 demonstrate with action type drop and then pass.
2830 - Flow filter demonstration with DROP action-type. Create Flowfilter in
2831 VBR Interface if1 by executing `the set-flow-filter
2832 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter>`__.
2836 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input": {"tenant-name": "vtn1", "bridge-name": "vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","vtn-drop-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]}}'
2838 Verification of the drop filter
2839 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2841 - Please execute ping from h1 to h3. As we have applied the action type
2842 "drop" , ping should fail with no packet flows between hosts h1 and
2849 Configuration for pass filter
2850 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2852 - Update the flow filter to pass the packets by executing `the
2854 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter>`__.
2858 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input": {"tenant-name": "vtn1", "bridge-name": "vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]}}'
2860 Verification For Packets Success
2861 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2863 - As we have applied action type PASS now ping should happen between
2869 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2870 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
2871 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
2872 64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
2874 - You can also verify the configurations by executing the following
2875 REST API. It shows all configuration in VTN Manager.
2879 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/vtn1
2889 "idle-timeout": 300,
2890 "description": "creating vtn"
2896 "age-interval": 600,
2897 "description": "creating vBridge1"
2906 "vinterface-status": {
2907 "mapped-port": "openflow:2:1",
2909 "entity-state": "UP"
2911 "port-map-config": {
2913 "node": "openflow:2",
2914 "port-name": "s2-eth1"
2916 "vinterface-config": {
2917 "description": "Creating if1 interface",
2920 "vinterface-input-filter": {
2921 "vtn-flow-filter": [
2924 "condition": "cond_1",
2925 "vtn-flow-action": [
2928 "vtn-set-inet-src-action": {
2929 "ipv4-address": "10.0.0.1/32"
2934 "vtn-set-inet-dst-action": {
2935 "ipv4-address": "10.0.0.3/32"
2939 "vtn-pass-filter": {}
2943 "condition": "cond_1",
2944 "vtn-drop-filter": {}
2951 "vinterface-status": {
2952 "mapped-port": "openflow:3:1",
2954 "entity-state": "UP"
2956 "port-map-config": {
2958 "node": "openflow:3",
2959 "port-name": "s3-eth1"
2961 "vinterface-config": {
2962 "description": "Creating if2 interface",
2976 - To clean up both VTN and flowcondition.
2978 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
2979 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#remove-vtn>`__.
2983 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2985 - You can delete the flowcondition cond\_1 by executing `the
2986 remove-flow-condition
2987 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#remove-flow-condition>`__.
2991 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
2993 How to use VTN to change the path of the packet flow
2994 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2999 - This page explains how to create specific VTN Pathmap using VTN
3000 Manager. This page targets Beryllium release, so the procedure
3001 described here does not work in other releases.
3003 .. figure:: ./images/vtn/Pathmap.png
3011 - Save the mininet script given below as pathmap\_test.py and run the
3012 mininet script in the mininet environment where Mininet is installed.
3014 - Create topology using the below mininet script:
3018 from mininet.topo import Topo
3019 class MyTopo( Topo ):
3020 "Simple topology example."
3021 def __init__( self ):
3022 "Create custom topo."
3023 # Initialize topology
3024 Topo.__init__( self )
3025 # Add hosts and switches
3026 leftHost = self.addHost( 'h1' )
3027 rightHost = self.addHost( 'h2' )
3028 leftSwitch = self.addSwitch( 's1' )
3029 middleSwitch = self.addSwitch( 's2' )
3030 middleSwitch2 = self.addSwitch( 's4' )
3031 rightSwitch = self.addSwitch( 's3' )
3033 self.addLink( leftHost, leftSwitch )
3034 self.addLink( leftSwitch, middleSwitch )
3035 self.addLink( leftSwitch, middleSwitch2 )
3036 self.addLink( middleSwitch, rightSwitch )
3037 self.addLink( middleSwitch2, rightSwitch )
3038 self.addLink( rightSwitch, rightHost )
3039 topos = { 'mytopo': ( lambda: MyTopo() ) }
3041 - After creating new file with the above script start the mininet as
3046 sudo mn --controller=remote,ip=10.106.138.124 --custom pathmap_test.py --topo mytopo
3050 Replace "10.106.138.124" with the IP address of OpenDaylight
3051 controller based on your environment.
3058 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
3059 s2 lo: s2-eth1:s1-eth2 s2-eth2:s3-eth1
3060 s3 lo: s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
3061 s4 lo: s4-eth1:s1-eth3 s4-eth2:s3-eth2
3064 - Generate traffic by pinging between host h1 and host h2 before
3065 creating the portmaps respectively.
3070 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3071 From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
3072 From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
3073 From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
3074 From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
3079 - To change the path of the packet flow, execute REST API provided by
3080 VTN Manager as follows. It uses curl command to call the REST API.
3082 - Create a virtual tenant named vtn1 by executing `the update-vtn
3083 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#update-vtn>`__.
3087 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3089 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
3091 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vbridge.html#update-vbridge>`__.
3095 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
3097 - Create two interfaces into the virtual bridge by executing `the
3099 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface>`__.
3103 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
3107 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
3109 - Configure two mappings on the interfaces by executing `the
3111 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map>`__.
3113 - The interface if1 of the virtual bridge will be mapped to the port
3114 "s2-eth1" of the switch "openflow:1" of the Mininet.
3116 - The h1 is connected to the port "s1-eth1".
3118 - The interface if2 of the virtual bridge will be mapped to the port
3119 "s3-eth1" of the switch "openflow:3" of the Mininet.
3121 - The h3 is connected to the port "s3-eth3".
3125 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:1", "port-name":"s1-eth1"}}'
3129 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth3"}}'
3131 - Genarate traffic by pinging between host h1 and host h2 after
3132 creating the portmaps respectively.
3137 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3138 64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.861 ms
3139 64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.101 ms
3140 64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.101 ms
3142 - Get the Dataflows information by executing `the get-data-flow
3143 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow.html#get-data-flow>`__.
3147 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow:get-data-flow -d '{"input":{"tenant-name":"vtn1","mode":"DETAIL","node":"openflow:1","data-flow-port":{"port-id":1,"port-name":"s1-eth1"}}}'
3149 - Create flowcondition named cond\_1 by executing `the
3151 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#set-flow-condition>`__.
3153 - For option source and destination-network, get inet address of
3154 host h1 or host h2 from mininet
3158 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.2/32"},"index":"1"}]}}'
3160 - Create pathmap with flowcondition cond\_1 by executing `the
3162 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-path-map.html#set-path-map>`__.
3166 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-map:set-path-map -d '{"input":{"tenant-name":"vtn1","path-map-list":[{"condition":"cond_1","policy":"1","index": "1","idle-timeout":"300","hard-timeout":"0"}]}}'
3168 - Create pathpolicy by executing `the set-path-policy
3169 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-path-policy.html#set-path-policy>`__.
3173 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-policy:set-path-policy -d '{"input":{"operation":"SET","id": "1","default-cost": "10000","vtn-path-cost": [{"port-desc":"openflow:1,3,s1-eth3","cost":"1000"},{"port-desc":"openflow:4,2,s4-eth2","cost":"1000"},{"port-desc":"openflow:3,3,s3-eth3","cost":"100000"}]}}'
3178 - Before applying Path policy get node information by executing get
3187 "physical-ingress-port": {
3188 "port-name": "s3-eth3",
3191 "physical-egress-port": {
3192 "port-name": "s3-eth1",
3195 "node": "openflow:3",
3199 "physical-ingress-port": {
3200 "port-name": "s2-eth2",
3203 "physical-egress-port": {
3204 "port-name": "s2-eth1",
3207 "node": "openflow:2",
3211 "physical-ingress-port": {
3212 "port-name": "s1-eth2",
3215 "physical-egress-port": {
3216 "port-name": "s1-eth1",
3219 "node": "openflow:1",
3223 "data-egress-node": {
3224 "interface-name": "if1",
3225 "bridge-name": "vbr1",
3226 "tenant-name": "vtn1"
3228 "data-egress-port": {
3229 "node": "openflow:1",
3230 "port-name": "s1-eth1",
3233 "data-ingress-node": {
3234 "interface-name": "if2",
3235 "bridge-name": "vbr1",
3236 "tenant-name": "vtn1"
3238 "data-ingress-port": {
3239 "node": "openflow:3",
3240 "port-name": "s3-eth3",
3247 - After applying Path policy get node information by executing get
3256 "physical-ingress-port": {
3257 "port-name": "s1-eth1",
3260 "physical-egress-port": {
3261 "port-name": "s1-eth3",
3264 "node": "openflow:1",
3268 "physical-ingress-port": {
3269 "port-name": "s4-eth1",
3272 "physical-egress-port": {
3273 "port-name": "s4-eth2",
3276 "node": "openflow:4",
3280 "physical-ingress-port": {
3281 "port-name": "s3-eth2",
3284 "physical-egress-port": {
3285 "port-name": "s3-eth3",
3288 "node": "openflow:3",
3292 "data-egress-node": {
3293 "interface-name": "if2",
3294 "bridge-name": "vbr1",
3295 "tenant-name": "vtn1"
3297 "data-egress-port": {
3298 "node": "openflow:3",
3299 "port-name": "s3-eth3",
3302 "data-ingress-node": {
3303 "interface-name": "if1",
3304 "bridge-name": "vbr1",
3305 "tenant-name": "vtn1"
3307 "data-ingress-port": {
3308 "node": "openflow:1",
3309 "port-name": "s1-eth1",
3317 - To clean up both VTN and flowcondition.
3319 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
3320 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#remove-vtn>`__.
3324 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3326 - You can delete the flowcondition cond\_1 by executing `the
3327 remove-flow-condition
3328 RPC <https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#remove-flow-condition>`__.
3332 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
3334 VTN Coordinator Usage Examples
3335 ------------------------------
3337 How to configure L2 Network with Single Controller
3338 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3343 This example provides the procedure to demonstrate configuration of VTN
3344 Coordinator with L2 network using VTN Virtualization(single controller).
3345 Here is the Example for vBridge Interface Mapping with Single Controller
3346 using mininet. mininet details and set-up can be referred at below URL:
3347 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
3349 .. figure:: ./images/vtn/vtn-single-controller-topology-example.png
3350 :alt: EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3352 EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3357 - Configure mininet and create a topology:
3361 mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3367 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1
3368 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0
3375 - Create a Controller named controllerone and mention its ip-address in
3376 the below create-controller command.
3380 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.0.0.2", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3382 - Create a VTN named vtn1 by executing the create-vtn command
3386 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3388 - Create a vBridge named vBridge1 in the vtn1 by executing the
3393 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3395 - Create two Interfaces named if1 and if2 into the vBridge1
3399 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3403 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3405 - Get the list of logical ports configured
3409 Curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/controllerone/domains/\(DEFAULT\)/logical_ports.json
3411 - Configure two mappings on each of the interfaces by executing the
3414 The interface if1 of the virtual bridge will be mapped to the port
3415 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3416 to the port "s2-eth1".
3418 The interface if2 of the virtual bridge will be mapped to the port
3419 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3420 to the port "s3-eth1".
3424 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
3425 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
3430 Please verify whether the Host1 and Host3 are pinging.
3432 - Send packets from Host1 to Host3
3437 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
3438 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.780 ms
3439 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.079 ms
3441 How to configure L2 Network with Multiple Controllers
3442 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3444 - This example provides the procedure to demonstrate configuration of
3445 VTN Coordinator with L2 network using VTN Virtualization Here is the
3446 Example for vBridge Interface Mapping with Multi-controller using
3449 .. figure:: ./images/vtn/MutiController_Example_diagram.png
3450 :alt: EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3452 EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3457 - Configure multiple controllers using the mininet script given below:
3458 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:Scripts:Mininet#Network_with_multiple_switches_and_OpenFlow_controllers
3463 - Create a VTN named vtn3 by executing the create-vtn command
3467 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn3"}}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3469 - Create two Controllers named odc1 and odc2 with its ip-address in the
3470 below create-controller command.
3474 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "odc1", "ipaddr":"10.100.9.52", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3478 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "odc2", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3480 - Create two vBridges in the VTN like, vBridge1 in Controller1 and
3481 vBridge2 in Controller2
3485 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr1","controller_id":"odc1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges.json
3489 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr2","controller_id":"odc2","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges.json
3491 - Create two Interfaces if1, if2 for the two vBridges vbr1 and vbr2.
3495 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
3499 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
3503 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
3507 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
3509 - Get the list of logical ports configured
3513 curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/odc1/domains/\(DEFAULT\)/logical_ports/detail.json
3515 - Create boundary and vLink for the two controllers
3519 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"boundary": {"boundary_id": "b1", "link": {"controller1_id": "odc1", "domain1_id": "(DEFAULT)", "logical_port1_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth3", "controller2_id": "odc2", "domain2_id": "(DEFAULT)", "logical_port2_id": "PP-OF:00:00:00:00:00:00:00:04-s4-eth3"}}}' http://127.0.0.1:8083/vtn-webapi/boundaries.json
3523 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vlink": {"vlk_name": "vlink1" , "vnode1_name": "vbr1", "if1_name":"if2", "vnode2_name": "vbr2", "if2_name": "if2", "boundary_map": {"boundary_id":"b1","vlan_id": "50"}}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vlinks.json
3525 - Configure two mappings on each of the interfaces by executing the
3528 The interface if1 of the vbr1 will be mapped to the port "s2-eth2" of
3529 the switch "openflow:2" of the Mininet. The h2 is connected to the port
3532 The interface if2 of the vbr2 will be mapped to the port "s5-eth2" of
3533 the switch "openflow:5" of the Mininet. The h6 is connected to the port
3538 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces/if1/portmap.json
3542 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:05-s5-eth2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces/if1/portmap.json
3547 Please verify whether Host h2 and Host h6 are pinging.
3549 - Send packets from h2 to h6
3557 PING 10.0.0.6 (10.0.0.3) 56(84) bytes of data.
3558 64 bytes from 10.0.0.6: icmp_req=1 ttl=64 time=0.780 ms
3559 64 bytes from 10.0.0.6: icmp_req=2 ttl=64 time=0.079 ms
3561 How To Test Vlan-Map In Mininet Environment
3562 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3567 This example explains how to test vlan-map in a multi host scenario.
3569 .. figure:: ./images/vtn/vlanmap_using_mininet.png
3570 :alt: Example that demonstrates vlanmap testing in Mininet
3573 Example that demonstrates vlanmap testing in Mininet Environment
3578 - Save the mininet script given below as vlan\_vtn\_test.py and run the
3579 mininet script in the mininet environment where Mininet is installed.
3584 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
3586 - Run the mininet script
3590 sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
3595 Please follow the below steps to test a vlan map using mininet:
3597 - Create a Controller named controllerone and mention its ip-address in
3598 the below create-controller command.
3602 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 - Create a VTN named vtn1 by executing the create-vtn command
3608 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 - Create a vBridge named vBridge1 in the vtn1 by executing the
3615 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 - Create a vlan map with vlanid 200 for vBridge vBridge1
3621 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 - Create a vBridge named vBridge2 in the vtn1 by executing the
3628 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 - Create a vlan map with vlanid 300 for vBridge vBridge2
3634 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
3639 Ping all in mininet environment to view the host reachability.
3644 Ping: testing ping reachability
3652 How To View Specific VTN Station Information.
3653 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3655 This example demonstrates on how to view a specific VTN Station
3658 .. figure:: ./images/vtn/vtn_stations.png
3659 :alt: EXAMPLE DEMONSTRATING VTN STATIONS
3661 EXAMPLE DEMONSTRATING VTN STATIONS
3666 - Configure mininet and create a topology:
3670 $ sudo mn --custom /home/mininet/mininet/custom/topo-2sw-2host.py --controller=remote,ip=10.100.9.61 --topo mytopo
3673 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1
3674 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0
3678 - Generate traffic by pinging between hosts h1 and h2 after configuring
3679 the portmaps respectively
3684 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3685 64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=16.7 ms
3686 64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=13.2 ms
3691 - Create a Controller named controllerone and mention its ip-address in
3692 the below create-controller command
3696 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 - Create a VTN named vtn1 by executing the create-vtn command
3702 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 - Create a vBridge named vBridge1 in the vtn1 by executing the
3709 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 - Create two Interfaces named if1 and if2 into the vBridge1
3715 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
3716 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 - Configure two mappings on each of the interfaces by executing the
3721 The interface if1 of the virtual bridge will be mapped to the port
3722 "s1-eth1" of the switch "openflow:1" of the Mininet. The h1 is connected
3723 to the port "s1-eth1".
3725 The interface if2 of the virtual bridge will be mapped to the port
3726 "s1-eth2" of the switch "openflow:1" of the Mininet. The h2 is connected
3727 to the port "s1-eth2".
3731 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
3732 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 - Get the VTN stations information
3738 curl -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
3745 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"
3749 "domain_id": "(DEFAULT)",
3754 "macaddr": "b2c3.06b8.2dac",
3755 "no_vlan_id": "true",
3756 "port_name": "s2-eth2",
3757 "station_id": "178195618445172",
3758 "switch_id": "00:00:00:00:00:00:00:02",
3759 "vnode_name": "vBridge1",
3760 "vnode_type": "vbridge",
3764 "domain_id": "(DEFAULT)",
3769 "macaddr": "ce82.1b08.90cf",
3770 "no_vlan_id": "true",
3771 "port_name": "s1-eth1",
3772 "station_id": "206130278144207",
3773 "switch_id": "00:00:00:00:00:00:00:01",
3774 "vnode_name": "vBridge1",
3775 "vnode_type": "vbridge",
3781 How To View Dataflows in VTN
3782 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3784 This example demonstrates on how to view a specific VTN Dataflow
3790 The same Configuration as Vlan Mapping
3791 Example(\ https://wiki.opendaylight.org/view/VTN:Coordinator:Beryllium:HowTos:How_To_test_vlanmap_using_mininet)
3796 Get the VTN Dataflows information
3800 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"
3807 "controller_dataflows": [
3809 "controller_id": "controllerone",
3810 "controller_type": "odc",
3811 "egress_domain_id": "(DEFAULT)",
3812 "egress_port_name": "s3-eth3",
3813 "egress_station_id": "3",
3814 "egress_switch_id": "00:00:00:00:00:00:00:03",
3816 "ingress_domain_id": "(DEFAULT)",
3817 "ingress_port_name": "s2-eth2",
3818 "ingress_station_id": "2",
3819 "ingress_switch_id": "00:00:00:00:00:00:00:02",
3833 "in_port_name": "s2-eth2",
3834 "out_port_name": "s2-eth1",
3835 "switch_id": "00:00:00:00:00:00:00:02"
3838 "in_port_name": "s1-eth2",
3839 "out_port_name": "s1-eth3",
3840 "switch_id": "00:00:00:00:00:00:00:01"
3843 "in_port_name": "s3-eth1",
3844 "out_port_name": "s3-eth3",
3845 "switch_id": "00:00:00:00:00:00:00:03"
3855 How To Configure Flow Filters Using VTN
3856 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3861 The flow-filter function discards, permits, or redirects packets of the
3862 traffic within a VTN, according to specified flow conditions The table
3863 below lists the actions to be applied when a packet matches the
3866 +--------------------------------------+--------------------------------------+
3867 | Action | Function |
3868 +--------------------------------------+--------------------------------------+
3869 | Pass | Permits the packet to pass. As |
3870 | | options, packet transfer priority |
3871 | | (set priority) and DSCP change (se t |
3872 | | ip-dscp) is specified. |
3873 +--------------------------------------+--------------------------------------+
3874 | Drop | Discards the packet. |
3875 +--------------------------------------+--------------------------------------+
3876 | Redirect | Redirects the packet to a desired |
3877 | | virtual interface. As an option, it |
3878 | | is possible to change the MAC |
3879 | | address when the packet is |
3881 +--------------------------------------+--------------------------------------+
3883 .. figure:: ./images/vtn/flow_filter_example.png
3888 Following steps explain flow-filter function:
3890 - When a packet is transferred to an interface within a virtual
3891 network, the flow-filter function evaluates whether the transferred
3892 packet matches the condition specified in the flow-list.
3894 - If the packet matches the condition, the flow-filter applies the
3895 flow-list matching action specified in the flow-filter.
3900 To apply the packet filter, configure the following:
3902 - Create a flow-list and flow-listentry.
3904 - Specify where to apply the flow-filter, for example VTN, vBridge, or
3905 interface of vBridge.
3907 Configure mininet and create a topology:
3911 $ mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree
3913 Please generate the following topology
3917 $ mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3920 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3
3921 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
3922 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
3931 - Create a Controller named controller1 and mention its ip-address in
3932 the below create-controller command.
3936 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 - Create a VTN named vtn\_one by executing the create-vtn command
3942 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 - Create a vBridge named vbr\_two in the vtn1 by executing the
3949 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
3950 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" :
3951 {"vbr_name":"vbr_two","controller_id":"controller1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges.json
3953 - Create two Interfaces named if1 and if2 into the vbr\_two
3957 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
3958 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 - Get the list of logical ports configured
3964 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 - Configure two mappings on each of the interfaces by executing the
3969 The interface if1 of the virtual bridge will be mapped to the port
3970 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3971 to the port "s2-eth1".
3973 The interface if2 of the virtual bridge will be mapped to the port
3974 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3975 to the port "s3-eth1".
3979 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
3980 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
3986 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 - Create Flowlistentry
3992 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 - Create vBridge Interface Flowfilter
3998 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 Flow filter demonstration with DROP action-type
4001 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4005 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
4010 As we have applied the action type "drop" , ping should fail.
4015 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4016 From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
4017 From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
4019 Flow filter demonstration with PASS action-type
4020 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4024 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
4032 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
4033 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
4034 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
4035 64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
4037 How To Use VTN To Make Packets Take Different Paths
4038 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4040 This example demonstrates on how to create a specific VTN Path Map
4043 .. figure:: ./images/vtn/Pathmap.png
4051 - Save the mininet script given below as pathmap\_test.py and run the
4052 mininet script in the mininet environment where Mininet is installed.
4054 - Create topology using the below mininet script:
4058 from mininet.topo import Topo
4059 class MyTopo( Topo ):
4060 "Simple topology example."
4061 def __init__( self ):
4062 "Create custom topo."
4063 # Initialize topology
4064 Topo.__init__( self )
4065 # Add hosts and switches
4066 leftHost = self.addHost( 'h1' )
4067 rightHost = self.addHost( 'h2' )
4068 leftSwitch = self.addSwitch( 's1' )
4069 middleSwitch = self.addSwitch( 's2' )
4070 middleSwitch2 = self.addSwitch( 's4' )
4071 rightSwitch = self.addSwitch( 's3' )
4073 self.addLink( leftHost, leftSwitch )
4074 self.addLink( leftSwitch, middleSwitch )
4075 self.addLink( leftSwitch, middleSwitch2 )
4076 self.addLink( middleSwitch, rightSwitch )
4077 self.addLink( middleSwitch2, rightSwitch )
4078 self.addLink( rightSwitch, rightHost )
4079 topos = { 'mytopo': ( lambda: MyTopo() ) }
4085 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
4086 s2 lo: s2-eth1:s1-eth2 s2-eth2:s3-eth1
4087 s3 lo: s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
4088 s4 lo: s4-eth1:s1-eth3 s4-eth2:s3-eth2
4092 - Generate traffic by pinging between hosts h1 and h2 before creating
4093 the portmaps respectively
4098 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4099 From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
4100 From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
4101 From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
4102 From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
4107 - Create a Controller named controller1 and mention its ip-address in
4108 the below create-controller command.
4112 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 - Create a VTN named vtn1 by executing the create-vtn command
4118 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 - Create a vBridge named vBridge1 in the vtn1 by executing the
4125 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 - Create two Interfaces named if1 and if2 into the vBridge1
4131 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
4132 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 - Configure two mappings on each of the interfaces by executing the
4137 The interface if1 of the virtual bridge will be mapped to the port
4138 "s1-eth1" of the switch "openflow:1" of the Mininet. The h1 is connected
4139 to the port "s1-eth1".
4141 The interface if2 of the virtual bridge will be mapped to the port
4142 "s3-eth3" of the switch "openflow:3" of the Mininet. The h2 is connected
4143 to the port "s3-eth3".
4147 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
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:03-s3-eth3"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
4150 - Generate traffic by pinging between hosts h1 and h2 after creating
4151 the portmaps respectively
4156 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4157 64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=36.4 ms
4158 64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.880 ms
4159 64 bytes from 10.0.0.2: icmp_req=3 ttl=64 time=0.073 ms
4160 64 bytes from 10.0.0.2: icmp_req=4 ttl=64 time=0.081 ms
4162 - Get the VTN Dataflows information
4166 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 - Create a Flowcondition in the VTN
4170 **(The flowconditions, pathmap and pathpolicy commands have to be
4171 executed in the controller).**
4175 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 - Create a Pathmap in the VTN
4181 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 - Get the Path policy information
4187 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"}]}}'
4192 - Before applying Path policy information in the VTN
4199 "in_port_name": "s1-eth1",
4200 "out_port_name": "s1-eth3",
4201 "switch_id": "openflow:1"
4204 "in_port_name": "s4-eth1",
4205 "out_port_name": "s4-eth2",
4206 "switch_id": "openflow:4"
4209 "in_port_name": "s3-eth2",
4210 "out_port_name": "s3-eth3",
4211 "switch_id": "openflow:3"
4216 - After applying Path policy information in the VTN
4223 "in_port_name": "s1-eth1",
4224 "out_port_name": "s1-eth2",
4225 "switch_id": "openflow:1"
4228 "in_port_name": "s2-eth1",
4229 "out_port_name": "s2-eth2",
4230 "switch_id": "openflow:2"
4233 "in_port_name": "s3-eth1",
4234 "out_port_name": "s3-eth3",
4235 "switch_id": "openflow:3"
4240 VTN Coordinator(Troubleshooting HowTo)
4241 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4246 This page demonstrates Installation troubleshooting steps of VTN
4247 Coordinator. OpenDaylight VTN provides multi-tenant virtual network
4248 functions on OpenDaylight controllers. OpenDaylight VTN consists of two
4255 VTN Coordinator orchestrates multiple VTN Managers running in
4256 OpenDaylight Controllers, and provides VTN Applications with VTN API.
4257 VTN Manager is OSGi bundles running in OpenDaylight Controller. Current
4258 VTN Manager supports only OpenFlow switches. It handles PACKET\_IN
4259 messages, sends PACKET\_OUT messages, manages host information, and
4260 installs flow entries into OpenFlow switches to provide VTN Coordinator
4261 with virtual network functions. The requirements for installing these
4262 two are different.Therefore, we recommend that you install VTN Manager
4263 and VTN Coordinator in different machines.
4265 List of installation Troubleshooting How to’s
4266 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4268 - https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Installation:VTN_Coordinator
4270 **After executing db\_setup, you have encountered the error "Failed to
4273 The error could be due to the below reasons
4275 - Access Restriction
4277 The user who owns /usr/local/vtn/ directory and installs VTN
4278 Coordinator, can only start db\_setup. Example :
4282 The directory should appear as below (assuming the user as "vtn"):
4284 drwxr-xr-x. 12 vtn vtn 4096 Mar 14 21:53 vtn
4285 If the user doesnot own /usr/local/vtn/ then, please run the below command (assuming the username as vtn),
4286 chown -R vtn:vtn /usr/local/vtn
4288 - Postgres not Present
4292 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
4293 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 - Not enough space to create tables
4299 Please check df -k and ensure enough free space is available.
4301 - If the above steps do not solve the problem, please refer to the log
4302 file for the exact problem
4306 /usr/local/vtn/var/dbm/unc_setup_db.log for the exact error.
4308 - list of VTN Coordinator processes
4310 - Run the below command ensure the Coordinator daemons are running.
4314 Command: /usr/local/vtn/bin/unc_dmctl status
4315 Name Type IPC Channel PID
4316 ----------- ----------- -------------- ------
4317 drvodcd DRIVER drvodcd 15972
4318 lgcnwd LOGICAL lgcnwd 16010
4319 phynwd PHYSICAL phynwd 15996
4321 - Issue the curl command to fetch version and ensure the process is
4324 **How to debug a startup failure?.**
4326 The following activities take place in order during startup
4328 - Database server is started after setting virtual memory to required
4329 value,Any database startup errors will be reflected in any of the
4334 /usr/local/vtn/var/dbm/unc_db_script.log.
4335 /usr/local/vtn/var/db/pg_log/postgresql-*.log (the pattern will have the date)
4337 - uncd daemon is kicked off, The daemon in turn kicks off the rest of
4342 Any uncd startup failures will be reflected in /usr/local/vtn/var/uncd/uncd_start.err.
4344 After setting up the apache tomcat server, what are the aspects that should be checked.
4345 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
4347 **Please check if catalina is running..**
4351 The command ps -ef | grep catalina | grep -v grep should list a catalina process
4353 **If you encounter an erroneous situation where the REST API is always
4358 Please ensure the firewall settings for port:8181(Beryllium release) or port:8083(Post Beryllium release) and enable the same.
4360 **How to debug a REST API returning a failure message?.**
4362 Please check the /usr/share/java/apache-tomcat-7.0.39/logs/core/core.log
4363 for failure details.
4365 **REST API for VTN configuration fails, how to debug?.**
4367 The default log level for all daemons is "INFO", to debug the situation
4368 TRACE or DEBUG logs may be needed. To increase the log level for
4369 individual daemons, please use the commands suggested below
4373 /usr/local/vtn/bin/lgcnw_control loglevel trace -- upll daemon log
4374 /usr/local/vtn/bin/phynw_control loglevel trace -- uppl daemon log
4375 /usr/local/vtn/bin/unc_control loglevel trace -- uncd daemon log
4376 /usr/local/vtn/bin/drvodc_control loglevel trace -- Driver daemon log
4378 After setting the log levels, the operation can be repeated and the log
4379 files can be referred for debugging.
4381 **Problems while Installing PostgreSQL due to openssl.**
4383 Errors may occur when trying to install postgreSQL rpms. Recently
4384 PostgreSQL has upgraded all their binaries to use the latest openssl
4385 versions with fix for http://en.wikipedia.org/wiki/Heartbleed Please
4386 upgrade the openssl package to the latest version and re-install. For
4387 RHEL 6.1/6.4 : If you have subscription, Please use the same and update
4388 the rpms. The details are available in the following link
4389 https://access.redhat.com/site/solutions/781793 ACCESS-REDHAT
4393 rpm -Uvh http://mirrors.kernel.org/centos/6/os/x86_64/Packages/openssl-1.0.1e-15.el6.x86_64.rpm
4394 rpm -ivh http://mirrors.kernel.org/centos/6/os/x86_64/Packages/openssl-devel-1.0.1e-15.el6.x86_64.rpm
4396 For other linux platforms, Please do yum update, the public respositroes
4397 will have the latest openssl, please install the same.
4399 Support for Microsoft SCVMM 2012 R2 with ODL VTN
4400 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4405 System Center Virtual Machine Manager (SCVMM) is Microsoft’s virtual
4406 machine support center for window’s based emulations. SCVMM is a
4407 management solution for the virtualized data center. You can use it to
4408 configure and manage your virtualization host, networking, and storage
4409 resources in order to create and deploy virtual machines and services to
4410 private clouds that you have created.
4412 The VSEM Provider is a plug-in to bridge between SCVMM and OpenDaylight.
4414 Microsoft Hyper-V is a server virtualization developed by Microsoft,
4415 which provides virtualization services through hypervisor-based
4418 .. figure:: ./images/vtn/setup_diagram_SCVMM.png
4419 :alt: Set-Up Diagram
4423 **The topology used in this set-up is:**
4425 - A SCVMM with VSEM Provider installed and a running VTN Coordinator
4426 and OpenDaylight with VTN Feature installed.
4428 - PF1000 virtual switch extension has been installed in the two Hyper-V
4429 servers as it implements the OpenFlow capability in Hyper-V.
4431 - Three OpenFlow switches simulated using mininet and connected to
4434 - Four VM’s hosted using SCVMM.
4436 **It is implemented as two major components:**
4440 - OpenDaylight (VTN Feature)
4447 OpenDaylight VTN as Network Service provider for SCVMM where VSEM
4448 provider is added in the Network Service which will handle all requests
4449 from SCVMM and communicate with the VTN Coordinator. It is used to
4450 manage the network virtualization provided by OpenDaylight.
4452 Installing HTTPS in VTN Coordinator
4453 '''''''''''''''''''''''''''''''''''
4455 - System Center Virtual Machine Manager (SCVMM) supports only https
4458 **Apache Portable Runtime (APR) Installation Steps**
4460 - Enter the command "yum install **apr**" in VTN Coordinator installed
4463 - In /usr/bin, create a soft link as "ln –s /usr/bin/apr-1-config
4464 /usr/bin/apr-config".
4466 - Extract tomcat under "/usr/share/java" by using the below command
4467 "tar -xvf apache-tomcat-8.0.27.tar.gz –C /usr/share/java".
4471 Please go through the bleow link to download
4472 apache-tomcat-8.0.27.tar.gz file,
4473 https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.27/bin/
4475 - Please go to the directory "cd
4476 /usr/share/java/apache-tomcat-8.0.27/bin and unzip tomcat-native.gz
4477 using this command "tar -xvf tomcat-native.gz".
4479 - Go to the directory "cd
4480 /usr/share/java/apache-tomcat-8.0.27/bin/tomcat-native-1.1.33-src/jni/native".
4482 - Enter the command "./configure --with-os-type=bin
4483 --with-apr=/usr/bin/apr-config".
4485 - Enter the command "make" and "make install".
4487 - Apr libraries are successfully installed in "/usr/local/apr/lib".
4489 **Enable HTTP/HTTPS in VTN Coordinator**
4491 Enter the command "firewall-cmd --zone=public --add-port=8083/tcp
4492 --permanent" and "firewall-cmd --reload" to enable firewall settings in
4495 **Create a CA’s private key and a self-signed certificate in server**
4497 - Execute the following command "openssl req -x509 -days 365
4498 -extensions v3\_ca -newkey rsa:2048 –out /etc/pki/CA/cacert.pem
4499 –keyout /etc/pki/CA/private/cakey.pem" in a single line.
4501 +-----------------------+----------------------------------------------------+
4502 | Argument | Description |
4503 +=======================+====================================================+
4504 | Country Name | | Specify the country code. |
4505 | | | For example, JP |
4506 +-----------------------+----------------------------------------------------+
4507 | State or Province | | Specify the state or province. |
4508 | Name | | For example, Tokyo |
4509 +-----------------------+----------------------------------------------------+
4510 | Locality Name | | Locality Name |
4511 | | | For example, Chuo-Ku |
4512 +-----------------------+----------------------------------------------------+
4513 | Organization Name | Specify the company. |
4514 +-----------------------+----------------------------------------------------+
4515 | Organizational Unit | Specify the department, division, or the like. |
4517 +-----------------------+----------------------------------------------------+
4518 | Common Name | Specify the host name. |
4519 +-----------------------+----------------------------------------------------+
4520 | Email Address | Specify the e-mail address. |
4521 +-----------------------+----------------------------------------------------+
4523 - Execute the following commands: "touch /etc/pki/CA/index.txt" and
4524 "echo 00 > /etc/pki/CA/serial" in server after setting your CA’s
4527 **Create a private key and a CSR for web server**
4529 - Execute the following command "openssl req -new -newkey rsa:2048 -out
4530 csr.pem –keyout /usr/local/vtn/tomcat/conf/key.pem" in a single line.
4532 - Enter the PEM pass phrase: Same password you have given in CA’s
4533 private key PEM pass phrase.
4535 +-----------------------+----------------------------------------------------+
4536 | Argument | Description |
4537 +=======================+====================================================+
4538 | Country Name | | Specify the country code. |
4539 | | | For example, JP |
4540 +-----------------------+----------------------------------------------------+
4541 | State or Province | | Specify the state or province. |
4542 | Name | | For example, Tokyo |
4543 +-----------------------+----------------------------------------------------+
4544 | Locality Name | | Locality Name |
4545 | | | For example, Chuo-Ku |
4546 +-----------------------+----------------------------------------------------+
4547 | Organization Name | Specify the company. |
4548 +-----------------------+----------------------------------------------------+
4549 | Organizational Unit | Specify the department, division, or the like. |
4551 +-----------------------+----------------------------------------------------+
4552 | Common Name | Specify the host name. |
4553 +-----------------------+----------------------------------------------------+
4554 | Email Address | Specify the e-mail address. |
4555 +-----------------------+----------------------------------------------------+
4556 | A challenge password | Specify the challenge password. |
4557 +-----------------------+----------------------------------------------------+
4558 | An optional company | Specify an optional company name. |
4560 +-----------------------+----------------------------------------------------+
4562 **Create a certificate for web server**
4564 - Execute the following command "openssl ca –in csr.pem –out
4565 /usr/local/vtn/tomcat/conf/cert.pem –days 365 –batch" in a single
4568 - Enter pass phrase for /etc/pki/CA/private/cakey.pem: Same password
4569 you have given in CA’s private key PEM pass phrase.
4571 - Open the tomcat file using "vim /usr/local/vtn/tomcat/bin/tomcat".
4573 - Include the line " TOMCAT\_PROPS="$TOMCAT\_PROPS
4574 -Djava.library.path=\\"/usr/local/apr/lib\\"" " in 131th line and
4577 **Edit server.xml file and restart the server**
4579 - Open the server.xml file using "vim
4580 /usr/local/vtn/tomcat/conf/server.xml" and add the below lines.
4584 <Connector port="${vtn.port}" protocol="HTTP/1.1" SSLEnabled="true"
4585 maxThreads="150" scheme="https" secure="true"
4586 SSLCertificateFile="/usr/local/vtn/tomcat/conf/cert.pem"
4587 SSLCertificateKeyFile="/usr/local/vtn/tomcat/conf/key.pem"
4588 SSLPassword=same password you have given in CA's private key PEM pass phrase
4589 connectionTimeout="20000" />
4591 - Save the file and restart the server.
4593 - To stop vtn use the following command.
4597 /usr/local/vtn/bin/vtn_stop
4599 - To start vtn use the following command.
4603 /usr/local/vtn/bin/vtn_start
4605 - Copy the created CA certificate from cacert.pem to cacert.crt by
4606 using the following command,
4610 openssl x509 –in /etc/pki/CA/cacert.pem –out cacert.crt
4612 **Checking the HTTP and HTTPS connection from client**
4614 - You can check the HTTP connection by using the following command:
4618 curl -X GET -H 'contenttype:application/json' -H 'username:admin' -H 'password:adminpass' http://<server IP address>:8083/vtn-webapi/api_version.json
4620 - You can check the HTTPS connection by using the following command:
4624 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 - The response should be like this for both HTTP and HTTPS:
4630 {"api_version":{"version":"V1.4"}}
4632 Prerequisites to create Network Service in SCVMM machine, Please follow the below steps
4633 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4635 1. Please go through the below link to download VSEM Provider zip file,
4636 https://nexus.opendaylight.org/content/groups/public/org/opendaylight/vtn/application/vtnmanager-vsemprovider/2.0.0-Beryllium/vtnmanager-vsemprovider-2.0.0-Beryllium-bin.zip
4638 2. Unzip the vtnmanager-vsemprovider-2.0.0-Beryllium-bin.zip file
4639 anywhere in your SCVMM machine.
4641 3. Stop SCVMM service from **"service manager→tools→servers→select
4642 system center virtual machine manager"** and click stop.
4644 4. Go to **"C:/Program Files"** in your SCVMM machine. Inside
4645 **"C:/Program Files"**, create a folder named as **"ODLProvider"**.
4647 5. Inside **"C:/Program Files/ODLProvider"**, create a folder named as
4648 "Module" in your SCVMM machine.
4650 6. Inside "C:/Program Files/ODLProvider/Module", Create two folders
4651 named as **"Odl.VSEMProvider"** and **"VSEMOdlUI"** in your SCVMM
4654 7. Copy the **"VSEMOdl.dll"** file from
4655 **"ODL\_SCVMM\_PROVIDER/ODL\_VSEM\_PROVIDER"** to **"C:/Program
4656 Files/ODLProvider/Module/Odl.VSEMProvider"** in your SCVMM machine.
4658 8. Copy the **"VSEMOdlProvider.psd1"** file from
4659 **"application/vsemprovider/VSEMOdlProvider/VSEMOdlProvider.psd1"**
4660 to **"C:/Program Files/ODLProvider/Module/Odl.VSEMProvider"** in
4663 9. Copy the **"VSEMOdlUI.dll"** file from
4664 **"ODL\_SCVMM\_PROVIDER/ODL\_VSEM\_PROVIDER\_UI"** to **"C:/Program
4665 Files/ODLProvider/Module/VSEMOdlUI"** in your SCVMM machine.
4667 10. Copy the **"VSEMOdlUI.psd1"** file from
4668 **"application/vsemprovider/VSEMOdlUI"** to **"C:/Program
4669 Files/ODLProvider/Module/VSEMOdlUI"** in your SCVMM machine.
4671 11. Copy the **"reg\_entry.reg"** file from
4672 **"ODL\_SCVMM\_PROVIDER/Register\_settings"** to your SCVMM desktop
4673 and double click the **"reg\_entry.reg"** file to install registry
4674 entry in your SCVMM machine.
4676 12. Download **"PF1000.msi"** from this link,
4677 https://www.pf-info.com/License/en/index.php?url=index/index_non_buyer
4678 and place into **"C:/Program Files/Switch Extension Drivers"** in
4681 13. Start SCVMM service from **"service manager→tools→servers→select
4682 system center virtual machine manager"** and click start.
4684 System Center Virtual Machine Manager (SCVMM)
4685 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4687 It supports two major features:
4689 - Failover Clustering
4696 A single Hyper-V can host a number of virtual machines. If the host were
4697 to fail then all of the virtual machines that are running on it will
4698 also fail, thereby resulting in a major outage. Failover clustering
4699 treats individual virtual machines as clustered resources. If a host
4700 were to fail then clustered virtual machines are able to fail over to a
4701 different Hyper-V server where they can continue to run.
4706 Live Migration is used to migrate the running virtual machines from one
4707 Hyper-V server to another Hyper-V server without any interruptions.
4708 Please go through the below video for more details,
4710 - https://youtu.be/34YMOTzbNJM
4715 - Please go through the below link for SCVMM user guide:
4716 https://wiki.opendaylight.org/images/c/ca/ODL_SCVMM_USER_GUIDE_final.pdf
4718 - Please go through the below links for more details
4720 - OpenDaylight SCVMM VTN Integration: https://youtu.be/iRt4dxtiz94
4722 - OpenDaylight Congestion Control with SCVMM VTN:
4723 https://youtu.be/34YMOTzbNJM