Skip to content

Commit 7399e54

Browse files
inocybe-jenkinsGerrit Code Review
authored andcommitted
Merge "Added HowTo content provided"
2 parents 73901b6 + 3d8931e commit 7399e54

15 files changed

+884
-81
lines changed
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
== Overview
2+
This example demonstrates on how to create a specific VTN Path Map information.
3+
4+
image::pathmap.PNG[600px-pathmap]
5+
6+
== Requirement
7+
* Save the mininet script given below as pathmap_test.py and run the mininet script in the mininet environment where Mininet is installed.
8+
9+
* Create topology using the below mininet script:
10+
[cols=*3,2a,^,options="header",width="75%"]
11+
|===
12+
|from mininet.topo import Topo
13+
class MyTopo( Topo ):
14+
"Simple topology example."
15+
def __init__( self ):
16+
"Create custom topo."
17+
# Initialize topology
18+
Topo.__init__( self )
19+
# Add hosts and switches
20+
leftHost = self.addHost( 'h1' )
21+
rightHost = self.addHost( 'h2' )
22+
leftSwitch = self.addSwitch( 's1' )
23+
middleSwitch = self.addSwitch( 's2' )
24+
middleSwitch2 = self.addSwitch( 's4' )
25+
rightSwitch = self.addSwitch( 's3' )
26+
# Add links
27+
self.addLink( leftHost, leftSwitch )
28+
self.addLink( leftSwitch, middleSwitch )
29+
self.addLink( leftSwitch, middleSwitch2 )
30+
self.addLink( middleSwitch, rightSwitch )
31+
self.addLink( middleSwitch2, rightSwitch )
32+
self.addLink( rightSwitch, rightHost )
33+
topos = { 'mytopo': ( lambda: MyTopo() ) }
34+
|===
35+
36+
* mininet> net
37+
c0
38+
s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1 s1-eth3:s4-eth1
39+
s2 lo: s2-eth1:s1-eth2 s2-eth2:s3-eth1
40+
s3 lo: s3-eth1:s2-eth2 s3-eth2:s4-eth2 s3-eth3:h2-eth0
41+
s4 lo: s4-eth1:s1-eth3 s4-eth2:s3-eth2
42+
h1 h1-eth0:s1-eth1
43+
h2 h2-eth0:s3-eth3
44+
45+
* Generate traffic by pinging between hosts h1 and h2 before creating the portmaps respectively
46+
mininet> h1 ping h2
47+
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
48+
From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
49+
From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
50+
From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
51+
From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
52+
53+
== Configuration
54+
* .Create Controller
55+
[cols=*3,2a,^,options="header",width="75%"]
56+
|===
57+
{
58+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
59+
|}
60+
|===
61+
* .Create a VTN
62+
[cols=*3,2a,^,options="header",width="75%"]
63+
|===
64+
{
65+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
66+
|}
67+
|===
68+
* .Create a vBridge in the VTN
69+
[cols=*3,2a,^,options="header",width="75%"]
70+
|===
71+
{
72+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
73+
|}
74+
|===
75+
* .Create two Interfaces into the vBridge
76+
[cols=*3,2a,^,options="header",width="75%"]
77+
|===
78+
{
79+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
80+
|-
81+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
82+
|}
83+
|===
84+
* .Configure two mappings on the interfaces
85+
[cols=*3,2a,^,options="header",width="75%"]
86+
|===
87+
{
88+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
89+
|-
90+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
91+
|}
92+
|===
93+
* .Generate traffic by pinging between hosts h1 and h2 after creating the portmaps respectively
94+
mininet> h1 ping h2
95+
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
96+
64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=36.4 ms
97+
64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=0.880 ms
98+
64 bytes from 10.0.0.2: icmp_req=3 ttl=64 time=0.073 ms
99+
64 bytes from 10.0.0.2: icmp_req=4 ttl=64 time=0.081 ms
100+
* .Get the VTN Dataflows information
101+
[cols=*3,2a,^,options="header",width="75%"]
102+
|===
103+
{
104+
|curl -X GET -H 'content-type: application/json' --user 'admin:adminpass' -H 'ipaddr:127.0.0.1' "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"
105+
|}
106+
|===
107+
* .Create a Flowcondition in the VTN
108+
[cols=*3,2a,^,options="header",width="75%"]
109+
|===
110+
{|curl --user admin:admin -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X PUT -d '{"name": "flowcond_1","match": [{"index": 1,"ethernet": {"src": "ca:9e:58:0c:1e:f0","dst": "ba:bd:0f:e3:a8:c8","type": 2048},"inetMatch": {"inet4": {"src": "10.0.0.1","dst": "10.0.0.2","protocol": 1}}}]}' http://10.100.9.42:8080/controller/nb/v2/vtn/default/flowconditions/flowcond_1
111+
|}
112+
|===
113+
* .Create a Pathmap in the VTN
114+
[cols=*3,2a,^,options="header",width="75%"]
115+
|===
116+
{
117+
|curl --user admin:admin -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X PUT -d '{"index": 10, "condition":"flowcond_1", "policy":1, "idleTimeout": 300, "hardTimeout": 0}' http://10.100.9.42:8080/controller/nb/v2/vtn/default/pathmaps/1
118+
|}
119+
|===
120+
* .Get the Path policy information
121+
[cols=*3,2a,^,options="header",width="75%"]
122+
|===
123+
{
124+
|curl --user admin:admin -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X GET -d '{"id": 1,"default": 100000,"cost": [{"location": {"node": {"type": "OF","id": "00:00:00:00:00:00:00:01"},"port": {"type": "OF","id": "3","name": "s1-eth3"}},"cost": 1000},{"location": {"node": {"type": "OF","id": "00:00:00:00:00:00:00:04"},"port": {"type": "OF","id": "2","name": "s4-eth2"}},"cost": 1000},{"location": {"node": {"type": "OF", "id": "00:00:00:00:00:00:00:03"},"port": {"type": "OF","id": "3","name": "s3-eth3"}},"cost": 100000}]}' http://10.100.9.42:8080/controller/nb/v2/vtn/default/pathpolicies/1
125+
|}
126+
|===
127+
== Verification
128+
== Before applying Path policy information in the VTN
129+
[cols=*3,2a,^,options="header",width="75%"]
130+
|===
131+
{
132+
"pathinfos": [
133+
{
134+
"in_port_name": "s1-eth1",
135+
"out_port_name": "s1-eth2",
136+
"switch_id": "00:00:00:00:00:00:00:01"
137+
},
138+
{
139+
"in_port_name": "s2-eth1",
140+
"out_port_name": "s2-eth2",
141+
"switch_id": "00:00:00:00:00:00:00:02"
142+
},
143+
{
144+
"in_port_name": "s3-eth1",
145+
"out_port_name": "s3-eth3",
146+
"switch_id": "00:00:00:00:00:00:00:03"
147+
}
148+
]
149+
}
150+
|===
151+
== After applying Path policy information in the VTN
152+
[cols=*3,2a,^,options="header",width="75%"]
153+
|===
154+
{
155+
"pathinfos": [
156+
{
157+
"in_port_name": "s1-eth1",
158+
"out_port_name": "s1-eth3",
159+
"switch_id": "00:00:00:00:00:00:00:01"
160+
},
161+
{
162+
"in_port_name": "s4-eth1",
163+
"out_port_name": "s4-eth2",
164+
"switch_id": "00:00:00:00:00:00:00:04"
165+
},
166+
{
167+
"in_port_name": "s3-eth2",
168+
"out_port_name": "s3-eth3",
169+
"switch_id": "00:00:00:00:00:00:00:03"
170+
}
171+
]
172+
}
173+
|===
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
OpenDaylight Virtual Tenant Network (VTN):VTN Coordinator:RestApi:How to configure L2 Network with Multiple Controllers
2+
3+
== Overview
4+
This example provides the procedure to demonstrate configuration of VTN Coordinator with L2 network using VTN Virtualization
5+
Here is the Example for vBridge Interface Mapping with Multi-controller using mininet.
6+
7+
image::MutiController_Example_diagram.PNG[EXAMPLE DEMONSTRATING MULTICONTROLLER]
8+
9+
== Requirements
10+
* Configure multiple controllers using the mininet script given below: [[OpenDaylight_Virtual_Tenant_Network_(VTN):Installation:VTN_Manager#Multiple_Clusters_of_Controllers|Mininet script to configure multiple controllers]].
11+
12+
== Configuration
13+
* Create a VTN
14+
[cols=*3,2a,^,options="header",width="75%"]
15+
|===
16+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"vtn" : {"vtn_name":"vtn3"}}' http://127.0.0.1:8083/vtn-webapi/vtns.json
17+
|===
18+
* Create two Controllers
19+
[cols=*3,2a,^,options="header",width="75%"]
20+
|===
21+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
22+
|===
23+
[cols=*3,2a,^,options="header",width="75%"]
24+
|===
25+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
26+
|===
27+
* Create two vBridges in the VTN like, vBridge1 in Controller1 and vBridge2 in Controller2
28+
[cols=*3,2a,^,options="header",width="75%"]
29+
|===
30+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
31+
|===
32+
[cols=*3,2a,^,options="header",width="75%"]
33+
|===
34+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
35+
|===
36+
* Create vBridge Interfaces
37+
[cols=*3,2a,^,options="header",width="75%"]
38+
|===
39+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
40+
|===
41+
[cols=*3,2a,^,options="header",width="75%"]
42+
|===
43+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr1/interfaces.json
44+
|===
45+
[cols=*3,2a,^,options="header",width="75%"]
46+
|===
47+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"interface": {"if_name": "if1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
48+
|===
49+
[cols=*3,2a,^,options="header",width="75%"]
50+
|===
51+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"interface": {"if_name": "if2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn3/vbridges/vbr2/interfaces.json
52+
|===
53+
* Get the list of logical ports configured
54+
[cols=*3,2a,^,options="header",width="75%"]
55+
|===
56+
|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
57+
|===
58+
* Create boundary and vLink
59+
[cols=*3,2a,^,options="header",width="75%"]
60+
|===
61+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
62+
|===
63+
[cols=*3,2a,^,options="header",width="75%"]
64+
|===
65+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
66+
|==
67+
* Configure port-map on the interfaces
68+
[cols=*3,2a,^,options="header",width="75%"]
69+
|===
70+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
71+
|===
72+
[cols=*3,2a,^,options="header",width="75%"]
73+
|===
74+
|curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
75+
|===
76+
== Verification
77+
Please verify whether Host h2 and Host h6 are pinging.
78+
* Send packets from h2 to h6
79+
[cols=*3,2a,^,options="header",width="75%"]
80+
|===
81+
|mininet> h2 ping h6
82+
|===
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
OpenDaylight Virtual Tenant Network (VTN):VTN Coordinator:RestApi:How to configure L2 Network with Single Controller
2+
3+
== Overview
4+
5+
This example provides the procedure to demonstrate configuration of VTN Coordinator with L2 network using VTN Virtualization(single controller). Here is the Example for vBridge Interface Mapping with Single Controller using mininet. mininet details and set-up can be referred at below URL:
6+
https://wiki.opendaylight.org/view/OpenDaylight_Controller:Installation#Using_Mininet
7+
8+
image::Single_Controller_Mapping.PNG[EXAMPLE DEMONSTRATING SINGLE CONTROLLER]
9+
10+
== Requirements
11+
12+
* Configure mininet and create a topology:
13+
[cols=*3,2a,^,options="header",width="75%"]
14+
|===
15+
|mininet@mininet-vm:~$ sudo mn --controller=remote,ip=<controller-ip> --topo tree,2
16+
|===
17+
18+
* mininet> net
19+
[cols=*3,2a,^,options="header",width="75%"]
20+
|===
21+
|
22+
s1 lo: s1-eth1:h1-eth0 s1-eth2:s2-eth1
23+
s2 lo: s2-eth1:s1-eth2 s2-eth2:h2-eth0
24+
h1 h1-eth0:s1-eth1
25+
h2 h2-eth0:s2-eth2
26+
|===
27+
== Configuration
28+
29+
* Create a Controller
30+
[cols=*3,2a,^,options="header",width="75%"]
31+
|===
32+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
33+
|===
34+
35+
* Create a VTN
36+
[cols=*3,2a,^,options="header",width="75%"]
37+
|===
38+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
39+
|===
40+
41+
* Create a vBridge in the VTN
42+
[cols=*3,2a,^,options="header",width="75%"]
43+
|===
44+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
45+
|===
46+
47+
* Create two Interfaces into the vBridge
48+
49+
[cols=*3,2a,^,options="header",width="75%"]
50+
|===
51+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
52+
|===
53+
54+
[cols=*3,2a,^,options="header",width="75%"]
55+
|===
56+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
57+
|===
58+
59+
* Get the list of logical ports configured
60+
[cols=*3,2a,^,options="header",width="75%"]
61+
|===
62+
| curl --user admin:adminpass -H 'content-type: application/json' -X GET -H 'ipaddr:127.0.0.1' http://127.0.0.1:8083/vtn-webapi/controllers/controllerone/domains/\(DEFAULT\)/logical_ports.json
63+
|===
64+
65+
* Configure two mappings on the interfaces
66+
[cols=*3,2a,^,options="header",width="75%"]
67+
|===
68+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
69+
|===
70+
[cols=*3,2a,^,options="header",width="75%"]
71+
|===
72+
| curl --user admin:adminpass -H 'content-type: application/json' -H 'ipaddr:127.0.0.1' -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
73+
|===
74+
75+
== Verification
76+
77+
Please verify whether the Host1 and Host3 are pinging.
78+
* Send packets from Host1 to Host3
79+
[cols=*3,2a,^,options="header",width="75%"]
80+
|===
81+
|mininet> h1 ping h3
82+
|===
83+

0 commit comments

Comments
 (0)