[pox-dev] Flow rule installation using POX

Murphy McCauley murphy.mccauley at gmail.com
Thu Mar 14 17:35:37 PDT 2019


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.

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.

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...

-- Murphy

On Thu, Mar 14, 2019 at 5:21 PM Sukheja, Himanshu <hxs376 at psu.edu> wrote:

> Hello Murphy,
>
> 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).
>
> 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.
>
> 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
> POX>from pox.core import core
> POX>import pox.openflow.libopenflow_01 as of
> POX>from pox.lib.addresses import IPAddr
>
>
> 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.
>
>
> Thanks,
>
> ************************************************************************
> Himanshu Sukheja
> ------------------------------
> *From:* Murphy McCauley <murphy.mccauley at gmail.com>
> *Sent:* 14 March 2019 07:08
> *To:* Sukheja, Himanshu
> *Cc:* pox-dev at lists.noxrepo.org
> *Subject:* Re: [pox-dev] Flow rule installation using POX
>
> 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:
>
> https://noxrepo.github.io/pox-doc/html/#communicating-with-datapaths-switches
> <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>
>
> You also might take a look at some of the sample POX components,
> particularly ones in the forwarding/ directory.
>
> 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:
> https://noxrepo.github.io/pox-doc/html/#openflow-of-01
> <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>
>
> 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:
> https://noxrepo.github.io/pox-doc/html/#invoking-pox
> <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>
>
> Ultimately, you should see some log messages in POX about the switches
> connecting.  Are you?
>
> 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).
>
> -- Murphy
>
> On Wed, Mar 13, 2019 at 8:36 PM Sukheja, Himanshu <hxs376 at psu.edu> wrote:
>
>  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.
>
> sh ovs-ofctl add-flow s1 priority=40000,hard_timeout=30,actions=drop
>
> Now In POX CLI I run the following command
>
> msg = of.ofp_flow_mod(command=of.OFPFC_DELETE)
>
> Although now when I do a Dump-flow command on mininet terminal it still
> shows the flow is installed
> Also, I tried to ping h1 and h2, and the packets are being dropped (which
> means that the flow is still there)
>
>
> Could you please point out the error in my execution here.
>
> Thanks
> ***********************************************
> ************************************************************************
> Himanshu Sukheja
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noxrepo.org/pipermail/pox-dev-noxrepo.org/attachments/20190314/e31f14b5/attachment-0002.html>


More information about the pox-dev mailing list