Code Monkey home page Code Monkey logo

ank_legacy_v2's People

Contributors

coaj avatar iainwp avatar ntwrkguru avatar sk2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ank_legacy_v2's Issues

Code Cleanup

Miscellaneous tasks to improve ANK codebase:

fix .name attribute being integer for graphs, use graph.graph['asn']
Move compiler into plugin
add rev dns as tap_host for 172.16.0.1 (or whatever tap host is defined to be)
use defaultdict more
replace code that gets highest match by sorting then taking [0] with code that looks at max value and then takes the item at that index
use python startswith() instead of string[0]
convert list(set(x)) to just operate as a set, and convert to list as last step
use try/except instead of checking
use generator functions with tuples for dictionaries
ensure no from x import *
use defaultdict to initialise dicts
make python classes inherit from Object
use nodes_iter() and edges_iter() instead of .nodes() and .edges()
Move all the reverse and forward dns mangling into the dns module out of compiler
remove double brackets on multiline formats for logger etc

networkx technique to check between node and nbunch list:
if nbunch in self: # return a single node
return next(self.degree_iter(nbunch,weight))[1]
else: # return a dict
return dict(self.degree_iter(nbunch,weight))

Don't enable OSPF for single node AS

From Olaf:

if i setup a small topology (only one node per AS), no ospf is configured
(quite obviously). however, the "daemons" file specified 'ospf yes'.
so when netkit boots it looks for an ospf configuration, which is not there
(and not needed)!

Create BGP session graph

Currently BGP sessions are created in the following manner:

  • iBGP are created as a full-mesh between all routers in an AS
  • eBGP are created where a link exists between two routers that are in different ASes

This is limited:

  • it is hard to create different iBGP sessions, especially for situations such as route-reflection
  • it limits our flexibility: some experiments may wish to specify the iBGP or eBGP session setup
  • we need somewhere to put BGP policies. Policies are per-session, not per ethernet link.

The problem is trying to stitch the session information onto the physical connectivity graph. An interim solution is to create a seperate graph for BGP sessions.
This can later be merged into the main graph, with edge types to denote the layer at which they operate.
For now a seperete graph will suffice, keep things simple, and allow user-specified topologies to be loaded.

The node id will be used like a database foreign key to related nodes between the graphs.

query plotter

initial progress in QueryPlotter, this needs to be developed better and documented

Improve documentation

Autonetkit has framework in place for documentation using sphinx.
This needs to be brought up to date, along with the user guides generated for the website

decide on namespace

with multiple target platforms, need a systematic way to define tags/labels inside netkit
currently it is ad-hoc, eg
ip, sn, asn, ram
some properties only make sense to certain platforms
options: append _ eg nk_ip nk_sn ank_ram
or have nested dictionaries
eg ['nk']['ip']

need something that is easy to pull in/out of external formats, so the underscore format may work best.

Add changelog

Need to create a changelog for future versions of autonetkit
This should be automatically used by pypi to list modifications

Improve detection of Netkit installation

Currently checks for env var but this is error-prone.
Better way would be:

$ lstart --version
Netkit version: 2.8

vs
$ lstart --version
-bash: lstart: command not found

Erase lab directory for local deployment

Netkit compiler needs to erase the lab directory before writing the new lab, if using local deployment.
Not an issue with remove deployment due to way tar is extracted.

Exception handling

Ank needs both

  • own exception classes as relevant
  • better exception handling including try/except blocks

cleaner API access to ip/subnet

add syntactic sugar to network to allow ip and subnet to be cleanly accessed, both for local and remote ip

eg
self.network.ip(src, dst)
self.network.subnet(src, dst)

Create BGP session graph

Currently BGP sessions are created in the following manner:

  • iBGP are created as a full-mesh between all routers in an AS
  • eBGP are created where a link exists between two routers that are in different ASes

This is limited:

  • it is hard to create different iBGP sessions, especially for situations such as route-reflection
  • it limits our flexibility: some experiments may wish to specify the iBGP or eBGP session setup
  • we need somewhere to put BGP policies. Policies are per-session, not per ethernet link.

The problem is trying to stitch the session information onto the physical connectivity graph. An interim solution is to create a separate graph for BGP sessions.
This can later be merged into the main graph, with edge types to denote the layer at which they operate.
For now a separate graph will suffice, keep things simple, and allow user-specified topologies to be loaded.

The node id will be used like a database foreign key to related nodes between the different graphs.

Better deployment scripting

AutoNetkit currently uses Pexpect for interaction with local/remote hosts.
This is low-level and can lead to complicated code. This is a problem both for maintenance, and for flexibility for future versions.

We need a more flexible solution, especially as we automate different deployment platforms.
Contenders are Fabric and Expect.

move ank to argparse

Ank uses optparse, which is deprecated. Use argparse instead for the demo.py script

Merge dev.py and demo.py

Currently have AutoNetkit/demo.py which is used as entry point for Standalone scripts when deployed
And examples/dev.py which is used for testing
These should be merged into a single file, with testing generated plots, labs and demo input files ignore by github as appropriate

Simplify compiler

We have templates and an API. We should use these. Currently the netkit compiler has far too much logic for simple tasks. Complex logic should be split out into external functions. This will simplify the compiler, making it easier to write for other platforms.

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.