If you've already gone through the ONOS tutorial, you'll already have the ONOS tutorial VM available. If not, check out the Introduction section of the ONOS tutorial to get the VM set up. However, don't log in as tutorial1 - we have a different username for this tutorial.
We have provided a simple mechanism which allows you to restart the tutorial from scratch. Simply, click on the "Reset" icon on your desktop and this will reset ONOS to its initial state. It'll take a few seconds for ONOS to restart and during that time you may not be able to launch your ONOS cli.
Starting the tutorial
When you start the VM, you'll be presented with a login screen. (If you're already logged in to another tutorial, please log out by clicking the bottom-left icon, clicking "Logout", then click "Logout" again).
You'll be deposited on a desktop with a bunch of icons that will be used for the tutorial. Before we get started, double-click on the "Reset" icon. This will pop up a terminal to start ONOS and reset ONOS to make sure there is no state left over from any other tutorials.
- The node labelled "bgp" is our Internal BGP Speaker. It sits inside our SDN network and its job is to peer with all the External BGP Routers, learn BGP routes from them, and relay those routes to the SDN-IP application running on ONOS.
- The other four nodes, labelled r1 through r4, are the External BGP Routers. They are the border routers that reside in other networks that want to exchange traffic with us.
- Behind each router is a host. These are labelled h1 through h4 in Mininet. ONOS can't see these hosts, because they reside in other networks that are not controlled by ONOS.
Start up ONOS
First double-click the "Reset" icon on the network to clean the environment and start up ONOS with the correct configuration.
Start up the network
Double-click the "SDN-IP Mininet" icon on the desktop to start up the network.
Also, double-click the "ONOS" icon on the desktop to start up the ONOS console. If you run the "devices" command, you should see the network has started up and connected to ONOS.
onos> summary node=12710.0.03.111, version=1.02.0.SNAPSHOT1.sdnip~2015/07/14@16:50 nodes=1, devices=6, links=14, hosts=5, clustersSCC(s)=1, paths=46, flows=018, intents=0
Install the application
First we need to install some helper applications that SDN-IP relies on. These features apps let ONOS read in various configuration files and respond to ARP requests between the external routers and internal BGP speakers.
onos> feature:install onos-app-config onos> feature:install onos-app-activate org.onosproject.config onos> app activate org.onosproject.proxyarp
Now, let's install the SDN-IP application so we can get some traffic flowing between our networks.
onos> feature:install onos-app-app activate org.onosproject.sdnip
A lot happens as soon as we install the SDN-IP application. The first thing it does is install point-to-point intents to allow the external BGP peers to communicate with our internal BGP speaker. This allows the external BGP routers to relay the routes that are capable of forwarding through to SDN-IP.
We can see the routes that SDN-IP has learnt with the "routes" command.
onos> routes prefix= Network Next Hop 192.168.1.0/24, nexthop= 10.0.1.1 prefix=192 192.168.2.0/24, nexthop= 10.0.2.1 prefix= 192.168.3.0/24, nexthop= 10.0.3.1
Total SDN-IP IPv4 routes = 3 Network Next Hop Total SDN-IP IPv6 routes = 0
Don't worry if you don't see all of the routes straight away - sometimes it takes a minute or so for the BGP sessions to establish and advertise the routes to ONOS.
onos> intents -s Connectivity total= 27 installed= 27 Connectivity withdrawn= 0 failed= 0 Connectivity submitted= 0 compiling= 0 Connectivity installing= 0 recompiling= 0 Connectivity withdrawing= 0 PointToPoint total= 24 installed= 24 PointToPoint withdrawn= 0 failed= 0 PointToPoint submitted= 0 compiling= 0 PointToPoint installing= 0 recompiling= 0 PointToPoint withdrawing= 0 MultiPointToSinglePoint total= 3 installed= 3 MultiPointToSinglePoint withdrawn= 0 failed= 0 MultiPointToSinglePoint submitted= 0 compiling= 0 MultiPointToSinglePoint installing= 0 recompiling= 0 MultiPointToSinglePoint withdrawing= 0 SinglePointToMultiPoint total= 0 installed= 0 SinglePointToMultiPoint withdrawn= 0 failed= 0 SinglePointToMultiPoint submitted= 0 compiling= 0 SinglePointToMultiPoint installing= 0 recompiling= 0 SinglePointToMultiPoint withdrawing= 0 Path total= 0 installed= 0 Path withdrawn= 0 failed= 0 Path submitted= 0 compiling= 0 Path installing= 0 recompiling= 0 Path withdrawing= 0 LinkCollection total= 0 installed= 0 LinkCollection withdrawn= 0 failed= 0 LinkCollection submitted= 0 compiling= 0 LinkCollection installing= 0 recompiling= 0 LinkCollection withdrawing= 0 UnknownType total= 0 installed= 0 UnknownType withdrawn= 0 failed= 0 UnknownType submitted= 0 compiling= 0 UnknownType installing= 0 recompiling= 0 UnknownType withdrawing= 0 All total= 27 installed= 27 All withdrawn= 0 failed= 0 All submitted= 0 compiling= 0 All installing= 0 recompiling= 0 All withdrawing= 0
We see a total of 27 intents. The 24 PointToPointIntents are simple end-to-end flows which allow the external BGP routers to communicate with our internal BGP speaker. The three MultiPointToSinglePoint intents are the forwarding rules for the routes that we've learned through BGP. Each route is translated into one MultiPointToSinglePoint intent which matches the traffic for that route at the ingress ports of the network and forwards it along to the router who advertised the route to us. This is how we use routing information learned from BGP to enable traffic to transit our network on these routes.
mininet> h1 ping h2 PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. 64 bytes from 192.168.2.1: icmp_seq=1 ttl=62 time=0.693 ms 64 bytes from 192.168.2.1: icmp_seq=2 ttl=62 time=0.139 ms 64 bytes from 192.168.2.1: icmp_seq=3 ttl=62 time=0.149 ms
The ping should succeed. Notice the TROUBLESHOOTING NOTE: If the ping doesn't work straight away, try to quit the Mininet network and restart it by double-clicking the "SDN-IP Mininet" icon. There is sometimes a bug with the script where the routes do not get put into the routing table of the linux routers correctly. Restarting Mininet often fixes this.
The ping should succeed. Notice the TTL has been decremented from the default value 64 to 62 as the ping passes through the network. This is because the packet has passed through two Quagga routers - the originating host's router, and the destination host's router. SDN-IP doesn't currently decrement the TTL within the SDN network, because our OpenFlow 1.0 switches don't support TTL decrements.
Let's go back to our ONOS terminal and see if ONOS has received the new route.
onos> routes prefix=192.168. Network Next Hop 192.168.1.0/24, nexthop= 10.0.1.1 prefix= 192.168.2.0/24, nexthop= 10.0.2.1 prefix= 192.168.3.0/24, nexthop= 10.0.3.1 prefix= 192.168.4.0/24, nexthop= 10.0.4.1 Total SDN-IP IPv4 routes = 4 Network Next Hop Total SDN-IP IPv6 routes = 0
We see the new route to 192.168.4.0/24 has appeared in the list. Also, when SDN-IP received the route it installed a new MultiPointToSinglePoint intent into the network.