Re: [nox-dev] Problem in getting flows statistics
Hi Ricardo I've used the nox flow fetcher component and it worked fine for me. One thing to look at is how you're specifying the ofp_match object while requesting for flows. The ofp_flow_stats_request will return counters for flow table entries that match the specified ofp_match object ? If there no matching entries in the forwarding table Flow_statsflows vector will be empty. Hope this helped Best! Malveeka - Original Message - From: Ricardo Bennesby ricardo.benne...@gmail.com To: nox-dev@noxrepo.org Sent: Tuesday, March 8, 2011 1:01:44 PM GMT -08:00 US/Canada Pacific Subject: [nox-dev] Problem in getting flows statistics Hi, I am trying to get flows statistics in my C++ component using flow fetcher, but all fields of flows seems not instanciated. For example, I need to know flow size, number of packets, number of bytes and other information. I created a ofp_flow_stats_request request in my component, set it as: request.table_id = 0xff; request.out_port = OFPP_NONE; , in datapath_join_event and passed it to flow_fetcher as a parameter of start_fetch. But when the handler of Flow_stats_in_event is called, the size of the vectorFlow_stats flows still zero as all of it other fields. Is the error in my request? Am I missing something? Sorry if I didn't made myself clear. Thank you for help. Regards. -- Happy Women's Day Ricardo Bennesby da Silva Ciência da Computação - UFAM LabCIA - Laboratório de Computação Inteligente e Autonômica ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] Problem in getting flows statistics
Yes I am using the C++ flow fetcher component. When you send a flow stats request you also specify a ofp_match field as well, Openflow internally matches the flow entries in the switch's flow table and returns counters for matching flows. Try the following ofp_flow_stats_request fsr; fsr.table_id = 0xff; fsr.match.wildcards = htonl(0x); //this would match all the flows in the forwarding table fsr.out_port = OFPP_NONE; Here I have wildcarded all matching fields, which means it will match all the flows in the switch's forwarding table. This works for me .. If this doesn't work for you then the next question then is -- are there any forwarding entries installed in the switch? Good luck, Malveeka - Original Message - From: Ricardo Bennesby ricardo.benne...@gmail.com To: malve...@cs.ucsd.edu Sent: Tuesday, March 8, 2011 1:51:47 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Problem in getting flows statistics Did you used it with C++ too? 2011/3/8 malve...@cs.ucsd.edu Hi Ricardo I've used the nox flow fetcher component and it worked fine for me. One thing to look at is how you're specifying the ofp_match object while requesting for flows. The ofp_flow_stats_request will return counters for flow table entries that match the specified ofp_match object ? If there no matching entries in the forwarding table Flow_statsflows vector will be empty. Hope this helped Best! Malveeka - Original Message - From: Ricardo Bennesby ricardo.benne...@gmail.com To: nox-dev@noxrepo.org Sent: Tuesday, March 8, 2011 1:01:44 PM GMT -08:00 US/Canada Pacific Subject: [nox-dev] Problem in getting flows statistics Hi, I am trying to get flows statistics in my C++ component using flow fetcher, but all fields of flows seems not instanciated. For example, I need to know flow size, number of packets, number of bytes and other information. I created a ofp_flow_stats_request request in my component, set it as: request.table_id = 0xff; request.out_port = OFPP_NONE; , in datapath_join_event and passed it to flow_fetcher as a parameter of start_fetch. But when the handler of Flow_stats_in_event is called, the size of the vectorFlow_stats flows still zero as all of it other fields. Is the error in my request? Am I missing something? Sorry if I didn't made myself clear. Thank you for help. Regards. -- Happy Women's Day Ricardo Bennesby da Silva Ciência da Computação - UFAM LabCIA - Laboratório de Computação Inteligente e Autonômica ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev -- Ricardo Bennesby da Silva Ciência da Computação - UFAM LabCIA - Laboratório de Computação Inteligente e Autonômica ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
[nox-dev] Getting individual flow stats for an python app
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
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] Matching wildcard flows with different priorities
I am not building the match by hand. I am specifying the flow as a dictionary and calling the install_datapath_flow method: inst.install_datapath_flow(dpid, flow, CACHE_TIMEOUT, openflow.OFP_FLOW_PERMANENT, actions, bufid, priority, port, buf) where flow is simply a dictionary .. flow1 = { 'dl_dst': array('B', [0, 96, 221, 70, 81, 94]), 'dl_src': array('B', [0, 96, 221, 70, 81, 94])} flow2 = {'dl_src': array('B', [0, 96, 221, 70, 81, 94])} and I invoke install_datapath_flow to insert entries flow flow1 and flow2. From what I understand install_datapath_flow internally calls set_match to create the ofp_match object for the flow. I even tried creating a ofp_match object for the given flow and passing it to the install_datapath_flow command in place of flow but that gave me an AttributeError Following is the traceback. Traceback (most recent call last): File ./nox/lib/util.py, line 138, in f ret = f.cb(event.datapath_id, attrs) File ./nox/coreapps/examples/hybriddc.py, line 66, in datapath_join_callback rules.insert_static_rules(inst, dpid, 1) File ./nox/coreapps/examples/staticrules.py, line 38, in insert_static_rules self.insert_rules_pod01(inst, dpid) File ./nox/coreapps/examples/staticrules.py, line 112, in insert_rules_pod01 None, None) File ./nox/coreapps/examples/staticrules.py, line 288, in insert_forwarding_rule port, buf) File ./nox/lib/core.py, line 380, in install_datapath_flow (idle_timeout, actions, buffer_id), hard_timeout) File ./nox/lib/core.py, line 253, in send_flow_command m = set_match(attrs) File ./nox/lib/util.py, line 250, in set_match if attrs.has_key(core.IN_PORT): File ./nox/lib/openflow.py, line 756, in lambda __getattr__ = lambda self, name: _swig_getattr(self, ofp_match, name) File ./nox/lib/openflow.py, line 54, in _swig_getattr raise AttributeError(name) - Original Message - From: Murphy McCauley jam...@nau.edu To: malve...@cs.ucsd.edu Cc: nox-dev nox-dev@noxrepo.org Sent: Monday, February 21, 2011 7:41:47 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Matching wildcard flows with different priorities The expected behavior is as you expect, not what you're observing. Are you building the match by hand, or are you using set_match() (in util) or something that calls it? If you're building it by hand, are you accounting for byte order in the wildcards field using htonl()? -- Murphy On Feb 21, 2011, at 6:18 PM, malve...@cs.ucsd.edu wrote: Hi I thought I'd start another thread for this issue.. I am inserting the following two flow entries in the switch. 1) match: (src1, dst1, *) , action: send out on port x, priority = 101 (higher priority) 2) match: (src1, *) action: send out on port y, priority = 5 (lower priority) The flow between src1 and dst1 is correctly being sent on port x. This is expected because flow entry 1 has a higher priority. However for a flow between src1 and dst2, the packets are being sent to the controller instead of being sent out on port y. I had expected that since the match will fail for a higher priority flow entry it'll be matched against the lower priority entry and sent out on port y but this doesn't seem to be the case. Is this the expected behavior ? If so, what should I change so that the flows between src1 and destination other than dst1 are sent out on port y ? 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] Matching wildcard flows with different priorities
So if I insert the rules in the order flow1, flow2 then you're right flow2 doesn't get installed . However, if I insert flow2 and then flow1, both rule do get installed but in that case, even packets that should match flow1 (because it's higher priority) match against flow2 and get forwarded incorrectly. - Original Message - From: Murphy McCauley jam...@nau.edu To: malve...@cs.ucsd.edu Cc: nox-dev nox-dev@noxrepo.org Sent: Monday, February 21, 2011 8:28:38 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Matching wildcard flows with different priorities I think my next step would be to inspect the switch and see if the flows I'm expecting are there (that is... is flow2 actually getting installed?). If you're using the reference switch or Open vSwitch, I'd just use the appropriate dpctl tool to dump the flow table. -- Murphy On Feb 21, 2011, at 8:09 PM, malve...@cs.ucsd.edu wrote: I am not building the match by hand. I am specifying the flow as a dictionary and calling the install_datapath_flow method: inst.install_datapath_flow(dpid, flow, CACHE_TIMEOUT, openflow.OFP_FLOW_PERMANENT, actions, bufid, priority, port, buf) where flow is simply a dictionary .. flow1 = { 'dl_dst': array('B', [0, 96, 221, 70, 81, 94]), 'dl_src': array('B', [0, 96, 221, 70, 81, 94])} flow2 = {'dl_src': array('B', [0, 96, 221, 70, 81, 94])} and I invoke install_datapath_flow to insert entries flow flow1 and flow2. From what I understand install_datapath_flow internally calls set_match to create the ofp_match object for the flow. I even tried creating a ofp_match object for the given flow and passing it to the install_datapath_flow command in place of flow but that gave me an AttributeError Following is the traceback. Traceback (most recent call last): File ./nox/lib/util.py, line 138, in f ret = f.cb(event.datapath_id, attrs) File ./nox/coreapps/examples/hybriddc.py, line 66, in datapath_join_callback rules.insert_static_rules(inst, dpid, 1) File ./nox/coreapps/examples/staticrules.py, line 38, in insert_static_rules self.insert_rules_pod01(inst, dpid) File ./nox/coreapps/examples/staticrules.py, line 112, in insert_rules_pod01 None, None) File ./nox/coreapps/examples/staticrules.py, line 288, in insert_forwarding_rule port, buf) File ./nox/lib/core.py, line 380, in install_datapath_flow (idle_timeout, actions, buffer_id), hard_timeout) File ./nox/lib/core.py, line 253, in send_flow_command m = set_match(attrs) File ./nox/lib/util.py, line 250, in set_match if attrs.has_key(core.IN_PORT): File ./nox/lib/openflow.py, line 756, in lambda __getattr__ = lambda self, name: _swig_getattr(self, ofp_match, name) File ./nox/lib/openflow.py, line 54, in _swig_getattr raise AttributeError(name) - Original Message - From: Murphy McCauley jam...@nau.edu To: malve...@cs.ucsd.edu Cc: nox-dev nox-dev@noxrepo.org Sent: Monday, February 21, 2011 7:41:47 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Matching wildcard flows with different priorities The expected behavior is as you expect, not what you're observing. Are you building the match by hand, or are you using set_match() (in util) or something that calls it? If you're building it by hand, are you accounting for byte order in the wildcards field using htonl()? -- Murphy On Feb 21, 2011, at 6:18 PM, malve...@cs.ucsd.edu wrote: Hi I thought I'd start another thread for this issue.. I am inserting the following two flow entries in the switch. 1) match: (src1, dst1, *) , action: send out on port x, priority = 101 (higher priority) 2) match: (src1, *) action: send out on port y, priority = 5 (lower priority) The flow between src1 and dst1 is correctly being sent on port x. This is expected because flow entry 1 has a higher priority. However for a flow between src1 and dst2, the packets are being sent to the controller instead of being sent out on port y. I had expected that since the match will fail for a higher priority flow entry it'll be matched against the lower priority entry and sent out on port y but this doesn't seem to be the case. Is this the expected behavior ? If so, what should I change so that the flows between src1 and destination other than dst1 are sent out on port y ? 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] Matching wildcard flows with different priorities
I am using a Fulcrum microsystems switch that has provided an openvswitch implementation for their switches. I need to run ovs-openflowd on the switch that connects to the specified nox controller and supports the standard openvswitch flow insertion rules etc. - Original Message - From: Kyriakos Zarifis kyr.zari...@gmail.com To: malve...@cs.ucsd.edu Cc: Murphy McCauley jam...@nau.edu, nox-dev nox-dev@noxrepo.org Sent: Monday, February 21, 2011 10:40:15 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Matching wildcard flows with different priorities Hey Malveeka, what kind of switch are you using? (sorry if you mentioned this and I missed it) On Mon, Feb 21, 2011 at 9:08 PM, malve...@cs.ucsd.edu wrote: So if I insert the rules in the order flow1, flow2 then you're right flow2 doesn't get installed . However, if I insert flow2 and then flow1, both rule do get installed but in that case, even packets that should match flow1 (because it's higher priority) match against flow2 and get forwarded incorrectly. - Original Message - From: Murphy McCauley jam...@nau.edu To: malve...@cs.ucsd.edu Cc: nox-dev nox-dev@noxrepo.org Sent: Monday, February 21, 2011 8:28:38 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Matching wildcard flows with different priorities I think my next step would be to inspect the switch and see if the flows I'm expecting are there (that is... is flow2 actually getting installed?). If you're using the reference switch or Open vSwitch, I'd just use the appropriate dpctl tool to dump the flow table. -- Murphy On Feb 21, 2011, at 8:09 PM, malve...@cs.ucsd.edu wrote: I am not building the match by hand. I am specifying the flow as a dictionary and calling the install_datapath_flow method: inst.install_datapath_flow(dpid, flow, CACHE_TIMEOUT, openflow.OFP_FLOW_PERMANENT, actions, bufid, priority, port, buf) where flow is simply a dictionary .. flow1 = { 'dl_dst': array('B', [0, 96, 221, 70, 81, 94]), 'dl_src': array('B', [0, 96, 221, 70, 81, 94])} flow2 = {'dl_src': array('B', [0, 96, 221, 70, 81, 94])} and I invoke install_datapath_flow to insert entries flow flow1 and flow2. From what I understand install_datapath_flow internally calls set_match to create the ofp_match object for the flow. I even tried creating a ofp_match object for the given flow and passing it to the install_datapath_flow command in place of flow but that gave me an AttributeError Following is the traceback. Traceback (most recent call last): File ./nox/lib/util.py, line 138, in f ret = f.cb(event.datapath_id, attrs) File ./nox/coreapps/examples/hybriddc.py, line 66, in datapath_join_callback rules.insert_static_rules(inst, dpid, 1) File ./nox/coreapps/examples/staticrules.py, line 38, in insert_static_rules self.insert_rules_pod01(inst, dpid) File ./nox/coreapps/examples/staticrules.py, line 112, in insert_rules_pod01 None, None) File ./nox/coreapps/examples/staticrules.py, line 288, in insert_forwarding_rule port, buf) File ./nox/lib/core.py, line 380, in install_datapath_flow (idle_timeout, actions, buffer_id), hard_timeout) File ./nox/lib/core.py, line 253, in send_flow_command m = set_match(attrs) File ./nox/lib/util.py, line 250, in set_match if attrs.has_key(core.IN_PORT): File ./nox/lib/openflow.py, line 756, in lambda __getattr__ = lambda self, name: _swig_getattr(self, ofp_match, name) File ./nox/lib/openflow.py, line 54, in _swig_getattr raise AttributeError(name) - Original Message - From: Murphy McCauley jam...@nau.edu To: malve...@cs.ucsd.edu Cc: nox-dev nox-dev@noxrepo.org Sent: Monday, February 21, 2011 7:41:47 PM GMT -08:00 US/Canada Pacific Subject: Re: [nox-dev] Matching wildcard flows with different priorities The expected behavior is as you expect, not what you're observing. Are you building the match by hand, or are you using set_match() (in util) or something that calls it? If you're building it by hand, are you accounting for byte order in the wildcards field using htonl()? -- Murphy On Feb 21, 2011, at 6:18 PM, malve...@cs.ucsd.edu wrote: Hi I thought I'd start another thread for this issue.. I am inserting the following two flow entries in the switch. 1) match: (src1, dst1, *) , action: send out on port x, priority = 101 (higher priority) 2) match: (src1, *) action: send out on port y, priority = 5 (lower priority) The flow between src1 and dst1 is correctly being sent on port x. This is expected because flow entry 1 has a higher priority. However for a flow between src1 and dst2, the packets are being sent to the controller instead of being sent out on port y. I had expected that since the match will fail for a higher priority flow entry it'll be matched against the lower priority entry and sent out on port y but this doesn't seem to be the case. Is this the expected