Thank you Murphy I have another question: I have got the switch MAC address, i.e., 00-00-00-00-0x, how can I convert it to dpid. I am working in l2_multi, while the switches array has something like [1: 00-00-00-00-01, 2: 00-00-00-00-02 ] is there a way to get the dpid number from switches array or I must use a specific command to convert from MAC to dpid.
Best regards, Amer On ١٩/١١/٢٠١٣, at ٧:٢١ ص, Murphy McCauley <murphy.mccau...@gmail.com> wrote: > I think you may have to modify l2_multi a bit to get this to work with it -- > it was designed with the assumption that it's in control of all the switches, > and I think that will cause problems. > > l2_learning, on the other hand, should be easy to run on individual switches. > And l2_pairs should be pretty easy too. > > I'd suggest not doing it by writing your own PacketIn handler and > demultiplexing it yourself. Instead, just have your L2 stuff listen to > PacketIns from some switches, and your L3 stuff listen to PacketIns from the > others. That is, you should make this decision in response to a ConnectionUp > event instead of each PacketIn. Something like... > > from pox.forwarding.l2_learning import LearningSwitch > > def _handle_ConnectionUp (event): > if event.dpid == 1: > LearningSwitch(event.connection, False) > else: > # initialize your L3 thing, binding its events to this connection > > > Hope that helps. > > -- Murphy > > On Nov 15, 2013, at 10:17 AM, Amer <amer7...@hotmail.com> wrote: > >> Hello, >> >> >> I want to create a handle packetin method, if the incoming packet is from >> specific switch run l2 if it from another run l3 >> What I did >> >> from pox.forearding.l2_multi import * >> >> def H_P (event): >> p = event.parsed >> If (p.dpid == "1"): >> sw= Switch() >> sw._handle_PacketIn(event) >> Else: >> #. L3.learning >> >> I have received this error: >> NoneType object has no Len() >> >> Pox.py l2l3 openflow.discovery >> >> Any help is appreciated >> >> Best regards, >> Amer > >