Skip to content

Commit

Permalink
Merge pull request #120 from atlanticwave-sdx/101.vlan
Browse files Browse the repository at this point in the history
VLAN reservation
  • Loading branch information
sajith authored Jun 29, 2023
2 parents d18c67e + dc9842f commit 79ef5c7
Show file tree
Hide file tree
Showing 3 changed files with 479 additions and 55 deletions.
70 changes: 70 additions & 0 deletions src/sdx/pce/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,73 @@ class ConnectionSolution:

connection_map: Mapping[ConnectionRequest, List[ConnectionPath]]
cost: float


# The classess below should help us construct a breakdown of the below
# form that pertains to one domain:
#
# {
# "name": "TENET_vlan_201_203_Ampath_Tenet",
# "dynamic_backup_path": true,
# "uni_a": {
# "tag": {
# "value": 203,
# "tag_type": 1
# },
# "interface_id": "cc:00:00:00:00:00:00:07:41"
# },
# "uni_z": {
# "tag": {
# "value": 201,
# "tag_type": 1
# },
# "interface_id": "cc:00:00:00:00:00:00:08:50"
# }
# }


@dataclass_json
@dataclass(frozen=True)
class VlanTag:
"""
Representation of a VLAN tag.
TODO: document tag_type.
"""

value: int
tag_type: int


@dataclass_json
@dataclass(frozen=True)
class VlanTaggedPort:
"""
Representation of a port.
"""

tag: VlanTag
port_id: str


@dataclass_json
@dataclass(frozen=True)
class VlanTaggedBreakdown:
"""
Path breakdown within a single domain with VLAN assignments.
"""

name: str
dynamic_backup_path: bool
uni_a: VlanTaggedPort
uni_z: VlanTaggedPort


@dataclass_json
@dataclass(frozen=True)
class VlanTaggedBreakdowns:
"""
Mapping from domain to breakdown.
"""

breakdowns: Mapping[str, VlanTaggedBreakdown]
Loading

0 comments on commit 79ef5c7

Please sign in to comment.