Have questions? Stuck? Please check our FAQ for some common questions and answers.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Developing

The content of this page is not final.

Welcome to the Cord Fabric - Tutorial!

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 and how it enables you to achieve better control of IP traffic. We also hope that you become familiar with a leaf-spine topology that represents the architecture for the CORD Fabric.

If you haven't done so 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. 

Email us (onos-discuss@onosproject.org) if you’re stuck, think you’ve found a bug, or just want to send some feedback.

1 - Download the tutorial VM

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 CLI type:

$ onos -w $OC1

After you see the ONOS CLI, make sure the correct apps are running and the onos cluster is formed correctly:

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> 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

3 - Start the Fabric

The 2x2 Leaf-Spine topology is described in the figure (i).

  • Add Figure Here

Each Leaf switch is connected to each Spine, each host under a Leaf share the same subnet.

Let's take a look at the configuration file inside ONOS.

{
  "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": 5, "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": 5, "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. 

$ sudo -s
#./cord_fabric.py
mininet> h1 ifconfig

Notice h1 has IP 10.0.1.1 and its gateway to the outside world is 10.0.1.254, one interface of the Leaf Router 1. Let's try to ping that interface.

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.

Now let's verify connectivity between the two hosts.

4 - Understand Segment Routing

Each Router is identified by a Label. The edge routers will encapsulate IP traffic with the MPLS label associated to the destination of the packet. 

The spines will simply forward traffic based on MPLS labels.

The Segment Routing application allows the expression of POLICIES via TUNNELS.

A tunnel is defined as a set of LABELS, defining the path taken by a flow.

Then, a policy can be applied to a subset of traffic, for example,  policy1 = tcp_port=80 >> fwd( TUNNEL_1)

The following figure describes the Segment Routing topology.

  • Add figure here

5 - GUI

6 - Topology

Now let's try a bigger topology.

$ sudo -s
#./cord_fabric.py --spine=4 --leaf=4
mininet> pingall
  • No labels