...
In this tutorial, we will go through a set of exercises to illustrate the behavior of the Cord Fabric use case on ONOS. With this tutorial, we hope you'll become familiar with the capabilities of the segment routing app and how it enables you to achieve better control of IP traffic. We also hope that you become familiar with a You will also play with the leaf-spine topology that represents the architecture for the CORD Fabric.
If you haven't done so it already, it's highly recommended that you go through the ONOS Tutorial first. This will give you some familiarity with the basic functionality of ONOS.
...
This VM already has all the dependencies necessary to run the Segment Routing application. Login in the VM with the following credentials:
user: mininet
password: mininet
2 - Start an ONOS Cluster
We configured the VM to automatically bring up 3 ONOS instances using LXC containers. They are already configured to form an ONOS cluster. To access it's its CLI type:
Code Block |
---|
$ onos -w $OC1 |
After you see the ONOS CLI, make sure the correct apps are running and the onos ONOS cluster is formed correctly:
Code Block |
---|
onos> nodes
id=10.0.3.215, address=10.0.3.215:9876, state=ACTIVE, updated=29m ago *
id=10.0.3.94, address=10.0.3.94:9876, state=ACTIVE, updated=29m ago
id=10.0.3.96, address=10.0.3.96:9876, state=ACTIVE, updated=29m ago
onos>
onos> apps -a -s
* 5 org.onosproject.segmentrouting 1.3.0.SNAPSHOT Segment routing application
* 19 org.onosproject.drivers 1.3.0.SNAPSHOT Builtin device drivers
* 21 org.onosproject.openflow 1.3.0.SNAPSHOT OpenFlow protocol southbound providers |
...
Each Leaf switch is connected to each Spine, each host all hosts under a Leaf share the same subnet.
...
Code Block |
---|
{ "comment": " Multilayer topology description and configuration", "restrictSwitches": true, "restrictLinks": true, "switchConfig": [ { "nodeDpid" : "of:0000000000000001", "name": "Leaf-R1", "type": "Router_SR", "allowed": true, "latitude": 80.80, "longitude": 90.10, "params": { "routerIp": "10.0.1.101/32", "routerMac": "00:00:00:00:01:80", "nodeSid": 101, "isEdgeRouter" : true, "subnets": [ { "portNo": 51, "subnetIp": "10.0.1.254/24" } ] } }, { "nodeDpid": "of:0000000000000002", "name": "Leaf-R2", "type": "Router_SR", "allowed": true, "latitude": 80.80, "longitude": 90.10, "params": { "routerIp": "10.0.2.101/32", "routerMac": "00:00:00:00:02:80", "nodeSid": 102, "isEdgeRouter" : true, "subnets": [ { "portNo": 51, "subnetIp": "10.0.2.254/24" } ] } }, { "nodeDpid": "of:0000000000000191", "name": "Spine-R1", "type": "Router_SR", "allowed": true, "latitude": 80.80, "longitude": 90.10, "params": { "routerIp": "192.168.0.11/32", "routerMac": "00:00:01:00:11:80", "nodeSid": 105, "isEdgeRouter" : false } }, { "nodeDpid": "of:0000000000000192", "name": "Spine-R2", "type": "Router_SR", "allowed": true, "latitude": 80.80, "longitude": 90.10, "params": { "routerIp": "192.168.0.22/32", "routerMac": "00:00:01:00:22:80", "nodeSid": 106, "isEdgeRouter" : false } } ] |
Let's start the mininet topology. :
Code Block |
---|
$ sudo -s #./cord_fabric.py mininet> h1 ifconfig h1-eth0 Link encap:Ethernet HWaddr 3a:b6:fe:90:0d:4f inet addr:10.0.1.1 Bcast:10.0.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
Notice h1 has IP 10.0.1.1 and its gateway to the outside world is 10.0.1.254, one a interface of the Leaf Router 1.
Code Block |
---|
mininet> h1 ifconfig h1-eth0 Link encap:Ethernet HWaddr 3a:b6:fe:90:0d:4f inet addr:10.0.1.1 Bcast:10.0.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) mininet> h1 ip route default via 10.0.1.254 dev h1-eth0 10.0.1.0/24 dev h1-eth0 proto kernel scope link src 10.0.1.1 |
Let's try to ping that interface.
Code Block |
---|
mininet> h1 ping 10.0.1.254 PING 10.0.1.254 (10.0.1.254) 56(84) bytes of data. 64 bytes from 10.0.1.254: icmp_seq=1 ttl=64 time=26.7 ms 64 bytes from 10.0.1.254: icmp_seq=2 ttl=64 time=5.18 ms 64 bytes from 10.0.1.254: icmp_seq=3 ttl=64 time=6.69 ms 64 bytes from 10.0.1.254: icmp_seq=4 ttl=64 time=6.94 ms |
Notice h4 has IP 10.0.2.2 and its network gateway is 10.0.2.254, on the Leaf Router 2. Let's ping that interface too.
...