Skip to content

NetGraph

Python-test

Scenario-driven network modeling and analysis framework combining Python's flexibility with high-performance C++ algorithms.

Overview

NetGraph enables declarative modeling of network topologies, traffic matrices, and failure scenarios. It delegates computationally intensive graph algorithms to NetGraph-Core while providing a rich Python API and CLI for orchestration.

Architecture

NetGraph employs a hybrid Python+C++ architecture:

  • Python layer (NetGraph): Scenario DSL parsing, workflow orchestration, result aggregation, and high-level APIs.
  • C++ layer (NetGraph-Core): Performance-critical graph algorithms (SPF, KSP, Max-Flow) executing in optimized 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: Unified modeling of IP Routing (static costs, oblivious to congestion) and Traffic Engineering (dynamic residuals, congestion-aware).
  • Flow Placement: Strategies for ECMP (Equal-Cost Multi-Path) and WCMP (Weighted Cost Multi-Path).
  • Capacity Analysis: Compute max-flow envelopes and demand allocation with configurable placement policies.

Workflow & Integration

  • Structured Results: Export analysis artifacts to JSON for downstream processing.
  • CLI: Comprehensive command-line interface for validation and execution.
  • Python API: Full programmatic access to all modeling and solving capabilities.

Getting Started

Examples

Reference Documentation