[nox-dev] The LLDP problem when using Extreme OpenFlow-enabled switch

2011-05-26 Thread Jen-Wei Hu
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:8501:23:20:00:00:01:VLAN](vlanid=10:
pcp=0)[LLDP]chassis ID:00:04:96:51:a9:85port ID:00:01ttl:120tlv end
 [(Nicira Network):a3:71:e301:23:20:00:00:01:LLDP]chassis
ID:00:23:20:a3:71:e3port ID:00:02ttl:120tlv 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


ethernet.patch
Description: Binary data
___
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] The LLDP problem when using Extreme OpenFlow-enabled switch

2011-05-26 Thread Murphy McCauley
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:8501:23:20:00:00:01:VLAN](vlanid=10:
 pcp=0)[LLDP]chassis ID:00:04:96:51:a9:85port ID:00:01ttl:120tlv end
  [(Nicira Network):a3:71:e301:23:20:00:00:01:LLDP]chassis
 ID:00:23:20:a3:71:e3port ID:00:02ttl:120tlv 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
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev


Re: [nox-dev] The LLDP problem when using Extreme OpenFlow-enabled switch

2011-05-26 Thread Jen-Wei Hu
Hi,

Thanks Murphy. It works and I also think your suggestion is a good way. And
thank again for how to use of packet.next. I think this is useful when the
packet also contains another ethernet type inside. Hope my thought is right.

Jen-Wei

On Thu, May 26, 2011 at 5:36 PM, Murphy McCauley jam...@nau.edu wrote:

 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:8501:23:20:00:00:01:VLAN](vlanid=10:
  pcp=0)[LLDP]chassis ID:00:04:96:51:a9:85port ID:00:01ttl:120tlv
 end
   [(Nicira Network):a3:71:e301:23:20:00:00:01:LLDP]chassis
  ID:00:23:20:a3:71:e3port ID:00:02ttl:120tlv 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
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev