Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define [=underlying connection=] for connection-level stats. #547

Merged
merged 4 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 38 additions & 39 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ session=] can contain multiple [=WebTransport streams=].

## WebTransport session ## {#webtransport-session}

A <dfn for="protocol">WebTransport session</dfn> is a session of WebTransport over HTTP/3.
A <dfn for="protocol">WebTransport session</dfn> is a session of WebTransport over an HTTP/3
or HTTP/2 <dfn>underlying [=connection=]</dfn>.
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
There may be multiple [=WebTransport sessions=] on one [=connection=], when pooling is enabled.

A [=WebTransport session=] has the following capabilities defined in [[!WEB-TRANSPORT-HTTP3]]:
Expand Down Expand Up @@ -601,7 +602,7 @@ defined in [[!WEB-TRANSPORT-HTTP3]].
interface WebTransport {
constructor(USVString url, optional WebTransportOptions options = {});

Promise&lt;WebTransportStats&gt; getStats();
Promise&lt;WebTransportConnectionStats&gt; getStats();
readonly attribute Promise&lt;undefined&gt; ready;
readonly attribute WebTransportReliabilityMode reliability;
readonly attribute WebTransportCongestionControl congestionControl;
Expand Down Expand Up @@ -983,10 +984,9 @@ these steps.
1. Let |transport| be [=this=].
1. Let |p| be a new promise.
1. Run the following steps [=in parallel=]:
1. Gather the stats from the underlying QUIC connection, including stats on datagrams.
1. Wait for the stats to be ready.
1. Gather the stats from the [=underlying connection=], including stats on datagrams.
1. [=Queue a network task=] with |transport| to run the following steps:
1. Let |stats| be a [=new=] {{WebTransportStats}} object representing the gathered stats.
1. Let |stats| be a [=new=] {{WebTransportConnectionStats}} object representing the gathered stats.
1. [=Resolve=] |p| with |stats|.
1. Return |p|.

Expand Down Expand Up @@ -1134,7 +1134,7 @@ Whenever a [=WebTransport session=] which is associated with a {{WebTransport}}
</div>

<div algorithm="termination-caused-by-connection-error">
Whenever a [=connection=] associated with a {{WebTransport}} |transport| gets a connection error,
Whenever a {{WebTransport}} |transport|'s [=underlying connection=] gets a connection error,
run these steps:

1. [=Queue a network task=] with |transport| to run these steps:
Expand Down Expand Up @@ -1192,15 +1192,15 @@ enum WebTransportCongestionControl {
</pre>

<dfn dictionary>WebTransportOptions</dfn> is a dictionary of parameters
that determine how WebTransport connection is established and used.
that determine how the [=WebTransport session=] is established and used.

: <dfn for="WebTransportOptions" dict-member>allowPooling</dfn>
:: When set to true, the WebTransport connection can be pooled, that is, the network connection for
the WebTransport session can be shared with other HTTP/3 sessions.
:: When set to true, the [=WebTransport session=] can be pooled, that is, its [=underlying connection=]
can be shared with other HTTP/3 sessions.

: <dfn for="WebTransportOptions" dict-member>requireUnreliable</dfn>
:: When set to true, the WebTransport connection cannot be established over HTTP/2 if
an HTTP/3 connection is not possible.
:: When set to true, the [=WebTransport session=] cannot be established over an
HTTP/2 [=connection=] if an HTTP/3 [=connection=] is not possible.

: <dfn for="WebTransportOptions" dict-member>serverCertificateHashes</dfn>
:: This option is only supported for transports using dedicated connections.
Expand Down Expand Up @@ -1316,18 +1316,18 @@ The dictionary SHALL have the following attributes:
Note: This is sender-side data prioritization which does not guarantee
reception order.

## `WebTransportStats` Dictionary ## {#web-transport-stats}
## `WebTransportConnectionStats` Dictionary ## {#web-transport-connection-stats}

The <dfn dictionary>WebTransportStats</dfn> dictionary includes information
on HTTP/3 connection stats.
The <dfn dictionary>WebTransportConnectionStats</dfn> dictionary includes information
on WebTransport-specific stats about the [=WebTransport session=]'s [=underlying connection=].

Issue: Now that quic-transport has been removed, this section needs to be
revised. Some of those are safe to expose for HTTP/2 and HTTP/3 connections
(like min-RTT), while most would either result in information disclosure
or are impossible to define for pooled connections.
Note: When pooling is used, multiple [=WebTransport sessions=] pooled
on the same [=connection=] all receive the same information, i.e. the information
jan-ivar marked this conversation as resolved.
Show resolved Hide resolved
is disclosed across pooled [=WebTransport sessions | sessions=] holding the
same [[fetch#network-partition-keys|network partition key]].

<pre class="idl">
dictionary WebTransportStats {
dictionary WebTransportConnectionStats {
DOMHighResTimeStamp timestamp;
unsigned long long bytesSent;
unsigned long long packetsSent;
Expand All @@ -1345,35 +1345,35 @@ dictionary WebTransportStats {

The dictionary SHALL have the following attributes:

: <dfn for="WebTransportStats" dict-member>timestamp</dfn>
: <dfn for="WebTransportConnectionStats" dict-member>timestamp</dfn>
:: The `timestamp` for when the stats are gathered, relative to the
UNIX epoch (Jan 1, 1970, UTC).
: <dfn for="WebTransportStats" dict-member>bytesSent</dfn>
:: The number of bytes sent on the QUIC connection, including retransmissions.
: <dfn for="WebTransportConnectionStats" dict-member>bytesSent</dfn>
:: The number of bytes sent on the [=underlying connection=], including retransmissions.
Does not include UDP or any other outer framing.
: <dfn for="WebTransportStats" dict-member>packetsSent</dfn>
:: The number of packets sent on the QUIC connection, including those that are determined to have been lost.
: <dfn for="WebTransportStats" dict-member>bytesLost</dfn>
:: The number of bytes lost on the QUIC connection (does not monotonically increase, because packets that are declared lost can subsequently be received).
: <dfn for="WebTransportConnectionStats" dict-member>packetsSent</dfn>
:: The number of packets sent on the [=underlying connection=], including those that are determined to have been lost.
: <dfn for="WebTransportConnectionStats" dict-member>bytesLost</dfn>
:: The number of bytes lost on the [=underlying connection=] (does not monotonically increase, because packets that are declared lost can subsequently be received).
Does not include UDP or any other outer framing.
: <dfn for="WebTransportStats" dict-member>packetsLost</dfn>
:: The number of packets lost on the QUIC connection (does not monotonically increase, because packets that are declared lost can subsequently be received).
: <dfn for="WebTransportStats" dict-member>bytesReceived</dfn>
:: The number of total bytes received on the QUIC connection, including
: <dfn for="WebTransportConnectionStats" dict-member>packetsLost</dfn>
:: The number of packets lost on the [=underlying connection=] (does not monotonically increase, because packets that are declared lost can subsequently be received).
: <dfn for="WebTransportConnectionStats" dict-member>bytesReceived</dfn>
:: The number of total bytes received on the [=underlying connection=], including
duplicate data for streams. Does not include UDP or any other outer framing.
: <dfn for="WebTransportStats" dict-member>packetsReceived</dfn>
:: The number of total packets received on the QUIC connection, including
: <dfn for="WebTransportConnectionStats" dict-member>packetsReceived</dfn>
:: The number of total packets received on the [=underlying connection=], including
packets that were not processable.
: <dfn for="WebTransportStats" dict-member>smoothedRtt</dfn>
: <dfn for="WebTransportConnectionStats" dict-member>smoothedRtt</dfn>
:: The smoothed round-trip time (RTT) currently observed on the connection, as defined
in [[!RFC9002]] [Section 5.3](https://www.rfc-editor.org/rfc/rfc9002#section-5.3).
: <dfn for="WebTransportStats" dict-member>rttVariation</dfn>
: <dfn for="WebTransportConnectionStats" dict-member>rttVariation</dfn>
:: The mean variation in round-trip time samples currently observed on the
connection, as defined in [[!RFC9002]]
[Section 5.3](https://www.rfc-editor.org/rfc/rfc9002#section-5.3).
: <dfn for="WebTransportStats" dict-member>minRtt</dfn>
: <dfn for="WebTransportConnectionStats" dict-member>minRtt</dfn>
:: The minimum round-trip time observed on the entire connection.
: <dfn for="WebTransportStats" dict-member>estimatedSendRate</dfn>
: <dfn for="WebTransportConnectionStats" dict-member>estimatedSendRate</dfn>
:: The estimated rate at which queued data will be sent by the user agent, in bits per second.
This rate applies to all streams and datagrams that share a [=WebTransport session=]
and is calculated by the congestion control algorithm (potentially chosen by
Expand Down Expand Up @@ -1716,7 +1716,6 @@ The {{WebTransportReceiveStream}}'s [=transfer steps=] and
1. Let |p| be a new promise.
1. Run the following steps [=in parallel=]:
1. Gather the stats specific to this {{WebTransportReceiveStream}}.
1. Wait for the stats to be ready.
1. [=Queue a network task=] with |transport| to run the following steps:
1. Let |stats| be a [=new=] {{WebTransportReceiveStreamStats}} object
representing the gathered stats.
Expand Down Expand Up @@ -2343,7 +2342,7 @@ possible.
Information about the network is available to the server either directly through
its own networking stack, indirectly through the rate at which data is consumed
or transmitted by the client, or as part of the statistics provided by the API
(see [[#web-transport-stats]]). Consequently, restrictions on information in
(see [[#web-transport-connection-stats]]). Consequently, restrictions on information in
user agents is not the only mechanism that might be needed to manage these
privacy risks.

Expand Down Expand Up @@ -2378,7 +2377,7 @@ This might allow sites to increase confidence that activity on different sites
originates from the same user.

A user agent could limit or degrade access to feedback mechanisms such as
statistics ([[#web-transport-stats]]) for sites that are inactive or do not have
statistics ([[#web-transport-connection-stats]]) for sites that are inactive or do not have
focus ([[html/interaction#focus]]). As noted, this does not prevent a server
from making observations about changes in the network.

Expand Down
Loading