Hello,

OpenFlow 1.3+ does not have ports.  Hence,

As per* ryu/controller/ofp_handler.py*, we have:

188         # hacky workaround, will be removed. OF1.3 doesn't have
189         # ports. An application should not depend on them. But there
190         # might be such bad applications so keep this workaround for
191         # while.
192         if datapath.ofproto.OFP_VERSION < 0x04:
193             datapath.ports = msg.ports


Now, in *ryu/controller/dpset.py*, we have

163         datapath = msg.datapath
164         datapath.ports = msg.ports

If I* don't have a check* for OF version < 0x04, I get this error:

linux-acls:/usr/local/src/ryu # *bin/ryu-manager --verbose
ofctl_rest_v1_3.py*
loading app ofctl_rest_v1_3.py
loading app ryu.controller.ofp_handler
creating context dpset
creating context wsgi
instantiating app ofctl_rest_v1_3.py
instantiating app ryu.controller.ofp_handler
BRICK dpset
  CONSUMES EventOFPPortStatus
  CONSUMES EventOFPSwitchFeatures
  CONSUMES EventOFPStateChange
BRICK ofp_event
  PROVIDES EventOFPPortStatus TO {'dpset': ['main']}
  PROVIDES EventOFPSwitchFeatures TO {'dpset': ['config']}
  PROVIDES EventOFPDescStatsReply TO {'RestStatsApi': ['main']}
  PROVIDES EventOFPPortStatsReply TO {'RestStatsApi': ['main']}
  PROVIDES EventOFPStateChange TO {'dpset': ['main', 'dead']}
  PROVIDES EventOFPFlowStatsReply TO {'RestStatsApi': ['main']}
  CONSUMES EventOFPErrorMsg
  CONSUMES EventOFPHello
  CONSUMES EventOFPEchoRequest
  CONSUMES EventOFPSwitchFeatures
BRICK RestStatsApi
  CONSUMES EventOFPFlowStatsReply
  CONSUMES EventOFPPortStatsReply
  CONSUMES EventOFPDescStatsReply
connected socket:<socket fileno=10 sock=10.48.11.196:6633 peer=
10.48.11.200:39719> address:('10.48.11.200', 39719)
hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x2e08d10>
move onto config mode
EVENT ofp_event->dpset EventOFPSwitchFeatures
switch features ev version: 0x4 msg_type 0x6 xid 0xc8c8ab9a
move onto main mode
EVENT ofp_event->dpset EventOFPStateChange
Traceback (most recent call last):
  File "/usr/local/lib64/python2.7/site-packages/gevent/greenlet.py", line
390, in run
    result = self._run(*self.args, **self.kwargs)
  File
"/usr/local/lib/python2.7/site-packages/ryu-1.8-py2.7.egg/ryu/base/app_manager.py",
line 106, in _event_loop
    handler(ev)
  File
"/usr/local/lib/python2.7/site-packages/ryu-1.8-py2.7.egg/ryu/controller/dpset.py",
line 164, in switch_features_handler
    datapath.ports = msg.ports
AttributeError: 'OFPSwitchFeatures' object has no attribute 'ports'
<Greenlet at 0x2dab2f8: <bound method DPSet._event_loop of
<ryu.controller.dpset.DPSet object at 0x7f99f354ef90>>> failed with
AttributeError


Now, If *I have* a check for OF version 1.3 as done in ofp_handler.py, then
I get this error:

linux-acls:/usr/local/src/ryu # *bin/ryu-manager --verbose
ofctl_rest_v1_3.py *
loading app ofctl_rest_v1_3.py
loading app ryu.controller.ofp_handler
creating context dpset
creating context wsgi
instantiating app ofctl_rest_v1_3.py
instantiating app ryu.controller.ofp_handler
BRICK dpset
  CONSUMES EventOFPPortStatus
  CONSUMES EventOFPStateChange
  CONSUMES EventOFPSwitchFeatures
BRICK ofp_event
  PROVIDES EventOFPPortStatus TO {'dpset': ['main']}
  PROVIDES EventOFPSwitchFeatures TO {'dpset': ['config']}
  PROVIDES EventOFPDescStatsReply TO {'RestStatsApi': ['main']}
  PROVIDES EventOFPFlowStatsReply TO {'RestStatsApi': ['main']}
  PROVIDES EventOFPPortStatsReply TO {'RestStatsApi': ['main']}
  PROVIDES EventOFPStateChange TO {'dpset': ['main', 'dead']}
  CONSUMES EventOFPErrorMsg
  CONSUMES EventOFPHello
  CONSUMES EventOFPEchoRequest
  CONSUMES EventOFPSwitchFeatures
BRICK RestStatsApi
  CONSUMES EventOFPFlowStatsReply
  CONSUMES EventOFPPortStatsReply
  CONSUMES EventOFPDescStatsReply
connected socket:<socket fileno=10 sock=10.48.11.196:6633 peer=
10.48.11.200:51396> address:('10.48.11.200', 51396)
hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x1e28d10>
move onto config mode
EVENT ofp_event->dpset EventOFPSwitchFeatures
switch features ev version: 0x4 msg_type 0x6 xid 0x1e42922e
move onto main mode
EVENT ofp_event->dpset EventOFPStateChange
Traceback (most recent call last):
  File "/usr/local/lib64/python2.7/site-packages/gevent/greenlet.py", line
390, in run
    result = self._run(*self.args, **self.kwargs)
  File
"/usr/local/lib/python2.7/site-packages/ryu-1.8-py2.7.egg/ryu/base/app_manager.py",
line 106, in _event_loop
    handler(ev)
  File
"/usr/local/lib/python2.7/site-packages/ryu-1.8-py2.7.egg/ryu/controller/dpset.py",
line 164, in switch_features_handler
    datapath.ports = msg.ports
AttributeError: 'OFPSwitchFeatures' object has no attribute 'ports'
<Greenlet at 0x1dcb2f8: <bound method DPSet._event_loop of
<ryu.controller.dpset.DPSet object at 0x7fca5acbcf90>>> failed with
AttributeError

 ^CTraceback (most recent call last):
  File "bin/ryu-manager", line 87, in <module>
    main()
  File "bin/ryu-manager", line 81, in main
    gevent.joinall(services)
  File "/usr/local/lib64/python2.7/site-packages/gevent/greenlet.py", line
502, in joinall
    queue.get()
  File "/usr/local/lib64/python2.7/site-packages/gevent/queue.py", line
190, in get
    return waiter.get()
  File "/usr/local/lib64/python2.7/site-packages/gevent/hub.py", line 321,
in get
    return get_hub().switch()
  File "/usr/local/lib64/python2.7/site-packages/gevent/hub.py", line 164,
in switch
    return greenlet.switch(self)



What can I do to fix this issue?  I don't even call ports in my program,
but, I do need dpset module.

Thanks

/Shivaram
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to