Phew.  Glad to hear it. :)

-- Murphy

On Oct 31, 2013, at 3:37 PM, Amer <[email protected]> wrote:

> Hello,
> 
> Thank you it works fine and I hope others get helpful comments from this 
> thread.
> 
> Many thanks to you and I hope you the best in your life.
> 
> Sincerely Yours,
> Amer
> 
> On ٣١‏/١٠‏/٢٠١٣, at ١٠:٥٢ م, Murphy McCauley <[email protected]> 
> wrote:
> 
>> 
>> On Oct 31, 2013, at 4:13 AM, AMER <[email protected]> wrote:
>> 
>>> hello,
>>>  
>>> this is my code:
>>>  
>>> def _handle_PacketIn (event):
>>>  packet = event.parsed
>>>  log.info("%s ready paacket IN", event)
>>> 
>>>  if ( packet.type == packet.ARP_TYPE):
>>>          RespondToARP(packet, event)
>>>          return
>>>  else:
>>> #1
>>>       msg1 = nx.nx_flow_mod()
>>>       msg1.idle_timeout = 10
>>>       msg1.hard_timeout = 20
>>>       msg1.match.eth_type = packet.IP_TYPE
>>>       msg1.match.of_ip_dst_with_mask = "10.0.0.4/0.0.0.255"
>> 
>> I'd suggest that you start by following my earlier suggestion (on the 
>> "Arbitrary netmask" thread) and making this line:
>> msg1.match.of_ip_dst_with_mask = ("0.0.0.4", "0.0.0.255")
>> 
>> If you want it to be any.any.any.4 as you say, there really isn't a point in 
>> specifying the 10.  Additionally, the way you're trying to specify it there 
>> simply isn't valid and will result in an exception.  If you're not getting 
>> an exception from that, I don't think this code has actually been getting 
>> run, so it's hard to evaluate whether it's doing what you want it to.
>> 
>>>       msg1.priority = 65001
>>>       msg1.actions.append(of.ofp_action_output(port = 3))
>>>       core.openflow.sendToDPID(1, msg1)
>>>  
>>>       msg1 = nx.nx_flow_mod()
>>>       msg1.idle_timeout = 10
>>>       msg1.hard_timeout = 20
>>>       msg1.match.eth_type = packet.IP_TYPE
>>>       msg1.match.ip_dst = "10.0.0.2"
>>>       msg1.priority = 65001
>>>       msg1.actions.append(of.ofp_action_output(port = 2))
>>>       core.openflow.sendToDPID(1, msg1)
>>>  
>>> def RespondToARP(packet, event):
>>>     # reply to ARP request
>>> 
>>>       msg1 = nx.nx_flow_mod()
>>>       msg1.idle_timeout = 100
>>>       msg1.hard_timeout = 120
>>>       msg1.match.eth_type = packet.ARP_TYPE
>>>       msg1.match.eth_src = packet.src
>>>       msg1.match.eth_dst = packet.dst
>>>       msg1.priority = 6
>>>       msg1.actions.append(of.ofp_action_output(port = of.OFPP_ALL))
>>>       event.connection.send(msg1)
>>>  
>>> 
>>> def launch ():
>>>   assert core.NX, "Nicira extensions required"
>>>   assert core.NX.convert_packet_in, "PacketIn conversion required"
>>>   core.openflow.addListenerByName("PacketIn", _handle_PacketIn)
>>>   log.info("Simple NX switch running.")
>>> 
>>> Thank you and Best rgards,
>>> 
>>> Eng Amer Alghadhban
>>> COE
>>> SANS-GCFW
>>> CEH, SCNP, CCNA
>>> 
>>>  
>>> Subject: Re: Nonzero masked bits
>>> From: [email protected]
>>> Date: Wed, 30 Oct 2013 16:52:05 -0700
>>> CC: [email protected]
>>> To: [email protected]
>>> 
>>> It seems like it could be a bug in POX, your code, or OVS.  It's probably 
>>> not OVS.  Can you post your code?
>>> 
>>> -- Murphy
>>> 
>>> On Oct 30, 2013, at 4:27 PM, Amer <[email protected]> wrote:
>>> 
>>> Hello,
>>> 
>>> Thank you for this comment
>>> I have removed them, but I this method ignores the effect of mask 
>>> completely. I tried to ping h3(10.0.0.3) to h2(10.0.0.2) --> 100% response
>>> ping h3(11.0.0.3) to h2(10.0.0.2) --> 100% response
>>> ping h3(10.1.0.3) to h2(10.0.0.2) --> 100% response
>>> 
>>> Where the match is as what mentioned in previous emails (10.0.0.4/0.0.0.255)
>>> Even when I changed the mask to 0.255.0.255 with 11.1.0.4.
>>> I think the value in match is replaced with any.
>>> What I want to do is:
>>> 10.0.0.3/0.0.0.255--> means any.any.any.3
>>> 
>>> Thank you
>>> Best regards 
>>> Amer
>>> 
>>> Sent from my iPhone
>>> 
>>> On ٣٠‏/١٠‏/٢٠١٣, at ٩:٥٨ م, Murphy McCauley <[email protected]> 
>>> wrote:
>>> 
>>> Right, this is what I was pointing out on the other thread about the mask 
>>> not actually making sense.  Your mask makes only the final byte matter, so 
>>> the leading "10" is useless.  The "canonical" form of this would just be 
>>> 0.0.0.4/0.0.0.255.
>>> 
>>> You could easily just disable the assertion on line 1816/1817 of nicira.py 
>>> and your code should run.  The assertion is just checking that what you're 
>>> doing makes sense -- which as far as I can figure, your current code 
>>> doesn't.
>>> 
>>> -- Murphy
>>> 
>>> On Oct 30, 2013, at 8:12 AM, Amer <[email protected]> wrote:
>>> 
>>> Hello,
>>> 
>>> I would to thank you, however I got 
>>> Nonzero bits mask error
>>> Is there a way to avoid this.
>>> Or is there a mask function for nonzero bits.
>>> This is my command:
>>> match.ip_src_with_mask = "10.0.0.4/0.0.0.255"
>>> 
>>> Best regards,
>>> Amer
>>> 
>>> Sent from my iPhone
>> 

Reply via email to