Re: [nox-dev] Getting individual flow stats for an python app
I believe that the flow stats event is Pythonized in both the zaku and destiny branches -- it's just that a helper method to make the callback easy to register is missing from zaku. A simple register_for_flow_stats_in method DOES exist in the destiny branch, though. So I'd suggest you either switch to the destiny branch, or look at the relevant patch to destiny (21e3bf59aca5d3df8e86bcd09cc9156a66866f7f) which should demonstrate how to register a callback for flow stats events (it's not particularly hard -- basically you call register_handler with Flow_stats_in_event.static_get_name() as the first parameter). Hope that helps. -- Murphy On Feb 21, 2011, at 8:30 AM, Malveeka Tewari wrote: Hi I am writing a python app for the NOX controller and want to obtain flow statistics for individual flows from an openflow switch. I can see that nox supports python callback handlers for handling stats reply for aggregate flows stats, table stats , port stats and desc stats events, but the handler for individual flow stat seems to be missing. Any suggestions on how can I extend the functionality to handle flow stats event in a python nox app. Thanks! Malveeka ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Getting individual flow stats for an python app
Exactly - there's an example of using this in netapps/monitoring.py (line 188) in destiny, (and you can trace how it's handled etc) If all you need is to print out/look at the flow stats (rather than act on them programatically), and you do switch to destiny, you could use the gui for that. On Mon, Feb 21, 2011 at 8:44 AM, Murphy McCauley jam...@nau.edu wrote: I believe that the flow stats event is Pythonized in both the zaku and destiny branches -- it's just that a helper method to make the callback easy to register is missing from zaku. A simple register_for_flow_stats_in method DOES exist in the destiny branch, though. So I'd suggest you either switch to the destiny branch, or look at the relevant patch to destiny (21e3bf59aca5d3df8e86bcd09cc9156a66866f7f) which should demonstrate how to register a callback for flow stats events (it's not particularly hard -- basically you call register_handler with Flow_stats_in_event.static_get_name() as the first parameter). Hope that helps. -- Murphy On Feb 21, 2011, at 8:30 AM, Malveeka Tewari wrote: Hi I am writing a python app for the NOX controller and want to obtain flow statistics for individual flows from an openflow switch. I can see that nox supports python callback handlers for handling stats reply for aggregate flows stats, table stats , port stats and desc stats events, but the handler for individual flow stat seems to be missing. Any suggestions on how can I extend the functionality to handle flow stats event in a python nox app. Thanks! Malveeka ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Getting individual flow stats for an python app
Thanks! I have another question. Using the nox controller , I have inserted forwarding rules such that packets that match a particular (src_mac, dst_mac) pair be sent out on a particular port. Since this is a wildcard entry, it also matches packets that belong to the null vlan as long as the ( src_mac, dst_mac) pair matches. However, when I request for aggregate flow stats from the nox controller, it does not show any flows 00117|openflow-event|DBG:received stats reply from 00ffca7e3ad4 Aggregate stats in from datapath 00:ff:ca:7e:3a:d4 {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L} This is how I am requesting for aggregate flow stats def aggregate_timer(self, dpid): flow = ofp_match() flow.wildcards = 0x self.ctxt.send_aggregate_stats_request(dpid, flow, 0xff) self.post_callback(MONITOR_TABLE_PERIOD, lambda : self.aggregate_timer(dpid)) But running ovs-ofctl on the switch does show that there are flows in the forwarding table. Jan 02 11:25:34|1|ofctl|INFO|connecting to unix://var/run/openvswitch/ful0.mgmt stats_reply (xid=0xe9c1a): flags=none type=2(aggregate) packet_count=414 byte_count=42228 flow_count=2 I am not sure why sending a request from the nox controller does not give the correct response. I don't know if that's a bug with the switch's implementation or nox or I am doing something wrong while requesting for stats. The following thread leads me to believe that I am missing something but I am not sure what. https://mailman.stanford.edu/pipermail/openflow-spec/2010-February/000890.html Any thoughts ? Thanks! Malveeka - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: Murphy McCauley jam...@nau.edu Cc: Malveeka Tewari malve...@cs.ucsd.edu, nox-dev@noxrepo.org Sent: Monday, February 21, 2011 1:10:42 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app Exactly - there's an example of using this in netapps/monitoring.py (line 188) in destiny, (and you can trace how it's handled etc) If all you need is to print out/look at the flow stats (rather than act on them programatically), and you do switch to destiny, you could use the gui for that. On Mon, Feb 21, 2011 at 8:44 AM, Murphy McCauley jam...@nau.edu wrote: I believe that the flow stats event is Pythonized in both the zaku and destiny branches -- it's just that a helper method to make the callback easy to register is missing from zaku. A simple register_for_flow_stats_in method DOES exist in the destiny branch, though. So I'd suggest you either switch to the destiny branch, or look at the relevant patch to destiny (21e3bf59aca5d3df8e86bcd09cc9156a66866f7f) which should demonstrate how to register a callback for flow stats events (it's not particularly hard -- basically you call register_handler with Flow_stats_in_event.static_get_name() as the first parameter). Hope that helps. -- Murphy On Feb 21, 2011, at 8:30 AM, Malveeka Tewari wrote: Hi I am writing a python app for the NOX controller and want to obtain flow statistics for individual flows from an openflow switch. I can see that nox supports python callback handlers for handling stats reply for aggregate flows stats, table stats , port stats and desc stats events, but the handler for individual flow stat seems to be missing. Any suggestions on how can I extend the functionality to handle flow stats event in a python nox app. Thanks! Malveeka ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Getting individual flow stats for an python app
In light of the previous discussion, I also tried tagging the packets with a particular vlan id using the OFPAT.SET_VLAN_VID but I do not see any flow entries being instantiated in the switch. On some more digging, I found that no corresponding method for vlan tagging in nox/nox/src/lib/openflow-action.cc http://noxrepo.org/pipermail/nox-dev_noxrepo.org/2011-February/002045.html Is that the reason why I am not able to add an action for setting the vlan id? Any help will be appreciated. Thanks! Malveeka - Original Message - From: malve...@cs.ucsd.edu To: Kyriakos Zarifis kyr.zari...@gmail.com Cc: nox-dev@noxrepo.org Sent: Monday, February 21, 2011 1:37:39 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app Thanks! I have another question. Using the nox controller , I have inserted forwarding rules such that packets that match a particular (src_mac, dst_mac) pair be sent out on a particular port. Since this is a wildcard entry, it also matches packets that belong to the null vlan as long as the (src_mac, dst_mac) pair matches. However, when I request for aggregate flow stats from the nox controller, it does not show any flows 00117|openflow-event|DBG:received stats reply from 00ffca7e3ad4 Aggregate stats in from datapath 00:ff:ca:7e:3a:d4 {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L} This is how I am requesting for aggregate flow stats def aggregate_timer(self, dpid): flow = ofp_match() flow.wildcards = 0x self.ctxt.send_aggregate_stats_request(dpid, flow, 0xff) self.post_callback(MONITOR_TABLE_PERIOD, lambda : self.aggregate_timer(dpid)) But running ovs-ofctl on the switch does show that there are flows in the forwarding table. Jan 02 11:25:34|1|ofctl|INFO|connecting to unix://var/run/openvswitch/ful0.mgmt stats_reply (xid=0xe9c1a): flags=none type=2(aggregate) packet_count=414 byte_count=42228 flow_count=2 I am not sure why sending a request from the nox controller does not give the correct response. I don't know if that's a bug with the switch's implementation or nox or I am doing something wrong while requesting for stats. The following thread leads me to believe that I am missing something but I am not sure what. https://mailman.stanford.edu/pipermail/openflow-spec/2010-February/000890.html Any thoughts ? Thanks! Malveeka - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: Murphy McCauley jam...@nau.edu Cc: Malveeka Tewari malve...@cs.ucsd.edu, nox-dev@noxrepo.org Sent: Monday, February 21, 2011 1:10:42 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app Exactly - there's an example of using this in netapps/monitoring.py (line 188) in destiny, (and you can trace how it's handled etc) If all you need is to print out/look at the flow stats (rather than act on them programatically), and you do switch to destiny, you could use the gui for that. On Mon, Feb 21, 2011 at 8:44 AM, Murphy McCauley jam...@nau.edu wrote: I believe that the flow stats event is Pythonized in both the zaku and destiny branches -- it's just that a helper method to make the callback easy to register is missing from zaku. A simple register_for_flow_stats_in method DOES exist in the destiny branch, though. So I'd suggest you either switch to the destiny branch, or look at the relevant patch to destiny (21e3bf59aca5d3df8e86bcd09cc9156a66866f7f) which should demonstrate how to register a callback for flow stats events (it's not particularly hard -- basically you call register_handler with Flow_stats_in_event.static_get_name() as the first parameter). Hope that helps. -- Murphy On Feb 21, 2011, at 8:30 AM, Malveeka Tewari wrote: Hi I am writing a python app for the NOX controller and want to obtain flow statistics for individual flows from an openflow switch. I can see that nox supports python callback handlers for handling stats reply for aggregate flows stats, table stats , port stats and desc stats events, but the handler for individual flow stat seems to be missing. Any suggestions on how can I extend the functionality to handle flow stats event in a python nox app. Thanks! Malveeka ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Getting individual flow stats for an python app
Even with flow.wildcard = openflow.OFPFW_ALL the counters seem to be zero .. :( - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: malve...@cs.ucsd.edu Cc: nox-dev@noxrepo.org, Murphy McCauley jam...@nau.edu Sent: Monday, February 21, 2011 2:47:10 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app can you try using flow.wildcards = openflow.OFPFW_ALL after making sure that nox.lib.openflow has been imported? On Mon, Feb 21, 2011 at 1:37 PM, malve...@cs.ucsd.edu wrote: Thanks! I have another question. Using the nox controller , I have inserted forwarding rules such that packets that match a particular (src_mac, dst_mac) pair be sent out on a particular port. Since this is a wildcard entry, it also matches packets that belong to the null vlan as long as the (src_mac, dst_mac) pair matches. However, when I request for aggregate flow stats from the nox controller, it does not show any flows 00117|openflow-event|DBG:received stats reply from 00ffca7e3ad4 Aggregate stats in from datapath 00.:ff:ca:7e:3a:d4 {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L} This is how I am requesting for aggregate flow stats def aggregate_timer(self, dpid): flow = ofp_match() flow.wildcards = 0x self.ctxt.send_aggregate_stats_request(dpid, flow, 0xff) self.post_callback(MONITOR_TABLE_PERIOD, lambda : self.aggregate_timer(dpid)) But running ovs-ofctl on the switch does show that there are flows in the forwarding table. Jan 02 11:25:34|1|ofctl|INFO|connecting to unix://var/run/openvswitch/ful0.mgmt stats_reply (xid=0xe9c1a): flags=none type=2(aggregate) packet_count=414 byte_count=42228 flow_count=2 I am not sure why sending a request from the nox controller does not give the correct response. I don't know if that's a bug with the switch's implementation or nox or I am doing something wrong while requesting for stats. The following thread leads me to believe that I am missing something but I am not sure what. https://mailman.stanford.edu/pipermail/openflow-spec/2010-February/000890.html Any thoughts ? Thanks! Malveeka - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: Murphy McCauley jam...@nau.edu Cc: Malveeka Tewari malve...@cs.ucsd.edu , nox-dev@noxrepo.org Sent: Monday, February 21, 2011 1:10:42 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app Exactly - there's an example of using this in netapps/monitoring.py (line 188) in destiny, (and you can trace how it's handled etc) If all you need is to print out/look at the flow stats (rather than act on them programatically), and you do switch to destiny, you could use the gui for that. On Mon, Feb 21, 2011 at 8:44 AM, Murphy McCauley jam...@nau.edu wrote: I believe that the flow stats event is Pythonized in both the zaku and destiny branches -- it's just that a helper method to make the callback easy to register is missing from zaku. A simple register_for_flow_stats_in method DOES exist in the destiny branch, though. So I'd suggest you either switch to the destiny branch, or look at the relevant patch to destiny (21e3bf59aca5d3df8e86bcd09cc9156a66866f7f) which should demonstrate how to register a callback for flow stats events (it's not particularly hard -- basically you call register_handler with Flow_stats_in_event.static_get_name() as the first parameter). Hope that helps. -- Murphy On Feb 21, 2011, at 8:30 AM, Malveeka Tewari wrote: Hi I am writing a python app for the NOX controller and want to obtain flow statistics for individual flows from an openflow switch. I can see that nox supports python callback handlers for handling stats reply for aggregate flows stats, table stats , port stats and desc stats events, but the handler for individual flow stat seems to be missing. Any suggestions on how can I extend the functionality to handle flow stats event in a python nox app. Thanks! Malveeka ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Getting individual flow stats for an python app
can you try using flow.wildcards = openflow.OFPFW_ALL after making sure that nox.lib.openflow has been imported? On Mon, Feb 21, 2011 at 1:37 PM, malve...@cs.ucsd.edu wrote: Thanks! I have another question. Using the nox controller , I have inserted forwarding rules such that packets that match a particular (src_mac, dst_mac) pair be sent out on a particular port. Since this is a wildcard entry, it also matches packets that belong to the null vlan as long as the (src_mac, dst_mac) pair matches. However, when I request for aggregate flow stats from the nox controller, it does not show any flows 00117|openflow-event|DBG:received stats reply from 00ffca7e3ad4 Aggregate stats in from datapath 00.:ff:ca:7e:3a:d4 {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L} This is how I am requesting for aggregate flow stats def aggregate_timer(self, dpid): flow = ofp_match() flow.wildcards = 0x self.ctxt.send_aggregate_stats_request(dpid, flow, 0xff) self.post_callback(MONITOR_TABLE_PERIOD, lambda : self.aggregate_timer(dpid)) But running ovs-ofctl on the switch does show that there are flows in the forwarding table. Jan 02 11:25:34|1|ofctl|INFO|connecting to unix://var/run/openvswitch/ful0.mgmt stats_reply (xid=0xe9c1a): flags=none type=2(aggregate) packet_count=414 byte_count=42228 flow_count=2 I am not sure why sending a request from the nox controller does not give the correct response. I don't know if that's a bug with the switch's implementation or nox or I am doing something wrong while requesting for stats. The following thread leads me to believe that I am missing something but I am not sure what. https://mailman.stanford.edu/pipermail/openflow-spec/2010-February/000890.html Any thoughts ? Thanks! Malveeka - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: Murphy McCauley jam...@nau.edu Cc: Malveeka Tewari malve...@cs.ucsd.edu, nox-dev@noxrepo.org Sent: Monday, February 21, 2011 1:10:42 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app Exactly - there's an example of using this in netapps/monitoring.py (line 188) in destiny, (and you can trace how it's handled etc) If all you need is to print out/look at the flow stats (rather than act on them programatically), and you do switch to destiny, you could use the gui for that. On Mon, Feb 21, 2011 at 8:44 AM, Murphy McCauley jam...@nau.edu wrote: I believe that the flow stats event is Pythonized in both the zaku and destiny branches -- it's just that a helper method to make the callback easy to register is missing from zaku. A simple register_for_flow_stats_in method DOES exist in the destiny branch, though. So I'd suggest you either switch to the destiny branch, or look at the relevant patch to destiny (21e3bf59aca5d3df8e86bcd09cc9156a66866f7f) which should demonstrate how to register a callback for flow stats events (it's not particularly hard -- basically you call register_handler with Flow_stats_in_event.static_get_name() as the first parameter). Hope that helps. -- Murphy On Feb 21, 2011, at 8:30 AM, Malveeka Tewari wrote: Hi I am writing a python app for the NOX controller and want to obtain flow statistics for individual flows from an openflow switch. I can see that nox supports python callback handlers for handling stats reply for aggregate flows stats, table stats , port stats and desc stats events, but the handler for individual flow stat seems to be missing. Any suggestions on how can I extend the functionality to handle flow stats event in a python nox app. Thanks! Malveeka ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Getting individual flow stats for an python app
So the thing is that flow.wildcard definitely needs to be at least 0x3f (and not 0x, which I am guessing you got from the monitor.py example, which is actually obsolete and should be updated, as the wildcard field has been changed to 32 bits (actual max length is 22). So OFPFW_ALL (which should be equal to 0x3f, or 4194303) should cover it. As a fast check, could you try manually setting flow.wildcard = 0x just to make sure that it's a wildcard issue? On Mon, Feb 21, 2011 at 2:58 PM, malve...@cs.ucsd.edu wrote: Even with flow.wildcard = openflow.OFPFW_ALL the counters seem to be zero .. :( - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: malve...@cs.ucsd.edu Cc: nox-dev@noxrepo.org, Murphy McCauley jam...@nau.edu Sent: Monday, February 21, 2011 2:47:10 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app can you try using flow.wildcards = openflow.OFPFW_ALL after making sure that nox.lib.openflow has been imported? On Mon, Feb 21, 2011 at 1:37 PM, malve...@cs.ucsd.edu wrote: Thanks! I have another question. Using the nox controller , I have inserted forwarding rules such that packets that match a particular (src_mac, dst_mac) pair be sent out on a particular port. Since this is a wildcard entry, it also matches packets that belong to the null vlan as long as the (src_mac, dst_mac) pair matches. However, when I request for aggregate flow stats from the nox controller, it does not show any flows 00117|openflow-event|DBG:received stats reply from 00ffca7e3ad4 Aggregate stats in from datapath 00.:ff:ca:7e:3a:d4 {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L} This is how I am requesting for aggregate flow stats def aggregate_timer(self, dpid): flow = ofp_match() flow.wildcards = 0x self.ctxt.send_aggregate_stats_request(dpid, flow, 0xff) self.post_callback(MONITOR_TABLE_PERIOD, lambda : self.aggregate_timer(dpid)) But running ovs-ofctl on the switch does show that there are flows in the forwarding table. Jan 02 11:25:34|1|ofctl|INFO|connecting to unix://var/run/openvswitch/ful0.mgmt stats_reply (xid=0xe9c1a): flags=none type=2(aggregate) packet_count=414 byte_count=42228 flow_count=2 I am not sure why sending a request from the nox controller does not give the correct response. I don't know if that's a bug with the switch's implementation or nox or I am doing something wrong while requesting for stats. The following thread leads me to believe that I am missing something but I am not sure what. https://mailman.stanford.edu/pipermail/openflow-spec/2010-February/000890.html Any thoughts ? Thanks! Malveeka - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: Murphy McCauley jam...@nau.edu Cc: Malveeka Tewari malve...@cs.ucsd.edu, nox-dev@noxrepo.org Sent: Monday, February 21, 2011 1:10:42 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app Exactly - there's an example of using this in netapps/monitoring.py (line 188) in destiny, (and you can trace how it's handled etc) If all you need is to print out/look at the flow stats (rather than act on them programatically), and you do switch to destiny, you could use the gui for that. On Mon, Feb 21, 2011 at 8:44 AM, Murphy McCauley jam...@nau.edu wrote: I believe that the flow stats event is Pythonized in both the zaku and destiny branches -- it's just that a helper method to make the callback easy to register is missing from zaku. A simple register_for_flow_stats_in method DOES exist in the destiny branch, though. So I'd suggest you either switch to the destiny branch, or look at the relevant patch to destiny (21e3bf59aca5d3df8e86bcd09cc9156a66866f7f) which should demonstrate how to register a callback for flow stats events (it's not particularly hard -- basically you call register_handler with Flow_stats_in_event.static_get_name() as the first parameter). Hope that helps. -- Murphy On Feb 21, 2011, at 8:30 AM, Malveeka Tewari wrote: Hi I am writing a python app for the NOX controller and want to obtain flow statistics for individual flows from an openflow switch. I can see that nox supports python callback handlers for handling stats reply for aggregate flows stats, table stats , port stats and desc stats events, but the handler for individual flow stat seems to be missing. Any suggestions on how can I extend the functionality to handle flow stats event in a python nox app. Thanks! Malveeka ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
Re: [nox-dev] Getting individual flow stats for an python app
Glad it works. Interesting, looking at it now it still looks like OFPFW_ALL==0x3f should be working too. Something to look into, thanks for bringing it up. On Mon, Feb 21, 2011 at 5:35 PM, Malveeka Tewari malve...@cs.ucsd.eduwrote: Setting flow.wildcards = 0x solved the problem :-) Thanks! - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: malve...@cs.ucsd.edu Cc: nox-dev@noxrepo.org, Murphy McCauley jam...@nau.edu Sent: Monday, February 21, 2011 5:01:52 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app So the thing is that flow.wildcard definitely needs to be at least 0x3f (and not 0x, which I am guessing you got from the monitor.py example, which is actually obsolete and should be updated, as the wildcard field has been changed to 32 bits (actual max length is 22). So OFPFW_ALL (which should be equal to 0x3f, or 4194303) should cover it. As a fast check, could you try manually setting flow.wildcard = 0x just to make sure that it's a wildcard issue? On Mon, Feb 21, 2011 at 2:58 PM, malve...@cs.ucsd.edu wrote: Even with flow.wildcard = openflow.OFPFW_ALL the counters seem to be zero .. :( - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: malve...@cs.ucsd.edu Cc: nox-dev@noxrepo.org, Murphy McCauley jam...@nau.edu Sent: Monday, February 21, 2011 2:47:10 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app can you try using flow.wildcards = openflow.OFPFW_ALL after making sure that nox.lib.openflow has been imported? On Mon, Feb 21, 2011 at 1:37 PM, malve...@cs.ucsd.edu wrote: Thanks! I have another question. Using the nox controller , I have inserted forwarding rules such that packets that match a particular (src_mac, dst_mac) pair be sent out on a particular port. Since this is a wildcard entry, it also matches packets that belong to the null vlan as long as the (src_mac, dst_mac) pair matches. However, when I request for aggregate flow stats from the nox controller, it does not show any flows 00117|openflow-event|DBG:received stats reply from 00ffca7e3ad4 Aggregate stats in from datapath 00.:ff:ca:7e:3a:d4 {'packet_count': 0L, 'byte_count': 0L, 'flow_count': 0L} This is how I am requesting for aggregate flow stats def aggregate_timer(self, dpid): flow = ofp_match() flow.wildcards = 0x self.ctxt.send_aggregate_stats_request(dpid, flow, 0xff) self.post_callback(MONITOR_TABLE_PERIOD, lambda : self.aggregate_timer(dpid)) But running ovs-ofctl on the switch does show that there are flows in the forwarding table. Jan 02 11:25:34|1|ofctl|INFO|connecting to unix://var/run/openvswitch/ful0.mgmt stats_reply (xid=0xe9c1a): flags=none type=2(aggregate) packet_count=414 byte_count=42228 flow_count=2 I am not sure why sending a request from the nox controller does not give the correct response. I don't know if that's a bug with the switch's implementation or nox or I am doing something wrong while requesting for stats. The following thread leads me to believe that I am missing something but I am not sure what. https://mailman.stanford.edu/pipermail/openflow-spec/2010-February/000890.html Any thoughts ? Thanks! Malveeka - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: Murphy McCauley jam...@nau.edu Cc: Malveeka Tewari malve...@cs.ucsd.edu, nox-dev@noxrepo.org Sent: Monday, February 21, 2011 1:10:42 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Getting individual flow stats for an python app Exactly - there's an example of using this in netapps/monitoring.py (line 188) in destiny, (and you can trace how it's handled etc) If all you need is to print out/look at the flow stats (rather than act on them programatically), and you do switch to destiny, you could use the gui for that. On Mon, Feb 21, 2011 at 8:44 AM, Murphy McCauley jam...@nau.edu wrote: I believe that the flow stats event is Pythonized in both the zaku and destiny branches -- it's just that a helper method to make the callback easy to register is missing from zaku. A simple register_for_flow_stats_in method DOES exist in the destiny branch, though. So I'd suggest you either switch to the destiny branch, or look at the relevant patch to destiny (21e3bf59aca5d3df8e86bcd09cc9156a66866f7f) which should demonstrate how to register a callback for flow stats events (it's not particularly hard -- basically you call register_handler with Flow_stats_in_event.static_get_name() as the first parameter). Hope that helps. -- Murphy On Feb 21, 2011, at 8:30 AM, Malveeka Tewari wrote: Hi I am writing a python app for the NOX controller and want to obtain flow statistics for individual flows from an openflow switch. I can see that nox supports python callback handlers