Skip to content

tim-fiola/network_traffic_modeler_py3

Repository files navigation

PyPI CI codecov Documentation Status

pyNTM 5.0.0 is here! This release unifies all model classes into a single Model class, adds significant RSVP LSP performance improvements, and introduces an interactive browser-based network visualization.

Note: As of 5.0.0, pypy support has been dropped. CPython performance improvements have closed the gap, and maintaining pypy compatibility added complexity without meaningful benefit.

Note: 5.0.0 was developed with the help of Claude Code. This was a big step because the scope of the changes I have been wanting to make would have taken months, if not years, for me to get done as the sole maintainer of this project. What did NOT change, however, was the testing rigor: the tests that I had meticulously crafted to ensure correct behavior received only minor updates to account for the changes in the Model class, so you can be assured that tests that rely on my deep knowledge of RSVP and other WAN features are still present. Additionally, the code has 98% testing coverage, which is a slight improvement over prior.

pyNTM: network_traffic_modeler_py3

Written by the author of the Junos Networking Technology Series book "This Week: Deploying MPLS", pyNTM (Network Traffic Modeler) is designed to answer the following questions for service-provider OSPF/IS-IS and MPLS WAN networks such as:

  • How will a failure on your wide area network (WAN) affect link utilizations?
  • What about a layer 3 node failure?
  • Will all of your RSVP auto-bandwidth LSPs be able to resignal after a link/node failure?
  • Can you WAN handle a 10% increase in traffic during steady state? What about failover state?

These questions are non-trivial to answer for a medium to large size WAN that is meshy/interconnected, and these are the exact scenarios that a WAN simulation engine is designed to answer.

This is a network traffic modeler written in python 3. The main use cases involve understanding how your layer 3 traffic will transit a given topology. You can modify the topology (add/remove layer 3 Nodes, Circuits, Shared Risk Link Groups), fail elements in the topology, or add new traffic Demands to the topology. pyNTM is a simulation engine that will converge the modeled topology to give you insight as to how traffic will transit a given topology, either steady state or with failures.

This library allows users to define a layer 3 network topology, define a traffic matrix, and then run a simulation to determine how the traffic will traverse the topology, traverse a modified topology, and fail over. If you've used Cariden MATE or WANDL, this code solves for some of the same basic use cases those do. This package is in no way related to those, or any, commercial products. IGP and RSVP routing is supported.

pyNTM can be used as an open source solution to answer WAN planning questions; you can also run pyNTM alongside a commercial solution as a validation/check on the commercial solution.

Documentation

See the documentation on Read the Docs.

Examples

See the example directory.

Install

Install via pip:

pip3 install pyNTM

For upgrade:

pip3 install --upgrade pyNTM

pyNTM Model Class

In pyNTM, the Model object houses the network topology objects: traffic Demands, layer 3 Nodes, Circuits, Shared Risk Link Groups (SRLGs), Interfaces, etc. The Model class controls how all the contained objects interact with each other during Model convergence to produce simulation results.

The model class is Model. It supports all pyNTM features:

  • IGP routing
  • Multiple Circuits (parallel links) between layer 3 Nodes
  • RSVP LSPs with bandwidth reservation, auto-bandwidth, and manual metrics
  • RSVP LSP IGP shortcuts, whereby LSPs can carry traffic demands downstream
  • SRLG (Shared Risk Link Group) support
  • Interactive visualization

The legacy class names FlexModel, PerformanceModel, and Parallel_Link_Model are available as aliases for backward compatibility.

Model files from either the old PerformanceModel format (without circuit_id column) or FlexModel format (with circuit_id column) are automatically detected and loaded correctly.

Visualization

pyNTM includes an interactive network visualization that runs in the browser. After running a simulation, call visualize() on the model:

from pyNTM import Model

model = Model.load_model_file('network.csv')
model.update_simulation()
model.visualize()                    # opens in default browser
model.visualize('output.html')       # saves to a specific file

The visualization features:

  • Draggable nodes for rearranging the topology layout
  • Per-direction utilization coloring on each interface with a toggleable legend to filter by utilization range
  • Demand path tracing - select a demand to highlight its path, see traffic, LSPs it rides, and interfaces it transits
  • RSVP LSP path tracing - select an LSP to see its traffic, reserved bandwidth, demands it carries, and interfaces
  • Interface inspection by node - select a node to list its interfaces with utilization, demands, and LSPs on each
  • Cross-linked navigation - click any demand, LSP, or interface in any panel to make it the active selection
  • Tooltips on hover showing interface name, endpoints, capacity, and utilization

The legacy WeatherMap class (pyNTM.weathermap) using Dash/Cytoscape is deprecated in favor of the new model.visualize() method.

License

Copyright 2019 Tim Fiola

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

About

pyNTM - This is the network traffic modeler written in python 3: pip3 install pyNTM

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages