[pox-dev] Requesting port statistics (problem with connection)
Murphy McCauley
murphy.mccauley at gmail.com
Thu Oct 4 10:31:38 PDT 2012
Sure, the problem is that ofp_port_stats_request is not an OpenFlow message. It's meant to be the body of an ofp_stats_request, as per the spec.
The Wiki has some info on using stats requests (though nothing specific to ofp_port_stats_request at the moment):
https://openflow.stanford.edu/display/ONL/POX+Wiki#POXWiki-ofpstatsrequest-Requestingstatisticsfromswitches
(I've just pushed a patch to betta that adds an assertion that the argument to Connection.send() has to be a subclass of ofp_header, which would catch on this error -- you're not the first one to have made it.)
-- Murphy
On Oct 4, 2012, at 8:39 AM, Tmusic wrote:
> Hi,
>
> I'm trying to query the switches for port statistics, but I experience some problems with the connections to the switches.
>
>
> #Ask switches for their port stats periodically (ignore the arg, it was for testing the Timer function)
> def periodic_event(arg):
> print 'timer_event:',arg
> Timer(5, periodic_event, args = ['Requesting stats'])
> topology = core.components['topology']
> for switch in topology.getEntitiesOfType(Switch):
> msg=of.ofp_port_stats_request()
> switch.send(msg)
> print 'request send'
>
> def _handle_port_stats(event):
> print 'port statistics message received'
>
> I get no stats and following output (one switch connected in mininet):
>
> timer_event: Requesting stats
> INFO:openflow.of_01:[Con 1/1] closing connection
> request send
> INFO:openflow.of_01:[Con 2/1] Connected to 00-00-00-00-00-01
> WARNING:openflow.topology:Switch 00-00-00-00-00-01 connected, but... it's already connected!
> INFO:openflow.topology:Switch 00-00-00-00-00-01 connected
> timer_event: Requesting stats
> INFO:openflow.of_01:[Con 2/1] closing connection
> request send
> INFO:openflow.of_01:[Con 3/1] Connected to 00-00-00-00-00-01
> WARNING:openflow.topology:Switch 00-00-00-00-00-01 connected, but... it's already connected!
> INFO:openflow.topology:Switch 00-00-00-00-00-01 connected
>
> Any ideas?
>
> Thank you in advance,
>
> Tim
More information about the pox-dev
mailing list