<div dir="ltr"><div>If you inspect core.openflow.connections from the CLI, can you see switch connections in there?  If you only have one switch, there should be just one.  You can use the send() method on that connection object to send the "msg" that you constructed.<br></div><div><br></div><div>It's rare to actually do this from the CLI.  Usually you write a program which get the connection object via an event.  But there's no reason why it can't be done from the CLI.</div><div><br></div><div>Still... POX sends a table clear by default.  If your tables aren't cleared, I am not sure the switches are connecting to the controller.  You should be getting log messages in POX that say the switches are connecting (I'm actually not sure what log level they're at; you may want to run with log.level --DEBUG on the commandline too).  And double check the OpenFlow port number and IP address and that the controller is running in the right network namespace or whatever.  But I guess you'll also see whether core.openflow.connections is empty or not...</div><div><br></div><div>-- Murphy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 14, 2019 at 5:21 PM Sukheja, Himanshu <<a href="mailto:hxs376@psu.edu">hxs376@psu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hello Murphy, <br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Thank you for you reply. I understand your concern that my POX controller may not be correctly connected to the switch. However, it is connected as whenever i put in "nodeS" command in my mininet CLI it shows me c0(i.e. pox).
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
As you recommended I read the links mentioned by you in your previous email. I am invoking pox with the openflow.of_1 --port=6653, So your last doubt is cleared.
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
The major problem I am facing is that I cannot even install any flow from my POX CLI. Although, I also parse these commands before trying to install a flow mod
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
POX>from pox.core import core<br>
POX>import pox.openflow.libopenflow_01 as of<br>
POX>from pox.lib.addresses import IPAddr<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I would be really grateful if you could give me an example about how to install any flow on the switch from my POX controller CLI. As, I can successfully install flow from the switch side but not from controller side.
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Thanks,<br>
</div>
<div id="gmail-m_-8605854585790729120signature">
<div id="gmail-m_-8605854585790729120divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0px;margin-bottom:0px"><span style="font-family:Helvetica;font-size:12px">************************************************************************</span><br style="font-family:Helvetica;font-size:12px">
<span style="font-family:Helvetica;font-size:12px">Himanshu Sukheja</span><span class="gmail-m_-8605854585790729120Apple-tab-span" style="font-family:Helvetica;font-size:12px;white-space:pre-wrap">
</span><br style="font-family:Helvetica;font-size:12px">
<span style="font-family:Helvetica;font-size:12px"></span></p>
</div>
</div>
<div id="gmail-m_-8605854585790729120appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-8605854585790729120divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Murphy McCauley <<a href="mailto:murphy.mccauley@gmail.com" target="_blank">murphy.mccauley@gmail.com</a>><br>
<b>Sent:</b> 14 March 2019 07:08<br>
<b>To:</b> Sukheja, Himanshu<br>
<b>Cc:</b> <a href="mailto:pox-dev@lists.noxrepo.org" target="_blank">pox-dev@lists.noxrepo.org</a><br>
<b>Subject:</b> Re: [pox-dev] Flow rule installation using POX</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>You are just creating a message, but that's not enough -- you have to send it to a switch.  This section of the POX manual may be of help:</div>
<div><a href="https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnoxrepo.github.io%2Fpox-doc%2Fhtml%2F%23communicating-with-datapaths-switches&data=02%7C01%7Chxs376%40psu.edu%7Cf1db8043ac5d4b88564208d6a86d75b4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636881585412243283&sdata=mBjaeQo7v2gOUFbhvMvIquCFEJwymwXylX8zCsOxFeU%3D&reserved=0" target="_blank">https://noxrepo.github.io/pox-doc/html/#communicating-with-datapaths-switches</a><br>
</div>
<div><br>
</div>
<div>You also might take a look at some of the sample POX components, particularly ones in the forwarding/ directory.</div>
<div><br>
</div>
<div>But I think you've got bigger problems.  By default, POX actually clears the tables on switches when they connect -- sending a command much like the one you've constructed.  So I think switches aren't connecting to POX.  Depending on what version of POX
 you're running, one possibility is that POX's OpenFlow component isn't running.  You might look at the documentation for the of_01 component in the manual:</div>
<div><a href="https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnoxrepo.github.io%2Fpox-doc%2Fhtml%2F%23openflow-of-01&data=02%7C01%7Chxs376%40psu.edu%7Cf1db8043ac5d4b88564208d6a86d75b4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636881585412253293&sdata=NlviWa9QM856%2F0RM0KyCozUB%2B1nIa8TI6QPLS%2FQq9xU%3D&reserved=0" target="_blank">https://noxrepo.github.io/pox-doc/html/#openflow-of-01</a><br>
</div>
<div><br>
</div>
<div>
<div>The manual mentions that POX will generally automatically load the of_01 (OpenFlow 1.0) component if another component that uses OpenFlow is loaded.  Since you're entering stuff in the CLI, maybe you aren't loading any OpenFlow-using component?  In that
 case, you'll need to launch of_01 manually.  If you're just running POX without any commandline arguments at all, you should probably read:</div>
<div><a href="https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnoxrepo.github.io%2Fpox-doc%2Fhtml%2F%23invoking-pox&data=02%7C01%7Chxs376%40psu.edu%7Cf1db8043ac5d4b88564208d6a86d75b4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636881585412263297&sdata=lJ05u9k3QuCTYzgGnP3zDzqkbb1tM1lgAmKedQedxHE%3D&reserved=0" target="_blank">https://noxrepo.github.io/pox-doc/html/#invoking-pox</a></div>
<br class="gmail-m_-8605854585790729120x_gmail-Apple-interchange-newline">
</div>
<div>Ultimately, you should see some log messages in POX about the switches connecting.  Are you?</div>
<div><br>
</div>
<div>Not really related to the above, but you mention how packets being dropped means the table entry is still there.  That's not true, generally speaking.  In general, an OpenFlow switch without any table entries doesn't forward any traffic (though it may
 encapsulate at least the headers and send it to the controller).</div>
<div><br>
</div>
<div>-- Murphy</div>
<br>
<div class="gmail-m_-8605854585790729120x_gmail_quote">
<div dir="ltr" class="gmail-m_-8605854585790729120x_gmail_attr">On Wed, Mar 13, 2019 at 8:36 PM Sukheja, Himanshu <<a href="mailto:hxs376@psu.edu" target="_blank">hxs376@psu.edu</a>> wrote:<br>
</div>
<blockquote class="gmail-m_-8605854585790729120x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div> have created a simple topology using Mininet in which I have created a single switch and connected it to a remote controller (POX). I installed a simple flow rule using Mininet CLI which commands the switch to drop all packets. 
<div>
<pre style="overflow:auto hidden;padding:5px;color:rgb(51,51,51);line-height:15.6px;border-top:1px solid rgb(170,204,153);border-bottom:1px solid rgb(170,204,153);border-right-style:none;border-left-style:none"><span style="background-color:rgba(255,255,255,0)">sh ovs-ofctl add-flow s1 priority=40000,hard_timeout=30,actions=drop</span></pre>
</div>
<div>
<div>Now In POX CLI I run the following command </div>
<div><br>
</div>
<div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">msg = of.ofp_flow_mod(command=of.OFPFC_DELETE)</span></div>
</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal">
Although now when I do a Dump-flow command on mininet terminal it still shows the flow is installed </div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal">
Also, I tried to ping h1 and h2, and the packets are being dropped (which means that the flow is still there)</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal">
<br>
</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal">
<br>
</div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">Could you please point out the error in my execution here. </span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></div>
<div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-variant-ligatures:no-common-ligatures">Thanks</span></div>
<div>***********************************************</div>
</div>
<div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
************************************************************************<br>
Himanshu Sukheja<span class="gmail-m_-8605854585790729120x_gmail-m_6339575454302862882Apple-tab-span" style="white-space:pre-wrap">
</span><br>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div>