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

WIP: High-level restructure of transport draft #1857

Merged
merged 30 commits into from Oct 18, 2018
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5ebd7ca
Moved stream stuff up and added intro text to describe structure of doc
janaiyengar Oct 12, 2018
c705fc1
Moved major sections around.
janaiyengar Oct 13, 2018
c4ce2c2
created packets and frames section and moved things about
janaiyengar Oct 13, 2018
438b965
modified intro, made error codes first level section
janaiyengar Oct 16, 2018
53f0bad
Done through connection migration section
janaiyengar Oct 16, 2018
9600d97
addresses mt's comments.
janaiyengar Oct 18, 2018
209a269
detailed structure in intro
janaiyengar Oct 18, 2018
d927b6a
most of martinduke comments
janaiyengar Oct 18, 2018
af51da7
added initial values in flow control
janaiyengar Oct 18, 2018
d5a1e49
lint
janaiyengar Oct 18, 2018
db2e9b2
max_stream_id
martinthomson Oct 18, 2018
ca49ae4
parenthesize
janaiyengar Oct 18, 2018
0368ca9
parenthesize
martinthomson Oct 18, 2018
1d4f7d3
stream-id-blocked frame
martinthomson Oct 18, 2018
c3426ee
s/intertwines/combines
martinthomson Oct 18, 2018
140a9c6
unnecessary text
martinthomson Oct 18, 2018
23d95c3
connection id para
martinthomson Oct 18, 2018
d3cf19f
connection id contd
martinthomson Oct 18, 2018
4c9858f
connection id contd
martinthomson Oct 18, 2018
0dfa885
s/subsequent/additional
martinthomson Oct 18, 2018
a6262f9
shorter sentences
martinthomson Oct 18, 2018
b90815f
packet protection TODO
martinthomson Oct 18, 2018
bbb241e
packet protection TODO contd
martinthomson Oct 18, 2018
2a00e0b
s/the/a
martinthomson Oct 18, 2018
2986d5b
s/acks/acknowledges
martinthomson Oct 18, 2018
c631c31
unnecessary text
martinthomson Oct 18, 2018
6a980bf
unnecessary text
martinthomson Oct 18, 2018
d6c9267
last of mt's comments
janaiyengar Oct 18, 2018
e13b6b3
lint
janaiyengar Oct 18, 2018
dd74eda
lint
janaiyengar Oct 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
200 changes: 109 additions & 91 deletions draft-ietf-quic-transport.md
Expand Up @@ -138,21 +138,30 @@ middleboxes.

This document describes the core QUIC protocol, and is structured as follows:

* streams, QUIC's service abstraction to applications, including stream
multiplexing, and stream and connection-level flow control ({{streams}} -
{{flow-control}});

* connections, including version negotiation and establishment, usage,
migration, and shutdown ({{connections}} - {{termination}});

* error handling ({{error-handling}});

* packets and frames, including QUIC's model and mechanics of reliability
(acknowledgements and retransmission) and packet sizing ({{packets-frames}} -
{{packet-size}});

* wire format, including QUIC's version format, packet formats, frame formats,
and error codes ({{versions}} - {{error-codes}}).
* Streams are the basic service abstraction that QUIC provides.
** {{streams}} describes core concepts related to streams,
** {{stream-states}} provides a reference model for stream states, and
** {{flow-control}} outlines the operation of flow control.

* Connections are the context in which QUIC endpoints communicate.
** {{connections}} describes core concepts related to connections,
** {{version-negotiation}} describes version negotiation,
** {{handshake}} detail the process for establishing connections,
** {{migration}} describes how endpoints migrate a connection to use a new network paths, and
** {{termination}} lists the options for terminating an open connection.

* Packets and frames are the basic unit used by QUIC to communicate.
** {{packets-frames}} describes concepts related to packets and frames,
** {{packetization}} defines models for the transmission, retransmission, and
acknowledgement of information, and
** {{packet-size}} contains a rules for managing the size of packets.

* Details of encoding of QUIC protocol elements is described in:
** {{versions}} (Versions),
** {{packet-formats}} (Packet Headers),
** {{transport-parameter-encoding}} (Transport Parameters),
** {{frame-formats}} (Frames), and
** {{error-codes}} (Errors).

Accompanying documents describe QUIC's loss detection and congestion control
{{QUIC-RECOVERY}}, and the use of TLS 1.3 for key negotiation {{QUIC-TLS}}.
Expand Down Expand Up @@ -1490,85 +1499,30 @@ response to connection migration ({{migration}}). NEW_CONNECTION_ID frames
({{frame-new-connection-id}}) are used to provide new connection ID values.


## Transport Parameters
## Transport Parameters {#transport-parameters}

During connection establishment, both endpoints make authenticated declarations
of their transport parameters. These declarations are made unilaterally by each
endpoint. Endpoints are required to comply with the restrictions implied by
these parameters; the description of each parameter includes rules for its
handling.

The format of the transport parameters is the TransportParameters struct from
{{figure-transport-parameters}}. This is described using the presentation
language from Section 3 of {{!TLS13=RFC8446}}.
The encoding of the transport parameters is detailed in
{{transport-parameter-encoding}}.

~~~
uint32 QuicVersion;

enum {
initial_max_stream_data_bidi_local(0),
initial_max_data(1),
initial_max_bidi_streams(2),
idle_timeout(3),
preferred_address(4),
max_packet_size(5),
stateless_reset_token(6),
ack_delay_exponent(7),
initial_max_uni_streams(8),
disable_migration(9),
initial_max_stream_data_bidi_remote(10),
initial_max_stream_data_uni(11),
max_ack_delay(12),
original_connection_id(13),
(65535)
} TransportParameterId;

struct {
TransportParameterId parameter;
opaque value<0..2^16-1>;
} TransportParameter;

struct {
select (Handshake.msg_type) {
case client_hello:
QuicVersion initial_version;

case encrypted_extensions:
QuicVersion negotiated_version;
QuicVersion supported_versions<4..2^8-4>;
};
TransportParameter parameters<0..2^16-1>;
} TransportParameters;

struct {
enum { IPv4(4), IPv6(6), (15) } ipVersion;
opaque ipAddress<4..2^8-1>;
uint16 port;
opaque connectionId<0..18>;
opaque statelessResetToken[16];
} PreferredAddress;
~~~
{: #figure-transport-parameters title="Definition of TransportParameters"}

The `extension_data` field of the quic_transport_parameters extension defined in
{{QUIC-TLS}} contains a TransportParameters value. TLS encoding rules are
therefore used to describe the encoding of transport parameters.

QUIC encodes transport parameters into a sequence of octets, which are then
included in the cryptographic handshake. Once the handshake completes, the
transport parameters declared by the peer are available. Each endpoint
validates the value provided by its peer. In particular, version negotiation
MUST be validated (see {{version-validation}}) before the connection
establishment is considered properly complete.
QUIC includes the encoded transport parameters in the cryptographic handshake.
Once the handshake completes, the transport parameters declared by the peer are
available. Each endpoint validates the value provided by its peer. In
particular, version negotiation MUST be validated (see {{version-validation}})
before the connection establishment is considered properly complete.

Definitions for each of the defined transport parameters are included in
{{transport-parameter-definitions}}. Any given parameter MUST appear
at most once in a given transport parameters extension. An endpoint MUST
treat receipt of duplicate transport parameters as a connection error of
type TRANSPORT_PARAMETER_ERROR.

{{transport-parameter-definitions}}. Any given parameter MUST appear at most
once in a given transport parameters extension. An endpoint MUST treat receipt
of duplicate transport parameters as a connection error of type
TRANSPORT_PARAMETER_ERROR.

### Transport Parameter Definitions
### Transport Parameter Definitions {#transport-parameter-definitions}

An endpoint MAY use the following transport parameters:

Expand Down Expand Up @@ -3290,14 +3244,7 @@ using for private experimentation on the GitHub wiki at



# Packet Formats {#packet-formats}

All numeric values are encoded in network byte order (that is, big-endian) and
all field sizes are in bits. Hexadecimal notation is used for describing the
value of fields.


## Variable-Length Integer Encoding {#integer-encoding}
# Variable-Length Integer Encoding {#integer-encoding}

QUIC packets and frames commonly use a variable-length encoding for non-negative
integer values. This encoding ensures that smaller integer values need fewer
Expand Down Expand Up @@ -3328,6 +3275,15 @@ the single octet 25 decodes to 37 (as does the two octet sequence 40 25).
Error codes ({{error-codes}}) and versions {{versions}} are described using
integers, but do not use this encoding.



# Packet Formats {#packet-formats}

All numeric values are encoded in network byte order (that is, big-endian) and
all field sizes are in bits. Hexadecimal notation is used for describing the
value of fields.


## Packet Number Encoding and Decoding {#packet-encoding}

<!-- TODO: Maybe split this into encoding and recovery sections? -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to any packet that it receives with another packet containing a closing frame.

I think that this is fine as it is. If it were longer, maybe, but it's a nice size now and the two concepts are very closely related.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, this suggested patch does not make sense. I think you're talking about the TODO, which I agree, and I'll remove, but the suggested patch is incorrect. Looking closer, the line number is correct, but the text it shows is broken.

Expand Down Expand Up @@ -3926,6 +3882,68 @@ A Retry packet does not include a packet number and cannot be explicitly
acknowledged by a client.


# Transport Parameter Encoding {#transport-parameter-encoding}

The format of the transport parameters is the TransportParameters struct from
{{figure-transport-parameters}}. This is described using the presentation
language from Section 3 of {{!TLS13=RFC8446}}.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that I like the fact that the specific transport parameters are described way back up top now. I think that having the description of each down here is better. There's a lot of encoding information in them, and we don't generally rely on the definitions of transport parameters for much. Anything we do need can use a forward reference.


~~~
uint32 QuicVersion;

enum {
initial_max_stream_data_bidi_local(0),
initial_max_data(1),
initial_max_bidi_streams(2),
idle_timeout(3),
preferred_address(4),
max_packet_size(5),
stateless_reset_token(6),
ack_delay_exponent(7),
initial_max_uni_streams(8),
disable_migration(9),
initial_max_stream_data_bidi_remote(10),
initial_max_stream_data_uni(11),
max_ack_delay(12),
original_connection_id(13),
(65535)
} TransportParameterId;

struct {
TransportParameterId parameter;
opaque value<0..2^16-1>;
} TransportParameter;

struct {
select (Handshake.msg_type) {
case client_hello:
QuicVersion initial_version;

case encrypted_extensions:
QuicVersion negotiated_version;
QuicVersion supported_versions<4..2^8-4>;
};
TransportParameter parameters<0..2^16-1>;
} TransportParameters;

struct {
enum { IPv4(4), IPv6(6), (15) } ipVersion;
opaque ipAddress<4..2^8-1>;
uint16 port;
opaque connectionId<0..18>;
opaque statelessResetToken[16];
} PreferredAddress;
~~~
{: #figure-transport-parameters title="Definition of TransportParameters"}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to any packet that it receives with another packet containing a closing frame.
<!-- TODO: split out definition of PreferredAddress -->

The `extension_data` field of the quic_transport_parameters extension defined in
{{QUIC-TLS}} contains a TransportParameters value. TLS encoding rules are
therefore used to describe the encoding of transport parameters.

QUIC encodes transport parameters into a sequence of octets, which are then
included in the cryptographic handshake.



# Frame Types and Formats {#frame-formats}

Expand Down