Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: after a controller restart, if a given switch hasn't connected yet, trace results in exc trying to derive OpenFlow version #66

Open
viniarck opened this issue Apr 9, 2024 · 0 comments
Labels
bug Something isn't working future_release Planned for the next release

Comments

@viniarck
Copy link
Member

viniarck commented Apr 9, 2024

  • After a controller restart, if a given switch hasn't connected yet, trace results in exc trying to derive OpenFlow version

Expected behavior: A trace id should be returned but it shouldn't result in an exception.

How to reproduce

  • Start a mn topology, like linear,3
  • Start the controller
  • Stop the topology
  • Restart the controller
  • Send a sdntrace:
❯ echo '{ "trace": { "switch": { "dpid": "00:00:00:00:00:00:00:01", "in_port": 1}, "eth": {"dl_type": 2048, "dl_vlan": 2222}, "ip": { "nw_proto": 6 } } }' | http PUT http://127.0.0.1:8181/api/amlight/sdntrace/trace

Check out the

kytos $> controller.switches['00:00:00:00:00:00:00:01'].features

kytos $> controller.switches['00:00:00:00:00:00:00:01'].connection

kytos $> 

kytos $> controller.switches['00:00:00:00:00:00:00:01'].is_active()
Out[4]: False

kytos $> 2024-04-09 15:41:59,819 - INFO [uvicorn.access] (MainThread) 127.0.0.1:34918 - "GET /api/amlight/coloring/colors HTTP/1.1" 200
2024-04-09 15:41:59,821 - INFO [uvicorn.access] (MainThread) 127.0.0.1:34932 - "GET /api/amlight/coloring/colors HTTP/1.1" 200
2024-04-09 15:41:59,821 - INFO [uvicorn.access] (MainThread) 127.0.0.1:34908 - "PUT /api/amlight/sdntrace/trace HTTP/1.1" 200
2024-04-09 15:42:00,007 - INFO [kytos.napps.amlight/sdntrace] (Dummy-90) Creating thread to trace request id 30001...
2024-04-09 15:42:00,008 - WARNING [kytos.napps.amlight/sdntrace] (Dummy-90) Starting Trace Path ID: 30001
2024-04-09 15:42:00,014 - INFO [uvicorn.access] (MainThread) 127.0.0.1:34938 - "GET /api/amlight/coloring/colors HTTP/1.1" 200
2024-04-09 15:42:00,019 - INFO [uvicorn.access] (MainThread) 127.0.0.1:34948 - "GET /api/amlight/coloring/colors HTTP/1.1" 200
2024-04-09 15:42:00,021 - WARNING [kytos.napps.amlight/sdntrace] (Dummy-90) Trace 30001: Sending POut to switch: 00:00:00:00:00:00:00:01 and in_port 1 
Exception ignored in thread started by: <bound method TraceManager._spawn_trace of <napps.amlight.sdntrace.tracing.trace_manager.TraceManager object at 0x7f4af04c1610>>
Traceback (most recent call last):
  File "/home/viniarck/repos/napps/napps/amlight/sdntrace/tracing/trace_manager.py", line 95, in _spawn_trace
    tracer.tracepath()
  File "/home/viniarck/repos/napps/napps/amlight/sdntrace/tracing/tracer.py", line 83, in tracepath
    self.tracepath_loop(entries, color, switch)
  File "/home/viniarck/repos/napps/napps/amlight/sdntrace/tracing/tracer.py", line 102, in tracepath_loop
    result, packet_in = self.send_trace_probe(switch, in_port,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/viniarck/repos/napps/napps/amlight/sdntrace/tracing/tracer.py", line 141, in send_trace_probe
    send_packet_out(self.trace_mgr.controller,
  File "/home/viniarck/repos/napps/napps/amlight/sdntrace/backends/of_parser.py", line 39, in send_packet_out
    of_version = switch.features.header.version
                 ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'header'
@viniarck viniarck added bug Something isn't working future_release Planned for the next release labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working future_release Planned for the next release
Projects
None yet
Development

No branches or pull requests

1 participant