Topology 2 is a "region aware" view of the topology, where the administrator can configure the network into regions and sub-regions.

In its default state (where no "regions" or "layouts" are defined), it should look and behave similarly to (and eventually the same as) the "classic" Topology view.


Note that this view is currently "experimental", although the longer term plan is to bring it up to par with the "classic" view, which it will eventually replace.

A more detailed description of the current state of Topology 2 can be found HERE. (Steven to provide link)


The ONOS model of the network includes Region objects which can be configured with a collection of Devices (switches) "belonging" to that region. 

Regions can be configured using a number of CLI commands:


To add a region to the model, the region-add command can be used..

region-add <region-id> <region-name> <region-type> <lat/Y> <long/X> <locType> <region-master>


A couple of examples:

region-add rUK "United Kingdom" COUNTRY 52.206035 -1.310384 geo " /"
region-add rRack1 "Primary Rack" RACK 15.0 20.0 grid

Note that CLI commands are scriptable. One way of doing this is as follows:

onos ${host} <<-EOF
region-add rUK "United Kingdom" COUNTRY 52.206035 -1.310384 geo ${host}
region-add rIT "Italy"   COUNTRY 44.447951  11.093161 geo ${host}
region-add rFR "France"  COUNTRY 47.066264  2.711458 geo ${host}


Devices can be assigned to regions with the region-add-devices command:

region-add-devices <region-id> <dev1> <dev2> ... <dev-n>


For example:

region-add-devices rUK \
    of:0000000000000001 \
    of:0000000000000002 \    


The regions currently configured in the system can be listed with the regions command:

onos> regions
id=rDE, name=Germany, type=COUNTRY
id=rES, name=Spain, type=COUNTRY

Another region command we'll look at is region-add-peer-loc, but we'll defer that until we have covered layouts.

Note that regions do not have any notion of hierarchy; they are simply "collections of devices". The hierarchy is expressed using Layouts


Layouts are used to define a "containment" hierarchy for the regions, as well as provide configuration information for the UI, such as which background decoration to use when displaying the layout; for example a geographical map.

A Layout is a "UI construct" that has an associated region "backing" it. Layouts (except for the "root" layout) declare their parent layout, thereby defining a hierarchy of layouts to be constructed.

The following diagram illustrates an example hierarchy:

Note that the "root" (default) layout does not have a backing region. Any devices (and their attached hosts) that have not been assigned to a region will appear in the topology view at the top level.

Layouts can be configured using a number of CLI commands:


Layouts can be added to the model with the layout-add command.

layout-add <layout-id> <bg-ref> <region-id> <parent-layout-id> <scale> <offset-x> <offset-y>


Some examples:

layout-add root @europe . . 4.66 -2562.93 -412.56
layout-add lUK @europe rUK root 11.63 -6652.54 -938.04
layout-add lIT @europe rIT root 7.15 -4818.73 -1330.36
layout-add lFR @europe rFR root 8.98 -5378.99 -1334.77

layout-add lMilan +segmentRouting rMilan lIT 0.86 68.58 54.71

Note the use of the dot (".") character in the definition of the root layout, as placeholders for the (non-existent) region-id and parent-layout-id.

Notes on <bg-ref>:

The <bg-ref> parameter should take the form:

Map identifiers can be listed by using the ui-geo-map-list command in the onos CLI:

onos> ui-geo-map-list
UiTopoMap{id=australia, desc=Australia}
UiTopoMap{id=americas, desc=North, Central and South America}
UiTopoMap{id=n_america, desc=North America}
UiTopoMap{id=s_america, desc=South America}

Additional maps can be registered from an application's server-side UiExtension implementation. (link to tutorial needed)

Sprite identifiers can be listed by opening the web console, making sure verbose option is selected, and filtering for the string "createLayout":

Additional sprite layouts can be registered from an application's topology overlay JavaScript code. (link to tutorial needed)


Notes on <scale>, <offset-x>, <offset-y> values:

Currently, getting these values right is a manual process:

One further note:

If the user zooms and pans a layout, the UI will remember how they left it.

However, by pressing the 'R' key, the view will reset to the <scale/offset> values configured in the layout-add command.


The layouts currently configured in the system can be listed with the layouts command:

onos> layouts
id=lDE, bgref=@europe, region=rDE, parent=root
id=lES, bgref=@europe, region=rES, parent=root
id=lFR, bgref=@europe, region=rFR, parent=root
id=lIT, bgref=@europe, region=rIT, parent=root
id=lMilan, bgref=+segmentRoutingTwo, region=rMilan, parent=lIT
id=lUK, bgref=@europe, region=rUK, parent=root
id=root, bgref=@europe, region=(root), parent=root



Putting this all together

Here is a brief demonstration of the UI configured with the script...

<iframe width="560" height="315" src="" frameborder="0" allowfullscreen></iframe>