Friday, January 28, 2011

Keeping a persistent 3G connection on Windows

I'm in charge of managing an array of Windows Embedded 7 Standard based PCs (they act just like plain old Windows 7).

The computers have 3G cards as their only means of communication, and are on buses. Right now, the 3G cards are configured in NDIS mode which in theory will maintain the connection automatically and persistently. However, sometimes the 3G link fails and never comes back up.

Can someone help me out here? My basic requirements are

  • Internet is available always
  • If the connection fails, it is detected and retried

Is RAS/DUN more reliable for this sort of thing than NDIS?

  • i have run into this situation before. When you have scarce resources, only possible solution is to make a script so that you can connect as soon as you detect a disconnection. 3g Will disconnect if the back-haul network is not very well implemented. This is the main problem. RAS/DUN could be as bad as NDIS. But it may be possible to get that Always-On connection by MicroCell or any of those *cells.

    David Pfeffer : I actually have plenty of resources -- I'm only using about 20% of 1 GB of RAM. But how would I restart the NDIS connection, or do I have to switch to RAS/DUN for that?
    fmysky : if you have a blurry 3g connection RAS/DUN wont help either. you may have to implement some command-line scripts or may be java to re-connect in case it just disconnects randomly for few seconds even with a full network coverage
    David Pfeffer : How would one "reconnect" an NDIS connection, though?
    fmysky : just disable/re-enable the interface.take a look at entens answer
    From fmysky
  • I ran into a similar problem while working on a communcations substation and ended up writing a program to keep the connection alive. You can find my post on the situation here. Basically, in addition to keeping the connection live, the interface id assigned by Windows is changed each time you disable and reenable the interface.

    David Pfeffer : I guess as a weird follow-up, is there an easy way to determine programmatically which connection is the 3G vs the built-in Ethernet?
    entens : Do you mean which interface is the 3G modem? You can test the MAC address or you can identify the interface using any of the information made available in the `NetworkInterface` class (assuming .Net framework). More information can be found at http://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.aspx
    David Pfeffer : Unfortunately the MAC address is unknown -- I'm going to be deploying to a bunch of these boxes. I don't think there's anything differentiating a LAN device from a WWAN device.
    entens : I meant looking for the vendor id in the MAC. The first 6 characters of the 3G modem MAC should always be the same if your using the same model.
    From entens

0 comments:

Post a Comment