Skip to content

Commit

Permalink
Merge pull request #159 from jfuruness/asra-b-bugfix
Browse files Browse the repository at this point in the history
Fix bug in ASRA-B
  • Loading branch information
c-morris authored Dec 30, 2024
2 parents 8bb5f4a + 25a44d1 commit ca2f0e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bgpy/simulation_engine/policies/aspa/asra.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _valid_ann(self, ann: "Ann", from_rel: Relationships) -> bool:
# If from_rel == PROVIDER, do ASRA-B "fake link" checks
# i.e., check from min_up_ramp up to the end of the path

path = ann.as_path
path = ann.as_path[::-1]
n = len(path)

# Compute min_up_ramp in a simple way:
Expand Down Expand Up @@ -70,7 +70,7 @@ def _get_min_up_ramp_length(self, ann: "Ann") -> int:
If we never fail, we return len(path).
"""
path = ann.as_path
path = ann.as_path[::-1]
for i in range(len(path) - 1):
asn1 = path[i]
asn2 = path[i + 1]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "bgpy_pkg"
version = "13.0.3"
version = "13.0.4"
requires-python = ">=3.10"
description = "Simulates BGP, ROV, ASPA, etc in an extensible manner"
readme = "README.md"
Expand Down
3 changes: 2 additions & 1 deletion scripts/aspawn_debug.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

from bgpy.shared.enums import SpecialPercentAdoptions
from bgpy.simulation_engine import ASRA
from bgpy.simulation_engine import ASRA, ASPAwN
from bgpy.simulation_framework import ScenarioConfig, Simulation, ForgedOriginPrefixHijack


Expand All @@ -22,6 +22,7 @@ def main():
),
scenario_configs=(
ScenarioConfig(ScenarioCls=ForgedOriginPrefixHijack, AdoptPolicyCls=ASRA),
ScenarioConfig(ScenarioCls=ForgedOriginPrefixHijack, AdoptPolicyCls=ASPAwN),
),
output_dir=Path("~/Desktop/aspawn").expanduser(),
num_trials=10,
Expand Down

0 comments on commit ca2f0e7

Please sign in to comment.