kytos-ng / of_core

Kytos Main OpenFlow Network Application (NApp)
MIT License
0 stars 5 forks source link

what if two switches have the same DPID #114

Open italovalcy opened 1 year ago

italovalcy commented 1 year ago

Accidentally, I configured two switches with the same DPID and Kytos behaving in a unexpected way:

Apr 20 18:46:05 e4d26ba1790f kytos.core.atcp_server:INFO atcp_server:131:  New connection from xx.xx.xx.226:43208
Apr 20 18:46:05 e4d26ba1790f kytos.core.atcp_server:INFO atcp_server:182:  Connection lost with client xx.xx.xx.224:50604. Reason: [Errno 9] Bad file descriptor
Apr 20 18:46:05 e4d26ba1790f kytos.napps.kytos/of_core:INFO main:140:  Connection ('xx.xx.xx.226', 43208), Switch 00:00:00:00:00:00:00:02: OPENFLOW HANDSHAKE COMPLETE
Apr 20 18:46:05 e4d26ba1790f kytos.napps.kytos/flow_manager:INFO main:603:  Send FlowMod from request dpid: 00:00:00:00:00:00:00:02, command: add, force: False, flows_dict: {'flows': [{'priority': 1000, 'table_id': 0, 'cookie': 12321848580485677058, 'match': {'dl_type': 35020, 'dl_vlan': 3799}, 'actions': [{'action_type': 'output', 'port': 4294967293}]}]}
Apr 20 18:46:05 e4d26ba1790f kytos.core.atcp_server:INFO atcp_server:131:  New connection from xx.xx.xx.224:50848
Apr 20 18:46:05 e4d26ba1790f kytos.core.atcp_server:INFO atcp_server:182:  Connection lost with client xx.xx.xx.226:43208. Reason: Request closed by client
Apr 20 18:46:05 e4d26ba1790f kytos.napps.kytos/of_core:INFO main:140:  Connection ('xx.xx.xx.224', 50848), Switch 00:00:00:00:00:00:00:02: OPENFLOW HANDSHAKE COMPLETE
Apr 20 18:46:05 e4d26ba1790f kytos.napps.kytos/flow_manager:INFO main:603:  Send FlowMod from request dpid: 00:00:00:00:00:00:00:02, command: add, force: False, flows_dict: {'flows': [{'priority': 1000, 'table_id': 0, 'cookie': 12321848580485677058, 'match': {'dl_type': 35020, 'dl_vlan': 3799}, 'actions': [{'action_type': 'output', 'port': 4294967293}]}]}
Apr 20 18:46:05 e4d26ba1790f kytos.core.atcp_server:INFO atcp_server:131:  New connection from xx.xx.xx.226:43210
Apr 20 18:46:05 e4d26ba1790f kytos.core.atcp_server:INFO atcp_server:182:  Connection lost with client xx.xx.xx.224:50848. Reason: [Errno 9] Bad file descriptor
Apr 20 18:46:05 e4d26ba1790f kytos.napps.kytos/of_core:INFO main:140:  Connection ('xx.xx.xx.226', 43210), Switch 00:00:00:00:00:00:00:02: OPENFLOW HANDSHAKE COMPLETE
Apr 20 18:46:05 e4d26ba1790f kytos.napps.kytos/flow_manager:INFO main:603:  Send FlowMod from request dpid: 00:00:00:00:00:00:00:02, command: add, force: False, flows_dict: {'flows': [{'priority': 1000, 'table_id': 0, 'cookie': 12321848580485677058, 'match': {'dl_type': 35020, 'dl_vlan': 3799}, 'actions': [{'action_type': 'output', 'port': 4294967293}]}]}
Apr 20 18:46:06 e4d26ba1790f kytos.core.atcp_server:INFO atcp_server:131:  New connection from xx.xx.xx.224:50852
Apr 20 18:46:06 e4d26ba1790f kytos.napps.kytos/of_core:INFO main:140:  Connection ('xx.xx.xx.224', 50852), Switch 00:00:00:00:00:00:00:02: OPENFLOW HANDSHAKE COMPLETE
Apr 20 18:46:06 e4d26ba1790f kytos.core.atcp_server:INFO atcp_server:131:  New connection from xx.xx.xx.226:43214
Apr 20 18:46:06 e4d26ba1790f kytos.napps.kytos/flow_manager:INFO main:603:  Send FlowMod from request dpid: 00:00:00:00:00:00:00:02, command: add, force: False, flows_dict: {'flows': [{'priority': 1000, 'table_id': 0, 'cookie': 12321848580485677058, 'match': {'dl_type': 35020, 'dl_vlan': 3799}, 'actions': [{'action_type': 'output', 'port': 4294967293}]}]}
Apr 20 18:46:06 e4d26ba1790f kytos.napps.kytos/of_core:INFO main:140:  Connection ('xx.xx.xx.226', 43214), Switch 00:00:00:00:00:00:00:02: OPENFLOW HANDSHAKE COMPLETE
Apr 20 18:46:06 e4d26ba1790f kytos.napps.kytos/flow_manager:INFO main:603:  Send FlowMod from request dpid: 00:00:00:00:00:00:00:02, command: add, force: False, flows_dict: {'flows': [{'priority': 1000, 'table_id': 0, 'cookie': 12321848580485677058, 'match': {'dl_type': 35020, 'dl_vlan': 3799}, 'actions': [{'action_type': 'output', 'port': 4294967293}]}]}

Maybe we could do something different on the core to handle this situation. Maybe supporting multiple DPIDs per switch object and then choosing a random one for being the duplicated one. Having multiple DPIDs per switch allow us even change the DPID of a switch