Skip to main content

Network traffic modeler API written in Python 3

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyntm-5.0.0.tar.gz (88.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyntm-5.0.0-py3-none-any.whl (105.5 kB view details)

Uploaded Python 3

File details

Details for the file pyntm-5.0.0.tar.gz.

File metadata

  • Download URL: pyntm-5.0.0.tar.gz
  • Upload date:
  • Size: 88.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyntm-5.0.0.tar.gz
Algorithm Hash digest
SHA256 fc55bc7cd328ef8b0cc30cb6159e18d133f0831fdb1361a232b56cf69db548bb
MD5 e0412e265f2a5c5078cc038bf594543a
BLAKE2b-256 b48cf2ecca1fbe15e0b5de98f900d537f17bf46abe9ead3ce25b5edddde7ee61

See more details on using hashes here.

File details

Details for the file pyntm-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyntm-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 105.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyntm-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e25e4dbc3666db750d351796ef322ceea428376cc726c2e4c77bea01937da0a6
MD5 e6527a4971ec906ff65d046281d91e37
BLAKE2b-256 1f49fc94936df5bdfd14255c1a651d6ef1e36486db69d6029546d0895937572a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page