In strict OpenFlow 1.0, it's not possible to do what you state efficiently, so 
some thought may be required in order to achieve whatever your goal is.

OpenFlow works on "flows" of packets -- not individual packets -- so there's no 
way to make a random decision per packet without going to the controller each 
time.  Going to the controller is easy and might be reasonable for an 
experiment/demonstration but entails quite a bit of overhead.

You could assign each *flow* a path at random (possibly by modifying the 
packet-in handler of l2_learning as you mention), or you could try to install 
table entries proactively to balance traffic across the possible links (e.g., 
by sending flows with odd high bits in the IP down one path and even high bits 
down another).  These approaches are also relatively easy.

If you're using switches with OVS/Nicira extensions, there's more flexibility.  
For example, there are extensions specifically for hashing flows across 
multiple paths.  POX doesn't currently support this extension, though it 
shouldn't be hard to add.  Again, hashing headers isn't really random, though.  
(This is usually considered a good thing, as sending all packets from a flow 
over the same path is assumed to reduce assumedly harmful reordering.)

ip_loadbalancer does something along the lines of assigning a flow to a path at 
random (as mentioned above), but it's trying to balance load across servers, 
not across the network.  And it certainly tries to make decisions per flow 
(connection), not per packet (since it wants to assign a flow to a server).  As 
far as better documentation for this component -- not really.  There are some 
comments in the code and some references to it in the mailing list archive.  
Really, though, most of the complexity in this component is to cover cases 
which don't seem to apply to your scenario.

Hope some of that is helpful.

-- Murphy

On Dec 23, 2013, at 9:46 AM, Savvas Zannettou <zsavva...@gmail.com> wrote:

> Hi all!
> 
> I am new to the concept of Open-flow and Pox and i want to create a "stupid" 
> switch. My goal is that for the same destination to spread the traffic across 
> multiple links. For example in the below topology i want Switch1 when it 
> receives a packet,  to randomly forward the packet to either the first link 
> or the second. I saw the implementation of l2.learning and i assume that i 
> must change the method handle_packet_in to achieve the described behavior. Am 
> i right ? Also i saw the component misc.ip_loadbalancer. Can this component 
> help me achieve what i want? Is there a better documentation for this 
> component ( i saw it in 
> https://openflow.stanford.edu/display/ONL/POX+Wiki#POXWiki-misc.ip_loadbalancer)
> Any help is appreciated!
> 
> Thanks 
> Savvas
> 
> 
> <topo.jpg>

Reply via email to