diff --git a/index.html b/index.html index b2114a3..4f9e086 100644 --- a/index.html +++ b/index.html @@ -114,7 +114,7 @@
-The Network Information API enables web applications to access information about the network connection in use by the device. +The Network Information API enables web applications to access information about the network connection in use by the device.
@@ -152,14 +152,7 @@
-## Dependencies and definitions - -The task source used by this specification is the the networking task source [[!HTML]]. - -The following concepts are defined in [[!DOM]]: - - * Queue a task. - * Fire a simple event. +## Definitions For clarity, a megabit is 1,000,000 bits, and megabits per second is equivalent to transferring: @@ -173,32 +166,88 @@
## Connection types -This section defines the connection types: - -
-
bluetooth
-
The user agent is using a Bluetooth connection as the underlying connection technology.
-
cellular
-
The user agent is using a cellular connection as the underlying connection technology (e.g., EDGE, HSPA, LTE, etc.).
-
ethernet
-
The user agent is using an Ethernet connection as the underlying connection technology.
-
none
-
The user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail) - i.e., equivalent to `navigator.onLine === false` in HTML.
-
wifi
-
The user agent is using a Wi-Fi connection as the underlying connection technology.
-
wimax
-
The user agent is using a WiMAX connection as the underlying connection technology.
-
other
-
The user agent is using a connection type that is not one of enumerated connection types as the underlying connection technology.
-
mixed
-
The user agent is using multiple connection types as the underlying connection technology.
-
unknown
-
The user agent has established a network connection, but is unable to determine what is the underlying connection technology.
-
+ +
+ ### Underlying connection technology + This section defines the connection types: + +
+
bluetooth
+
The user agent is using a Bluetooth connection as the underlying connection technology.
+
cellular
+
The user agent is using a cellular connection as the underlying connection technology (e.g., EDGE, HSPA, LTE, etc.).
+
ethernet
+
The user agent is using an Ethernet connection as the underlying connection technology.
+
none
+
The user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail) - i.e., equivalent to `navigator.onLine === false` in HTML.
+
wifi
+
The user agent is using a Wi-Fi connection as the underlying connection technology.
+
wimax
+
The user agent is using a WiMAX connection as the underlying connection technology.
+
other
+
The user agent is using a connection type that is not one of enumerated connection types as the underlying connection technology.
+
mixed
+
The user agent is using multiple connection types as the underlying connection technology.
+
unknown
+
The user agent has established a network connection, but is unable to determine what is the underlying connection technology.
+
+
+ +
+ ### Effective connection types + This section defines the effective connection types (ECT): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table of effective connection types
ECTMinimum RTT (ms)Maximum downlink (Kbps)Explanation
slow-2g190050The network is suited for small transfers only such as text-only pages.
2g130070The network is suited for transfers of small images.
3g200700The network is suited for transfers of large assets such as high resolution images, audio, and SD video.
4g0The network is suited for HD video, real-time video, etc.
+

The above roundtrip and bandwidth values are based on real user measurement observations:

+
    +
  • `slow-2g` is the 66.6th percentile of 2G observations
  • +
  • `2g` is the 50th percentile of 2G observations
  • +
  • `3g` is the 50th percentile of 3G observations
  • +
+

The absolute values provided above are based on real user measurement on Chrome on Android, as captured in April 2017. The user agent MAY update these values in the future to reflect changes in the measurement data.

+
-
+ +
## Extensions to the `Navigator` interface +The `NavigatorNetworkInformation` interface exposes access to `NetworkInformation` interface.
 [NoInterfaceObject, Exposed=(Window,Worker)]
@@ -214,7 +263,7 @@
 The `connection` attribute, when getting, returns an object that implements the `NetworkInformation` interface.
 
-
+
## The `NetworkInformation` interface The `NetworkInformation` interface provides a means to access information about the network connection the user agent is currently using. @@ -222,16 +271,23 @@ [Exposed=(Window,Worker)] interface NetworkInformation : EventTarget{ readonly attribute ConnectionType type; + readonly attribute EffectiveConnectionType effectiveType; readonly attribute Megabit downlinkMax; + readonly attribute Megabit downlink; + readonly attribute Millisecond rtt; attribute EventHandler onchange; }; typedef unrestricted double Megabit; +typedef unsigned long long Millisecond; ### `type` attribute -The `type` attribute, when getting, returns the connection type that the user agent is using. +The `type` attribute, when getting, returns the connection type that the user agent is using. + +### `effectiveType` attribute +The `effectiveType` attribute, when getting, returns the effective connection type that is determined using a combination of recently observed round trip times and downlink bandwidth. ### `downlinkMax` attribute The `downlinkMax` attribute represents an upper bound on the downlink speed of the first network hop. The reported value is in megabits per second and determined by the properties of the underlying connection technology. @@ -240,6 +296,16 @@ The user agent has no knowledge of the total number or the performance characteristics of the various network hops required to fulfill a particular request; different requests may follow different routes and have different performance characteristics. The reported upper bound on the downlink speed of the first network hop value is determined by the properties of the underlying connection technology of the first network hop. The end-to-end performance of any request cannot exceed this value, but it is also not a guarantee of performance and may be significantly worse. +### `onchange` attribute +The `onchange` event handler attribute handles "change" events fired during the steps to update the connection values. + +### `downlink` attribute +The `downlink` attribute represents the effective bandwidth estimate in megabits per second based on recently observed throughput on the client, rounded to nearest 25 kilobits per second. + +### `rtt` attribute +The `rtt` attribute represents the effective round-trip time estimate in milliseconds based on recently observed round-trip times on the client, rounded to nearest 25 milliseconds. + + ## Underlying connection technology The relationship between an underlying connection technology and its upper bound on the downlink speed of the first network hop is determined by the available network interfaces that may be used to fulfill new network requests. @@ -252,7 +318,7 @@ The enumeration of available network interfaces and their generation and version is not directly exposed to script. Instead, `downlinkMax` exposes a single value in megabits per second that accounts for all available interfaces and their current network conditions. - + @@ -272,26 +338,31 @@ ### Handling changes to the underlying connection -When the properties of the underlying connection technology change (e.g. due to a switch to a different connection type, or change in upper bound on the downlink speed of the first network hop), the user agent MUST run the steps to update the connection values: +When the properties of the underlying connection technology change, due to a switch to a different connection type or effective connection type, change in upper bound on the downlink speed of the first network hop, or change in effective downlink or rtt estimates, the user agent MUST run the steps to update the connection values: 1. Let new-type be the connection type that represents the underlying connection technology. +1. Let new-effective-type be the effective connection type determined by current downlink and rtt values. +1. Let new-downlink be the downlink value. +1. Let new-rtt be the rtt value. 1. If new-type is "none", set max-value to `0`. 1. if new-type is "unknown", set max-value to `+Infinity`. 1. If new-type is "mixed", set max-value to an applicable value for the interface configuration used to service new network requests - e.g. if multiple interfaces may be used, sum their downlinkMax for an available interface values. 1. Otherwise, set max-value to downlinkMax for an available interface. -1. If max-value is not equal to the value of `connection.downlinkMax` or if new-type is not equal to the value of `connection.type`: - 1. Using the networking task source, queue a task to perform the following: +1. If max-value is not equal to the value of `connection.downlinkMax`, or if new-type is not equal to the value of `connection.type`, or if new-downlink is not equal to the value of `connection.downlink`, or if new-rtt is not equal to the value of `connection.rtt`: + 1. Using the networking task source, queue a task to perform the following: 1. Set `connection.downlinkMax` to max-value. 1. Set `connection.type` to new-type. - 1. Fire a simple event named `change` at the `NetworkInformation` object. - + 1. set `connection.effectiveType` to new-effective-type. + 1. Set `connection.downlink` to new-downlink. + 1. Set `connection.rtt` to new-rtt. + 1. Fire an event named `change` at the `NetworkInformation` object.
- ## The `ConnectionType` enum + ## The ConnectionType enum
-  enum ConnectionType{
+  enum ConnectionType {
     "bluetooth",
     "cellular",
     "ethernet",
@@ -300,15 +371,29 @@
     "other",
     "unknown",
     "wifi",
-    "wimax",
+    "wimax"
   };
   
+
+ ## The EffectiveConnectionType enum + +
+  enum EffectiveConnectionType {
+    "slow-2g",
+    "2g",
+    "3g",
+    "4g"
+  };
+  
+
+ +
## Privacy Considerations - The Network Information API exposes information about the first network hop between the user agent and the server; specifically, the type of connection and the upper bound of the downlink speed, as well as signals whenever this information changes. Such information may be used to: + The Network Information API exposes information about the observed network bandwidth, latency and the first network hop between the user agent and the server; specifically, the type of connection and the upper bound of the downlink speed, as well as signals whenever this information changes. Such information may be used to:
  • Fingerprint a user based on characteristics of a particular network (e.g. type and downlink estimates) at a point in time, and by observing change in such characteristics over a period of time.