Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Link.bandwidth to interdomain Links based on ports type #209

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/sdx_pce/topology/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ def __init__(self):
("disabled", "maintenance"): "maintenance",
# defults to disabled
}
# bandwidth: the bandwidth attribute will be created based on both port
# speeds (the minimum of them). Port speed is stored on Port.type and
# can be 100FE, 1GE, 10GE, 25GE, 40GE, 50GE, 100GE, 400GE, and Other
# When the value Other is chosen, no bandwidth guaranteed services will
# be supported, so that we map that value to bandwidth=0
self.bandwidth_map = {
"100FE": 0.1,
"1GE": 1,
"10GE": 10,
"25GE": 25,
"40GE": 40,
"100GE": 100,
"400GE": 400,
"Other": 0,
}

def get_handler(self):
return self.topology_handler
Expand Down Expand Up @@ -321,7 +336,10 @@ def create_update_interdomain_link(self, port1, port2):
id=link_id,
name=f"{port1.name}--{port2.name}",
ports=[port1.id, port2.id],
bandwidth=100,
bandwidth=min(
self.bandwidth_map.get(port1.type, 100),
self.bandwidth_map.get(port2.type, 100),
),
residual_bandwidth=100,
latency=0,
packet_loss=0,
Expand Down