Indeed, that's a problem. routing assumes it's installing exact matches.
It seems like one way to do this would just be to install a new rule for every
destination MAC you came up against, even though the destination MAC wouldn't
actually be used for determining the path. So you'd still do exact matches,
it just wouldn't be any different between flows regardless of the destination
address.
If you really wanted to wildcard the field (the only advantage I can think of
here is that you'd install fewer rules)... the main routing class has a single
ofp_match member, which set_openflow() stocks before sending out a flow_mod.
So
I think easist way to do this halfway reasonably would be to add a "wildcards"
parameter to setup_route that you could pass from Python. Then inside
setup_route(), you'd copy that into the match before it sends the flow_mod (and
probably set it back to 0 after). I have no idea if this will break anything.
Tangentially... you're determining the path based just on the source MAC...
are you actually sending the frame to who it's addressed to, just not by using
the destination address? If not... does your destination not mind that the
address is wrong?
-- Murphy
On Friday, May 06, 2011 02:07:59 AM karim torkmen wrote:
> Hi Murphy,
> thanks a lot for your answeer.
> The small problem is that I am using python and the setup_route
> ("self.routing.setup_route(flow,route, inport, outport,FLOW_TIMEOUT, [],
> False")) method of pyrouting which takes as an entry a flow not an
> "attrs". My aim is to make the switch just decide on the source mac
> address and to ignore the destination mac address.
>
> Regards,
> karim
>
> On 05/06/2011 02:20 AM, Murphy McCauley wrote:
> > In general, OpenFlow supports this feature by the wildcards field of
> > ofp_match. So if you're on the C++ side, you may just set bits in there.
> > There are constants that correlate to each of the match fields (e.g.,
> > match.wildcards = OFPFW_DL_DST would cause a switch to ignore the
> > destination MAC address). IP addresses are a bit trickier, because you
> > can wildcard a suffix.
> >
> > If you're doing this from Python, a lot of functions take an "attrs"
> > dictionary to describe the flow. This includes thigs like
> > send_flow_command(), install_datapath_flow(), etc. It has keys like
> > "dl_dst" (or more properly, I think this is nox.lib.core.DL_DST). These
> > dictionaries are translated to an ofp_match structure by set_match(),
> > and entries which are not present in the dictionary are automatically
> > wildcarded. So if you have some dictionary describing a flow in Python,
> > you can just do "del myflow[core.DL_DST]", so there's no destination MAC
> > to match on.
> >
> > Hope that helps. If you want more detail or a more specific answer,
> > feel free to give some more context about what exactly you are trying to
> > do or post some code.
> >
> > -- Murphy
> >
> > On Thursday, May 05, 2011 08:32:42 AM karim torkmen wrote:
> >> Hi,
> >> Is there any function in nox that allows to select the fields to match
> >> in a flow table (e.g. order the switch to ignore the destination mac
> >> address).
> >> Thanks a lot.
> >> Karim
> >> _______________________________________________
> >> nox-dev mailing list
> >> [email protected]
> >> http://noxrepo.org/mailman/listinfo/nox-dev
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev