3 Virtual Tenant Network (VTN)
4 ============================
9 OpenDaylight Virtual Tenant Network (VTN) is an application that
10 provides multi-tenant virtual network on an SDN controller.
12 Conventionally, huge investment in the network systems and operating
13 expenses are needed because the network is configured as a silo for each
14 department and system. So, various network appliances must be installed
15 for each tenant and those boxes cannot be shared with others. It is a
16 heavy work to design, implement and operate the entire complex network.
18 The uniqueness of VTN is a logical abstraction plane. This enables the
19 complete separation of logical plane from physical plane. Users can
20 design and deploy any desired network without knowing the physical
21 network topology or bandwidth restrictions.
23 VTN allows the users to define the network with a look and feel of
24 conventional L2/L3 network. Once the network is designed on VTN, it will
25 automatically be mapped into underlying physical network, and then
26 configured on the individual switch leveraging SDN control protocol. The
27 definition of logical plane makes it possible not only to hide the
28 complexity of the underlying network but also to better manage network
29 resources. It achieves reducing reconfiguration time of network services
30 and minimizing network configuration errors.
32 .. figure:: ./images/vtn/VTN_Overview.jpg
37 It is implemented as two major components
46 An OpenDaylight Plugin that interacts with other modules to implement
47 the components of the VTN model. It also provides a REST interface to
48 configure VTN components in OpenDaylight. VTN Manager is implemented as
49 one plugin to the OpenDaylight. This provides a REST interface to
50 create/update/delete VTN components. The user command in VTN Coordinator
51 is translated as REST API to VTN Manager by the OpenDaylight Driver
52 component. In addition to the above mentioned role, it also provides an
53 implementation to the OpenStack L2 Network Functions API.
58 - **odl-vtn-manager** provides VTN Manager’s JAVA API.
60 - **odl-vtn-manager-rest** provides VTN Manager’s REST API.
62 - **odl-vtn-manager-neutron** provides the integration with Neutron
68 VTN Manager provides REST API for virtual network functions.
70 Here is an example of how to create a virtual tenant network.
74 curl --user "admin":"admin" -H "Accept: application/json" -H \
75 "Content-type: application/json" -X POST \
76 http://localhost:8181/restconf/operations/vtn:update-vtn \
77 -d '{"input":{"tenant-name":"vtn1"}}'
79 You can check the list of all tenants by executing the following
84 curl --user "admin":"admin" -H "Accept: application/json" -H \
85 "Content-type: application/json" -X GET \
86 http://localhost:8181/restconf/operational/vtn:vtns
88 REST Conf documentation for VTN Manager, please refer to:
89 https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/apidocs/index.html
95 The VTN Coordinator is an external application that provides a REST
96 interface for an user to use OpenDaylight VTN Virtualization. It
97 interacts with VTN Manager plugin to implement the user configuration.
98 It is also capable of multiple OpenDaylight orchestration. It realizes
99 Virtual Tenant Network (VTN) provisioning in OpenDaylight instances. In
100 the OpenDaylight architecture VTN Coordinator is part of the network
101 application, orchestration and services layer. VTN Coordinator will use
102 the REST interface exposed by the VTN Manger to realize the virtual
103 network using OpenDaylight. It uses OpenDaylight APIs (REST) to
104 construct the virtual network in OpenDaylight instances. It provides
105 REST APIs for northbound VTN applications and supports virtual networks
106 spanning across multiple OpenDaylight by coordinating across
109 For VTN Coordinator REST API, please refer to:
110 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:VTN_Coordinator:RestApi
112 Network Virtualization Function
113 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115 The user first defines a VTN. Then, the user maps the VTN to a physical
116 network, which enables communication to take place according to the VTN
117 definition. With the VTN definition, L2 and L3 transfer functions and
118 flow-based traffic control functions (filtering and redirect) are
121 Virtual Network Construction
122 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124 The following table shows the elements which make up the VTN. In the
125 VTN, a virtual network is constructed using virtual nodes (vBridge,
126 vRouter) and virtual interfaces and links. It is possible to configure a
127 network which has L2 and L3 transfer function, by connecting the virtual
128 intrefaces made on virtual nodes via virtual links.
130 +--------------------------------------+--------------------------------------+
131 | vBridge | The logical representation of L2 |
132 | | switch function. |
133 +--------------------------------------+--------------------------------------+
134 | vRouter | The logical representation of router |
136 +--------------------------------------+--------------------------------------+
137 | vTep | The logical representation of Tunnel |
138 | | End Point - TEP. |
139 +--------------------------------------+--------------------------------------+
140 | vTunnel | The logical representation of |
142 +--------------------------------------+--------------------------------------+
143 | vBypass | The logical representation of |
144 | | connectivity between controlled |
146 +--------------------------------------+--------------------------------------+
147 | Virtual interface | The representation of end point on |
148 | | the virtual node. |
149 +--------------------------------------+--------------------------------------+
150 | Virtual Linkv(vLink) | The logical representation of L1 |
151 | | connectivity between virtual |
153 +--------------------------------------+--------------------------------------+
155 The following figure shows an example of a constructed virtual network.
156 VRT is defined as the vRouter, BR1 and BR2 are defined as vBridges.
157 interfaces of the vRouter and vBridges are connected using vLinks.
159 .. figure:: ./images/vtn/VTN_Construction.jpg
160 :alt: VTN Construction
164 Mapping of Physical Network Resources
165 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167 Map physical network resources to the constructed virtual network.
168 Mapping identifies which virtual network each packet transmitted or
169 received by an OpenFlow switch belongs to, as well as which interface in
170 the OpenFlow switch transmits or receives that packet. There are two
171 mapping methods. When a packet is received from the OFS, port mapping is
172 first searched for the corresponding mapping definition, then VLAN
173 mapping is searched, and the packet is mapped to the relevant vBridge
174 according to the first matching mapping.
176 +--------------------------------------+--------------------------------------+
177 | Port mapping | Maps physical network resources to |
178 | | an interface of vBridge using Switch |
179 | | ID, Port ID and VLAN ID of the |
180 | | incoming L2 frame. Untagged frame |
181 | | mapping is also supported. |
182 +--------------------------------------+--------------------------------------+
183 | VLAN mapping | Maps physical network resources to a |
184 | | vBridge using VLAN ID of the |
185 | | incoming L2 frame.Maps physical |
186 | | resources of a particular switch to |
187 | | a vBridge using switch ID and VLAN |
188 | | ID of the incoming L2 frame. |
189 +--------------------------------------+--------------------------------------+
190 | MAC mapping | Maps physical resources to an |
191 | | interface of vBridge using MAC |
192 | | address of the incoming L2 frame(The |
193 | | initial contribution does not |
194 | | include this method). |
195 +--------------------------------------+--------------------------------------+
197 VTN can learn the terminal information from a terminal that is connected
198 to a switch which is mapped to VTN. Further, it is possible to refer
199 that terminal information on the VTN.
201 - Learning terminal information VTN learns the information of a
202 terminal that belongs to VTN. It will store the MAC address and VLAN
203 ID of the terminal in relation to the port of the switch.
205 - Aging of terminal information Terminal information, learned by the
206 VTN, will be maintained until the packets from terminal keep flowing
207 in VTN. If the terminal gets disconnected from the VTN, then the
208 aging timer will start clicking and the terminal information will be
209 maintained till timeout.
211 The following figure shows an example of mapping. An interface of BR1 is
212 mapped to port GBE0/1 of OFS1 using port mapping. Packets received from
213 GBE0/1 of OFS1 are regarded as those from the corresponding interface of
214 BR1. BR2 is mapped to VLAN 200 using VLAN mapping. Packets with VLAN tag
215 200 received from any ports of any OFSs are regarded as those from an
218 .. figure:: ./images/vtn/VTN_Mapping.jpg
226 The vBridge provides the bridge function that transfers a packet to the
227 intended virtual port according to the destination MAC address. The
228 vBridge looks up the MAC address table and transmits the packet to the
229 corresponding virtual interface when the destination MAC address has
230 been learned. When the destination MAC address has not been learned, it
231 transmits the packet to all virtual interfaces other than the receiving
232 port (flooding). MAC addresses are learned as follows.
234 - MAC address learning The vBridge learns the MAC address of the
235 connected host. The source MAC address of each received frame is
236 mapped to the receiving virtual interface, and this MAC address is
237 stored in the MAC address table created on a per-vBridge basis.
239 - MAC address aging The MAC address stored in the MAC address table is
240 retained as long as the host returns the ARP reply. After the host is
241 disconnected, the address is retained until the aging timer times
242 out. To have the vBridge learn MAC addresses statically, you can
243 register MAC addresses manually.
248 The vRouter transfers IPv4 packets between vBridges. The vRouter
249 supports routing, ARP learning, and ARP aging functions. The following
250 outlines the functions.
252 - Routing function When an IP address is registered with a virtual
253 interface of the vRouter, the default routing information for that
254 interface is registered. It is also possible to statically register
255 routing information for a virtual interface.
257 - ARP learning function The vRouter associates a destination IP
258 address, MAC address and a virtual interface, based on an ARP request
259 to its host or a reply packet for an ARP request, and maintains this
260 information in an ARP table prepared for each routing domain. The
261 registered ARP entry is retained until the aging timer, described
262 later, times out. The vRouter transmits an ARP request on an
263 individual aging timer basis and deletes the associated entry from
264 the ARP table if no reply is returned. For static ARP learning, you
265 can register ARP entry information manually.
267 - DHCP relay agent function The vRouter also provides the DHCP relay
270 Flow Filter Functions
271 ~~~~~~~~~~~~~~~~~~~~~
273 Flow Filter function is similar to ACL. It is possible to allow or
274 prohibit communication with only certain kind of packets that meet a
275 particular condition. Also, it can perform a processing called
276 Redirection - WayPoint routing, which is different from the existing
277 ACL. Flow Filter can be applied to any interface of a vNode within VTN,
278 and it is possible to the control the packets that pass interface. The
279 match conditions that could be specified in Flow Filter are as follows.
280 It is also possible to specify a combination of multiple conditions.
284 - Destination MAC address
292 - Destination IP address
298 - TCP/UDP source port
300 - TCP/UDP destination port
306 The types of Action that can be applied on packets that match the Flow
307 Filter conditions are given in the following table. It is possible to
308 make only those packets, which match a particular condition, to pass
309 through a particular server by specifying Redirection in Action. E.g.,
310 path of flow can be changed for each packet sent from a particular
311 terminal, depending upon the destination IP address. VLAN priority
312 control and DSCP marking are also supported.
314 +--------------------------------------+--------------------------------------+
315 | Action | Function |
316 +--------------------------------------+--------------------------------------+
317 | Pass | Pass particular packets matching the |
318 | | specified conditions. |
319 +--------------------------------------+--------------------------------------+
320 | Drop | Discards particular packets matching |
321 | | the specified conditions. |
322 +--------------------------------------+--------------------------------------+
323 | Redirection | Redirects the packet to a desired |
324 | | virtual interface. Both Transparent |
325 | | Redirection (not changing MAC |
326 | | address) and Router Redirection |
327 | | (changing MAC address) are |
329 +--------------------------------------+--------------------------------------+
331 The following figure shows an example of how the flow filter function
334 If there is any matching condition specified by flow filter when a
335 packet being transferred within a virtual network goes through a virtual
336 interface, the function evaluates the matching condition to see whether
337 the packet matches it. If the packet matches the condition, the function
338 applies the matching action specified by flow filter. In the example
339 shown in the figure, the function evaluates the matching condition at
340 BR1 and discards the packet if it matches the condition.
342 .. figure:: ./images/vtn/VTN_Flow_Filter.jpg
347 Multiple SDN Controller Coordination
348 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
350 With the network abstractions, VTN enables to configure virtual network
351 across multiple SDN controllers. This provides highly scalable network
354 VTN can be created on each SDN controller. If users would like to manage
355 those multiple VTNs with one policy, those VTNs can be integrated to a
358 As a use case, this feature is deployed to multi data center
359 environment. Even if those data centers are geographically separated and
360 controlled with different controllers, a single policy virtual network
361 can be realized with VTN.
363 Also, one can easily add a new SDN Controller to an existing VTN or
364 delete a particular SDN Controller from VTN.
366 In addition to this, one can define a VTN which covers both OpenFlow
367 network and Overlay network at the same time.
369 Flow Filter, which is set on the VTN, will be automatically applied on
370 the newly added SDN Controller.
372 Coordination between OpenFlow Network and L2/L3 Network
373 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
375 It is possible to configure VTN on an environment where there is mix of
376 L2/L3 switches as well. L2/L3 switch will be shown on VTN as vBypass.
377 Flow Filter or policing cannot be configured for a vBypass. However, it
378 is possible to treat it as a virtual node inside VTN.
380 Virtual Tenant Network (VTN) API
381 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383 VTN provides Web APIs. They are implemented by REST architecture and
384 provide the access to resources within VTN that are identified by URI.
385 User can perform the operations like GET/PUT/POST/DELETE against the
386 virtual network resources (e.g. vBridge or vRouter) by sending a message
387 to VTN through HTTPS communication in XML or JSON format.
389 .. figure:: ./images/vtn/VTN_API.jpg
397 VTN provides following operations for various network resources.
399 +----------------+----------------+----------------+----------------+----------------+
400 | Resources | GET | POST | PUT | DELETE |
401 +----------------+----------------+----------------+----------------+----------------+
402 | VTN | Yes | Yes | Yes | Yes |
403 +----------------+----------------+----------------+----------------+----------------+
404 | vBridge | Yes | Yes | Yes | Yes |
405 +----------------+----------------+----------------+----------------+----------------+
406 | vRouter | Yes | Yes | Yes | Yes |
407 +----------------+----------------+----------------+----------------+----------------+
408 | vTep | Yes | Yes | Yes | Yes |
409 +----------------+----------------+----------------+----------------+----------------+
410 | vTunnel | Yes | Yes | Yes | Yes |
411 +----------------+----------------+----------------+----------------+----------------+
412 | vBypass | Yes | Yes | Yes | Yes |
413 +----------------+----------------+----------------+----------------+----------------+
414 | vLink | Yes | Yes | Yes | Yes |
415 +----------------+----------------+----------------+----------------+----------------+
416 | Interface | Yes | Yes | Yes | Yes |
417 +----------------+----------------+----------------+----------------+----------------+
418 | Port map | Yes | No | Yes | Yes |
419 +----------------+----------------+----------------+----------------+----------------+
420 | Vlan map | Yes | Yes | Yes | Yes |
421 +----------------+----------------+----------------+----------------+----------------+
422 | Flowfilter | Yes | Yes | Yes | Yes |
423 | (ACL/redirect) | | | | |
424 +----------------+----------------+----------------+----------------+----------------+
425 | Controller | Yes | Yes | Yes | Yes |
426 | information | | | | |
427 +----------------+----------------+----------------+----------------+----------------+
428 | Physical | Yes | No | No | No |
430 | information | | | | |
431 +----------------+----------------+----------------+----------------+----------------+
432 | Alarm | Yes | No | No | No |
433 | information | | | | |
434 +----------------+----------------+----------------+----------------+----------------+
439 The following is an example of the usage to construct a virtual network.
445 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
446 -d '{"vtn":{"vtn_name":"VTN1"}}' http://172.1.0.1:8083/vtn-webapi/vtns.json
448 - Create Controller Information
452 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
453 -d '{"controller": {"controller_id":"CONTROLLER1","ipaddr":"172.1.0.1","type":"odc","username":"admin", \
454 "password":"admin","version":"1.0"}}' http://172.1.0.1:8083/vtn-webapi/controllers.json
456 - Create vBridge under VTN
460 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
461 -d '{"vbridge":{"vbr_name":"VBR1","controller_id": "CONTROLLER1","domain_id": "(DEFAULT)"}}' \
462 http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges.json
464 - Create the interface under vBridge
468 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
469 -d '{"interface":{"if_name":"IF1"}}' http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges/VBR1/interfaces.json
471 VTN OpenStack Configuration
472 ---------------------------
474 This guide describes how to set up OpenStack for integration with
475 OpenDaylight Controller.
477 While OpenDaylight Controller provides several ways to integrate with
478 OpenStack, this guide focus on the way which uses VTN features available
479 on OpenDaylight. In the integration, VTN Manager work as network service
480 provider for OpenStack.
482 VTN Manager features, enable OpenStack to work in pure OpenFlow
483 environment in which all switches in data plane are OpenFlow switch.
488 - OpenDaylight Controller. (VTN features must be installed)
490 - OpenStack Control Node.
492 - OpenStack Compute Node.
494 - OpenFlow Switch like mininet(Not Mandatory).
496 The VTN features support multiple OpenStack nodes. You can deploy
497 multiple OpenStack Compute Nodes. In management plane, OpenDaylight
498 Controller, OpenStack nodes and OpenFlow switches should communicate
499 with each other. In data plane, Open vSwitches running in OpenStack
500 nodes should communicate with each other through a physical or logical
501 OpenFlow switches. The core OpenFlow switches are not mandatory.
502 Therefore, you can directly connect to the Open vSwitch’s.
504 .. figure:: ./images/vtn/OpenStack_Demo_Picture.png
505 :alt: Openstack Overview
512 Below steps depicts the configuration of single OpenStack Control node
513 and OpenStack Compute node setup. Our test setup is as follows
515 .. figure:: ./images/vtn/vtn_devstack_setup.png
520 **Server Preparation**
522 - Install Ubuntu 14.04 LTS in two servers (OpenStack Control node and
523 Compute node respectively)
525 - While installing, Ubuntu mandates creation of a User, we created the
526 user "stack"(We will use the same user for running devstack)
528 - Proceed with the below mentioned User Settings and Network Settings
529 in both the Control and Compute nodes.
531 **User Settings for devstack** - Login to both servers - Disable Ubuntu
538 - Install the below packages (optional, provides ifconfig and route
539 coammnds, handy for debugging!!)
543 sudo apt-get install net-tools
545 - Edit sudo vim /etc/sudoers and add an entry as follows
549 stack ALL=(ALL) NOPASSWD: ALL
551 **Network Settings** - Checked the output of ifconfig -a, two interfaces
552 were listed eth0 and eth1 as indicated in the image above. - We had
553 connected eth0 interface to the Network where OpenDaylight is reachable.
554 - eth1 interface in both servers were connected to a different network
555 to act as data plane for the VM’s created using the OpenStack. -
556 Manually edited the file : sudo vim /etc/network/interfaces and made
561 stack@ubuntu-devstack:~/devstack$ cat /etc/network/interfaces
562 # This file describes the network interfaces available on your system
563 # and how to activate them. For more information, see interfaces(5).
564 # The loop-back network interface
566 iface lo inet loopback
567 # The primary network interface
569 iface eth0 inet static
570 address <IP_ADDRESS_TO_REACH_ODL>
572 broadcast <BROADCAST_IP_ADDRESS>
573 gateway <GATEWAY_IP_ADDRESS>
575 iface eth1 inet static
576 address <IP_ADDRESS_UNIQ>
581 Please ensure that the eth0 interface is the default route and it is
582 able to reach the ODL\_IP\_ADDRESS NOTE: The entries for eth1 are
583 not mandatory, If not set, we may have to manually do "ifup eth1"
584 after the stacking is complete to activate the interface
586 **Finalize the user and network settings** - Please reboot both nodes
587 after the user and network settings to have the network settings applied
588 to the network - Login again and check the output of ifconfig to ensure
589 that both interfaces are listed
591 OpenDaylight Settings and Execution
592 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
594 VTN Configuration for OpenStack Integration:
595 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
597 - VTN uses the configuration parameters from "90-vtn-neutron.xml" file
598 for the OpenStack integration.
600 - These values will be set for the OpenvSwitch, in all the
601 participating OpenStack nodes.
603 - A configuration file "90-vtn-neutron.xml" will be generated
604 automatically by following the below steps,
606 - Download the latest Boron karaf distribution from the below link,
610 http://www.opendaylight.org/software/downloads
612 - cd "distribution-karaf-0.5.0-Boron" and run karaf by using the
613 following command "./bin/karaf".
615 - Install the below feature to generate "90-vtn-neutron.xml"
619 feature:install odl-vtn-manager-neutron
621 - Logout from the karaf console and Check "90-vtn-neutron.xml" file
622 from the following path
623 "distribution-karaf-0.5.0-Boron/etc/opendaylight/karaf/".
625 - The contents of "90-vtn-neutron.xml" should be as follows:
627 bridgename=br-int portname=eth1 protocols=OpenFlow13 failmode=secure
629 - The values of the configuration parameters must be changed based on
630 the user environment.
632 - Especially, "portname" should be carefully configured, because if the
633 value is wrong, OpenDaylight fails to forward packets.
635 - Other parameters works fine as is for general use cases.
639 - The name of the bridge in Open vSwitch, that will be created by
640 OpenDaylight Controller.
642 - It must be "br-int".
646 - The name of the port that will be created in the vbridge in
649 - This must be the same name of the interface of OpenStack Nodes
650 which is used for interconnecting OpenStack Nodes in data
651 plane.(in our case:eth1)
653 - By default, if 90-vtn-neutron.xml is not created, VTN uses
658 - OpenFlow protocol through which OpenFlow Switch and Controller
661 - The values can be OpenFlow13 or OpenFlow10.
665 - The value can be "standalone" or "secure".
667 - Please use "secure" for general use cases.
672 - Please refer to the Installation Pages to run ODL with VTN Feature
675 - After running ODL Controller, please ensure ODL Controller listens to
676 the ports:6633,6653, 6640 and 8080
678 - Please allow the ports in firewall for the devstack to be able to
679 communicate with ODL Controller.
683 - 6633/6653 - OpenFlow Ports
685 - 6640 - OVS Manager Port
687 - 8080 - Port for REST API
692 Get Devstack (All nodes)
693 ^^^^^^^^^^^^^^^^^^^^^^^^
695 - Install git application using
697 - sudo apt-get install git
701 - git clone https://git.openstack.org/openstack-dev/devstack;
703 - Switch to stable/Juno Version branch
709 git checkout stable/juno
713 If you want to use stable/kilo Version branch, Please execute the
714 below command in devstack folder
718 git checkout stable/kilo
722 If you want to use stable/liberty Version branch, Please execute the
723 below command in devstack folder
727 git checkout stable/liberty
734 - cd devstack in the controller node
736 - Copy the contents of local.conf for juno (devstack control node) from
737 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack
738 and save it as "local.conf" in the "devstack".
740 - Copy the contents of local.conf for kilo and liberty (devstack
742 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack_post_juno_versions
743 and save it as "local.conf" in the "devstack".
745 - Please modify the IP Address values as required.
753 Verify Control Node stacking
754 ''''''''''''''''''''''''''''
756 - stack.sh prints out Horizon is now available at
757 http://<CONTROL\_NODE\_IP\_ADDRESS>:8080/
759 - Execute the command *sudo ovs-vsctl show* in the control node
760 terminal and verify if the bridge *br-int* is created.
762 - Typical output of the ovs-vsctl show is indicated below:
766 e232bbd5-096b-48a3-a28d-ce4a492d4b4f
767 Manager "tcp:192.168.64.73:6640"
770 Controller "tcp:192.168.64.73:6633"
782 - cd devstack in the controller node
784 - Copy the contents of local.conf for juno (devstack compute node) from
785 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack
786 and save it as "local.conf" in the "devstack".
788 - Copy the contents of local.conf file for kilo and liberty (devstack
790 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack_post_juno_versions
791 and save it as "local.conf" in the "devstack".
793 - Please modify the IP Address values as required.
801 Verify Compute Node Stacking
802 ''''''''''''''''''''''''''''
804 - stack.sh prints out This is your host ip:
805 <COMPUTE\_NODE\_IP\_ADDRESS>
807 - Execute the command *sudo ovs-vsctl show* in the control node
808 terminal and verify if the bridge *br-int* is created.
810 - The output of the ovs-vsctl show will be similar to the one seen in
813 Additional Verifications
814 ^^^^^^^^^^^^^^^^^^^^^^^^
816 - Please visit the OpenDaylight DLUX GUI after stacking all the nodes,
817 http://<ODL\_IP\_ADDRESS>:8181/index.html.
818 The switches, topology and the ports that are currently read can be
823 http://<controller-ip>:8181/index.html
827 If the interconnected between the Open vSwitch is not seen, Please
828 bring up the interface for the dataplane manually using the below
833 ifup <interface_name>
835 - Please Accept Promiscuous mode in the networks involving the
838 Create VM from Devstack Horizon GUI
839 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
842 http://<CONTROL\_NODE\_IP>:8080/
843 to check the horizon GUI.
845 .. figure:: ./images/vtn/OpenStackGui.png
850 Enter the value for User Name as admin and enter the value for Password
853 - We should first ensure both the hypervisors(control node and compute
854 node) are mapped under hypervisors by clicking on Hpervisors tab.
856 .. figure:: ./images/vtn/Hypervisors.png
861 - Create a new Network from Horizon GUI.
863 - Click on Networks Tab.
865 - click on the Create Network button.
867 .. figure:: ./images/vtn/Create_Network.png
872 - A popup screen will appear.
874 - Enter network name and click Next button.
876 .. figure:: ./images/vtn/Creare_Network_Step_1.png
881 - Create a sub network by giving Network Address and click Next button
884 .. figure:: ./images/vtn/Create_Network_Step_2.png
889 - Specify the additional details for subnetwork (please refer the image
892 .. figure:: ./images/vtn/Create_Network_Step_3.png
897 - Click Create button
901 - Navigate to Instances tab in the GUI.
903 .. figure:: ./images/vtn/Instance_Creation.png
904 :alt: Instance Creation
908 - Click on Launch Instances button.
910 .. figure:: ./images/vtn/Launch_Instance.png
911 :alt: Launch Instance
915 - Click on Details tab to enter the VM details.For this demo we are
916 creating Ten VM’s(instances).
918 - In the Networking tab, we must select the network,for this we need to
919 drag and drop the Available networks to Selected Networks (i.e.,)
920 Drag vtn1 we created from Available networks to Selected Networks and
921 click Launch to create the instances.
923 .. figure:: ./images/vtn/Launch_Instance_network.png
928 - Ten VM’s will be created.
930 .. figure:: ./images/vtn/Load_All_Instances.png
931 :alt: Load All Instances
935 - Click on any VM displayed in the Instances tab and click the Console
938 .. figure:: ./images/vtn/Instance_Console.png
939 :alt: Instance Console
943 - Login to the VM console and verify with a ping command.
945 .. figure:: ./images/vtn/Instance_ping.png
950 Verification of Control and Compute Node after VM creation
951 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
953 - Every time a new VM is created, more interfaces are added to the
954 br-int bridge in Open vSwitch.
956 - Use *sudo ovs-vsctl show* to list the number of interfaces added.
958 - Please visit the DLUX GUI to list the new nodes in every switch.
960 Getting started with DLUX
961 ^^^^^^^^^^^^^^^^^^^^^^^^^
963 Ensure that you have created a topology and enabled MD-SAL feature in
964 the Karaf distribution before you use DLUX for network management.
969 To log in to DLUX, after installing the application: \* Open a browser
970 and enter the login URL. If you have installed DLUX as a stand-alone,
971 then the login URL is http://localhost:9000/DLUX/index.html. However if
972 you have deployed DLUX with Karaf, then the login URL is
973 http://<your IP>:8181/dlux/index.html. \* Login
974 to the application with user ID and password credentials as admin.
975 NOTE:admin is the only user type available for DLUX in this release.
980 To get a complete DLUX feature list, install restconf, odl l2 switch,
981 and switch while you start the DLUX distribution.
983 .. figure:: ./images/vtn/Dlux_login.png
990 DLUX enables only those modules, whose APIs are responding. If you
991 enable just the MD-SAL in beginning and then start dlux, only MD-SAL
992 related tabs will be visible. While using the GUI if you enable
993 AD-SAL karaf features, those tabs will appear automatically.
995 Viewing Network Statistics
996 ^^^^^^^^^^^^^^^^^^^^^^^^^^
998 The Nodes module on the left pane enables you to view the network
999 statistics and port information for the switches in the network. \* To
1000 use the Nodes module: \*\* Select Nodeson the left pane.
1004 The right pane displays atable that lists all the nodes, node connectors and the statistics.
1006 - Enter a node ID in the Search Nodes tab to search by node connectors.
1008 - Click on the Node Connector number to view details such as port ID,
1009 port name, number of ports per switch, MAC Address, and so on.
1011 - Click Flows in the Statistics column to view Flow Table Statistics
1012 for the particular node like table ID, packet match, active flows and
1015 - Click Node Connectors to view Node Connector Statistics for the
1018 Viewing Network Topology
1019 ^^^^^^^^^^^^^^^^^^^^^^^^
1021 To view network topology: \* Select Topology on the left pane. You will
1022 view the graphical representation on the right pane.
1027 blue boxes represent the switches,black represents the hosts available, and lines represents how switches are connected.
1031 DLUX UI does not provide ability to add topology information. The
1032 Topology should be created using an open flow plugin. Controller
1033 stores this information in the database and displays on the DLUX
1034 page, when the you connect to the controller using OpenFlow.
1036 .. figure:: ./images/vtn/Dlux_topology.png
1041 OpenStack PackStack Installation Steps
1042 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1044 - Please go through the below wiki page for OpenStack PackStack
1047 - https://wiki.opendaylight.org/view/Release/Lithium/VTN/User_Guide/Openstack_Packstack_Support
1052 - http://devstack.org/guides/multinode-lab.html
1054 - https://wiki.opendaylight.org/view/File:Vtn_demo_hackfest_2014_march.pdf
1056 VTN Manager Usage Examples
1057 --------------------------
1059 How to provision virtual L2 Network
1060 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1065 This page explains how to provision virtual L2 network using VTN
1066 Manager. This page targets Boron release, so the procedure described
1067 here does not work in other releases.
1069 .. figure:: ./images/vtn/How_to_provision_virtual_L2_network.png
1070 :alt: Virtual L2 network for host1 and host3
1072 Virtual L2 network for host1 and host3
1080 - To provision OpenFlow switches, this page uses Mininet. Mininet
1081 details and set-up can be referred at the following page:
1082 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
1084 - Start Mininet and create three switches(s1, s2, and s3) and four
1085 hosts(h1, h2, h3, and h4) in it.
1089 mininet@mininet-vm:~$ sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
1093 Replace "192.168.0.100" with the IP address of OpenDaylight
1094 controller based on your environment.
1096 - you can check the topology that you have created by executing "net"
1097 command in the Mininet console.
1106 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3
1107 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
1108 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
1110 - In this guide, you will provision the virtual L2 network to establish
1111 communication between h1 and h3.
1116 To provision the virtual L2 network for the two hosts (h1 and h3),
1117 execute REST API provided by VTN Manager as follows. It uses curl
1118 command to call the REST API.
1120 - Create a virtual tenant named vtn1 by executing `the update-vtn
1121 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1125 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1127 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1129 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1133 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1"}}'
1135 - Create two interfaces into the virtual bridge by executing `the
1137 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1141 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1"}}'
1145 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2"}}'
1147 - Configure two mappings on the created interfaces by executing `the
1149 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1151 - The interface if1 of the virtual bridge will be mapped to the port
1152 "s2-eth1" of the switch "openflow:2" of the Mininet.
1154 - The h1 is connected to the port "s2-eth1".
1156 - The interface if2 of the virtual bridge will be mapped to the port
1157 "s3-eth1" of the switch "openflow:3" of the Mininet.
1159 - The h3 is connected to the port "s3-eth1".
1163 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:2", "port-name":"s2-eth1"}}'
1167 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth1"}}'
1172 - Please execute ping from h1 to h3 to verify if the virtual L2 network
1173 for h1 and h3 is provisioned successfully.
1178 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
1179 64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=243 ms
1180 64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.341 ms
1181 64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.078 ms
1182 64 bytes from 10.0.0.3: icmp_seq=4 ttl=64 time=0.079 ms
1184 - You can also verify the configuration by executing the following REST
1185 API. It shows all configuration in VTN Manager.
1189 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/
1191 - The result of the command should be like this.
1201 "idle-timeout": 300,
1217 "vinterface-status": {
1218 "entity-state": "UP",
1220 "mapped-port": "openflow:3:3"
1222 "vinterface-config": {
1225 "port-map-config": {
1227 "port-name": "s3-eth1",
1228 "node": "openflow:3"
1233 "vinterface-status": {
1234 "entity-state": "UP",
1236 "mapped-port": "openflow:2:1"
1238 "vinterface-config": {
1241 "port-map-config": {
1243 "port-name": "s2-eth1",
1244 "node": "openflow:2"
1258 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
1259 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
1263 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1265 How To Test Vlan-Map In Mininet Environment
1266 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1271 This page explains how to test Vlan-map in a multi host scenario using
1272 mininet. This page targets Boron release, so the procedure described
1273 here does not work in other releases.
1275 .. figure:: ./images/vtn/vlanmap_using_mininet.png
1276 :alt: Example that demonstrates vlanmap testing in Mininet Environment
1278 Example that demonstrates vlanmap testing in Mininet Environment
1283 Save the mininet script given below as vlan\_vtn\_test.py and run the
1284 mininet script in the mininet environment where Mininet is installed.
1289 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
1291 - Run the mininet script
1295 sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
1299 Replace "192.168.64.13" with the IP address of OpenDaylight
1300 controller based on your environment.
1302 - You can check the topology that you have created by executing "net"
1303 command in the Mininet console.
1308 h1 h1-eth0.200:s1-eth1
1309 h2 h2-eth0.300:s2-eth2
1310 h3 h3-eth0.200:s2-eth3
1311 h4 h4-eth0.300:s2-eth4
1312 h5 h5-eth0.200:s3-eth2
1313 h6 h6-eth0.300:s3-eth3
1314 s1 lo: s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
1315 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
1316 s3 lo: s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
1322 To test vlan-map, execute REST API provided by VTN Manager as follows.
1324 - Create a virtual tenant named vtn1 by executing `the update-vtn
1325 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1329 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1331 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1333 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1337 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
1339 - Configure a vlan map with vlanid 200 for vBridge vbr1 by executing
1341 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vlan-map.html#add-vlan-map>`__.
1345 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vlan-map:add-vlan-map -d '{"input":{"vlan-id":200,"tenant-name":"vtn1","bridge-name":"vbr1"}}'
1347 - Create a virtual bridge named vbr2 in the tenant vtn1 by executing
1349 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1353 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr2"}}'
1355 - Configure a vlan map with vlanid 300 for vBridge vbr2 by executing
1357 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vlan-map.html#add-vlan-map>`__.
1361 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vlan-map:add-vlan-map -d '{"input":{"vlan-id":300,"tenant-name":"vtn1","bridge-name":"vbr2"}}'
1366 - Please execute pingall in mininet environment to view the host
1372 Ping: testing ping reachability
1380 - You can also verify the configuration by executing the following REST
1381 API. It shows all configurations in VTN Manager.
1385 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1387 - The result of the command should be like this.
1398 "idle-timeout": 300,
1399 "description": "creating vtn"
1405 "age-interval": 600,
1406 "description": "creating vbr2"
1414 "map-id": "ANY.300",
1415 "vlan-map-config": {
1418 "vlan-map-status": {
1427 "age-interval": 600,
1428 "description": "creating vbr1"
1436 "map-id": "ANY.200",
1437 "vlan-map-config": {
1440 "vlan-map-status": {
1455 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
1456 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
1460 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1462 How To Configure Service Function Chaining using VTN Manager
1463 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1468 This page explains how to configure VTN Manager for Service Chaining.
1469 This page targets Boron release, so the procedure described here
1470 does not work in other releases.
1472 .. figure:: ./images/vtn/Service_Chaining_With_One_Service.png
1473 :alt: Service Chaining With One Service
1475 Service Chaining With One Service
1480 - Please refer to the `Installation
1481 Pages <https://wiki.opendaylight.org/view/VTN:Boron:Installation_Guide>`__
1482 to run ODL with VTN Feature enabled.
1484 - Please ensure Bridge-Utils package is installed in mininet
1485 environment before running the mininet script.
1487 - To install Bridge-Utils package run sudo apt-get install bridge-utils
1488 (assuming Ubuntu is used to run mininet, If not then this is not
1491 - Save the mininet script given below as topo\_handson.py and run the
1492 mininet script in the mininet environment where Mininet is installed.
1497 - `Script for emulating network with multiple
1498 hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet>`__.
1500 - Before executing the mininet script, please confirm Controller is up
1503 - Run the mininet script.
1505 - Replace <path> and <Controller IP> based on your environment
1509 sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
1514 h11 h11-eth0:s1-eth1
1515 h12 h12-eth0:s1-eth2
1516 h21 h21-eth0:s2-eth1
1517 h22 h22-eth0:s2-eth2
1518 h23 h23-eth0:s2-eth3
1519 srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
1520 srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
1521 s1 lo: s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
1522 s2 lo: s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
1523 s3 lo: s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
1524 s4 lo: s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
1532 - Please follow the below steps to configure the network in mininet as
1535 .. figure:: ./images/vtn/Mininet_Configuration.png
1536 :alt: Mininet Configuration
1538 Mininet Configuration
1540 Configure service nodes
1541 '''''''''''''''''''''''
1543 - Please execute the following commands in the mininet console where
1544 mininet script is executed.
1548 mininet> srvc1 ip addr del 10.0.0.6/8 dev srvc1-eth0
1549 mininet> srvc1 brctl addbr br0
1550 mininet> srvc1 brctl addif br0 srvc1-eth0
1551 mininet> srvc1 brctl addif br0 srvc1-eth1
1552 mininet> srvc1 ifconfig br0 up
1553 mininet> srvc1 tc qdisc add dev srvc1-eth1 root netem delay 200ms
1554 mininet> srvc2 ip addr del 10.0.0.7/8 dev srvc2-eth0
1555 mininet> srvc2 brctl addbr br0
1556 mininet> srvc2 brctl addif br0 srvc2-eth0
1557 mininet> srvc2 brctl addif br0 srvc2-eth1
1558 mininet> srvc2 ifconfig br0 up
1559 mininet> srvc2 tc qdisc add dev srvc2-eth1 root netem delay 300ms
1567 - Please execute the below commands to configure the network topology
1568 in the controller as in the below image:
1570 .. figure:: ./images/vtn/Tenant2.png
1575 Please execute the below commands in controller
1576 '''''''''''''''''''''''''''''''''''''''''''''''
1580 The below commands are for the difference in behavior of Manager in
1581 Boron topology. The Link below has the details for this bug:
1582 https://bugs.opendaylight.org/show_bug.cgi?id=3818.
1586 curl --user admin:admin -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X PUT http://localhost:8181/restconf/config/vtn-static-topology:vtn-static-topology/static-edge-ports -d '{"static-edge-ports": {"static-edge-port": [ {"port": "openflow:3:3"}, {"port": "openflow:3:4"}, {"port": "openflow:4:3"}, {"port": "openflow:4:4"}]}}'
1588 - Create a virtual tenant named vtn1 by executing `the update-vtn
1589 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1593 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1","update-mode":"CREATE","operation":"SET","description":"creating vtn","idle-timeout":300,"hard-timeout":0}}'
1595 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1597 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1601 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"creating vbr","tenant-name":"vtn1","bridge-name":"vbr1"}}'
1603 - Create interface if1 into the virtual bridge vbr1 by executing `the
1605 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1609 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif1 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
1611 - Configure port mapping on the interface by executing `the
1613 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1615 - The interface if1 of the virtual bridge will be mapped to the port
1616 "s1-eth2" of the switch "openflow:1" of the Mininet.
1618 - The h12 is connected to the port "s1-eth2".
1622 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","node":"openflow:1","port-name":"s1-eth2"}}'
1624 - Create interface if2 into the virtual bridge vbr1 by executing `the
1626 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1630 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif2 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
1632 - Configure port mapping on the interface by executing `the
1634 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1636 - The interface if2 of the virtual bridge will be mapped to the port
1637 "s2-eth2" of the switch "openflow:2" of the Mininet.
1639 - The h22 is connected to the port "s2-eth2".
1643 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2","node":"openflow:2","port-name":"s2-eth2"}}'
1645 - Create interface if3 into the virtual bridge vbr1 by executing `the
1647 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1651 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif3 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if3"}}'
1653 - Configure port mapping on the interfaces by executing `the
1655 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1657 - The interface if3 of the virtual bridge will be mapped to the port
1658 "s2-eth3" of the switch "openflow:2" of the Mininet.
1660 - The h23 is connected to the port "s2-eth3".
1664 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if3","node":"openflow:2","port-name":"s2-eth3"}}'
1669 - Create flowcondition named cond\_1 by executing `the
1671 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1673 - For option source and destination-network, get inet address of
1674 host h12(src) and h22(dst) from mininet.
1678 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"index":1,"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.2/32","destination-network":"10.0.0.4/32"}}]}}'
1680 - Flow filter demonstration with DROP action-type. Create Flowfilter in
1681 VBR Interface if1 by executing `the set-flow-filter
1682 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1686 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","index":10,"vtn-drop-filter":{}}]}}'
1694 - Please execute the below commands to configure the network topology
1695 which sends some specific traffic via a single service(External
1696 device) in the controller as in the below image:
1698 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_LLD.png
1699 :alt: Service Chaining With One Service LLD
1701 Service Chaining With One Service LLD
1703 - Create a virtual terminal named vt\_srvc1\_1 in the tenant vtn1 by
1704 executing `the update-vterminal
1705 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1709 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc1_1","description":"Creating vterminal"}}'
1711 - Create interface IF into the virtual terminal vt\_srvc1\_1 by
1712 executing `the update-vinterface
1713 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1717 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc1_1","interface-name":"IF"}}'
1719 - Configure port mapping on the interfaces by executing `the
1721 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1723 - The interface IF of the virtual terminal will be mapped to the
1724 port "s3-eth3" of the switch "openflow:3" of the Mininet.
1726 - The h12 is connected to the port "s3-eth3".
1730 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc1_1","interface-name":"IF","node":"openflow:3","port-name":"s3-eth3"}}'
1732 - Create a virtual terminal named vt\_srvc1\_2 in the tenant vtn1 by
1733 executing `the update-vterminal
1734 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1738 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","description":"Creating vterminal"}}'
1740 - Create interface IF into the virtual terminal vt\_srvc1\_2 by
1741 executing `the update-vinterface
1742 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1746 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF"}}'
1748 - Configure port mapping on the interfaces by executing `the
1750 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1752 - The interface IF of the virtual terminal will be mapped to the
1753 port "s4-eth3" of the switch "openflow:4" of the Mininet.
1755 - The h22 is connected to the port "s4-eth3".
1759 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","node":"openflow:4","port-name":"s4-eth3"}}'
1761 - Create flowcondition named cond\_1 by executing `the
1763 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1765 - For option source and destination-network, get inet address of
1766 host h12(src) and h22(dst) from mininet.
1770 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"index":1,"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.2/32","destination-network":"10.0.0.4/32"}}]}}'
1772 - Create flowcondition named cond\_any by executing `the
1774 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1778 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_any","vtn-flow-match":[{"index":1}]}}'
1780 - Flow filter demonstration with redirect action-type. Create
1781 Flowfilter in virtual terminal vt\_srvc1\_2 interface IF by executing
1782 `the set-flow-filter
1783 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1785 - Flowfilter redirects vt\_srvc1\_2 to bridge1-IF2
1789 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"bridge-name":"vbr1","interface-name":"if2"},"output":"true"}}]}}'
1791 - Flow filter demonstration with redirect action-type. Create
1792 Flowfilter in vbridge vbr1 interface if1 by executing `the
1794 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1796 - Flow filter redirects Bridge1-IF1 to vt\_srvc1\_1
1800 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","index":10,"vtn-redirect-filter":{"redirect-destination":{"terminal-name":"vt_srvc1_1","interface-name":"IF"},"output":"true"}}]}}'
1805 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_Verification.png
1806 :alt: Service Chaining With One Service
1808 Service Chaining With One Service
1810 - Ping host12 to host22 to view the host rechability, a delay of 200ms
1811 will be taken to reach host22 as below.
1815 mininet> h12 ping h22
1816 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1817 64 bytes from 10.0.0.4: icmp_seq=35 ttl=64 time=209 ms
1818 64 bytes from 10.0.0.4: icmp_seq=36 ttl=64 time=201 ms
1819 64 bytes from 10.0.0.4: icmp_seq=37 ttl=64 time=200 ms
1820 64 bytes from 10.0.0.4: icmp_seq=38 ttl=64 time=200 ms
1825 - Please execute the below commands to configure the network topology
1826 which sends some specific traffic via two services(External device)
1827 in the controller as in the below image.
1829 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services_LLD.png
1830 :alt: Service Chaining With Two Services LLD
1832 Service Chaining With Two Services LLD
1834 - Create a virtual terminal named vt\_srvc2\_1 in the tenant vtn1 by
1835 executing `the update-vterminal
1836 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1840 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc2_1","description":"Creating vterminal"}}'
1842 - Create interface IF into the virtual terminal vt\_srvc2\_1 by
1843 executing `the update-vinterface
1844 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1848 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc2_1","interface-name":"IF"}}'
1850 - Configure port mapping on the interfaces by executing `the
1852 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1854 - The interface IF of the virtual terminal will be mapped to the
1855 port "s3-eth4" of the switch "openflow:3" of the Mininet.
1857 - The host h12 is connected to the port "s3-eth4".
1861 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc2_1","interface-name":"IF","node":"openflow:3","port-name":"s3-eth4"}}'
1863 - Create a virtual terminal named vt\_srvc2\_2 in the tenant vtn1 by
1864 executing `the update-vterminal
1865 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1869 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","description":"Creating vterminal"}}'
1871 - Create interfaces IF into the virtual terminal vt\_srvc2\_2 by
1872 executing `the update-vinterface
1873 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1877 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF"}}'
1879 - Configure port mapping on the interfaces by executing `the
1881 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1883 - The interface IF of the virtual terminal will be mapped to the
1884 port "s4-eth4" of the switch "openflow:4" of the mininet.
1886 - The host h22 is connected to the port "s4-eth4".
1890 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF","node":"openflow:4","port-name":"s4-eth4"}}'
1892 - Flow filter demonstration with redirect action-type. Create
1893 Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1894 `the set-flow-filter
1895 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1897 - Flow filter redirects vt\_srvc2\_2 to Bridge1-IF2.
1901 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"bridge-name":"vbr1","interface-name":"if2"},"output":"true"}}]}}'
1903 - Flow filter demonstration with redirect action-type. Create
1904 Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1905 `the set-flow-filter
1906 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1908 - Flow filter redirects vt\_srvc1\_2 to vt\_srvc2\_1.
1912 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"terminal-name":"vt_srvc2_1","interface-name":"IF"},"output":"true"}}]}}'
1917 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services.png
1918 :alt: Service Chaining With Two Service
1920 Service Chaining With Two Service
1922 - Ping host12 to host22 to view the host rechability, a delay of 500ms
1923 will be taken to reach host22 as below.
1927 mininet> h12 ping h22
1928 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1929 64 bytes from 10.0.0.4: icmp_seq=1 ttl=64 time=512 ms
1930 64 bytes from 10.0.0.4: icmp_seq=2 ttl=64 time=501 ms
1931 64 bytes from 10.0.0.4: icmp_seq=3 ttl=64 time=500 ms
1932 64 bytes from 10.0.0.4: icmp_seq=4 ttl=64 time=500 ms
1934 - You can verify the configuration by executing the following REST API.
1935 It shows all configuration in VTN Manager.
1939 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1949 "idle-timeout": 300,
1950 "description": "creating vtn"
1956 "age-interval": 600,
1957 "description": "creating vbr"
1966 "vinterface-status": {
1967 "mapped-port": "openflow:1:2",
1969 "entity-state": "UP"
1971 "port-map-config": {
1973 "node": "openflow:1",
1974 "port-name": "s1-eth2"
1976 "vinterface-config": {
1977 "description": "Creating vbrif1 interface",
1980 "vinterface-input-filter": {
1981 "vtn-flow-filter": [
1984 "condition": "cond_1",
1985 "vtn-redirect-filter": {
1987 "redirect-destination": {
1988 "terminal-name": "vt_srvc1_1",
1989 "interface-name": "IF"
1998 "vinterface-status": {
1999 "mapped-port": "openflow:2:2",
2001 "entity-state": "UP"
2003 "port-map-config": {
2005 "node": "openflow:2",
2006 "port-name": "s2-eth2"
2008 "vinterface-config": {
2009 "description": "Creating vbrif2 interface",
2015 "vinterface-status": {
2016 "mapped-port": "openflow:2:3",
2018 "entity-state": "UP"
2020 "port-map-config": {
2022 "node": "openflow:2",
2023 "port-name": "s2-eth3"
2025 "vinterface-config": {
2026 "description": "Creating vbrif3 interface",
2035 "name": "vt_srvc2_2",
2043 "vinterface-status": {
2044 "mapped-port": "openflow:4:4",
2046 "entity-state": "UP"
2048 "port-map-config": {
2050 "node": "openflow:4",
2051 "port-name": "s4-eth4"
2053 "vinterface-config": {
2054 "description": "Creating vterminal IF",
2057 "vinterface-input-filter": {
2058 "vtn-flow-filter": [
2061 "condition": "cond_any",
2062 "vtn-redirect-filter": {
2064 "redirect-destination": {
2065 "bridge-name": "vbr1",
2066 "interface-name": "if2"
2074 "vterminal-config": {
2075 "description": "Creating vterminal"
2079 "name": "vt_srvc1_1",
2087 "vinterface-status": {
2088 "mapped-port": "openflow:3:3",
2090 "entity-state": "UP"
2092 "port-map-config": {
2094 "node": "openflow:3",
2095 "port-name": "s3-eth3"
2097 "vinterface-config": {
2098 "description": "Creating vterminal IF",
2103 "vterminal-config": {
2104 "description": "Creating vterminal"
2108 "name": "vt_srvc1_2",
2116 "vinterface-status": {
2117 "mapped-port": "openflow:4:3",
2119 "entity-state": "UP"
2121 "port-map-config": {
2123 "node": "openflow:4",
2124 "port-name": "s4-eth3"
2126 "vinterface-config": {
2127 "description": "Creating vterminal IF",
2130 "vinterface-input-filter": {
2131 "vtn-flow-filter": [
2134 "condition": "cond_any",
2135 "vtn-redirect-filter": {
2137 "redirect-destination": {
2138 "terminal-name": "vt_srvc2_1",
2139 "interface-name": "IF"
2147 "vterminal-config": {
2148 "description": "Creating vterminal"
2152 "name": "vt_srvc2_1",
2160 "vinterface-status": {
2161 "mapped-port": "openflow:3:4",
2163 "entity-state": "UP"
2165 "port-map-config": {
2167 "node": "openflow:3",
2168 "port-name": "s3-eth4"
2170 "vinterface-config": {
2171 "description": "Creating vterminal IF",
2176 "vterminal-config": {
2177 "description": "Creating vterminal"
2188 - To clean up both VTN and flowconditions.
2190 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
2191 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2195 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2197 - You can delete the flowcondition cond\_1 and cond\_any by executing
2198 `the remove-flow-condition
2199 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
2203 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
2207 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_any"}}'
2209 How To View Dataflows
2210 ~~~~~~~~~~~~~~~~~~~~~
2215 This page explains how to view Dataflows using VTN Manager. This page
2216 targets Boron release, so the procedure described here does not work
2219 Dataflow feature enables retrieval and display of data flows in the
2220 OpenFlow network. The data flows can be retrieved based on an OpenFlow
2221 switch or a switch port or a L2 source host.
2223 The flow information provided by this feature are
2225 - Location of virtual node which maps the incoming packet and outgoing
2228 - Location of physical switch port where incoming and outgoing packets
2229 is sent and received.
2231 - A sequence of physical route info which represents the packet route
2232 in the physical network.
2237 - To view Dataflow information, configure with VLAN Mapping
2238 https://wiki.opendaylight.org/view/VTN:Mananger:How_to_test_Vlan-map_using_mininet.
2243 After creating vlan mapping configuration from the above page, execute
2244 as below in mininet to get switch details.
2249 h1 h1-eth0.200:s1-eth1
2250 h2 h2-eth0.300:s2-eth2
2251 h3 h3-eth0.200:s2-eth3
2252 h4 h4-eth0.300:s2-eth4
2253 h5 h5-eth0.200:s3-eth2
2254 h6 h6-eth0.300:s3-eth3
2255 s1 lo: s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
2256 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
2257 s3 lo: s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
2261 Please execute ping from h1 to h3 to check hosts reachability.
2266 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2267 64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=11.4 ms
2268 64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.654 ms
2269 64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.093 ms
2271 Parallely execute below Restconf command to get data flow information of
2272 node "openflow:1" and its port "s1-eth1".
2274 - Get the Dataflows information by executing `the get-data-flow
2275 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow.html#get-data-flow>`__.
2279 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow:get-data-flow -d '{"input":{"tenant-name":"vtn1","mode":"DETAIL","node":"openflow:1","data-flow-port":{"port-id":"1","port-name":"s1-eth1"}}}'
2287 "averaged-data-flow-stats": {
2288 "packet-count": 1.1998800119988002,
2289 "start-time": 1455241209151,
2290 "end-time": 1455241219152,
2291 "byte-count": 117.58824117588242
2295 "physical-ingress-port": {
2296 "port-name": "s2-eth3",
2299 "physical-egress-port": {
2300 "port-name": "s2-eth1",
2303 "node": "openflow:2",
2307 "physical-ingress-port": {
2308 "port-name": "s1-eth2",
2311 "physical-egress-port": {
2312 "port-name": "s1-eth1",
2315 "node": "openflow:1",
2319 "data-egress-node": {
2320 "bridge-name": "vbr1",
2321 "tenant-name": "vtn1"
2324 "idle-timeout": 300,
2325 "data-flow-stats": {
2327 "nanosecond": 640000000,
2330 "packet-count": 134,
2333 "data-egress-port": {
2334 "node": "openflow:1",
2335 "port-name": "s1-eth1",
2338 "data-ingress-node": {
2339 "bridge-name": "vbr1",
2340 "tenant-name": "vtn1"
2342 "data-ingress-port": {
2343 "node": "openflow:2",
2344 "port-name": "s2-eth3",
2347 "creation-time": 1455240855753,
2348 "data-flow-match": {
2349 "vtn-ether-match": {
2351 "source-address": "6a:ff:e2:81:86:bb",
2352 "destination-address": "26:9f:82:70:ec:66"
2357 "reason": "VLANMAPPED",
2358 "virtual-node-path": {
2359 "bridge-name": "vbr1",
2360 "tenant-name": "vtn1"
2365 "reason": "FORWARDED",
2366 "virtual-node-path": {
2367 "bridge-name": "vbr1",
2368 "tenant-name": "vtn1"
2376 "averaged-data-flow-stats": {
2377 "packet-count": 1.1998800119988002,
2378 "start-time": 1455241209151,
2379 "end-time": 1455241219152,
2380 "byte-count": 117.58824117588242
2384 "physical-ingress-port": {
2385 "port-name": "s1-eth1",
2388 "physical-egress-port": {
2389 "port-name": "s1-eth2",
2392 "node": "openflow:1",
2396 "physical-ingress-port": {
2397 "port-name": "s2-eth1",
2400 "physical-egress-port": {
2401 "port-name": "s2-eth3",
2404 "node": "openflow:2",
2408 "data-egress-node": {
2409 "bridge-name": "vbr1",
2410 "tenant-name": "vtn1"
2413 "idle-timeout": 300,
2414 "data-flow-stats": {
2416 "nanosecond": 587000000,
2419 "packet-count": 134,
2422 "data-egress-port": {
2423 "node": "openflow:2",
2424 "port-name": "s2-eth3",
2427 "data-ingress-node": {
2428 "bridge-name": "vbr1",
2429 "tenant-name": "vtn1"
2431 "data-ingress-port": {
2432 "node": "openflow:1",
2433 "port-name": "s1-eth1",
2436 "creation-time": 1455240855747,
2437 "data-flow-match": {
2438 "vtn-ether-match": {
2440 "source-address": "26:9f:82:70:ec:66",
2441 "destination-address": "6a:ff:e2:81:86:bb"
2446 "reason": "VLANMAPPED",
2447 "virtual-node-path": {
2448 "bridge-name": "vbr1",
2449 "tenant-name": "vtn1"
2454 "reason": "FORWARDED",
2455 "virtual-node-path": {
2456 "bridge-name": "vbr1",
2457 "tenant-name": "vtn1"
2468 How To Create Mac Map In VTN
2469 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2474 - This page demonstrates Mac Mapping. This demonstration aims at
2475 enabling communication between two hosts and denying communication of
2476 particular host by associating a Vbridge to the hosts and configuring
2477 Mac Mapping (mac address) to the Vbridge.
2479 - This page targets Boron release, so the procedure described here
2480 does not work in other releases.
2482 .. figure:: ./images/vtn/Single_Controller_Mapping.png
2483 :alt: Single Controller Mapping
2485 Single Controller Mapping
2490 Configure mininet and create a topology
2491 '''''''''''''''''''''''''''''''''''''''
2493 - `Script for emulating network with multiple
2494 hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_Multiple_Hosts_for_Service_Function_Chain>`__.
2496 - Before executing the mininet script, please confirm Controller is up
2499 - Run the mininet script.
2501 - Replace <path> and <Controller IP> based on your environment.
2505 sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
2510 h11 h11-eth0:s1-eth1
2511 h12 h12-eth0:s1-eth2
2512 h21 h21-eth0:s2-eth1
2513 h22 h22-eth0:s2-eth2
2514 h23 h23-eth0:s2-eth3
2515 srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
2516 srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
2517 s1 lo: s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
2518 s2 lo: s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
2519 s3 lo: s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
2520 s4 lo: s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
2525 To create Mac Map in VTN, execute REST API provided by VTN Manager as
2526 follows. It uses curl command to call REST API.
2528 - Create a virtual tenant named Tenant1 by executing `the update-vtn
2529 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
2533 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2535 - Create a virtual bridge named vBridge1 in the tenant Tenant1 by
2536 executing `the update-vbridge
2537 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
2541 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"Tenant1","bridge-name":"vBridge1"}}'
2543 - Configuring Mac Mappings on the vBridge1 by giving the mac address of
2544 host h12 and host h22 as follows to allow the communication by
2545 executing `the set-mac-map
2546 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-mac-map.html#set-mac-map>`__.
2550 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-mac-map:set-mac-map -d '{"input":{"operation":"SET","allowed-hosts":["de:05:40:c4:96:76@0","62:c5:33:bc:d7:4e@0"],"tenant-name":"Tenant1","bridge-name":"vBridge1"}}'
2554 Mac Address of host h12 and host h22 can be obtained with the
2555 following command in mininet.
2559 mininet> h12 ifconfig
2560 h12-eth0 Link encap:Ethernet HWaddr 62:c5:33:bc:d7:4e
2561 inet addr:10.0.0.2 Bcast:10.255.255.255 Mask:255.0.0.0
2562 inet6 addr: fe80::60c5:33ff:febc:d74e/64 Scope:Link
2566 mininet> h22 ifconfig
2567 h22-eth0 Link encap:Ethernet HWaddr de:05:40:c4:96:76
2568 inet addr:10.0.0.4 Bcast:10.255.255.255 Mask:255.0.0.0
2569 inet6 addr: fe80::dc05:40ff:fec4:9676/64 Scope:Link
2571 - MAC Mapping will not be activated just by configuring it, a two end
2572 communication needs to be established to activate Mac Mapping.
2574 - Ping host h22 from host h12 in mininet, the ping will not happen
2575 between the hosts as only one way activation is enabled.
2579 mininet> h12 ping h22
2580 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2581 From 10.0.0.2 icmp_seq=1 Destination Host Unreachable
2582 From 10.0.0.2 icmp_seq=2 Destination Host Unreachable
2584 - Ping host h12 from host h22 in mininet, now the ping communication
2585 will take place as the two end communication is enabled.
2589 mininet> h22 ping h12
2590 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
2591 64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=91.8 ms
2592 64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.510 ms
2594 - After two end communication enabled, now host h12 can ping host h22
2598 mininet> h12 ping h22
2599 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2600 64 bytes from 10.0.0.4: icmp_req=1 ttl=64 time=0.780 ms
2601 64 bytes from 10.0.0.4: icmp_req=2 ttl=64 time=0.079 ms
2606 - To view the configured Mac Map of allowed host execute the following
2611 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/Tenant1/vbridge/vBridge1/mac-map
2620 "mac-address": "c6:44:22:ba:3e:72",
2622 "port-id": "openflow:1:2"
2625 "mac-address": "f6:e0:43:b6:3a:b7",
2627 "port-id": "openflow:2:2"
2633 "vlan-host-desc-list": [
2635 "host": "c6:44:22:ba:3e:72@0"
2638 "host": "f6:e0:43:b6:3a:b7@0"
2648 When Deny is configured a broadcast message is sent to all the hosts
2649 connected to the vBridge, so a two end communication need not be
2650 establihed like allow, the hosts can communicate directly without
2651 any two way communication enabled.
2653 1. To Deny host h23 communication from hosts connected on vBridge1, the
2654 following configuration can be applied.
2658 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-mac-map:set-mac-map -d '{"input":{"operation": "SET", "denied-hosts": ["0a:d3:ea:3d:8f:a5@0"],"tenant-name": "Tenant1","bridge-name": "vBridge1"}}'
2663 - You can delete the virtual tenant Tenant1 by executing `the
2665 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2669 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2671 How To Configure Flowfilters
2672 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2677 - This page explains how to provision flowfilter using VTN Manager.
2678 This page targets Boron release, so the procedure described here
2679 does not work in other releases.
2681 - The flow-filter function discards, permits, or redirects packets of
2682 the traffic within a VTN, according to specified flow conditions. The
2683 table below lists the actions to be applied when a packet matches the
2686 +-----------------------+----------------------------------------------------+
2687 | Action | Function |
2688 +=======================+====================================================+
2689 | Pass | | Permits the packet to pass along the determined |
2691 | | | As options, packet transfer priority (set |
2692 | | priority) and DSCP change (set ip-dscp) is |
2694 +-----------------------+----------------------------------------------------+
2695 | Drop | Discards the packet. |
2696 +-----------------------+----------------------------------------------------+
2697 | Redirect | | Redirects the packet to a desired virtual |
2699 | | | As an option, it is possible to change the MAC |
2700 | | address when the packet is transferred. |
2701 +-----------------------+----------------------------------------------------+
2703 .. figure:: ./images/vtn/flow_filter_example.png
2704 :alt: Flow Filter Example
2708 - Following steps explain flow-filter function:
2710 - when a packet is transferred to an interface within a virtual
2711 network, the flow-filter function evaluates whether the
2712 transferred packet matches the condition specifed in the
2715 - If the packet matches the condition, the flow-filter applies the
2716 flow-list matching action specified in the flow-filter.
2721 To apply the packet filter, configure the following:
2723 - Create a flow condition.
2725 - Specify where to apply the flow-filter, for example VTN, vBridge, or
2726 interface of vBridge.
2728 To provision OpenFlow switches, this page uses Mininet. Mininet details
2729 and set-up can be referred at the below page:
2730 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
2732 Start Mininet, and create three switches (s1, s2, and s3) and four hosts
2733 (h1, h2, h3 and h4) in it.
2737 sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
2741 Replace "192.168.0.100" with the IP address of OpenDaylight
2742 controller based on your environment.
2744 You can check the topology that you have created by executing "net"
2745 command in the Mininet console.
2754 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3
2755 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
2756 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
2758 In this guide, you will provision flowfilters to establish communication
2764 To provision the virtual L2 network for the two hosts (h1 and h3),
2765 execute REST API provided by VTN Manager as follows. It uses curl
2766 command to call the REST API.
2768 - Create a virtual tenant named vtn1 by executing `the update-vtn
2769 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
2773 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2775 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
2777 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
2781 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
2783 - Create two interfaces into the virtual bridge by executing `the
2785 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
2789 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
2793 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
2795 - Configure two mappings on the interfaces by executing `the
2797 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
2799 - The interface if1 of the virtual bridge will be mapped to the port
2800 "s2-eth1" of the switch "openflow:2" of the Mininet.
2802 - The h1 is connected to the port "s2-eth1".
2804 - The interface if2 of the virtual bridge will be mapped to the port
2805 "s3-eth1" of the switch "openflow:3" of the Mininet.
2807 - The h3 is connected to the port "s3-eth1".
2811 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:2", "port-name":"s2-eth1"}}'
2815 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth1"}}'
2817 - Create flowcondition named cond\_1 by executing `the
2819 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
2821 - For option source and destination-network, get inet address of
2822 host h1 and h3 from mininet.
2826 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.3/32"},"index":"1"}]}}'
2828 - Flowfilter can be applied either in VTN, VBR or VBR Interfaces. Here
2829 in this page we provision flowfilter with VBR Interface and
2830 demonstrate with action type drop and then pass.
2832 - Flow filter demonstration with DROP action-type. Create Flowfilter in
2833 VBR Interface if1 by executing `the set-flow-filter
2834 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
2838 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input": {"tenant-name": "vtn1", "bridge-name": "vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","vtn-drop-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]}}'
2840 Verification of the drop filter
2841 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2843 - Please execute ping from h1 to h3. As we have applied the action type
2844 "drop" , ping should fail with no packet flows between hosts h1 and
2851 Configuration for pass filter
2852 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2854 - Update the flow filter to pass the packets by executing `the
2856 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
2860 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input": {"tenant-name": "vtn1", "bridge-name": "vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]}}'
2862 Verification For Packets Success
2863 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2865 - As we have applied action type PASS now ping should happen between
2871 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2872 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
2873 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
2874 64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
2876 - You can also verify the configurations by executing the following
2877 REST API. It shows all configuration in VTN Manager.
2881 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/vtn1
2891 "idle-timeout": 300,
2892 "description": "creating vtn"
2898 "age-interval": 600,
2899 "description": "creating vBridge1"
2908 "vinterface-status": {
2909 "mapped-port": "openflow:2:1",
2911 "entity-state": "UP"
2913 "port-map-config": {
2915 "node": "openflow:2",
2916 "port-name": "s2-eth1"
2918 "vinterface-config": {
2919 "description": "Creating if1 interface",
2922 "vinterface-input-filter": {
2923 "vtn-flow-filter": [
2926 "condition": "cond_1",
2927 "vtn-flow-action": [
2930 "vtn-set-inet-src-action": {
2931 "ipv4-address": "10.0.0.1/32"
2936 "vtn-set-inet-dst-action": {
2937 "ipv4-address": "10.0.0.3/32"
2941 "vtn-pass-filter": {}
2945 "condition": "cond_1",
2946 "vtn-drop-filter": {}
2953 "vinterface-status": {
2954 "mapped-port": "openflow:3:1",
2956 "entity-state": "UP"
2958 "port-map-config": {
2960 "node": "openflow:3",
2961 "port-name": "s3-eth1"
2963 "vinterface-config": {
2964 "description": "Creating if2 interface",
2978 - To clean up both VTN and flowcondition.
2980 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
2981 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2985 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2987 - You can delete the flowcondition cond\_1 by executing `the
2988 remove-flow-condition
2989 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
2993 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
2995 How to use VTN to change the path of the packet flow
2996 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3001 - This page explains how to create specific VTN Pathmap using VTN
3002 Manager. This page targets Boron release, so the procedure
3003 described here does not work in other releases.
3005 .. figure:: ./images/vtn/Pathmap.png
3013 - Save the mininet script given below as pathmap\_test.py and run the
3014 mininet script in the mininet environment where Mininet is installed.
3016 - Create topology using the below mininet script:
3020 from mininet.topo import Topo
3021 class MyTopo( Topo ):
3022 "Simple topology example."
3023 def __init__( self ):
3024 "Create custom topo."
3025 # Initialize topology
3026 Topo.__init__( self )
3027 # Add hosts and switches
3028 leftHost = self.addHost( 'h1' )
3029 rightHost = self.addHost( 'h2' )
3030 leftSwitch = self.addSwitch( 's1' )
3031 middleSwitch = self.addSwitch( 's2' )
3032 middleSwitch2 = self.addSwitch( 's4' )
3033 rightSwitch = self.addSwitch( 's3' )
3035 self.addLink( leftHost, leftSwitch )
3036 self.addLink( leftSwitch, middleSwitch )
3037 self.addLink( leftSwitch, middleSwitch2 )
3038 self.addLink( middleSwitch, rightSwitch )
3039 self.addLink( middleSwitch2, rightSwitch )
3040 self.addLink( rightSwitch, rightHost )
3041 topos = { 'mytopo': ( lambda: MyTopo() ) }
3043 - After creating new file with the above script start the mininet as
3048 sudo mn --controller=remote,ip=10.106.138.124 --custom pathmap_test.py --topo mytopo
3052 Replace "10.106.138.124" with the IP address of OpenDaylight
3053 controller based on your environment.
3060 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
3061 s2 lo: s2-eth1:s1-eth2 s2-eth2:s3-eth1
3062 s3 lo: s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
3063 s4 lo: s4-eth1:s1-eth3 s4-eth2:s3-eth2
3066 - Generate traffic by pinging between host h1 and host h2 before
3067 creating the portmaps respectively.
3072 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3073 From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
3074 From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
3075 From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
3076 From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
3081 - To change the path of the packet flow, execute REST API provided by
3082 VTN Manager as follows. It uses curl command to call the REST API.
3084 - Create a virtual tenant named vtn1 by executing `the update-vtn
3085 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
3089 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3091 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
3093 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
3097 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
3099 - Create two interfaces into the virtual bridge by executing `the
3101 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
3105 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
3109 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
3111 - Configure two mappings on the interfaces by executing `the
3113 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
3115 - The interface if1 of the virtual bridge will be mapped to the port
3116 "s2-eth1" of the switch "openflow:1" of the Mininet.
3118 - The h1 is connected to the port "s1-eth1".
3120 - The interface if2 of the virtual bridge will be mapped to the port
3121 "s3-eth1" of the switch "openflow:3" of the Mininet.
3123 - The h3 is connected to the port "s3-eth3".
3127 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:1", "port-name":"s1-eth1"}}'
3131 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth3"}}'
3133 - Genarate traffic by pinging between host h1 and host h2 after
3134 creating the portmaps respectively.
3139 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3140 64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.861 ms
3141 64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.101 ms
3142 64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.101 ms
3144 - Get the Dataflows information by executing `the get-data-flow
3145 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow.html#get-data-flow>`__.
3149 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow:get-data-flow -d '{"input":{"tenant-name":"vtn1","mode":"DETAIL","node":"openflow:1","data-flow-port":{"port-id":1,"port-name":"s1-eth1"}}}'
3151 - Create flowcondition named cond\_1 by executing `the
3153 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
3155 - For option source and destination-network, get inet address of
3156 host h1 or host h2 from mininet
3160 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.2/32"},"index":"1"}]}}'
3162 - Create pathmap with flowcondition cond\_1 by executing `the
3164 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-path-map.html#set-path-map>`__.
3168 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-map:set-path-map -d '{"input":{"tenant-name":"vtn1","path-map-list":[{"condition":"cond_1","policy":"1","index": "1","idle-timeout":"300","hard-timeout":"0"}]}}'
3170 - Create pathpolicy by executing `the set-path-policy
3171 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-path-policy.html#set-path-policy>`__.
3175 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-policy:set-path-policy -d '{"input":{"operation":"SET","id": "1","default-cost": "10000","vtn-path-cost": [{"port-desc":"openflow:1,3,s1-eth3","cost":"1000"},{"port-desc":"openflow:4,2,s4-eth2","cost":"1000"},{"port-desc":"openflow:3,3,s3-eth3","cost":"100000"}]}}'
3180 - Before applying Path policy get node information by executing get
3189 "physical-ingress-port": {
3190 "port-name": "s3-eth3",
3193 "physical-egress-port": {
3194 "port-name": "s3-eth1",
3197 "node": "openflow:3",
3201 "physical-ingress-port": {
3202 "port-name": "s2-eth2",
3205 "physical-egress-port": {
3206 "port-name": "s2-eth1",
3209 "node": "openflow:2",
3213 "physical-ingress-port": {
3214 "port-name": "s1-eth2",
3217 "physical-egress-port": {
3218 "port-name": "s1-eth1",
3221 "node": "openflow:1",
3225 "data-egress-node": {
3226 "interface-name": "if1",
3227 "bridge-name": "vbr1",
3228 "tenant-name": "vtn1"
3230 "data-egress-port": {
3231 "node": "openflow:1",
3232 "port-name": "s1-eth1",
3235 "data-ingress-node": {
3236 "interface-name": "if2",
3237 "bridge-name": "vbr1",
3238 "tenant-name": "vtn1"
3240 "data-ingress-port": {
3241 "node": "openflow:3",
3242 "port-name": "s3-eth3",
3249 - After applying Path policy get node information by executing get
3258 "physical-ingress-port": {
3259 "port-name": "s1-eth1",
3262 "physical-egress-port": {
3263 "port-name": "s1-eth3",
3266 "node": "openflow:1",
3270 "physical-ingress-port": {
3271 "port-name": "s4-eth1",
3274 "physical-egress-port": {
3275 "port-name": "s4-eth2",
3278 "node": "openflow:4",
3282 "physical-ingress-port": {
3283 "port-name": "s3-eth2",
3286 "physical-egress-port": {
3287 "port-name": "s3-eth3",
3290 "node": "openflow:3",
3294 "data-egress-node": {
3295 "interface-name": "if2",
3296 "bridge-name": "vbr1",
3297 "tenant-name": "vtn1"
3299 "data-egress-port": {
3300 "node": "openflow:3",
3301 "port-name": "s3-eth3",
3304 "data-ingress-node": {
3305 "interface-name": "if1",
3306 "bridge-name": "vbr1",
3307 "tenant-name": "vtn1"
3309 "data-ingress-port": {
3310 "node": "openflow:1",
3311 "port-name": "s1-eth1",
3319 - To clean up both VTN and flowcondition.
3321 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
3322 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
3326 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3328 - You can delete the flowcondition cond\_1 by executing `the
3329 remove-flow-condition
3330 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
3334 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
3336 VTN Coordinator Usage Examples
3337 ------------------------------
3339 How to configure L2 Network with Single Controller
3340 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3345 This example provides the procedure to demonstrate configuration of VTN
3346 Coordinator with L2 network using VTN Virtualization(single controller).
3347 Here is the Example for vBridge Interface Mapping with Single Controller
3348 using mininet. mininet details and set-up can be referred at below URL:
3349 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
3351 .. figure:: ./images/vtn/vtn-single-controller-topology-example.png
3352 :alt: EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3354 EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3359 - Configure mininet and create a topology:
3363 mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3369 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1
3370 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0
3377 - Create a Controller named controllerone and mention its ip-address in
3378 the below create-controller command.
3382 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.0.0.2", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3384 - Create a VTN named vtn1 by executing the create-vtn command
3388 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3390 - Create a vBridge named vBridge1 in the vtn1 by executing the
3395 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3397 - Create two Interfaces named if1 and if2 into the vBridge1
3401 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3405 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3407 - Get the list of logical ports configured
3411 Curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/controllerone/domains/\(DEFAULT\)/logical_ports.json
3413 - Configure two mappings on each of the interfaces by executing the
3416 The interface if1 of the virtual bridge will be mapped to the port
3417 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3418 to the port "s2-eth1".
3420 The interface if2 of the virtual bridge will be mapped to the port
3421 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3422 to the port "s3-eth1".
3426 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
3427 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
3432 Please verify whether the Host1 and Host3 are pinging.
3434 - Send packets from Host1 to Host3
3439 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
3440 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.780 ms
3441 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.079 ms
3443 How to configure L2 Network with Multiple Controllers
3444 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3446 - This example provides the procedure to demonstrate configuration of
3447 VTN Coordinator with L2 network using VTN Virtualization Here is the
3448 Example for vBridge Interface Mapping with Multi-controller using
3451 .. figure:: ./images/vtn/MutiController_Example_diagram.png
3452 :alt: EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3454 EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3459 - Configure multiple controllers using the mininet script given below:
3460 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:Scripts:Mininet#Network_with_multiple_switches_and_OpenFlow_controllers
3465 - Create a VTN named vtn3 by executing the create-vtn command
3469 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn3"}}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3471 - Create two Controllers named odc1 and odc2 with its ip-address in the
3472 below create-controller command.
3476 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "odc1", "ipaddr":"10.100.9.52", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3480 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "odc2", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3482 - Create two vBridges in the VTN like, vBridge1 in Controller1 and
3483 vBridge2 in Controller2
3487 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr1","controller_id":"odc1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges.json
3491 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr2","controller_id":"odc2","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges.json
3493 - Create two Interfaces if1, if2 for the two vBridges vbr1 and vbr2.
3497 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
3501 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
3505 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
3509 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
3511 - Get the list of logical ports configured
3515 curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/odc1/domains/\(DEFAULT\)/logical_ports/detail.json
3517 - Create boundary and vLink for the two controllers
3521 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"boundary": {"boundary_id": "b1", "link": {"controller1_id": "odc1", "domain1_id": "(DEFAULT)", "logical_port1_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth3", "controller2_id": "odc2", "domain2_id": "(DEFAULT)", "logical_port2_id": "PP-OF:00:00:00:00:00:00:00:04-s4-eth3"}}}' http://127.0.0.1:8083/vtn-webapi/boundaries.json
3525 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vlink": {"vlk_name": "vlink1" , "vnode1_name": "vbr1", "if1_name":"if2", "vnode2_name": "vbr2", "if2_name": "if2", "boundary_map": {"boundary_id":"b1","vlan_id": "50"}}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vlinks.json
3527 - Configure two mappings on each of the interfaces by executing the
3530 The interface if1 of the vbr1 will be mapped to the port "s2-eth2" of
3531 the switch "openflow:2" of the Mininet. The h2 is connected to the port
3534 The interface if2 of the vbr2 will be mapped to the port "s5-eth2" of
3535 the switch "openflow:5" of the Mininet. The h6 is connected to the port
3540 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces/if1/portmap.json
3544 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:05-s5-eth2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces/if1/portmap.json
3549 Please verify whether Host h2 and Host h6 are pinging.
3551 - Send packets from h2 to h6
3559 PING 10.0.0.6 (10.0.0.3) 56(84) bytes of data.
3560 64 bytes from 10.0.0.6: icmp_req=1 ttl=64 time=0.780 ms
3561 64 bytes from 10.0.0.6: icmp_req=2 ttl=64 time=0.079 ms
3563 How To Test Vlan-Map In Mininet Environment
3564 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3569 This example explains how to test vlan-map in a multi host scenario.
3571 .. figure:: ./images/vtn/vlanmap_using_mininet.png
3572 :alt: Example that demonstrates vlanmap testing in Mininet Environment
3574 Example that demonstrates vlanmap testing in Mininet Environment
3579 - Save the mininet script given below as vlan\_vtn\_test.py and run the
3580 mininet script in the mininet environment where Mininet is installed.
3585 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
3587 - Run the mininet script
3591 sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
3596 Please follow the below steps to test a vlan map using mininet:
3598 - Create a Controller named controllerone and mention its ip-address in
3599 the below create-controller command.
3603 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.0.0.2", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers
3605 - Create a VTN named vtn1 by executing the create-vtn command
3609 curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3611 - Create a vBridge named vBridge1 in the vtn1 by executing the
3616 curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3618 - Create a vlan map with vlanid 200 for vBridge vBridge1
3622 curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vlanmap" : {"vlan_id": 200 }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/vlanmaps.json
3624 - Create a vBridge named vBridge2 in the vtn1 by executing the
3629 curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vbridge" : {"vbr_name":"vBridge2","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3631 - Create a vlan map with vlanid 300 for vBridge vBridge2
3635 curl -X POST -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' -d '{"vlanmap" : {"vlan_id": 300 }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge2/vlanmaps.json
3640 Ping all in mininet environment to view the host reachability.
3645 Ping: testing ping reachability
3653 How To View Specific VTN Station Information.
3654 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3656 This example demonstrates on how to view a specific VTN Station
3659 .. figure:: ./images/vtn/vtn_stations.png
3660 :alt: EXAMPLE DEMONSTRATING VTN STATIONS
3662 EXAMPLE DEMONSTRATING VTN STATIONS
3667 - Configure mininet and create a topology:
3671 $ sudo mn --custom /home/mininet/mininet/custom/topo-2sw-2host.py --controller=remote,ip=10.100.9.61 --topo mytopo
3674 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1
3675 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0
3679 - Generate traffic by pinging between hosts h1 and h2 after configuring
3680 the portmaps respectively
3685 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3686 64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=16.7 ms
3687 64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=13.2 ms
3692 - Create a Controller named controllerone and mention its ip-address in
3693 the below create-controller command
3697 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3699 - Create a VTN named vtn1 by executing the create-vtn command
3703 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3705 - Create a vBridge named vBridge1 in the vtn1 by executing the
3710 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3712 - Create two Interfaces named if1 and if2 into the vBridge1
3716 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3717 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3719 - Configure two mappings on each of the interfaces by executing the
3722 The interface if1 of the virtual bridge will be mapped to the port
3723 "s1-eth1" of the switch "openflow:1" of the Mininet. The h1 is connected
3724 to the port "s1-eth1".
3726 The interface if2 of the virtual bridge will be mapped to the port
3727 "s1-eth2" of the switch "openflow:1" of the Mininet. The h2 is connected
3728 to the port "s1-eth2".
3732 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
3733 curl -v --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth2"}}' http://17.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
3735 - Get the VTN stations information
3739 curl -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
3746 curl -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
3750 "domain_id": "(DEFAULT)",
3755 "macaddr": "b2c3.06b8.2dac",
3756 "no_vlan_id": "true",
3757 "port_name": "s2-eth2",
3758 "station_id": "178195618445172",
3759 "switch_id": "00:00:00:00:00:00:00:02",
3760 "vnode_name": "vBridge1",
3761 "vnode_type": "vbridge",
3765 "domain_id": "(DEFAULT)",
3770 "macaddr": "ce82.1b08.90cf",
3771 "no_vlan_id": "true",
3772 "port_name": "s1-eth1",
3773 "station_id": "206130278144207",
3774 "switch_id": "00:00:00:00:00:00:00:01",
3775 "vnode_name": "vBridge1",
3776 "vnode_type": "vbridge",
3782 How To View Dataflows in VTN
3783 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3785 This example demonstrates on how to view a specific VTN Dataflow
3791 The same Configuration as Vlan Mapping
3792 Example(\ https://wiki.opendaylight.org/view/VTN:Coordinator:Beryllium:HowTos:How_To_test_vlanmap_using_mininet)
3797 Get the VTN Dataflows information
3801 curl -X GET -H 'content-type: application/json' --user 'admin:adminpass' "http://127.0.0.1:8083/vtn-webapi/dataflows?controller_id=controllerone&srcmacaddr=924c.e4a3.a743&vlan_id=300&switch_id=openflow:2&port_name=s2-eth1"
3808 "controller_dataflows": [
3810 "controller_id": "controllerone",
3811 "controller_type": "odc",
3812 "egress_domain_id": "(DEFAULT)",
3813 "egress_port_name": "s3-eth3",
3814 "egress_station_id": "3",
3815 "egress_switch_id": "00:00:00:00:00:00:00:03",
3817 "ingress_domain_id": "(DEFAULT)",
3818 "ingress_port_name": "s2-eth2",
3819 "ingress_station_id": "2",
3820 "ingress_switch_id": "00:00:00:00:00:00:00:02",
3834 "in_port_name": "s2-eth2",
3835 "out_port_name": "s2-eth1",
3836 "switch_id": "00:00:00:00:00:00:00:02"
3839 "in_port_name": "s1-eth2",
3840 "out_port_name": "s1-eth3",
3841 "switch_id": "00:00:00:00:00:00:00:01"
3844 "in_port_name": "s3-eth1",
3845 "out_port_name": "s3-eth3",
3846 "switch_id": "00:00:00:00:00:00:00:03"
3856 How To Configure Flow Filters Using VTN
3857 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3862 The flow-filter function discards, permits, or redirects packets of the
3863 traffic within a VTN, according to specified flow conditions The table
3864 below lists the actions to be applied when a packet matches the
3867 +--------------------------------------+--------------------------------------+
3868 | Action | Function |
3869 +--------------------------------------+--------------------------------------+
3870 | Pass | Permits the packet to pass. As |
3871 | | options, packet transfer priority |
3872 | | (set priority) and DSCP change (se t |
3873 | | ip-dscp) is specified. |
3874 +--------------------------------------+--------------------------------------+
3875 | Drop | Discards the packet. |
3876 +--------------------------------------+--------------------------------------+
3877 | Redirect | Redirects the packet to a desired |
3878 | | virtual interface. As an option, it |
3879 | | is possible to change the MAC |
3880 | | address when the packet is |
3882 +--------------------------------------+--------------------------------------+
3884 .. figure:: ./images/vtn/flow_filter_example.png
3889 Following steps explain flow-filter function:
3891 - When a packet is transferred to an interface within a virtual
3892 network, the flow-filter function evaluates whether the transferred
3893 packet matches the condition specified in the flow-list.
3895 - If the packet matches the condition, the flow-filter applies the
3896 flow-list matching action specified in the flow-filter.
3901 To apply the packet filter, configure the following:
3903 - Create a flow-list and flow-listentry.
3905 - Specify where to apply the flow-filter, for example VTN, vBridge, or
3906 interface of vBridge.
3908 Configure mininet and create a topology:
3912 $ mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree
3914 Please generate the following topology
3918 $ mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3921 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3
3922 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
3923 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
3932 - Create a Controller named controller1 and mention its ip-address in
3933 the below create-controller command.
3937 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controller1", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers
3939 - Create a VTN named vtn\_one by executing the create-vtn command
3943 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn_one","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3945 - Create a vBridge named vbr\_two in the vtn1 by executing the
3950 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr_one^C"controller_id":"controller1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges.json
3951 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" :
3952 {"vbr_name":"vbr_two","controller_id":"controller1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges.json
3954 - Create two Interfaces named if1 and if2 into the vbr\_two
3958 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces.json
3959 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces.json
3961 - Get the list of logical ports configured
3965 curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/controllerone/domains/\(DEFAULT\)/logical_ports.json
3967 - Configure two mappings on each of the interfaces by executing the
3970 The interface if1 of the virtual bridge will be mapped to the port
3971 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3972 to the port "s2-eth1".
3974 The interface if2 of the virtual bridge will be mapped to the port
3975 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3976 to the port "s3-eth1".
3980 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if1/portmap.json
3981 curl -v --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if2/portmap.json
3987 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"flowlist": {"fl_name": "flowlist1", "ip_version":"IP"}}' http://127.0.0.1:8083/vtn-webapi/flowlists.json
3989 - Create Flowlistentry
3993 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"flowlistentry": {"seqnum": "233","macethertype": "0x8000","ipdstaddr": "10.0.0.3","ipdstaddrprefix": "2","ipsrcaddr": "10.0.0.2","ipsrcaddrprefix": "2","ipproto": "17","ipdscp": "55","icmptypenum":"232","icmpcodenum": "232"}}' http://127.0.0.1:8083/vtn-webapi/flowlists/flowlist1/flowlistentries.json
3995 - Create vBridge Interface Flowfilter
3999 curl --user admin:adminpass -X POST -H 'content-type: application/json' -d '{"flowfilter" : {"ff_type": "in"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if1/flowfilters.json
4001 Flow filter demonstration with DROP action-type
4002 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4006 curl --user admin:adminpass -X POST -H 'content-type: application/json' -d '{"flowfilterentry": {"seqnum": "233", "fl_name": "flowlist1", "action_type":"drop", "priority":"3", "dscp":"55" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if1/flowfilters/in/flowfilterentries.json
4011 As we have applied the action type "drop" , ping should fail.
4016 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4017 From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
4018 From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
4020 Flow filter demonstration with PASS action-type
4021 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4025 curl --user admin:adminpass -X PUT -H 'content-type: application/json' -d '{"flowfilterentry": {"seqnum": "233", "fl_name": "flowlist1", "action_type":"pass", "priority":"3", "dscp":"55" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn_one/vbridges/vbr_two/interfaces/if1/flowfilters/in/flowfilterentries/233.json
4033 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
4034 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
4035 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
4036 64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
4038 How To Use VTN To Make Packets Take Different Paths
4039 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4041 This example demonstrates on how to create a specific VTN Path Map
4044 .. figure:: ./images/vtn/Pathmap.png
4052 - Save the mininet script given below as pathmap\_test.py and run the
4053 mininet script in the mininet environment where Mininet is installed.
4055 - Create topology using the below mininet script:
4059 from mininet.topo import Topo
4060 class MyTopo( Topo ):
4061 "Simple topology example."
4062 def __init__( self ):
4063 "Create custom topo."
4064 # Initialize topology
4065 Topo.__init__( self )
4066 # Add hosts and switches
4067 leftHost = self.addHost( 'h1' )
4068 rightHost = self.addHost( 'h2' )
4069 leftSwitch = self.addSwitch( 's1' )
4070 middleSwitch = self.addSwitch( 's2' )
4071 middleSwitch2 = self.addSwitch( 's4' )
4072 rightSwitch = self.addSwitch( 's3' )
4074 self.addLink( leftHost, leftSwitch )
4075 self.addLink( leftSwitch, middleSwitch )
4076 self.addLink( leftSwitch, middleSwitch2 )
4077 self.addLink( middleSwitch, rightSwitch )
4078 self.addLink( middleSwitch2, rightSwitch )
4079 self.addLink( rightSwitch, rightHost )
4080 topos = { 'mytopo': ( lambda: MyTopo() ) }
4086 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
4087 s2 lo: s2-eth1:s1-eth2 s2-eth2:s3-eth1
4088 s3 lo: s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
4089 s4 lo: s4-eth1:s1-eth3 s4-eth2:s3-eth2
4093 - Generate traffic by pinging between hosts h1 and h2 before creating
4094 the portmaps respectively
4099 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4100 From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
4101 From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
4102 From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
4103 From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
4108 - Create a Controller named controller1 and mention its ip-address in
4109 the below create-controller command.
4113 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "odc", "ipaddr":"10.100.9.42", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
4115 - Create a VTN named vtn1 by executing the create-vtn command
4119 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
4121 - Create a vBridge named vBridge1 in the vtn1 by executing the
4126 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"odc","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
4128 - Create two Interfaces named if1 and if2 into the vBridge1
4132 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
4133 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
4135 - Configure two mappings on each of the interfaces by executing the
4138 The interface if1 of the virtual bridge will be mapped to the port
4139 "s1-eth1" of the switch "openflow:1" of the Mininet. The h1 is connected
4140 to the port "s1-eth1".
4142 The interface if2 of the virtual bridge will be mapped to the port
4143 "s3-eth3" of the switch "openflow:3" of the Mininet. The h2 is connected
4144 to the port "s3-eth3".
4148 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
4149 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth3"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
4151 - Generate traffic by pinging between hosts h1 and h2 after creating
4152 the portmaps respectively
4157 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
4158 64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=36.4 ms
4159 64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.880 ms
4160 64 bytes from 10.0.0.2: icmp_req=3 ttl=64 time=0.073 ms
4161 64 bytes from 10.0.0.2: icmp_req=4 ttl=64 time=0.081 ms
4163 - Get the VTN Dataflows information
4167 curl -X GET -H 'content-type: application/json' --user 'admin:adminpass' "http://127.0.0.1:8083/vtn-webapi/dataflows?&switch_id=00:00:00:00:00:00:00:01&port_name=s1-eth1&controller_id=odc&srcmacaddr=de3d.7dec.e4d2&no_vlan_id=true"
4169 - Create a Flowcondition in the VTN
4171 **(The flowconditions, pathmap and pathpolicy commands have to be
4172 executed in the controller).**
4176 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.2/32"},"index":"1"}]}}'
4178 - Create a Pathmap in the VTN
4182 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-map:set-path-map -d '{"input":{"tenant-name":"vtn1","path-map-list":[{"condition":"cond_1","policy":"1","index": "1","idle-timeout":"300","hard-timeout":"0"}]}}'
4184 - Get the Path policy information
4188 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-policy:set-path-policy -d '{"input":{"operation":"SET","id": "1","default-cost": "10000","vtn-path-cost": [{"port-desc":"openflow:1,3,s1-eth3","cost":"1000"},{"port-desc":"openflow:4,2,s4-eth2","cost":"100000"},{"port-desc":"openflow:3,3,s3-eth3","cost":"10000"}]}}'
4193 - Before applying Path policy information in the VTN
4200 "in_port_name": "s1-eth1",
4201 "out_port_name": "s1-eth3",
4202 "switch_id": "openflow:1"
4205 "in_port_name": "s4-eth1",
4206 "out_port_name": "s4-eth2",
4207 "switch_id": "openflow:4"
4210 "in_port_name": "s3-eth2",
4211 "out_port_name": "s3-eth3",
4212 "switch_id": "openflow:3"
4217 - After applying Path policy information in the VTN
4224 "in_port_name": "s1-eth1",
4225 "out_port_name": "s1-eth2",
4226 "switch_id": "openflow:1"
4229 "in_port_name": "s2-eth1",
4230 "out_port_name": "s2-eth2",
4231 "switch_id": "openflow:2"
4234 "in_port_name": "s3-eth1",
4235 "out_port_name": "s3-eth3",
4236 "switch_id": "openflow:3"
4241 VTN Coordinator(Troubleshooting HowTo)
4242 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4247 This page demonstrates Installation troubleshooting steps of VTN
4248 Coordinator. OpenDaylight VTN provides multi-tenant virtual network
4249 functions on OpenDaylight controllers. OpenDaylight VTN consists of two
4256 VTN Coordinator orchestrates multiple VTN Managers running in
4257 OpenDaylight Controllers, and provides VTN Applications with VTN API.
4258 VTN Manager is OSGi bundles running in OpenDaylight Controller. Current
4259 VTN Manager supports only OpenFlow switches. It handles PACKET\_IN
4260 messages, sends PACKET\_OUT messages, manages host information, and
4261 installs flow entries into OpenFlow switches to provide VTN Coordinator
4262 with virtual network functions. The requirements for installing these
4263 two are different.Therefore, we recommend that you install VTN Manager
4264 and VTN Coordinator in different machines.
4266 List of installation Troubleshooting How to’s
4267 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4269 - https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Installation:VTN_Coordinator
4271 **After executing db\_setup, you have encountered the error "Failed to
4274 The error could be due to the below reasons
4276 - Access Restriction
4278 The user who owns /usr/local/vtn/ directory and installs VTN
4279 Coordinator, can only start db\_setup. Example :
4283 The directory should appear as below (assuming the user as "vtn"):
4285 drwxr-xr-x. 12 vtn vtn 4096 Mar 14 21:53 vtn
4286 If the user doesnot own /usr/local/vtn/ then, please run the below command (assuming the username as vtn),
4287 chown -R vtn:vtn /usr/local/vtn
4289 - Postgres not Present
4293 1. In case of Fedora/CentOS/RHEL, please check if /usr/pgsql/<version> directory is present and also ensure the commands initdb, createdb,pg_ctl,psql are working. If, not please re-install postgres packages
4294 2. In case of Ubuntu, check if /usr/lib/postgres/<version> directory is present and check for the commands as in the previous step.
4296 - Not enough space to create tables
4300 Please check df -k and ensure enough free space is available.
4302 - If the above steps do not solve the problem, please refer to the log
4303 file for the exact problem
4307 /usr/local/vtn/var/dbm/unc_setup_db.log for the exact error.
4309 - list of VTN Coordinator processes
4311 - Run the below command ensure the Coordinator daemons are running.
4315 Command: /usr/local/vtn/bin/unc_dmctl status
4316 Name Type IPC Channel PID
4317 ----------- ----------- -------------- ------
4318 drvodcd DRIVER drvodcd 15972
4319 lgcnwd LOGICAL lgcnwd 16010
4320 phynwd PHYSICAL phynwd 15996
4322 - Issue the curl command to fetch version and ensure the process is
4325 **How to debug a startup failure?.**
4327 The following activities take place in order during startup
4329 - Database server is started after setting virtual memory to required
4330 value,Any database startup errors will be reflected in any of the
4335 /usr/local/vtn/var/dbm/unc_db_script.log.
4336 /usr/local/vtn/var/db/pg_log/postgresql-*.log (the pattern will have the date)
4338 - uncd daemon is kicked off, The daemon in turn kicks off the rest of
4343 Any uncd startup failures will be reflected in /usr/local/vtn/var/uncd/uncd_start.err.
4345 After setting up the apache tomcat server, what are the aspects that should be checked.
4346 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
4348 **Please check if catalina is running..**
4352 The command ps -ef | grep catalina | grep -v grep should list a catalina process
4354 **If you encounter an erroneous situation where the REST API is always
4359 Please ensure the firewall settings for port:8181 (Beryllium release) or port:8083 (Post Beryllium release) and enable the same.
4361 **How to debug a REST API returning a failure message?.**
4363 Please check the /usr/share/java/apache-tomcat-7.0.39/logs/core/core.log
4364 for failure details.
4366 **REST API for VTN configuration fails, how to debug?.**
4368 The default log level for all daemons is "INFO", to debug the situation
4369 TRACE or DEBUG logs may be needed. To increase the log level for
4370 individual daemons, please use the commands suggested below
4374 /usr/local/vtn/bin/lgcnw_control loglevel trace -- upll daemon log
4375 /usr/local/vtn/bin/phynw_control loglevel trace -- uppl daemon log
4376 /usr/local/vtn/bin/unc_control loglevel trace -- uncd daemon log
4377 /usr/local/vtn/bin/drvodc_control loglevel trace -- Driver daemon log
4379 After setting the log levels, the operation can be repeated and the log
4380 files can be referred for debugging.
4382 **Problems while Installing PostgreSQL due to openssl.**
4384 Errors may occur when trying to install postgreSQL rpms. Recently
4385 PostgreSQL has upgraded all their binaries to use the latest openssl
4386 versions with fix for http://en.wikipedia.org/wiki/Heartbleed Please
4387 upgrade the openssl package to the latest version and re-install. For
4388 RHEL 6.1/6.4 : If you have subscription, Please use the same and update
4389 the rpms. The details are available in the following link
4390 https://access.redhat.com/site/solutions/781793 ACCESS-REDHAT
4394 rpm -Uvh http://mirrors.kernel.org/centos/6/os/x86_64/Packages/openssl-1.0.1e-15.el6.x86_64.rpm
4395 rpm -ivh http://mirrors.kernel.org/centos/6/os/x86_64/Packages/openssl-devel-1.0.1e-15.el6.x86_64.rpm
4397 For other linux platforms, Please do yum update, the public respositroes
4398 will have the latest openssl, please install the same.
4400 Support for Microsoft SCVMM 2012 R2 with ODL VTN
4401 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4406 System Center Virtual Machine Manager (SCVMM) is Microsoft’s virtual
4407 machine support center for window’s based emulations. SCVMM is a
4408 management solution for the virtualized data center. You can use it to
4409 configure and manage your virtualization host, networking, and storage
4410 resources in order to create and deploy virtual machines and services to
4411 private clouds that you have created.
4413 The VSEM Provider is a plug-in to bridge between SCVMM and OpenDaylight.
4415 Microsoft Hyper-V is a server virtualization developed by Microsoft,
4416 which provides virtualization services through hypervisor-based
4419 .. figure:: ./images/vtn/setup_diagram_SCVMM.png
4420 :alt: Set-Up Diagram
4424 **The topology used in this set-up is:**
4426 - A SCVMM with VSEM Provider installed and a running VTN Coordinator
4427 and OpenDaylight with VTN Feature installed.
4429 - PF1000 virtual switch extension has been installed in the two Hyper-V
4430 servers as it implements the OpenFlow capability in Hyper-V.
4432 - Three OpenFlow switches simulated using mininet and connected to
4435 - Four VM’s hosted using SCVMM.
4437 **It is implemented as two major components:**
4441 - OpenDaylight (VTN Feature)
4448 OpenDaylight VTN as Network Service provider for SCVMM where VSEM
4449 provider is added in the Network Service which will handle all requests
4450 from SCVMM and communicate with the VTN Coordinator. It is used to
4451 manage the network virtualization provided by OpenDaylight.
4453 Installing HTTPS in VTN Coordinator
4454 '''''''''''''''''''''''''''''''''''
4456 - System Center Virtual Machine Manager (SCVMM) supports only https
4459 **Apache Portable Runtime (APR) Installation Steps**
4461 - Enter the command "yum install **apr**" in VTN Coordinator installed
4464 - In /usr/bin, create a soft link as "ln –s /usr/bin/apr-1-config
4465 /usr/bin/apr-config".
4467 - Extract tomcat under "/usr/share/java" by using the below command
4468 "tar -xvf apache-tomcat-8.0.27.tar.gz –C /usr/share/java".
4472 Please go through the bleow link to download
4473 apache-tomcat-8.0.27.tar.gz file,
4474 https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.27/bin/
4476 - Please go to the directory "cd
4477 /usr/share/java/apache-tomcat-8.0.27/bin and unzip tomcat-native.gz
4478 using this command "tar -xvf tomcat-native.gz".
4480 - Go to the directory "cd
4481 /usr/share/java/apache-tomcat-8.0.27/bin/tomcat-native-1.1.33-src/jni/native".
4483 - Enter the command "./configure --with-os-type=bin
4484 --with-apr=/usr/bin/apr-config".
4486 - Enter the command "make" and "make install".
4488 - Apr libraries are successfully installed in "/usr/local/apr/lib".
4490 **Enable HTTP/HTTPS in VTN Coordinator**
4492 Enter the command "firewall-cmd --zone=public --add-port=8083/tcp
4493 --permanent" and "firewall-cmd --reload" to enable firewall settings in
4496 **Create a CA’s private key and a self-signed certificate in server**
4498 - Execute the following command "openssl req -x509 -days 365
4499 -extensions v3\_ca -newkey rsa:2048 –out /etc/pki/CA/cacert.pem
4500 –keyout /etc/pki/CA/private/cakey.pem" in a single line.
4502 +-----------------------+----------------------------------------------------+
4503 | Argument | Description |
4504 +=======================+====================================================+
4505 | Country Name | | Specify the country code. |
4506 | | | For example, JP |
4507 +-----------------------+----------------------------------------------------+
4508 | State or Province | | Specify the state or province. |
4509 | Name | | For example, Tokyo |
4510 +-----------------------+----------------------------------------------------+
4511 | Locality Name | | Locality Name |
4512 | | | For example, Chuo-Ku |
4513 +-----------------------+----------------------------------------------------+
4514 | Organization Name | Specify the company. |
4515 +-----------------------+----------------------------------------------------+
4516 | Organizational Unit | Specify the department, division, or the like. |
4518 +-----------------------+----------------------------------------------------+
4519 | Common Name | Specify the host name. |
4520 +-----------------------+----------------------------------------------------+
4521 | Email Address | Specify the e-mail address. |
4522 +-----------------------+----------------------------------------------------+
4524 - Execute the following commands: "touch /etc/pki/CA/index.txt" and
4525 "echo 00 > /etc/pki/CA/serial" in server after setting your CA’s
4528 **Create a private key and a CSR for web server**
4530 - Execute the following command "openssl req -new -newkey rsa:2048 -out
4531 csr.pem –keyout /usr/local/vtn/tomcat/conf/key.pem" in a single line.
4533 - Enter the PEM pass phrase: Same password you have given in CA’s
4534 private key PEM pass phrase.
4536 +-----------------------+----------------------------------------------------+
4537 | Argument | Description |
4538 +=======================+====================================================+
4539 | Country Name | | Specify the country code. |
4540 | | | For example, JP |
4541 +-----------------------+----------------------------------------------------+
4542 | State or Province | | Specify the state or province. |
4543 | Name | | For example, Tokyo |
4544 +-----------------------+----------------------------------------------------+
4545 | Locality Name | | Locality Name |
4546 | | | For example, Chuo-Ku |
4547 +-----------------------+----------------------------------------------------+
4548 | Organization Name | Specify the company. |
4549 +-----------------------+----------------------------------------------------+
4550 | Organizational Unit | Specify the department, division, or the like. |
4552 +-----------------------+----------------------------------------------------+
4553 | Common Name | Specify the host name. |
4554 +-----------------------+----------------------------------------------------+
4555 | Email Address | Specify the e-mail address. |
4556 +-----------------------+----------------------------------------------------+
4557 | A challenge password | Specify the challenge password. |
4558 +-----------------------+----------------------------------------------------+
4559 | An optional company | Specify an optional company name. |
4561 +-----------------------+----------------------------------------------------+
4563 **Create a certificate for web server**
4565 - Execute the following command "openssl ca –in csr.pem –out
4566 /usr/local/vtn/tomcat/conf/cert.pem –days 365 –batch" in a single
4569 - Enter pass phrase for /etc/pki/CA/private/cakey.pem: Same password
4570 you have given in CA’s private key PEM pass phrase.
4572 - Open the tomcat file using "vim /usr/local/vtn/tomcat/bin/tomcat".
4574 - Include the line " TOMCAT\_PROPS="$TOMCAT\_PROPS
4575 -Djava.library.path=\\"/usr/local/apr/lib\\"" " in 131th line and
4578 **Edit server.xml file and restart the server**
4580 - Open the server.xml file using "vim
4581 /usr/local/vtn/tomcat/conf/server.xml" and add the below lines.
4585 <Connector port="${vtn.port}" protocol="HTTP/1.1" SSLEnabled="true"
4586 maxThreads="150" scheme="https" secure="true"
4587 SSLCertificateFile="/usr/local/vtn/tomcat/conf/cert.pem"
4588 SSLCertificateKeyFile="/usr/local/vtn/tomcat/conf/key.pem"
4589 SSLPassword=same password you have given in CA's private key PEM pass phrase
4590 connectionTimeout="20000" />
4592 - Save the file and restart the server.
4594 - To stop vtn use the following command.
4598 /usr/local/vtn/bin/vtn_stop
4600 - To start vtn use the following command.
4604 /usr/local/vtn/bin/vtn_start
4606 - Copy the created CA certificate from cacert.pem to cacert.crt by
4607 using the following command,
4611 openssl x509 –in /etc/pki/CA/cacert.pem –out cacert.crt
4613 **Checking the HTTP and HTTPS connection from client**
4615 - You can check the HTTP connection by using the following command:
4619 curl -X GET -H 'contenttype:application/json' -H 'username:admin' -H 'password:adminpass' http://<server IP address>:8083/vtn-webapi/api_version.json
4621 - You can check the HTTPS connection by using the following command:
4625 curl -X GET -H 'contenttype:application/json' -H 'username:admin' -H 'password:adminpass' https://<server IP address>:8083/vtn-webapi/api_version.json --cacert /etc/pki/CA/cacert.pem
4627 - The response should be like this for both HTTP and HTTPS:
4631 {"api_version":{"version":"V1.4"}}
4633 Prerequisites to create Network Service in SCVMM machine, Please follow the below steps
4634 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4636 1. Please go through the below link to download VSEM Provider zip file,
4637 https://nexus.opendaylight.org/content/groups/public/org/opendaylight/vtn/application/vtnmanager-vsemprovider/1.2.0-Boron/vtnmanager-vsemprovider-1.2.0-Boron-bin.zip
4639 2. Unzip the vtnmanager-vsemprovider-1.2.0-Boron-bin.zip file
4640 anywhere in your SCVMM machine.
4642 3. Stop SCVMM service from **"service manager→tools→servers→select
4643 system center virtual machine manager"** and click stop.
4645 4. Go to **"C:/Program Files"** in your SCVMM machine. Inside
4646 **"C:/Program Files"**, create a folder named as **"ODLProvider"**.
4648 5. Inside **"C:/Program Files/ODLProvider"**, create a folder named as
4649 "Module" in your SCVMM machine.
4651 6. Inside "C:/Program Files/ODLProvider/Module", Create two folders
4652 named as **"Odl.VSEMProvider"** and **"VSEMOdlUI"** in your SCVMM
4655 7. Copy the **"VSEMOdl.dll"** file from
4656 **"ODL\_SCVMM\_PROVIDER/ODL\_VSEM\_PROVIDER"** to **"C:/Program
4657 Files/ODLProvider/Module/Odl.VSEMProvider"** in your SCVMM machine.
4659 8. Copy the **"VSEMOdlProvider.psd1"** file from
4660 **"application/vsemprovider/VSEMOdlProvider/VSEMOdlProvider.psd1"**
4661 to **"C:/Program Files/ODLProvider/Module/Odl.VSEMProvider"** in
4664 9. Copy the **"VSEMOdlUI.dll"** file from
4665 **"ODL\_SCVMM\_PROVIDER/ODL\_VSEM\_PROVIDER\_UI"** to **"C:/Program
4666 Files/ODLProvider/Module/VSEMOdlUI"** in your SCVMM machine.
4668 10. Copy the **"VSEMOdlUI.psd1"** file from
4669 **"application/vsemprovider/VSEMOdlUI"** to **"C:/Program
4670 Files/ODLProvider/Module/VSEMOdlUI"** in your SCVMM machine.
4672 11. Copy the **"reg\_entry.reg"** file from
4673 **"ODL\_SCVMM\_PROVIDER/Register\_settings"** to your SCVMM desktop
4674 and double click the **"reg\_entry.reg"** file to install registry
4675 entry in your SCVMM machine.
4677 12. Download **"PF1000.msi"** from this link,
4678 https://www.pf-info.com/License/en/index.php?url=index/index_non_buyer
4679 and place into **"C:/Program Files/Switch Extension Drivers"** in
4682 13. Start SCVMM service from **"service manager→tools→servers→select
4683 system center virtual machine manager"** and click start.
4685 System Center Virtual Machine Manager (SCVMM)
4686 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4688 It supports two major features:
4690 - Failover Clustering
4697 A single Hyper-V can host a number of virtual machines. If the host were
4698 to fail then all of the virtual machines that are running on it will
4699 also fail, thereby resulting in a major outage. Failover clustering
4700 treats individual virtual machines as clustered resources. If a host
4701 were to fail then clustered virtual machines are able to fail over to a
4702 different Hyper-V server where they can continue to run.
4707 Live Migration is used to migrate the running virtual machines from one
4708 Hyper-V server to another Hyper-V server without any interruptions.
4709 Please go through the below video for more details,
4711 - https://youtu.be/34YMOTzbNJM
4716 - Please go through the below link for SCVMM user guide:
4717 https://wiki.opendaylight.org/images/c/ca/ODL_SCVMM_USER_GUIDE_final.pdf
4719 - Please go through the below links for more details
4721 - OpenDaylight SCVMM VTN Integration: https://youtu.be/iRt4dxtiz94
4723 - OpenDaylight Congestion Control with SCVMM VTN:
4724 https://youtu.be/34YMOTzbNJM