Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Network Resetting Issue


  • Please log in to reply
14 replies to this topic

#1 lesmondo

lesmondo

    Member

  • Members
  • PipPip
  • 24 posts

Posted 17 August 2011 - 12:18 PM

Hi, I've been playing with N+ at home plugged into my ADSL router/modem (Billion 7800G) and it works just fine. However, today I took the board into work and had a strange issue when connected to our network. Plugging the N+ into our network - which I believe is some flavour of a cisco gigabit switch - causes the network adapter on the N+ to appear to continually reset. By this I mean the three n/w leds turn on, one blinks a few times then all three turn off for a couple of seconds. This repeats. Originally I was using HttpWebRequest to retrieve some data from a webserver on my PC. This code wass hanging on the GetResponse call. After simplifying the code, I've ended up with a main that only calls Thread.sleep in a loop. The network still appears to reset endlessly. I'm using a static IP and firmware 4.2. Curiously, about 1 in 100 resets, the board functions fine and I can ping it and make socket connections back to the server running on my PC. But for the other 99 times, the board is not pingable. I've brought the board home again tonight, changed the static IP to one on my network and the board works fine. So I'm wondering is it something to do with the networking hardware at work? Thanks

#2 oofki

oofki

    Member

  • Members
  • PipPip
  • 11 posts

Posted 17 August 2011 - 08:44 PM

Hi,

I've been playing with N+ at home plugged into my ADSL router/modem (Billion 7800G) and it works just fine. However, today I took the board into work and had a strange issue when connected to our network.

Plugging the N+ into our network - which I believe is some flavour of a cisco gigabit switch - causes the network adapter on the N+ to appear to continually reset. By this I mean the three n/w leds turn on, one blinks a few times then all three turn off for a couple of seconds. This repeats.

Originally I was using HttpWebRequest to retrieve some data from a webserver on my PC. This code wass hanging on the GetResponse call. After simplifying the code, I've ended up with a main that only calls Thread.sleep in a loop. The network still appears to reset endlessly.

I'm using a static IP and firmware 4.2.

Curiously, about 1 in 100 resets, the board functions fine and I can ping it and make socket connections back to the server running on my PC. But for the other 99 times, the board is not pingable.


I've brought the board home again tonight, changed the static IP to one on my network and the board works fine. So I'm wondering is it something to do with the networking hardware at work?


Thanks



Can you post the code you are using?

#3 lesmondo

lesmondo

    Member

  • Members
  • PipPip
  • 24 posts

Posted 18 August 2011 - 05:02 AM

Can you post the code you are using?


Sure. It's basically:

main() { while(true) { Thread.sleep(5000); } }

I thought it was something to do with my code so simplified and simplified until I ended up with that. If you erase the app using mfdeploy so that there's no running program it still does the reset thing.

After reading this, http://forums.netdui...in-the-network/ it looks like I'm seeing the same issue - the link going up and down repeatedly.

#4 oofki

oofki

    Member

  • Members
  • PipPip
  • 11 posts

Posted 18 August 2011 - 08:44 PM

Sure. It's basically:

main() { while(true) { Thread.sleep(5000); } }

I thought it was something to do with my code so simplified and simplified until I ended up with that. If you erase the app using mfdeploy so that there's no running program it still does the reset thing.

After reading this, http://forums.netdui...in-the-network/ it looks like I'm seeing the same issue - the link going up and down repeatedly.


I'm no expert, I'm just starting to learn too, but I think it's because you only have one thread and you are blocking it for 5 seconds at a time.

Try this: main() { while(true) { int i = 0; } }

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 18 August 2011 - 08:56 PM

Hi oofki, The Thread.Sleep function simply puts the main thread to sleep...you can have background threads running (including networking) without any issue. Chris

#6 lesmondo

lesmondo

    Member

  • Members
  • PipPip
  • 24 posts

Posted 19 August 2011 - 01:22 AM

Hi oofki,

The Thread.Sleep function simply puts the main thread to sleep...you can have background threads running (including networking) without any issue.

Chris


Thanks Chris, like I said this was my simple as possible test case. Any ideas as to why the network would be resetting like this?

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 August 2011 - 01:48 AM

Hi lesmondo,

Thanks Chris, like I said this was my simple as possible test case. Any ideas as to why the network would be resetting like this?

If other devices work on this router, I'm guessing that it's a glitch in the lwIP open source networking stack.

Could you please post a bug report ("work item/issue") on this over at netmf.codeplex.com? The .NET MF 4.2 release is almost ready to ship...so this is the last chance to get critical bug reports in. [Otherwise, it could be a year before the issue is addressed in an official release.]

Also...do you have a copy of Wireshark? It would be really helpful to see a copy of the network traffic...see what is arriving at the Netduino Plus and what is going out...

Chris

#8 lesmondo

lesmondo

    Member

  • Members
  • PipPip
  • 24 posts

Posted 23 August 2011 - 01:16 AM

Hi lesmondo,

If other devices work on this router, I'm guessing that it's a glitch in the lwIP open source networking stack.

Could you please post a bug report ("work item/issue") on this over at netmf.codeplex.com? The .NET MF 4.2 release is almost ready to ship...so this is the last chance to get critical bug reports in. [Otherwise, it could be a year before the issue is addressed in an official release.]

Also...do you have a copy of Wireshark? It would be really helpful to see a copy of the network traffic...see what is arriving at the Netduino Plus and what is going out...

Chris


Hi Chris,

I'll raise a bug report. Unfortunately since our network is switched I don't think I'll be able to capture the N+ packets - my PC doesn't see them.

Les

#9 Inquisitor

Inquisitor

    Advanced Member

  • Members
  • PipPipPip
  • 91 posts
  • LocationAtlanta, Georgia, USA

Posted 24 August 2011 - 10:36 AM

Hi Chris,

I'll raise a bug report. Unfortunately since our network is switched I don't think I'll be able to capture the N+ packets - my PC doesn't see them.

Les


Although your corporation might frown on it (some will)...
At my day job (an extremely large, security conscious corporation) we run on a gigabit switch network, some of us developers who need to use Wire Shark occasionally will also have a dumb, gigabit hub in our office… plugging in network, Netduino and your PC should allow you to “see” what’s going on between your N+ and the (anti-social ;) ) company switch.
Doing my best to keep the smoke in the little black boxes.
If my message helped you... how 'bout giving me a Posted Image
www.MessingWithReality.com

#10 lesmondo

lesmondo

    Member

  • Members
  • PipPip
  • 24 posts

Posted 25 August 2011 - 05:55 AM

Although your corporation might frown on it (some will)...
At my day job (an extremely large, security conscious corporation) we run on a gigabit switch network, some of us developers who need to use Wire Shark occasionally will also have a dumb, gigabit hub in our office… plugging in network, Netduino and your PC should allow you to “see” what’s going on between your N+ and the (anti-social ;) ) company switch.


Shhh..... they might hear you :) That's what I'm hunting around for now. I'm also thinking that if it is the cisco switch/N+ combo that's the problem, maybe putting a cheap hub between the two might fix it.

#11 Inquisitor

Inquisitor

    Advanced Member

  • Members
  • PipPipPip
  • 91 posts
  • LocationAtlanta, Georgia, USA

Posted 25 August 2011 - 05:57 PM

Shhh..... they might hear you :) That's what I'm hunting around for now. I'm also thinking that if it is the cisco switch/N+ combo that's the problem, maybe putting a cheap hub between the two might fix it.


Yeah! I hate that Heisenberg thing. :D
Doing my best to keep the smoke in the little black boxes.
If my message helped you... how 'bout giving me a Posted Image
www.MessingWithReality.com

#12 lesmondo

lesmondo

    Member

  • Members
  • PipPip
  • 24 posts

Posted 31 August 2011 - 02:33 AM

Hi All, I've managed to get one of our networking gurus to do some wiresharking and it appears that it's the Cisco Discovery Protocol packet(s) that are causing the N+ network to reset. The N+ negotiates at 100mb full dup, the switch sends CDP, then N+ network resets. This repeats. I have the capture but since this contains site specific info, it's probably best if I don't attach them here. Does this sound like a MF problem or a N+ hardware problem? Thanks Les

#13 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 31 August 2011 - 08:02 AM

Hi Les, If it's a packet, then it's almost definitely a .NET MF firmware (or lwIP network stack) issue. Unless the packet is accompanied by a voltage spike or something that is :D Chris

#14 ColinR

ColinR

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationCape Town, South Africa

Posted 02 September 2011 - 03:54 AM

If it's a packet, then it's almost definitely a .NET MF firmware (or lwIP network stack) issue.



Les, are you able to anonymise the capture data (without jeopardising it) so that a bug report can be submitted on CodePlex including the capture?

#15 lesmondo

lesmondo

    Member

  • Members
  • PipPip
  • 24 posts

Posted 16 September 2011 - 02:14 AM

Les, are you able to anonymise the capture data (without jeopardising it) so that a bug report can be submitted on CodePlex including the capture?


Update: I bought a cheap 10/100 switch from ebay and that's fixed the problem :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.