Hmm... I don't immediately know what the right thing to do in this situation
is. But if it's to ignore the vlan (which doesn't immediately seem completely
unreasonable), I think maybe the right approach is to replace that assert at
the start of lldp_input_handler() with something like:
if packet.type == ethernet.VLAN_TYPE:
if not packet.next:
lg.error("lldp_input_handler could not parse vlan frame")
return
packet = packet.next
assert (packet.eth_type == ethernet.LLDP_TYPE)
else:
assert (packet.type == ethernet.LLDP_TYPE)
That's 100% untested, so if you wanted to give it a try, please let me know
how it turns out. :)
Anyone want to comment on whether that's the right approach?
-- Murphy
On Thursday, May 26, 2011 01:47:00 AM Jen-Wei Hu wrote:
> Hi,
>
> Recently, we use the discovery and lavi applications in NOX. The experiment
> environment contains two different switches, one is PC w/ NetFPGA and the
> other is Extreme OpenFlow enabled-Switch. After starting the discovery app,
> we got the complaint messages on the console. The messages are showed
> below: ------------------------------------------------------------
> 00103|pyrt|ERR:unable to invoke a Python event handler:
> Traceback (most recent call last):
> File "./nox/lib/util.py", line 116, in f
> event.total_len, buffer_id, packet)
> File "./nox/netapps/discovery/discovery.py", line 163, in <lambda>
> discovery.lldp_input_handler(self,dp,inport,reason,len,bid,packet),
> File "./nox/netapps/discovery/discovery.py", line 251, in
> lldp_input_handler
> assert (packet.type == ethernet.LLDP_TYPE)
> AssertionError
> ------------------------------------------------------------
>
> After trying to debug these two days and check the ethernet frame, we print
> received packet and find some hints from discovery.py
> ------------------------------------------------------------
> [(Extreme Networks):51:a9:85>01:23:20:00:00:01:VLAN](vlanid=10:
> pcp=0)[LLDP]<chassis ID:00:04:96:51:a9:85><port ID:00:01><ttl:120><tlv end>
> [(Nicira Network):a3:71:e3>01:23:20:00:00:01:LLDP]<chassis
> ID:00:23:20:a3:71:e3><port ID:00:02><ttl:120><tlv end>
> ------------------------------------------------------------
>
> The Extreme Switch will pack the VLAN info into the OFP packet, so we
> modify a little parts of ethernet.py. This code just skip the VLAN part (4
> bytes) of ethernet frame. The attachment is our modified code. Although it
> works, we are not sure doing this is right or not. We are not the python
> expert and maybe you guys could provide better way for this.
>
> Thanks,
>
> Jen-Wei
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev