1 Virtual Tenant Network (VTN)
2 ============================
7 OpenDaylight Virtual Tenant Network (VTN) is an application that
8 provides multi-tenant virtual network on an SDN controller.
10 Conventionally, huge investment in the network systems and operating
11 expenses are needed because the network is configured as a silo for each
12 department and system. So, various network appliances must be installed
13 for each tenant and those boxes cannot be shared with others. It is a
14 heavy work to design, implement and operate the entire complex network.
16 The uniqueness of VTN is a logical abstraction plane. This enables the
17 complete separation of logical plane from physical plane. Users can
18 design and deploy any desired network without knowing the physical
19 network topology or bandwidth restrictions.
21 VTN allows the users to define the network with a look and feel of
22 conventional L2/L3 network. Once the network is designed on VTN, it will
23 automatically be mapped into underlying physical network, and then
24 configured on the individual switch leveraging SDN control protocol. The
25 definition of logical plane makes it possible not only to hide the
26 complexity of the underlying network but also to better manage network
27 resources. It achieves reducing reconfiguration time of network services
28 and minimizing network configuration errors.
30 .. figure:: ./images/vtn/VTN_Overview.jpg
35 It is implemented as two major components
37 - `VTN Manager <#_vtn_manager>`__
39 - `VTN Coordinator <#_vtn_coordinator>`__
44 An OpenDaylight Plugin that interacts with other modules to implement
45 the components of the VTN model. It also provides a REST interface to
46 configure VTN components in OpenDaylight. VTN Manager is implemented as
47 one plugin to the OpenDaylight. This provides a REST interface to
48 create/update/delete VTN components. The user command in VTN Coordinator
49 is translated as REST API to VTN Manager by the OpenDaylight Driver
50 component. In addition to the above mentioned role, it also provides an
51 implementation to the OpenStack L2 Network Functions API.
56 - **odl-vtn-manager** provides VTN Manager’s JAVA API.
58 - **odl-vtn-manager-rest** provides VTN Manager’s REST API.
60 - **odl-vtn-manager-neutron** provides the integration with Neutron
66 VTN Manager provides REST API for virtual network functions.
68 Here is an example of how to create a virtual tenant network.
72 curl --user "admin":"admin" -H "Accept: application/json" -H \
73 "Content-type: application/json" -X POST \
74 http://localhost:8181/restconf/operations/vtn:update-vtn \
75 -d '{"input":{"tenant-name":"vtn1"}}'
77 You can check the list of all tenants by executing the following
82 curl --user "admin":"admin" -H "Accept: application/json" -H \
83 "Content-type: application/json" -X GET \
84 http://localhost:8181/restconf/operational/vtn:vtns
86 REST Conf documentation for VTN Manager, please refer to:
87 https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/apidocs/index.html
93 The VTN Coordinator is an external application that provides a REST
94 interface for an user to use OpenDaylight VTN Virtualization. It
95 interacts with VTN Manager plugin to implement the user configuration.
96 It is also capable of multiple OpenDaylight orchestration. It realizes
97 Virtual Tenant Network (VTN) provisioning in OpenDaylight instances. In
98 the OpenDaylight architecture VTN Coordinator is part of the network
99 application, orchestration and services layer. VTN Coordinator will use
100 the REST interface exposed by the VTN Manger to realize the virtual
101 network using OpenDaylight. It uses OpenDaylight APIs (REST) to
102 construct the virtual network in OpenDaylight instances. It provides
103 REST APIs for northbound VTN applications and supports virtual networks
104 spanning across multiple OpenDaylight by coordinating across
107 For VTN Coordinator REST API, please refer to:
108 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:VTN_Coordinator:RestApi
110 Network Virtualization Function
111 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113 The user first defines a VTN. Then, the user maps the VTN to a physical
114 network, which enables communication to take place according to the VTN
115 definition. With the VTN definition, L2 and L3 transfer functions and
116 flow-based traffic control functions (filtering and redirect) are
119 Virtual Network Construction
120 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122 The following table shows the elements which make up the VTN. In the
123 VTN, a virtual network is constructed using virtual nodes (vBridge,
124 vRouter) and virtual interfaces and links. It is possible to configure a
125 network which has L2 and L3 transfer function, by connecting the virtual
126 intrefaces made on virtual nodes via virtual links.
128 +--------------------------------------+--------------------------------------+
129 | vBridge | The logical representation of L2 |
130 | | switch function. |
131 +--------------------------------------+--------------------------------------+
132 | vRouter | The logical representation of router |
134 +--------------------------------------+--------------------------------------+
135 | vTep | The logical representation of Tunnel |
136 | | End Point - TEP. |
137 +--------------------------------------+--------------------------------------+
138 | vTunnel | The logical representation of |
140 +--------------------------------------+--------------------------------------+
141 | vBypass | The logical representation of |
142 | | connectivity between controlled |
144 +--------------------------------------+--------------------------------------+
145 | Virtual interface | The representation of end point on |
146 | | the virtual node. |
147 +--------------------------------------+--------------------------------------+
148 | Virtual Linkv(vLink) | The logical representation of L1 |
149 | | connectivity between virtual |
151 +--------------------------------------+--------------------------------------+
153 The following figure shows an example of a constructed virtual network.
154 VRT is defined as the vRouter, BR1 and BR2 are defined as vBridges.
155 interfaces of the vRouter and vBridges are connected using vLinks.
157 .. figure:: ./images/vtn/VTN_Construction.jpg
158 :alt: VTN Construction
162 Mapping of Physical Network Resources
163 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
165 Map physical network resources to the constructed virtual network.
166 Mapping identifies which virtual network each packet transmitted or
167 received by an OpenFlow switch belongs to, as well as which interface in
168 the OpenFlow switch transmits or receives that packet. There are two
169 mapping methods. When a packet is received from the OFS, port mapping is
170 first searched for the corresponding mapping definition, then VLAN
171 mapping is searched, and the packet is mapped to the relevant vBridge
172 according to the first matching mapping.
174 +--------------------------------------+--------------------------------------+
175 | Port mapping | Maps physical network resources to |
176 | | an interface of vBridge using Switch |
177 | | ID, Port ID and VLAN ID of the |
178 | | incoming L2 frame. Untagged frame |
179 | | mapping is also supported. |
180 +--------------------------------------+--------------------------------------+
181 | VLAN mapping | Maps physical network resources to a |
182 | | vBridge using VLAN ID of the |
183 | | incoming L2 frame.Maps physical |
184 | | resources of a particular switch to |
185 | | a vBridge using switch ID and VLAN |
186 | | ID of the incoming L2 frame. |
187 +--------------------------------------+--------------------------------------+
188 | MAC mapping | Maps physical resources to an |
189 | | interface of vBridge using MAC |
190 | | address of the incoming L2 frame(The |
191 | | initial contribution does not |
192 | | include this method). |
193 +--------------------------------------+--------------------------------------+
195 VTN can learn the terminal information from a terminal that is connected
196 to a switch which is mapped to VTN. Further, it is possible to refer
197 that terminal information on the VTN.
199 - Learning terminal information VTN learns the information of a
200 terminal that belongs to VTN. It will store the MAC address and VLAN
201 ID of the terminal in relation to the port of the switch.
203 - Aging of terminal information Terminal information, learned by the
204 VTN, will be maintained until the packets from terminal keep flowing
205 in VTN. If the terminal gets disconnected from the VTN, then the
206 aging timer will start clicking and the terminal information will be
207 maintained till timeout.
209 The following figure shows an example of mapping. An interface of BR1 is
210 mapped to port GBE0/1 of OFS1 using port mapping. Packets received from
211 GBE0/1 of OFS1 are regarded as those from the corresponding interface of
212 BR1. BR2 is mapped to VLAN 200 using VLAN mapping. Packets with VLAN tag
213 200 received from any ports of any OFSs are regarded as those from an
216 .. figure:: ./images/vtn/VTN_Mapping.jpg
224 The vBridge provides the bridge function that transfers a packet to the
225 intended virtual port according to the destination MAC address. The
226 vBridge looks up the MAC address table and transmits the packet to the
227 corresponding virtual interface when the destination MAC address has
228 been learned. When the destination MAC address has not been learned, it
229 transmits the packet to all virtual interfaces other than the receiving
230 port (flooding). MAC addresses are learned as follows.
232 - MAC address learning The vBridge learns the MAC address of the
233 connected host. The source MAC address of each received frame is
234 mapped to the receiving virtual interface, and this MAC address is
235 stored in the MAC address table created on a per-vBridge basis.
237 - MAC address aging The MAC address stored in the MAC address table is
238 retained as long as the host returns the ARP reply. After the host is
239 disconnected, the address is retained until the aging timer times
240 out. To have the vBridge learn MAC addresses statically, you can
241 register MAC addresses manually.
246 The vRouter transfers IPv4 packets between vBridges. The vRouter
247 supports routing, ARP learning, and ARP aging functions. The following
248 outlines the functions.
250 - Routing function When an IP address is registered with a virtual
251 interface of the vRouter, the default routing information for that
252 interface is registered. It is also possible to statically register
253 routing information for a virtual interface.
255 - ARP learning function The vRouter associates a destination IP
256 address, MAC address and a virtual interface, based on an ARP request
257 to its host or a reply packet for an ARP request, and maintains this
258 information in an ARP table prepared for each routing domain. The
259 registered ARP entry is retained until the aging timer, described
260 later, times out. The vRouter transmits an ARP request on an
261 individual aging timer basis and deletes the associated entry from
262 the ARP table if no reply is returned. For static ARP learning, you
263 can register ARP entry information manually.
265 - DHCP relay agent function The vRouter also provides the DHCP relay
268 Flow Filter Functions
269 ~~~~~~~~~~~~~~~~~~~~~
271 Flow Filter function is similar to ACL. It is possible to allow or
272 prohibit communication with only certain kind of packets that meet a
273 particular condition. Also, it can perform a processing called
274 Redirection - WayPoint routing, which is different from the existing
275 ACL. Flow Filter can be applied to any interface of a vNode within VTN,
276 and it is possible to the control the packets that pass interface. The
277 match conditions that could be specified in Flow Filter are as follows.
278 It is also possible to specify a combination of multiple conditions.
282 - Destination MAC address
290 - Destination IP address
296 - TCP/UDP source port
298 - TCP/UDP destination port
304 The types of Action that can be applied on packets that match the Flow
305 Filter conditions are given in the following table. It is possible to
306 make only those packets, which match a particular condition, to pass
307 through a particular server by specifying Redirection in Action. E.g.,
308 path of flow can be changed for each packet sent from a particular
309 terminal, depending upon the destination IP address. VLAN priority
310 control and DSCP marking are also supported.
312 +--------------------------------------+--------------------------------------+
313 | Action | Function |
314 +--------------------------------------+--------------------------------------+
315 | Pass | Pass particular packets matching the |
316 | | specified conditions. |
317 +--------------------------------------+--------------------------------------+
318 | Drop | Discards particular packets matching |
319 | | the specified conditions. |
320 +--------------------------------------+--------------------------------------+
321 | Redirection | Redirects the packet to a desired |
322 | | virtual interface. Both Transparent |
323 | | Redirection (not changing MAC |
324 | | address) and Router Redirection |
325 | | (changing MAC address) are |
327 +--------------------------------------+--------------------------------------+
329 The following figure shows an example of how the flow filter function
332 If there is any matching condition specified by flow filter when a
333 packet being transferred within a virtual network goes through a virtual
334 interface, the function evaluates the matching condition to see whether
335 the packet matches it. If the packet matches the condition, the function
336 applies the matching action specified by flow filter. In the example
337 shown in the figure, the function evaluates the matching condition at
338 BR1 and discards the packet if it matches the condition.
340 .. figure:: ./images/vtn/VTN_Flow_Filter.jpg
345 Multiple SDN Controller Coordination
346 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348 With the network abstractions, VTN enables to configure virtual network
349 across multiple SDN controllers. This provides highly scalable network
352 VTN can be created on each SDN controller. If users would like to manage
353 those multiple VTNs with one policy, those VTNs can be integrated to a
356 As a use case, this feature is deployed to multi data center
357 environment. Even if those data centers are geographically separated and
358 controlled with different controllers, a single policy virtual network
359 can be realized with VTN.
361 Also, one can easily add a new SDN Controller to an existing VTN or
362 delete a particular SDN Controller from VTN.
364 In addition to this, one can define a VTN which covers both OpenFlow
365 network and Overlay network at the same time.
367 Flow Filter, which is set on the VTN, will be automatically applied on
368 the newly added SDN Controller.
370 Coordination between OpenFlow Network and L2/L3 Network
371 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373 It is possible to configure VTN on an environment where there is mix of
374 L2/L3 switches as well. L2/L3 switch will be shown on VTN as vBypass.
375 Flow Filter or policing cannot be configured for a vBypass. However, it
376 is possible to treat it as a virtual node inside VTN.
378 Virtual Tenant Network (VTN) API
379 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
381 VTN provides Web APIs. They are implemented by REST architecture and
382 provide the access to resources within VTN that are identified by URI.
383 User can perform the operations like GET/PUT/POST/DELETE against the
384 virtual network resources (e.g. vBridge or vRouter) by sending a message
385 to VTN through HTTPS communication in XML or JSON format.
387 .. figure:: ./images/vtn/VTN_API.jpg
395 VTN provides following operations for various network resources.
397 +----------------+----------------+----------------+----------------+----------------+
398 | Resources | GET | POST | PUT | DELETE |
399 +----------------+----------------+----------------+----------------+----------------+
400 | VTN | Yes | Yes | Yes | Yes |
401 +----------------+----------------+----------------+----------------+----------------+
402 | vBridge | Yes | Yes | Yes | Yes |
403 +----------------+----------------+----------------+----------------+----------------+
404 | vRouter | Yes | Yes | Yes | Yes |
405 +----------------+----------------+----------------+----------------+----------------+
406 | vTep | Yes | Yes | Yes | Yes |
407 +----------------+----------------+----------------+----------------+----------------+
408 | vTunnel | Yes | Yes | Yes | Yes |
409 +----------------+----------------+----------------+----------------+----------------+
410 | vBypass | Yes | Yes | Yes | Yes |
411 +----------------+----------------+----------------+----------------+----------------+
412 | vLink | Yes | Yes | Yes | Yes |
413 +----------------+----------------+----------------+----------------+----------------+
414 | Interface | Yes | Yes | Yes | Yes |
415 +----------------+----------------+----------------+----------------+----------------+
416 | Port map | Yes | No | Yes | Yes |
417 +----------------+----------------+----------------+----------------+----------------+
418 | Vlan map | Yes | Yes | Yes | Yes |
419 +----------------+----------------+----------------+----------------+----------------+
420 | Flowfilter | Yes | Yes | Yes | Yes |
421 | (ACL/redirect) | | | | |
422 +----------------+----------------+----------------+----------------+----------------+
423 | Controller | Yes | Yes | Yes | Yes |
424 | information | | | | |
425 +----------------+----------------+----------------+----------------+----------------+
426 | Physical | Yes | No | No | No |
428 | information | | | | |
429 +----------------+----------------+----------------+----------------+----------------+
430 | Alarm | Yes | No | No | No |
431 | information | | | | |
432 +----------------+----------------+----------------+----------------+----------------+
437 The following is an example of the usage to construct a virtual network.
443 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
444 -d '{"vtn":{"vtn_name":"VTN1"}}' http://172.1.0.1:8083/vtn-webapi/vtns.json
446 - Create Controller Information
450 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
451 -d '{"controller": {"controller_id":"CONTROLLER1","ipaddr":"172.1.0.1","type":"odc","username":"admin", \
452 "password":"admin","version":"1.0"}}' http://172.1.0.1:8083/vtn-webapi/controllers.json
454 - Create vBridge under VTN
458 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
459 -d '{"vbridge":{"vbr_name":"VBR1","controller_id": "CONTROLLER1","domain_id": "(DEFAULT)"}}' \
460 http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges.json
462 - Create the interface under vBridge
466 curl --user admin:adminpass -X POST -H 'content-type: application/json' \
467 -d '{"interface":{"if_name":"IF1"}}' http://172.1.0.1:8083/vtn-webapi/vtns/VTN1/vbridges/VBR1/interfaces.json
469 VTN OpenStack Configuration
470 ---------------------------
472 This guide describes how to set up OpenStack for integration with
473 OpenDaylight Controller.
475 While OpenDaylight Controller provides several ways to integrate with
476 OpenStack, this guide focus on the way which uses VTN features available
477 on OpenDaylight. In the integration, VTN Manager work as network service
478 provider for OpenStack.
480 VTN Manager features, enable OpenStack to work in pure OpenFlow
481 environment in which all switches in data plane are OpenFlow switch.
486 - OpenDaylight Controller. (VTN features must be installed)
488 - OpenStack Control Node.
490 - OpenStack Compute Node.
492 - OpenFlow Switch like mininet(Not Mandatory).
494 The VTN features support multiple OpenStack nodes. You can deploy
495 multiple OpenStack Compute Nodes. In management plane, OpenDaylight
496 Controller, OpenStack nodes and OpenFlow switches should communicate
497 with each other. In data plane, Open vSwitches running in OpenStack
498 nodes should communicate with each other through a physical or logical
499 OpenFlow switches. The core OpenFlow switches are not mandatory.
500 Therefore, you can directly connect to the Open vSwitch’s.
502 .. figure:: ./images/vtn/OpenStack_Demo_Picture.png
503 :alt: Openstack Overview
510 Below steps depicts the configuration of single OpenStack Control node
511 and OpenStack Compute node setup. Our test setup is as follows
513 .. figure:: ./images/vtn/vtn_devstack_setup.png
518 **Server Preparation**
520 - Install Ubuntu 14.04 LTS in two servers (OpenStack Control node and
521 Compute node respectively)
523 - While installing, Ubuntu mandates creation of a User, we created the
524 user "stack"(We will use the same user for running devstack)
526 - Proceed with the below mentioned User Settings and Network Settings
527 in both the Control and Compute nodes.
529 **User Settings for devstack** - Login to both servers - Disable Ubuntu
536 - Install the below packages (optional, provides ifconfig and route
537 coammnds, handy for debugging!!)
541 sudo apt-get install net-tools
543 - Edit sudo vim /etc/sudoers and add an entry as follows
547 stack ALL=(ALL) NOPASSWD: ALL
549 **Network Settings** - Checked the output of ifconfig -a, two interfaces
550 were listed eth0 and eth1 as indicated in the image above. - We had
551 connected eth0 interface to the Network where OpenDaylight is reachable.
552 - eth1 interface in both servers were connected to a different network
553 to act as data plane for the VM’s created using the OpenStack. -
554 Manually edited the file : sudo vim /etc/network/interfaces and made
559 stack@ubuntu-devstack:~/devstack$ cat /etc/network/interfaces
560 # This file describes the network interfaces available on your system
561 # and how to activate them. For more information, see interfaces(5).
562 # The loop-back network interface
564 iface lo inet loopback
565 # The primary network interface
567 iface eth0 inet static
568 address <IP_ADDRESS_TO_REACH_ODL>
570 broadcast <BROADCAST_IP_ADDRESS>
571 gateway <GATEWAY_IP_ADDRESS>
573 iface eth1 inet static
574 address <IP_ADDRESS_UNIQ>
579 Please ensure that the eth0 interface is the default route and it is
580 able to reach the ODL\_IP\_ADDRESS NOTE: The entries for eth1 are
581 not mandatory, If not set, we may have to manually do "ifup eth1"
582 after the stacking is complete to activate the interface
584 **Finalize the user and network settings** - Please reboot both nodes
585 after the user and network settings to have the network settings applied
586 to the network - Login again and check the output of ifconfig to ensure
587 that both interfaces are listed
589 OpenDaylight Settings and Execution
590 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
592 VTN Configuration for OpenStack Integration:
593 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
595 - VTN uses the configuration parameters from "90-vtn-neutron.xml" file
596 for the OpenStack integration.
598 - These values will be set for the OpenvSwitch, in all the
599 participating OpenStack nodes.
601 - A configuration file "90-vtn-neutron.xml" will be generated
602 automatically by following the below steps,
604 - Download the latest Boron karaf distribution from the below link,
608 http://www.opendaylight.org/software/downloads
610 - cd "distribution-karaf-0.5.0-Boron" and run karaf by using the
611 following command "./bin/karaf".
613 - Install the below feature to generate "90-vtn-neutron.xml"
617 feature:install odl-vtn-manager-neutron
619 - Logout from the karaf console and Check "90-vtn-neutron.xml" file
620 from the following path
621 "distribution-karaf-0.5.0-Boron/etc/opendaylight/karaf/".
623 - The contents of "90-vtn-neutron.xml" should be as follows:
625 bridgename=br-int portname=eth1 protocols=OpenFlow13 failmode=secure
627 - The values of the configuration parameters must be changed based on
628 the user environment.
630 - Especially, "portname" should be carefully configured, because if the
631 value is wrong, OpenDaylight fails to forward packets.
633 - Other parameters works fine as is for general use cases.
637 - The name of the bridge in Open vSwitch, that will be created by
638 OpenDaylight Controller.
640 - It must be "br-int".
644 - The name of the port that will be created in the vbridge in
647 - This must be the same name of the interface of OpenStack Nodes
648 which is used for interconnecting OpenStack Nodes in data
649 plane.(in our case:eth1)
651 - By default, if 90-vtn-neutron.xml is not created, VTN uses
656 - OpenFlow protocol through which OpenFlow Switch and Controller
659 - The values can be OpenFlow13 or OpenFlow10.
663 - The value can be "standalone" or "secure".
665 - Please use "secure" for general use cases.
670 - Please refer to the Installation Pages to run ODL with VTN Feature
673 - After running ODL Controller, please ensure ODL Controller listens to
674 the ports:6633,6653, 6640 and 8080
676 - Please allow the ports in firewall for the devstack to be able to
677 communicate with ODL Controller.
681 - 6633/6653 - OpenFlow Ports
683 - 6640 - OVS Manager Port
685 - 8080 - Port for REST API
690 Get Devstack (All nodes)
691 ^^^^^^^^^^^^^^^^^^^^^^^^
693 - Install git application using
695 - sudo apt-get install git
699 - git clone https://git.openstack.org/openstack-dev/devstack;
701 - Switch to stable/Juno Version branch
707 git checkout stable/juno
711 If you want to use stable/kilo Version branch, Please execute the
712 below command in devstack folder
716 git checkout stable/kilo
720 If you want to use stable/liberty Version branch, Please execute the
721 below command in devstack folder
725 git checkout stable/liberty
732 - cd devstack in the controller node
734 - Copy the contents of local.conf for juno (devstack control node) from
735 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack
736 and save it as "local.conf" in the "devstack".
738 - Copy the contents of local.conf for kilo and liberty (devstack
740 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack_post_juno_versions
741 and save it as "local.conf" in the "devstack".
743 - Please modify the IP Address values as required.
751 Verify Control Node stacking
752 ''''''''''''''''''''''''''''
754 - stack.sh prints out Horizon is now available at
755 `http://<CONTROL\_NODE\_IP\_ADDRESS>:8080/ <http://<CONTROL_NODE_IP_ADDRESS>:8080/>`__
757 - Execute the command *sudo ovs-vsctl show* in the control node
758 terminal and verify if the bridge *br-int* is created.
760 - Typical output of the ovs-vsctl show is indicated below:
764 e232bbd5-096b-48a3-a28d-ce4a492d4b4f
765 Manager "tcp:192.168.64.73:6640"
768 Controller "tcp:192.168.64.73:6633"
780 - cd devstack in the controller node
782 - Copy the contents of local.conf for juno (devstack compute node) from
783 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack
784 and save it as "local.conf" in the "devstack".
786 - Copy the contents of local.conf file for kilo and liberty (devstack
788 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:devstack_post_juno_versions
789 and save it as "local.conf" in the "devstack".
791 - Please modify the IP Address values as required.
799 Verify Compute Node Stacking
800 ''''''''''''''''''''''''''''
802 - stack.sh prints out This is your host ip:
803 <COMPUTE\_NODE\_IP\_ADDRESS>
805 - Execute the command *sudo ovs-vsctl show* in the control node
806 terminal and verify if the bridge *br-int* is created.
808 - The output of the ovs-vsctl show will be similar to the one seen in
811 Additional Verifications
812 ^^^^^^^^^^^^^^^^^^^^^^^^
814 - Please visit the OpenDaylight DLUX GUI after stacking all the nodes,
815 `http://<ODL\_IP\_ADDRESS>:8181/index.html <http://<ODL_IP_ADDRESS>:8181/index.html>`__.
816 The switches, topology and the ports that are currently read can be
821 http://<controller-ip>:8181/index.html
825 If the interconnected between the Open vSwitch is not seen, Please
826 bring up the interface for the dataplane manually using the below
831 ifup <interface_name>
833 - Please Accept Promiscuous mode in the networks involving the
836 Create VM from Devstack Horizon GUI
837 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
840 `http://<CONTROL\_NODE\_IP>:8080/ <http://<CONTROL_NODE_IP>:8080/>`__
841 to check the horizon GUI.
843 .. figure:: ./images/vtn/OpenStackGui.png
848 Enter the value for User Name as admin and enter the value for Password
851 - We should first ensure both the hypervisors(control node and compute
852 node) are mapped under hypervisors by clicking on Hpervisors tab.
854 .. figure:: ./images/vtn/Hypervisors.png
859 - Create a new Network from Horizon GUI.
861 - Click on Networks Tab.
863 - click on the Create Network button.
865 .. figure:: ./images/vtn/Create_Network.png
870 - A popup screen will appear.
872 - Enter network name and click Next button.
874 .. figure:: ./images/vtn/Creare_Network_Step_1.png
879 - Create a sub network by giving Network Address and click Next button
882 .. figure:: ./images/vtn/Create_Network_Step_2.png
887 - Specify the additional details for subnetwork (please refer the image
890 .. figure:: ./images/vtn/Create_Network_Step_3.png
895 - Click Create button
899 - Navigate to Instances tab in the GUI.
901 .. figure:: ./images/vtn/Instance_Creation.png
902 :alt: Instance Creation
906 - Click on Launch Instances button.
908 .. figure:: ./images/vtn/Launch_Instance.png
909 :alt: Launch Instance
913 - Click on Details tab to enter the VM details.For this demo we are
914 creating Ten VM’s(instances).
916 - In the Networking tab, we must select the network,for this we need to
917 drag and drop the Available networks to Selected Networks (i.e.,)
918 Drag vtn1 we created from Available networks to Selected Networks and
919 click Launch to create the instances.
921 .. figure:: ./images/vtn/Launch_Instance_network.png
926 - Ten VM’s will be created.
928 .. figure:: ./images/vtn/Load_All_Instances.png
929 :alt: Load All Instances
933 - Click on any VM displayed in the Instances tab and click the Console
936 .. figure:: ./images/vtn/Instance_Console.png
937 :alt: Instance Console
941 - Login to the VM console and verify with a ping command.
943 .. figure:: ./images/vtn/Instance_ping.png
948 Verification of Control and Compute Node after VM creation
949 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
951 - Every time a new VM is created, more interfaces are added to the
952 br-int bridge in Open vSwitch.
954 - Use *sudo ovs-vsctl show* to list the number of interfaces added.
956 - Please visit the DLUX GUI to list the new nodes in every switch.
958 Getting started with DLUX
959 ^^^^^^^^^^^^^^^^^^^^^^^^^
961 Ensure that you have created a topology and enabled MD-SAL feature in
962 the Karaf distribution before you use DLUX for network management.
967 To log in to DLUX, after installing the application: \* Open a browser
968 and enter the login URL. If you have installed DLUX as a stand-alone,
969 then the login URL is http://localhost:9000/DLUX/index.html. However if
970 you have deployed DLUX with Karaf, then the login URL is
971 `http://\\<your <http://\<your>`__ IP\\>:8181/dlux/index.html. \* Login
972 to the application with user ID and password credentials as admin.
973 NOTE:admin is the only user type available for DLUX in this release.
978 To get a complete DLUX feature list, install restconf, odl l2 switch,
979 and switch while you start the DLUX distribution.
981 .. figure:: ./images/vtn/Dlux_login.png
988 DLUX enables only those modules, whose APIs are responding. If you
989 enable just the MD-SAL in beginning and then start dlux, only MD-SAL
990 related tabs will be visible. While using the GUI if you enable
991 AD-SAL karaf features, those tabs will appear automatically.
993 Viewing Network Statistics
994 ^^^^^^^^^^^^^^^^^^^^^^^^^^
996 The Nodes module on the left pane enables you to view the network
997 statistics and port information for the switches in the network. \* To
998 use the Nodes module: \*\* Select Nodeson the left pane.
1002 The right pane displays atable that lists all the nodes, node connectors and the statistics.
1004 - Enter a node ID in the Search Nodes tab to search by node connectors.
1006 - Click on the Node Connector number to view details such as port ID,
1007 port name, number of ports per switch, MAC Address, and so on.
1009 - Click Flows in the Statistics column to view Flow Table Statistics
1010 for the particular node like table ID, packet match, active flows and
1013 - Click Node Connectors to view Node Connector Statistics for the
1016 Viewing Network Topology
1017 ^^^^^^^^^^^^^^^^^^^^^^^^
1019 To view network topology: \* Select Topology on the left pane. You will
1020 view the graphical representation on the right pane.
1025 blue boxes represent the switches,black represents the hosts available, and lines represents how switches are connected.
1029 DLUX UI does not provide ability to add topology information. The
1030 Topology should be created using an open flow plugin. Controller
1031 stores this information in the database and displays on the DLUX
1032 page, when the you connect to the controller using OpenFlow.
1034 .. figure:: ./images/vtn/Dlux_topology.png
1039 OpenStack PackStack Installation Steps
1040 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1042 - Please go through the below wiki page for OpenStack PackStack
1045 - https://wiki.opendaylight.org/view/Release/Lithium/VTN/User_Guide/Openstack_Packstack_Support
1050 - http://devstack.org/guides/multinode-lab.html
1052 - https://wiki.opendaylight.org/view/File:Vtn_demo_hackfest_2014_march.pdf
1054 VTN Manager Usage Examples
1055 --------------------------
1057 How to provision virtual L2 Network
1058 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1063 This page explains how to provision virtual L2 network using VTN
1064 Manager. This page targets Boron release, so the procedure described
1065 here does not work in other releases.
1067 .. figure:: ./images/vtn/How_to_provision_virtual_L2_network.png
1068 :alt: Virtual L2 network for host1 and host3
1070 Virtual L2 network for host1 and host3
1078 - To provision OpenFlow switches, this page uses Mininet. Mininet
1079 details and set-up can be referred at the following page:
1080 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
1082 - Start Mininet and create three switches(s1, s2, and s3) and four
1083 hosts(h1, h2, h3, and h4) in it.
1087 mininet@mininet-vm:~$ sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
1091 Replace "192.168.0.100" with the IP address of OpenDaylight
1092 controller based on your environment.
1094 - you can check the topology that you have created by executing "net"
1095 command in the Mininet console.
1104 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3
1105 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
1106 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
1108 - In this guide, you will provision the virtual L2 network to establish
1109 communication between h1 and h3.
1114 To provision the virtual L2 network for the two hosts (h1 and h3),
1115 execute REST API provided by VTN Manager as follows. It uses curl
1116 command to call the REST API.
1118 - Create a virtual tenant named vtn1 by executing `the update-vtn
1119 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1123 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1125 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1127 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1131 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1"}}'
1133 - Create two interfaces into the virtual bridge by executing `the
1135 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1139 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1"}}'
1143 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2"}}'
1145 - Configure two mappings on the created interfaces by executing `the
1147 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1149 - The interface if1 of the virtual bridge will be mapped to the port
1150 "s2-eth1" of the switch "openflow:2" of the Mininet.
1152 - The h1 is connected to the port "s2-eth1".
1154 - The interface if2 of the virtual bridge will be mapped to the port
1155 "s3-eth1" of the switch "openflow:3" of the Mininet.
1157 - The h3 is connected to the port "s3-eth1".
1161 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:2", "port-name":"s2-eth1"}}'
1165 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth1"}}'
1170 - Please execute ping from h1 to h3 to verify if the virtual L2 network
1171 for h1 and h3 is provisioned successfully.
1176 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
1177 64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=243 ms
1178 64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.341 ms
1179 64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.078 ms
1180 64 bytes from 10.0.0.3: icmp_seq=4 ttl=64 time=0.079 ms
1182 - You can also verify the configuration by executing the following REST
1183 API. It shows all configuration in VTN Manager.
1187 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/
1189 - The result of the command should be like this.
1199 "idle-timeout": 300,
1215 "vinterface-status": {
1216 "entity-state": "UP",
1218 "mapped-port": "openflow:3:3"
1220 "vinterface-config": {
1223 "port-map-config": {
1225 "port-name": "s3-eth1",
1226 "node": "openflow:3"
1231 "vinterface-status": {
1232 "entity-state": "UP",
1234 "mapped-port": "openflow:2:1"
1236 "vinterface-config": {
1239 "port-map-config": {
1241 "port-name": "s2-eth1",
1242 "node": "openflow:2"
1256 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
1257 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
1261 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1263 How To Test Vlan-Map In Mininet Environment
1264 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1269 This page explains how to test Vlan-map in a multi host scenario using
1270 mininet. This page targets Boron release, so the procedure described
1271 here does not work in other releases.
1273 .. figure:: ./images/vtn/vlanmap_using_mininet.png
1274 :alt: Example that demonstrates vlanmap testing in Mininet
1277 Example that demonstrates vlanmap testing in Mininet Environment
1282 Save the mininet script given below as vlan\_vtn\_test.py and run the
1283 mininet script in the mininet environment where Mininet is installed.
1288 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_hosts_in_different_vlan
1290 - Run the mininet script
1294 sudo mn --controller=remote,ip=192.168.64.13 --custom vlan_vtn_test.py --topo mytopo
1298 Replace "192.168.64.13" with the IP address of OpenDaylight
1299 controller based on your environment.
1301 - You can check the topology that you have created by executing "net"
1302 command in the Mininet console.
1307 h1 h1-eth0.200:s1-eth1
1308 h2 h2-eth0.300:s2-eth2
1309 h3 h3-eth0.200:s2-eth3
1310 h4 h4-eth0.300:s2-eth4
1311 h5 h5-eth0.200:s3-eth2
1312 h6 h6-eth0.300:s3-eth3
1313 s1 lo: s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
1314 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
1315 s3 lo: s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
1321 To test vlan-map, execute REST API provided by VTN Manager as follows.
1323 - Create a virtual tenant named vtn1 by executing `the update-vtn
1324 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1328 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1330 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1332 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1336 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
1338 - Configure a vlan map with vlanid 200 for vBridge vbr1 by executing
1340 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vlan-map.html#add-vlan-map>`__.
1344 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vlan-map:add-vlan-map -d '{"input":{"vlan-id":200,"tenant-name":"vtn1","bridge-name":"vbr1"}}'
1346 - Create a virtual bridge named vbr2 in the tenant vtn1 by executing
1348 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1352 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr2"}}'
1354 - Configure a vlan map with vlanid 300 for vBridge vbr2 by executing
1356 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vlan-map.html#add-vlan-map>`__.
1360 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vlan-map:add-vlan-map -d '{"input":{"vlan-id":300,"tenant-name":"vtn1","bridge-name":"vbr2"}}'
1365 - Please execute pingall in mininet environment to view the host
1371 Ping: testing ping reachability
1379 - You can also verify the configuration by executing the following REST
1380 API. It shows all configurations in VTN Manager.
1384 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1386 - The result of the command should be like this.
1397 "idle-timeout": 300,
1398 "description": "creating vtn"
1404 "age-interval": 600,
1405 "description": "creating vbr2"
1413 "map-id": "ANY.300",
1414 "vlan-map-config": {
1417 "vlan-map-status": {
1426 "age-interval": 600,
1427 "description": "creating vbr1"
1435 "map-id": "ANY.200",
1436 "vlan-map-config": {
1439 "vlan-map-status": {
1454 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
1455 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
1459 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
1461 How To Configure Service Function Chaining using VTN Manager
1462 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1467 This page explains how to configure VTN Manager for Service Chaining.
1468 This page targets Boron release, so the procedure described here
1469 does not work in other releases.
1471 .. figure:: ./images/vtn/Service_Chaining_With_One_Service.png
1472 :alt: Service Chaining With One Service
1474 Service Chaining With One Service
1479 - Please refer to the `Installation
1480 Pages <https://wiki.opendaylight.org/view/VTN:Boron:Installation_Guide>`__
1481 to run ODL with VTN Feature enabled.
1483 - Please ensure Bridge-Utils package is installed in mininet
1484 environment before running the mininet script.
1486 - To install Bridge-Utils package run sudo apt-get install bridge-utils
1487 (assuming Ubuntu is used to run mininet, If not then this is not
1490 - Save the mininet script given below as topo\_handson.py and run the
1491 mininet script in the mininet environment where Mininet is installed.
1496 - `Script for emulating network with multiple
1497 hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet>`__.
1499 - Before executing the mininet script, please confirm Controller is up
1502 - Run the mininet script.
1504 - Replace <path> and <Controller IP> based on your environment
1508 sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
1513 h11 h11-eth0:s1-eth1
1514 h12 h12-eth0:s1-eth2
1515 h21 h21-eth0:s2-eth1
1516 h22 h22-eth0:s2-eth2
1517 h23 h23-eth0:s2-eth3
1518 srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
1519 srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
1520 s1 lo: s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
1521 s2 lo: s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
1522 s3 lo: s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
1523 s4 lo: s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
1531 - Please follow the below steps to configure the network in mininet as
1534 .. figure:: ./images/vtn/Mininet_Configuration.png
1535 :alt: Mininet Configuration
1537 Mininet Configuration
1539 Configure service nodes
1540 '''''''''''''''''''''''
1542 - Please execute the following commands in the mininet console where
1543 mininet script is executed.
1547 mininet> srvc1 ip addr del 10.0.0.6/8 dev srvc1-eth0
1548 mininet> srvc1 brctl addbr br0
1549 mininet> srvc1 brctl addif br0 srvc1-eth0
1550 mininet> srvc1 brctl addif br0 srvc1-eth1
1551 mininet> srvc1 ifconfig br0 up
1552 mininet> srvc1 tc qdisc add dev srvc1-eth1 root netem delay 200ms
1553 mininet> srvc2 ip addr del 10.0.0.7/8 dev srvc2-eth0
1554 mininet> srvc2 brctl addbr br0
1555 mininet> srvc2 brctl addif br0 srvc2-eth0
1556 mininet> srvc2 brctl addif br0 srvc2-eth1
1557 mininet> srvc2 ifconfig br0 up
1558 mininet> srvc2 tc qdisc add dev srvc2-eth1 root netem delay 300ms
1566 - Please execute the below commands to configure the network topology
1567 in the controller as in the below image:
1569 .. figure:: ./images/vtn/Tenant2.png
1574 Please execute the below commands in controller
1575 '''''''''''''''''''''''''''''''''''''''''''''''
1579 The below commands are for the difference in behavior of Manager in
1580 Boron topology. The Link below has the details for this bug:
1581 https://bugs.opendaylight.org/show_bug.cgi?id=3818.
1585 curl --user admin:admin -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X PUT http://localhost:8181/restconf/config/vtn-static-topology:vtn-static-topology/static-edge-ports -d '{"static-edge-ports": {"static-edge-port": [ {"port": "openflow:3:3"}, {"port": "openflow:3:4"}, {"port": "openflow:4:3"}, {"port": "openflow:4:4"}]}}'
1587 - Create a virtual tenant named vtn1 by executing `the update-vtn
1588 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
1592 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1","update-mode":"CREATE","operation":"SET","description":"creating vtn","idle-timeout":300,"hard-timeout":0}}'
1594 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
1596 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
1600 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"creating vbr","tenant-name":"vtn1","bridge-name":"vbr1"}}'
1602 - Create interface if1 into the virtual bridge vbr1 by executing `the
1604 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1608 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif1 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
1610 - Configure port mapping on the interface by executing `the
1612 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1614 - The interface if1 of the virtual bridge will be mapped to the port
1615 "s1-eth2" of the switch "openflow:1" of the Mininet.
1617 - The h12 is connected to the port "s1-eth2".
1621 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","node":"openflow:1","port-name":"s1-eth2"}}'
1623 - Create interface if2 into the virtual bridge vbr1 by executing `the
1625 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1629 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif2 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
1631 - Configure port mapping on the interface by executing `the
1633 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1635 - The interface if2 of the virtual bridge will be mapped to the port
1636 "s2-eth2" of the switch "openflow:2" of the Mininet.
1638 - The h22 is connected to the port "s2-eth2".
1642 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2","node":"openflow:2","port-name":"s2-eth2"}}'
1644 - Create interface if3 into the virtual bridge vbr1 by executing `the
1646 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1650 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vbrif3 interface","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if3"}}'
1652 - Configure port mapping on the interfaces by executing `the
1654 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1656 - The interface if3 of the virtual bridge will be mapped to the port
1657 "s2-eth3" of the switch "openflow:2" of the Mininet.
1659 - The h23 is connected to the port "s2-eth3".
1663 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"vlan-id":0,"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if3","node":"openflow:2","port-name":"s2-eth3"}}'
1668 - Create flowcondition named cond\_1 by executing `the
1670 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1672 - For option source and destination-network, get inet address of
1673 host h12(src) and h22(dst) from mininet.
1677 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"index":1,"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.2/32","destination-network":"10.0.0.4/32"}}]}}'
1679 - Flow filter demonstration with DROP action-type. Create Flowfilter in
1680 VBR Interface if1 by executing `the set-flow-filter
1681 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1685 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","index":10,"vtn-drop-filter":{}}]}}'
1693 - Please execute the below commands to configure the network topology
1694 which sends some specific traffic via a single service(External
1695 device) in the controller as in the below image:
1697 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_LLD.png
1698 :alt: Service Chaining With One Service LLD
1700 Service Chaining With One Service LLD
1702 - Create a virtual terminal named vt\_srvc1\_1 in the tenant vtn1 by
1703 executing `the update-vterminal
1704 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1708 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc1_1","description":"Creating vterminal"}}'
1710 - Create interface IF into the virtual terminal vt\_srvc1\_1 by
1711 executing `the update-vinterface
1712 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1716 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc1_1","interface-name":"IF"}}'
1718 - Configure port mapping on the interfaces by executing `the
1720 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1722 - The interface IF of the virtual terminal will be mapped to the
1723 port "s3-eth3" of the switch "openflow:3" of the Mininet.
1725 - The h12 is connected to the port "s3-eth3".
1729 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc1_1","interface-name":"IF","node":"openflow:3","port-name":"s3-eth3"}}'
1731 - Create a virtual terminal named vt\_srvc1\_2 in the tenant vtn1 by
1732 executing `the update-vterminal
1733 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1737 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","description":"Creating vterminal"}}'
1739 - Create interface IF into the virtual terminal vt\_srvc1\_2 by
1740 executing `the update-vinterface
1741 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1745 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF"}}'
1747 - Configure port mapping on the interfaces by executing `the
1749 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1751 - The interface IF of the virtual terminal will be mapped to the
1752 port "s4-eth3" of the switch "openflow:4" of the Mininet.
1754 - The h22 is connected to the port "s4-eth3".
1758 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","node":"openflow:4","port-name":"s4-eth3"}}'
1760 - Create flowcondition named cond\_1 by executing `the
1762 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1764 - For option source and destination-network, get inet address of
1765 host h12(src) and h22(dst) from mininet.
1769 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1","vtn-flow-match":[{"index":1,"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.2/32","destination-network":"10.0.0.4/32"}}]}}'
1771 - Create flowcondition named cond\_any by executing `the
1773 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
1777 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_any","vtn-flow-match":[{"index":1}]}}'
1779 - Flow filter demonstration with redirect action-type. Create
1780 Flowfilter in virtual terminal vt\_srvc1\_2 interface IF by executing
1781 `the set-flow-filter
1782 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1784 - Flowfilter redirects vt\_srvc1\_2 to bridge1-IF2
1788 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"bridge-name":"vbr1","interface-name":"if2"},"output":"true"}}]}}'
1790 - Flow filter demonstration with redirect action-type. Create
1791 Flowfilter in vbridge vbr1 interface if1 by executing `the
1793 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1795 - Flow filter redirects Bridge1-IF1 to vt\_srvc1\_1
1799 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","index":10,"vtn-redirect-filter":{"redirect-destination":{"terminal-name":"vt_srvc1_1","interface-name":"IF"},"output":"true"}}]}}'
1804 .. figure:: ./images/vtn/Service_Chaining_With_One_Service_Verification.png
1805 :alt: Service Chaining With One Service
1807 Service Chaining With One Service
1809 - Ping host12 to host22 to view the host rechability, a delay of 200ms
1810 will be taken to reach host22 as below.
1814 mininet> h12 ping h22
1815 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1816 64 bytes from 10.0.0.4: icmp_seq=35 ttl=64 time=209 ms
1817 64 bytes from 10.0.0.4: icmp_seq=36 ttl=64 time=201 ms
1818 64 bytes from 10.0.0.4: icmp_seq=37 ttl=64 time=200 ms
1819 64 bytes from 10.0.0.4: icmp_seq=38 ttl=64 time=200 ms
1824 - Please execute the below commands to configure the network topology
1825 which sends some specific traffic via two services(External device)
1826 in the controller as in the below image.
1828 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services_LLD.png
1829 :alt: Service Chaining With Two Services LLD
1831 Service Chaining With Two Services LLD
1833 - Create a virtual terminal named vt\_srvc2\_1 in the tenant vtn1 by
1834 executing `the update-vterminal
1835 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1839 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc2_1","description":"Creating vterminal"}}'
1841 - Create interface IF into the virtual terminal vt\_srvc2\_1 by
1842 executing `the update-vinterface
1843 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1847 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc2_1","interface-name":"IF"}}'
1849 - Configure port mapping on the interfaces by executing `the
1851 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1853 - The interface IF of the virtual terminal will be mapped to the
1854 port "s3-eth4" of the switch "openflow:3" of the Mininet.
1856 - The host h12 is connected to the port "s3-eth4".
1860 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc2_1","interface-name":"IF","node":"openflow:3","port-name":"s3-eth4"}}'
1862 - Create a virtual terminal named vt\_srvc2\_2 in the tenant vtn1 by
1863 executing `the update-vterminal
1864 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vterminal.html#update-vterminal>`__.
1868 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vterminal:update-vterminal -d '{"input":{"update-mode":"CREATE","operation":"SET","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","description":"Creating vterminal"}}'
1870 - Create interfaces IF into the virtual terminal vt\_srvc2\_2 by
1871 executing `the update-vinterface
1872 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
1876 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"update-mode":"CREATE","operation":"SET","description":"Creating vterminal IF","enabled":"true","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF"}}'
1878 - Configure port mapping on the interfaces by executing `the
1880 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
1882 - The interface IF of the virtual terminal will be mapped to the
1883 port "s4-eth4" of the switch "openflow:4" of the mininet.
1885 - The host h22 is connected to the port "s4-eth4".
1889 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF","node":"openflow:4","port-name":"s4-eth4"}}'
1891 - Flow filter demonstration with redirect action-type. Create
1892 Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1893 `the set-flow-filter
1894 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1896 - Flow filter redirects vt\_srvc2\_2 to Bridge1-IF2.
1900 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc2_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"bridge-name":"vbr1","interface-name":"if2"},"output":"true"}}]}}'
1902 - Flow filter demonstration with redirect action-type. Create
1903 Flowfilter in virtual terminal vt\_srvc2\_2 interface IF by executing
1904 `the set-flow-filter
1905 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
1907 - Flow filter redirects vt\_srvc1\_2 to vt\_srvc2\_1.
1911 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input":{"output":"false","tenant-name":"vtn1","terminal-name":"vt_srvc1_2","interface-name":"IF","vtn-flow-filter":[{"condition":"cond_any","index":10,"vtn-redirect-filter":{"redirect-destination":{"terminal-name":"vt_srvc2_1","interface-name":"IF"},"output":"true"}}]}}'
1916 .. figure:: ./images/vtn/Service_Chaining_With_Two_Services.png
1917 :alt: Service Chaining With Two Service
1919 Service Chaining With Two Service
1921 - Ping host12 to host22 to view the host rechability, a delay of 500ms
1922 will be taken to reach host22 as below.
1926 mininet> h12 ping h22
1927 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
1928 64 bytes from 10.0.0.4: icmp_seq=1 ttl=64 time=512 ms
1929 64 bytes from 10.0.0.4: icmp_seq=2 ttl=64 time=501 ms
1930 64 bytes from 10.0.0.4: icmp_seq=3 ttl=64 time=500 ms
1931 64 bytes from 10.0.0.4: icmp_seq=4 ttl=64 time=500 ms
1933 - You can verify the configuration by executing the following REST API.
1934 It shows all configuration in VTN Manager.
1938 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
1948 "idle-timeout": 300,
1949 "description": "creating vtn"
1955 "age-interval": 600,
1956 "description": "creating vbr"
1965 "vinterface-status": {
1966 "mapped-port": "openflow:1:2",
1968 "entity-state": "UP"
1970 "port-map-config": {
1972 "node": "openflow:1",
1973 "port-name": "s1-eth2"
1975 "vinterface-config": {
1976 "description": "Creating vbrif1 interface",
1979 "vinterface-input-filter": {
1980 "vtn-flow-filter": [
1983 "condition": "cond_1",
1984 "vtn-redirect-filter": {
1986 "redirect-destination": {
1987 "terminal-name": "vt_srvc1_1",
1988 "interface-name": "IF"
1997 "vinterface-status": {
1998 "mapped-port": "openflow:2:2",
2000 "entity-state": "UP"
2002 "port-map-config": {
2004 "node": "openflow:2",
2005 "port-name": "s2-eth2"
2007 "vinterface-config": {
2008 "description": "Creating vbrif2 interface",
2014 "vinterface-status": {
2015 "mapped-port": "openflow:2:3",
2017 "entity-state": "UP"
2019 "port-map-config": {
2021 "node": "openflow:2",
2022 "port-name": "s2-eth3"
2024 "vinterface-config": {
2025 "description": "Creating vbrif3 interface",
2034 "name": "vt_srvc2_2",
2042 "vinterface-status": {
2043 "mapped-port": "openflow:4:4",
2045 "entity-state": "UP"
2047 "port-map-config": {
2049 "node": "openflow:4",
2050 "port-name": "s4-eth4"
2052 "vinterface-config": {
2053 "description": "Creating vterminal IF",
2056 "vinterface-input-filter": {
2057 "vtn-flow-filter": [
2060 "condition": "cond_any",
2061 "vtn-redirect-filter": {
2063 "redirect-destination": {
2064 "bridge-name": "vbr1",
2065 "interface-name": "if2"
2073 "vterminal-config": {
2074 "description": "Creating vterminal"
2078 "name": "vt_srvc1_1",
2086 "vinterface-status": {
2087 "mapped-port": "openflow:3:3",
2089 "entity-state": "UP"
2091 "port-map-config": {
2093 "node": "openflow:3",
2094 "port-name": "s3-eth3"
2096 "vinterface-config": {
2097 "description": "Creating vterminal IF",
2102 "vterminal-config": {
2103 "description": "Creating vterminal"
2107 "name": "vt_srvc1_2",
2115 "vinterface-status": {
2116 "mapped-port": "openflow:4:3",
2118 "entity-state": "UP"
2120 "port-map-config": {
2122 "node": "openflow:4",
2123 "port-name": "s4-eth3"
2125 "vinterface-config": {
2126 "description": "Creating vterminal IF",
2129 "vinterface-input-filter": {
2130 "vtn-flow-filter": [
2133 "condition": "cond_any",
2134 "vtn-redirect-filter": {
2136 "redirect-destination": {
2137 "terminal-name": "vt_srvc2_1",
2138 "interface-name": "IF"
2146 "vterminal-config": {
2147 "description": "Creating vterminal"
2151 "name": "vt_srvc2_1",
2159 "vinterface-status": {
2160 "mapped-port": "openflow:3:4",
2162 "entity-state": "UP"
2164 "port-map-config": {
2166 "node": "openflow:3",
2167 "port-name": "s3-eth4"
2169 "vinterface-config": {
2170 "description": "Creating vterminal IF",
2175 "vterminal-config": {
2176 "description": "Creating vterminal"
2187 - To clean up both VTN and flowconditions.
2189 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
2190 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2194 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2196 - You can delete the flowcondition cond\_1 and cond\_any by executing
2197 `the remove-flow-condition
2198 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
2202 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
2206 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_any"}}'
2208 How To View Dataflows
2209 ~~~~~~~~~~~~~~~~~~~~~
2214 This page explains how to view Dataflows using VTN Manager. This page
2215 targets Boron release, so the procedure described here does not work
2218 Dataflow feature enables retrieval and display of data flows in the
2219 OpenFlow network. The data flows can be retrieved based on an OpenFlow
2220 switch or a switch port or a L2 source host.
2222 The flow information provided by this feature are
2224 - Location of virtual node which maps the incoming packet and outgoing
2227 - Location of physical switch port where incoming and outgoing packets
2228 is sent and received.
2230 - A sequence of physical route info which represents the packet route
2231 in the physical network.
2236 - To view Dataflow information, configure with VLAN Mapping
2237 https://wiki.opendaylight.org/view/VTN:Mananger:How_to_test_Vlan-map_using_mininet.
2242 After creating vlan mapping configuration from the above page, execute
2243 as below in mininet to get switch details.
2248 h1 h1-eth0.200:s1-eth1
2249 h2 h2-eth0.300:s2-eth2
2250 h3 h3-eth0.200:s2-eth3
2251 h4 h4-eth0.300:s2-eth4
2252 h5 h5-eth0.200:s3-eth2
2253 h6 h6-eth0.300:s3-eth3
2254 s1 lo: s1-eth1:h1-eth0.200 s1-eth2:s2-eth1 s1-eth3:s3-eth1
2255 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0.300 s2-eth3:h3-eth0.200 s2-eth4:h4-eth0.300
2256 s3 lo: s3-eth1:s1-eth3 s3-eth2:h5-eth0.200 s3-eth3:h6-eth0.300
2260 Please execute ping from h1 to h3 to check hosts reachability.
2265 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2266 64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=11.4 ms
2267 64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.654 ms
2268 64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.093 ms
2270 Parallely execute below Restconf command to get data flow information of
2271 node "openflow:1" and its port "s1-eth1".
2273 - Get the Dataflows information by executing `the get-data-flow
2274 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow.html#get-data-flow>`__.
2278 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow:get-data-flow -d '{"input":{"tenant-name":"vtn1","mode":"DETAIL","node":"openflow:1","data-flow-port":{"port-id":"1","port-name":"s1-eth1"}}}'
2286 "averaged-data-flow-stats": {
2287 "packet-count": 1.1998800119988002,
2288 "start-time": 1455241209151,
2289 "end-time": 1455241219152,
2290 "byte-count": 117.58824117588242
2294 "physical-ingress-port": {
2295 "port-name": "s2-eth3",
2298 "physical-egress-port": {
2299 "port-name": "s2-eth1",
2302 "node": "openflow:2",
2306 "physical-ingress-port": {
2307 "port-name": "s1-eth2",
2310 "physical-egress-port": {
2311 "port-name": "s1-eth1",
2314 "node": "openflow:1",
2318 "data-egress-node": {
2319 "bridge-name": "vbr1",
2320 "tenant-name": "vtn1"
2323 "idle-timeout": 300,
2324 "data-flow-stats": {
2326 "nanosecond": 640000000,
2329 "packet-count": 134,
2332 "data-egress-port": {
2333 "node": "openflow:1",
2334 "port-name": "s1-eth1",
2337 "data-ingress-node": {
2338 "bridge-name": "vbr1",
2339 "tenant-name": "vtn1"
2341 "data-ingress-port": {
2342 "node": "openflow:2",
2343 "port-name": "s2-eth3",
2346 "creation-time": 1455240855753,
2347 "data-flow-match": {
2348 "vtn-ether-match": {
2350 "source-address": "6a:ff:e2:81:86:bb",
2351 "destination-address": "26:9f:82:70:ec:66"
2356 "reason": "VLANMAPPED",
2357 "virtual-node-path": {
2358 "bridge-name": "vbr1",
2359 "tenant-name": "vtn1"
2364 "reason": "FORWARDED",
2365 "virtual-node-path": {
2366 "bridge-name": "vbr1",
2367 "tenant-name": "vtn1"
2375 "averaged-data-flow-stats": {
2376 "packet-count": 1.1998800119988002,
2377 "start-time": 1455241209151,
2378 "end-time": 1455241219152,
2379 "byte-count": 117.58824117588242
2383 "physical-ingress-port": {
2384 "port-name": "s1-eth1",
2387 "physical-egress-port": {
2388 "port-name": "s1-eth2",
2391 "node": "openflow:1",
2395 "physical-ingress-port": {
2396 "port-name": "s2-eth1",
2399 "physical-egress-port": {
2400 "port-name": "s2-eth3",
2403 "node": "openflow:2",
2407 "data-egress-node": {
2408 "bridge-name": "vbr1",
2409 "tenant-name": "vtn1"
2412 "idle-timeout": 300,
2413 "data-flow-stats": {
2415 "nanosecond": 587000000,
2418 "packet-count": 134,
2421 "data-egress-port": {
2422 "node": "openflow:2",
2423 "port-name": "s2-eth3",
2426 "data-ingress-node": {
2427 "bridge-name": "vbr1",
2428 "tenant-name": "vtn1"
2430 "data-ingress-port": {
2431 "node": "openflow:1",
2432 "port-name": "s1-eth1",
2435 "creation-time": 1455240855747,
2436 "data-flow-match": {
2437 "vtn-ether-match": {
2439 "source-address": "26:9f:82:70:ec:66",
2440 "destination-address": "6a:ff:e2:81:86:bb"
2445 "reason": "VLANMAPPED",
2446 "virtual-node-path": {
2447 "bridge-name": "vbr1",
2448 "tenant-name": "vtn1"
2453 "reason": "FORWARDED",
2454 "virtual-node-path": {
2455 "bridge-name": "vbr1",
2456 "tenant-name": "vtn1"
2467 How To Create Mac Map In VTN
2468 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2473 - This page demonstrates Mac Mapping. This demonstration aims at
2474 enabling communication between two hosts and denying communication of
2475 particular host by associating a Vbridge to the hosts and configuring
2476 Mac Mapping (mac address) to the Vbridge.
2478 - This page targets Boron release, so the procedure described here
2479 does not work in other releases.
2481 .. figure:: ./images/vtn/Single_Controller_Mapping.png
2482 :alt: Single Controller Mapping
2484 Single Controller Mapping
2489 Configure mininet and create a topology
2490 '''''''''''''''''''''''''''''''''''''''
2492 - `Script for emulating network with multiple
2493 hosts <https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet#Network_with_Multiple_Hosts_for_Service_Function_Chain>`__.
2495 - Before executing the mininet script, please confirm Controller is up
2498 - Run the mininet script.
2500 - Replace <path> and <Controller IP> based on your environment.
2504 sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
2509 h11 h11-eth0:s1-eth1
2510 h12 h12-eth0:s1-eth2
2511 h21 h21-eth0:s2-eth1
2512 h22 h22-eth0:s2-eth2
2513 h23 h23-eth0:s2-eth3
2514 srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
2515 srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
2516 s1 lo: s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
2517 s2 lo: s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
2518 s3 lo: s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
2519 s4 lo: s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
2524 To create Mac Map in VTN, execute REST API provided by VTN Manager as
2525 follows. It uses curl command to call REST API.
2527 - Create a virtual tenant named Tenant1 by executing `the update-vtn
2528 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
2532 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2534 - Create a virtual bridge named vBridge1 in the tenant Tenant1 by
2535 executing `the update-vbridge
2536 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
2540 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"Tenant1","bridge-name":"vBridge1"}}'
2542 - Configuring Mac Mappings on the vBridge1 by giving the mac address of
2543 host h12 and host h22 as follows to allow the communication by
2544 executing `the set-mac-map
2545 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-mac-map.html#set-mac-map>`__.
2549 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-mac-map:set-mac-map -d '{"input":{"operation":"SET","allowed-hosts":["de:05:40:c4:96:76@0","62:c5:33:bc:d7:4e@0"],"tenant-name":"Tenant1","bridge-name":"vBridge1"}}'
2553 Mac Address of host h12 and host h22 can be obtained with the
2554 following command in mininet.
2558 mininet> h12 ifconfig
2559 h12-eth0 Link encap:Ethernet HWaddr 62:c5:33:bc:d7:4e
2560 inet addr:10.0.0.2 Bcast:10.255.255.255 Mask:255.0.0.0
2561 inet6 addr: fe80::60c5:33ff:febc:d74e/64 Scope:Link
2565 mininet> h22 ifconfig
2566 h22-eth0 Link encap:Ethernet HWaddr de:05:40:c4:96:76
2567 inet addr:10.0.0.4 Bcast:10.255.255.255 Mask:255.0.0.0
2568 inet6 addr: fe80::dc05:40ff:fec4:9676/64 Scope:Link
2570 - MAC Mapping will not be activated just by configuring it, a two end
2571 communication needs to be established to activate Mac Mapping.
2573 - Ping host h22 from host h12 in mininet, the ping will not happen
2574 between the hosts as only one way activation is enabled.
2578 mininet> h12 ping h22
2579 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2580 From 10.0.0.2 icmp_seq=1 Destination Host Unreachable
2581 From 10.0.0.2 icmp_seq=2 Destination Host Unreachable
2583 - Ping host h12 from host h22 in mininet, now the ping communication
2584 will take place as the two end communication is enabled.
2588 mininet> h22 ping h12
2589 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
2590 64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=91.8 ms
2591 64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.510 ms
2593 - After two end communication enabled, now host h12 can ping host h22
2597 mininet> h12 ping h22
2598 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
2599 64 bytes from 10.0.0.4: icmp_req=1 ttl=64 time=0.780 ms
2600 64 bytes from 10.0.0.4: icmp_req=2 ttl=64 time=0.079 ms
2605 - To view the configured Mac Map of allowed host execute the following
2610 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/Tenant1/vbridge/vBridge1/mac-map
2619 "mac-address": "c6:44:22:ba:3e:72",
2621 "port-id": "openflow:1:2"
2624 "mac-address": "f6:e0:43:b6:3a:b7",
2626 "port-id": "openflow:2:2"
2632 "vlan-host-desc-list": [
2634 "host": "c6:44:22:ba:3e:72@0"
2637 "host": "f6:e0:43:b6:3a:b7@0"
2647 When Deny is configured a broadcast message is sent to all the hosts
2648 connected to the vBridge, so a two end communication need not be
2649 establihed like allow, the hosts can communicate directly without
2650 any two way communication enabled.
2652 1. To Deny host h23 communication from hosts connected on vBridge1, the
2653 following configuration can be applied.
2657 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-mac-map:set-mac-map -d '{"input":{"operation": "SET", "denied-hosts": ["0a:d3:ea:3d:8f:a5@0"],"tenant-name": "Tenant1","bridge-name": "vBridge1"}}'
2662 - You can delete the virtual tenant Tenant1 by executing `the
2664 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2668 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"Tenant1"}}'
2670 How To Configure Flowfilters
2671 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2676 - This page explains how to provision flowfilter using VTN Manager.
2677 This page targets Boron release, so the procedure described here
2678 does not work in other releases.
2680 - The flow-filter function discards, permits, or redirects packets of
2681 the traffic within a VTN, according to specified flow conditions. The
2682 table below lists the actions to be applied when a packet matches the
2685 +-----------------------+----------------------------------------------------+
2686 | Action | Function |
2687 +=======================+====================================================+
2688 | Pass | | Permits the packet to pass along the determined |
2690 | | | As options, packet transfer priority (set |
2691 | | priority) and DSCP change (set ip-dscp) is |
2693 +-----------------------+----------------------------------------------------+
2694 | Drop | Discards the packet. |
2695 +-----------------------+----------------------------------------------------+
2696 | Redirect | | Redirects the packet to a desired virtual |
2698 | | | As an option, it is possible to change the MAC |
2699 | | address when the packet is transferred. |
2700 +-----------------------+----------------------------------------------------+
2702 .. figure:: ./images/vtn/flow_filter_example.png
2703 :alt: Flow Filter Example
2707 - Following steps explain flow-filter function:
2709 - when a packet is transferred to an interface within a virtual
2710 network, the flow-filter function evaluates whether the
2711 transferred packet matches the condition specifed in the
2714 - If the packet matches the condition, the flow-filter applies the
2715 flow-list matching action specified in the flow-filter.
2720 To apply the packet filter, configure the following:
2722 - Create a flow condition.
2724 - Specify where to apply the flow-filter, for example VTN, vBridge, or
2725 interface of vBridge.
2727 To provision OpenFlow switches, this page uses Mininet. Mininet details
2728 and set-up can be referred at the below page:
2729 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
2731 Start Mininet, and create three switches (s1, s2, and s3) and four hosts
2732 (h1, h2, h3 and h4) in it.
2736 sudo mn --controller=remote,ip=192.168.0.100 --topo tree,2
2740 Replace "192.168.0.100" with the IP address of OpenDaylight
2741 controller based on your environment.
2743 You can check the topology that you have created by executing "net"
2744 command in the Mininet console.
2753 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3
2754 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
2755 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
2757 In this guide, you will provision flowfilters to establish communication
2763 To provision the virtual L2 network for the two hosts (h1 and h3),
2764 execute REST API provided by VTN Manager as follows. It uses curl
2765 command to call the REST API.
2767 - Create a virtual tenant named vtn1 by executing `the update-vtn
2768 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
2772 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2774 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
2776 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
2780 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
2782 - Create two interfaces into the virtual bridge by executing `the
2784 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
2788 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
2792 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
2794 - Configure two mappings on the interfaces by executing `the
2796 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
2798 - The interface if1 of the virtual bridge will be mapped to the port
2799 "s2-eth1" of the switch "openflow:2" of the Mininet.
2801 - The h1 is connected to the port "s2-eth1".
2803 - The interface if2 of the virtual bridge will be mapped to the port
2804 "s3-eth1" of the switch "openflow:3" of the Mininet.
2806 - The h3 is connected to the port "s3-eth1".
2810 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:2", "port-name":"s2-eth1"}}'
2814 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth1"}}'
2816 - Create flowcondition named cond\_1 by executing `the
2818 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
2820 - For option source and destination-network, get inet address of
2821 host h1 and h3 from mininet.
2825 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.3/32"},"index":"1"}]}}'
2827 - Flowfilter can be applied either in VTN, VBR or VBR Interfaces. Here
2828 in this page we provision flowfilter with VBR Interface and
2829 demonstrate with action type drop and then pass.
2831 - Flow filter demonstration with DROP action-type. Create Flowfilter in
2832 VBR Interface if1 by executing `the set-flow-filter
2833 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
2837 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input": {"tenant-name": "vtn1", "bridge-name": "vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","vtn-drop-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]}}'
2839 Verification of the drop filter
2840 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2842 - Please execute ping from h1 to h3. As we have applied the action type
2843 "drop" , ping should fail with no packet flows between hosts h1 and
2850 Configuration for pass filter
2851 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2853 - Update the flow filter to pass the packets by executing `the
2855 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-filter.html#set-flow-filter>`__.
2859 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-filter:set-flow-filter -d '{"input": {"tenant-name": "vtn1", "bridge-name": "vbr1","interface-name":"if1","vtn-flow-filter":[{"condition":"cond_1","vtn-pass-filter":{},"vtn-flow-action":[{"order": "1","vtn-set-inet-src-action":{"ipv4-address":"10.0.0.1/32"}},{"order": "2","vtn-set-inet-dst-action":{"ipv4-address":"10.0.0.3/32"}}],"index": "1"}]}}'
2861 Verification For Packets Success
2862 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2864 - As we have applied action type PASS now ping should happen between
2870 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
2871 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.984 ms
2872 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.110 ms
2873 64 bytes from 10.0.0.3: icmp_req=3 ttl=64 time=0.098 ms
2875 - You can also verify the configurations by executing the following
2876 REST API. It shows all configuration in VTN Manager.
2880 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns/vtn/vtn1
2890 "idle-timeout": 300,
2891 "description": "creating vtn"
2897 "age-interval": 600,
2898 "description": "creating vBridge1"
2907 "vinterface-status": {
2908 "mapped-port": "openflow:2:1",
2910 "entity-state": "UP"
2912 "port-map-config": {
2914 "node": "openflow:2",
2915 "port-name": "s2-eth1"
2917 "vinterface-config": {
2918 "description": "Creating if1 interface",
2921 "vinterface-input-filter": {
2922 "vtn-flow-filter": [
2925 "condition": "cond_1",
2926 "vtn-flow-action": [
2929 "vtn-set-inet-src-action": {
2930 "ipv4-address": "10.0.0.1/32"
2935 "vtn-set-inet-dst-action": {
2936 "ipv4-address": "10.0.0.3/32"
2940 "vtn-pass-filter": {}
2944 "condition": "cond_1",
2945 "vtn-drop-filter": {}
2952 "vinterface-status": {
2953 "mapped-port": "openflow:3:1",
2955 "entity-state": "UP"
2957 "port-map-config": {
2959 "node": "openflow:3",
2960 "port-name": "s3-eth1"
2962 "vinterface-config": {
2963 "description": "Creating if2 interface",
2977 - To clean up both VTN and flowcondition.
2979 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
2980 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
2984 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
2986 - You can delete the flowcondition cond\_1 by executing `the
2987 remove-flow-condition
2988 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
2992 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
2994 How to use VTN to change the path of the packet flow
2995 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3000 - This page explains how to create specific VTN Pathmap using VTN
3001 Manager. This page targets Boron release, so the procedure
3002 described here does not work in other releases.
3004 .. figure:: ./images/vtn/Pathmap.png
3012 - Save the mininet script given below as pathmap\_test.py and run the
3013 mininet script in the mininet environment where Mininet is installed.
3015 - Create topology using the below mininet script:
3019 from mininet.topo import Topo
3020 class MyTopo( Topo ):
3021 "Simple topology example."
3022 def __init__( self ):
3023 "Create custom topo."
3024 # Initialize topology
3025 Topo.__init__( self )
3026 # Add hosts and switches
3027 leftHost = self.addHost( 'h1' )
3028 rightHost = self.addHost( 'h2' )
3029 leftSwitch = self.addSwitch( 's1' )
3030 middleSwitch = self.addSwitch( 's2' )
3031 middleSwitch2 = self.addSwitch( 's4' )
3032 rightSwitch = self.addSwitch( 's3' )
3034 self.addLink( leftHost, leftSwitch )
3035 self.addLink( leftSwitch, middleSwitch )
3036 self.addLink( leftSwitch, middleSwitch2 )
3037 self.addLink( middleSwitch, rightSwitch )
3038 self.addLink( middleSwitch2, rightSwitch )
3039 self.addLink( rightSwitch, rightHost )
3040 topos = { 'mytopo': ( lambda: MyTopo() ) }
3042 - After creating new file with the above script start the mininet as
3047 sudo mn --controller=remote,ip=10.106.138.124 --custom pathmap_test.py --topo mytopo
3051 Replace "10.106.138.124" with the IP address of OpenDaylight
3052 controller based on your environment.
3059 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
3060 s2 lo: s2-eth1:s1-eth2 s2-eth2:s3-eth1
3061 s3 lo: s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
3062 s4 lo: s4-eth1:s1-eth3 s4-eth2:s3-eth2
3065 - Generate traffic by pinging between host h1 and host h2 before
3066 creating the portmaps respectively.
3071 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3072 From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
3073 From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
3074 From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
3075 From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
3080 - To change the path of the packet flow, execute REST API provided by
3081 VTN Manager as follows. It uses curl command to call the REST API.
3083 - Create a virtual tenant named vtn1 by executing `the update-vtn
3084 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#update-vtn>`__.
3088 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:update-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3090 - Create a virtual bridge named vbr1 in the tenant vtn1 by executing
3092 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vbridge.html#update-vbridge>`__.
3096 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vbridge:update-vbridge -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1"}}'
3098 - Create two interfaces into the virtual bridge by executing `the
3100 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-vinterface.html#update-vinterface>`__.
3104 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if1"}}'
3108 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-vinterface:update-vinterface -d '{"input":{"tenant-name":"vtn1","bridge-name":"vbr1","interface-name":"if2"}}'
3110 - Configure two mappings on the interfaces by executing `the
3112 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-port-map.html#set-port-map>`__.
3114 - The interface if1 of the virtual bridge will be mapped to the port
3115 "s2-eth1" of the switch "openflow:1" of the Mininet.
3117 - The h1 is connected to the port "s1-eth1".
3119 - The interface if2 of the virtual bridge will be mapped to the port
3120 "s3-eth1" of the switch "openflow:3" of the Mininet.
3122 - The h3 is connected to the port "s3-eth3".
3126 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if1", "node":"openflow:1", "port-name":"s1-eth1"}}'
3130 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-port-map:set-port-map -d '{"input":{"tenant-name":"vtn1", "bridge-name":"vbr1", "interface-name":"if2", "node":"openflow:3", "port-name":"s3-eth3"}}'
3132 - Genarate traffic by pinging between host h1 and host h2 after
3133 creating the portmaps respectively.
3138 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
3139 64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.861 ms
3140 64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.101 ms
3141 64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.101 ms
3143 - Get the Dataflows information by executing `the get-data-flow
3144 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow.html#get-data-flow>`__.
3148 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow:get-data-flow -d '{"input":{"tenant-name":"vtn1","mode":"DETAIL","node":"openflow:1","data-flow-port":{"port-id":1,"port-name":"s1-eth1"}}}'
3150 - Create flowcondition named cond\_1 by executing `the
3152 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#set-flow-condition>`__.
3154 - For option source and destination-network, get inet address of
3155 host h1 or host h2 from mininet
3159 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:set-flow-condition -d '{"input":{"operation":"SET","present":"false","name":"cond_1", "vtn-flow-match":[{"vtn-ether-match":{},"vtn-inet-match":{"source-network":"10.0.0.1/32","protocol":1,"destination-network":"10.0.0.2/32"},"index":"1"}]}}'
3161 - Create pathmap with flowcondition cond\_1 by executing `the
3163 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-path-map.html#set-path-map>`__.
3167 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-map:set-path-map -d '{"input":{"tenant-name":"vtn1","path-map-list":[{"condition":"cond_1","policy":"1","index": "1","idle-timeout":"300","hard-timeout":"0"}]}}'
3169 - Create pathpolicy by executing `the set-path-policy
3170 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-path-policy.html#set-path-policy>`__.
3174 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-path-policy:set-path-policy -d '{"input":{"operation":"SET","id": "1","default-cost": "10000","vtn-path-cost": [{"port-desc":"openflow:1,3,s1-eth3","cost":"1000"},{"port-desc":"openflow:4,2,s4-eth2","cost":"1000"},{"port-desc":"openflow:3,3,s3-eth3","cost":"100000"}]}}'
3179 - Before applying Path policy get node information by executing get
3188 "physical-ingress-port": {
3189 "port-name": "s3-eth3",
3192 "physical-egress-port": {
3193 "port-name": "s3-eth1",
3196 "node": "openflow:3",
3200 "physical-ingress-port": {
3201 "port-name": "s2-eth2",
3204 "physical-egress-port": {
3205 "port-name": "s2-eth1",
3208 "node": "openflow:2",
3212 "physical-ingress-port": {
3213 "port-name": "s1-eth2",
3216 "physical-egress-port": {
3217 "port-name": "s1-eth1",
3220 "node": "openflow:1",
3224 "data-egress-node": {
3225 "interface-name": "if1",
3226 "bridge-name": "vbr1",
3227 "tenant-name": "vtn1"
3229 "data-egress-port": {
3230 "node": "openflow:1",
3231 "port-name": "s1-eth1",
3234 "data-ingress-node": {
3235 "interface-name": "if2",
3236 "bridge-name": "vbr1",
3237 "tenant-name": "vtn1"
3239 "data-ingress-port": {
3240 "node": "openflow:3",
3241 "port-name": "s3-eth3",
3248 - After applying Path policy get node information by executing get
3257 "physical-ingress-port": {
3258 "port-name": "s1-eth1",
3261 "physical-egress-port": {
3262 "port-name": "s1-eth3",
3265 "node": "openflow:1",
3269 "physical-ingress-port": {
3270 "port-name": "s4-eth1",
3273 "physical-egress-port": {
3274 "port-name": "s4-eth2",
3277 "node": "openflow:4",
3281 "physical-ingress-port": {
3282 "port-name": "s3-eth2",
3285 "physical-egress-port": {
3286 "port-name": "s3-eth3",
3289 "node": "openflow:3",
3293 "data-egress-node": {
3294 "interface-name": "if2",
3295 "bridge-name": "vbr1",
3296 "tenant-name": "vtn1"
3298 "data-egress-port": {
3299 "node": "openflow:3",
3300 "port-name": "s3-eth3",
3303 "data-ingress-node": {
3304 "interface-name": "if1",
3305 "bridge-name": "vbr1",
3306 "tenant-name": "vtn1"
3308 "data-ingress-port": {
3309 "node": "openflow:1",
3310 "port-name": "s1-eth1",
3318 - To clean up both VTN and flowcondition.
3320 - You can delete the virtual tenant vtn1 by executing `the remove-vtn
3321 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn.html#remove-vtn>`__.
3325 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
3327 - You can delete the flowcondition cond\_1 by executing `the
3328 remove-flow-condition
3329 RPC <https://nexus.opendaylight.org/content/sites/site/org.opendaylight.vtn/boron/manager.model/models/vtn-flow-condition.html#remove-flow-condition>`__.
3333 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn-flow-condition:remove-flow-condition -d '{"input":{"name":"cond_1"}}'
3335 VTN Coordinator Usage Examples
3336 ------------------------------
3338 How to configure L2 Network with Single Controller
3339 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3344 This example provides the procedure to demonstrate configuration of VTN
3345 Coordinator with L2 network using VTN Virtualization(single controller).
3346 Here is the Example for vBridge Interface Mapping with Single Controller
3347 using mininet. mininet details and set-up can be referred at below URL:
3348 https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
3350 .. figure:: ./images/vtn/vtn-single-controller-topology-example.png
3351 :alt: EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3353 EXAMPLE DEMONSTRATING SINGLE CONTROLLER
3358 - Configure mininet and create a topology:
3362 mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
3368 s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1
3369 s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0
3376 - Create a Controller named controllerone and mention its ip-address in
3377 the below create-controller command.
3381 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.0.0.2", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3383 - Create a VTN named vtn1 by executing the create-vtn command
3387 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3389 - Create a vBridge named vBridge1 in the vtn1 by executing the
3394 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
3396 - Create two Interfaces named if1 and if2 into the vBridge1
3400 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3404 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
3406 - Get the list of logical ports configured
3410 Curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/controllerone/domains/\(DEFAULT\)/logical_ports.json
3412 - Configure two mappings on each of the interfaces by executing the
3415 The interface if1 of the virtual bridge will be mapped to the port
3416 "s2-eth1" of the switch "openflow:2" of the Mininet. The h1 is connected
3417 to the port "s2-eth1".
3419 The interface if2 of the virtual bridge will be mapped to the port
3420 "s3-eth1" of the switch "openflow:3" of the Mininet. The h3 is connected
3421 to the port "s3-eth1".
3425 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:03-s3-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
3426 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
3431 Please verify whether the Host1 and Host3 are pinging.
3433 - Send packets from Host1 to Host3
3438 PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
3439 64 bytes from 10.0.0.3: icmp_req=1 ttl=64 time=0.780 ms
3440 64 bytes from 10.0.0.3: icmp_req=2 ttl=64 time=0.079 ms
3442 How to configure L2 Network with Multiple Controllers
3443 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3445 - This example provides the procedure to demonstrate configuration of
3446 VTN Coordinator with L2 network using VTN Virtualization Here is the
3447 Example for vBridge Interface Mapping with Multi-controller using
3450 .. figure:: ./images/vtn/MutiController_Example_diagram.png
3451 :alt: EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3453 EXAMPLE DEMONSTRATING MULTIPLE CONTROLLERS
3458 - Configure multiple controllers using the mininet script given below:
3459 https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_%28VTN%29:Scripts:Mininet#Network_with_multiple_switches_and_OpenFlow_controllers
3464 - Create a VTN named vtn3 by executing the create-vtn command
3468 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn3"}}' http://127.0.0.1:8083/vtn-webapi/vtns.json
3470 - Create two Controllers named odc1 and odc2 with its ip-address in the
3471 below create-controller command.
3475 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "odc1", "ipaddr":"10.100.9.52", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3479 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "odc2", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
3481 - Create two vBridges in the VTN like, vBridge1 in Controller1 and
3482 vBridge2 in Controller2
3486 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr1","controller_id":"odc1","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges.json
3490 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vbr2","controller_id":"odc2","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges.json
3492 - Create two Interfaces if1, if2 for the two vBridges vbr1 and vbr2.
3496 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
3500 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
3504 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
3508 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
3510 - Get the list of logical ports configured
3514 curl --user admin:adminpass -H 'content-type: application/json' -X GET http://127.0.0.1:8083/vtn-webapi/controllers/odc1/domains/\(DEFAULT\)/logical_ports/detail.json
3516 - Create boundary and vLink for the two controllers
3520 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"boundary": {"boundary_id": "b1", "link": {"controller1_id": "odc1", "domain1_id": "(DEFAULT)", "logical_port1_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth3", "controller2_id": "odc2", "domain2_id": "(DEFAULT)", "logical_port2_id": "PP-OF:00:00:00:00:00:00:00:04-s4-eth3"}}}' http://127.0.0.1:8083/vtn-webapi/boundaries.json
3524 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vlink": {"vlk_name": "vlink1" , "vnode1_name": "vbr1", "if1_name":"if2", "vnode2_name": "vbr2", "if2_name": "if2", "boundary_map": {"boundary_id":"b1","vlan_id": "50"}}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vlinks.json
3526 - Configure two mappings on each of the interfaces by executing the
3529 The interface if1 of the vbr1 will be mapped to the port "s2-eth2" of
3530 the switch "openflow:2" of the Mininet. The h2 is connected to the port
3533 The interface if2 of the vbr2 will be mapped to the port "s5-eth2" of
3534 the switch "openflow:5" of the Mininet. The h6 is connected to the port
3539 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces/if1/portmap.json
3543 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:05-s5-eth2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces/if1/portmap.json
3548 Please verify whether Host h2 and Host h6 are pinging.
3550 - Send packets from h2 to h6
3558 PING 10.0.0.6 (10.0.0.3) 56(84) bytes of data.
3559 64 bytes from 10.0.0.6: icmp_req=1 ttl=64 time=0.780 ms
3560 64 bytes from 10.0.0.6: icmp_req=2 ttl=64 time=0.079 ms
3562 How To Test Vlan-Map In Mininet Environment
3563 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3568 This example explains how to test vlan-map in a multi host scenario.
3570 .. figure:: ./images/vtn/vlanmap_using_mininet.png
3571 :alt: Example that demonstrates vlanmap testing in Mininet
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