You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NetGraph is a scenario-based network modeling and analysis framework written in Python. Design, simulate, and evaluate complex network topologies from small test cases to massive Data Center fabrics and WAN networks.
7
+
NetGraph is a scenario-based network modeling and analysis framework written in Python. It allows you to design, simulate, and evaluate complex network topologies - ranging from small test cases to massive Data Center fabrics and WAN networks.
8
8
9
9
## Key Features
10
10
11
-
-**Scenario-Based Modeling**[DONE]: Define complete network scenarios in YAML with topology, failures, traffic, and workflows
12
-
-**Hierarchical Blueprints**[DONE]: Reusable network templates with nested structures and bracket expansion
13
-
-**Flow Analysis**[DONE]: Calculate capacity with different flow placement strategies (e.g., shortest path only, ECMP/UCMP, etc.)
11
+
-**Scenario-Based Modeling**[DONE]: Define complete network scenarios in YAML with topology, failures, traffic, and workflow
12
+
-**Hierarchical Blueprints**[DONE]: Reusable network templates with nested structures and parameterization
13
+
-**Demand Placement**[DONE]: Place traffic demands on the network with various flow placement strategies (e.g., shortest path only, ECMP/UCMP, etc.)
14
+
-**Capacity Calculation**[DONE]: Calculate capacity with different flow placement strategies
14
15
-**Failure Simulation**[DONE]: Model component and risk groups failures for availability analysis
16
+
-**Network Analysis**[IN PROGRESS]: Analyze capacity, failure tolerance, and efficiency
15
17
16
18
## Quick Start
17
19
18
-
### Docker (Recommended)
20
+
### Docker with JupyterLab (Recommended)
19
21
20
22
```bash
21
23
git clone https://github.com/networmix/NetGraph
@@ -39,7 +41,7 @@ pip install -e '.[dev]'
39
41
from ngraph.scenario import Scenario
40
42
from ngraph.lib.flow_policy import FlowPlacement
41
43
42
-
# Define a 3-tier Clos network with inter-fabric connectivity
44
+
# Define two 3-tier Clos networks with inter-fabric connectivity
Copy file name to clipboardExpand all lines: docs/examples/basic.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,6 @@
1
-
# Basic Examples
1
+
# Basic Example
2
2
3
-
This guide demonstrates basic NetGraph functionality using a couple of simple examples. These fundamentals will help you understand the more complex scenarios in the [Clos Fabric Analysis](clos-fabric.md) example.
4
-
5
-
## Calculating MaxFlow
6
-
7
-
In this example, we'll create a simple network with parallel edges and alternative paths, then run max flow analysis with different flow placement policies.
3
+
In this toy example, we'll create a simple graph with parallel edges and alternative paths, then run max flow analysis with different flow placement policies.
Note that here we used a simple `nodes` and `links` structure to directly define the network topology. In more complex scenarios, you would typically use `groups` and `adjacency` to define groups of nodes and their connections, or even leverage the `blueprints` to create reusable components. This advanced functionality is explained in the [DSL Reference](../reference/dsl.md) and used in the [Clos Fabric Analysis](clos-fabric.md) example.
82
+
85
83
### Flow Analysis Variants
86
84
87
85
Now let's run MaxFlow using the high-level Network API:
Copy file name to clipboardExpand all lines: docs/getting-started/installation.md
+45-35Lines changed: 45 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,32 +14,32 @@ NetGraph can be used in two ways:
14
14
15
15
1. Clone the repository:
16
16
17
-
```bash
18
-
git clone https://github.com/networmix/NetGraph
19
-
```
17
+
```bash
18
+
git clone https://github.com/networmix/NetGraph
19
+
```
20
20
21
21
2. Build the Docker image:
22
22
23
-
```bash
24
-
cd NetGraph
25
-
./run.sh build
26
-
```
23
+
```bash
24
+
cd NetGraph
25
+
./run.sh build
26
+
```
27
27
28
28
3. Start the container with JupyterLab server:
29
29
30
-
```bash
31
-
./run.sh run
32
-
```
30
+
```bash
31
+
./run.sh run
32
+
```
33
33
34
34
4. Open the JupyterLab URL in your browser:
35
35
36
-
```bash
37
-
http://127.0.0.1:8788/
38
-
```
36
+
```bash
37
+
http://127.0.0.1:8788/
38
+
```
39
39
40
40
5. Jupyter will show the content of `notebooks` directory and you can start using the provided notebooks (e.g., open scenario_dc.ipynb) or create your own.
41
41
42
-
**Note**: Docker is instructed to mount the content of `NetGraph` directory into the `/root/env` directory inside container, so any changes made to any files in the `NetGraph` directory will be reflected in the container and vice versa. The `ngraph` package is installed in the container in editable mode, so you can make changes to the code and leverage them immediately in JupyterLab. But don't forget to restart the JupyterLab kernelto see the changes.
42
+
**Note**: Docker is instructed to mount the content of `NetGraph` directory into the `/root/env` directory inside container, so any changes made to any files in the `NetGraph` directory will be reflected in the container and vice versa. The `ngraph` package is installed in the container in editable mode, so you can make changes to the code and leverage them immediately in JupyterLab. But **don't forget to restart the JupyterLab kernel** after making changes to the package code to see the effects in the running notebook.
43
43
44
44
To exit the JupyterLab server, press `Ctrl+C` in the terminal where the server is running. To stop the remaining Docker container, run:
45
45
@@ -60,31 +60,41 @@ To exit the JupyterLab server, press `Ctrl+C` in the terminal where the server i
60
60
61
61
1. Install the package using pip:
62
62
63
-
```bash
64
-
pip install ngraph
65
-
```
63
+
```bash
64
+
pip install ngraph
65
+
```
66
66
67
67
2. Use the package in your Python code:
68
68
69
-
```python
70
-
from ngraph.scenario import Scenario
71
-
from ngraph.explorer import NetworkExplorer
72
-
73
-
scenario_yaml = """
74
-
network:
75
-
groups:
76
-
servers:
77
-
node_count: 2
78
-
name_template: "server-{node_num}"
79
-
"""
80
-
81
-
scenario = Scenario.from_yaml(scenario_yaml)
82
-
network = scenario.network
83
-
explorer = NetworkExplorer.explore_network(network)
0 commit comments