Hi, I am trying to use Ryu REST applications (ofctl_rest and rest_topology) in my exam project. I am not using mininet but an alternative called Kathara that was developed at my university and it is based on docker.
Whenever I use rest_topolgy /v1.0/topology/links and /v1.0/topology/hosts endpoints I get back an empty array as answer. Any other request does work (/stats/switches, /stats/desc/<dpid>, /v1.0/topology/switches, ...). So, I suppose the problem is thath the controller does not manage to get links between switches. I edited ryu/topology/event.py to print switches and links when EventSwitchBase and EventLinkBase are called and then I run this command: *ryu-manager --observe-links --install-lldp-flow <path-to-ryu>/app/rest_topology.py <path-to-ryu>/app/ofctl_rest.py* The lines I added to print switches and links produced these lines only: *Switch<dpid=196548594862159, Port<dpid=196548594862159, port_no=1, DOWN> Port<dpid=196548594862159, port_no=2, DOWN> Port<dpid=196548594862159, port_no=3, DOWN> >Switch<dpid=217841702508866, Port<dpid=217841702508866, port_no=1, DOWN> Port<dpid=217841702508866, port_no=2, DOWN> >Switch<dpid=56026200183617, Port<dpid=56026200183617, port_no=1, DOWN> Port<dpid=56026200183617, port_no=2, DOWN> Port<dpid=56026200183617, port_no=3, DOWN> >* This information is right but links have not ben printed, so I run the same command with the original event.py file and the *--verbose *option and I got this: *Registered VCS backend: gitRegistered VCS backend: hgRegistered VCS backend: svnRegistered VCS backend: bzrloading app /usr/local/lib/python2.7/dist-packages/ryu/app/rest_topology.pyrequire_app: ryu.topology.switches is required by rest_topologyloading app /usr/local/lib/python2.7/dist-packages/ryu/app/ofctl_rest.pyloading app ryu.topology.switchesloading app ryu.controller.ofp_handlerinstantiating app None of DPSetcreating context dpsetcreating context wsgiinstantiating app /usr/local/lib/python2.7/dist-packages/ryu/app/ofctl_rest.py of RestStatsApiinstantiating app ryu.topology.switches of Switchesinstantiating app ryu.controller.ofp_handler of OFPHandlerinstantiating app /usr/local/lib/python2.7/dist-packages/ryu/app/rest_topology.py of TopologyAPIBRICK switches CONSUMES EventOFPPacketIn CONSUMES EventOFPStateChange CONSUMES EventHostRequest CONSUMES EventOFPPortStatus CONSUMES EventLinkRequest CONSUMES EventSwitchRequestBRICK dpset CONSUMES EventOFPSwitchFeatures CONSUMES EventOFPPortStatus CONSUMES EventOFPStateChangeBRICK ofp_event PROVIDES EventOFPPacketIn TO {'switches': set(['main'])} PROVIDES EventOFPGroupFeaturesStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPTableStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPPortDescStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPQueueGetConfigReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPDescStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPMeterStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPQueueDescStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPAggregateStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPPortStatus TO {'switches': set(['main']), 'dpset': set(['main'])} PROVIDES EventOFPPortStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPMeterFeaturesStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPStateChange TO {'switches': set(['main', 'dead']), 'dpset': set(['main', 'dead'])} PROVIDES EventOFPTableFeaturesStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPGroupStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPMeterConfigStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPGroupDescStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPSwitchFeatures TO {'dpset': set(['config']), 'RestStatsApi': set(['main'])} PROVIDES EventOFPFlowStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPQueueStatsReply TO {'RestStatsApi': set(['main'])} PROVIDES EventOFPRoleReply TO {'RestStatsApi': set(['main'])} CONSUMES EventOFPEchoReply CONSUMES EventOFPEchoRequest CONSUMES EventOFPHello CONSUMES EventOFPPortStatus CONSUMES EventOFPPortDescStatsReply CONSUMES EventOFPSwitchFeatures CONSUMES EventOFPErrorMsgBRICK TopologyAPIBRICK RestStatsApi CONSUMES EventOFPGroupFeaturesStatsReply CONSUMES EventOFPDescStatsReply CONSUMES EventOFPMeterFeaturesStatsReply CONSUMES EventOFPMeterStatsReply CONSUMES EventOFPQueueStatsReply CONSUMES EventOFPPortStatsReply CONSUMES EventOFPTableFeaturesStatsReply CONSUMES EventOFPGroupStatsReply CONSUMES EventOFPMeterConfigStatsReply CONSUMES EventOFPGroupDescStatsReply CONSUMES EventOFPQueueGetConfigReply CONSUMES EventOFPAggregateStatsReply CONSUMES EventOFPTableStatsReply CONSUMES EventOFPFlowStatsReply CONSUMES EventOFPPortDescStatsReply CONSUMES EventOFPSwitchFeatures CONSUMES EventOFPRoleReply CONSUMES EventOFPStatsReply CONSUMES EventOFPQueueDescStatsReply(103) wsgi starting up on http://0.0.0.0:8080 <http://0.0.0.0:8080>connected socket:<eventlet.greenio.base.GreenSocket object at 0x7f43ad9130d0> address:('192.168.100.2', 56980)hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7f43ad913690>move onto config modeconnected socket:<eventlet.greenio.base.GreenSocket object at 0x7f43ad913190> address:('192.168.100.3', 42142)hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7f43ad913e10>move onto config modeconnected socket:<eventlet.greenio.base.GreenSocket object at 0x7f43ad9138d0> address:('192.168.100.4', 49822)hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x7f43ad923450>move onto config modeEVENT ofp_event->dpset EventOFPSwitchFeaturesswitch features ev version=0x4,msg_type=0x6,msg_len=0x20,xid=0x730e260d,OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=196548594862159,n_buffers=256,n_tables=254)EVENT ofp_event->dpset EventOFPSwitchFeaturesswitch features ev version=0x4,msg_type=0x6,msg_len=0x20,xid=0x425acc6d,OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=217841702508866,n_buffers=256,n_tables=254)EVENT ofp_event->dpset EventOFPSwitchFeaturesswitch features ev version=0x4,msg_type=0x6,msg_len=0x20,xid=0x47560b86,OFPSwitchFeatures(auxiliary_id=0,capabilities=79,datapath_id=56026200183617,n_buffers=256,n_tables=254)move onto main modeEVENT ofp_event->switches EventOFPStateChangeEVENT ofp_event->dpset EventOFPStateChangeDPSET: register datapath <ryu.controller.controller.Datapath object at 0x7f43ad978cd0><ryu.controller.controller.Datapath object at 0x7f43ad978cd0>register Switch<dpid=196548594862159, Port<dpid=196548594862159, port_no=1, DOWN> Port<dpid=196548594862159, port_no=2, DOWN> Port<dpid=196548594862159, port_no=3, DOWN> >move onto main modeEVENT ofp_event->switches EventOFPStateChangeEVENT ofp_event->dpset EventOFPStateChangemove onto main modeEVENT ofp_event->switches EventOFPStateChangeEVENT ofp_event->dpset EventOFPStateChange<ryu.controller.controller.Datapath object at 0x7f43ad913850>register Switch<dpid=217841702508866, Port<dpid=217841702508866, port_no=1, DOWN> Port<dpid=217841702508866, port_no=2, DOWN> ><ryu.controller.controller.Datapath object at 0x7f43ad913590>register Switch<dpid=56026200183617, Port<dpid=56026200183617, port_no=1, DOWN> Port<dpid=56026200183617, port_no=2, DOWN> Port<dpid=56026200183617, port_no=3, DOWN> >DPSET: register datapath <ryu.controller.controller.Datapath object at 0x7f43ad913850>DPSET: register datapath <ryu.controller.controller.Datapath object at 0x7f43ad913590>(103) accepted ('192.168.100.254', 58408)EVENT TopologyAPI->switches EventSwitchRequest192.168.100.254 - - [24/Sep/2018 07:52:04] "GET /v1.0/topology/switches HTTP/1.1" 200 1059 0.034508Keyboard Interrupt received. Closing RYU application manager...* Here is an example of how I configured the OVS switches: *service openvswitch-switch startovs-vsctl add-br br0ovs-vsctl add-port br0 eth1ovs-vsctl add-port br0 eth2ovs-vsctl add-port br0 eth3ifconfig eth1 downifconfig eth2 downifconfig eth3 downovs-vsctl set bridge br0 protocols=[OpenFlow13]ovs-vsctl set-controller br0 tcp:192.168.100.1:6633 <http://192.168.100.1:6633>* *Thanks for support*
_______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel