I need to know what internet connection is available when my application is running. I checked out the Reachability example from Apple, but this differs only between wifi and carrier network. What I need to know is what carrier network is selected, UMTS or EDGE or GPRS.
4 Answers
Currently, this information is not available. If you want this feature, file a new bug and mention that this is a duplicate of bug 6014806.

- 6,207
- 3
- 36
- 57
You could take a guess at what kind of network you are on by checking the latency of a round trip to your server. If you are getting figures of under 100ms, you are almost certainly on WiFi.
GPRS and EDGE run at around 600ms latency. UMTS/HSDPA is 100-200ms.
Source: my informal testing, and [AT&T][1] figures.

- 32,379
- 13
- 71
- 75
-
1i think this method is inaccurate. Latency varies a lot, depending the reception of signals. – Raptor Dec 12 '09 at 03:06
-
AT&T backhauls Internet traffic to just a few portals out to the Internet. If you run a trace route on a connection you can see it. For example, I was north of Boston and tried to do a speed test to a Boston test point on Speedtest.net ... The connection went from Maine to Virginia and back up to Boston. Apple needs to publish APIs that let you set how/what you are connected to the carrier. You can put your phone in test mode (dial *3001#12345#*) and see some of it. – padapa Dec 13 '11 at 19:37
File only
I like Wedge's answer. I'm not sure that the file wouldn't be cached by ISPs though. You could always keep generating a new file name or choose one big enough that you only test for long enough to get a result.
Simple latency
The idea of using latency is close but as Shivan mentioned it's inaccurate. A user in Australia to UK will get a latency of around 350ms vs the local user who could see it as low as 30-40ms
Solution: Mean deviation
If you ping your server with 3 packets and then look at the mean deviation (mdev) under 3G it's usually under 50ms. With 2G/EDGE it's almost always over 100ms. I got one outlier at 65ms to AUS.
My tests found a range of 4ms-38ms, with only one exception on a test to Australia from Belgium at 202ms.
Hope that's useful to someone..

- 11
- 1
Rather than hardcoding different versions of your site for 3G, EDGE, GPRS, wifi broadband, why not build a framework which detects connection speed and bootstraps your site up to the appropriate level of bandwidth? That way you would get appropriate results on slow 3G / wifi, and it would naturally scale to the next generation of wireless broadband (e.g. WiMax and 802.11n) with a minimal amount of effort / disruption.
For example, you could determine different bandwidth "checkpoints" (which may correspond to 3G, EDGE, etc.), then you could do something like transfer some small bit of data or cache a small image (such as an icon) common to all bandwidth levels, benchmark the download speed in the background and set the bandwidth level accordingly.

- 19,513
- 7
- 48
- 71