kytos-ng / mef_eline

Kytos NApp to create and manage point-to-point L2 circuits
https://kytos-ng.github.io/api/mef_eline.html
MIT License
0 stars 9 forks source link

[release 2023.2.7] backport: fix: try to handle uni interface up as link up for inter-EVCs #577

Closed viniarck closed 3 days ago

viniarck commented 3 days ago

Backport of https://github.com/kytos-ng/mef_eline/pull/573

Summary

Local Tests

Run one of the cases mentioned in the linked PR but with kytosd on version 2023.2

     _   __      _
    | | / /     | |
    | |/ / _   _| |_ ___  ___          _ __   __ _
    |    \| | | | __/ _ \/ __| ______ | '_ \ / _` |
    | |\  \ |_| | || (_) \__ \|______|| | | | (_| |
    \_| \_/\__, |\__\___/|___/        |_| |_|\__, |
            __/ |                             __/ |
           |___/                             |___/

    Welcome to Kytos SDN Platform!

    Kytos website.: https://kytos-ng.github.io/about/
    Documentation.: https://github.com/kytos-ng/documentation/tree/master/tutorials/napps
    OF Address....: tcp://0.0.0.0:6653
    WEB UI........: http://0.0.0.0:8181/
    Kytos Version.: 2023.2.0

kytos $> 2024-11-27 13:24:29,467 - INFO [kytos.napps.kytos/of_core] (MainThread) PortStatus modified interface 00:00:00:00:00:00:00:01:4 state OFPPS_LIVE                                 
2024-11-27 13:24:29,468 - INFO [kytos.napps.kytos/of_core] (MainThread) PortStatus modified interface 00:00:00:00:00:00:00:03:3 state OFPPS_LIVE
2024-11-27 13:24:29,570 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_20) Event handle_interface_link_up Interface('s1-eth4', 4, Switch('00:00:00:00:00:00:00:01'))
2024-11-27 13:24:29,571 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_17) Event handle_interface_link_up Interface('s3-eth3', 3, Switch('00:00:00:00:00:00:00:03'))
2024-11-27 13:24:31,297 - INFO [uvicorn.access] (MainThread) 127.0.0.1:56392 - "GET /api/kytos/mef_eline/v2/evc/?archived=false HTTP/1.1" 200
kytos $>                                                                                                                                                                                  

kytos $> 2024-11-27 13:24:39,481 - INFO [kytos.napps.kytos/topology] (thread_pool_app_0) Link(Interface('s3-eth3', 3, Switch('00:00:00:00:00:00:00:03')), Interface('s1-eth4', 4, Switch('
00:00:00:00:00:00:00:01')), c8b55359990f89a5849813dc348d30e9e1f991bad1dcb7f82112bd35429d9b07) changed status EntityStatus.UP, reason: link up
2024-11-27 13:24:39,484 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_app_13) Event handle_link_up Link(Interface('s3-eth3', 3, Switch('00:00:00:00:00:00:00:03')), Interface('s1-eth4
', 4, Switch('00:00:00:00:00:00:00:01')), c8b55359990f89a5849813dc348d30e9e1f991bad1dcb7f82112bd35429d9b07)
2024-11-27 13:24:39,493 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:03, command: delete, force: True,  flows[0, 1]:
 [{'cookie': 12303728060200799552, 'cookie_mask': 18446744073709551615}]
2024-11-27 13:24:39,506 - INFO [uvicorn.access] (MainThread) 127.0.0.1:56402 - "POST /api/kytos/flow_manager/v2/delete/00%3A00%3A00%3A00%3A00%3A00%3A00%3A03 HTTP/1.1" 202
2024-11-27 13:24:39,516 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:01, command: delete, force: True,  flows[0, 1]:
 [{'cookie': 12303728060200799552, 'cookie_mask': 18446744073709551615}]
2024-11-27 13:24:39,521 - INFO [uvicorn.access] (MainThread) 127.0.0.1:56418 - "POST /api/kytos/flow_manager/v2/delete/00%3A00%3A00%3A00%3A00%3A00%3A00%3A01 HTTP/1.1" 202
2024-11-27 13:24:39,540 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:01, command: add, force: False,  flows[0, 2]: [
{'match': {'in_port': 1}, 'cookie': 12303728060200799552, 'actions': [{'action_type': 'push_vlan', 'tag_type': 's'}, {'action_type': 'set_vlan', 'vlan_id': 1}, {'action_type': 'output', 
'port': 4}], 'owner': 'mef_eline', 'table_group': 'epl', 'table_id': 0, 'priority': 10000}, {'match': {'in_port': 4, 'dl_vlan': 1}, 'cookie': 12303728060200799552, 'actions': [{'action_t
ype': 'pop_vlan'}, {'action_type': 'output', 'port': 1}], 'owner': 'mef_eline', 'table_group': 'evpl', 'table_id': 0, 'priority': 20000}]
2024-11-27 13:24:39,546 - INFO [uvicorn.access] (MainThread) 127.0.0.1:56432 - "POST /api/kytos/flow_manager/v2/flows/00%3A00%3A00%3A00%3A00%3A00%3A00%3A01 HTTP/1.1" 202
2024-11-27 13:24:39,553 - INFO [kytos.napps.kytos/flow_manager] (AnyIO worker thread) Send FlowMod from request dpid: 00:00:00:00:00:00:00:03, command: add, force: False,  flows[0, 2]: [
{'match': {'in_port': 1}, 'cookie': 12303728060200799552, 'actions': [{'action_type': 'push_vlan', 'tag_type': 's'}, {'action_type': 'set_vlan', 'vlan_id': 1}, {'action_type': 'output', 
'port': 3}], 'owner': 'mef_eline', 'table_group': 'epl', 'table_id': 0, 'priority': 10000}, {'match': {'in_port': 3, 'dl_vlan': 1}, 'cookie': 12303728060200799552, 'actions': [{'action_t
ype': 'pop_vlan'}, {'action_type': 'output', 'port': 1}], 'owner': 'mef_eline', 'table_group': 'evpl', 'table_id': 0, 'priority': 20000}]
2024-11-27 13:24:39,558 - INFO [uvicorn.access] (MainThread) 127.0.0.1:56440 - "POST /api/kytos/flow_manager/v2/flows/00%3A00%3A00%3A00%3A00%3A00%3A00%3A03 HTTP/1.1" 202
2024-11-27 13:24:39,563 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_app_13) EVC(bf9f7b99464d40, epl_static) was deployed. Won't be able to activate EVC(bf9f7b99464d40, epl_static) 
due to UNIs: {'00:00:00:00:00:00:00:01:1': {'status': 'DOWN', 'status_reason': {'deactivated'}}}
kytos $>                                                                                                                                                                                  

kytos $> 2024-11-27 13:24:45,276 - INFO [kytos.napps.kytos/of_core] (MainThread) PortStatus modified interface 00:00:00:00:00:00:00:01:1 state OFPPS_LIVE                                 
2024-11-27 13:24:45,379 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_7) Event handle_interface_link_up Interface('s1-eth1', 1, Switch('00:00:00:00:00:00:00:01'))
2024-11-27 13:24:45,380 - INFO [kytos.napps.kytos/mef_eline] (thread_pool_sb_7) Activating EVC(bf9f7b99464d40, epl_static). Interfaces: {'00:00:00:00:00:00:00:01:1': {'status': 'UP', 'st
atus_reason': set()}, '00:00:00:00:00:00:00:03:1': {'status': 'UP', 'status_reason': set()}}.

End-to-End Tests

In progress in the linked PR