Skip to content

Commit 35139a3

Browse files
committed
one_to_one for inter_metro
1 parent a7a5aff commit 35139a3

6 files changed

Lines changed: 344 additions & 12 deletions

File tree

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
output:
2+
scenario_metadata:
3+
title: "Small Test: East Coast, Clos_L16_S4 (Hose, mesh)"
4+
5+
formatting:
6+
json_indent: 2
7+
yaml_anchors: true
8+
9+
scenario_seed: 42
10+
11+
build:
12+
build_defaults:
13+
pop_per_metro: 2
14+
site_blueprint: SingleRouter
15+
dc_regions_per_metro: 0
16+
dc_region_blueprint: DCRegion
17+
intra_metro_link:
18+
capacity: 12_800
19+
cost: 1
20+
attrs: { link_type: intra_metro }
21+
role_pairs: ["core|leaf"]
22+
inter_metro_link:
23+
capacity: 3_200
24+
cost: 1
25+
attrs: { link_type: inter_metro_corridor }
26+
role_pairs: ["core|leaf"]
27+
mode: mesh
28+
dc_to_pop_link:
29+
capacity: 25_600
30+
cost: 1
31+
attrs: { link_type: dc_to_pop }
32+
role_pairs: ["dc|core", "dc|leaf"]
33+
build_overrides:
34+
- metros: [new-york-jersey-city-newark, columbus, washington-arlington]
35+
site_blueprint: Clos_L16_S4
36+
dc_regions_per_metro: 1
37+
dc_region_blueprint: DCRegion
38+
39+
tm_sizing:
40+
enabled: true
41+
matrix_name: baseline_traffic_matrix
42+
quantum_gbps: 3200.0
43+
headroom: 1.3
44+
alpha_dc_to_pop: 1.2
45+
beta_intra_pop: 0.8
46+
flow_placement: EQUAL_BALANCED
47+
edge_select: ALL_MIN_COST
48+
respect_min_base_capacity: true
49+
50+
components:
51+
hw_component:
52+
core: CoreRouter
53+
leaf: LeafRouter
54+
spine: SpineRouter
55+
dc: {}
56+
optics:
57+
core|core: 800G-ZR+
58+
leaf|leaf: 800G-ZR+
59+
core|leaf: 800G-ZR+
60+
leaf|dc: 800G-ZR+
61+
core|dc: 800G-ZR+
62+
leaf|spine: 800G-DR4
63+
spine|leaf: 1600G-2xDR4
64+
65+
failure_policies:
66+
assignments:
67+
default: "mc_baseline"
68+
69+
workflows:
70+
assignments:
71+
default: "design_analysis_brief"
72+
73+
visualization:
74+
corridors:
75+
use_real_geometry: true
76+
site_graph:
77+
export: true
78+
blueprints:
79+
export: true
80+
81+
traffic:
82+
enabled: true
83+
model: hose
84+
samples: 1
85+
gbps_per_mw: 200.0
86+
mw_per_dc_region: 150.0
87+
priority_ratios:
88+
0: 1
89+
flow_policy_config:
90+
0: TE_UCMP_UNLIM
91+
matrix_name: baseline_traffic_matrix
92+
gravity:
93+
rounding_gbps: 100.0
94+
95+
data_sources:
96+
uac_polygons: "data/tl_2020_us_uac20.zip"
97+
tiger_roads: "data/tl_2024_us_primaryroads.zip"
98+
conus_boundary: "data/cb_2024_us_state_500k.zip"
99+
100+
projection:
101+
target_crs: "EPSG:5070"
102+
103+
clustering:
104+
metro_clusters: 5
105+
max_uac_radius_km: 100.0
106+
export_clusters: false
107+
export_integrated_graph: true
108+
109+
override_metro_clusters:
110+
- "New York"
111+
- "Washington"
112+
- "Chicago"
113+
- "Atlanta"
114+
- "Columbus"
115+
116+
coordinate_precision: 1
117+
area_precision: 2
118+
119+
highway_processing:
120+
min_edge_length_km: 0.0
121+
snap_precision_m: 150.0
122+
highway_classes: ["S1100"]
123+
min_cycle_nodes: 3
124+
filter_largest_component: true
125+
validation_sample_size: 5
126+
127+
corridors:
128+
k_paths: 1
129+
k_nearest: 6
130+
max_edge_km: 1000.0
131+
max_corridor_distance_km: 1500.0
132+
133+
risk_groups:
134+
enabled: true
135+
group_prefix: "corridor_risk"
136+
exclude_metro_radius_shared: true
137+
138+
validation:
139+
max_metro_highway_distance_km: 50.0
140+
require_connected: true
141+
max_degree_threshold: 1000
142+
high_degree_warning: 20
143+
min_largest_component_fraction: 0.5
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
output:
2+
scenario_metadata:
3+
title: "Small Test: East Coast, Clos_L16_S4 (Hose, one_to_one)"
4+
5+
formatting:
6+
json_indent: 2
7+
yaml_anchors: true
8+
9+
scenario_seed: 42
10+
11+
build:
12+
build_defaults:
13+
pop_per_metro: 2
14+
site_blueprint: SingleRouter
15+
dc_regions_per_metro: 0
16+
dc_region_blueprint: DCRegion
17+
intra_metro_link:
18+
capacity: 12_800
19+
cost: 1
20+
attrs: { link_type: intra_metro }
21+
role_pairs: ["core|leaf"]
22+
inter_metro_link:
23+
capacity: 3_200
24+
cost: 1
25+
attrs: { link_type: inter_metro_corridor }
26+
role_pairs: ["core|leaf"]
27+
mode: one_to_one
28+
dc_to_pop_link:
29+
capacity: 25_600
30+
cost: 1
31+
attrs: { link_type: dc_to_pop }
32+
role_pairs: ["dc|core", "dc|leaf"]
33+
build_overrides:
34+
- metros: [new-york-jersey-city-newark, columbus, washington-arlington]
35+
site_blueprint: Clos_L16_S4
36+
dc_regions_per_metro: 1
37+
dc_region_blueprint: DCRegion
38+
39+
tm_sizing:
40+
enabled: true
41+
matrix_name: baseline_traffic_matrix
42+
quantum_gbps: 3200.0
43+
headroom: 1.3
44+
alpha_dc_to_pop: 1.2
45+
beta_intra_pop: 0.8
46+
flow_placement: EQUAL_BALANCED
47+
edge_select: ALL_MIN_COST
48+
respect_min_base_capacity: true
49+
50+
components:
51+
hw_component:
52+
core: CoreRouter
53+
leaf: LeafRouter
54+
spine: SpineRouter
55+
dc: {}
56+
optics:
57+
core|core: 800G-ZR+
58+
leaf|leaf: 800G-ZR+
59+
core|leaf: 800G-ZR+
60+
leaf|dc: 800G-ZR+
61+
core|dc: 800G-ZR+
62+
leaf|spine: 800G-DR4
63+
spine|leaf: 1600G-2xDR4
64+
65+
failure_policies:
66+
assignments:
67+
default: "mc_baseline"
68+
69+
workflows:
70+
assignments:
71+
default: "design_analysis_brief"
72+
73+
visualization:
74+
corridors:
75+
use_real_geometry: true
76+
site_graph:
77+
export: true
78+
blueprints:
79+
export: true
80+
81+
traffic:
82+
enabled: true
83+
model: hose
84+
samples: 1
85+
gbps_per_mw: 200.0
86+
mw_per_dc_region: 150.0
87+
priority_ratios:
88+
0: 1
89+
flow_policy_config:
90+
0: TE_UCMP_UNLIM
91+
matrix_name: baseline_traffic_matrix
92+
gravity:
93+
rounding_gbps: 100.0
94+
95+
data_sources:
96+
uac_polygons: "data/tl_2020_us_uac20.zip"
97+
tiger_roads: "data/tl_2024_us_primaryroads.zip"
98+
conus_boundary: "data/cb_2024_us_state_500k.zip"
99+
100+
projection:
101+
target_crs: "EPSG:5070"
102+
103+
clustering:
104+
metro_clusters: 5
105+
max_uac_radius_km: 100.0
106+
export_clusters: false
107+
export_integrated_graph: true
108+
109+
override_metro_clusters:
110+
- "New York"
111+
- "Washington"
112+
- "Chicago"
113+
- "Atlanta"
114+
- "Columbus"
115+
116+
coordinate_precision: 1
117+
area_precision: 2
118+
119+
highway_processing:
120+
min_edge_length_km: 0.0
121+
snap_precision_m: 150.0
122+
highway_classes: ["S1100"]
123+
min_cycle_nodes: 3
124+
filter_largest_component: true
125+
validation_sample_size: 5
126+
127+
corridors:
128+
k_paths: 1
129+
k_nearest: 6
130+
max_edge_km: 1000.0
131+
max_corridor_distance_km: 1500.0
132+
133+
risk_groups:
134+
enabled: true
135+
group_prefix: "corridor_risk"
136+
exclude_metro_radius_shared: true
137+
138+
validation:
139+
max_metro_highway_distance_km: 50.0
140+
require_connected: true
141+
max_degree_threshold: 1000
142+
high_degree_warning: 20
143+
min_largest_component_fraction: 0.5

topogen/config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ class LinkParams:
138138
# Optional striping configuration for controlled device-group partitioning
139139
# during adjacency creation. Example: {"width": 4}
140140
striping: dict[str, Any] = field(default_factory=dict)
141+
# Optional adjacency formation mode (used by inter-metro links).
142+
# "mesh" connects all PoP pairs between metros; "one_to_one" connects
143+
# only corresponding indices: pop1-pop1, pop2-pop2, ... up to min counts.
144+
mode: str = "mesh"
141145

142146

143147
@dataclass
@@ -672,6 +676,7 @@ def _from_dict(cls, config_dict: dict[str, Any]) -> TopologyConfig:
672676
match=intra_metro_link_dict.get("match", {}),
673677
role_pairs=intra_metro_link_dict.get("role_pairs", []) or [],
674678
striping=intra_metro_link_dict.get("striping", {}) or {},
679+
mode=str(intra_metro_link_dict.get("mode", "mesh")),
675680
)
676681
inter_metro_link = LinkParams(
677682
capacity=inter_metro_link_dict.get("capacity", 100),
@@ -683,6 +688,7 @@ def _from_dict(cls, config_dict: dict[str, Any]) -> TopologyConfig:
683688
match=inter_metro_link_dict.get("match", {}),
684689
role_pairs=inter_metro_link_dict.get("role_pairs", []) or [],
685690
striping=inter_metro_link_dict.get("striping", {}) or {},
691+
mode=str(inter_metro_link_dict.get("mode", "mesh")),
686692
)
687693
dc_to_pop_link = LinkParams(
688694
capacity=dc_to_pop_link_dict.get("capacity", 400),
@@ -694,6 +700,7 @@ def _from_dict(cls, config_dict: dict[str, Any]) -> TopologyConfig:
694700
match=dc_to_pop_link_dict.get("match", {}),
695701
role_pairs=dc_to_pop_link_dict.get("role_pairs", []) or [],
696702
striping=dc_to_pop_link_dict.get("striping", {}) or {},
703+
mode=str(dc_to_pop_link_dict.get("mode", "mesh")),
697704
)
698705

699706
# Create BuildDefaults with explicit parameters

topogen/scenario/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def _rp_list(obj: Any) -> list[str | list[str]]:
7373
"striping": getattr(defaults.intra_metro_link, "striping", {})
7474
if isinstance(getattr(defaults.intra_metro_link, "striping", {}), dict)
7575
else {},
76+
"mode": getattr(defaults.intra_metro_link, "mode", "mesh"),
7677
},
7778
"inter_metro_link": {
7879
"capacity": defaults.inter_metro_link.capacity,
@@ -83,6 +84,7 @@ def _rp_list(obj: Any) -> list[str | list[str]]:
8384
"striping": getattr(defaults.inter_metro_link, "striping", {})
8485
if isinstance(getattr(defaults.inter_metro_link, "striping", {}), dict)
8586
else {},
87+
"mode": getattr(defaults.inter_metro_link, "mode", "mesh"),
8688
},
8789
"dc_to_pop_link": {
8890
"capacity": defaults.dc_to_pop_link.capacity,
@@ -93,6 +95,7 @@ def _rp_list(obj: Any) -> list[str | list[str]]:
9395
"striping": getattr(defaults.dc_to_pop_link, "striping", {})
9496
if isinstance(getattr(defaults.dc_to_pop_link, "striping", {}), dict)
9597
else {},
98+
"mode": getattr(defaults.dc_to_pop_link, "mode", "mesh"),
9699
},
97100
}
98101

0 commit comments

Comments
 (0)