[pox-dev] Requesting port statistics (problem with connection)
Tmusic
Tmusic987 at gmail.com
Fri Oct 5 12:38:52 PDT 2012
Hi,
Thank you Murphy and William!!
Flow stats are working now!
Port stats seem to be trickier...
I found this thread on the list: "How can POX get packet counts (or beta
transferred) from a switch within a timeline."
With the command Murphy suggested
[of.ofp_stats_request(body=of.ofp_port_stats_request(port_no =
of.OFPP_NONE))] to work around the problem with port_no, I get following
error:
Task <Timer/tid41> caused exception and was de-scheduled
File
"/home/openflow/pox_workspace/OFcontroller/pox/lib/recoco/recoco.py", line
276, in cycle
rv = t.execute()
File
"/home/openflow/pox_workspace/OFcontroller/pox/lib/recoco/recoco.py", line
94, in execute
return self.gen.send(v)
File
"/home/openflow/pox_workspace/OFcontroller/pox/lib/recoco/recoco.py", line
751, in run
rv = self._callback(*self._args,**self._kw)
File
"/home/openflow/pox_workspace/OFcontroller/pox/thesis/l2_pairs_stats.py",
line 111, in periodic_event
switch.send(msg2)
File
"/home/openflow/pox_workspace/OFcontroller/pox/openflow/topology.py", line
301, in send
return self._connection.send(*args, **kw)
File "/home/openflow/pox_workspace/OFcontroller/pox/openflow/of_01.py",
line 572, in send
data = data.pack()
File
"/home/openflow/pox_workspace/OFcontroller/pox/openflow/libopenflow_01.py",
line 2136, in pack
packed += struct.pack("!HH", self.type, self.flags)
error: cannot convert argument to integer
Changing port_no directly in the ofp_port_stats_request gives the same
result.
I have to add that I'm still using the stable branch.
Betta (0ca0a8b5b5726195aa2c69337af98a146308dab9) always gives following
error (no matter which components are loaded):
Traceback (most recent call last):
File "/home/openflow/temp_repo/poxrefbetta/pox.py", line 44, in <module>
from pox.boot import boot
File "/home/openflow/temp_repo/poxrefbetta/pox/boot.py", line 55, in
<module>
import pox.openflow
File "/home/openflow/temp_repo/poxrefbetta/pox/openflow/__init__.py",
line 41, in <module>
import libopenflow_01 as of
File
"/home/openflow/temp_repo/poxrefbetta/pox/openflow/libopenflow_01.py", line
56, in <module>
generate_xid = xid_generator()
File
"/home/openflow/temp_repo/poxrefbetta/pox/openflow/libopenflow_01.py", line
51, in xid_generator
return chain.from_iterable(repeat(xrange(start,stop+1))).next
OverflowError: Python int too large to convert to C long
Do you know what's wrong?
Thanks!
Tim
2012/10/4 William Emmanuel S. Yu <wyu at ateneo.edu>
> 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
>
>
2012/10/4 William Emmanuel S. Yu <wyu at ateneo.edu>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noxrepo.org/pipermail/pox-dev-noxrepo.org/attachments/20121005/34274de2/attachment-0001.htm>
More information about the pox-dev
mailing list