Hi Sayed,

My 2 cents as below..

Just to put Murphy's words into examples- please find below

while initialising the controller, create a mac adde dictionary like below

        def __init__(self):
        # as soon as the module is hooked initialise..

                self.macaddrtable = {}

as and when you get an packet with unknown address you can update the
dictionary based on source mac learning like below

        #updating srcmactable
                self.updateMap(inport,srcmacaddr)

that will help you keep a dummy src mac able in the controller.



Cheers!
Durga



On Wed, Oct 30, 2013 at 7:46 PM, Murphy McCauley
<[email protected]>wrote:

> You want to compare to entries in the flow table of a particular switch?
>  This seems like a sort of strange thing to want.  But the easiest way to
> do it is to keep track of what flow entries you installed in a normal
> Python data structure like a set or dictionary and check if the MAC is in
> there.
>
> -- Murphy
>
> On Oct 30, 2013, at 1:39 AM, Sayed Qaiser Ali Shah Shah <
> [email protected]> wrote:
>
> > Hello everyone,
> >
> > Using POX controller I want to compare Mac addresses from packet in and
> flow table. As we can get source mac from packet in by using packet.src but
> I don't know how can we get source mac and destination MAC from table. What
> I want to do is:
> > Lets say source mac from table is table.src.
> >
> > if (packet.src == table.src):
> >     Do This
> > else
> >     Do this
> >
>
>

Reply via email to