How can I detect network type or routing information in Windows CE?

R

russryba

Greetings,

I'm working on a Windows Mobile 5.0 device that has WiFi, Bluetooth and
Cellular IP Interfaces, as well as possibly being connected over an
ethernet cradle. The device is a ruggedized Symbol handheld.

I have two questions...

1 - How can I determine what type of network connections are available
such as WiFi, Cellular, Ethernet, etc
2 - How can I specify which interface to use when attempting to
initiate a connection on the windows CE device.

I'm hoping to automatically switch to cheaper network connections when
available, but fall back to the more expensive types when necessary.


I've looked through the System.Net namespace but I don't see anything
specific to routing or detection of the physical connection type. I
would imagine some sort of Socket.LocalEndPoint overload but i don't
see that.

I don't see any tools or CF classes to manipulate the routing table or
detect physical connection type. I'm sure what I'm looking for is
available through a google search but I must be using the wrong
keywords.

Any answers or suggestions to point me in the right direction would be
appreciated.

Thanks in advance,
- Russ Ryba
 
G

Guest

You're not missing anything - they're not there. I don't think they're even
there on the desktop. I think the ConnectionManager might have some of what
you're after. For routing and the like, the only thing I'm aware of is the
OpenNETCF.networkInformation library, which is currently in Beta.

http://www.opennetcf.com/library/networkinformation
 
R

russryba

Thank you Chris for confirming what I suspected.

We are currently using a software package called NetMotion VPN which
does what we want in regards to selecting the cheapest network and
routing packets over that network connection. It provides a virtual IP
address to use when connecting to the remote network and reroutes the
packets over the cheapest connection transparent to the application.

It works well but I was trying to see if there was some way I could
implement the network selection and detection portion of the
application on my own.

I checked on the desktop and I see it's no so easy to do there either.
The closest thing I can see that could be useful is the metrics
settings used in the routing table. Even on the desktop it appears to
be a difficult thing to configure. although the netsh utility is a good
start.

I have checked out the CE ConnectionManager. It doesn't seem to do
what I need. It's able to define if a connection should be used to
connect to a certain server or not, but I don't see any where I can
select or define an order in which network connections should be used
if there are several possible connections that may work.

Thanks for your help Chris. I'll be sure to post any answer I find.
Right now it appears the NetMotion VPN software is somehow doing this
but it must be pretty low level to create virtual ip addresses and so
on. Certainly a non-trivial task.

Regards,

- Russ Ryba
 
R

russryba

I haven't found any code or libraries to use. It appears to be a very
low level function.

I did find some reference to it in the platform builder documentation
but it doesn't look like anything I'll be able to implement in time for
the project. Maybe you'll find it useful for your OpenNetCF library if
you're not using it already.
http://msdn2.microsoft.com/en-us/library/ms882649.aspx
 
G

Guest

Yep, that's what we've already wrapper. We have routing and ARP tables
exposed in managed code (plus a lot more). And yes, it was no small task to
get done.
 
P

Paul G. Tobey [eMVP]

You can modify the routing table, of course. It should *already* be
choosing the lowest-cost connection automatically. Now, the cost doesn't
necessarily mean in dollars, but could be speed (the fastest connection).
Of course, you can see what sort of a network adapter each thing is using
the NetworkInformation class that Chris' mentioned or the classes in
OpenNETCF.Net in either 1.x or 2.0 of the Smart Device Framework.

There's been some traffic recently here about the routing table. You could
use GoogleGroups to search the archives for it:

http://groups.google.com/group/micr...ork/topics?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top