[pox-dev] Requesting port statistics (problem with connection)
William Emmanuel S. Yu
wyu at ateneo.edu
Thu Oct 4 14:46:45 PDT 2012
Hi Tim,
Check out the flow_stats.py example I posted in the pox wiki.
Good luck!
"Sent on the move."
-----Original Message-----
From: Murphy McCauley <murphy.mccauley at gmail.com>
Sender: pox-dev-bounces at lists.noxrepo.orgDate: Thu, 4 Oct 2012 10:31:38
To: <Tmusic987 at gmail.com>
Cc: <pox-dev at lists.noxrepo.org>
Subject: Re: [pox-dev] Requesting port statistics (problem with connection)
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