1 ==== How To Configure Service Function Chaining using VTN Manager
5 This page explains how to configure VTN Manager for Service Chaining. This page targets Beryllium release, so the procedure described here does not work in other releases.
7 .Service Chaining With One Service
8 image::vtn/Service_Chaining_With_One_Service.png["Service Chaining With One Service",width=500]
12 * Please refer to the https://wiki.opendaylight.org/view/VTN:Beryllium:Installation_Guide[Installation Pages] to run ODL with VTN Feature enabled.
13 * Please ensure Bridge-Utils package is installed in mininet environment before running the mininet script.
14 * To install Bridge-Utils package run sudo apt-get install bridge-utils (assuming Ubuntu is used to run mininet, If not then this is not required).
15 * Save the mininet script given below as topo_handson.py and run the mininet script in the mininet environment where Mininet is installed.
19 * https://wiki.opendaylight.org/view/OpenDaylight_Virtual_Tenant_Network_(VTN):Scripts:Mininet[Script for emulating network with multiple hosts].
20 * Before executing the mininet script, please confirm Controller is up and running.
21 * Run the mininet script.
22 * Replace <path> and <Controller IP> based on your environment
25 sudo mn --controller=remote,ip=<Controller IP> --custom <path>\topo_handson.py --topo mytopo2
35 srvc1 srvc1-eth0:s3-eth3 srvc1-eth1:s4-eth3
36 srvc2 srvc2-eth0:s3-eth4 srvc2-eth1:s4-eth4
37 s1 lo: s1-eth1:h11-eth0 s1-eth2:h12-eth0 s1-eth3:s2-eth4 s1-eth4:s3-eth2
38 s2 lo: s2-eth1:h21-eth0 s2-eth2:h22-eth0 s2-eth3:h23-eth0 s2-eth4:s1-eth3 s2-eth5:s4-eth1
39 s3 lo: s3-eth1:s4-eth2 s3-eth2:s1-eth4 s3-eth3:srvc1-eth0 s3-eth4:srvc2-eth0
40 s4 lo: s4-eth1:s2-eth5 s4-eth2:s3-eth1 s4-eth3:srvc1-eth1 s4-eth4:srvc2-eth1
47 * Please follow the below steps to configure the network in mininet as in the below image:
49 .Mininet Configuration
50 image::vtn/Mininet_Configuration.png["Mininet Configuration",width=500]
52 ====== Install flow entries
54 * In mininet environment, install the following flow entries to send PACKET_IN to the controller.
57 $ sudo ovs-ofctl add-flow s1 priority=0,actions=output:CONTROLLER
58 $ sudo ovs-ofctl add-flow s2 priority=0,actions=output:CONTROLLER
59 $ sudo ovs-ofctl add-flow s3 priority=0,actions=output:CONTROLLER
60 $ sudo ovs-ofctl add-flow s4 priority=0,actions=output:CONTROLLER
63 ====== Configure service nodes
65 * Please execute the following commands in the mininet console where mininet script is executed.
68 mininet> srvc1 ip addr del 10.0.0.6/8 dev srvc1-eth0
69 mininet> srvc1 brctl addbr br0
70 mininet> srvc1 brctl addif br0 srvc1-eth0
71 mininet> srvc1 brctl addif br0 srvc1-eth1
72 mininet> srvc1 ifconfig br0 up
73 mininet> srvc1 tc qdisc add dev srvc1-eth1 root netem delay 200ms
74 mininet> srvc2 ip addr del 10.0.0.7/8 dev srvc2-eth0
75 mininet> srvc2 brctl addbr br0
76 mininet> srvc2 brctl addif br0 srvc2-eth0
77 mininet> srvc2 brctl addif br0 srvc2-eth1
78 mininet> srvc2 ifconfig br0 up
79 mininet> srvc2 tc qdisc add dev srvc2-eth1 root netem delay 300ms
86 * Please execute the below commands to configure the network topology in the controller as in the below image:
89 image::vtn/Tenant2.png["Tenant2",width=500]
91 ====== Please execute the below commands in controller
94 The below commands are for the difference in behavior of Manager in Beryllium topology. The Link below has the details for this bug: https://bugs.opendaylight.org/show_bug.cgi?id=3818.
97 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"}]}}'
100 * Create a virtual tenant named vtn1 by executing
101 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#update-vtn[the update-vtn RPC].
104 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}}'
107 * Create a virtual bridge named vbr1 in the tenant vtn1 by executing
108 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vbridge.html#update-vbridge[the update-vbridge RPC].
111 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"}}'
114 * Create interface if1 into the virtual bridge vbr1 by executing
115 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface[the update-vinterface RPC].
118 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"}}'
121 * Configure port mapping on the interface by executing
122 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map[the set-port-map RPC].
124 ** The interface if1 of the virtual bridge will be mapped to the port "s1-eth2" of the switch "openflow:1" of the Mininet.
126 *** The h12 is connected to the port "s1-eth2".
129 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"}}'
132 * Create interface if2 into the virtual bridge vbr1 by executing
133 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface[the update-vinterface RPC].
136 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"}}'
139 * Configure port mapping on the interface by executing
140 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map[the set-port-map RPC].
142 ** The interface if2 of the virtual bridge will be mapped to the port "s2-eth2" of the switch "openflow:2" of the Mininet.
144 *** The h22 is connected to the port "s2-eth2".
147 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"}}'
150 * Create interface if3 into the virtual bridge vbr1 by executing
151 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface[the update-vinterface RPC].
154 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"}}'
157 * Configure port mapping on the interfaces by executing
158 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map[the set-port-map RPC].
160 ** The interface if3 of the virtual bridge will be mapped to the port "s2-eth3" of the switch "openflow:2" of the Mininet.
162 *** The h23 is connected to the port "s2-eth3".
165 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"}}'
168 ===== Traffic filtering
170 * Create flowcondition named cond_1 by executing
171 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#set-flow-condition[the set-flow-condition RPC].
173 ** For option source and destination-network, get inet address of host h12(src) and h22(dst) from mininet.
176 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"}}]}}'
179 * Flow filter demonstration with DROP action-type. Create Flowfilter in VBR Interface if1 by executing
180 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter[the set-flow-filter RPC].
183 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":{}}]}}'
186 ===== Service Chaining
188 ====== With One Service
190 * Please execute the below commands to configure the network topology which sends some specific traffic via a single service(External device) in the controller as in the below image:
192 .Service Chaining With One Service LLD
193 image::vtn/Service_Chaining_With_One_Service_LLD.png["Service Chaining With One Service LLD",width=500]
195 * Create a virtual terminal named vt_srvc1_1 in the tenant vtn1 by executing
196 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vterminal.html#update-vterminal[the update-vterminal RPC].
199 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"}}'
202 * Create interface IF into the virtual terminal vt_srvc1_1 by executing
203 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface[the update-vinterface RPC].
206 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"}}'
209 * Configure port mapping on the interfaces by executing
210 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map[the set-port-map RPC].
212 ** The interface IF of the virtual terminal will be mapped to the port "s3-eth3" of the switch "openflow:3" of the Mininet.
214 *** The h12 is connected to the port "s3-eth3".
217 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"}}'
220 * Create a virtual terminal named vt_srvc1_2 in the tenant vtn1 by executing
221 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vterminal.html#update-vterminal[the update-vterminal RPC].
224 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"}}'
227 * Create interface IF into the virtual terminal vt_srvc1_2 by executing
228 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface[the update-vinterface RPC].
231 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"}}'
234 * Configure port mapping on the interfaces by executing
235 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map[the set-port-map RPC].
237 ** The interface IF of the virtual terminal will be mapped to the port "s4-eth3" of the switch "openflow:4" of the Mininet.
239 *** The h22 is connected to the port "s4-eth3".
242 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"}}'
245 * Create flowcondition named cond_1 by executing
246 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#set-flow-condition[the set-flow-condition RPC].
248 ** For option source and destination-network, get inet address of host h12(src) and h22(dst) from mininet.
251 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"}}]}}'
254 * Create flowcondition named cond_any by executing
255 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#set-flow-condition[the set-flow-condition RPC].
258 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}]}}'
261 * Flow filter demonstration with redirect action-type. Create Flowfilter in virtual terminal vt_srvc1_2 interface IF by executing
262 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter[the set-flow-filter RPC].
264 ** Flowfilter redirects vt_srvc1_2 to bridge1-IF2
267 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"}}]}}'
270 * Flow filter demonstration with redirect action-type. Create Flowfilter in vbridge vbr1 interface if1 by executing
271 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter[the set-flow-filter RPC].
273 ** Flow filter redirects Bridge1-IF1 to vt_srvc1_1
276 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"}}]}}'
281 .Service Chaining With One Service
282 image::vtn/Service_Chaining_With_One_Service_Verification.png["Service Chaining With One Service Verification",width=500]
284 * Ping host12 to host22 to view the host rechability, a delay of 200ms will be taken to reach host22 as below.
287 mininet> h12 ping h22
288 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
289 64 bytes from 10.0.0.4: icmp_seq=35 ttl=64 time=209 ms
290 64 bytes from 10.0.0.4: icmp_seq=36 ttl=64 time=201 ms
291 64 bytes from 10.0.0.4: icmp_seq=37 ttl=64 time=200 ms
292 64 bytes from 10.0.0.4: icmp_seq=38 ttl=64 time=200 ms
295 ====== With two services
297 * Please execute the below commands to configure the network topology which sends some specific traffic via two services(External device) in the controller as in the below image.
299 .Service Chaining With Two Services LLD
300 image::vtn/Service_Chaining_With_Two_Services_LLD.png["Service Chaining With Two Services LLD",width=500]
302 * Create a virtual terminal named vt_srvc2_1 in the tenant vtn1 by executing
303 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vterminal.html#update-vterminal[the update-vterminal RPC].
306 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"}}'
309 * Create interface IF into the virtual terminal vt_srvc2_1 by executing
310 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface[the update-vinterface RPC].
313 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"}}'
316 * Configure port mapping on the interfaces by executing
317 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map[the set-port-map RPC].
319 ** The interface IF of the virtual terminal will be mapped to the port "s3-eth4" of the switch "openflow:3" of the Mininet.
321 *** The host h12 is connected to the port "s3-eth4".
324 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"}}'
327 * Create a virtual terminal named vt_srvc2_2 in the tenant vtn1 by executing
328 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vterminal.html#update-vterminal[the update-vterminal RPC].
331 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"}}'
334 * Create interfaces IF into the virtual terminal vt_srvc2_2 by executing
335 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-vinterface.html#update-vinterface[the update-vinterface RPC].
338 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"}}'
341 * Configure port mapping on the interfaces by executing
342 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-port-map.html#set-port-map[the set-port-map RPC].
344 ** The interface IF of the virtual terminal will be mapped to the port "s4-eth4" of the switch "openflow:4" of the mininet.
346 *** The host h22 is connected to the port "s4-eth4".
349 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"}}'
352 * Flow filter demonstration with redirect action-type. Create Flowfilter in virtual terminal vt_srvc2_2 interface IF by executing
353 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter[the set-flow-filter RPC].
355 ** Flow filter redirects vt_srvc2_2 to Bridge1-IF2.
358 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"}}]}}'
361 * Flow filter demonstration with redirect action-type. Create Flowfilter in virtual terminal vt_srvc2_2 interface IF by executing
362 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-filter.html#set-flow-filter[the set-flow-filter RPC].
364 ** Flow filter redirects vt_srvc1_2 to vt_srvc2_1.
367 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"}}]}}'
372 .Service Chaining With Two Service
373 image::vtn/Service_Chaining_With_Two_Services.png["Service Chaining With Two Services",width=500]
375 * Ping host12 to host22 to view the host rechability, a delay of 500ms will be taken to reach host22 as below.
378 mininet> h12 ping h22
379 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
380 64 bytes from 10.0.0.4: icmp_seq=1 ttl=64 time=512 ms
381 64 bytes from 10.0.0.4: icmp_seq=2 ttl=64 time=501 ms
382 64 bytes from 10.0.0.4: icmp_seq=3 ttl=64 time=500 ms
383 64 bytes from 10.0.0.4: icmp_seq=4 ttl=64 time=500 ms
386 * You can verify the configuration by executing the following REST API. It shows all configuration in VTN Manager.
389 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
400 "description": "creating vtn"
407 "description": "creating vbr"
416 "vinterface-status": {
417 "mapped-port": "openflow:1:2",
423 "node": "openflow:1",
424 "port-name": "s1-eth2"
426 "vinterface-config": {
427 "description": "Creating vbrif1 interface",
430 "vinterface-input-filter": {
434 "condition": "cond_1",
435 "vtn-redirect-filter": {
437 "redirect-destination": {
438 "terminal-name": "vt_srvc1_1",
439 "interface-name": "IF"
448 "vinterface-status": {
449 "mapped-port": "openflow:2:2",
455 "node": "openflow:2",
456 "port-name": "s2-eth2"
458 "vinterface-config": {
459 "description": "Creating vbrif2 interface",
465 "vinterface-status": {
466 "mapped-port": "openflow:2:3",
472 "node": "openflow:2",
473 "port-name": "s2-eth3"
475 "vinterface-config": {
476 "description": "Creating vbrif3 interface",
485 "name": "vt_srvc2_2",
493 "vinterface-status": {
494 "mapped-port": "openflow:4:4",
500 "node": "openflow:4",
501 "port-name": "s4-eth4"
503 "vinterface-config": {
504 "description": "Creating vterminal IF",
507 "vinterface-input-filter": {
511 "condition": "cond_any",
512 "vtn-redirect-filter": {
514 "redirect-destination": {
515 "bridge-name": "vbr1",
516 "interface-name": "if2"
524 "vterminal-config": {
525 "description": "Creating vterminal"
529 "name": "vt_srvc1_1",
537 "vinterface-status": {
538 "mapped-port": "openflow:3:3",
544 "node": "openflow:3",
545 "port-name": "s3-eth3"
547 "vinterface-config": {
548 "description": "Creating vterminal IF",
553 "vterminal-config": {
554 "description": "Creating vterminal"
558 "name": "vt_srvc1_2",
566 "vinterface-status": {
567 "mapped-port": "openflow:4:3",
573 "node": "openflow:4",
574 "port-name": "s4-eth3"
576 "vinterface-config": {
577 "description": "Creating vterminal IF",
580 "vinterface-input-filter": {
584 "condition": "cond_any",
585 "vtn-redirect-filter": {
587 "redirect-destination": {
588 "terminal-name": "vt_srvc2_1",
589 "interface-name": "IF"
597 "vterminal-config": {
598 "description": "Creating vterminal"
602 "name": "vt_srvc2_1",
610 "vinterface-status": {
611 "mapped-port": "openflow:3:4",
617 "node": "openflow:3",
618 "port-name": "s3-eth4"
620 "vinterface-config": {
621 "description": "Creating vterminal IF",
626 "vterminal-config": {
627 "description": "Creating vterminal"
638 * To clean up both VTN and flowconditions.
640 * You can delete the virtual tenant vtn1 by executing
641 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn.html#remove-vtn[the remove-vtn RPC].
644 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
647 * You can delete the flowcondition cond_1 and cond_any by executing
648 https://jenkins.opendaylight.org/releng/view/vtn/job/vtn-merge-beryllium/lastSuccessfulBuild/artifact/manager/model/target/site/models/vtn-flow-condition.html#remove-flow-condition[the remove-flow-condition RPC].
651 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"}}'
656 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"}}'