Determination of bandwidth / type of network interface without data transfer

Is there any way in Win32 to programmatically determine the bandwidth of a given network interface without actually transferring any data? I just want to distinguish between different types of interfaces (for example, dialup vs DSL vs LAN), so the coarse order of magnitude is good, I do not need to actually measure throughput.

The underlying problem is that my application is very hungry, and I want to display a warning to the user if they try to run it through an interface with a low bandwidth, for example. modem or GPRS modem.

I looked at some other related issues , but if possible, I would like to avoid measuring throughput. GPRS modems, in particular, may have restrictions on use, and I do not want to be in the user manual - I would rather detect a bad connection in some other way and not send any data at all.

I'm most interested in Win32 / C ++ answers, but any ideas would be greatly appreciated.

+4
c ++ winapi networking bandwidth
source share
3 answers

You can use InternetGetConnectedState to determine the type of connection (LAN / Modem / etc). This will tell you if they have a somewhat decent (non-modem) connection without bandwidth transfer.

Unfortunately, you really cannot go beyond this without connecting and transmitting data. The system does not have the ability to find out the bandwidth limits outside its connection to the local network, i.e. You can directly connect to your gateway on the local network, and this can have a crappy connection with the outside world. As for your computer, however, it runs on a full fast LAN connection ...

+4
source share

You can use a WMI request, of course there are calls to Win32 functions, but this request:

Select * from Win32_PerfFormattedData_Tcpip_NetworkInterface 
+6
source share

Why not ask the user? He must know.

Your application may cache information for the network address and again ask if the network address has changed.

+3
source share

All Articles