Closed italovalcy closed 1 year ago
Thanks for catching and reporting this, @italovalcy.
I'll start to analyze this issue and fix it.
It turns out that coloring could overflow FlowMod's cookie value. This was resulting in a silent unhandled exception on msg_out_event_handler
coroutine, that's why it became unresponsive for msg_out for a given dpid connection, although it's just a validation issue, core queues couroutine handlers are critical they can't crash for such cases.
2023-02-17 09:52:42,976 - INFO [kytos.napps.kytos/flow_manager] [main.py:601:_send_flow_mods_from_request] (Thread-96) Send FlowMod from request dpid: cc:4e:24:4b:11:00:00:00, command:
add, force: True, flows_dict: {'flows': [{'table_id': 0, 'match': {'dl_src': '38:94:06:ee:ee:ee'}, 'priority': 50000, 'actions': [{'action_type': 'output', 'port': 4294967293}], 'cookie
': 27115650311270694912}], 'force': True}
2023-02-17 09:52:43,000 - ERROR [kytos.core.controller] [controller.py:629:msg_out_event_handler] (MainThread) FlowMod.cookie - Expected UBInt64, found value "27115650311270694912"
of type int
kytos $> 27115650311270694912 > 2 ** 64
Out[1]: True
kytos $> 27115650311270694912 > 2 ** 65
Out[2]: False
I'll send PRs to coloring
, kytos
and also flow_manager
to have a minimal FlowMod
pack validation until we also have in the next version 2023.1 better validation.
All related PRs have landed, I'll go ahead and close this issue.
Hi,
I'm using Kytos through the
amlight/kytos:latest
docker image and when using a certain switch's DPID, Kytos becomes unresponsive. The switches start reconnecting and all components get affected.In the container, the following Napps are enabled:
How to reproduce:
amlight/kytos
docker image, create a topology with the following python code:""" This example creates a multi-controller network from semi-scratch by using the net.add*() API and manually starting the switches and controllers. """
import os
from mininet.clean import Cleanup # from mininet.net import Mininet from mininet.node import RemoteController from mininet.cli import CLI from mininet.log import setLogLevel
ip = os.environ.get('CONTROLLER_IP', '127.0.0.1') port = int(os.environ.get('CONTROLLER_PORT', '6653'))
def single_domain(): """ Create AmLight network for tests """
if name == 'main': setLogLevel('info') # for CLI output Cleanup.cleanup() single_domain()
tmux new-sess -d -s mn python3 /mytopo.py tmux new-sess -d -s k1 "kytosd -f"
for sw in $(curl -s http://127.0.0.1:8181/api/kytos/topology/v3/switches | jq -r '.switches[].id'); do curl -H 'Content-type: application/json' -X POST http://127.0.0.1:8181/api/kytos/topology/v3/switches/$sw/enable; curl -H 'Content-type: application/json' -X POST http://127.0.0.1:8181/api/kytos/topology/v3/interfaces/switch/$sw/enable; done
Feb 16 20:19:11 29f740abc748 kytos.core.atcp_server:INFO atcp_server:131: New connection from 127.0.0.1:46474 Feb 16 20:19:11 29f740abc748 kytos.core.atcp_server:INFO atcp_server:131: New connection from 127.0.0.1:46476 Feb 16 20:19:11 29f740abc748 kytos.napps.kytos/of_core:INFO main:140: Connection ('127.0.0.1', 46474), Switch 00:24:38:94:06:00:00:00: OPENFLOW HANDSHAKE COMPLETE Feb 16 20:19:11 29f740abc748 kytos.napps.kytos/of_core:INFO main:140: Connection ('127.0.0.1', 46476), Switch cc:4e:24:4b:11:00:00:00: OPENFLOW HANDSHAKE COMPLETE Feb 16 20:19:27 29f740abc748 kytos.napps.kytos/flow_manager:INFO main:600: Send FlowMod from request dpid: 00:24:38:94:06:00:00:00, command: add, force: False, flows_dict: {'flows': [{'priority': 1000, 'table_id': 0, 'cookie': 12321910788892655616, 'match': {'dl_type': 35020, 'dl_vlan': 3799}, 'actions': [{'action_type': 'output', 'port': 4294967293}]}]} Feb 16 20:19:27 29f740abc748 kytos.napps.kytos/flow_manager:INFO main:600: Send FlowMod from request dpid: cc:4e:24:4b:11:00:00:00, command: add, force: False, flows_dict: {'flows': [{'priority': 1000, 'table_id': 0, 'cookie': 12321888485312036864, 'match': {'dl_type': 35020, 'dl_vlan': 3799}, 'actions': [{'action_type': 'output', 'port': 4294967293}]}]} Feb 16 20:19:27 29f740abc748 kytos.napps.kytos/flow_manager:INFO main:600: Send FlowMod from request dpid: 00:24:38:94:06:00:00:00, command: add, force: True, flows_dict: {'flows': [{'table_id': 0, 'match': {'dl_src': '24:4b:11:ee:ee:ee'}, 'priority': 50000, 'actions': [{'action_type': 'output', 'port': 4294967293}], 'cookie': 12404101482092167168}], 'force': True} Feb 16 20:19:27 29f740abc748 kytos.napps.kytos/flow_manager:INFO main:600: Send FlowMod from request dpid: cc:4e:24:4b:11:00:00:00, command: add, force: True, flows_dict: {'flows': [{'table_id': 0, 'match': {'dl_src': '38:94:06:ee:ee:ee'}, 'priority': 50000, 'actions': [{'action_type': 'output', 'port': 4294967293}], 'cookie': 27115650311270694912}], 'force': True}
Feb 16 20:19:37 29f740abc748 ovs-vswitchd: ovs|00958|rconn|ERR|s3<->tcp:127.0.0.1:6653: no response to inactivity probe after 5 seconds, disconnecting Feb 16 20:19:37 29f740abc748 kytos.core.atcp_server:INFO atcp_server:182: Connection lost with client 127.0.0.1:46476. Reason: Request closed by client Feb 16 20:19:37 29f740abc748 ovs-vswitchd: ovs|00959|rconn|ERR|s1<->tcp:127.0.0.1:6653: no response to inactivity probe after 5 seconds, disconnecting Feb 16 20:19:37 29f740abc748 kytos.core.atcp_server:INFO atcp_server:182: Connection lost with client 127.0.0.1:46474. Reason: Request closed by client Feb 16 20:19:38 29f740abc748 kytos.core.atcp_server:INFO atcp_server:131: New connection from 127.0.0.1:46498 Feb 16 20:19:38 29f740abc748 kytos.core.atcp_server:INFO atcp_server:131: New connection from 127.0.0.1:46500 Feb 16 20:19:40 29f740abc748 kytos.core.atcp_server:INFO atcp_server:182: Connection lost with client 127.0.0.1:46498. Reason: Request closed by client Feb 16 20:19:40 29f740abc748 kytos.core.atcp_server:INFO atcp_server:182: Connection lost with client 127.0.0.1:46500. Reason: Request closed by client Feb 16 20:19:42 29f740abc748 kytos.core.atcp_server:INFO atcp_server:131: New connection from 127.0.0.1:46502 Feb 16 20:19:42 29f740abc748 kytos.core.atcp_server:INFO atcp_server:131: New connection from 127.0.0.1:46504 Feb 16 20:19:44 29f740abc748 kytos.core.atcp_server:INFO atcp_server:182: Connection lost with client 127.0.0.1:46502. Reason: Request closed by client Feb 16 20:19:44 29f740abc748 kytos.core.atcp_server:INFO atcp_server:182: Connection lost with client 127.0.0.1:46504. Reason: Request closed by client