Git Product home page Git Product logo

nsp2clab's Introduction

General Description

Inspired through the work done here I wanted to create something similar based on an actual Topology that was discovered by an NMS. In this case the NMS is the Nokia Network Services Platform (NSP).

So the main goal is the ability to create drawio diagrams from actual live network data.

This script allows the export of L2 Topology information in RFC8944 compliant format from an active NSP instance:

  • it connects to an NSP server using provided information such as credentials, server IP, proxy address
  • it pulls the L2 topology information
  • it revokes the authentication token again

Furthermore the retrieved data is transformed into an containerlab yaml format which can be used to feed into the "clab-io-draw" script to create drawio diagrams.

Usage Example

nsp2clab

The only mandatory argument that needs to be provided is the NSP Server IP Address (or hostname).

python3 nsp2clab.py -s [NSP Server IP]
Enter your username: [username]
Enter your password:

In that case the script will prompt you for username and password.

Alternatively you can also provide username and password as additional arguments:

python3 nsp2clab.py -s [NSP Server IP] -u [username] -p [password]

There is also the option to provide a proxy server using the "--proxy" flag. The proxy implementation is currently very rudimentary though.

In addition an output path can be specified. If no ouput path is specified, a file called "data.clab.yaml" is created in the current working directory.

clab2drawio

As mentioned in the beginning, the main driver for this script was the will and interest to generate a drawio diagram based on the actual live network information.

The script in this repo outputs a containerlab topology compliant .clab.yaml file which can be used in this script to finally create the drawio diagram.

python3 clab2drawio.py -i data.clab.yaml --layout horizontal

Known Limitations

  • the rendered containerlab yaml files are currently not executable/runnable due to the following constraints:

    • the detailed device information are not collected (e.g. chassis type, OS type and version)
    • virtual SROS devices (vSIMs) that can be run as part of a containerlab topology can not use all possible ports (e.g. we can only use the first breakout port in case we use connector ports) and the script does not handle any port mappings
  • proxy implementation is quite limited

nsp2clab's People

Contributors

mabra94 avatar

Stargazers

 avatar Florian Schwarz avatar

Watchers

 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.