Coder Social home page Coder Social logo

netomox's Introduction

Netomox

Netomox (Network Topology Modeling Toolbox) is a tool to make/validate network topology data that based on RFC8345.

See also:

Installation

  • Install tools for development tools (in Ubuntu, apt install build-essentials)
  • Install ruby(>2.3), ruby-dev, ruby-bundler
  • Install packages used in this application
    • git clone and bundle install --path=vendor/bundle

How to handle topology data instance

In vendor dir, there are some data instances defined/handled with Netomox.

  • vendor/model: topology data instance (json) of fictional network.
  • vendor/model_defs: topology data definition using Netomox::DSL to generate json data instance.

YANG Files

You can find latest yang files defined in RFC8345 and RFC8346 at Yang models repository on github. Draft L2 network topology yang file is also at experimental folder in the repository

Setup tools

  • Install pyang (>1.7.4)
    • sudo pip install pyang installs pyang, yang2dsdl and json2xml.
  • Install json_schema pyang plugin
    • sudo cp json_schema.py PYANG_PLUGIN_DIR
  • install jsonlint-cli to validate json data.
    • sudo npm install -g jsonlint-cli
  • or other JSON/XML utilities as you like.

Write/Construct topology data

Use topology model DSL (Domain Specific Language) to make target data. e.g.

$ bundle exec ruby model_defs/target.rb

It generate topology data and print it to standard-output as JSON.

Check data consistency

$ bundle exec netomox check target.json

Validate JSON

Install pyang JSON Schema plugin from EAGLE-Open-Model-Profile-and-Tools/YangJsonTools at ToolChain instead of cmoberg/pyang-json-schema-plugin. (because cmoberg's plugin can work only on single yang module at a time)

Generate json schema

pyang -f json_schema -o topo.jsonschema [email protected] [email protected]

and validate (using jsonlint or other json tool).

jsonlint-cli -s topo.jsonschema target.json

Convert JSON to XML

Create jtox file at first.

[Notice] use base topology model (NOT augmented model such as L2/L3).

pyang -f jtox -o topo.jtox [email protected] [email protected]

Convert json to xml

json2xml topo.jtox target.json | xmllint --format - > target.xml

Validate XML

Notice, topology YANG models are YANG/1.1, so you have to set -x option to yang2dsdl.

$ yang2dsdl -x -j -t config -v model/target.xml yang/[email protected] yang/[email protected]

Show diff between topology data

You can see diff of 2 topology data like that:

$ bundle exec netomox diff [--all|--color] model/target.orig.json model/target.json

In default, checker diff output only changed object and its parent object.

  • -a/--all option: checker diff output whole data include unchanged object.
  • -c/--color option: use color for diff.
  • -o FILE/--output FILE option: save diff data to FILE (json data includes diff info for diff viewer). If specified -o and other options, ignored them.

Store topology data with Graph DB (Neo4j)

Ready db_info.json file to store information to connect your Neo4j database.

This application is using neography to post the data into neo4j graph database. Execute like below

bundle exec netomox graphdb [--info|--clear] target.json
  • -i FILE/--info FILE option: graph db connection info file (if not specified, use db_info.json)
  • -c/--clear option: only deleting all data in graph (clear database and do not import graph data)

Visualize Neo4j graph data using Popoto.js

(Experimental)

Popoto.js is a graphical Neo4j query builder. If you use Neo4j with netomox graphdb command, you can also use popoto.js to query/visualize its data.

Install popoto and required packages at first.

cd popoto/
npm install

Next, Edit neo4j API entry point and its account in src/index.js. (See Popoto.js Wiki in detail.)

  • popoto.rest.CYPHER_URL
  • popoto.rest.AUTHORIZATION

Run webpack dev-server and access localhost:8081 (See webpack.config.js to config dev-server).

npm run start

Development

Netomox UML Class diagrams

Install PlantUML and exec bundle exec rake fig. Then, class diagrams will be created in figs/ directory.

netomox's People

Contributors

corestate55 avatar

Watchers

James Cloos avatar

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.