Re: [pox-dev] Question about the capacity of pox controller

2019-08-22 Thread Murphy McCauley
Sure, though it depends on how fast the machine running POX is, whether
you're using CPython or PyPy, etc.  How fast the switch is may also be an
issue.

In general, if you're doing work where performance is critical, you
probably shouldn't be using Python.

On Thu, Aug 22, 2019 at 10:02 AM Modhawi Alotaibi 
wrote:

> Hello All,
> I wonder is there a way to limit the capacity of a pox controller in terms
> of the maximum number of flows processed per unit of time?
> I'm working on a load balancing approach where controllers have thresholds
> on the number of handled OF flows.
>
> Best Regards,
> Modhawi
>


Re: [pox-dev] problem in discovery.py function

2019-07-08 Thread Murphy McCauley
Assuming the legacy switches speak LLDP, I think you'd generally have to
query them using SNMP to get the information you need.  This wouldn't be a
straightforward modification of how the current discovery component works
-- it'd be a complete rewrite.

-- Murphy

On Mon, Jul 8, 2019 at 12:27 AM AASIF MNIT  wrote:

> I am trying a way to modify lldp packet such that it can discover topology
> in hybrid Sdn(having legacy switches). what fields should I add or delete
> from lldp frame formate?
>
> On Mon, 8 Jul 2019 at 00:52, Murphy McCauley 
> wrote:
>
>> So this is the constructor for LLDPSender.  The docstring explains what
>> the two parameters are.  ttl probably isn't that important.
>> send_cycle_time has to do with how fast discovery is sending packets.
>>
>> You don't usually construct LLDPSenders yourself, though.  Normally, the
>> discovery component (class Discovery) constructs them for you -- all you
>> need to do is put "openflow.discovery" on the POX commandline.
>>
>> If you're trying to modify how discovery works or something, you might
>> get better help if you explained what you were actually trying to
>> accomplish.
>>
>> -- Murphy
>>
>> On Sun, Jul 7, 2019 at 5:59 AM AASIF MNIT  wrote:
>>
>>> I am working on a security project, and unable to get the function of
>>> the following method which is in discovery.py
>>>
>>> def __init__ (self, send_cycle_time, ttl = 120):
>>>
>>> please help me in understanding this method
>>>
>>>


Re: [pox-dev] problem in lldp.py

2019-07-07 Thread Murphy McCauley
The constructor arguments are basically the same for all classes in the
packet library.

raw is used if you are parsing a raw packet that's held in a bytes/str
object.
prev is mostly used internally to build chains of packet headers.  That is,
since most packet headers are preceded by other packet headers, a packet's
.prev usually points to the preceding one.  But most of the time you don't
manually set it in the constructor; usually the right thing happens without
you having to worry about it.

If you're constructing a packet from scratch, you use keyword arguments.
This isn't that useful for LLDP packets.  It's more useful for things like
TCP packets.  It's more or less a shortcut so that you can do things like:
mypacket = foo(bar = 42)

Instead of:
mypacket = foo()
foo.bar = 42

LLDP packets don't really have many fields, though.  They're basically just
a list of TLVs.  So the more common way to use it is just to create an
empty LLDP header and append TLVs.  discovery does this, for example:
https://github.com/noxrepo/pox/blob/eel/pox/openflow/discovery.py#L189

-- Murphy

On Sun, Jul 7, 2019 at 6:01 AM AASIF MNIT  wrote:

> The following is code from lldp.py, I am unable to get use of parameters
> used in methods, please help me.
>
>
> def __init__ (self, raw=None, prev=None, **kw):
> packet_base.__init__(self)
>
> self.prev = prev
>
> self.next = None
> self.tlvs = []
>
> if raw is not None:
>   self.parse(raw)
>
> self._init(kw)
>


Re: [pox-dev] problem in discovery.py function

2019-07-07 Thread Murphy McCauley
So this is the constructor for LLDPSender.  The docstring explains what the
two parameters are.  ttl probably isn't that important.  send_cycle_time
has to do with how fast discovery is sending packets.

You don't usually construct LLDPSenders yourself, though.  Normally, the
discovery component (class Discovery) constructs them for you -- all you
need to do is put "openflow.discovery" on the POX commandline.

If you're trying to modify how discovery works or something, you might get
better help if you explained what you were actually trying to accomplish.

-- Murphy

On Sun, Jul 7, 2019 at 5:59 AM AASIF MNIT  wrote:

> I am working on a security project, and unable to get the function of the
> following method which is in discovery.py
>
> def __init__ (self, send_cycle_time, ttl = 120):
>
> please help me in understanding this method
>
>


Re: [pox-dev] Flow rule installation using POX

2019-03-14 Thread Murphy McCauley
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  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 
> *Sent:* 14 March 2019 07:08
> *To:* Sukheja, Himanshu
> *Cc:* pox-dev@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=02%7C01%7Chxs376%40psu.edu%7Cf1db8043ac5d4b88564208d6a86d75b4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636881585412243283=mBjaeQo7v2gOUFbhvMvIquCFEJwymwXylX8zCsOxFeU%3D=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=02%7C01%7Chxs376%40psu.edu%7Cf1db8043ac5d4b88564208d6a86d75b4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636881585412253293=NlviWa9QM856%2F0RM0KyCozUB%2B1nIa8TI6QPLS%2FQq9xU%3D=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=02%7C01%7Chxs376%40psu.edu%7Cf1db8043ac5d4b88564208d6a86d75b4%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636881585412263297=lJ05u9k3QuCTYzgGnP3zDzqkbb1tM1lgAmKedQedxHE%3D=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 ther

Re: [pox-dev] Flow rule installation using POX

2019-03-14 Thread Murphy McCauley
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

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

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

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  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=4,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
>


Re: [pox-dev] Redirect "ofp_packet_in" packet among multiple controllers in POX?

2018-06-17 Thread Murphy McCauley
It sounds like you're on to a solution, but here are some other thoughts...

1) Depending on what kind of switch you're using and exactly how your
controllers are supposed to work... it may be possible to just have the
switch connect to multiple controllers (and have the controllers behave
differently) rather than have one controller connect to another.

2) You're having the first controller send the redirected packet-in to the
second controller's normal OpenFlow-listening-port.  Which, as you found,
is problematic.  Because the second controller is expecting a switch to
connect which does some handshaking which you're not doing.  Why not just
have the second controller like... open a socket and listen on it?  Why
have it go through the normal OpenFlow processing stuff at all?  You could
use POX's messenger component for this (though it's not ideal for this use
case).  Or you should be able to use the ioworker stuff to open a socket
and listen easily.  Or you could just write it by hand.  Or you could just
send the packet-in data between controller using some Python RPC library
(RPyC would probably work).

3) Again, this doesn't seem necessary, but you could have controller 1 act
like a proper OpenFlow switch which just happens to only send packet-in
messages.  The datapaths.switch.SoftwareSwitchBase class will maintain a
connection to a controller.  Create a subclass of it in controller 1 (you
actually may not even need to subclass it!) and have it send the packet-ins
to controller 2 using its .send() method.  This is probably overkill,
even.  You could probably just hardcode enough of the handshake into
controller 1.  (But using SoftwareSwitchBase seems like it'd be really easy
with no particular downside?)

As a sidenote, carp is like 5 years out of date.  eel has updates like six
months ago.  fangtooth (in my fork) has updates last month.

Good luck.

-- Murphy

On Wed, Jun 13, 2018 at 8:22 AM, 夏瑞  wrote:

> I'm trying to modify the source code of POX to realize my idea.
>
> I find that the "ofnexus" is the key module for processing an event, like
> "Packet_In". This is the code snippet in "pox/openflow/of_01.py"
> ###
> def handle_PACKET_IN (con, msg): #A
>   e = con.ofnexus.raiseEventNoErrors(PacketIn, con, msg)
>   if e is None or e.halt != True:
> con.raiseEventNoErrors(PacketIn, con, msg)
> ###
>
> "con.ofnexus" will trigger my customized "_handle_packet_in". However,
> this value is "_dummyOFNexus" by default, which is set in "__init__()"
> function of class "Connection".
> ###
> class DummyOFNexus (object):
>   def raiseEventNoErrors (self, event, *args, **kw):
> log.warning("%s raised on dummy OpenFlow nexus" % event)
>   def raiseEvent (self, event, *args, **kw):
> log.warning("%s raised on dummy OpenFlow nexus" % event)
>   def _disconnect (self, dpid):
> log.warning("%s disconnected on dummy OpenFlow nexus",
> pox.lib.util.dpidToStr(dpid))
>
> _dummyOFNexus = DummyOFNexus()
> ###
>
> The value of "con.ofnexus" is formally set in "handle_request_reply"
> function:
> ###
>   nexus = core.OpenFlowConnectionArbiter.getNexus(con)
>   if nexus is None:
> # Cancel connection
> con.info("No OpenFlow nexus for " +
>  pox.lib.util.dpidToStr(msg.datapath_id))
> con.disconnect()
> return
>   con.ofnexus = nexus
>   con.ofnexus._connect(con)
> ###
>
> So I come up with an idea, I manually set the value of "con.ofnexus". In
> this way, customized "_handle_packet_in" will be triggered:
> ###
> def handle_PACKET_IN (con, msg): #A
>   if con.ofnexus is _dummyOFNexus:
> con.ofnexus = core.OpenFlowConnectionArbiter.getNexus(con)
>   e = con.ofnexus.raiseEventNoErrors(PacketIn, con, msg)
>   if e is None or e.halt != True:
> con.raiseEventNoErrors(PacketIn, con, msg)
> ###
>
> I was wondering if there are some underlying bugs in my modification.  Any
> comments or suggestions are welcomed. Thank you for sharing.
>
> Best wishes.
> Xia
>
>
> At 2018-06-13 13:30:35, "夏瑞"  wrote:
>
> Hello,
> I am trying to redirect `ofp_packet_in` packet among multiple controllers.
> For example, suppose there are two controllers `c1,c2` and one switch `s1`.
> `s1` is assigned to `c1`. Now, `c1` receives a `Packet_In` from switch
> `s1`. Generally, `s1` should dispose of this `Packet_In`. **What I am
> trying to do is to send this `Packet_In` to `c2` and let `c2` process this
> `Packet_In`**.
>
> I am trying to implement my idea by POX, but I got some 

Re: [pox-dev] writing flow rules in intermediate nodes

2017-11-15 Thread Murphy McCauley
First off, in many cases, it doesn't make much sense to think of the
switches as having IP addresses.  Hosts have IP addresses.  There are
exceptions, but... are you sure you're in one of those exceptional cases?
If not, this is just going to be confusing.

That aside, you mention wanting to get packets from n1 to n3.  The entry
you've written there won't help because you have the destination set to
match 10.0.0.2, but IP packets to n3's IP address will always have a
destination of 10.0.0.3.  It's also worth noting that you don't need to
match on the source in order to match packets going to a destination.
Finally, in order to match on IP addresses (at L3), you need to match on
the Ethertype (at L2) to ensure that only IP packets match -- this is
explained in the OpenFlow 1.0 specification.  Off the top of my head, I
think a suitable n1 match is...
fm.match.dl_type = 0x800
fm.match.nw_dst = IPAddr("10.0.0.3") # It's best to explicitly use POX's
IPAddr here

And, indeed, you should be able to use the exact same entry on n2.  For n3,
I think you'll want to change the output port from OFPP_FLOOD to OFPP_LOCAL
if you really do want to deliver the packet to n3's local IP address.

Good luck.

-- Murphy

On Wed, Nov 15, 2017 at 11:25 AM, S hj  wrote:

> Hello,
>
>
>
> I have the following topology and want to install rules in nodes
> (openvswitch nodes) to communicate with each other.
>
> N1(10 .0.0.1) ---
> N2(10.0.0.2)--- N3(10
> .0.0.3)
>
>
>
> each node has another interface to connect to the controller directly.
>
>
> I want to write flow rules to help n2 to forward a packet from n1 to n3.
>
>
> So at first n1 sends a packetIn message to get the rules to communicate
> with n2 as following:
>
> (If the source of packet is n1 and the destination in n2, send the packet
> to the port)
>
> fm= of.ofp_flow_mod()
>
> fm.match.nw_src = “10.0.0.1”
>
> fm.match.nw_dst = “10.0.0.2”
>
> fm.actions.append(of.ofp_action_output(port= of.OFPP_FLOOD)
>
> event.connection.send(fm)
>
>
>
> Then in n2, I want to write a flow rule that if it receive a packet from
> n1 , forward that to n3.
>
> Could you let me know how should I write this rule?
>
>
>
> Thank you
>


Re: [pox-dev] Handling of ARP requests at POX

2015-11-27 Thread Murphy McCauley
On Nov 27, 2015, at 6:14 AM, Ramana Reddy  wrote:
> 
> Hi All,
> 
> I have few concerns while handling arp requests at pox.
> 
> 1. How to handle retransmission of arp reply in case if arp reply is dropped.
> Is there any API which allows to retransmit the packet.

I'm not sure I understand.

How would you know it had been dropped?  And how is this any different than 
traditional Ethernet-like networks?  Packets get dropped by the network.  The 
endhosts typically take care of recovery.

> 2.  In the multi client scenario, how this can be handled ( i.e 
> retransmission to
> the every client)
> 
> Thanks,
> Ramana



Re: [pox-dev] question about output ports

2015-11-25 Thread Murphy McCauley
On Nov 25, 2015, at 12:02 PM, Kostas Chartsias  wrote:
> 
> Fisrtly i know this is most likely a mininet question, but is there an easy 
> way to define which port number is assigned to switch ports other than dpctl 
> dump-flows??
> for example mininet links output for a switch with 3 hosts is 
> s1-eth1
> s2-ethe2
> s3-eth3
> 
> but the output numbers may be different thant 1,2,3 
> (i'd like to try a loop topology with switches,so dpctl dump-flows won't be 
> very helpfull cause of possible broadcast storms)

Yes, you can do this.  IIRC, core.openflow.ports is a collection, and the 
values are OpenFlow port descriptions which contain the interface name as well 
as the OpenFlow port number.  Should be more on this in the manual.

By the way, the openflow.discovery POX component demonstrates one way of 
detecting the topology (and therefore letting you avoid loops -- like the 
spanning_tree component does... which, incidentally, does not use the Spanning 
Tree Protocol at all).

> Secondly is there a way to send a packet from a switch to anothr switch using 
> dpid?
> trying to figure out a way to create static routes and i don't want to use 
> spanning tree protocol

Well, there's a way to send a packet from a switch out of a port.  Whether this 
goes to another switch or not depends. :)

I don't full understand your intended use at this point, but the simple answer 
is that you just create and send an ofp_packet_out from the switch in question. 
 There are multiple ways to do this, most of them require getting the switch's 
Connection object (which there are multiple ways to do; discussed in the 
manual).  There's also core.openflow.sendToDPID(), which just lets you send a 
message (e.g., an ofp_packet_out) to a specific switch.  The manual has various 
examples of this, and the discovery component does this to send the discovery 
messages that it uses to piece together the topology.

> Thanks in advance!

-- Murphy

Re: [pox-dev] Reassembling the fragmented packets at pox

2015-11-25 Thread Murphy McCauley
If you mean that all the fragments of a packet are being sent to POX via 
packet_in messages, then... sure?  Just follow the IP RFC for doing reassembly. 
 (That is, I don't think POX has any specific helpers for doing this, but it's 
not a particularly difficult algorithm if you're not trying to do it at line 
rate, etc.).

-- Murphy

> On Nov 24, 2015, at 3:33 AM, Ramana Reddy  wrote:
> 
> Hi All,
> 
> Is there any way to reassemble the fragmented packets at pox.
> 
> Thanks,
> Ramana



Re: [pox-dev] L2Multi + OpenFlow Discovery

2015-11-25 Thread Murphy McCauley
On Nov 24, 2015, at 6:52 PM, Shen Ting Ang  wrote:

> Hi all,
> 
> Following up from my previous question about POX and fat-tree topologies, 
> I've tried using forwarding.l2multi and openflow.discovery. However, I now 
> run into a slightly different problem: there's only connectivity between 
> several hosts when I run pingall on my Mininet CLI.

I think it should be possible to make this work, but I don't think I've tried 
it recently if ever.  It may take some tweaking of parameters.  I've posted 
some suggested parameters to start with for discovery/spanning_tree on the 
mailing list and possibly in the POX manual.  What are the parameters you're 
using, if any?

> I've also looked up RipL-POX and have tried running it, but it seems that the 
> code was meant to run on an older version of POX and I'm getting all kinds of 
> errors just following the default instructions listed in the github. Or 
> should I find an older version of POX that is RipL compatible...?

That's one possibility.  I also did some work on compatibility a while back.  
If I recall correctly, I forked RipL-POX and I think there's an issue or pull 
request against the original RipL or RipL-POX which describes some of my 
experiences getting things to work with more recent Mininet/POX.  There may 
also be some notes in the POX wiki (I can't remember).

So yeah.  You could go oldschool, but that probably means digging up both old 
Mininet and old POX versions.  Or you could try to start from the work I did a 
year or two ago on getting things running on recent versions again.  I'd do the 
latter (obviously), but I think at least one person has had some semi-recent 
success with the former approach too.

-- Murphy

Re: [pox-dev] VLAN and nicira

2015-11-11 Thread Murphy McCauley
I think you want match.vlan_tci = 10

On Nov 11, 2015, at 4:59 AM, Amer  wrote:

> Dear All
> 
> May you please provide me with an example of using VLAN under nicira flow_mod 
> and match rule.
> 
> I received an error when I used it as the following:
> 
> msg = nx.nx_flow_mod()
> msg.match.dl_vlan = 10 
> 
> "dl_vlan" works only with of_flow_mod()
> 
> Best regards,
> Amer
> 
> Sent from my iPhone



Re: [pox-dev] MPLS match and labels popping

2015-11-08 Thread Murphy McCauley
On Nov 8, 2015, at 8:04 AM, AMER  wrote:

> Dear All
> 
> I would like to ask you about the following match commands and actions
> 
>msg1 = nx.nx_flow_mod()
>msg1.match = nx.nx_match()
>msg1.match.eth_type = pkt.ethernet.MPLS_TYPE   
>msg1.match.mpls_label = 50# host 1 10.0.0.1
>msg1.actions.append(of.ofp_action_output(port = 1))
> 
> The above matches didn't work

I'd suggest trying to narrow down why it doesn't work.  If you remove the label 
match, do all MPLS packets go out port 1?  Have you used Wireshark or something 
to confirm that there are packets that you think should match with label 50?

It's also possible that some MPLS stuff just plain doesn't work with 
current/almost-current OVS, I suppose.  It was added to POX when MPLS support 
was pretty experimental...

> when I tested it in mininet 2.2.1, OvS 2.3.2 , POX is "POX 0.2.0 (carp)"

Carp is pretty old.  I have no memory of whether there are known problems with 
it.

> The push command is:
> 
>msg = nx.nx_flow_mod()
>msg.match.of_eth_src = "00:00:00:00:00:04"
>msg.actions.append(nx.nx_action_push_mpls())
>msg.actions.append(nx.nx_reg_load(dst=nx.OXM_OF_MPLS_LABEL, value=50))
>msg.actions.append(of.ofp_action_output(port = 2))
>core.openflow.sendToDPID(event.dpid, msg)
> 
> Also, when I tried to use pop command as the following I received the down 
> error
> 
>msg1 = nx.nx_flow_mod()
>msg1.match = nx.nx_match()
>msg1.match.eth_type = pkt.ethernet.MPLS_TYPE   
>msg1.match.mpls_label = 50# host 1 10.0.0.1
>msg1.actions.append(nx.nx_action_pop_mpls()) ##<-- POP
>msg1.actions.append(of.ofp_action_output(port = 1))
> 
> The error is:
> 
> POX 0.2.0 (carp) / Copyright 2011-2013 James McCauley, et al.
> INFO:forwarding.l2_mid:Simple NX switch running.
> INFO:core:POX 0.2.0 (carp) is up.
> INFO:openflow.of_01:[00-00-00-00-00-02 1] connected
> INFO:forwarding.l2_mid:2 switches in path
> INFO:openflow.of_01:[00-00-00-00-00-01 2] connected
> INFO:forwarding.l2_mid:1 switches in path
> ERROR:core:Exception while handling OpenFlowNexus!ConnectionUp...
> Traceback (most recent call last):
>   File "/home/alghada/pox/pox/lib/revent/revent.py", line 231, in 
> raiseEventNoErrors
> return self.raiseEvent(event, *args, **kw)
>   File "/home/alghada/pox/pox/lib/revent/revent.py", line 278, in raiseEvent
> rv = event._invoke(handler, *args, **kw)
>   File "/home/alghada/pox/pox/lib/revent/revent.py", line 156, in _invoke
> return handler(self, *args, **kw)
>   File "/home/alghada/pox/pox/forwarding/l2_mid.py", line 110, in 
> _handle_ConnectionUp
> core.openflow.sendToDPID(event.dpid, msg1)
>   File "/home/alghada/pox/pox/openflow/__init__.py", line 353, in sendToDPID
> self._connections[dpid].send(data)
>   File "/home/alghada/pox/pox/openflow/of_01.py", line 692, in send
> data = data.pack()
>   File "/home/alghada/pox/pox/openflow/nicira.py", line 387, in pack
> packed += i.pack()
>   File "/home/alghada/pox/pox/openflow/libopenflow_01.py", line 2036, in pack
> body = self._pack_body()
>   File "/home/alghada/pox/pox/openflow/nicira.py", line 815, in _pack_body
> p = struct.pack('!HHI', self.subtype, self.ethertype, 0) # 4 bytes pad
> error: cannot convert argument to integer

This one is very easy.  pop requires the new Ethertype to be given.

nx_action_pop_mpls(ethertype=0x0800) or something like that will be more likely 
to work (if the packet was IP).

> Any help is appreciated
> 
> Best regards,
> 
> Eng Amer Alghadhban
> COE
> SANS-GCFW
> CEH, SCNP, CCNA



Re: [pox-dev] Nox installation error

2015-10-22 Thread Murphy McCauley
To have any chance of getting help, you probably need to post which version of 
NOX, and the output of configure/make.

Also, the chance of someone else who can help seeing it is probably higher if 
you post on nox-dev instead of pox-dev.

-- Murphy

On Oct 22, 2015, at 2:39 PM, Amer  wrote:

> Dear All
> 
> I am running with the following error while installing NOX 
> 
> lib tool: compile Failed to create '.libs'
> 
> I have Ubuntu 12.04 and I followed the instructions in the website in how to 
> install NOX in Ubuntu 12.04
> 
> Best regards,
> Amer
> 
> Sent from my iPhone



Re: [pox-dev] How to send the whole packet from OVS to pox controller

2015-10-09 Thread Murphy McCauley
There are two major possibilities.

1) Install a low priority table entry that sends to the controller and 
specifies the full payload size (I think this last part is the default, 
actually).

2) Change the default size for packets which miss the table entirely.  The best 
way to do this is simply to add misc.full_payload to your commandline.

-- Murphy

On Oct 8, 2015, at 11:16 PM, Ramana Reddy  wrote:

> Hi all,
> 
> When I parse the packet at the pox, pox is getting only a portion of
> the packet and not the entire packet. How can we get the whole packet
> at the pox.
> 
> Thanks,
> Ramana



Re: [pox-dev] Protocol between multiple POX controllers

2015-10-01 Thread Murphy McCauley
I usually use the messenger component for this.

-- Murphy

On Oct 1, 2015, at 3:42 AM, Ramana Reddy  wrote:

> Hi All,
> 
> Is there any mechanism to transfer data between multiple pox controllers.
> If not, what typical changes we need in the pox code to implement this.
> Any inputs are highly appreciated.
> 
> Thanks & regards,
> Ramana



Re: [pox-dev] pox with flowvisor

2015-09-24 Thread Murphy McCauley
My first guess is that something is wrong with your slice configuration, but 
I'm the wrong person to ask about that (maybe try openflow-discuss?).

If I were trying to debug this, I might...

Capture all the OpenFlow traffic between the controllers and FlowVisor.

Write a simple controller for one slice that just installs a single table entry.

Start up a controller for the second slice that does *nothing*.

If the second controller starting up causes flows to be deleted, check the 
captured OpenFlow traffic.  There should only be a single flow-mod (for the 
first slice).  If there are others, or if you can identify the flow-mod that's 
clearing the tables, then the problem is on the POX side.  If you can't, the 
problem would seem to be on the FlowVisor side (or the switches somehow).

Good luck.

-- Murphy

On Sep 24, 2015, at 7:34 PM, Vishlesh Patel  wrote:

> Hi
> 
> I pox instances are running on different slices of flowvisor: slice1 and 
> slice2. Here is the details:
> 
> traffic between 10.0.0.3 and 10.1.0.3 are hadled by slice1
> traffic between 10.0.0.4 and 10.1.0.4 are hadled by slice2
> 
>  fvctl list-slice-info slice1
> Password:
> {
>   "admin-contact": "admin@slice1",
>   "admin-status": true,
>   "controller-url": "tcp:127.0.0.2:10001",
>   "current-flowmod-usage": 0,
>   "current-rate": 0,
>   "drop-policy": "exact",
>   "recv-lldp": false,
>   "slice-name": "slice1"
> }
> 
> fvctl list-slice-info slice2
> Password:
> {
>   "admin-contact": "admin@slice2",
>   "admin-status": true,
>   "controller-url": "tcp:127.0.0.3:10002",
>   "current-flowmod-usage": 0,
>   "current-rate": 0,
>   "drop-policy": "exact",
>   "recv-lldp": false,
>   "slice-name": "slice2"
> }
> 
> pox controller started in this way:
>  ./pox.py openflow.of_01 --address=127.0.0.2 --port=10001 
> forwarding.new_controller1
> ./pox.py openflow.of_01 --address=127.0.0.3 --port=10002 
> forwarding.new_controller2
> 
> 
> I also used core.openflow.clear_flows_of_connect = False  attribute to 
> disable deleting flowentry when it connects.
> 
> Am i doing any mistake here in configuring flowspace?
> Here is the configured flowspace in flowvisor:
>> Configured Flow entries:
>> {“force-enqueue”: -1, “name”: “dpid2-flow1”, “slice-action”: [{“slice-name”: 
>> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:02”, “id”: 15, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.0.0.3”, “nw_dst”: “10.1.0.3”}}
>> {“force-enqueue”: -1, “name”: “dpid3-flow1”, “slice-action”: [{“slice-name”: 
>> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:03”, “id”: 19, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.0.0.3”, “nw_dst”: “10.1.0.3”}}
>> {“force-enqueue”: -1, “name”: “dpid2-flow2”, “slice-action”: [{“slice-name”: 
>> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:02”, “id”: 21, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.1.0.3”, “nw_dst”: “10.0.0.3”}}
>> {“force-enqueue”: -1, “name”: “dpid3-flow2”, “slice-action”: [{“slice-name”: 
>> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:03”, “id”: 22, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.1.0.3”, “nw_dst”: “10.0.0.3”}}
>> {“force-enqueue”: -1, “name”: “dpid1-flow1”, “slice-action”: [{“slice-name”: 
>> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:01”, “id”: 25, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.0.0.3”, “nw_dst”: “10.1.0.3”}}
>> {“force-enqueue”: -1, “name”: “dpid1-flow2”, “slice-action”: [{“slice-name”: 
>> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:01”, “id”: 26, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.1.0.3”, “nw_dst”: “10.0.0.3”}}
>> {“force-enqueue”: -1, “name”: “dpid1-flow3”, “slice-action”: [{“slice-name”: 
>> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:01”, “id”: 29, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.0.0.4”, “nw_dst”: “10.1.0.4”}}
>> {“force-enqueue”: -1, “name”: “dpid1-flow4”, “slice-action”: [{“slice-name”: 
>> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:01”, “id”: 30, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.1.0.4”, “nw_dst”: “10.0.0.4”}}
>> {“force-enqueue”: -1, “name”: “dpid2-flow3”, “slice-action”: [{“slice-name”: 
>> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:02”, “id”: 31, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.0.0.4”, “nw_dst”: “10.1.0.4”}}
>> {“force-enqueue”: -1, “name”: “dpid3-flow3”, “slice-action”: [{“slice-name”: 
>> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
>> “00:00:00:00:00:00:00:03”, “id”: 32, “match”: {“wildcards”: 3145983, 
>> “nw_src”: “10.0.0.4”, “nw_dst”: “10.1.0.4”}}
>> {“force-enqueue”: -1, “name”: 

Re: [pox-dev] pox with flowvisor

2015-09-23 Thread Murphy McCauley
If the POX instances are running on different FlowVisor slices, I wouldn't 
think the POX for one slice would be able to delete entries on the other.

-- Murphy

On Sep 23, 2015, at 8:29 PM, Vishlesh Patel  wrote:

> Hi all,
> 
> I am using pox with flowvisor. I have 3 switch connected with 2 pox 
> controller thorugh proxy flowvisor controller. When i start 2nd controller, 
> It deletes all flow entry installed by the first controller. Is there any way 
> I can stop 2nd controller to delete flow entries in ovs ? May be changing 
> some code in my home pox repo.
> 
> My flowspace is something like this:
> 
> Configured Flow entries:
> {“force-enqueue”: -1, “name”: “dpid2-flow1”, “slice-action”: [{“slice-name”: 
> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:02”, “id”: 15, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.0.0.3”, “nw_dst”: “10.1.0.3”}}
> {“force-enqueue”: -1, “name”: “dpid3-flow1”, “slice-action”: [{“slice-name”: 
> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:03”, “id”: 19, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.0.0.3”, “nw_dst”: “10.1.0.3”}}
> {“force-enqueue”: -1, “name”: “dpid2-flow2”, “slice-action”: [{“slice-name”: 
> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:02”, “id”: 21, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.1.0.3”, “nw_dst”: “10.0.0.3”}}
> {“force-enqueue”: -1, “name”: “dpid3-flow2”, “slice-action”: [{“slice-name”: 
> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:03”, “id”: 22, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.1.0.3”, “nw_dst”: “10.0.0.3”}}
> {“force-enqueue”: -1, “name”: “dpid1-flow1”, “slice-action”: [{“slice-name”: 
> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:01”, “id”: 25, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.0.0.3”, “nw_dst”: “10.1.0.3”}}
> {“force-enqueue”: -1, “name”: “dpid1-flow2”, “slice-action”: [{“slice-name”: 
> “slice1”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:01”, “id”: 26, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.1.0.3”, “nw_dst”: “10.0.0.3”}}
> {“force-enqueue”: -1, “name”: “dpid1-flow3”, “slice-action”: [{“slice-name”: 
> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:01”, “id”: 29, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.0.0.4”, “nw_dst”: “10.1.0.4”}}
> {“force-enqueue”: -1, “name”: “dpid1-flow4”, “slice-action”: [{“slice-name”: 
> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:01”, “id”: 30, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.1.0.4”, “nw_dst”: “10.0.0.4”}}
> {“force-enqueue”: -1, “name”: “dpid2-flow3”, “slice-action”: [{“slice-name”: 
> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:02”, “id”: 31, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.0.0.4”, “nw_dst”: “10.1.0.4”}}
> {“force-enqueue”: -1, “name”: “dpid3-flow3”, “slice-action”: [{“slice-name”: 
> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:03”, “id”: 32, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.0.0.4”, “nw_dst”: “10.1.0.4”}}
> {“force-enqueue”: -1, “name”: “dpid2-flow4”, “slice-action”: [{“slice-name”: 
> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:02”, “id”: 33, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.1.0.4”, “nw_dst”: “10.0.0.4”}}
> {“force-enqueue”: -1, “name”: “dpid3-flow4”, “slice-action”: [{“slice-name”: 
> “slice2”, “permission”: 7}], “queues”: [], “priority”: 100, “dpid”: 
> “00:00:00:00:00:00:00:03”, “id”: 34, “match”: {“wildcards”: 3145983, 
> “nw_src”: “10.1.0.4”, “nw_dst”: “10.0.0.4”}}
> 
> Please help! Thanks in advance.
> 
> Best,
> Vishlesh Patel
> vishlesh.pate...@gmail.com
> 
> Best Regards,
> Vishlesh Patel
> M.S. Computer Engineering
> NYU Polytechnic School of Engineering



Re: [pox-dev] ARP_Responder

2015-09-14 Thread Murphy McCauley
Can you give more information?

What is the complete POX commandline you're using?  Have you made any 
modifications?  What exact behavior are you seeing (who is sending what ARP 
requests, who is sending what ARP replies, and who is receiving the requests 
and replies)?  What exact behavior are you expecting?

-- Murphy

On Sep 13, 2015, at 8:09 PM, Talal Alharbi  wrote:

> Dear All, 
> 
> When I run arp_responder component, and send ARP it works first as it is 
> described but I saw it is flooding ARP reply when the host Reply.  why ? 
> 
> Cheers, 
> Talal



Re: [pox-dev] Fwd: Content based HTTP load balancer

2015-09-03 Thread Murphy McCauley
If I were doing it, I would seriously consider whether there was a reason to 
implement something myself using OpenFlow rather than using an existing HTTP 
proxy/load balancer (or modifying an existing one).

Good luck.

-- Murphy

On Sep 3, 2015, at 9:23 AM, Ramana Reddy  wrote:

> Hi All,
> 
> I would like to implement a content based load balancer for http packets.
> I want to parse the payload, and see the content ( method and file name) 
> and redirect the packet to the respective server. Any material or code in
> this regards is really appreciated.
> 
> Thanks,
> Ramana
> 



Re: [pox-dev] Riplpox with large topology

2015-09-02 Thread Murphy McCauley
Well, IIRC, riplpox stuffs topology-specific addresses into the VLAN header.  
It's possible that at larger sizes, there aren't enough bits (or that they're 
not allocated correctly).

-- Murphy

On Sep 2, 2015, at 7:47 PM, Amer <amer7...@hotmail.com> wrote:

> Thank you Murphy
> Yes, it is working correctly with the default number of host (i.e., 16 hosts).
> 
> Best regards,
> Amer 
> 
> Sent from my iPhone
> 
> On Sep 3, 2015, at 4:00 AM, Murphy McCauley <murphy.mccau...@gmail.com> wrote:
> 
>> Did it work correctly with a smaller number of hosts before modification?
>> 
>> On Wednesday, September 2, 2015, Amer <amer7...@hotmail.com> wrote:
>> Dear All
>> 
>> The default number of hosts in riplpox is 16. I modified some commands in 
>> dctopo.py in ripl folder to get the needed number of hosts. Accordingly, the 
>> riplpox recognize this increase and inserts the required flow-entries when I 
>> run it in proactive mode. Unfortunately, the added hosts can't ping each 
>> other. For example, hosts 0_0_2 can't ping the added host 0_0_4, at the same 
>> time, host 0_0_2 can ping 0_0_3.
>> The flow-entries of all the hosts are installed in the flow-table, when I 
>> checked the flow-table of the switches. Also, I tried with reactive and the 
>> same problem was faced.
>> 
>> Any body has a suggestion to solve this issue.
>> 
>> Best regards,
>> Amer



Re: [pox-dev] Error while setting up PoX controller with GENI-based fat-tree topology

2015-08-16 Thread Murphy McCauley
Meaning you no longer get errors, but can't communicate between hosts anyway?  
You might try upgrading to the eel branch of POX.

But, really, none of the forwarding components that come with POX are well 
suited to fat trees.  You'd be much better off writing one that not only 
*deals* with loops, but *expects* them.

-- Murphy

On Aug 16, 2015, at 1:23 AM, Sadia Bashir 11msccssbas...@seecs.edu.pk wrote:

 Hi Murphy, 
 
 Thanks a lot for your suggestion. The problem is resolved now after I used 
 the following command to run PoX on the controller node:
 ./pox.py forwarding.l2_learning openflow.discovery --eat-early-packets 
 openflow.spanning_tree --no-flood --hold-down
 
 by following this link but still hosts are unable to communicate. 
 
 
 
 On Sun, Aug 16, 2015 at 2:51 AM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Pleases see the I'm seeing many packet_in messages and forwarding isn't 
 working; what gives? and Does POX support topologies with loops? questions 
 in the FAQ.
 
 -- Murphy
 
 On Aug 15, 2015, at 2:11 AM, Sadia Bashir 11msccssbas...@seecs.edu.pk wrote:
 
 Hello, 
 
 I have set up fat-tree topology using InstaGENI aggregate, pls see file 
 attached for more detail. 
 
 I am setting up edge, aggregate and core switches using following set of 
 commands:
 
 ovs-vsctl add-br br0
 ifconfig eth1 0
 ifconfig eth2 0
 ifconfig eth3 0
 ifconfig eth4 0
 ovs-vsctl list-br
 ovs-vsctl add-port br0 eth1
 ovs-vsctl add-port br0 eth2
 ovs-vsctl add-port br0 eth3
 ovs-vsctl add-port br0 eth4
 ovs-vsctl list-ports br0
 ifconfig eth1 0 up
 ifconfig eth2 0 up
 ifconfig eth3 0 up
 ifconfig eth4 0 up
 ovs-vsctl set-controller br0 tcp:controller IP:6633
 ovs-vsctl set bridge br0 protocols=OpenFlow10
 ovs-vsctl set-fail-mode br0 secure
 
 I have set up a POX(dart) controller with public IP and running 
 forwarding.l2_learning on it:
 ./pox.py log.level --DEBUG pox.forwarding.l2_learning
 
 all edge, aggregate and core nodes are running ovs 2.3.1 version. 
 
 But firstly, I am not able to ping/iperf between two hosts and secondly, the 
 controller runs with this error: 
 
 ERROR:openflow.of_01:[62-75-7f-15-b9-4d 14] OpenFlow Error:
 [62-75-7f-15-b9-4d 14] Error: header:
 [62-75-7f-15-b9-4d 14] Error:   version: 1
 [62-75-7f-15-b9-4d 14] Error:   type:1 (OFPT_ERROR)
 [62-75-7f-15-b9-4d 14] Error:   length:  36
 [62-75-7f-15-b9-4d 14] Error:   xid: 118250
 [62-75-7f-15-b9-4d 14] Error: type: OFPET_BAD_REQUEST (1)
 [62-75-7f-15-b9-4d 14] Error: code: OFPBRC_BUFFER_UNKNOWN (8)
 [62-75-7f-15-b9-4d 14] Error: datalen: 24
 [62-75-7f-15-b9-4d 14] Error: : 01 0d 00 18 00 01 cd ea  00 00 05 d4 00 
 02 00 08   ||
 
 Any help/suggestion to fix this issue is much appreciated. OR if anyone in 
 the list has experience with setting up GENI topologies can point a problem 
 in the steps I am following. PS the same steps work fine with simple 
 GENI-topology(3 hosts, 1 switch, 1 controller). 
 
 
 Thank you, 
 Sadia Bashir
 
 -- 
 
  
 GENI Final Fat-tree Topology.png
 
 
 
 
 -- 
 
  



Re: [pox-dev] Error while setting up PoX controller with GENI-based fat-tree topology

2015-08-15 Thread Murphy McCauley
Pleases see the I'm seeing many packet_in messages and forwarding isn't 
working; what gives? and Does POX support topologies with loops? questions 
in the FAQ.

-- Murphy

On Aug 15, 2015, at 2:11 AM, Sadia Bashir 11msccssbas...@seecs.edu.pk wrote:

 Hello, 
 
 I have set up fat-tree topology using InstaGENI aggregate, pls see file 
 attached for more detail. 
 
 I am setting up edge, aggregate and core switches using following set of 
 commands:
 
 ovs-vsctl add-br br0
 ifconfig eth1 0
 ifconfig eth2 0
 ifconfig eth3 0
 ifconfig eth4 0
 ovs-vsctl list-br
 ovs-vsctl add-port br0 eth1
 ovs-vsctl add-port br0 eth2
 ovs-vsctl add-port br0 eth3
 ovs-vsctl add-port br0 eth4
 ovs-vsctl list-ports br0
 ifconfig eth1 0 up
 ifconfig eth2 0 up
 ifconfig eth3 0 up
 ifconfig eth4 0 up
 ovs-vsctl set-controller br0 tcp:controller IP:6633
 ovs-vsctl set bridge br0 protocols=OpenFlow10
 ovs-vsctl set-fail-mode br0 secure
 
 I have set up a POX(dart) controller with public IP and running 
 forwarding.l2_learning on it:
 ./pox.py log.level --DEBUG pox.forwarding.l2_learning
 
 all edge, aggregate and core nodes are running ovs 2.3.1 version. 
 
 But firstly, I am not able to ping/iperf between two hosts and secondly, the 
 controller runs with this error: 
 
 ERROR:openflow.of_01:[62-75-7f-15-b9-4d 14] OpenFlow Error:
 [62-75-7f-15-b9-4d 14] Error: header:
 [62-75-7f-15-b9-4d 14] Error:   version: 1
 [62-75-7f-15-b9-4d 14] Error:   type:1 (OFPT_ERROR)
 [62-75-7f-15-b9-4d 14] Error:   length:  36
 [62-75-7f-15-b9-4d 14] Error:   xid: 118250
 [62-75-7f-15-b9-4d 14] Error: type: OFPET_BAD_REQUEST (1)
 [62-75-7f-15-b9-4d 14] Error: code: OFPBRC_BUFFER_UNKNOWN (8)
 [62-75-7f-15-b9-4d 14] Error: datalen: 24
 [62-75-7f-15-b9-4d 14] Error: : 01 0d 00 18 00 01 cd ea  00 00 05 d4 00 
 02 00 08   ||
 
 Any help/suggestion to fix this issue is much appreciated. OR if anyone in 
 the list has experience with setting up GENI topologies can point a problem 
 in the steps I am following. PS the same steps work fine with simple 
 GENI-topology(3 hosts, 1 switch, 1 controller). 
 
 
 Thank you, 
 Sadia Bashir
 
 -- 
 
  
 GENI Final Fat-tree Topology.png



Re: [pox-dev] Multiple POX controller setup

2015-07-24 Thread Murphy McCauley
None of the example forwarding components that ship with POX contain any 
special features to facilitate distribution.

-- Murphy

On Jul 24, 2015, at 2:25 AM, Sulabh Deshmukh sulabh02.deshm...@gmail.com 
wrote:

 Hello Experts,
 
 
 I recently started working with the POX and currently experimenting with the 
 robustness of the SDN controllers.
 
 I have few questions regarding the same.
 
 How to setup the multiple POX controllers for the created topology.? I did 
 not find any documentation mentioning the setup procedure. I also searched 
 the archive mail list but could not get the steps to do that. 
 
 Even though I could find that few blogs mentioning about the setup in the 
 mini net environment, I am not using the mininet. We have our one setup 
 environment with the open vswitch on each separate server. 
 
 
 Can someone please guide me to the right documentation for setting up the two 
 or more POX controllers.? Also, I would like to know when two controllers are 
 set up  how do they communicate the states with each other? Will it be done 
 internally or user have to do an extra setup ?
 
 Any help in the regard is highly appreciated.
 
 
 Thanks in advance !!
 
 //Best Regards,
 Sulabh 
 Graduate Student 
 Delft University of Technology 
 2628CD, Delft,Netherlands
 



Re: [pox-dev] Multipath using MPLS

2015-07-16 Thread Murphy McCauley
I think you have two requirements here.
1) You need to be able to push and pop MLPS labels on a packet.
2) You need to be able to create table entries which match on the MPLS label.

If I remember correctly, both of these are available in POX through the 
nicira.py file.  The first is done with some extended actions.  The other one 
is done using the Nicira match extension (NXM).

-- Murphy

On Jul 16, 2015, at 9:49 AM, Suelen Cremonini suelen_cremon...@hotmail.com 
wrote:

 Hello everybody,
 
 We are trying to make a POX controller using MPLS labels. Our intention is to 
 implement multi-path according to the packets label. We are using the nicira 
 extension for that. 
 We have to apply different labels inside a same switch for packets that have 
 the same source and the same destination. However, there is no match field 
 that we can use to apply different labels in the same switch. Any ideas?
 
 
 --
 Best regards,
 Suelen



Re: [pox-dev] How do i interface the POX Controller with the OVS switches

2015-07-16 Thread Murphy McCauley
Sounds like you need to configure Open vSwitch to create OpenFlow 1.0 
connections to your controller.  This involves something roughly like...

ovs-vsctl set-controller your-switch-name tcp:controller-ip:6333

ovs-vsctl set bridge your-switch-name protocols=OpenFlow10

.. but you should probably refer to the Open vSwitch documentation.

-- Murphy

On Jul 16, 2015, at 9:20 AM, Sanghamitra De sanghamitra...@gmail.com wrote:

 Hi,
 when trying to install pox in a node which is already installed with OVS i 
 have run the following commands:
 
 ~$ git clone http://github.com/noxrepo/pox
 ~$ cd pox
 
 ./pox.py --verbose forwarding.l2_learning
 The output should have looked like this:
 
 POX 0.1.0 (betta) / Copyright 2011-2013 James McCauley, et al.
 DEBUG:core:POX 0.1.0 (betta) going up...
 DEBUG:core:Running on CPython (2.7.3/Apr 20 2012 22:39:59)
 DEBUG:core:Platform is Linux-3.2.0-56-generic-x86_64-with-Ubuntu-12.04-precise
 INFO:core:POX 0.1.0 (betta) is up.
 DEBUG:openflow.of_01:Listening on 0.0.0.0:6633
 INFO:openflow.of_01:[9e-38-3e-8d-42-42 1] connected
 DEBUG:forwarding.l2_learning:Connection [9e-38-3e-8d-42-42 1]
 
 instead i am getting only upto:
 DEBUG:openflow.of_01:Listening on 0.0.0.0:6633
 
 The setup i am working on requires the OVS node to behave as an L2 switch to 
 connect a no. of nodes. However, i need a router or L3 device to connect 
 different such L2 switches as the one which is the OVS installed switch. For 
 that purpose i am trying to use one of the OVS installed nodes as both an L2 
 switch and a L3 router (by installing POX controller in it)
 
 
 My query is: 
 
  How do i interface the Controller with the switches (i.e OVS nodes).  Let me 
 know the commands. Thanks!!
 
 
 
 Sanghamitra
 



Re: [pox-dev] Priority doesnt change

2015-07-12 Thread Murphy McCauley
Sure, it's a different project.  But that thread describes the most common 
reason for failure when trying to assign priorities.  And my final post gives a 
couple suggestions as to how to resolve it.

-- Murphy

On Jul 12, 2015, at 5:22 PM, Anees Mohsin Hadi Al-Najjar 
a.alnajj...@uq.edu.au wrote:

 Dear Murphy,
This Guy is working with another project. I tried to set different 
 priorities to flows because I need to work with different flows, but it 
 doesn’t work. All of the priorities are set to default.
  
 Could you help me?
  
 Thanks,
Anees
  
 From: Murphy McCauley [mailto:murphy.mccau...@gmail.com] 
 Sent: Friday, 10 July 2015 2:18 PM
 To: Anees Mohsin Hadi Al-Najjar
 Cc: pox-dev@lists.noxrepo.org
 Subject: Re: [pox-dev] Priority doesnt change
  
 Does this thread from the archive answer your question?
  
 https://www.mail-archive.com/pox-dev@lists.noxrepo.org/msg01838.html
  
 -- Murphy
  
 On Jul 9, 2015, at 9:15 PM, Anees Mohsin Hadi Al-Najjar 
 a.alnajj...@uq.edu.au wrote:
 
 
 Dear Colleagues,
 
   In my controller, I applied different priorities to rules. However, when I 
 did dump-flows on switch, I noticed that all the priorities are the same. 
 Could you please tell me what should I do to change the priorities in POX?
 
 Thanks,
   Anees



Re: [pox-dev] Raise event for ofp_packet_out

2015-07-10 Thread Murphy McCauley
If you wanted to try to do it for arbitrary unmodified components, I don't see 
too much alternative to Connection.send().  Unfortunately, there's no 
requirement that it gets passed  message objects instead of raw bytes, and if 
it's passed raw bytes, there's no requirement that they be complete messages, 
etc., so doing this very reliably will be difficult.  On the other hand, 
catching a large percentage of cases should be pretty easy.

-- Murphy

On Jul 10, 2015, at 8:35 PM, Dylan Thomas gth44...@gmail.com wrote:

 Hi all,
 
 I want to add a component which can either read or  intercept ofp_packet_out 
 messages sent by other POX components.
 Where would the most appropriate place to raise an event? Connection.send() 
 seems like a good spot, maybe?
 
 Thanks,
 Dylan



Re: [pox-dev] Priority doesnt change

2015-07-09 Thread Murphy McCauley
Does this thread from the archive answer your question?

https://www.mail-archive.com/pox-dev@lists.noxrepo.org/msg01838.html

-- Murphy

On Jul 9, 2015, at 9:15 PM, Anees Mohsin Hadi Al-Najjar a.alnajj...@uq.edu.au 
wrote:

 Dear Colleagues,
 
   In my controller, I applied different priorities to rules. However, when I 
 did dump-flows on switch, I noticed that all the priorities are the same. 
 Could you please tell me what should I do to change the priorities in POX?
 
 Thanks,
   Anees



Re: [pox-dev] Packet_In Packet_out

2015-07-01 Thread Murphy McCauley
Can you post a minimal working example that demonstrates the problem?

On Wednesday, July 1, 2015, Anees Mohsin Hadi Al-Najjar 
a.alnajj...@uq.edu.au wrote:


Dear Guys,
I,ve faced a problem when I sent an ARP request as a Packet out of
 the controller. Instead to send the packet out via port =of.OFPP_IN_PORT,
 I directed the packet to specific port, which is #3, in a switch has three
 ports. I noticed that the packet that I sent has been sent three times as
 an ARP packet request, and I received three packets  ARP reply which is
 unacceptable from networking point of view.
Could you possibly how can I resolve this problem?

Thanks a lot,
  Anees Al-Najjar


Re: [pox-dev] ICMP type packet

2015-06-29 Thread Murphy McCauley
The proto.pong component replies to pings. Actually, it replies to *all* ICMP messages. Here's an untested quick hack at very slightly modifying it so that it's a bit more discerning.# Copyright 2012 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


A simple component that always replies to ARPs and pings.

When running this component, pings (and pretty much nothing else!)
should always work.


from pox.core import core
import pox.openflow.libopenflow_01 as of
import pox.lib.packet as pkt
from pox.lib.addresses import EthAddr

log = core.getLogger()


def _handle_PacketIn (event):
  packet = event.parsed

  if packet.find(arp):
# Reply to ARP
a = packet.find(arp)
if a.opcode == a.REQUEST:
  r = pkt.arp()
  r.hwtype = a.hwtype
  r.prototype = a.prototype
  r.hwlen = a.hwlen
  r.protolen = a.protolen
  r.opcode = r.REPLY
  r.hwdst = a.hwsrc
  r.protodst = a.protosrc
  r.protosrc = a.protodst
  r.hwsrc = EthAddr(02:00:DE:AD:BE:EF)
  e = pkt.ethernet(type=packet.type, src=r.hwsrc, dst=a.hwsrc)
  e.payload = r

  msg = of.ofp_packet_out()
  msg.data = e.pack()
  msg.actions.append(of.ofp_action_output(port = of.OFPP_IN_PORT))
  msg.in_port = event.port
  event.connection.send(msg)

  log.info(%s ARPed for %s, r.protodst, r.protosrc)

  elif packet.find(icmp):
if packet.find(icmp).type == pkt.TYPE_ECHO_REQUEST:
  # Reply to pings

  # Make the ping reply
  icmp = pkt.icmp()
  icmp.type = pkt.TYPE_ECHO_REPLY
  icmp.payload = packet.find(icmp).payload

  # Make the IP packet around it
  ipp = pkt.ipv4()
  ipp.protocol = ipp.ICMP_PROTOCOL
  ipp.srcip = packet.find(ipv4).dstip
  ipp.dstip = packet.find(ipv4).srcip

  # Ethernet around that...
  e = pkt.ethernet()
  e.src = packet.dst
  e.dst = packet.src
  e.type = e.IP_TYPE

  # Hook them up...
  ipp.payload = icmp
  e.payload = ipp

  # Send it back to the input port
  msg = of.ofp_packet_out()
  msg.actions.append(of.ofp_action_output(port = of.OFPP_IN_PORT))
  msg.data = e.pack()
  msg.in_port = event.port
  event.connection.send(msg)

  log.debug(%s pinged %s, ipp.dstip, ipp.srcip)


def launch ():
  core.openflow.addListenerByName(PacketIn, _handle_PacketIn)

  log.info(Pong component running.)
-- MurphyOn Jun 29, 2015, at 10:07 PM, Anees Mohsin Hadi Al-Najjar a.alnajj...@uq.edu.au wrote:Dear All, I’m new with POX. I’m trying to write manually an ICMP reply packet. Could you possibly inform me How I can check the type of ICMP packet is echo-request? I find it difficult because there is no payload in ofp_matchThanks Anees Al-Najjar

Re: [pox-dev] Set Priority on Flow Rules

2015-06-28 Thread Murphy McCauley
In plain OpenFlow 1.0, this isn't possible because l2_learning installs exact 
matches, which have maximum priority.  There are at least two ways to fix this:

1) Don't install exact matches for normal learning.  This is pretty reasonable, 
actually.  l2_pairs, for example, installs rules that just match Ethernet 
addresses.  These matches can be at whatever priority you want.

2) If you're using a switch which has Nicira extensions (e.g., Open vSwitch), 
you can take advantage of multiple tables.  Have l2_learning install its 
entries into table 1.  Put a low priority wildcard entry into table 0 that just 
resubmits to table 1.  So normal traffic will hit that wildcard entry and go 
to table 1 and then be processed as usual.  Then put whatever exceptional 
entries you want in table 0 too.  They'll always be matched before the ones 
installed into table 1.

-- Murphy

On Jun 28, 2015, at 5:59 PM, Talal Alharbi tal...@hotmail.com wrote:

 I have already looked at it before and did not work because I need higher 
 priority than rules installed by l2_learning after ping.   
 From: sul...@gmail.com
 Date: Sun, 28 Jun 2015 20:19:31 -0400
 Subject: Re: [pox-dev] Set Priority on Flow Rules
 To: tal...@hotmail.com
 CC: pox-dev@lists.noxrepo.org
 
 You can find some clues in the documentation here: 
 https://openflow.stanford.edu/display/ONL/POX+Wiki#POXWiki-OpenFlowMessages
 
 Straight from the documentation:
 priority (int) - the priority at which a rule will match, higher numbers 
 higher priority. Note: Exact matches will have highest priority.
 
 On Sun, Jun 28, 2015 at 8:12 PM, Talal Alharbi tal...@hotmail.com wrote:
 Dear All, 
 
 I need to a high priority to the rules I would like to preformed first. I 
 have tried different values but none of them work. Could you please advise me 
 ?
 
 Cheers, 
 Talal



Re: [pox-dev] ARP in L2_learning

2015-06-23 Thread Murphy McCauley
This would probably be easier if you posted the details of the four packets.

-- Murphy

On Jun 23, 2015, at 6:54 PM, Talal Alharbi tal...@hotmail.com wrote:

 Dear All, 
 
 Running a test on L2_learning module and trying to send an ARP packet from a 
 host using Scapy. After sending an ARP request from host#1 to host#2,  I 
 checked Wireshark and I have found 4 packets: 
 
 1- Broadcast ARP request  
 2- Unicast ARP reply 
 3- Unicast ARP request 
 4- Unicast ARP reply
 
 Why  do I have the third packet? Who is sending it ?  I used scapy command: 
 arp = ARP(op=1, psrc=host1, pdst=host2, hwdst= mac address of host2)
 Cheers, 
 Talal



Re: [pox-dev] L2_Learning POX

2015-06-16 Thread Murphy McCauley
Usually if you want to do something when switches disconnect, you do it by 
registering a handler for the ConnectionDown event on pox.core.openflow, as 
described in the OpenFlow Events section of the manual.

You haven't given enough information to know for sure, but if what you want is 
to do something when POX shuts down (which isn't the same thing as when 
switches disconnect, but is what happens when you do Ctrl+C), you do this by 
registering a handler for GoingDownEvent on pox.core.

If you really want to put a print statement before the message you mention, 
you're looking in the wrong place -- it's not in l2_learning.  As the log 
message states, this message comes from openflow.of_01.  Which is 
pox/openflow/of_01.py.  It's a log message in the Connection.disconnect() 
method.

Also, you might consider using a log message instead of a print statement.  
Doing so is incredibly easy in POX, and there are a number of advantages.

-- Murphy

On Jun 15, 2015, at 11:08 PM, Talal Alharbi tal...@hotmail.com wrote:

 Hi All, 
 
 I need to place a print statement before discounting switches. When you press 
 Ctrl+C and the component stops, there is a message  
 INFO:openflow.of_01:[00-00-00...] disconnected. I want to place the print 
 statement before this line. I could not find where that is in the 
 code(l2_learning)
 
 Cheers,



Re: [pox-dev] ports in pox

2015-06-03 Thread Murphy McCauley
Looking at page 6 and 19 of the OpenFlow spec, you can see that it's done via 
the local port.  On POX, this means creating an output action to the 
OFPP_LOCAL virtual port.

-- Murphy

On Jun 3, 2015, at 3:32 AM, AMER amer7...@hotmail.com wrote:

 Hello,
 
 Dear All
 
 I would like to build a switch to switch communication, however, I am facing 
 some problem in output port action
 how can I forward a received packet to the local network stack.
 
 Best regards,
 
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA



Re: [pox-dev] Help Regarding Flow Statistics Module

2015-06-03 Thread Murphy McCauley
The statistics that you gather are specific to the table entries that you 
install.  If you have table entries for each address, you should get back flow 
stats for each entry and therefore each address...

-- Murphy

On Jun 3, 2015, at 2:19 AM, Tom Mody bug29...@gmail.com wrote:

 Hi all,
 
 I am presently working on a project involving Openflow's POX . I need to 
 collect total no. of packets flowing through a  link  . 
 Eg. To know the no. of packet flowing from host'h1' to 'h2' or from 'h1' to 
 switch 's0'
 
  I have used the following function defined in POXWiki :
 
  _handle_flowstats_received (event) 
 
 but am only successful in retrieving the total packets transferred through a 
 switch ( 's0')
  I am unable to collect packets from switch based on Addresses ,
 
 Can anyone help ?
 If anyone has a link to a tutorial ,, please post it..
 
 Thanks in Advance



Re: [pox-dev] l2_learning flow installation

2015-05-27 Thread Murphy McCauley
On May 27, 2015, at 2:29 PM, Adam Pavlidis adampavli...@gmail.com wrote:

 Are you using l2_learning and only l2_learning?
  
 I am using  l2_learning, log.level with --DEBUG flag, and a custom module 
 that only handles Flow Removed events (only to print them)
 
 
 
 Are you sure?  Try monitoring the OpenFlow connection to the controller 
 (this can be done with Wireshark, for example, or with a little 
 modification to POX).  Do you see packet-ins with the ARPs in them?
 
 Sorry you are right, by using Wireshark with OF dissector i see the packet 
 In messages containing arp. 
 However, since the hosts don't exchange ARP Messages, but POX receives 
 Packet In messages were do these messages come from? 
 Also,
 why the ARP request packets encapsulated in Packet In target a specific
 MAC, as opposed to usual ARP request targeting every MAC? Is it a 
 keep-alive like mechanism for ARP Cache entries, or am i way off base?
 
 Are you sure they're not?  You've inspected the right interfaces with 
 Wireshark or whatever?  I am guessing they are there.  (And that Linux's ARP 
 logic is not as straightforward as one might imagine.)
 
 Well i was certain initially, but now i have some doubts that i did not do 
 something wrong in tcpdump. Now that i used wireshark not only to dissect the 
 OF messages but to inspect the OF Bridge interfaces i was proved wrong 
 again...
 I guess i got carried away by me expectation not to sent/receive messages for 
 a host with an already known MAC and perhaps i terminated the capture 
 prematurely.
 Seems like this is a Linux ARP logic matter as you said. I will search 
 further on that direction.

If you find a nice reference on the ARP logic used, let me know.  I'm always 
telling people it's not as simple as they think, but never have anything good 
to point them at. :)  (For the record, the only reason I know this is because I 
saw it so often due to working on POX!)

 Sorry for bothering you with this, and thanks again for all your help

-- Murphy

Re: [pox-dev] A flow removal question

2015-05-26 Thread Murphy McCauley
The information you want may not be available on the FlowRemoved event object 
itself, but as described in the OpenFlow Events section of the manual, the 
actual OpenFlow protocol message that caused the event is available on the 
event's .ofp attribute.  In this case, that means it's an ofp_flow_removed 
object.  If you look that up in the OpenFlow spec, you'll see there should be a 
.match attribute containing the match for the table entry as well as the 
.cookie (which, as I mention in my post on pox-dev a few minutes ago, is 
probably even more useful).

-- Murphy

On May 26, 2015, at 5:06 PM, David Li dlipub...@gmail.com wrote:

 Hi,
 
 I added a handler for flow removal. But I am wondering if it's
 possible to see from the event which flow has been removed. In the
 FlowRemoved class, I can't see how this info can be obtained easily.
 Maybe I am wrong.



Re: [pox-dev] help with priorities

2015-05-16 Thread Murphy McCauley
I think you're probably using l2_learning, which installs exact match table 
entries.  In OpenFlow, exact matches always have maximum priority -- you can't 
override it.

Here are some options for getting around the problem:
1. Make the exceptional table entries you install *also* be at maximum 
priority, overriding the ones that l2_learning installed.
2. If you're using Open vSwitch, use the multiple table extension.  Put your 
exceptional entries in table 0 and have l2_learning install into table 1.  Have 
a lowest-priority match-all entry in table 0 just submit to table 1.
3. Don't install exact matches to begin with; do something more like l2_pairs.

Good luck.

-- Murphy

On May 16, 2015, at 9:00 AM, Kostas Chartsias kcharts...@yahoo.gr wrote:

 another question and thanks for the support,Murphy you rule !!!
 
 I modify the L2_switch and i install flow rules after an event 
 accurs.Everything works fine,but there is a problem.
 When it behaves as normal switch it installs rules with maximum priority 
 65535 even though i set msg.priotiry a low value .It seams as i can't change 
 the flows priority for the switch,so i have to wait until timeouts expire and 
 the new flows from my event will work.Have you experienced similare thing 
 with overlapping flow matches?
 
 p.s. i used dpctl and i saw the flow of the switch always 65535,and the 
 others with my lower priority
 
 (i only added priority in the openflow mod message which installs flows,above 
 default switch timeouts)
 
 Thanks in advance!!!
 



Re: [pox-dev] How to use popen to send parallel iperf?

2015-05-15 Thread Murphy McCauley
I think this is probably better aimed at the mininet-discuss list.

Good luck.

-- Murphy

On May 14, 2015, at 3:00 AM, 博威张 zbw921...@gmail.com wrote:

 Hi,
 
 The popen function is here : Node.popen(self,args,kwargs)
 I have read examples/popenpoll.py and  examples/popen.py, both of which only 
 show multiple pings.
 I don't know the exact meaning of two parameters(args and kwargs) and their 
 format of usage.
 
 Thank you,
 Bowei
 
 
 
 



Re: [pox-dev] Host_Tracker

2015-05-13 Thread Murphy McCauley
Well it only sends them under certain conditions (IIRC, it sends them when a 
host has been quiet for a while and h_t is trying to see if the host is still 
there or not), and it's not a normal ICMP ping -- it's an ARP request.

-- Murphy

On May 12, 2015, at 11:06 PM, Talal Alharbi tal...@hotmail.com wrote:

 Dear All, 
 
 Based on the source code of the host tracker component, it sends ping, but I 
 have monitored this through Wireshark and there is no ping. 
 
 Check senPing: 
 def sendPing (self, macEntry, ipAddr):
 
 Thank you,



Re: [pox-dev] help with openflow actions

2015-05-12 Thread Murphy McCauley
The problem is probably that you're rewriting the IP addresses but not the 
Ethernet addresses.  In such a case, for example, .4 sees the rewritten packet, 
but it still has .2's Ethernet address.  .4 never even looks at the IP because 
the packet appears to be for someone else at the Ethernet layer.

-- Murphy

On May 12, 2015, at 12:07 PM, Kostas Chartsias kcharts...@yahoo.gr wrote:

  msg = of.ofp_flow_mod()
  msg.priority = 42
  msg.match.dl_type=0x800
  msg.idle_timeout = 40
  msg.hard_timeout = 40
  msg.match.nw_dst = IPAddr(10.0.0.2)
  msg.actions.append(of.ofp_action_nw_addr.set_dst(IPAddr(10.0.0.4)))
  msg.actions.append(of.ofp_action_output(port = 4))
  self.connection.send(msg)
  msg = of.ofp_flow_mod()
  msg.priority = 42
  msg.match.dl_type=0x800
  msg.idle_timeout = 40
  msg.hard_timeout = 40
  msg.match.nw_dst = IPAddr(src_ip)
  msg.actions.append(of.ofp_action_nw_addr.set_src(IPAddr(10.0.0.2)))
  msg.actions.append(of.ofp_action_output(port = myport))
  self.connection.send(msg)
 
 I have a switch and 3 hosts.I assume that 10.0.0.3 is the attacker and 
 10.0.0.2 and 10.0.0.4 are two(supposed) honeypots.(i use mininet)
 When there are a lot of packets towards .2 honeypot i want to redirect the 
 traffic to .4.So i install a rule for ip spoofing to .4 and i send it to port 
 4.Moreover there is a flow for the replies from 10.0.0.4.
 The thing is that i send echo requests to .2 ,switch succeessfully changes it 
 to .4 and sends is from the correct port.But h4 drops it and doesn't send any 
 echo reply.
 The even more bizzar thing is that i can ping from .4 to .3 and .3 sees is as 
 .2.(ping show that packets drop,but with tcpdump i can see full duplex 
 communication,wtf is going on) :/
 
 I cannot understand if it's a pox bug when it modifies src or destination 
 ip,or mininet bug.Or if you could suggest any other solution.
 To sum up the consept is,i want to send packets from .3 to .2 and when an 
 event accurs to send them to .4 But the attacker should see that communicates 
 always with .2 and not .4 (that's why i want to modify ip 2 times)
 Thanks in advance  
 
 



Re: [pox-dev] cannot convert argument to integer in pack self.max_len

2015-05-10 Thread Murphy McCauley
In Python, logical lines of code can span multiple physical lines.  When 
printing tracebacks, it only prints the final physical line of the logical line 
of code in question.  So while you're seeing line 1560 and only seeing the 
self.max_len, the actual problem may well be on the line before that -- 1559. 
 In this case, that contains self.port -- it's very likely that your modified 
_install() is setting the port value wrong when constructing the 
ofp_action_output().

-- Murphy

On May 10, 2015, at 7:58 PM, 博威张 zbw921...@gmail.com wrote:

 Hi,
 
 I'm doing something based on l2_multi and I got such problems :
 
 Traceback (most recent call last):
   File /home/seuzbw/pox/pox/lib/revent/revent.py, line 231, in 
 raiseEventNoErrors
 return self.raiseEvent(event, *args, **kw)
   File /home/seuzbw/pox/pox/lib/revent/revent.py, line 278, in raiseEvent
 rv = event._invoke(handler, *args, **kw)
   File /home/seuzbw/pox/pox/lib/revent/revent.py, line 156, in _invoke
 return handler(self, *args, **kw)
   File /home/seuzbw/pox/ext/test1.py, line 492, in _handle_PacketIn
 self.install_path(dest[0], dest[1], match, event)
   File /home/seuzbw/pox/ext/test1.py, line 414, in install_path
 self._install_path(p, match, event.ofp)
   File /home/seuzbw/pox/ext/test1.py, line 360, in _install_path
 self._install(sw, in_port, out_port, match)
   File /home/seuzbw/pox/ext/test1.py, line 355, in _install
 switch.connection.send(msg)
   File /home/seuzbw/pox/pox/openflow/of_01.py, line 692, in send
 data = data.pack()
   File /home/seuzbw/pox/pox/openflow/libopenflow_01.py, line 2322, in pack
 packed += i.pack()
   File /home/seuzbw/pox/pox/openflow/libopenflow_01.py, line 1560, in pack
 self.max_len)
 error: cannot convert argument to integer
 
 self.max_len is in class of ofp_action_output.
 
 I didn't make any changes either on method  of _install() or on class of 
 ofp_action_output, so what's wrong?
 
 The original l2_multi works fine.
 
 Thank you.
 Bowei



Re: [pox-dev] How the class of Switch (EventMixin) in l2_multi works?

2015-05-08 Thread Murphy McCauley

On May 8, 2015, at 9:49 PM, 博威张 zbw921...@gmail.com wrote:

 Hi,
 
 I have following confusions about the class of Switch (EventMixin) in 
 l2_multi :
 1.No instance of the class of Switch (EventMixin) has been found in component 
 of l2_multi, so how does it work? 

Sure there are instances of it.  The l2_multi class creates instances in 
response to ConnectionUp events.

 2. It doesn't listen to any components(including the core.openflow) , so how 
 will the function of _handle_PacketIn work?

It listens to Connection objects.  Switch.connect() does this by a call to 
self.listenTo().  As with the creation of Switch instances, the call to 
Switch.connect() is made from l2_multi's ConnectionUp handler.

 3. It doesn't raise any events and even doesn't have the _eventMixin_events 
 set, why does it inherit from revent.EventMixin? 

It inherits from it so that it can do self.listenTo() (which comes from 
EventMixin).  This was briefly the normal way to bind events, but has been 
sort of deprecated for a long while.  I guess it has never been replaced here, 
though.  The more common/modern equivalent is calling source.addListeners(sink) 
rather than sink.listenTo(source).

 Thank you!
 Bowei
 



Re: [pox-dev] sFlow and POX

2015-04-27 Thread Murphy McCauley
POX presently has no special support for sFlow.  But, IIRC, for the most part, 
sFlow just samples packets and encapsulates them in UDP.  You could certainly 
extend POX to listen on a UDP socket to get the sFlow packets.

BUT... if you're going to have a large number of sFlow packets (e.g., your 
sample rate isn't going to be that low or you have a lot of switches), I 
wouldn't have the packets go directly into POX.  Python is not particularly 
suited to sipping from a firehose.  I'd be tempted to write an external agent 
in C or something which runs alongside POX and gets the sFlow packets, does 
application-specific aggregation/thresholding/etc. and communicates the results 
to POX in a more efficient way (e.g., snapshots at a fixed rate).

If you want to configure the sFlow stuff on the switches from the controller 
(rather than by hand), and if your switches are Open vSwitch, I think you can 
do it via OVSDB.  You might want to look at my POX fork on github 
(MurphyMc/pox) which has some experimental OVSDB support that is very likely to 
get merged into mainline POX when I have the time.

-- Murphy

On Apr 27, 2015, at 5:06 AM, Fahime Alizade alizade...@gmail.com wrote:

 Dear all,
 
 
 I was wondering if it is possible to use sFlow along with POX? 
 I need my POX controller to make all the decisions about flow scheduling, so 
 all the statistical information from sFlow needs to be passed to POX. Is it 
 possible to do so?
 
 Thanks in advance,
 
 Best regards,
 Fahimeh



Re: [pox-dev] Modules Depend on Host_Tracker

2015-04-27 Thread Murphy McCauley
I don't think POX ships with anything that depends on it, though gephi_topo can 
optionally use it to display hosts in Gephi.

-- Murphy

On Apr 27, 2015, at 12:39 AM, Talal Alharbi tal...@hotmail.com wrote:

 Dear All, 
 
 I'm just carious is there any modules depend on Host_tracker ? Like discovery 
 ?
 
 Thank you!
 Talal



Re: [pox-dev] Bad OpenFlow version (4) on connection with ovs switches

2015-04-16 Thread Murphy McCauley
Is the version of POX you're using more than two years old?  I think more 
recent versions are unlikely to have this happen.

If your POX is old, you could update it (in which case, you'd probably want to 
run  my fork of ripl/riplpox), or you could make the relevant change in your 
local POX (I think it was a change to HELLO message processing in of_01.py in 
early 2013).

Another way to fix this would be to configure OVS to use OpenFlow 1.0 only.  
This should be something like...
ovs-vsctl set bridge br0 protocols=openflow10

Except instead of br0, you'll want to do it for every switch that Mininet 
creates.  There may be an easy way to get Mininet to do this, but I don't know 
it off the top of my head; you might try the Mininet list.  Or maybe there's a 
way to make it the default for OVS; I don't know a way to do that off the top 
of my head either; you might try the OVS list.

-- Murphy

On Apr 16, 2015, at 12:32 AM, david jhon djhon9...@gmail.com wrote:

 Hi everyone, 
 
 I am working with openvswitch 2.3.90 and made some changes in vswitch code. I 
 am trying to use ripl and riplpox along with the pox controller but pox 
 throws this error:
  
 WARNING:openflow.of_01:Bad OpenFlow version (4) on connection [Con 19/None]
 INFO:openflow.of_01:[Con 19/None] closing connection
 
 and does not process any packets. I am building and running ovs by compiling 
 from its source available at its git repository. 
 
 P.S. I am using following command to start the topology: sudo mn --custom 
 ~/ripl/ripl/mn.py --topo ft,4 --controller=remote --mac
 
 and ~/pox/pox.py riplpox.riplpox --topo=ft,4 --routing=hashed --mode=reactive 
 to start the controller. 
 
 It seems POX does not support 2.3.90 version of openvswitch or what else? Pls 
 let me know if there exist a work around for this. Many thanks!
 
 Regards,
 Jhon
 
 



Re: [pox-dev] Bad OpenFlow version (4) on connection with ovs switches

2015-04-16 Thread Murphy McCauley
My fork, which I attempted to update for modern POX:
https://github.com/MurphyMc/riplpox

It might run on carp, but it was done for dart (and will probably work on eel).

See my pull request against Brandon's repo for more info:
https://github.com/brandonheller/riplpox/pull/5

(I think the short of it was that my updated riplpox works fine, but there 
seemed to be some incompatibilities with ripl and current versions of Mininet.)

-- Murphy

On Apr 16, 2015, at 3:31 AM, david jhon djhon9...@gmail.com wrote:

 Thank you very much for your response Murphy, 
 
 I have decided to use pox carp branch and running it with the 
 brandonheller(git://github.com/brandonheller/ripl.git, 
 git://github.com/brandonheller/riplpox.git) version of ripL and ripLpox but 
 getting following error on pox controller:
 
 Traceback (most recent call last):
   File /root/pox/pox/lib/revent/revent.py, line 231, in raiseEventNoErrors
 return self.raiseEvent(event, *args, **kw)
   File /root/pox/pox/lib/revent/revent.py, line 278, in raiseEvent
 rv = event._invoke(handler, *args, **kw)
   File /root/pox/pox/lib/revent/revent.py, line 156, in _invoke
 return handler(self, *args, **kw)
   File /root/riplpox/riplpox/riplpox.py, line 344, in _handle_PacketIn
 self._handle_packet_reactive(event)
   File /root/riplpox/riplpox/riplpox.py, line 240, in 
 _handle_packet_reactive
 self._install_reactive_path(event, out_dpid, out_port, packet)
   File /root/riplpox/riplpox/riplpox.py, line 160, in _install_reactive_path
 IDLE_TIMEOUT)
   File /root/riplpox/riplpox/riplpox.py, line 90, in install
 self.connection.send(msg)
   File /root/pox/pox/openflow/of_01.py, line 692, in send
 data = data.pack()
   File /root/pox/pox/openflow/libopenflow_01.py, line 2320, in pack
 self.flags)
 error: integer out of range for 'L' format code
 INFO:.root.riplpox.riplpox:route: ['0_1_1', '0_2_1', '0_0_1']
 
 could you please let me know if it is the right version to be used? I 
 couldn't find RipL and RipLPOX at POX git repository. Or could you please 
 suggest me a fix for this problem? Thanks a lot for your help/suggestions. 
 
 Regards,
 David
 
 
 
 
 On Thu, Apr 16, 2015 at 12:47 PM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Is the version of POX you're using more than two years old?  I think more 
 recent versions are unlikely to have this happen.
 
 If your POX is old, you could update it (in which case, you'd probably want 
 to run  my fork of ripl/riplpox), or you could make the relevant change in 
 your local POX (I think it was a change to HELLO message processing in 
 of_01.py in early 2013).
 
 Another way to fix this would be to configure OVS to use OpenFlow 1.0 only.  
 This should be something like...
 ovs-vsctl set bridge br0 protocols=openflow10
 
 Except instead of br0, you'll want to do it for every switch that Mininet 
 creates.  There may be an easy way to get Mininet to do this, but I don't 
 know it off the top of my head; you might try the Mininet list.  Or maybe 
 there's a way to make it the default for OVS; I don't know a way to do that 
 off the top of my head either; you might try the OVS list.
 
 -- Murphy
 
 On Apr 16, 2015, at 12:32 AM, david jhon djhon9...@gmail.com wrote:
 
  Hi everyone,
 
  I am working with openvswitch 2.3.90 and made some changes in vswitch code. 
  I am trying to use ripl and riplpox along with the pox controller but pox 
  throws this error:
 
  WARNING:openflow.of_01:Bad OpenFlow version (4) on connection [Con 19/None]
  INFO:openflow.of_01:[Con 19/None] closing connection
 
  and does not process any packets. I am building and running ovs by 
  compiling from its source available at its git repository.
 
  P.S. I am using following command to start the topology: sudo mn --custom 
  ~/ripl/ripl/mn.py --topo ft,4 --controller=remote --mac
 
  and ~/pox/pox.py riplpox.riplpox --topo=ft,4 --routing=hashed 
  --mode=reactive to start the controller.
 
  It seems POX does not support 2.3.90 version of openvswitch or what else? 
  Pls let me know if there exist a work around for this. Many thanks!
 
  Regards,
  Jhon
 
 
 
 



Re: [pox-dev] Cbench issue with pox controller

2015-04-13 Thread Murphy McCauley
It works fine for me using POX eel on both Linux and Mac OS, using both CPython 
and PyPy, using both --unthreaded-sh and not.

Why are you trying to run cbench?  What is it that you think cbench is going to 
tell you?

-- Murphy

On Apr 10, 2015, at 2:29 AM, Anil Kumar Konasale Krishna akuma...@cs.utah.edu 
wrote:

 Hi Folks. 
 
 I am trying to evaluate the throughput of the POX controller. But every time 
 I run cbench with POX controller, this is the issue that I see:
 
 cbench: controller benchmarking tool
running in mode 'throughput'
connecting to controller at localhost:6633 
faking 256 switches offset 1 :: 10 tests each; 1 ms per test
with 10 unique source MACs per switch
learning destination mac addresses before the test
starting test with 0 ms delay after features_reply
ignoring first 1 warmup and last 0 cooldown loops
connection delay of 0ms per 1 switch(es)
debugging info is off
 controller msgbuf_read() = -1:  msgbuf_read: Connection refused
 
 
 I looked into many mail threads online. My repository for cbench has the fix 
 for barrier issue also.
 Any specific reason why this failure ?
 
 Thanks
 Anil 



Re: [pox-dev] Reading TLS header.

2015-04-03 Thread Murphy McCauley
I think maybe the answer here is a combination of Lucas Brasilino's answer to 
your other question from earlier today and RFC 5246.

-- Murphy

On Apr 3, 2015, at 10:37 AM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 HI all,
 
 How can i read the TLS header of a packet? Is there any reference material 
 available for the same?
 
 
 Thanks and Regards.
 



Re: [pox-dev] frequent packet_in in riplpox

2015-03-17 Thread Murphy McCauley
Have you looked at the packet to see what it is it?

It might be IPv6 neighbor discovery or something...

-- Murphy

On Mar 17, 2015, at 8:37 AM, Amer amer7...@hotmail.com wrote:

 Hello,
 
 Dear Murphy
 
 I run mininet in fattree, 4 topology and riplpox in proactive mode
 
 I have added a counter into Packet_in function in riplpox, however, I am 
 seeing several-frequent packet_in requests, whereas I am not sending any 
 traffic between any hosts.
 the issue happing while using reactive mode.
 
 Best regards,
 
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA



Re: [pox-dev] ovsdb

2015-03-09 Thread Murphy McCauley

On Mar 9, 2015, at 1:55 AM, Felician Nemeth neme...@tmit.bme.hu wrote:

 On Thu, Mar 05 2015, Murphy McCauley wrote:
 
 On Mar 4, 2015, at 3:51 AM, Felician Nemeth neme...@tmit.bme.hu wrote:
 
 Hi Murphy,
 
 Finally, I've had a little time to have a look at your ovsdb module.
 It's absolutely great and the connect_back feature is really convenient.
 
 I'm glad it sounds like it was somewhat useful.
 
 Unfortunately, I felt the DSL didn't ease writing the code for the toy
 example I created.  However, the DSL does help reading it.
 
 Thanks for the feedback.  Do you think better documentation for the
 DSL would help (a low bar, since there's basically none), or do you
 think the DSL just isn't likely to be helpful?  
 
 I mean it took me almost same amount of effort to write a transaction
 with the DSL as it took me to write a similar transaction directly in
 json.  It requires the same knowledge about ovsdb.
 
 This is in contrast to OpenFlow support, because for example it is so
 much easier to create a flow_mod with libopenflow_01 of POX than
 directly assemble a similar OpenFlow 1.1 message in NOX.  And for some
 cases POX has more abstract layers: using ARPHelper I don't even have
 know the wire format and other details of the ARP protocol either.
 
 So I think the ovsdb module provides a solid low-level support, but I
 somehow excepted ovs-vsctl like features, which was silly because
 there's no point in reimplementing ovs-vsctl.  Higher layer abstractions
 over the ovsdb protocol would be good on the long run, but the ovsdb
 protocol is much more powerful than the ovs-vsctl interface.

Ah, yes, that's true.  It really is meant to be a completely generic interface 
to ovsdb.  There is a thought to build higher-level utilities on top of it, but 
it hasn't happened yet.  I don't know what all would be useful to people in 
general.  My own use cases have been tunnel-related.

 Did you try using the normal OOP interface instead?
 
 Now that's something where documentation would have helped me.  I didn't
 realized I could use it.  I saw the DSL example, and I thought that's
 way to use ovsdb.

Ah.  Yeah. :)  It should be possible to use the OOP interface instead, and it 
should be functionally equivalent to the DSL.  Basically I was finding it 
difficult to craft an OOP API that actually seemed nice or intuitive to use, 
and I thought I'd give a DSL approach a shot, so that's where most of the 
effort ended up going.

 Maybe it's not a shortcoming at all, but it's not possible to specify a
 context to callback functions.  I mean I have to use object methods as
 callbacks if I'd like to access some details of the transaction in the
 callback function.  This is OK, but sometimes it would be good to use
 something like the following:
 
 conn.transact( ... ).callback(cb, var1, var2)
 
 def cb (results, var1, var2):
   ...
 
 I think I just assumed you'd use a lambda...
 conn.transact( ... ).callback(lambda results: cb(results, var1, var2))
 
 Or move results to the end of the parameter list of cb() and then use
 functools.partial (or just use named arguments) for the same sort of
 effect.
 
 If you think having this built in would be a really valuable feature,
 though, I don't think I'm opposed.
 
 I haven't known functools.partial (I'm still a python-beginner), but
 both approaches result in wordy code.  To me, the beauty of the DSL,
 and the ovsdb module is its terse, clean interface.  On the hand,
 supporting extra parameters in the callback function might ruin the
 cleanness of the interface, I don't know.

I think it sounds like it's worth looking at implementing in the future if you 
want to file a bug about it on github.

 I've also found a few minor bugs.  The fixes and my sample modules
 (which might be useful for future ovsdb users) are here:
 https://github.com/MurphyMc/pox/compare/experimental...nemethf:experimental
 
 Thanks!  My time to work on POX lately is so limited, I am thinking
 that for eel, I will just pull the OVSDB stuff from my experimental
 branch and call it done.  Any objection to me integrating your
 patches and samples?
 
 Not at all.
 
 Or on that note... I've been meaning to create a repository of POX
 stuff that isn't in the mainline... I don't know exactly how I want it
 set up.  But the idea is to try to gather stuff that people want to
 share, but that doesn't belong in mainline because it's a bit too
 off-the-beaten-path, or not generic enough, or there's not a good
 maintenance story for, etc.  If you (or anyone) wants to weigh in on
 whether the OVSDB stuff belongs there or in the mainline, I'm
 interested.
 
 Well, currently there's no real contributing community around POX,
 therefore without your active participation it will inevitably lose
 momentum.  So anything that encourages contribution is a good move, I
 think.
 
 Nevertheless, I'd love to see ovsdb in the mainline.  It belongs there.

That's the way I've been leaning.  Thanks for the input.

 Thank you again

Re: [pox-dev] POX controller giving error on giving SSL options

2015-03-03 Thread Murphy McCauley
You're running POX carp, but SSL support was added in POX dart.  See the manual 
about upgrading.

-- Murphy

On Feb 10, 2015, at 2:29 AM, Ruchika Verma ruve...@gmail.com wrote:

 hi,
 
 I am receiving following error while starting POX controller with SSL options.
 
 The .PEM files are created in /pox folder. Also tried with .PEM files under 
 /etc/openvswitch folder.
 
 mininet@mininet-vm:~/pox$ ./pox.py openflow.of_01 --port=6634 
 --private-key=ctl-privkey.pem --certificate=ctl-cert.pem --ca-cert=sc-cert.pem
 
 POX 0.2.0 (carp) / Copyright 2011-2013 James McCauley, et al.
 Error executing pox.openflow.of_01.launch:
 TypeError: launch() got an unexpected keyword argument 'ca_cert'
 
 Parameters for pox.openflow.of_01:
  Name  Default   Active   
  ---   ---   ---  
  port  6633  6634 
  address   0.0.0.0   0.0.0.0  
 This component does not have a parameter named 'ca_cert'.
 mininet@mininet-vm:~/pox$ 
 
 Can you please help?
 
 BR,
 Ruchika
 



Re: [pox-dev] Getting counter values in POX controller

2015-02-28 Thread Murphy McCauley
Haha.  What a coincidence. :)

On Feb 28, 2015, at 4:10 PM, Sulabh Bista sul...@gmail.com wrote:

 Hey,
 
 A generic method would be:
 Requesting statistics from a switch (see: 
 https://openflow.stanford.edu/display/ONL/POX+Wiki#POXWiki-ofp_stats_request-Requestingstatisticsfromswitches)
 Listening to statistics events (see: 
 https://openflow.stanford.edu/display/ONL/POX+Wiki#POXWiki-StatisticsEvents)
 Hope it was helpful.
 
 
 On Sat, Feb 28, 2015 at 2:25 PM, Sandesh Shrestha sande...@ualberta.ca 
 wrote:
 Dear All,
 
 Could you help me with getting the values of counters from open vswitch into 
 the
 POX controller ie number of bytes sent per flow or per port.
 
 If there is any link where I can find that, can you please guide me to the 
 link.
 
 
 Thanks,
 Sandesh Shrestha
 



Re: [pox-dev] dec_ttl not working

2015-02-28 Thread Murphy McCauley
Have you tried looking at the table on the switch and verifying that you see 
the entry as you expect (e.g., including the decrement action)?  The easiest 
way to do this is probably using ovs-ofctl.

-- Murphy

On Feb 28, 2015, at 12:28 PM, AMER amer7...@hotmail.com wrote:

 Hello,
 
 Dear
 
 I am using mininet v 2.0 and OVS 1,10 
 I run wireshatk in the background to check the IP-TTL value, however it isn't 
 decremented
 I have used the following commands in riplpox to decrement the IP_TTL in 
 reactive mode
 
   def install(self, port, packet, buf = None, idle_timeout = 0, hard_timeout 
 = 0,
   priority = of.OFP_DEFAULT_PRIORITY):
 #msg = of.ofp_flow_mod()
 msg = nx.nx_flow_mod()
  #   msg.match = match
 msg.match.eth_src = packet.src
 msg.match.eth_dst = packet.dst
 msg.idle_timeout = idle_timeout
 msg.hard_timeout = hard_timeout
 msg.priority = priority
 msg.actions.append(nx.nx_action_dec_ttl())
 msg.actions.append(of.ofp_action_output(port = port))
 msg.buffer_id = buf
 self.connection.send(msg)
 
 Best regards,
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA



Re: [pox-dev] Create ICMP packets in POX

2015-02-28 Thread Murphy McCauley
Use Wireshark to examine the destination host's interface.  Do you see the 
packet?  Is it as you expect it?

-- Murphy

On Feb 28, 2015, at 11:06 AM, Sandesh Shrestha sande...@ualberta.ca wrote:

 Thank you very much for pointing that out Murphy. However, I am still not 
 able to get the response ping. Please share if you have any idea.
 
 Thanks,
 Sandesh Shrestha
 
 On Fri, Feb 27, 2015 at 8:39 PM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Jumping in with a quick comment below...
 
 On Feb 27, 2015, at 11:15 AM, Sandesh Shrestha sande...@ualberta.ca wrote:
 
 Hey Lucas,
 
 Thanks for the help. I was able to send icmp packets to mininet host using 
 the code below.
 I used arbitrary source mac address and source ip. The destination ip and 
 destination mac address is the values of
 the mininet host connected in port 1 of the switch.
 
 However I was not able to get the icmp reply from the host.Could you please 
 check what the probem is.
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 import pox.lib.packet as pkt
 from pox.lib.addresses import EthAddr,IPAddr
 
 log= core.getLogger()
 
 class Icmp(object):
 def __init__(self):
 core.openflow.addListeners(self)
 
 def _handle_PacketIn(self,event):
 packet=event.parsed
 
 
 if packet.find(icmp):
 log.debug(Icmp message received)
 
 def _handle_ConnectionUp(self,event):
 
 #This part is the ping reply
 icmp=pkt.icmp()
 icmp.type=pkt.TYPE_ECHO_REQUEST
 echo=pkt.ICMP.echo(payload=0123456789)
 icmp.payload= echo
 log.debug(This is the icmp payload %s%icmp.payload)
 
 #Create IP payload
 ipp = pkt.ipv4()
 ipp.protocol=ipp.ICMP_PROTOCOL
 ipp.srcip=IPAddr(10.0.0.10)
 ipp.dstip=IPAddr(10.0.0.1)
 ipp.payload=icmp
 log.debug( This is the ip payload %s%ipp.payload)
 
 #Create Ethernet Payload
 e= pkt.ethernet()
 e.src=EthAddr(00:00:00:00:00:10)
 e.dst=EthAddr(00:00:00:00:00:01)
 e.type=e.IP_TYPE
 e.payload=ipp
 log.debug( This is the ethernet payload %s%e.payload)
 
 #Send it to first input port
 msg = of.ofp_packet_out()
 msg.actions.append(of.ofp_action_output(port=1))
 msg.date=e.pack()
 
 .. I don't know what other problems this code may have, but the above will 
 certainly be enough to keep it from working.  You mean msg.data.
 
 msg.in_port=of.OFPP_NONE
 event.connection.send(msg)
 
 def launch():
 
 def start_switch(event):
 log.debug(Controlling %s%(event.connection))
 Icmp()
 core.openflow.addListenerByName(ConnectionUp,start_switch)
 
 
 Thanks,
 Sandesh Shrestha
 www.sandeshshrestha.blogspot.com
 
 On Thu, Feb 26, 2015 at 6:17 AM, Lucas Brasilino lr...@cin.ufpe.br wrote:
 Hi Sadesh,
 
 I think you can construct a ICMP request as below. I did use python 
 interactively just as example.
 The ethernet packet object 'eth' must be sent by using openflow's 
 ofp_packet_out() (method) message along
 with ofp_action_output() (method) action to inform switch which output port 
 the packet must be sent from.
 python was started from pox installation directory.
 
  import pox.lib.packet as pkt
  from pox.lib.addresses import IPAddr,EthAddr
  echo = pkt.ICMP.echo(payload=0123456789)
  icmp = pkt.icmp(type=pkt.ICMP.TYPE_ECHO_REQUEST,payload=echo)
  ip = 
  pkt.ipv4(srcip=IPAddr(10.0.0.1),dstip=(10.0.0.2),protocol=pkt.ipv4.ICMP_PROTOCOL,payload=icmp)
  eth = 
  pkt.ethernet(src=EthAddr(aa:bb:cc:dd:ee:fe),dst=EthAddr(aa:bb:cc:dd:ee:ff),type=pkt.ethernet.IP_TYPE,payload=ip)
  print eth
 [aa:bb:cc:dd:ee:feaa:bb:cc:dd:ee:ff IP]
  print eth.payload
 [IP+ICMP 10.0.0.110.0.0.2 (cs:00 v:4 hl:5 l:20 t:64)]
  print eth.payload.payload
 [t:ECHO_REQUEST c:0 chk:0][ICMP id:25863 seq:0]
 
 
 I didn't test myself now but it should work :)
 Hope it helps
 
 -- 
 Att
 Lucas Brasilino
 MSc Student @ Federal University of Pernambuco (UFPE) / Brazil
 twitter: @lucas_brasilino
 
 
 2015-02-26 0:03 GMT-03:00 Sandesh Shrestha sande...@ualberta.ca:
 
 Dear All,
 
 I want to create an ICMP request(not reply) packet in POX. How can I do 
 that?Especially what will be the icmp payload and source ip and mac address 
 so that I get reply from the mininet host.
 
 
 Thanks,
 Sandesh Shrestha
 www.sandeshshrestha.blogspot.com
 
 
 
 
 
 
 
 
 



Re: [pox-dev] Getting counter values in POX controller

2015-02-28 Thread Murphy McCauley
In OpenFlow, these values are known as statistics.  Have you read the 
relevant sections of the OpenFlow specification and the POX manual?  If not, 
I'd suggest reading the following sections in the POX manual:
Statistics Events
ofp_stats_request - Requesting statistics from switches
Statistics Collector Example

-- Murphy

On Feb 28, 2015, at 11:25 AM, Sandesh Shrestha sande...@ualberta.ca wrote:

 Dear All,
 
 Could you help me with getting the values of counters from open vswitch into 
 the
 POX controller ie number of bytes sent per flow or per port.
 
 If there is any link where I can find that, can you please guide me to the 
 link.
 
 
 Thanks,
 Sandesh Shrestha



Re: [pox-dev] Create ICMP packets in POX

2015-02-27 Thread Murphy McCauley
Jumping in with a quick comment below...

On Feb 27, 2015, at 11:15 AM, Sandesh Shrestha sande...@ualberta.ca wrote:

 Hey Lucas,
 
 Thanks for the help. I was able to send icmp packets to mininet host using 
 the code below.
 I used arbitrary source mac address and source ip. The destination ip and 
 destination mac address is the values of
 the mininet host connected in port 1 of the switch.
 
 However I was not able to get the icmp reply from the host.Could you please 
 check what the probem is.
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 import pox.lib.packet as pkt
 from pox.lib.addresses import EthAddr,IPAddr
 
 log= core.getLogger()
 
 class Icmp(object):
 def __init__(self):
 core.openflow.addListeners(self)
 
 def _handle_PacketIn(self,event):
 packet=event.parsed
 
 
 if packet.find(icmp):
 log.debug(Icmp message received)
 
 def _handle_ConnectionUp(self,event):
 
 #This part is the ping reply
 icmp=pkt.icmp()
 icmp.type=pkt.TYPE_ECHO_REQUEST
 echo=pkt.ICMP.echo(payload=0123456789)
 icmp.payload= echo
 log.debug(This is the icmp payload %s%icmp.payload)
 
 #Create IP payload
 ipp = pkt.ipv4()
 ipp.protocol=ipp.ICMP_PROTOCOL
 ipp.srcip=IPAddr(10.0.0.10)
 ipp.dstip=IPAddr(10.0.0.1)
 ipp.payload=icmp
 log.debug( This is the ip payload %s%ipp.payload)
 
 #Create Ethernet Payload
 e= pkt.ethernet()
 e.src=EthAddr(00:00:00:00:00:10)
 e.dst=EthAddr(00:00:00:00:00:01)
 e.type=e.IP_TYPE
 e.payload=ipp
 log.debug( This is the ethernet payload %s%e.payload)
 
 #Send it to first input port
 msg = of.ofp_packet_out()
 msg.actions.append(of.ofp_action_output(port=1))
 msg.date=e.pack()

.. I don't know what other problems this code may have, but the above will 
certainly be enough to keep it from working.  You mean msg.data.

 msg.in_port=of.OFPP_NONE
 event.connection.send(msg)
 
 def launch():
 
 def start_switch(event):
 log.debug(Controlling %s%(event.connection))
 Icmp()
 core.openflow.addListenerByName(ConnectionUp,start_switch)
 
 
 Thanks,
 Sandesh Shrestha
 www.sandeshshrestha.blogspot.com
 
 On Thu, Feb 26, 2015 at 6:17 AM, Lucas Brasilino lr...@cin.ufpe.br wrote:
 Hi Sadesh,
 
 I think you can construct a ICMP request as below. I did use python 
 interactively just as example.
 The ethernet packet object 'eth' must be sent by using openflow's 
 ofp_packet_out() (method) message along
 with ofp_action_output() (method) action to inform switch which output port 
 the packet must be sent from.
 python was started from pox installation directory.
 
  import pox.lib.packet as pkt
  from pox.lib.addresses import IPAddr,EthAddr
  echo = pkt.ICMP.echo(payload=0123456789)
  icmp = pkt.icmp(type=pkt.ICMP.TYPE_ECHO_REQUEST,payload=echo)
  ip = 
  pkt.ipv4(srcip=IPAddr(10.0.0.1),dstip=(10.0.0.2),protocol=pkt.ipv4.ICMP_PROTOCOL,payload=icmp)
  eth = 
  pkt.ethernet(src=EthAddr(aa:bb:cc:dd:ee:fe),dst=EthAddr(aa:bb:cc:dd:ee:ff),type=pkt.ethernet.IP_TYPE,payload=ip)
  print eth
 [aa:bb:cc:dd:ee:feaa:bb:cc:dd:ee:ff IP]
  print eth.payload
 [IP+ICMP 10.0.0.110.0.0.2 (cs:00 v:4 hl:5 l:20 t:64)]
  print eth.payload.payload
 [t:ECHO_REQUEST c:0 chk:0][ICMP id:25863 seq:0]
 
 
 I didn't test myself now but it should work :)
 Hope it helps
 
 -- 
 Att
 Lucas Brasilino
 MSc Student @ Federal University of Pernambuco (UFPE) / Brazil
 twitter: @lucas_brasilino
 
 
 2015-02-26 0:03 GMT-03:00 Sandesh Shrestha sande...@ualberta.ca:
 
 Dear All,
 
 I want to create an ICMP request(not reply) packet in POX. How can I do 
 that?Especially what will be the icmp payload and source ip and mac address 
 so that I get reply from the mininet host.
 
 
 Thanks,
 Sandesh Shrestha
 www.sandeshshrestha.blogspot.com
 
 
 
 
 
 
 



Re: [pox-dev] error in riplpox

2015-02-25 Thread Murphy McCauley
First: What version of riplpox are you using?

Second: I don't think any version of riplpox was ever used with and test with 
POX carp.  The original riplpox was, I think, from the dart era or maybe even 
the angler era.  My updated version of riplpox was for dart.

-- Murphy

On Feb 25, 2015, at 3:14 AM, AMER amer7...@hotmail.com wrote:

 Hello
 
 Dear all
 
 I tried to upgrade the openvswitch in mininet 2.0, however, I faced an error 
 then I reinstall everything from scratch but nothing working
 
 Debug
 DEBUG:core:POX 0.2.0 (carp) going up...
 DEBUG:core:Running on CPython (2.7.3/Dec 18 2014 19:10:20)
 DEBUG:core:Platform is Linux-3.2.0-76-generic-x86_64-with-Ubuntu-12.04-precise
 INFO:core:POX 0.2.0 (carp) is up.
 DEBUG:openflow.of_01:Listening on 0.0.0.0:6633
 
 ERROR:packet:(dns) parsing answers: Bad address format ��(�C��Z'
 
 when I tried to ping any host I received this error:
 
 self._install_reactive_path(event, out_dpid, out_port, packet)
   File /home/alghada/riplpox/riplpox/riplpox.py, line 160, in 
 _install_reactive_path
 IDLE_TIMEOUT)
   File /home/alghada/riplpox/riplpox/riplpox.py, line 90, in install
 self.connection.send(msg)
   File /home/alghada/pox/pox/openflow/of_01.py, line 692, in send
 data = data.pack()
   File /home/alghada/pox/pox/openflow/libopenflow_01.py, line 2320, in pack
 self.flags)
 error: integer out of range for 'L' format code
 
 I am trying to run pox and mininet with the following commands:
 sudo mn --custom ~/ripl/ripl/mn.py --topo ft,4 --controller=remote --mac
 
 ~/pox/pox.py riplpox.riplpox --topo=ft,4 --routing=random --mode=reactive
 
 the tested openvswitch version is:
 
 alghada@kw12067:~$ ovs-vswitchd --version
 ovs-vswitchd (Open vSwitch) 1.4.6
 Compiled Oct 13 2014 09:25:29
 OpenFlow versions 0x1:0x1
 
 Thank you,
 Best regards
 
 
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA



Re: [pox-dev] Install a flow in for loop

2015-02-23 Thread Murphy McCauley
I expect the problem is that you're doing packet.IP_TYPE, but packet is a 
string, and not the part of the packet library with the IP_TYPE constant.  As 
mentioned in the manual, POX convention is to import the packet library as:
import pox.lib.packet as pkt

.. after which you can do pkt.IP_TYPE and it should work.

Of course, if packet is a string, the next line -- packet.next.srcip -- won't 
work either.  You need packet to be some sort of a packet subclass.  You 
haven't shown the relevant code, so I don't know what you should be doing 
instead.

Also, offhand, it looks like you may be mixing usage of msg and msgd.

As a sidenote: just giving the exception is generally of limited use.  As the 
POX FAQ states in the section about getting help, it's much more useful to post 
the entire traceback.

-- Murphy

On Feb 23, 2015, at 12:00 PM, AMER amer7...@hotmail.com wrote:

 Thank you
 I have solved this problem but I am facing another :)
 
 with this flow match i am receiving the down error
 
 match = of.ofp_match()
 msg.match.eth_type = packet.IP_TYPE
 msg.match.nw_src = packet.next.srcip
 msgd.idle_timeout = idle_timeout
 msgd.hard_timeout = hard_timeout
 msgd.priority = priority
 msgd.actions.append(of.ofp_action_nw_addr.set_dst(packet.next.dstip))
 msgd.actions.append(of.ofp_action_output(port = lport))
 msgd.buffer_id = buf
 core.openflow.sendToDPID(dstsw, msgd)
 
 AttributeError: 'str' object has no attribute 'IP_TYPE'
 
 Thank you
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA
 
 
 From: amer7...@hotmail.com
 To: murphy.mccau...@gmail.com; pox-dev@lists.noxrepo.org
 Date: Mon, 23 Feb 2015 17:53:57 +
 Subject: Re: [pox-dev] Install a flow in for loop
 
 Hello,
 I have removed the index  [i], but still nothing installed !!?
 
 Best regards,
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA
 
 
 From: amer7...@hotmail.com
 To: murphy.mccau...@gmail.com; pox-dev@lists.noxrepo.org
 Date: Mon, 23 Feb 2015 17:08:50 +
 Subject: [pox-dev] Install a flow in for loop
 
 hello,
 
 i want to install a flow table like the following:
 But it is not installing  
  for i in range(0,3):
 msg[i] = of.ofp_flow_mod()
 msg[i].idle_timeout = 100
 msg[i].hard_timeout = 120
 msg[i].match.eth_type = packet.IP_TYPE
 msg[i].match.eth_src = packet.src
 msg[i].match.eth_dst = packet.dst
 msg[i].match.ip_dst = dst[i]  # proactive port based ip
 msg[i].actions.append(of.ofp_action_output(port = i+1))
 msgs = str(msg).strip('[]')
 self.connection.send(msgs)
 
 Best regards,
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA



Re: [pox-dev] error usinf riplpox

2015-02-21 Thread Murphy McCauley
I don't think riplpox is currently maintained.  You could try using my fork, 
which is probably more up-to-date than the official one 
(github.com/MurphyMc/riplpox), or you could try using old versions of POX and 
Mininet.

Good luck.

-- Murphy

On Feb 21, 2015, at 4:33 AM, AMER amer7...@hotmail.com wrote:

 Hello,
 
 
 I am facing this error while using riplpox with reactive fat tree topology
 
 AttributeError: 'FatTreeTopo' object has no attribute 'node_info'
 
 when I changed the self.node_info to self.nodeInfo in dctopo.py
 
 I received the following error
 TypeError: 'instancemethod' object has no attribute '__getitem__
 
 However, I am running the latest version of mininet and pox
 
 Best regards,
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA
 
 
 From: amer7...@hotmail.com
 To: murphy.mccau...@gmail.com; pox-dev@lists.noxrepo.org
 Date: Sat, 21 Feb 2015 12:03:17 +
 Subject: [pox-dev] error usinf riplpox
 
 Hi
 
 I am facing this error while using riplpox with reactive fat tree topology
 
 AttributeError: 'FatTreeTopo' object has no attribute 'node_info'
 
 Best regards,
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA



Re: [pox-dev] Loop problem and Routing

2015-02-17 Thread Murphy McCauley
About discovery?  Yes, it discovers links.  With no QoS information.  See the 
POX manual for more on the discovery component.

-- Murphy

On Feb 17, 2015, at 9:29 PM, Murat Karakus muratkaraku...@gmail.com wrote:

 Thanks for quickly relpy, Murphy. I guess I need to use openflow.discovery 
 component as well like below, right?
 
 ./pox forwarding.l2_multi openflow.spanning_tree openflow.discovery
 
 How about my other question?
 -
 For this purpose, I want my controller (POX) to discover all switches (w/ 
 ports) and links with their corresponding QoS values and store them for 
 future QoS routing. Does the discovery.py component do what I explained 
 without QoS values? 
 
 
 Thanks,
 Murat
 
 
 
 On Wed, Feb 18, 2015 at 12:16 AM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 l2_multi is an example that does shortest paths between endpoints (it uses 
 Floyd-Warshall instead of Dijkstra's, but that's just a detail).  And the 
 spanning_tree component doesn't disable entire ports, IIRC -- just flooding 
 on those ports.  So if you have loops and use l2_multi and spanning_tree, 
 when the destination is known, you get a shortest path.  When the destination 
 isn't known or is multicast/broadcast, it uses the tree.
 
 -- Murphy
 
 On Feb 17, 2015, at 9:09 PM, Murat Karakus muratkaraku...@gmail.com wrote:
 
 Hi All,
 
 I am trying to implement a network having loops (e.g. 4 switches connected 
 to each other and one host connected to each switch). When I try to ping a 
 host, it does not work because of the loops. Using spanning_tree component 
 may work in this case but I don't want it since it deletes a port to get out 
 of the loop which reduces the possible multi paths between src and dst. I 
 don't want this because I want to route my packets based on QoS values of 
 links. (i.e. if one path from the loop does not meet the QoS requirement, 
 another may meet.)
 
 For this purpose, I want my controller (POX) to discover all switches (w/ 
 ports) and links with their corresponding QoS values and store them for 
 future QoS routing. Does the discovery.py component do what I explained 
 without QoS values? 
 
 Also, is there any (already implemented in POX) routing component like 
 Dijkstra algorithm to find a path between given src and dst? Or, we should 
 implement it?
 
 
 Thanks,
 Murat
 
 
 
 



Re: [pox-dev] Loop problem and Routing

2015-02-17 Thread Murphy McCauley
l2_multi is an example that does shortest paths between endpoints (it uses 
Floyd-Warshall instead of Dijkstra's, but that's just a detail).  And the 
spanning_tree component doesn't disable entire ports, IIRC -- just flooding on 
those ports.  So if you have loops and use l2_multi and spanning_tree, when the 
destination is known, you get a shortest path.  When the destination isn't 
known or is multicast/broadcast, it uses the tree.

-- Murphy

On Feb 17, 2015, at 9:09 PM, Murat Karakus muratkaraku...@gmail.com wrote:

 Hi All,
 
 I am trying to implement a network having loops (e.g. 4 switches connected to 
 each other and one host connected to each switch). When I try to ping a host, 
 it does not work because of the loops. Using spanning_tree component may work 
 in this case but I don't want it since it deletes a port to get out of the 
 loop which reduces the possible multi paths between src and dst. I don't want 
 this because I want to route my packets based on QoS values of links. (i.e. 
 if one path from the loop does not meet the QoS requirement, another may 
 meet.)
 
 For this purpose, I want my controller (POX) to discover all switches (w/ 
 ports) and links with their corresponding QoS values and store them for 
 future QoS routing. Does the discovery.py component do what I explained 
 without QoS values? 
 
 Also, is there any (already implemented in POX) routing component like 
 Dijkstra algorithm to find a path between given src and dst? Or, we should 
 implement it?
 
 
 Thanks,
 Murat
 
 



Re: [pox-dev] Error in openflow

2015-02-02 Thread Murphy McCauley
That depends on the switch you're using.  Unless you're using the POX datapath, 
you should probably ask on the switch's 
site/mailing-list/other-support-mechanism.  For example, if you're using Open 
vSwitch, it has its own mailing lists.

-- Murphy

On Feb 2, 2015, at 1:50 AM, AMER amer7...@hotmail.com wrote:

 Hello,
  
 Dear Murphy
 Yes I am trying to increase the VLAN tag to be 6 bytes. I have modified the 
 vlan code on vlan.py under pox directory
 how can i do the same for the switch, I just need to increase the size 
 nothing else :-).
  
 Regards,
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA
 
  
 Subject: Re: Error in openflow
 From: murphy.mccau...@gmail.com
 Date: Sun, 1 Feb 2015 12:45:40 -0800
 CC: pox-dev@lists.noxrepo.org
 To: amer7...@hotmail.com
 
 Are you saying that you're altering the OpenFlow protocol so that it can 
 specify VLAN tags larger than two bytes?  And modifying a switch so that it 
 can match and probably insert and remove these larger VLAN tags?  (If so, I'd 
 have thought that using VXLAN would be an easier way or that using an 
 extension would be cleaner, but that's another issue.)
 
 So you're getting an error from the switch saying that it thinks you've sent 
 it a flow-mod with the emergency flag *and* timeouts set, which isn't 
 allowed.  Assuming that you're not trying to set an emergency flow, the most 
 likely explanation here is that the flow-mod is either being constructed 
 wrong or parsed wrong.  If you're modifying the match structure to 
 accommodate larger VLAN tags, make sure you've modified it the same way on 
 both the switch and controller.
 
 -- Murphy
 
 On Feb 1, 2015, at 3:35 AM, AMER amer7...@hotmail.com wrote:
 
 Dear all
 
 I am using POX carp
 I am receiving this error
 
 [00-00-00-00-00-02 143] Error: header:
 [00-00-00-00-00-02 143] Error: version: 1
 [00-00-00-00-00-02 143] Error: type: 1 (OFPT_ERROR)
 [00-00-00-00-00-02 143] Error: length: 76
 [00-00-00-00-00-02 143] Error: xid: 719
 [00-00-00-00-00-02 143] Error: type: OFPET_FLOW_MOD_FAILED (3)
 [00-00-00-00-00-02 143] Error: code: OFPFMFC_BAD_EMERG_TIMEOUT (3)
 [00-00-00-00-00-02 143] Error: datalen: 64
 [00-00-00-00-00-02 143] Error: : 01 0e 00 48 00 00 02 cf 00 10 00 1f 00 
 00 00 00 |...H|
 [00-00-00-00-00-02 143] Error: 0010: 00 00 00 00 00 00 00 00 00 00 4e 6f 6e 
 65 00 00 |..None..|
 [00-00-00-00-00-02 143] Error: 0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 ||
 [00-00-00-00-00-02 143] Error: 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 
 03 00 00 ||
 INFO:openflow.of_01:[00-00-00-00-00-01 144] closed
 INFO:openflow.of_01:[00-00-00-00-00-02 143] closed
 
 I am trying to extend the vlan header size, sorted almost all errors but 
 finally I am facing this and I do not understand it.
 
 Best regards,
 Amer
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA



Re: [pox-dev] Error in openflow

2015-02-01 Thread Murphy McCauley
Are you saying that you're altering the OpenFlow protocol so that it can 
specify VLAN tags larger than two bytes?  And modifying a switch so that it can 
match and probably insert and remove these larger VLAN tags?  (If so, I'd have 
thought that using VXLAN would be an easier way or that using an extension 
would be cleaner, but that's another issue.)

So you're getting an error from the switch saying that it thinks you've sent it 
a flow-mod with the emergency flag *and* timeouts set, which isn't allowed.  
Assuming that you're not trying to set an emergency flow, the most likely 
explanation here is that the flow-mod is either being constructed wrong or 
parsed wrong.  If you're modifying the match structure to accommodate larger 
VLAN tags, make sure you've modified it the same way on both the switch and 
controller.

-- Murphy

On Feb 1, 2015, at 3:35 AM, AMER amer7...@hotmail.com wrote:

 Dear all
 
 I am using POX carp
 I am receiving this error
 
 [00-00-00-00-00-02 143] Error: header:
 [00-00-00-00-00-02 143] Error: version: 1
 [00-00-00-00-00-02 143] Error: type: 1 (OFPT_ERROR)
 [00-00-00-00-00-02 143] Error: length: 76
 [00-00-00-00-00-02 143] Error: xid: 719
 [00-00-00-00-00-02 143] Error: type: OFPET_FLOW_MOD_FAILED (3)
 [00-00-00-00-00-02 143] Error: code: OFPFMFC_BAD_EMERG_TIMEOUT (3)
 [00-00-00-00-00-02 143] Error: datalen: 64
 [00-00-00-00-00-02 143] Error: : 01 0e 00 48 00 00 02 cf 00 10 00 1f 00 
 00 00 00 |...H|
 [00-00-00-00-00-02 143] Error: 0010: 00 00 00 00 00 00 00 00 00 00 4e 6f 6e 
 65 00 00 |..None..|
 [00-00-00-00-00-02 143] Error: 0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 ||
 [00-00-00-00-00-02 143] Error: 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 
 03 00 00 ||
 INFO:openflow.of_01:[00-00-00-00-00-01 144] closed
 INFO:openflow.of_01:[00-00-00-00-00-02 143] closed
 
 I am trying to extend the vlan header size, sorted almost all errors but 
 finally I am facing this and I do not understand it.
 
 Best regards,
 Amer
 
 Eng Amer Alghadhban
 COE
 SANS-GCFW
 CEH, SCNP, CCNA



Re: [pox-dev] Understanding POX

2015-01-24 Thread Murphy McCauley
The former is discussed in the Working with POX: The POX Core object section 
of the manual -- especially the first subsection of that: Registering 
Components.

The second is addressed in the The Event System: pox.lib.revent section of 
the manual -- particularly in the first few sections (e.g., Listening to an 
Event).

If you have any questions not addressed by the manual, please feel free to ask 
for clarification.

-- Murphy

On Jan 24, 2015, at 1:48 PM, Sandesh Shrestha sande...@ualberta.ca wrote:

 Hello All,
 
 Can anyone please explain me what registerNew and addListenerByName are used 
 for ?
 
 Thanks,
 Sandesh Shrestha
 www.sandeshshrestha.blogspot.com



Re: [pox-dev] Spanning Tree Algorithm

2015-01-12 Thread Murphy McCauley
I don't have enough information to understand or evaluate the information 
you've given about port status.  Where does it come from?  Are you querying the 
switch, or is it from one of the datastructures in spanning_tree.py, or 
something else?  When are you printing it?

And what options are you using to run discovery and spanning_tree?

-- Murphy

On Jan 12, 2015, at 12:47 AM, TALAL AL-HARBI tal...@hotmail.com wrote:

 Dear Murphy 
 
 After the connection is established, ports status set to false expect those 
 who are between switches and no correcting a loop even ports where hosts 
 attached to. 
 
 I have printed ports status with basic topology:
 
 Ports s1-eth1:1   -- where host1 attached to
 Flood False
 Ports s1-eth2:2   --- Link between S1  S2
 Flood True
 Ports s1:65534
 Ports s2-eth1:1   -- where host2 attached to
 Flood False
 Ports s2-eth2:2
 Flood True
 Ports s2:65534 
 
 In this case, why once s1 gets arp request,  broadcast it out of port1?   
 
 Best,,,
 Talal
 Subject: Re: [pox-dev] Spanning Tree Algorithm
 From: murphy.mccau...@gmail.com
 Date: Fri, 9 Jan 2015 19:28:22 -0800
 CC: amer7...@hotmail.com; pox-dev@lists.noxrepo.org
 To: tal...@hotmail.com
 
 I believe you're mistaken and the ports to which hosts are attached have 
 flood enabled.  What makes you think this isn't the case?
 
 -- Murphy
 
 On Jan 9, 2015, at 7:21 PM, TALAL AL-HARBI tal...@hotmail.com wrote:
 
 If you print out ports status, you would see they are false. 
 
 Sent from my iPhone
 
 On Jan 9, 2015, at 9:46 PM, Amer amer7...@hotmail.com wrote:
 
 Dear Talal
 
 The ports that are connected to hosts are not creating loops, thus it will 
 not be disabled.
 
 Best regards,
 Amer
 
 Sent from my iPhone
 
 On ٠٩‏/٠١‏/٢٠١٥, at ١٠:٠٥ ص, TALAL AL-HARBI tal...@hotmail.com wrote:
 
 Hello There,,, 
 
 I'm a bit confused about spanning tree algorithm. After detecting all links, 
 it disables the one creating the loop. However, ports where hosts attached to 
 are still False(Means no flood?). Pings were successful, how ? 
 Thank you!!!
 
 Cheers,,, 
 Talal



Re: [pox-dev] Format of flow entries to use fast failover group type in OF 1.3

2015-01-11 Thread Murphy McCauley
Since POX doesn't currently support OpenFlow 1.3, I'm not sure that this 
applies...

-- Murphy

On Jan 11, 2015, at 4:09 PM, Padma Jayasankar padmaj...@gmail.com wrote:

 Hi,
   I want to use fast fail over group type of OpenFlow 1.3. I need sample flow 
 entries for doing this. According to my knowledge, we have to change the 
 action as group table and then add an entry in the group table. but how to 
 specify in the flow table entry.Please clarify.
 
 Thanks and Regards,
 Padma V



Re: [pox-dev] MAC address encaps

2015-01-11 Thread Murphy McCauley
There are multiple types of MAC-in-MAC encapsulation.  I think recent versions 
of OVS are starting to have support for the kind done with Provider Backbone 
Bridging, but I haven't looked into it.  It might be done with special push and 
pop actions like MPLS, which should be easy enough to add to POX (maybe just 
quick modifications to the MPLS actions).  But I'm just speculating.

-- Murphy

On Jan 5, 2015, at 1:57 AM, Amer amer7...@hotmail.com wrote:

 Hello,
 
 Dear All
 
 How to encapsulate MAC address, I mean MAC-in-MAC encapsulation.
 I searched in the archive, OVS and OF commands, I found nothing, 
 
 Best regards,
 Amer



Re: [pox-dev] Order of handlers for one event

2015-01-11 Thread Murphy McCauley
I think you sent out an email saying you'd already found the answer on the POX 
wiki, but I happened to get the emails in reverse order (I only just got this 
one, but got the other one 20 minutes ago).

For anyone wondering the same thing, I think the relevant answer is in the POX 
manual wiki in the section POX APIs / The Event System / Advanced Topics in 
Event Handling / Events With Multiple Listeners.

-- Murphy

On Jan 11, 2015, at 12:01 PM, tim huang pds...@gmail.com wrote:

 Hi,
 
 I am working on discovery,spanning-tree and l2_multi module, and found that 
 the link_event, which raised by the discovery module, has 2 handlers in 
 spanning_tree and l2_multi respectively. I want to do some changes for 
 core.openflow_discovery.adjacency in spanning_tree module, after the 
 changing, then the l2_multi link_event handler will read the new adjacency, 
 which had been changed by the spanning_tree. Is there any method for me to 
 guarantee the the handlers order for the same event, which means the l2_multi 
 handler is always called later than spanning tree's ?
 
 -- 
 Thanks
 Tim



Re: [pox-dev] Spanning Tree Algorithm

2015-01-09 Thread Murphy McCauley
I believe you're mistaken and the ports to which hosts are attached have flood 
enabled.  What makes you think this isn't the case?

-- Murphy

On Jan 9, 2015, at 7:21 PM, TALAL AL-HARBI tal...@hotmail.com wrote:

 If you print out ports status, you would see they are false. 
 
 Sent from my iPhone
 
 On Jan 9, 2015, at 9:46 PM, Amer amer7...@hotmail.com wrote:
 
 Dear Talal
 
 The ports that are connected to hosts are not creating loops, thus it will 
 not be disabled.
 
 Best regards,
 Amer
 
 Sent from my iPhone
 
 On ٠٩‏/٠١‏/٢٠١٥, at ١٠:٠٥ ص, TALAL AL-HARBI tal...@hotmail.com wrote:
 
 Hello There,,, 
 
 I'm a bit confused about spanning tree algorithm. After detecting all 
 links, it disables the one creating the loop. However, ports where hosts 
 attached to are still False(Means no flood?). Pings were successful, how ? 
 Thank you!!!
 
 Cheers,,, 
 Talal



Re: [pox-dev] LLDP flow installing in discovery module

2015-01-09 Thread Murphy McCauley
In the case of l2_multi, there isn't a point.  But l2_multi isn't the only 
component that uses discovery.  Ones that don't clear the table don't have this 
issue at all.  And some that do clear the table (e.g., topo_proactive) install 
the table entry themselves.

As for what caused this... I think l2_multi predates discovery having the 
option to install a table entry.

Here's an untested patch which maybe is an improvement on the state of affairs?

-- Murphy



discovery_install_flow_change.patch
Description: Binary data

On Jan 9, 2015, at 6:30 AM, tim huang pds...@gmail.com wrote:

 Hi,
 
 I found in the discovery module, the controller will install a flow for the 
 LLDP packet to every switch, however, in the l2_multi module, the controller 
 will clear all flows when there is a link event for re-calculating the path , 
 which means the flow installed from discovery module will only exist at very 
 first beginning. What's the point of the temporary flow installed by the 
 discovery module?
 
 -- 
 Thanks
 Tim



Re: [pox-dev] ECMP in OF

2014-12-31 Thread Murphy McCauley
You might also be interested in riplpox.  Here's my fork:
https://github.com/MurphyMc/riplpox

Also, the Nicira bundle action is useful for this sort of thing.  POX doesn't 
currently support it, unfortunately (I started it, but haven't had time to 
finish it).

-- Murphy

On Dec 31, 2014, at 2:01 PM, tim huang pds...@gmail.com wrote:

 Hi, 
 
 There isn't any command you can enable that.
 
 Based on my understanding, you could do the binding for the ports on the 
 switch, but from controller standpoint view the binding ports should be one 
 logical port. The round-robin you can do on controller is based on the flow.
 
 I implemented the round-robin and hash based on flow around half year ago. 
 Here is the link https://github.com/timhuanggithub/pox_load_balancing. 
 However, when I did the implementing, I was new to programming and Open-flow. 
 I have to admit that the way I implemented isn't good at all, but It works. 
 Hope it give you a rough idea about how to start.
 
 If you want to do weight round-robin routing, you need to use other algorithm 
 to replace the Floyd-Warshall in POX.
 
 On Wed, Dec 31, 2014 at 12:56 AM, Amer amer7...@hotmail.com wrote:
 Hello,
 
 I want to understand the idea behind implementing ECMP in OF switches.
 Is there a command that is enabling OF to do hashing and counter based 
 routing?
 Is there a way to do round-robin routing or weight round-robin routing in OF 
 and POX? May you please tell me how?
 
 Best regards,
 Amer
 
 Sent from my iPhone
 
 
 
 -- 
 Thanks
 Tim



Re: [pox-dev] discovery module LLDP destination MAC address

2014-12-26 Thread Murphy McCauley
Yes, and it has been discussed before.  I've added the answer to the POX FAQ.

-- Murphy

On Dec 26, 2014, at 8:16 AM, tim huang pds...@gmail.com wrote:

 Hi,
 
 I'm working on discovery module, and found that the LLDP destination MAC 
 address is not the standard. Is there any particular reason to use 
 NDP_MULTICAST as the destination MAC address?
 
 -- 
 Thanks
 Tim



Re: [pox-dev] discovery module LLDP destination MAC address

2014-12-26 Thread Murphy McCauley
No trouble.  It should have been documented anyway!

-- Murphy

On Dec 26, 2014, at 11:03 AM, tim huang pds...@gmail.com wrote:

 Sorry to bother you. I should search archive firstly. Thanks for your patient 
 reply.
 On Fri, Dec 26, 2014 at 1:01 PM Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Yes, and it has been discussed before.  I've added the answer to the POX FAQ.
 
 -- Murphy
 
 On Dec 26, 2014, at 8:16 AM, tim huang pds...@gmail.com wrote:
 
  Hi,
 
  I'm working on discovery module, and found that the LLDP destination MAC 
  address is not the standard. Is there any particular reason to use 
  NDP_MULTICAST as the destination MAC address?
 
  --
  Thanks
  Tim
 



Re: [pox-dev] fast fail over type in group table

2014-12-20 Thread Murphy McCauley
I think you'd use the OVS bundle action with the NX_BD_ALG_ACTIVE_BACKUP 
algorithm.  POX doesn't currently have support for the bundle action, 
unfortunately.  Implementing it shouldn't be that hard; I just haven't had the 
time.

-- Murphy

On Dec 16, 2014, at 8:30 PM, Padma Jayasankar padmaj...@gmail.com wrote:

 Hi,
   Is it possible to incorporate fast fail over feature of openflow 1.1 in POX 
 using nicira's extensions.If so could u please provide some input about that.
 
 Thanks and Regards,
 Padma V



Re: [pox-dev] Over-writing table entries

2014-12-19 Thread Murphy McCauley
Or you could do the IP addresses as long as you also set the dl_type to be IP.

Any halfway recent version of POX will point out this mistake on the log with 
helpful information for fixing it.  If your version of POX didn't do this or 
you didn't read the log, you should consider upgrading and consider reading the 
log (especially warnings and errors).  Both of these will probably make your 
life easier.

Glad you got it working.

-- Murphy

On Dec 18, 2014, at 10:22 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 Thank you Murphy. Now its working. I have to mention the MAC addresses too.
 
 
 Best Regards.
 
 On Fri, Dec 19, 2014 at 8:39 AM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Did you read the third item in the FAQ?
 
 On Dec 18, 2014, at 8:14 AM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 My overall aim is to divert the traffic 
 
 I want two rules to get installed.
 1. if src address is equal to 10.0.0.2 and destination address is equal to 
 10.0.0.3, Then change the destination address to 30.0.0.2 and send it out of 
 port 3.
 
 2. If destination address is equal to 30.0.0.2 then send it out of port 1.
 I have only one action in 2nd rule.
 * So i want to install these two rules in the switches.
 
 I am matching fields on IP, So acc to that question I should put MAC address 
 too?? But isn't missing field means match everything? And if for a 
 machine/node IP is static, isn't it going to be the same machine/node every 
 time then why the need of MAC in my case?? 
 
 Please suggest me how can i put both the rules in the switches?
 
 Thanks and Best Regards. 
 
 On Thu, Dec 18, 2014 at 1:21 PM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Please see the second, third, and final entries in the POX FAQ.
 
 I also think the second entry you're trying to install has problems (too 
 many actions).
 
 -- Murphy
 
 On Dec 17, 2014, at 9:54 AM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 Hi all,
 
 I am using the following code to insert flowtable entires in switch. I want 
 to fill two table entries but the following code is only putting the last 
 one, may be overwriting the previously written. 
 How to resolve this?
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 from pox.lib.revent import *
 from pox.lib.util import dpidToStr
 from pox.lib.addresses import EthAddr
 from collections import namedtuple
 from pox.lib.addresses import IPAddr
 import os
 log = core.getLogger()
 class Diversion(EventMixin):
 def __init__ (self) :
 self.listenTo(core.openflow)
 log.debug(Enabling Diversion Module)
 def _handle_ConnectionUp (self, event):
 msg = of.ofp_flow_mod()
 msg1 = of.ofp_flow_mod()
 msg.match = of.ofp_match(nw_src = '10.0.0.2',nw_dst = '10.0.0.3')
 
 msg.actions.append(of.ofp_action_nw_addr.set_dst(IPAddr('30.0.0.2')))
 msg.actions.append(of.ofp_action_output(port = 3))
 msg.priority = 100
 event.connection.send(msg)
 msg.match = of.ofp_match(nw_dst = '30.0.0.2')
 msg.actions.append(of.ofp_action_output(port = 1))
 msg.priority = 100
 event.connection.send(msg)
 log.debug( rules installed on %s, dpidToStr(event.dpid))
 def launch():
 core.registerNew(Diversion)
 
 Thanks in advance.
 
 
 Best Regards.
 
 



Re: [pox-dev] Over-writing table entries

2014-12-18 Thread Murphy McCauley
Did you read the third item in the FAQ?

On Dec 18, 2014, at 8:14 AM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 My overall aim is to divert the traffic 
 
 I want two rules to get installed.
 1. if src address is equal to 10.0.0.2 and destination address is equal to 
 10.0.0.3, Then change the destination address to 30.0.0.2 and send it out of 
 port 3.
 
 2. If destination address is equal to 30.0.0.2 then send it out of port 1.
 I have only one action in 2nd rule.
 * So i want to install these two rules in the switches.
 
 I am matching fields on IP, So acc to that question I should put MAC address 
 too?? But isn't missing field means match everything? And if for a 
 machine/node IP is static, isn't it going to be the same machine/node every 
 time then why the need of MAC in my case?? 
 
 Please suggest me how can i put both the rules in the switches?
 
 Thanks and Best Regards. 
 
 On Thu, Dec 18, 2014 at 1:21 PM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Please see the second, third, and final entries in the POX FAQ.
 
 I also think the second entry you're trying to install has problems (too many 
 actions).
 
 -- Murphy
 
 On Dec 17, 2014, at 9:54 AM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 Hi all,
 
 I am using the following code to insert flowtable entires in switch. I want 
 to fill two table entries but the following code is only putting the last 
 one, may be overwriting the previously written. 
 How to resolve this?
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 from pox.lib.revent import *
 from pox.lib.util import dpidToStr
 from pox.lib.addresses import EthAddr
 from collections import namedtuple
 from pox.lib.addresses import IPAddr
 import os
 log = core.getLogger()
 class Diversion(EventMixin):
 def __init__ (self) :
 self.listenTo(core.openflow)
 log.debug(Enabling Diversion Module)
 def _handle_ConnectionUp (self, event):
 msg = of.ofp_flow_mod()
 msg1 = of.ofp_flow_mod()
 msg.match = of.ofp_match(nw_src = '10.0.0.2',nw_dst = '10.0.0.3')
 msg.actions.append(of.ofp_action_nw_addr.set_dst(IPAddr('30.0.0.2')))
 msg.actions.append(of.ofp_action_output(port = 3))
 msg.priority = 100
 event.connection.send(msg)
 msg.match = of.ofp_match(nw_dst = '30.0.0.2')
 msg.actions.append(of.ofp_action_output(port = 1))
 msg.priority = 100
 event.connection.send(msg)
 log.debug( rules installed on %s, dpidToStr(event.dpid))
 def launch():
 core.registerNew(Diversion)
 
 Thanks in advance.
 
 
 Best Regards.
 



Re: [pox-dev] Bideirectional Forwarding Detection(BFD) packets

2014-12-18 Thread Murphy McCauley
I'm not that familiar with it, but I think BFD is configured entirely through 
ovsdb.  In that case, you could do it out of band, or you could use the 
experimental POX OVSDB interface to do it.  It's currently in my fork 
(github/MurphyMc/pox experimental, I think), but it will probably be pulled 
into the eel branch soon.

-- Murphy

On Dec 16, 2014, at 11:34 PM, Padma Jayasankar padmaj...@gmail.com wrote:

 Hi,
   Is it possible to send BFD packets using POX controller?
 
  Actually i am working with fast failure recovery in openflow. I am trying to 
 use segment protection scheme which splits the working path into several 
 segments.For example the path ABCDE, can be split into ABC and DEF.When a 
 controller installs this working path ,BFD  packets has to be sent between A 
 to C and C to E to check for failures of link in these segments. Is this 
 possible in POX. Does any other controller supports this?
   Please provide some input.
 
 Thanks and Regards,
 Padma V
 



Re: [pox-dev] Over-writing table entries

2014-12-17 Thread Murphy McCauley
Please see the second, third, and final entries in the POX FAQ.

I also think the second entry you're trying to install has problems (too many 
actions).

-- Murphy

On Dec 17, 2014, at 9:54 AM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 Hi all,
 
 I am using the following code to insert flowtable entires in switch. I want 
 to fill two table entries but the following code is only putting the last 
 one, may be overwriting the previously written. 
 How to resolve this?
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 from pox.lib.revent import *
 from pox.lib.util import dpidToStr
 from pox.lib.addresses import EthAddr
 from collections import namedtuple
 from pox.lib.addresses import IPAddr
 import os
 log = core.getLogger()
 class Diversion(EventMixin):
 def __init__ (self) :
 self.listenTo(core.openflow)
 log.debug(Enabling Diversion Module)
 def _handle_ConnectionUp (self, event):
 msg = of.ofp_flow_mod()
 msg1 = of.ofp_flow_mod()
 msg.match = of.ofp_match(nw_src = '10.0.0.2',nw_dst = '10.0.0.3')
 msg.actions.append(of.ofp_action_nw_addr.set_dst(IPAddr('30.0.0.2')))
 msg.actions.append(of.ofp_action_output(port = 3))
 msg.priority = 100
 event.connection.send(msg)
 msg.match = of.ofp_match(nw_dst = '30.0.0.2')
 msg.actions.append(of.ofp_action_output(port = 1))
 msg.priority = 100
 event.connection.send(msg)
 log.debug( rules installed on %s, dpidToStr(event.dpid))
 def launch():
 core.registerNew(Diversion)
 
 Thanks in advance.
 
 
 Best Regards.



Re: [pox-dev] Issue with TimedRotatingFile Log Output

2014-12-16 Thread Murphy McCauley
Just pushed what's hopefully a fix to the eel branch.

-- Murphy

On Dec 16, 2014, at 1:47 PM, A Sydney asydney...@gmail.com wrote:

 Hi POX folks,
   The backupCount parameter of the TimedRotatingFile 
 log output does not function as expected. For example, from the link below, I 
 would expect 2 or so log files to exist. 
 
 http://codepad.org/DF9RI680
 
 However, the number of log files keep increasing. Can you provide feedback?
 
 Thanks,
 Ali 



Re: [pox-dev] Suggestions! Whats wrong with 2nd code?

2014-12-15 Thread Murphy McCauley
You're using an outdated version of POX (betta).  You should probably upgrade 
to dart or eel.

-- Murphy

On Dec 15, 2014, at 12:06 AM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 mininet@mininet-vm:~$ cd pox
 mininet@mininet-vm:~/pox$ pox.py log.level --DEBUG forwarding.l2_learning 
 diversion 
 [1] 4321
 mininet@mininet-vm:~/pox$ POX 0.1.0 (betta) / Copyright 2011-2013 James 
 McCauley, et al.
 DEBUG:diversion:Enabling Diversion Module
 DEBUG:core:POX 0.1.0 (betta) going up...
 DEBUG:core:Running on CPython (2.7.4/Apr 19 2013 18:28:01)
 DEBUG:core:Platform is Linux-3.8.0-19-generic-x86_64-with-Ubuntu-13.04-raring
 INFO:core:POX 0.1.0 (betta) is up.
 DEBUG:openflow.of_01:Listening on 0.0.0.0:6633
 INFO:openflow.of_01:[00-00-00-00-00-02 1] connected
 DEBUG:forwarding.l2_learning:Connection [00-00-00-00-00-02 1]
 DEBUG:diversion: rules installed on 00-00-00-00-00-02
 INFO:openflow.of_01:[00-00-00-00-00-03 3] connected
 DEBUG:forwarding.l2_learning:Connection [00-00-00-00-00-03 3]
 DEBUG:diversion: rules installed on 00-00-00-00-00-03
 INFO:openflow.of_01:[00-00-00-00-00-01 2] connected
 DEBUG:forwarding.l2_learning:Connection [00-00-00-00-00-01 2]
 
 This the log i am getting. Can you identify something from them? diversion 
 is my 2nd code which we are talking about. about attaching it.
 
 Thanks.
 
 
 On Mon, Dec 15, 2014 at 12:31 PM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 I'm not actually sure how the controller works at all in your example.
 
 This section of the Mininet documentation discusses using external OpenFlow 
 controllers:
 https://github.com/mininet/mininet/wiki/Introduction-to-Mininet#external-openflow-controllers
 
 Basically you can give it an external IP and port, and it'll set the switches 
 up to try to connect to a controller there.  The default (127.0.0.1:6633) is 
 fine if you want to run the controller on the same machine as Mininet.
 
 Then just run POX from the commandline as described in the POX manual.  If 
 you want, turn up the logging level to DEBUG using the log.level module as 
 described in the POX manual.
 
 -- Murphy
 
 On Dec 14, 2014, at 10:54 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 Can you suggest some points.
 Where should i run my POX controller? 
 Where you generally run your POX controller when using mininet?
 
 On Mon, Dec 15, 2014 at 12:14 PM, Murphy McCauley 
 murphy.mccau...@gmail.com wrote:
 Yup.  I'm sure there's something wrong with it.
 
 But trying to program POX without being able to read the log is like trying 
 to do a puzzle in the dark.
 
 Figure out how to read the log.
 
 -- Murphy
 
 On Dec 14, 2014, at 10:36 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 But there is some problem due to my 2nd code becuase when I ran the pox 
 without my 2nd code. All host were able to ping each other.
 Its when i installed a rule to the switch they stop pinging.
 
 On Mon, Dec 15, 2014 at 12:00 PM, Murphy McCauley 
 murphy.mccau...@gmail.com wrote:
 I don't know that.  Seems like a Mininet question.
 
 I always set up Mininet to use a remote controller and then just run POX 
 myself.  By default, POX displays its log on standard output.
 
 -- Murphy
 
 On Dec 14, 2014, at 10:27 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 I am new to SDN. How can i check to POX logs? 
 In mininet its just showing that POX is up and POX controller is connected 
 to all the switches.
 
 Thanks.
 
 On Mon, Dec 15, 2014 at 11:53 AM, Murphy McCauley 
 murphy.mccau...@gmail.com wrote:
 Does your POX log have any warnings or errors in it?  Those can be really 
 informative.
 
 -- Murphy
 
 On Dec 14, 2014, at 9:56 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 I have created a network using the following code, and pox as remote 
 controller with l2.learning module.
 
 
 #!/usr/bin/python
 from mininet.net import Mininet
 from mininet.node import Controller, RemoteController, OVSController
 from mininet.node import CPULimitedHost, Host, Node
 from mininet.node import OVSKernelSwitch, UserSwitch
 from mininet.node import IVSSwitch
 from mininet.cli import CLI
 from mininet.log import setLogLevel, info
 from mininet.link import TCLink, Intf
 
 def myNetwork():
 
 net = Mininet( topo=None,
build=False,
ipBase='10.0.0.0/8')
 
 #info( '*** Adding controller\n' )
 #c0=net.addController(name='c0',
  # controller=None)
 info( '*** Add switches\n')
 s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
 s2 = net.addSwitch('s2', cls=OVSKernelSwitch)
 s3 = net.addSwitch('s3', cls=OVSKernelSwitch)
 info( '*** Add hosts\n')
 
 h1 = net.addHost('h1', cls=Host, mac='00:00:00:00:00:01', 
 ip='10.0.0.2/24', defaultRoute='h1-eth0')
 h2 = net.addHost('h2', cls=Host, mac='00:00:00:00:00:02', 
 ip='10.0.0.3/24', defaultRoute='h2-eth0')
 h4 = net.addHost('h4', cls=Host, mac='00:00:00:00:00:04', 
 ip='20.0.0.3/24', defaultRoute

Re: [pox-dev] Suggestions! Whats wrong with 2nd code?

2014-12-14 Thread Murphy McCauley
Does your POX log have any warnings or errors in it?  Those can be really 
informative.

-- Murphy

On Dec 14, 2014, at 9:56 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 I have created a network using the following code, and pox as remote 
 controller with l2.learning module.
 
 
 #!/usr/bin/python
 from mininet.net import Mininet
 from mininet.node import Controller, RemoteController, OVSController
 from mininet.node import CPULimitedHost, Host, Node
 from mininet.node import OVSKernelSwitch, UserSwitch
 from mininet.node import IVSSwitch
 from mininet.cli import CLI
 from mininet.log import setLogLevel, info
 from mininet.link import TCLink, Intf
 
 def myNetwork():
 
 net = Mininet( topo=None,
build=False,
ipBase='10.0.0.0/8')
 
 #info( '*** Adding controller\n' )
 #c0=net.addController(name='c0',
  # controller=None)
 info( '*** Add switches\n')
 s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
 s2 = net.addSwitch('s2', cls=OVSKernelSwitch)
 s3 = net.addSwitch('s3', cls=OVSKernelSwitch)
 info( '*** Add hosts\n')
 
 h1 = net.addHost('h1', cls=Host, mac='00:00:00:00:00:01', 
 ip='10.0.0.2/24', defaultRoute='h1-eth0')
 h2 = net.addHost('h2', cls=Host, mac='00:00:00:00:00:02', 
 ip='10.0.0.3/24', defaultRoute='h2-eth0')
 h4 = net.addHost('h4', cls=Host, mac='00:00:00:00:00:04', 
 ip='20.0.0.3/24', defaultRoute='h4-eth0')
 h3 = net.addHost('h3', cls=Host, mac='00:00:00:00:00:03', 
 ip='30.0.0.2/24', defaultRoute='h3-eth0')
 h5 = net.addHost('h5', cls=Host, mac='00:00:00:00:00:05', 
 ip='20.0.0.3/24', defaultRoute='h5-eth0')
 
 info( '*** Add links\n')
 linkBW = {'bw':100}
 net.addLink(h1, s1, cls=TCLink , **linkBW)
 net.addLink(h2, s1, cls=TCLink , **linkBW)
 net.addLink(h3, s2, cls=TCLink , **linkBW)
 net.addLink(h4, s3, cls=TCLink , **linkBW)
 net.addLink(h5, s3, cls=TCLink , **linkBW)
 net.addLink(s1, s2, cls=TCLink , **linkBW)
 net.addLink(s3, s2, cls=TCLink , **linkBW)
 info( '*** Starting network\n')
 net.build()
 #info( '*** Starting controllers\n')
 #for controller in net.controllers:
  #   controller.start()
 info( '*** Starting switches\n')
 net.get('s1')#.start([c0])
 net.get('s2')#.start([c0])
 net.get('s3')#.start([c0])
 info( '*** Configuring switches\n')
 
 CLI(net)
 net.stop()
 
 if __name__ == '__main__':
 setLogLevel( 'info' )
 myNetwork()
 
 
 I am able to ping to each other.
 But now I want add an entry to all switch. If h2 sends packet to h3 then 
 divert it to h5 on the basis of IP addresses by the following code.
 
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 from pox.lib.revent import *
 from pox.lib.util import dpidToStr
 from pox.lib.addresses import EthAddr
 from collections import namedtuple
 import os
 
 log = core.getLogger()
 
 class Diversion(EventMixin):
 def __init__ (self) :
 self.listenTo(core.openflow)
 log.debug(Enabling Diversion Module)
 
 def _handle_ConnectionUp (self, event):
 msg = of.ofp_flow_mod()
 msg.match = of.ofp_match(nw_src = IPAddr(10.0.0.3),nw_dst = 
 IPAddr(10.0.0.3))
 msg.actions.append(ofp_action_nw_addr.set_dst(IPAddr(192.168.1.14)))
 self.connection.send(msg)
 log.debug( rules installed on %s, dpidToStr(event.dpid))
 
 def launch():
 core.registerNew(Diversion)
 
 
 But now i am not able to ping any of the host..
 
 Please direct me to the error.
 
 
 Thanks and Regards.



Re: [pox-dev] Suggestions! Whats wrong with 2nd code?

2014-12-14 Thread Murphy McCauley
I don't know that.  Seems like a Mininet question.

I always set up Mininet to use a remote controller and then just run POX 
myself.  By default, POX displays its log on standard output.

-- Murphy

On Dec 14, 2014, at 10:27 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 I am new to SDN. How can i check to POX logs? 
 In mininet its just showing that POX is up and POX controller is connected to 
 all the switches.
 
 Thanks.
 
 On Mon, Dec 15, 2014 at 11:53 AM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Does your POX log have any warnings or errors in it?  Those can be really 
 informative.
 
 -- Murphy
 
 On Dec 14, 2014, at 9:56 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 I have created a network using the following code, and pox as remote 
 controller with l2.learning module.
 
 
 #!/usr/bin/python
 from mininet.net import Mininet
 from mininet.node import Controller, RemoteController, OVSController
 from mininet.node import CPULimitedHost, Host, Node
 from mininet.node import OVSKernelSwitch, UserSwitch
 from mininet.node import IVSSwitch
 from mininet.cli import CLI
 from mininet.log import setLogLevel, info
 from mininet.link import TCLink, Intf
 
 def myNetwork():
 
 net = Mininet( topo=None,
build=False,
ipBase='10.0.0.0/8')
 
 #info( '*** Adding controller\n' )
 #c0=net.addController(name='c0',
  # controller=None)
 info( '*** Add switches\n')
 s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
 s2 = net.addSwitch('s2', cls=OVSKernelSwitch)
 s3 = net.addSwitch('s3', cls=OVSKernelSwitch)
 info( '*** Add hosts\n')
 
 h1 = net.addHost('h1', cls=Host, mac='00:00:00:00:00:01', 
 ip='10.0.0.2/24', defaultRoute='h1-eth0')
 h2 = net.addHost('h2', cls=Host, mac='00:00:00:00:00:02', 
 ip='10.0.0.3/24', defaultRoute='h2-eth0')
 h4 = net.addHost('h4', cls=Host, mac='00:00:00:00:00:04', 
 ip='20.0.0.3/24', defaultRoute='h4-eth0')
 h3 = net.addHost('h3', cls=Host, mac='00:00:00:00:00:03', 
 ip='30.0.0.2/24', defaultRoute='h3-eth0')
 h5 = net.addHost('h5', cls=Host, mac='00:00:00:00:00:05', 
 ip='20.0.0.3/24', defaultRoute='h5-eth0')
 
 info( '*** Add links\n')
 linkBW = {'bw':100}
 net.addLink(h1, s1, cls=TCLink , **linkBW)
 net.addLink(h2, s1, cls=TCLink , **linkBW)
 net.addLink(h3, s2, cls=TCLink , **linkBW)
 net.addLink(h4, s3, cls=TCLink , **linkBW)
 net.addLink(h5, s3, cls=TCLink , **linkBW)
 net.addLink(s1, s2, cls=TCLink , **linkBW)
 net.addLink(s3, s2, cls=TCLink , **linkBW)
 info( '*** Starting network\n')
 net.build()
 #info( '*** Starting controllers\n')
 #for controller in net.controllers:
  #   controller.start()
 info( '*** Starting switches\n')
 net.get('s1')#.start([c0])
 net.get('s2')#.start([c0])
 net.get('s3')#.start([c0])
 info( '*** Configuring switches\n')
 
 CLI(net)
 net.stop()
 
 if __name__ == '__main__':
 setLogLevel( 'info' )
 myNetwork()
 
 
 I am able to ping to each other.
 But now I want add an entry to all switch. If h2 sends packet to h3 then 
 divert it to h5 on the basis of IP addresses by the following code.
 
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 from pox.lib.revent import *
 from pox.lib.util import dpidToStr
 from pox.lib.addresses import EthAddr
 from collections import namedtuple
 import os
 
 log = core.getLogger()
 
 class Diversion(EventMixin):
 def __init__ (self) :
 self.listenTo(core.openflow)
 log.debug(Enabling Diversion Module)
 
 def _handle_ConnectionUp (self, event):
 msg = of.ofp_flow_mod()
 msg.match = of.ofp_match(nw_src = IPAddr(10.0.0.3),nw_dst = 
 IPAddr(10.0.0.3))
 
 msg.actions.append(ofp_action_nw_addr.set_dst(IPAddr(192.168.1.14)))
 self.connection.send(msg)
 log.debug( rules installed on %s, dpidToStr(event.dpid))
 
 def launch():
 core.registerNew(Diversion)
 
 
 But now i am not able to ping any of the host..
 
 Please direct me to the error.
 
 
 Thanks and Regards.
 



Re: [pox-dev] Suggestions! Whats wrong with 2nd code?

2014-12-14 Thread Murphy McCauley
Yup.  I'm sure there's something wrong with it.

But trying to program POX without being able to read the log is like trying to 
do a puzzle in the dark.

Figure out how to read the log.

-- Murphy

On Dec 14, 2014, at 10:36 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 But there is some problem due to my 2nd code becuase when I ran the pox 
 without my 2nd code. All host were able to ping each other.
 Its when i installed a rule to the switch they stop pinging.
 
 On Mon, Dec 15, 2014 at 12:00 PM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 I don't know that.  Seems like a Mininet question.
 
 I always set up Mininet to use a remote controller and then just run POX 
 myself.  By default, POX displays its log on standard output.
 
 -- Murphy
 
 On Dec 14, 2014, at 10:27 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 I am new to SDN. How can i check to POX logs? 
 In mininet its just showing that POX is up and POX controller is connected 
 to all the switches.
 
 Thanks.
 
 On Mon, Dec 15, 2014 at 11:53 AM, Murphy McCauley 
 murphy.mccau...@gmail.com wrote:
 Does your POX log have any warnings or errors in it?  Those can be really 
 informative.
 
 -- Murphy
 
 On Dec 14, 2014, at 9:56 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 I have created a network using the following code, and pox as remote 
 controller with l2.learning module.
 
 
 #!/usr/bin/python
 from mininet.net import Mininet
 from mininet.node import Controller, RemoteController, OVSController
 from mininet.node import CPULimitedHost, Host, Node
 from mininet.node import OVSKernelSwitch, UserSwitch
 from mininet.node import IVSSwitch
 from mininet.cli import CLI
 from mininet.log import setLogLevel, info
 from mininet.link import TCLink, Intf
 
 def myNetwork():
 
 net = Mininet( topo=None,
build=False,
ipBase='10.0.0.0/8')
 
 #info( '*** Adding controller\n' )
 #c0=net.addController(name='c0',
  # controller=None)
 info( '*** Add switches\n')
 s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
 s2 = net.addSwitch('s2', cls=OVSKernelSwitch)
 s3 = net.addSwitch('s3', cls=OVSKernelSwitch)
 info( '*** Add hosts\n')
 
 h1 = net.addHost('h1', cls=Host, mac='00:00:00:00:00:01', 
 ip='10.0.0.2/24', defaultRoute='h1-eth0')
 h2 = net.addHost('h2', cls=Host, mac='00:00:00:00:00:02', 
 ip='10.0.0.3/24', defaultRoute='h2-eth0')
 h4 = net.addHost('h4', cls=Host, mac='00:00:00:00:00:04', 
 ip='20.0.0.3/24', defaultRoute='h4-eth0')
 h3 = net.addHost('h3', cls=Host, mac='00:00:00:00:00:03', 
 ip='30.0.0.2/24', defaultRoute='h3-eth0')
 h5 = net.addHost('h5', cls=Host, mac='00:00:00:00:00:05', 
 ip='20.0.0.3/24', defaultRoute='h5-eth0')
 
 info( '*** Add links\n')
 linkBW = {'bw':100}
 net.addLink(h1, s1, cls=TCLink , **linkBW)
 net.addLink(h2, s1, cls=TCLink , **linkBW)
 net.addLink(h3, s2, cls=TCLink , **linkBW)
 net.addLink(h4, s3, cls=TCLink , **linkBW)
 net.addLink(h5, s3, cls=TCLink , **linkBW)
 net.addLink(s1, s2, cls=TCLink , **linkBW)
 net.addLink(s3, s2, cls=TCLink , **linkBW)
 info( '*** Starting network\n')
 net.build()
 #info( '*** Starting controllers\n')
 #for controller in net.controllers:
  #   controller.start()
 info( '*** Starting switches\n')
 net.get('s1')#.start([c0])
 net.get('s2')#.start([c0])
 net.get('s3')#.start([c0])
 info( '*** Configuring switches\n')
 
 CLI(net)
 net.stop()
 
 if __name__ == '__main__':
 setLogLevel( 'info' )
 myNetwork()
 
 
 I am able to ping to each other.
 But now I want add an entry to all switch. If h2 sends packet to h3 then 
 divert it to h5 on the basis of IP addresses by the following code.
 
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 from pox.lib.revent import *
 from pox.lib.util import dpidToStr
 from pox.lib.addresses import EthAddr
 from collections import namedtuple
 import os
 
 log = core.getLogger()
 
 class Diversion(EventMixin):
 def __init__ (self) :
 self.listenTo(core.openflow)
 log.debug(Enabling Diversion Module)
 
 def _handle_ConnectionUp (self, event):
 msg = of.ofp_flow_mod()
 msg.match = of.ofp_match(nw_src = IPAddr(10.0.0.3),nw_dst = 
 IPAddr(10.0.0.3))
 
 msg.actions.append(ofp_action_nw_addr.set_dst(IPAddr(192.168.1.14)))
 self.connection.send(msg)
 log.debug( rules installed on %s, dpidToStr(event.dpid))
 
 def launch():
 core.registerNew(Diversion)
 
 
 But now i am not able to ping any of the host..
 
 Please direct me to the error.
 
 
 Thanks and Regards.
 
 



Re: [pox-dev] Suggestions! Whats wrong with 2nd code?

2014-12-14 Thread Murphy McCauley
I'm not actually sure how the controller works at all in your example.

This section of the Mininet documentation discusses using external OpenFlow 
controllers:
https://github.com/mininet/mininet/wiki/Introduction-to-Mininet#external-openflow-controllers

Basically you can give it an external IP and port, and it'll set the switches 
up to try to connect to a controller there.  The default (127.0.0.1:6633) is 
fine if you want to run the controller on the same machine as Mininet.

Then just run POX from the commandline as described in the POX manual.  If you 
want, turn up the logging level to DEBUG using the log.level module as 
described in the POX manual.

-- Murphy

On Dec 14, 2014, at 10:54 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
wrote:

 Can you suggest some points.
 Where should i run my POX controller? 
 Where you generally run your POX controller when using mininet?
 
 On Mon, Dec 15, 2014 at 12:14 PM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 Yup.  I'm sure there's something wrong with it.
 
 But trying to program POX without being able to read the log is like trying 
 to do a puzzle in the dark.
 
 Figure out how to read the log.
 
 -- Murphy
 
 On Dec 14, 2014, at 10:36 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 But there is some problem due to my 2nd code becuase when I ran the pox 
 without my 2nd code. All host were able to ping each other.
 Its when i installed a rule to the switch they stop pinging.
 
 On Mon, Dec 15, 2014 at 12:00 PM, Murphy McCauley 
 murphy.mccau...@gmail.com wrote:
 I don't know that.  Seems like a Mininet question.
 
 I always set up Mininet to use a remote controller and then just run POX 
 myself.  By default, POX displays its log on standard output.
 
 -- Murphy
 
 On Dec 14, 2014, at 10:27 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 I am new to SDN. How can i check to POX logs? 
 In mininet its just showing that POX is up and POX controller is connected 
 to all the switches.
 
 Thanks.
 
 On Mon, Dec 15, 2014 at 11:53 AM, Murphy McCauley 
 murphy.mccau...@gmail.com wrote:
 Does your POX log have any warnings or errors in it?  Those can be really 
 informative.
 
 -- Murphy
 
 On Dec 14, 2014, at 9:56 PM, chaitanya tanwar chaitanya.tan...@gmail.com 
 wrote:
 
 I have created a network using the following code, and pox as remote 
 controller with l2.learning module.
 
 
 #!/usr/bin/python
 from mininet.net import Mininet
 from mininet.node import Controller, RemoteController, OVSController
 from mininet.node import CPULimitedHost, Host, Node
 from mininet.node import OVSKernelSwitch, UserSwitch
 from mininet.node import IVSSwitch
 from mininet.cli import CLI
 from mininet.log import setLogLevel, info
 from mininet.link import TCLink, Intf
 
 def myNetwork():
 
 net = Mininet( topo=None,
build=False,
ipBase='10.0.0.0/8')
 
 #info( '*** Adding controller\n' )
 #c0=net.addController(name='c0',
  # controller=None)
 info( '*** Add switches\n')
 s1 = net.addSwitch('s1', cls=OVSKernelSwitch)
 s2 = net.addSwitch('s2', cls=OVSKernelSwitch)
 s3 = net.addSwitch('s3', cls=OVSKernelSwitch)
 info( '*** Add hosts\n')
 
 h1 = net.addHost('h1', cls=Host, mac='00:00:00:00:00:01', 
 ip='10.0.0.2/24', defaultRoute='h1-eth0')
 h2 = net.addHost('h2', cls=Host, mac='00:00:00:00:00:02', 
 ip='10.0.0.3/24', defaultRoute='h2-eth0')
 h4 = net.addHost('h4', cls=Host, mac='00:00:00:00:00:04', 
 ip='20.0.0.3/24', defaultRoute='h4-eth0')
 h3 = net.addHost('h3', cls=Host, mac='00:00:00:00:00:03', 
 ip='30.0.0.2/24', defaultRoute='h3-eth0')
 h5 = net.addHost('h5', cls=Host, mac='00:00:00:00:00:05', 
 ip='20.0.0.3/24', defaultRoute='h5-eth0')
 
 info( '*** Add links\n')
 linkBW = {'bw':100}
 net.addLink(h1, s1, cls=TCLink , **linkBW)
 net.addLink(h2, s1, cls=TCLink , **linkBW)
 net.addLink(h3, s2, cls=TCLink , **linkBW)
 net.addLink(h4, s3, cls=TCLink , **linkBW)
 net.addLink(h5, s3, cls=TCLink , **linkBW)
 net.addLink(s1, s2, cls=TCLink , **linkBW)
 net.addLink(s3, s2, cls=TCLink , **linkBW)
 info( '*** Starting network\n')
 net.build()
 #info( '*** Starting controllers\n')
 #for controller in net.controllers:
  #   controller.start()
 info( '*** Starting switches\n')
 net.get('s1')#.start([c0])
 net.get('s2')#.start([c0])
 net.get('s3')#.start([c0])
 info( '*** Configuring switches\n')
 
 CLI(net)
 net.stop()
 
 if __name__ == '__main__':
 setLogLevel( 'info' )
 myNetwork()
 
 
 I am able to ping to each other.
 But now I want add an entry to all switch. If h2 sends packet to h3 then 
 divert it to h5 on the basis of IP addresses by the following code.
 
 
 from pox.core import core
 import pox.openflow.libopenflow_01 as of
 from pox.lib.revent import *
 from pox.lib.util import dpidToStr
 from pox.lib.addresses import EthAddr
 from

Re: [pox-dev] how pox update counter in active flow table

2014-12-12 Thread Murphy McCauley
No part of the POX framework tracks counter values.  You can ask the switches 
to send results.  Switches send the counters.  You can see the counters the 
switches send.  That's it.  For more information on OpenFlow's counters, see 
the OpenFlow specification.

-- Murphy

On Dec 12, 2014, at 12:03 AM, nor masri sahri masri.sa...@gmail.com wrote:

 hi all, when POX decide the forwarding rules, it has capability to send 
 statistic request message to gather per flow statistic (duration, bytes, 
 packet count,etc) from all OF switches. For example during initialization, at 
 t=1, the value of bytes counter of OF switch is 10, so the controller update 
 the counter value in the controller to 10. At t=2, the value has change to 
 30, so when the controller get the new value updated by the switches, it will 
 replace the previous value (10) to new value (30).
 My question is, how the controller decide to update the counter value for 
 each flow entries it stored in the controller? How is the value replacement 
 mechanism?for example, does it use EWMA (moving average calculation) to 
 replace to new value? please advice, thanks
 
 -- 
 Regards,
 
 masri.sahri
 



Re: [pox-dev] forwarding the traffic

2014-11-30 Thread Murphy McCauley
This sounds like it's strictly Ethernet-address based, so I might start with 
l2_pairs instead of l2_learning.

Before doing a packet-out or flow-mod, check if the destination is to the host 
that you're diverting traffic for (h3 in your example).  If so, put an dl_dst 
to rewrite the MAC to the intermediary (h2 in your example), and set the output 
action to be the port that leads to the intermediary (again, h2 in your 
example).

The gotcha here is that you'll need to know h2's port and MAC before you can do 
the above.  You could just take them as commandline parameters or something.  
Or if you knew the MAC but not the port, you could have the controller ARP for 
it or something...

-- Murphy

On Nov 30, 2014, at 8:43 AM, Ali Reza Zamani az...@cs.rutgers.edu wrote:

 Thanks Murphy for your response.
 The reason that I said I want to use l2_learning is that I want to have the 
 learning behavior and I just want to forward some of the traffic for one of 
 the hosts to other host and the rest of the network should work with 
 l2_learning.
 
 Regards,
 
 On 11/29/14 8:02 PM, Murphy McCauley wrote:
 This doesn't sound like learning behavior.  Do you just want to set up the 
 table by hand?  Do that by just crafting a flow_mod for each direction of 
 communication.  Match on a destination MAC address, and include actions to 
 change the dl_dst (possibly) and send out a specific port (definitely).
 
 -- Murphy
 
 On Nov 29, 2014, at 4:55 PM, Ali Reza Zamani az...@cs.rutgers.edu wrote:
 
 Hi,
 
 I have a question regarding the changing the destination of the packet in 
 the switches. I am using l2_learning controller in pox. I was wondering how 
 can I forward packet to one host to another host. For example if I have 3 
 hosts e.g h1 h2 h3; and if h1 ping h3 the traffic should go from h1 to h2 
 and then h2 sends it to h3.
 
 Thanks,
 
 



Re: [pox-dev] forwarding the traffic

2014-11-29 Thread Murphy McCauley
This doesn't sound like learning behavior.  Do you just want to set up the 
table by hand?  Do that by just crafting a flow_mod for each direction of 
communication.  Match on a destination MAC address, and include actions to 
change the dl_dst (possibly) and send out a specific port (definitely).

-- Murphy

On Nov 29, 2014, at 4:55 PM, Ali Reza Zamani az...@cs.rutgers.edu wrote:

 Hi,
 
 I have a question regarding the changing the destination of the packet in the 
 switches. I am using l2_learning controller in pox. I was wondering how can I 
 forward packet to one host to another host. For example if I have 3 hosts e.g 
 h1 h2 h3; and if h1 ping h3 the traffic should go from h1 to h2 and then h2 
 sends it to h3.
 
 Thanks,
 



Re: [pox-dev] inserting specific rules to specific switch

2014-11-24 Thread Murphy McCauley
You might find the OpenFlow in POX section of the manual helpful.  Especially 
the first two subsections and the OpenFlow Messages/ofp_flow_mod subsubsection.

-- Murphy

On Nov 24, 2014, at 2:58 PM, Ali Reza Zamani az...@cs.rutgers.edu wrote:

 Hi all,
 
 I have a question regarding defining the rules for a switch in in Pox 
 controller.
 I am running my data plane using mininet. How can I insert some forwarding 
 rule for the switches. for example I want that all of the packet which are 
 using destination port xx forwarded to specific host.
 Howe can I define these kinds of rules?
 Also how can I insert the rules for the specific switches and not all of them.
 
 Thank you in advance,
 Ali



[pox-dev] New branch: POX eel

2014-11-19 Thread Murphy McCauley
Just a note that POX has a new branch -- eel -- where I'll be pushing my own 
new development and possibly merging some of the stuff in my private branches 
and my public fork.  In fact, it's already gotten some.

Sadly, I don't think dart has been pushed on as much as I'd like before calling 
it a release, so I'm not *immediately* planning to roll it over.  But I'm not 
immediately planning to push any new development there either.

This may be mostly academic -- as noted in a recent github issue, POX 
development on my side has been slow lately.  Just thought I'd make a note that 
if anyone wants to be bleeding edge, you should switch branches. :)

-- Murphy

Re: [pox-dev] pox console with ipython

2014-11-17 Thread Murphy McCauley
How about replacing the code.interact() call in py.py with...
from IPython import embed
embed(user_global_ns=self.variables)
?

(And then just running POX with py as usual -- not using ipython to run it.)

As a starting point, anyway.  I'm not sure of the semantics for user_global_ns 
are exactly right here.

We could add an --ipython argument to launch() which tries to do this and falls 
back if it's unavailable.

-- Murphy

On Nov 17, 2014, at 9:24 AM, Alison Chan chan7...@kettering.edu wrote:

 ipython pox.py 'works' as in pox starts up, but doesn't give me the
 nice features of ipython like object? for object details. It also
 doesn't tab complete pox objects like core.openflow.
 
 alisonc $ ipython pox.py py openflow.of_01
 POX 0.3.0 (dart) / Copyright 2011-2014 James McCauley, et al.
 INFO:core:POX 0.3.0 (dart) is up.
 Ready.
 POX core?
  File console, line 1
core?
^
 SyntaxError: invalid syntax
 
 ./pox.py py --completion also doesn't tab complete stuff.
 
 Cheers,
 Alison
 
 2014-11-14 21:59 GMT-05:00 Murphy McCauley murphy.mccau...@gmail.com:
 At one point, I think I made some tweaks to make sure that it worked with 
 ipython if you just run ipython pox.py.  Have you tried that?  Maybe it's 
 gotten broken -- I'll admit to not testing that regularly (ever :) ).
 
 Also if you run py --completion, you can often get some tab-completion with 
 even without ipython.
 
 -- Murphy
 
 On Nov 14, 2014, at 1:07 PM, Alison Chan chan7...@kettering.edu wrote:
 
 Hey pox-dev,
 
 Is there any component that is like py, but provides the enhanced
 features of the ipython console? I often use the py console to push
 static flows and prototype stuff before it goes into my real
 controller code, but I especially miss the tab completion that ipython
 gives me.
 
 If there is such a component, then awesome, but if not, then I could
 write one and send a PR.
 
 Cheers,
 --
 Alison Chan
 Kettering University
 chan7...@kettering.edu
 +1 909 278 7753
 
 
 
 
 -- 
 Alison Chan
 Kettering University
 chan7...@kettering.edu
 +1 909 278 7753



Re: [pox-dev] pox console with ipython

2014-11-14 Thread Murphy McCauley
At one point, I think I made some tweaks to make sure that it worked with 
ipython if you just run ipython pox.py.  Have you tried that?  Maybe it's 
gotten broken -- I'll admit to not testing that regularly (ever :) ).

Also if you run py --completion, you can often get some tab-completion with 
even without ipython.

-- Murphy

On Nov 14, 2014, at 1:07 PM, Alison Chan chan7...@kettering.edu wrote:

 Hey pox-dev,
 
 Is there any component that is like py, but provides the enhanced
 features of the ipython console? I often use the py console to push
 static flows and prototype stuff before it goes into my real
 controller code, but I especially miss the tab completion that ipython
 gives me.
 
 If there is such a component, then awesome, but if not, then I could
 write one and send a PR.
 
 Cheers,
 -- 
 Alison Chan
 Kettering University
 chan7...@kettering.edu
 +1 909 278 7753



Re: [pox-dev] traffic rate of a flow

2014-11-09 Thread Murphy McCauley
Sorry, I guess I missed this until just now.  But there's some discussion of 
the same topic in another thread which has been active today.

-- Murphy

On Nov 5, 2014, at 6:16 AM, farshad tajedin farshad.taje...@gmail.com wrote:

 hi
 how i can find traffic rate of a flow in pox?
 
 -- 
 Best Regards
 
 Farshad Tajedin



Re: [pox-dev] Raising LinkEvents when openflow.discovery handles a port status removed

2014-11-07 Thread Murphy McCauley
You're not off base.  This has actually *almost* reached the mainline in the 
form of a fast_discovery component which subclasses/tweaks some stuff from 
discovery, but just never quite has.  I wanted the code a bit cleaner than it 
was, and I think there were some subtleties I wanted to get right (since you 
can, for example, send LLDPs on a link immediately after it goes up in order to 
speed re-discovery, etc.).

We've also had a variant which uses discovery to find the topology *once* and 
then stops and assumes that anything from then on are just up/downs of the 
discovered topology (no changes).  This was especially nice with, e.g., Mininet.

-- Murphy

On Nov 7, 2014, at 2:20 PM, Alison Chan chan7...@kettering.edu wrote:

 Hello,
 
 Would it be useful for openflow.discovery to raise LinkEvents when it
 detects a switch port going down? Currently, it only raises LinkEvents
 for removals when a link times out, which could be several seconds
 after the link actually goes down. I would think it would be of some
 value to raise a LinkEvent immediately on detecting that the switch
 port went down. Am I way off base here?
 
 Cheers,
 -- 
 Alison Chan
 Kettering University
 chan7...@kettering.edu
 +1 909 278 7753



Re: [pox-dev] Creating and Raising Custom Events

2014-11-05 Thread Murphy McCauley

On Nov 5, 2014, at 2:48 AM, Adam Pavlidis adampavli...@gmail.com wrote:

 I also found it strange that i get no error message whatsoever.
 I was always running POX with --verbose plus log.level —DEBUG, 
 and i did not use .raiseEventNoErrors() method.
 
 I haven't really given much thought on how i want the events to be
 raised, i experimented a little in order to find a way that works.
 
 Adding the CustomEvent, in the _eventMixin set of OpenFlowNexus and
 did the trick.
 
 In the end it doesn’t really matter for me which way the event is raised.
 I have a module, with 2 distinct functions.
 Flow removal that is called automatically
 Flow insertion that has to be manually called everywhere a new flow is added.
 I used the same logic as FlowRemoved, PacketIn e.t.c. events/handlers,
 so i added the following lines in of_01.py
 
 def handle_CUSTOM_EVENT (con, msg): #A
   e = con.ofnexus.raiseEvent(
 CustomEvent, con, msg)
   if e is None or e.halt != True:
 con.raiseEvent(CustomEvent, con, msg)
 
 and in order to call the above (e.g. l2_learning):
 
 of_01.handle_CUSTOM_EVENT(event.connection, msg)
 
 The above doesn't work unless i delete the arguments in handle_CUSTOM_EVENT().
 Traceback is:
 
   File /home/mininet/pox/pox/lib/revent/revent.py, line 234, in
 raiseEventNoErrors
 
 return self.raiseEvent(event, *args, **kw)
 
   File /home/mininet/pox/pox/lib/revent/revent.py, line 281, in raiseEvent
 
 rv = event._invoke(handler, *args, **kw)
 
   File /home/mininet/pox/pox/lib/revent/revent.py, line 159, in _invoke
 
 return handler(self, *args, **kw)
 
   File /home/mininet/pox/pox/forwarding/l2_learning.py, line 182, in
 _handle_PacketIn
 
 of_01.handle_CUSTOM_EVENT(event.connection, msg)
 
   File /home/mininet/pox/pox/openflow/of_01.py, line 68, in
 handle_CUSTOM_EVENT
 
 e = con.ofnexus.raiseEvent(CustomEvent, con, msg)
 
   File /home/mininet/pox/pox/lib/revent/revent.py, line 265, in raiseEvent
 
 event = eventType(*args, **kw)
 
 TypeError: __init__() takes exactly 1 argument (3 given)
 
 
 From what i understand raiseEvent method expects 1 argument but
 receives 3. I don't understand however why handle_PACKET_IN/FLOW_REMOVED
 get to .raiseEventNoErrors the exact same way, and no TypeError occurs.

Not quite.  What it's actually talking about here is the constructor for the 
event class itself.  In your case, I am guessing your CustomEvent.__init__() 
just took self.  You'll want to add additional parameters.  As you say below, 
you want the match, so you'd pass that into your event object's constructor.

Something to keep in mind:
foo.raiseEvent(BarEvent, spam, eggs)
.. is more or less the same as...
new_event = BarEvent(spam, eggs)
foo.raiseEvent(new_event)

The latter is perhaps a bit easier to understand, though.

 Truth is i don't need the connection part, but is necessary for my
 module that the msg.match object representing the flow that is installed is
 passed to the handler. 
 
 def _handle_CustomEvent(self, msg):
 
 I don’t know if what i did is conceptually correct or if there is a
 cleaner way (programming-wise). I just thought that using a separate
 module instead of hard-coding the actions i need executed was better,
 considering i will also be able to pass some arguments from the CLI to
 the module less painfully, e.g. misc.CustomModule --server_hostname. 
 
 I would greatly appreciate your opinion on this.

If there's no compelling reason, I think you shouldn't mess with of_01/openflow 
at all.  Keep your events within your own module.  Have your component register 
itself on core, and raise your two new event types on your component instead of 
on the OpenFlowNexus or Connection.  Other components can listen there.

 Thanks for all your help so far,
 Adam Pavlidis
 
 On Tue, Nov 4, 2014 at 12:42 AM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 I'm a bit surprised that you're getting no result at all as opposed to, say, 
 exceptions in the POX log.  Have you tried turning logging to DEBUG level and 
 reading through to make sure there are no hints as to what might be going 
 wrong?  It's possible that raiseEventNoErrors() is masking the exceptions.  
 You might try at least temporarily replacing such calls with just plain 
 raiseEvent().
 
 It looks like you want these events to be raised using the same sources as 
 normal OpenFlow events.  Normally, sources need to be aware of the events 
 they'll be raising.  In your case, these sources are the Connection (in 
 of_01) and OpenFlowNexus (in openflow/__init__) classes.  Have you added your 
 event to their set of _eventMixin_events?
 
 On Nov 3, 2014, at 2:15 AM, Adam Pavlidis adampavli...@gmail.com wrote:
 
  Hello,
 
  i am trying to implement a controller module that handles two types of 
  Events:
  the already existing FlowRemoved and another of my own creation
  CustomEvent that i will execute in various circumstances.
 
  I have read the section on custom events contained in the POX manual

Re: [pox-dev] msg.match.tp_dst is None

2014-11-04 Thread Murphy McCauley
You should probably take a look at the POX FAQ.  The second and third questions 
probably directly relate.

-- Murphy

On Nov 4, 2014, at 11:30 PM, farshad tajedin farshad.taje...@gmail.com wrote:

 hi all
 i have a problem with add_flow entry in my switches. this is my code:
 
 msg=of.ofp_flow_mod()
 msg.match.nw_src=something
 msg.match.nw_dst=something
 msg.match.tp_dst=21
 msg.match.tp_src=somthing
 msg.actions.append(of.ofp_action_output(port=something))
 
 
 and i send this msg to switch, when i read flow entry of switch 
 msg.match.tp_src and msg.match.tp_dst are None. i dont know why 
 Best Regards
 
 Farshad Tajedin



Re: [pox-dev] msg.match.tp_dst is None

2014-11-04 Thread Murphy McCauley
Sure.  http://noxrepo.org/faq

You can also find it under the POX menu on POX's official website 
(noxrepo.org), or through many search engines with the term POX FAQ.

-- Murphy

On Nov 4, 2014, at 11:39 PM, farshad tajedin farshad.taje...@gmail.com wrote:

 tanks can you give me a link? 
 
 On Wed, Nov 5, 2014 at 11:03 AM, Murphy McCauley murphy.mccau...@gmail.com 
 wrote:
 You should probably take a look at the POX FAQ.  The second and third 
 questions probably directly relate.
 
 -- Murphy
 
 On Nov 4, 2014, at 11:30 PM, farshad tajedin farshad.taje...@gmail.com 
 wrote:
 
  hi all
  i have a problem with add_flow entry in my switches. this is my code:
 
  msg=of.ofp_flow_mod()
  msg.match.nw_src=something
  msg.match.nw_dst=something
  msg.match.tp_dst=21
  msg.match.tp_src=somthing
  msg.actions.append(of.ofp_action_output(port=something))
 
 
  and i send this msg to switch, when i read flow entry of switch 
  msg.match.tp_src and msg.match.tp_dst are None. i dont know why
  Best Regards
 
  Farshad Tajedin
 
 
 
 
 -- 
 Best Regards
 
 Farshad Tajedin



Re: [pox-dev] Creating and Raising Custom Events

2014-11-03 Thread Murphy McCauley
I'm a bit surprised that you're getting no result at all as opposed to, say, 
exceptions in the POX log.  Have you tried turning logging to DEBUG level and 
reading through to make sure there are no hints as to what might be going 
wrong?  It's possible that raiseEventNoErrors() is masking the exceptions.  You 
might try at least temporarily replacing such calls with just plain 
raiseEvent().

It looks like you want these events to be raised using the same sources as 
normal OpenFlow events.  Normally, sources need to be aware of the events 
they'll be raising.  In your case, these sources are the Connection (in of_01) 
and OpenFlowNexus (in openflow/__init__) classes.  Have you added your event to 
their set of _eventMixin_events?

On Nov 3, 2014, at 2:15 AM, Adam Pavlidis adampavli...@gmail.com wrote:

 Hello,
 
 i am trying to implement a controller module that handles two types of Events:
 the already existing FlowRemoved and another of my own creation
 CustomEvent that i will execute in various circumstances.
 
 I have read the section on custom events contained in the POX manual
 ( 
 https://openflow.stanford.edu/display/ONL/POX+Wiki#POXWiki-TheEventSystem%3Apox.lib.revent
 )
 and have successfully executed the examples.
 
 I have looked up a bit how the POX raises events such as PacketIn.
 I added the following lines of code in pox/pox/openflow/__init__.py
 
 class CustomEvent(Event):
  
  Our own custom event
  
  def __init__(self):
Event.__init__(self)
 
 Then i added a handler for that event in an already existing controller 
 module,
 
 def _handle_CustomEvent (self, event):
  log.debug('The Event was raised successfully')
 
 However when i manually raise the above event,
 (e.g. during the handling of a PacketIn event in
 forwarding.l2_learning) nothing happens.
 I used both the method explained in the manual (creating a subclass of
 EventMixin with _eventMixin_set=([CustomEvent], creating an instance
 of that class and raising the event on that instance), and the
 core.raiselater method.
 
 Important note: In the same module there is a handler for FlowRemoved
 Events, that is notified without issues, when a flow is removed from the
 switch, so i don't think there is a listener issue.
 
 In my efforts to find the problem i tried to experiment in
 openflow/of_01.py and specifically in lines 85, 177 where FlowRemoved
 and PacketIn events are raised from the Controller, i tried to force
 raise my own
 event when a PacketIn was supposed to be raised.
 
 def handle_PACKET_IN (con, msg): #A
  e = con.ofnexus.raiseEventNoErrors(CustomEvent, con, msg)
  if e is None or e.halt != True:
con.raiseEventNoErrors(CustomEvent, con, msg)
 
 Nothing happened either (apart from losing connectivity between the hosts).
 
 I would appreciate any help,
 Adam Pavlidis



  1   2   3   4   5   >