W3C home > Mailing lists > Public > public-device-apis@w3.org > December 2012

Re: Network Information API

From: Brian Leroux <brianl@adobe.com>
Date: Thu, 6 Dec 2012 08:12:42 -0800
To: Yoav Weiss <yoav@yoav.ws>, "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-ID: <CCE603C7.13928%brianl@adobe.com>
Network type can lie. Very often here in San Francisco my phone reports 3G when indeed my bandwidth is closer to Edge. The abstraction you seek could be built on top of bandwidth property however.

From: Yoav Weiss <yoav@yoav.ws<mailto:yoav@yoav.ws>>
Date: Thu, 6 Dec 2012 00:42:38 -0800
To: "public-device-apis@w3.org<mailto:public-device-apis@w3.org>" <public-device-apis@w3.org<mailto:public-device-apis@w3.org>>
Subject: Network Information API

Hi,

I have a few comments on the current draft of Network Information API.
The current draft exposes a couple of properties: `bandwidth` and `metered`, both of which are  described in the specification as hard to implement.

I have looked into the current implementation of `bandwidth` in Firefox for Android, and summed up the parts I found relevant at: https://gist.github.com/4206150
Basically, the application gets the network type from the OS, and translates it to an arbitrary bandwidth value which is the maximum such a network can achieve.

I believe that the name `bandwidth` for such a property is misleading, and will lead to confusion among Web developers. Maybe a name along the lines of `maxRadioNetworkBandwidth` would make more sense.

As far as I understand it, the actual bandwidth between the browser and the Web server is not known to the OS layer. It is something that if we want to (unreliably) measure, it should be done in the browser's socket layer (while taking slow-start and multiple TCP connections into consideration), and will probably be highly variable depending on the radio network *and* the destination host. So by definition, a `bandwidth` property in unreliable and therefore, of little value.

As a Web developer, I'd much rather know the `networkType` and draw my conclusions from there. To my understanding, the `networkType` property was removed from the specification because of privacy concerns. Could someone elaborate on these concerns?

Since `networkType` is forbidden, wouldn't it be wise to replace it with a few properties such as: `maxRadioNetworkBandwidth` (which we have under the name `bandwidth`), `avgRadioNetworkBandwidth`, `AvgRadioNetworkRTT` and possibly `receptionPrecentage`  and `radioState` (I'm not sure that is information that the OS exposes)

These properties will give developers more information regarding the actual radio conditions they are facing, rather than an inherently inaccurate `bandwidth` property.

Thanks for reading so far,
Yoav Weiss
Received on Thursday, 6 December 2012 16:18:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 6 December 2012 16:18:04 GMT