Giter Club home page Giter Club logo

onos-topo's Introduction

onos-topo

Go Report Card License GoDoc

Overview

The µONOS Topology subsystem provides topology management for µONOS core services and applications. The topology subsystem structures the topology information as a set of objects, which can be either Entity, Relation or a Kind.

  • Entity objects are nodes in a graph and are generally intended to represent network devices, control entities, control domains, and so on.
  • Relation objects are edges in a graph and are intended to represent various types of relations between two Entity objects, e.g. contains, controls, implements.
  • Kind objects can be thought of as template or schema objects that represent an entity or a relation kind. Strictly speaking, Entity or Relation instances do not have to be associated with a Kind, but maintaining Kind associations can be used for schema validation and speeding up queries and is therefore highly encouraged.

API

The onos-topo subsystem exposes the topology information via a gRPC API that supports the above abstractions.

Unique ID

Each Entity, Relation and Kind objects has a unique identifier that can be used to directly look it up, update or delete it.

Aspects

The Entity and Relation objects themselves carry only the essential information for identifying them, associating them with a particular kind and in case of Relation, for associating the two - source and target - Entity objects. Clearly, while this is necessary, it is not sufficient to allow the platform or applications to track other pertinent information about the entities and relations.

Since different use-cases or applications require tracking different information, and these may vary for different types of devices or network domains, the topology schema must be extensible to carry various aspects of information. This is where the notion of Aspect comes in. An Aspect is a collection of structured information, modeled as a Protobuf message (although this is not strictly necessary), which is attached to any type of object; generally mostly an Entity or a Relation.

Each object carries a mapping of aspect type (TypeURL) and Protobuf Any message. For example, to track a geo-location of a network element, one can associate onos.topo.Location instance, populated with the appropriate longitude and latitude with the Entity that represents that network element, with the Location being defined as follows:

// Geographical location; expected value type of "location" aspect
message Location {
    double lat = 1;
    double lng = 2;
}

Similarly, to track information about the cone of signal coverage for a radio-unit, one can attach onos.topo.Coverage instance to an Entity representing the radio unit, with Coverage being defined as follows:

// Area of coverage; expected value type of "coverage" aspect
message Coverage {
    int32 height = 1;
    int32 arc_width = 2;
    int32 azimuth = 3;
    int32 tilt = 4;
}

The current list of aspects defined in onos-api includes the following:

  • onos.topo.Asset - basic asset information for the device: model, HW, SW versions, serial number, etc.
  • onos.topo.Location - geo location coordinates
  • onos.topo.Configurable - info for devices that support configuration via gNMI
  • onos.topo.MastershipState - for tracking mastership role
  • onos.topo.TLSOptoins - TLS connection options
  • onos.topo.Protocols - for tracking connectivity state of supported device control protocols
  • onos.topo.Coverage - radio unit signal coverage cone information
  • onos.topo.E2Node - information about an O-RAN E2 node
  • onos.topo.E2Cell - information about an O-RAN E2 cell
  • onos.topo.AdHoc - for tracking ad-hoc key/value string attributes (not labels)

The above are merely examples of aspects. Network control platforms and applications can supply their own depending on the needs of a particular use-case.

Labels

To assist in categorization of the topology objects, each object can carry a number of labels as meta-data. Each label carries a value.

For example the deployment label can have production or staging or testing as values. Or similarly, tier label can have access, fabric or backhaul as values to indicate the area of network where the entity belongs.

Filters

The topology API provides a List method to obtain a collection of objects. The caller can specify a number of different filters to narrow the results. All topology objects will be returned if the request does not contain any filters.

  • Type Filter - specifies which type(s) of objects - Entity, Relation or Kind - should be included.
  • Kind Filter - specifies which kind(s) of objects should be included, e.g. contains, controls
  • Labels Filter - specifies which label name/value(s) should be included, e.g. tier=fabric
  • Relation Filter - specifies target entities related to a given source entity via a relation of a given kind

Support for other filters may be added in the future.

Distribution

The topology subsystem is available as a Docker image and deployed with Helm. To build the Docker image, run make images.

Visualizer

To assist developers in visualizing the entities and relations tracked by onos-topo, a simple graphic visualization tool is available. It can be run locally via:

# Requires 'kubectl port-forward deploy/onos-topo 5150' to forward topo gRPC API
> go run cmd/topo-visualizer/topo-visualizer.go --service-address localhost:5150

and then simply opening http://localhost:5152 using your web browser of choice.

Alternatively, the visualizer can be run directly from the onos-topo docker container via:

# Requires 'kubectl port-forward deploy/onos-topo 5152' to forward visualizer HTTP/WS traffic
> k exec -it deploy/onos-topo -- /usr/local/bin/topo-visualizer

The visualizer uses onos-topo API to watch changes occurring on the topology and forwards these changes via web-socket to the browser where it renders the various entities and relations using a simple force layout graph. This allows the view to dynamically adjust to reflect the current topology state.

Clicking on nodes (entities) and links (relations) will show the full contents of the entity or relation as JSON structure. Nodes can be dragged around and the entire graph can be zoomed and panned within the viewport.

The visualizer is presently under active development.

See Also

onos-topo's People

Contributors

adibrastegarnia avatar agarwal-shivansh avatar amolonf avatar andrea-campanella avatar eesha-deepak avatar eroshiva avatar k1eran avatar kuujo avatar onos-builder avatar ray-milkey avatar seancondon avatar shadansari avatar stolsma avatar tomikazi avatar tweoss avatar woojoong88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onos-topo's Issues

Make CLI configurable

The CLI should support a configuration command to allow users to change the topo host/port.

Move proto files/code to standalone package

In onos-config we created a separate package for protobuf files/code. This works well because the generated code doesn’t count against test coverage. It also allows other subsystems to import Protobuf types without importing implementations (e.g. services/stores), which can create dependency conflicts: We need to do the same for topo northbound APIs.

My proposal is to create a convention in which we separate serializable types into two packages:

  • Public API - types that are exposed via a northbound API and can be imported by other services
  • Private API - types that are stored e.g. in databases but not exposed via a northbound API

The public API needs to be separate from the subsystem’s code - maybe just in a top level api Or proto package.

Topology Destruction

Hi,

I ran the following command to create a test MININET Optical topology in ONOS and now it won't let me destroy the topology.

sudo -E python onos/tools/test/topos/opticalTestBig.py

Running the command "wipe-out please" in ONOS deletes the topology but it immediately reappears. What do I do?

Add missing features to new onos-topo cli

  1. getGetEntityCommand() should allow it to be run without an id.
    also it should be given an alias entities, so that I can do onos topo get entities as an alternative
  2. same goes for getGetRelationCommand()
  3. also when creating a relationship, there is no check that the entity exists - i think this would be useful, at least a creation time
  4. when creating a relationship, through CLI I can specify 1 source and 1 target, yet topo.proto allows multiple sources and multiple targets per relationship ( i think it's topo.proto that should be changed to single source and single target)

Convert Protocol info to attributes

message Entity {
  // user-defined entity kind
  string kind_id = 1 [(gogoproto.customname) = "KindID", (gogoproto.casttype) = "ID"];
  repeated topo.device.ProtocolState protocols = 2;

handler for onos-topo DeviceService/List with subscribe should handle client disconnect

In the file
https://github.com/onosproject/onos-topo/blob/master/pkg/northbound/device/service.go line 99
the handler does not handle a client disconnect, and stays running

This might become a problem when the onos-gui is attached, as the client disconnects when the user browses away from the topology page.

I found this was necessary with the GetOpState and used a mechanism to handle <-stream.Context().Done(). See:
https://github.com/onosproject/onos-config/blob/master/pkg/northbound/diags/diags.go line 183
that handles this.

onos-topo fails to start on microk8s on Ubuntu 18.04

I think its that Atomix might not have started properly or something?

I set up microk8s and loaded all the latest docker images in to it and then ran:

onit create cluster sean-1 --image-tags="topo=latest,config=latest"

It tried starting the cluster, but never finishes with topo

scondon@Z420:~/go/src/github.com/onosproject/onos-test$ onit create cluster sean-1 --image-tags="topo=latest,config=latest"
 ✓ Creating cluster namespace
 ✓ Setting up RBAC
 ✓ Setting up Atomix controller 
 ✓ Starting Raft partitions 
 ✓ Adding secrets
⢎⠁ Bootstrapping onos-topo cluster

but when I go and get the logs of onos-topo I see:

scondon@Z420:~/go/src/github.com/onosproject/onos-test$ kubectl logs onos-topo-6b564977f9-62grp -n sean-1
I0816 07:47:39.868782       1 onos-topo.go:69] Starting onos-topo
I0816 07:47:39.869203       1 manager.go:26] Creating Manager
I0816 07:47:39.869217       1 manager.go:37] Starting Manager
F0816 07:47:44.875387       1 onos-topo.go:78] Unable to start onos-topo rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp: lookup atomix-controller.sean-1.svc.cluster.local: Try again"
goroutine 1 [running]:
k8s.io/klog.stacks(0xc00013e700, 0xc000216000, 0x12e, 0x222)
	/go/src/github.com/onosproject/onos-topo/vendor/k8s.io/klog/klog.go:855 +0xb1
k8s.io/klog.(*loggingT).output(0x10150a0, 0xc000000003, 0xc000135f10, 0xfbbc08, 0xc, 0x4e, 0x0)
	/go/src/github.com/onosproject/onos-topo/vendor/k8s.io/klog/klog.go:806 +0x2d9
k8s.io/klog.(*loggingT).printDepth(0x10150a0, 0x3, 0x1, 0xc0000eff68, 0x2, 0x2)
	/go/src/github.com/onosproject/onos-topo/vendor/k8s.io/klog/klog.go:696 +0x12b
k8s.io/klog.(*loggingT).print(...)
	/go/src/github.com/onosproject/onos-topo/vendor/k8s.io/klog/klog.go:687
k8s.io/klog.Fatal(...)
	/go/src/github.com/onosproject/onos-topo/vendor/k8s.io/klog/klog.go:1236
main.main()
	/go/src/github.com/onosproject/onos-topo/cmd/onos-topo/onos-topo.go:78 +0x4ca
scondon@Z420:~/go/src/github.com/onosproject/onos-test$

cosmetic issues with CLI for entity and relationship

In pkg/cli/topo.go:
line 111:
I think the type flag on line 111 is not used - if it is, it should say the type of relationship

line 264:
I think the default for the CLI should be replay on - It might make sense to call the flag noreplay

line 318:
The response to the onos topo get entities has a first column which is the Update Type - this should not be shown for get because these are just in the database, and are not updates (that's only for watch)

line 320:
In the output, there are no headers, and the columns don't align e.g.

$ go run ./cmd/onos topo get entities --service-address localhost:5150
UNSPECIFIED   ENTITY   ric0   RIC
UNSPECIFIED   ENTITY   ric1   RIC
UNSPECIFIED   ENTITY   e2node1   E2NODE
UNSPECIFIED   ENTITY   e2node2   E2NODE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.