...
In this exercise, we are going to run a sample app shipped with ONOS. Reactive Forwarding is a simple application which installs flows for every packet in that arrives at the controller. Go to your mininet prompt and do the following.
Code Block |
---|
h1mininet> h11 ping h10h41 |
You will notice that the ping fails as shown below.
...
So why did the ping fail? Well we didn't load the reactive forwarding application. Indeed, if you list the loaded application applications you will see the following:
Code Block |
---|
onos> feature:list
110 | Active | 80 | 1.0.0.SNAPSHOT | onos-rest
116 | Active | 80 | 1.0.0.SNAPSHOT | onos-of-api
117 | Active | 80 | 1.0.0.SNAPSHOT | onos-of-ctl
118 | Active | 80 | 1.0.0.SNAPSHOT | onos-lldp-provider
119 | Active | 80 | 1.0.0.SNAPSHOT | onos-host-provider
120 | Active | 80 | 1.0.0.SNAPSHOT | onos-of-provider-device
121 | Active | 80 | 1.0.0.SNAPSHOT | onos-of-provider-packet
122 | Active | 80 | 1.0.0.SNAPSHOT | onos-of-provider-flow
136 | Active | 80 | 1.0.0.SNAPSHOT | onos-cli
137 | Active | 80 | 8.1.15.v20140411 | Jetty :: Websocket
138 | Active | 80 | 1.0.0.SNAPSHOT | onos-gui
151 | Active | 80 | 1.0.0.SNAPSHOT | onos-core-net
152 | Active | 80 | 1.0.0.SNAPSHOT | onos-core-trivial |
...
In your ONOS window, do
Code Block |
---|
onos> feature:install onos-app-fwd |
...
Then, in a mininet window run the ping again, just this time don't limit the number of pings.
Code Block |
---|
mininet> h11 ping h41 |
This time the ping is flowing:
...
You have now seen that you can load applications into ONOS dynamically. Actually you can also interrupt applications while they are running so, for example, let's stop the reactive forwarding application.
Code Block |
---|
onos> stop onos-app-fwd |
Observe that the ping has now stopped. This is because when the reactive forwarding application is unloaded, it cleans up after itself by removing the rules that it has pushed. We'll talk more about this in the next section. For now, let's restart the reactive forwarding application.
Code Block |
---|
onos> start onos-app-fwd |
...and the ping restarts
...
ONOS has many CLI commands. In this section, we will go through some of the most useful commands. This section may also serve as a CLI reference for you during this tutorial. While we will explain some of the ONOS CLI command here you can find an exhaustive list by running:
Code Block |
---|
onos> help onos |
or more information about an individual command adding --help to any command. Also most commands have autocompletion to help you find the parameters quickly and easily.
...
An SDN Controller would be nothing without devices to control. Luckily, ONOS has a convenient command to list the device currently known in the system. Running
Code Block |
---|
onos> devices |
will return the following information,
...
The links command is used to list the links detected by ONOS. At the ONOS prompt run
Code Block |
---|
onos> links |
and you should get the following output:
...
A network without hosts is a little like a city without bars, it would be a ridiculously boring place. Fortunately, ONOS has the ability to list the hosts (as opposed to bars, although that would be a great feature) currently in the system.
Code Block |
---|
onos> hosts |
with this output:
Code Block |
---|
onos> hosts id=00:00:00:00:00:01/-1, mac=00:00:00:00:00:01, location=of:000000000000000b/3, vlan=-1, ip(s)=[10.0.0.1] id=00:00:00:00:00:02/-1, mac=00:00:00:00:00:02, location=of:000000000000000b/4, vlan=-1, ip(s)=[10.0.0.2] id=00:00:00:00:00:03/-1, mac=00:00:00:00:00:03, location=of:000000000000000b/5, vlan=-1, ip(s)=[10.0.0.3] id=00:00:00:00:00:04/-1, mac=00:00:00:00:00:04, location=of:000000000000000b/6, vlan=-1, ip(s)=[10.0.0.4] id=00:00:00:00:00:05/-1, mac=00:00:00:00:00:05, location=of:000000000000000b/7, vlan=-1, ip(s)=[10.0.0.5] id=00:00:00:00:00:06/-1, mac=00:00:00:00:00:06, location=of:000000000000000b/8, vlan=-1, ip(s)=[10.0.0.6] id=00:00:00:00:00:07/-1, mac=00:00:00:00:00:07, location=of:000000000000000c/3, vlan=-1, ip(s)=[10.0.0.7] id=00:00:00:00:00:08/-1, mac=00:00:00:00:00:08, location=of:000000000000000c/4, vlan=-1, ip(s)=[10.0.0.8] id=00:00:00:00:00:09/-1, mac=00:00:00:00:00:09, location=of:000000000000000c/5, vlan=-1, ip(s)=[10.0.0.9] id=00:00:00:00:00:0A/-1, mac=00:00:00:00:00:0A, location=of:000000000000000c/6, vlan=-1, ip(s)=[10.0.0.10] id=00:00:00:00:00:0B/-1, mac=00:00:00:00:00:0B, location=of:000000000000000c/7, vlan=-1, ip(s)=[10.0.0.11] id=00:00:00:00:00:0C/-1, mac=00:00:00:00:00:0C, location=of:000000000000000c/8, vlan=-1, ip(s)=[10.0.0.12] id=00:00:00:00:00:0D/-1, mac=00:00:00:00:00:0D, location=of:000000000000000d/3, vlan=-1, ip(s)=[10.0.0.13] id=00:00:00:00:00:0E/-1, mac=00:00:00:00:00:0E, location=of:000000000000000d/4, vlan=-1, ip(s)=[10.0.0.14] id=00:00:00:00:00:0F/-1, mac=00:00:00:00:00:0F, location=of:000000000000000d/5, vlan=-1, ip(s)=[10.0.0.15] id=00:00:00:00:00:10/-1, mac=00:00:00:00:00:10, location=of:000000000000000d/6, vlan=-1, ip(s)=[10.0.0.16] id=00:00:00:00:00:11/-1, mac=00:00:00:00:00:11, location=of:000000000000000d/7, vlan=-1, ip(s)=[10.0.0.17] id=00:00:00:00:00:12/-1, mac=00:00:00:00:00:12, location=of:000000000000000d/8, vlan=-1, ip(s)=[10.0.0.18] id=00:00:00:00:00:13/-1, mac=00:00:00:00:00:13, location=of:000000000000000e/3, vlan=-1, ip(s)=[10.0.0.19] id=00:00:00:00:00:14/-1, mac=00:00:00:00:00:14, location=of:000000000000000e/4, vlan=-1, ip(s)=[10.0.0.20] id=00:00:00:00:00:15/-1, mac=00:00:00:00:00:15, location=of:000000000000000e/5, vlan=-1, ip(s)=[10.0.0.21] id=00:00:00:00:00:16/-1, mac=00:00:00:00:00:16, location=of:000000000000000e/6, vlan=-1, ip(s)=[10.0.0.22] id=00:00:00:00:00:17/-1, mac=00:00:00:00:00:17, location=of:000000000000000e/7, vlan=-1, ip(s)=[10.0.0.23] id=00:00:00:00:00:18/-1, mac=00:00:00:00:00:18, location=of:000000000000000e/8, vlan=-1, ip(s)=[10.0.0.24] |
...
Code Block |
---|
onos> apps
id=0, name=org.onlab.onos.net.intent
id=1, name=org.onlab.onos.fwd
id=2, name=org.onlab.onos.gui |
As shown above the tutorial ONOS has three applications loaded. One of them is the reactive forwarding applications, we will see the other two later in this tutorial.
...