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 ====== Configure service nodes
54 * Please execute the following commands in the mininet console where mininet script is executed.
57 mininet> srvc1 ip addr del 10.0.0.6/8 dev srvc1-eth0
58 mininet> srvc1 brctl addbr br0
59 mininet> srvc1 brctl addif br0 srvc1-eth0
60 mininet> srvc1 brctl addif br0 srvc1-eth1
61 mininet> srvc1 ifconfig br0 up
62 mininet> srvc1 tc qdisc add dev srvc1-eth1 root netem delay 200ms
63 mininet> srvc2 ip addr del 10.0.0.7/8 dev srvc2-eth0
64 mininet> srvc2 brctl addbr br0
65 mininet> srvc2 brctl addif br0 srvc2-eth0
66 mininet> srvc2 brctl addif br0 srvc2-eth1
67 mininet> srvc2 ifconfig br0 up
68 mininet> srvc2 tc qdisc add dev srvc2-eth1 root netem delay 300ms
75 * Please execute the below commands to configure the network topology in the controller as in the below image:
78 image::vtn/Tenant2.png["Tenant2",width=500]
80 ====== Please execute the below commands in controller
83 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.
86 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"}]}}'
89 * Create a virtual tenant named vtn1 by executing
90 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].
93 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}}'
96 * Create a virtual bridge named vbr1 in the tenant vtn1 by executing
97 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].
100 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"}}'
103 * Create interface if1 into the virtual bridge vbr1 by executing
104 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].
107 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"}}'
110 * Configure port mapping on the interface by executing
111 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].
113 ** The interface if1 of the virtual bridge will be mapped to the port "s1-eth2" of the switch "openflow:1" of the Mininet.
115 *** The h12 is connected to the port "s1-eth2".
118 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"}}'
121 * Create interface if2 into the virtual bridge vbr1 by executing
122 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].
125 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"}}'
128 * Configure port mapping on the interface by executing
129 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].
131 ** The interface if2 of the virtual bridge will be mapped to the port "s2-eth2" of the switch "openflow:2" of the Mininet.
133 *** The h22 is connected to the port "s2-eth2".
136 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"}}'
139 * Create interface if3 into the virtual bridge vbr1 by executing
140 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].
143 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"}}'
146 * Configure port mapping on the interfaces by executing
147 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].
149 ** The interface if3 of the virtual bridge will be mapped to the port "s2-eth3" of the switch "openflow:2" of the Mininet.
151 *** The h23 is connected to the port "s2-eth3".
154 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"}}'
157 ===== Traffic filtering
159 * Create flowcondition named cond_1 by executing
160 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].
162 ** For option source and destination-network, get inet address of host h12(src) and h22(dst) from mininet.
165 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"}}]}}'
168 * Flow filter demonstration with DROP action-type. Create Flowfilter in VBR Interface if1 by executing
169 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].
172 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":{}}]}}'
175 ===== Service Chaining
177 ====== With One Service
179 * 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:
181 .Service Chaining With One Service LLD
182 image::vtn/Service_Chaining_With_One_Service_LLD.png["Service Chaining With One Service LLD",width=500]
184 * Create a virtual terminal named vt_srvc1_1 in the tenant vtn1 by executing
185 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].
188 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"}}'
191 * Create interface IF into the virtual terminal vt_srvc1_1 by executing
192 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].
195 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"}}'
198 * Configure port mapping on the interfaces by executing
199 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].
201 ** The interface IF of the virtual terminal will be mapped to the port "s3-eth3" of the switch "openflow:3" of the Mininet.
203 *** The h12 is connected to the port "s3-eth3".
206 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"}}'
209 * Create a virtual terminal named vt_srvc1_2 in the tenant vtn1 by executing
210 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].
213 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"}}'
216 * Create interface IF into the virtual terminal vt_srvc1_2 by executing
217 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].
220 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"}}'
223 * Configure port mapping on the interfaces by executing
224 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].
226 ** The interface IF of the virtual terminal will be mapped to the port "s4-eth3" of the switch "openflow:4" of the Mininet.
228 *** The h22 is connected to the port "s4-eth3".
231 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"}}'
234 * Create flowcondition named cond_1 by executing
235 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].
237 ** For option source and destination-network, get inet address of host h12(src) and h22(dst) from mininet.
240 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"}}]}}'
243 * Create flowcondition named cond_any by executing
244 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].
247 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}]}}'
250 * Flow filter demonstration with redirect action-type. Create Flowfilter in virtual terminal vt_srvc1_2 interface IF by executing
251 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].
253 ** Flowfilter redirects vt_srvc1_2 to bridge1-IF2
256 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"}}]}}'
259 * Flow filter demonstration with redirect action-type. Create Flowfilter in vbridge vbr1 interface if1 by executing
260 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].
262 ** Flow filter redirects Bridge1-IF1 to vt_srvc1_1
265 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"}}]}}'
270 .Service Chaining With One Service
271 image::vtn/Service_Chaining_With_One_Service_Verification.png["Service Chaining With One Service Verification",width=500]
273 * Ping host12 to host22 to view the host rechability, a delay of 200ms will be taken to reach host22 as below.
276 mininet> h12 ping h22
277 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
278 64 bytes from 10.0.0.4: icmp_seq=35 ttl=64 time=209 ms
279 64 bytes from 10.0.0.4: icmp_seq=36 ttl=64 time=201 ms
280 64 bytes from 10.0.0.4: icmp_seq=37 ttl=64 time=200 ms
281 64 bytes from 10.0.0.4: icmp_seq=38 ttl=64 time=200 ms
284 ====== With two services
286 * 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.
288 .Service Chaining With Two Services LLD
289 image::vtn/Service_Chaining_With_Two_Services_LLD.png["Service Chaining With Two Services LLD",width=500]
291 * Create a virtual terminal named vt_srvc2_1 in the tenant vtn1 by executing
292 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].
295 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"}}'
298 * Create interface IF into the virtual terminal vt_srvc2_1 by executing
299 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].
302 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"}}'
305 * Configure port mapping on the interfaces by executing
306 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].
308 ** The interface IF of the virtual terminal will be mapped to the port "s3-eth4" of the switch "openflow:3" of the Mininet.
310 *** The host h12 is connected to the port "s3-eth4".
313 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"}}'
316 * Create a virtual terminal named vt_srvc2_2 in the tenant vtn1 by executing
317 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].
320 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"}}'
323 * Create interfaces IF into the virtual terminal vt_srvc2_2 by executing
324 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].
327 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"}}'
330 * Configure port mapping on the interfaces by executing
331 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].
333 ** The interface IF of the virtual terminal will be mapped to the port "s4-eth4" of the switch "openflow:4" of the mininet.
335 *** The host h22 is connected to the port "s4-eth4".
338 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"}}'
341 * Flow filter demonstration with redirect action-type. Create Flowfilter in virtual terminal vt_srvc2_2 interface IF by executing
342 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].
344 ** Flow filter redirects vt_srvc2_2 to Bridge1-IF2.
347 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"}}]}}'
350 * Flow filter demonstration with redirect action-type. Create Flowfilter in virtual terminal vt_srvc2_2 interface IF by executing
351 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].
353 ** Flow filter redirects vt_srvc1_2 to vt_srvc2_1.
356 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"}}]}}'
361 .Service Chaining With Two Service
362 image::vtn/Service_Chaining_With_Two_Services.png["Service Chaining With Two Services",width=500]
364 * Ping host12 to host22 to view the host rechability, a delay of 500ms will be taken to reach host22 as below.
367 mininet> h12 ping h22
368 PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
369 64 bytes from 10.0.0.4: icmp_seq=1 ttl=64 time=512 ms
370 64 bytes from 10.0.0.4: icmp_seq=2 ttl=64 time=501 ms
371 64 bytes from 10.0.0.4: icmp_seq=3 ttl=64 time=500 ms
372 64 bytes from 10.0.0.4: icmp_seq=4 ttl=64 time=500 ms
375 * You can verify the configuration by executing the following REST API. It shows all configuration in VTN Manager.
378 curl --user "admin":"admin" -H "Content-type: application/json" -X GET http://localhost:8181/restconf/operational/vtn:vtns
389 "description": "creating vtn"
396 "description": "creating vbr"
405 "vinterface-status": {
406 "mapped-port": "openflow:1:2",
412 "node": "openflow:1",
413 "port-name": "s1-eth2"
415 "vinterface-config": {
416 "description": "Creating vbrif1 interface",
419 "vinterface-input-filter": {
423 "condition": "cond_1",
424 "vtn-redirect-filter": {
426 "redirect-destination": {
427 "terminal-name": "vt_srvc1_1",
428 "interface-name": "IF"
437 "vinterface-status": {
438 "mapped-port": "openflow:2:2",
444 "node": "openflow:2",
445 "port-name": "s2-eth2"
447 "vinterface-config": {
448 "description": "Creating vbrif2 interface",
454 "vinterface-status": {
455 "mapped-port": "openflow:2:3",
461 "node": "openflow:2",
462 "port-name": "s2-eth3"
464 "vinterface-config": {
465 "description": "Creating vbrif3 interface",
474 "name": "vt_srvc2_2",
482 "vinterface-status": {
483 "mapped-port": "openflow:4:4",
489 "node": "openflow:4",
490 "port-name": "s4-eth4"
492 "vinterface-config": {
493 "description": "Creating vterminal IF",
496 "vinterface-input-filter": {
500 "condition": "cond_any",
501 "vtn-redirect-filter": {
503 "redirect-destination": {
504 "bridge-name": "vbr1",
505 "interface-name": "if2"
513 "vterminal-config": {
514 "description": "Creating vterminal"
518 "name": "vt_srvc1_1",
526 "vinterface-status": {
527 "mapped-port": "openflow:3:3",
533 "node": "openflow:3",
534 "port-name": "s3-eth3"
536 "vinterface-config": {
537 "description": "Creating vterminal IF",
542 "vterminal-config": {
543 "description": "Creating vterminal"
547 "name": "vt_srvc1_2",
555 "vinterface-status": {
556 "mapped-port": "openflow:4:3",
562 "node": "openflow:4",
563 "port-name": "s4-eth3"
565 "vinterface-config": {
566 "description": "Creating vterminal IF",
569 "vinterface-input-filter": {
573 "condition": "cond_any",
574 "vtn-redirect-filter": {
576 "redirect-destination": {
577 "terminal-name": "vt_srvc2_1",
578 "interface-name": "IF"
586 "vterminal-config": {
587 "description": "Creating vterminal"
591 "name": "vt_srvc2_1",
599 "vinterface-status": {
600 "mapped-port": "openflow:3:4",
606 "node": "openflow:3",
607 "port-name": "s3-eth4"
609 "vinterface-config": {
610 "description": "Creating vterminal IF",
615 "vterminal-config": {
616 "description": "Creating vterminal"
627 * To clean up both VTN and flowconditions.
629 * You can delete the virtual tenant vtn1 by executing
630 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].
633 curl --user "admin":"admin" -H "Content-type: application/json" -X POST http://localhost:8181/restconf/operations/vtn:remove-vtn -d '{"input":{"tenant-name":"vtn1"}}'
636 * You can delete the flowcondition cond_1 and cond_any by executing
637 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].
640 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"}}'
645 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"}}'