Re: [nox-dev] IP address prefixing
Thanks Murphy. That was extremely helpful. Theo On 01/09/2012 04:09 PM, Murphy McCauley wrote: I am assuming that by 10.10.23.40/2, you don't intend the CIDR meaning, and in fact mean that you want two bits to be wildcarded. Try this: wildcard = (wildcard& ~OFPFW_NW_DST_MASK) | (wild_bits<< OFPFW_NW_DST_SHIFT); .. where wild_bits is between 0 and 32 inclusive (in your case, it should be 2). Hope that helps. -- Murphy On Jan 9, 2012, at 10:24 AM, Theophlius Benson wrote: Good Morning, I am trying to install rules into switches to match ip prefixes. For example 10.10.23.40/2. However, the rules i install endup looking like this: 0.0.0.0/2. I'm sure that I'm installing these rules incorrectly. Here is a fragment of the code that sets the matching criteria. wildcard = (~OFPFW_NW_DST_ALL& (OFPFW_NW_DST_MASK<< dstmask)) | wildcard; ofm->match.wildcards = htonl(wildcard); ofm->match.nw_dst=htonl(dstip); I Can include more fragments of the code if you will find it helpful. Theo ___ 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] IP address prefixing
I am assuming that by 10.10.23.40/2, you don't intend the CIDR meaning, and in fact mean that you want two bits to be wildcarded. Try this: wildcard = (wildcard & ~OFPFW_NW_DST_MASK) | (wild_bits << OFPFW_NW_DST_SHIFT); .. where wild_bits is between 0 and 32 inclusive (in your case, it should be 2). Hope that helps. -- Murphy On Jan 9, 2012, at 10:24 AM, Theophlius Benson wrote: > Good Morning, > > I am trying to install rules into switches to match ip prefixes. For example > 10.10.23.40/2. However, the rules i install endup looking like this: > 0.0.0.0/2. I'm sure that I'm installing these rules incorrectly. Here is a > fragment of the code that sets the matching criteria. > > wildcard = (~OFPFW_NW_DST_ALL & (OFPFW_NW_DST_MASK << dstmask)) | > wildcard; >ofm->match.wildcards = htonl(wildcard); >ofm->match.nw_dst=htonl(dstip); > > I Can include more fragments of the code if you will find it helpful. > Theo > ___ > 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
[nox-dev] IP address prefixing
Good Morning, I am trying to install rules into switches to match ip prefixes. For example 10.10.23.40/2. However, the rules i install endup looking like this: 0.0.0.0/2. I'm sure that I'm installing these rules incorrectly. Here is a fragment of the code that sets the matching criteria. wildcard = (~OFPFW_NW_DST_ALL & (OFPFW_NW_DST_MASK << dstmask)) | wildcard; ofm->match.wildcards = htonl(wildcard); ofm->match.nw_dst=htonl(dstip); I Can include more fragments of the code if you will find it helpful. Theo ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev
Re: [nox-dev] Ip Address
This looks to me like the utility function convert_to_ipaddr() has some unfortunate and inconsistent behavior. It could be that things rely on this, so this patch may actually break things. I tried to do a quick look and fix where that happens, but I haven't tested even a little tiny bit. It may correct the situation, though. Let me know. :) -- Murphy fix_ipaddr.patch Description: Binary data On Nov 27, 2010, at 4:33 PM, Rohit Manohar wrote: > I am trying to change the IP source for a flow. For that I am doing the > following: > > src_ip = '10.0.0.4' > actions = [[openflow.OFPAT_OUTPUT, [0, > prt[0]]],[openflow.OFPAT_SET_NW_SRC,src_ip]] > > When I run the code, I get the following error. Any idea what might be > causing it? > > 00035|pyrt|ERR:unable to invoke a Python event handler: > Traceback (most recent call last): > File "./nox/lib/util.py", line 116, in f > event.total_len, buffer_id, packet) > File "./nox/coreapps/examples/pyproject.py", line 166, in packet_in_callback > forward_l2_packet(dpid, inport, packet, packet.arr, bufid) > File "./nox/coreapps/examples/pyproject.py", line 107, in forward_l2_packet > inport, buf) > File "./nox/lib/core.py", line 378, in install_datapath_flow > (idle_timeout, actions, buffer_id), hard_timeout) > File "./nox/lib/core.py", line 257, in send_flow_command > oactions = self.make_action_array(actions) > File "./nox/lib/core.py", line 168, in make_action_array > a = struct.pack("HHI", htons(action[0]), htons(8), iaddr.addr) > AttributeError: 'int' object has no attribute 'addr' > > > Regards, > -- > Rohit Manohar > Graduate Student > North Carolina State University > Raleigh, US. > > ___ > 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] Ip Address
I am trying to change the IP source for a flow. For that I am doing the following: src_ip = '10.0.0.4' actions = [[openflow.OFPAT_OUTPUT, [0, prt[0]]],[openflow.OFPAT_SET_NW_SRC,src_ip]] When I run the code, I get the following error. Any idea what might be causing it? 00035|pyrt|ERR:unable to invoke a Python event handler: Traceback (most recent call last): File "./nox/lib/util.py", line 116, in f event.total_len, buffer_id, packet) File "./nox/coreapps/examples/pyproject.py", line 166, in packet_in_callback forward_l2_packet(dpid, inport, packet, packet.arr, bufid) File "./nox/coreapps/examples/pyproject.py", line 107, in forward_l2_packet inport, buf) File "./nox/lib/core.py", line 378, in install_datapath_flow (idle_timeout, actions, buffer_id), hard_timeout) File "./nox/lib/core.py", line 257, in send_flow_command oactions = self.make_action_array(actions) File "./nox/lib/core.py", line 168, in make_action_array a = struct.pack("HHI", htons(action[0]), htons(8), iaddr.addr) AttributeError: 'int' object has no attribute 'addr' Regards, -- Rohit Manohar Graduate Student North Carolina State University Raleigh, US. ___ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org