<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">Murphy,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">

<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">That point you made about firewall being reactive is exactly what I wanted to know. So seems it was not due to connectionup event, but rather a packetIn event being processed by two components triggered the error.</div>

<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">both of my firewall component and the switch component, have PacketIn handlers , I have now tried making the firewall proactive by installing flow table entries as soon as a connection is set up  instead of handling the packet once received by the controller as below and it seemed to have worked.</div>

<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)"><div class="gmail_default">

        def _handle_ConnectionUp(self,event):#everytime a connection is established, a prepopulate the firewall entries </div><div class="gmail_default">                #connection.addListeners(self)</div><div class="gmail_default">

                print "in firewll"</div><div class="gmail_default">                filterlist = [('00:00:00:00:00:02','00:00:00:00:00:03')]</div><div class="gmail_default"><br></div><div class="gmail_default">

                msg = of.ofp_flow_mod()</div><div class="gmail_default">                msg.match.dl_src = EthAddr(filterlist[0][0])</div><div class="gmail_default">                msg.match.dl_dst = EthAddr(filterlist[0][1])</div>

<div class="gmail_default">                msg.priority = 65535</div><div class="gmail_default">                print msg</div><div class="gmail_default">                event.connection.send(msg</div><div class="gmail_default">

<br></div><div class="gmail_default">result:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><div class="gmail_default">*** s2 ------------------------------------------------------------------------</div>

<div class="gmail_default">in_port(1),eth(src=00:00:00:00:00:02,dst=00:00:00:00:00:03),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:4, bytes:392, used:1.468s, actions:drop</div>

</div><div class="gmail_default"><br></div><div class="gmail_default">mininet></div><div class="gmail_default"><br></div><div class="gmail_default">I will reread the docs w.r.t priorities for the listeners though..</div>

<div class="gmail_default"><br></div><div class="gmail_default">thanks again.</div></div><div class="gmail_default"><br></div></div></div><div class="gmail_extra"><br clear="all"><div>Cheers!<br>Durga<br><br></div>
<br><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 6:26 PM, Murphy McCauley <span dir="ltr"><<a href="mailto:murphy.mccauley@gmail.com" target="_blank">murphy.mccauley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><div class="h5"><br><div><div>On Nov 11, 2013, at 10:33 PM, durga <<a href="mailto:c.vijaya.durga@gmail.com" target="_blank">c.vijaya.durga@gmail.com</a>> wrote:</div><br><blockquote type="cite">

<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">Hello All,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">



<br>
</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">Just a small question. Incase I run the a firewall application in conjecture to  a l2 learning switch application , how does the controller work on the connectionup event?</div>



<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">for example I run the command :</div>



<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">mininet@mininet-vm:~/pox$ pox.py log.level -DEBUG l2_switching_v5 l2_switching_firewall_v3 &<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">



<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">I want firewall to take precedence over the l2 switch and have introduced priority as msg.priority = 65535 (highest priority), but what I am trying to understand is - its a single connection from the OVS switch to the pox controller and controller is running 2 applications - firewall and switch, so how do these 2 applications work on the same connection? </div>



<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">Currently, my program sends 2 flow mod messages - </div>



<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">1.from firewall app with priority of 65535 for matching flows </div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">



2. from the switch for all other flows</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">and the ovs installs flow with max priority. Is this the right way of doing?? </div>



<div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:rgb(153,51,0)">As of now, I am stuck with an error - <span style="font-family:arial;color:rgb(34,34,34)">OFPBRC_BUFFER_EMPTY = 7  - which as per openflow doc is  error when a buffer is already in use..</span></div>



</div></blockquote><br></div></div></div><div>POX doesn't do any magic arbitration for you.  If two components listen to the same event -- both of them get it.  Which one gets it first is technically undefined *unless* the listeners have priorities set.  I think revent priorities aren't really documented on the wiki yet... you'll have to read the docs/code in pox/lib/revent.  If it wants to, the one that fires first can then cancel the event so that the second one doesn't get it.  Again, you probably need to read the docstrings or code for this.</div>

<div><br></div><div>Alternatively... read the code for the mac_blocker component (in misc) or the port blocker in the FAQ.  These are examples of very simple firewalls.  mac_blocker definitely uses both event priorities and event canceling.</div>

<div><br></div><div>The problem you're having with BUFFER_EMPTY is probably because... I am guessing your firewall is "reactive" and both the firewall and the forwarding component are handling the PacketIn event.  You probably want the firewall at a high priority, and when it wants to block, it should install the "block" table entry and cancel the event so that the forwarding component doesn't try to install an entry too.  This is exactly what mac_blocker does.</div>

<span class="HOEnZb"><font color="#888888"><div><br></div><div>-- Murphy</div></font></span></div></blockquote></div><br></div>