Skip to content

Commit a9d25dd

Browse files
Merge branch 'master' into ianswett-patch-3
2 parents f759b4b + da282a7 commit a9d25dd

File tree

4 files changed

+65
-40
lines changed

4 files changed

+65
-40
lines changed

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ endif
1010

1111
latest::
1212
@if grep -l ' $$' *.md; then ! echo "Trailing whitespace found"; fi
13-
@wc -L draft-*.md | head -n -1 | while read l f; do \
14-
[ "$$l" -le 80 ] || ! echo "$$f is contains a line with $$l characters"; \
15-
done
13+
@err=0; for f in draft-*.md ; do \
14+
line=$$(cat "$$f" | wc -L); \
15+
if [ "$$line" -gt 80 ]; then \
16+
echo "$$f contains a line with >80 ($$line) characters"; err=1; \
17+
fi; \
18+
figure=$$(sed -e '/^~~~/,/^~~~/p;d' "$$f" | wc -L); \
19+
if [ "$$figure" -gt 69 ]; then \
20+
echo "$$f contains a figure with >69 ($$figure) characters"; err=1; \
21+
fi; \
22+
done; [ "$$err" -eq 0 ]

draft-ietf-quic-http.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ normative:
3131
org: Mozilla
3232
role: editor
3333
-
34-
ins: S. Turner, Ed.
34+
ins: S. Turner
3535
name: Sean Turner
3636
org: sn3rd
3737
role: editor

draft-ietf-quic-recovery.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ normative:
3737
org: Mozilla
3838
role: editor
3939
-
40-
ins: S. Turner, Ed.
40+
ins: S. Turner
4141
name: Sean Turner
4242
org: sn3rd
4343
role: editor
@@ -483,7 +483,7 @@ Pseudocode for OnAlarm follows:
483483
~~~
484484
OnAlarm(acked_packet):
485485
lost_packets = DetectLostPackets(acked_packet);
486-
MaybeRetransmitLostPackets();
486+
MaybeRetransmit(lost_packets);
487487
SetLossDetectionAlarm();
488488
~~~
489489

@@ -503,22 +503,21 @@ identical to other packets.
503503

504504
### Psuedocode
505505

506-
DetectLostPackets takes one parameter, acked_packet, which is the packet number
507-
of the largest acked packet, and returns a list of packet numbers detected as
508-
lost.
506+
DetectLostPackets takes one parameter, acked, which is the largest acked packet,
507+
and returns a list of packets detected as lost.
509508

510509
Pseudocode for DetectLostPackets follows:
511510

512511
~~~
513-
DetectLostPackets(acked_packet):
512+
DetectLostPackets(acked):
514513
lost_packets = {};
515-
foreach (unacked_packet less than acked_packet):
516-
if (unacked_packet.time_sent <
517-
acked_packet.time_sent - kTimeReorderThreshold * smoothed_rtt):
518-
lost_packets.insert(unacked_packet.packet_number);
519-
else if (unacked_packet.packet_number <
520-
acked_packet.packet_number - reordering_threshold)
521-
lost_packets.insert(unacked_packet.packet_number);
514+
foreach (unacked less than acked):
515+
time_delta = acked.time_sent - unacked.time_sent
516+
packet_delta = acked.packet_number - unacked.packet_number
517+
if (time_delta > kTimeReorderThreshold * smoothed_rtt):
518+
lost_packets.insert(unacked);
519+
else if (packet_delta > reordering_threshold)
520+
lost_packets.insert(unacked);
522521
return lost_packets;
523522
~~~
524523

draft-ietf-quic-transport.md

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ normative:
5252
org: Mozilla
5353
role: editor
5454
-
55-
ins: S. Turner, Ed.
55+
ins: S. Turner
5656
name: Sean Turner
5757
org: sn3rd
5858
role: editor
@@ -475,8 +475,8 @@ The fields in a Regular packet past the Common Header are the following:
475475

476476
* Packet Number: The lower 8, 16, 32, or 48 bits of the packet number, based on
477477
the PACKET_NUMBER_SIZE flag. Each Regular packet is assigned a packet number
478-
by the sender. The first packet sent by an endpoint MUST have a packet number
479-
of 1.
478+
by the sender. The first packet number is randomized (see
479+
{{initial-packet-number}}.
480480

481481
* Encrypted Payload: The remainder of a Regular packet is both authenticated and
482482
encrypted once packet protection keys are available. {{QUIC-TLS}} describes
@@ -535,6 +535,17 @@ at any point in the connection. In other words,
535535

536536
(TODO: Clarify how packet number size can change mid-connection.)
537537

538+
539+
### Initial Packet Number
540+
541+
The initial value for packet number MUST be a 31-bit random number. That is,
542+
the value is selected from an uniform random distribution between 0 and 2^31-1.
543+
544+
The first set of packets sent by an endpoint MUST include the low 32-bits of the
545+
packet number. Once any packet has been acknowledged, subsequent packets can
546+
use a shorter packet number encoding.
547+
548+
538549
### Frames and Frame Types {#frames}
539550

540551
A Regular packet MUST contain at least one frame, and MAY contain multiple
@@ -920,28 +931,29 @@ A STREAM frame is shown below.
920931
0 1 2 3
921932
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
922933
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
934+
| [Data Length (16)] |
935+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
923936
| Stream ID (8/16/24/32) ...
924937
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
925938
| Offset (0/16/24/32/40/48/56/64) ...
926939
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
927-
| [Data Length (16)] |
928-
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
929940
| Stream Data (*) ...
930941
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
931942
~~~
932943
{: #stream-format title="STREAM Frame Format"}
933944

934945
The STREAM frame contains the following fields:
935946

947+
* Data Length: An optional 16-bit unsigned number specifying the length of the
948+
Stream Data field in this STREAM frame. This field is present when the `D`
949+
bit is set to 1.
950+
936951
* Stream ID: A variable-sized unsigned ID unique to this stream.
937952

938953
* Offset: A variable-sized unsigned number specifying the byte offset in the
939954
stream for the data in this STREAM frame. The first byte in the stream has an
940955
offset of 0.
941956

942-
* Data Length: An optional 16-bit unsigned number specifying the length of the
943-
Stream Data field in this STREAM frame.
944-
945957
* Stream Data: The bytes from the designated stream to be delivered.
946958

947959
A STREAM frame MUST have either non-zero data length or the FIN bit set.
@@ -1007,36 +1019,36 @@ An ACK frame is shown below.
10071019
0 1 2 3
10081020
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
10091021
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1010-
| Largest Acked (8/16/32/48) ...
1022+
|[Num Blocks(8)]| NumTS (8) | Largest Acked (8/16/32/48) ...
10111023
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10121024
| Ack Delay (16) |
10131025
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1014-
|[Num Blocks(8)]| Ack Block Section (*) ...
1026+
| Ack Block Section (*) ...
10151027
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1016-
| NumTS (8) | Timestamp Section (*) ...
1028+
| Timestamp Section (*) ...
10171029
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
10181030
~~~
10191031
{: #ack-format title="ACK Frame Format"}
10201032

10211033
The fields in the ACK frame are as follows:
10221034

1035+
* Num Blocks (opt): An optional 8-bit unsigned value specifying the number of
1036+
additional ack blocks (besides the required First Ack Block) in this ACK
1037+
frame. Only present if the 'N' flag bit is 1.
1038+
1039+
* Num Timestamps: An unsigned 8-bit number specifying the total number of
1040+
<packet number, timestamp> pairs in the Timestamp Section.
1041+
10231042
* Largest Acked: A variable-sized unsigned value representing the largest packet
10241043
number the peer is acking in this packet (typically the largest that the peer
10251044
has seen thus far.)
10261045

10271046
* Ack Delay: Time from when the largest acked packet, as indicated in the
10281047
Largest Acked field, was received by this peer to when this ack was sent.
10291048

1030-
* Num Blocks (opt): An optional 8-bit unsigned value specifying the number of
1031-
additional ack blocks (besides the required First Ack Block) in this ACK
1032-
frame. Only present if the 'N' flag bit is 1.
1033-
10341049
* Ack Block Section: Contains one or more blocks of packet numbers which have
10351050
been successfully received. See {{ack-block-section}}.
10361051

1037-
* Num Timestamps: An unsigned 8-bit number specifying the total number of
1038-
<packet number, timestamp> pairs in the Timestamp Section.
1039-
10401052
* Timestamp Section: Contains zero or more timestamps reporting transit delay of
10411053
received packets. See {{timestamp-section}}.
10421054

@@ -1387,9 +1399,7 @@ bundle any set of frames in a packet. All QUIC packets MUST contain a packet
13871399
number and MAY contain one or more frames ({{frames}}). Packet numbers MUST be
13881400
unique within a connection and MUST NOT be reused within the same connection.
13891401
Packet numbers MUST be assigned to packets in a strictly monotonically
1390-
increasing order. The initial packet number used, at both the client and the
1391-
server, MUST be 0. That is, the first packet in both directions of the
1392-
connection MUST have a packet number of 0.
1402+
increasing order.
13931403

13941404
A sender SHOULD minimize per-packet bandwidth and computational costs by
13951405
bundling as many frames as possible within a QUIC packet. A sender MAY wait for
@@ -1532,8 +1542,8 @@ shown in the following figure and described below.
15321542
15331543
app: application API signals to QUIC
15341544
reserve_stream: causes a StreamID to be reserved for later use
1535-
read_close: causes stream to be half-closed without receiving a FIN
1536-
write_close: causes stream to be half-closed without sending a FIN
1545+
read_close: causes stream to be half-closed without a FIN
1546+
write_close: causes stream to be half-closed without a FIN
15371547
~~~
15381548
{: #stream-lifecycle title="Lifecycle of a stream"}
15391549
@@ -1708,6 +1718,15 @@ receives a STREAM frame that causes its advertised concurrent stream limit to be
17081718
exceeded MUST treat this as a stream error of type QUIC_TOO_MANY_OPEN_STREAMS
17091719
({{error-handling}}).
17101720
1721+
All streams, including stream 1, count toward this limit. Thus, a concurrent
1722+
stream limit of 0 will cause a connection to be unusable. Application protocols
1723+
that use QUIC might require a certain minimum number of streams to function
1724+
correctly. If a peer advertises an MSPC value that is too small for the
1725+
selected application protocol to function, an endpoint MUST terminate the
1726+
connection with an error of type QUIC_TOO_MANY_OPEN_STREAMS
1727+
({{error-handling}}).
1728+
1729+
17111730
## Sending and Receiving Data
17121731
17131732
Once a stream is created, endpoints may use the stream to send and receive data.

0 commit comments

Comments
 (0)