Skip to content

NetGraph

Python-test

Scenario-driven network modeling and analysis framework combining Python with C++ graph algorithms.

Overview

Model network topologies, traffic matrices, and failure scenarios declaratively. Graph algorithms are delegated to NetGraph-Core; NetGraph itself provides the Python API and CLI that orchestrate them.

Architecture

NetGraph uses a hybrid Python+C++ architecture, split across two layers:

  • Python layer (NetGraph): Scenario DSL parsing, workflow orchestration, result aggregation, and high-level APIs.
  • C++ layer (NetGraph-Core): The compute-intensive graph algorithms (SPF, KSP, Max-Flow), executed in C++ with the GIL released.

Key Features

Modeling & DSL

  • Declarative Scenarios: Define topology, traffic, and workflows in validated YAML.
  • Blueprints: Reusable topology templates (e.g., Clos fabrics, regions) with parameterized expansion.
  • Strict Multigraph: Deterministic graph representation with stable edge IDs.

Failure Analysis

  • Policy Engine: Weighted failure modes with multiple policy rules per mode.
  • Non-Destructive: Runtime exclusions simulate failures without modifying the base topology.
  • Risk Groups: Model shared fate (e.g., fiber cuts, power zones).

Traffic Engineering

  • Routing Modes: IP routing (cost-only, fixed paths) and traffic engineering (capacity-aware) in one model.
  • Flow Placement: Strategies for ECMP (Equal-Cost Multi-Path) and WCMP (Weighted Cost Multi-Path).
  • Capacity Analysis: Max-flow between node groups and traffic-matrix placement with selectable placement policies.

Workflow & Integration

  • Structured Results: JSON export with a fixed shape.
  • CLI: Validate, inspect, and run scenarios from the command line.
  • Python API: Programmatic access to the same modeling and solving entry points.

Getting Started

Examples

Reference Documentation