atlanticwave-sdx / sdx-controller

Central Controller for AtlanticWave SDX.
https://www.atlanticwave-sdx.net
MIT License
1 stars 3 forks source link

Creating a connection to a port directly attached to a neighbor domain results in wrong breakdown #309

Open italovalcy opened 1 month ago

italovalcy commented 1 month ago

Considering the three topologies documented on datamodel repo (see links below), if you create a connection between Ampath3:50 and Sax01:50, since Sax01 is directly attached to its neighbor domain (Ampath), the breakdown connections will be missing one item:

curl -s -X POST -H 'Content-type: application/json' http://0.0.0.0:8080/SDX-Controller/1.0.0/connection -d '{"name": "VLAN between AMPATH/302 and SAX/302", "endpoints": [{"port_id": "urn:sdx:port:ampath.net:Ampath3:50", "vlan": "302"}, {"port_id": "urn:sdx:port:sax.net:Sax01:50", "vlan": "302"}]}'

On the SDX-Controller logs:

2024-08-10T01:30:37.454208080Z INFO:sdx_pce.topology.temanager:VLAN reservation: domain: urn:sdx:topology:ampath.net, ingress_vlan: 302, egress_vlan: 4095
2024-08-10T01:30:37.454216250Z INFO:sdx_pce.topology.temanager:generate_connection_breakdown(): tagged_breakdown: VlanTaggedBreakdowns(breakdowns={'urn:sdx:topology:ampath.net': VlanTaggedBreakdown(name='AMPATH_vlan_302_4095', dynamic_backup_path=True, uni_a=VlanTaggedPort(tag=VlanTag(value=302, tag_type=1), port_id='urn:sdx:port:ampath.net:Ampath3:50'), uni_z=VlanTaggedPort(tag=VlanTag(value=4095, tag_type=1), port_id='urn:sdx:port:ampath.net:Ampath1:40'))})
2024-08-10T01:30:37.545652574Z INFO:sdx_controller.messaging.topic_queue_producer:Publishing link: {"operation": "post", "link": {"name": "AMPATH_vlan_302_4095", "dynamic_backup_path": true, "uni_a": {"tag": {"value": 302, "tag_type": 1}, "port_id": "urn:sdx:port:ampath.net:Ampath3:50"}, "uni_z": {"tag": {"value": 4095, "tag_type": 1}, "port_id": "urn:sdx:port:ampath.net:Ampath1:40"}}}, MQ_HOST: 192.168.0.12, MQ_PORT: 5672, exchange_name: connection, routing_key: ampath.net
2024-08-10T01:30:37.594143332Z INFO:sdx_controller.controllers.connection_controller:place_connection result: ID: 332b3354-9e3c-4b07-972d-984b3dff37d4 reason='Connection published', code=200

As can be seen above, the breakdowns is composed only by domain urn:sdx:topology:ampath.net, while it was expected to also see additionally the domain urn:sdx:topology:sax.net with something similar to VlanTaggedBreakdown(name='SAX_vlan_4095_302', dynamic_backup_path=True, uni_a=VlanTaggedPort(tag=VlanTag(value=4095, tag_type=1), port_id='urn:sdx:port:sax.net:Sax01:40'), uni_z=VlanTaggedPort(tag=VlanTag(value=302, tag_type=1), port_id='urn:sdx:port:sax.net:Sax01:50'))

Steps to reproduce: just follow the guide available at https://sdx-docs.readthedocs.io/en/latest/sdx_deploy_single_server.html and create a connection as showed above.

Or you can just use the topologies on your local tests: