田字簿

[译] QUIC Wire Layout Specificati

2019-06-16  本文已影响0人  就想叫yoko

欢迎访问我的个人网站获取更佳阅读体验:[译] QUIC Wire Layout Specification - QUIC Transport Parameters & Handshake Protocol Requirements | QUIC协议标准中文翻译(5) 传输参数以及握手协议必需条件 | yoko blog
(https://pengrl.com/p/45849/)

目录

QUIC Transport Parameters | QUIC传输参数

The handshake is responsible for negotiating a variety of transport parameters for a QUIC connection.

握手负责为QUIC连接协商一系列的传输参数。

Required Parameters | 必须参数

  • SFCW - Stream Flow Control Window. The size in bytes of the stream level flow control window.
  • CFCW - Connection Flow Control Window. The size in bytes of the connection level flow control window.

Optional Parameters | 可选参数

  • SRBF - Socket receive buffer size in bytes. The peer may want to limit their max CWND to something similar to the socket receive buffer if they fear the peer may sometimes be delayed in reading packets from kernel’s socket buffer. Defaults to 256kbytes and has a minimum value of 16kbytes.
  • TCID - Connection ID truncation. Indicates support for truncated Connection IDs. If sent by a peer, indicates the connection IDs sent to the peer should be truncated to 0 bytes. Useful for cases when a client ephemeral port is only used for a single connection.
  • COPT - Connection Options are a repeated tag field. The field contains any connection options being requested by the client or server. These are typically used for experimentation and will evolve over time. Example use cases include changing congestion control algorithms and parameters such as initial window.

QuicErrorCodes | QUIC错误码

The number to code mappings for QuicErrorCodes are currently defined in the Chromium source code in src/net/quic/quic_protocol.h. (TODO: hardcode numbers and add them here)

对应错误码的错误数值目前被定义在Chromium的源码中,源码文件为 src/net/quic/quic_protocol.h(TODO:将硬编码的错误数值添加至此)

Priority | 优先级

(TODO: implement)
QUIC will use the HTTP/2 prioritization mechanism. Roughly, a stream may be dependent on another stream. In this situation, the "parent" stream should effectively starve the "child" stream. In addition, parent streams have an explicit priority. Parent streams should not starve other parent streams, but should make progress proportional to their relative priority.

(TODO:实现)

QUIC将使用HTTP/2的优先级机制。粗略的说,一个流可能依赖另一个流。在这种情况,父类流可能会饿死子类流。此外,父类流拥有显式的优先级。父类流不应该饿死其他父类流,但是应该根据它们的相对优先级来调整进度。

HTTP/2 Layering over QUIC | 基于QUIC的HTTP/2

Since QUIC integrates various HTTP/2 mechanisms with transport mechanisms, QUIC implements a number of features that are also specified in HTTP/2. As a result, QUIC allows HTTP/2 mechanisms to be replaced by QUIC's implementation, reducing complexity in the HTTP/2 protocol. This section briefly describes how HTTP/2 semantics can be offered over a QUIC implementation.

Stream Management

When HTTP/2 headers and data are sent over QUIC, the QUIC layer handles most of the stream management. HTTP/2 Stream IDs are replaced by QUIC Stream IDs. HTTP/2 does not need to do any explicit stream framing when using QUIC---data sent over a QUIC stream simply consists of HTTP/2 headers or body. Requests and responses are considered complete when the QUIC stream is closed in the corresponding direction.

Stream flow control is handled by QUIC, and does not need to be re-implemented in HTTP/2. QUIC's flow controller replaces the two levels of poorly matched flow controllers in current HTTP/2 deployments---one at the HTTP/2 level, and the other at the TCP level.

HTTP/2 Header Compression

QUIC implements HPACK header compression for HTTP/2 [RFC7541], which unfortunately introduces some Head-of-Line blocking since HTTP/2 header blocks must be decompressed in the order they were compressed.

Since streams may be processed in arbitrary order at a receiver, strict ordering across headers is enforced by sending all headers on a dedicated headers stream, with Stream ID 3. An HTTP/2 receiver using QUIC would thus process data from a stream only after receiving the corresponding header on the headers stream.

Future work will tweak the compressor and decompressor in QUIC so that the compressed output does not depend on unacked previous compressed state. This could be done, perhaps, by creating "checkpoints" of HPACK state which are updated when headers have been acked. When compressing headers QUIC would only compress relative to the previous "checkpoint".

Parsing HTTP/2 Headers

Bytes sent on the dedicated headers stream are simply HTTP/2 HEADERS frames. The exact layout of these frames is described in Section 6.2 of [RFC7540].

QUIC Negotiation in HTTP

The Alternate-Protocol header is used to negotiate use of QUIC on future HTTP requests. To specify QUIC as an alternate protocol available on port 123, a server uses:

--- src
"Alternate-Protocol: 123:quic"
---

When a client receives a Alternate-Protocol header advertising QUIC, it can then attempt to use QUIC for future secure connections on that domain. Since middleboxes and/or firewalls can block QUIC and/or UDP communication, a client should implement a graceful fallback to TCP when QUIC reachability is broken.

Note that the server may reply with multiple field values or a comma-separated field value for Alternate-Protocol to indicate the various transports it supports.

A server can also send a header to notify that QUIC should not be used on this domain. If it sends the alternate-protocol-required header, the client should remember to not use QUIC on that domain in future, and not do any UDP probing to see if QUIC is available.

Handshake Protocol Requirements | 握手协议必需条件

QUIC provides a dedicated stream (Stream ID 1) to be used for performing a combined connection and security handshake, but the details of this handshake protocol are out of this document's scope. However, QUIC does impose a number of requirements on any such handshake protocol. The following list of requirements documents properties of the current prototype handshake which should be provided by any future handshake protocol.

QUIC提供了一个专用的流(流ID为1)用于处理连接和安全性握手,但是握手协议的细节超出了本文档的范围。然而,对于任何QUIC的握手协议来说,QUIC确实强制了一系列的必需条件。接下来的必需条件列表是目前握手的原型,将来的握手协议也需遵守这些条件。

Connection Establishment in 0-RTT | 0-RTT建立连接

The QUIC handshake protocol manages to successfully achieve 0-RTT for most connections, and is critical to QUIC's latency improvements.

QUIC握手协议设法为大部分连接成功达到0-RTT的目标,改善QUIC的时延是首要目标。

Source Address Spoofing Defense | 源地址欺骗防御

TCP verifies the client’s address by burning a round trip on the SYN, SYN_ACK exchange. QUIC uses a source address token delivered by the server in a previous connection.

TCP通过一次往返的SYN,SYN_ACK交换信息来验证客户端的地址。QUIC使用一个服务端在上一个连接发送的源地址token。

Opaque Source Address Tokens | 不透明的源地址令牌

QUIC servers store a number of pieces of data in the source address token, for use on a subsequent connection from the same client. This includes recently used source addresses, measured bandwidth to the client, and server-designated connection IDs (for Stateless REJs). An alternative handshake protocol’s analog of a source address token needs to be (i) opaque at the client, and (ii) large enough to permit these bits of information to be stored. Alternatively, the handshake protocol should have a different method to store this information at the client.

QUIC服务端在源地址令牌中保存了一系列的数据,为同一个客户端的后续连接所使用。包含了最近使用的源地址,与该客户端间测量过的带宽,以及服务端指定的连接ID(为了无状态的REJ)。一个可替代的握手协议必须提供相似的源地址令牌,满足以下条件:(i) 对于客户端是透明的 (ii) 足够大以允许存储这些信息。或者,握手协议需有其他方法在客户端存储这些信息。

Transport Parameter Negotiation | 传输参数协商

In addition to negotiating crypto parameters, the QUIC handshake also negotiates QUIC and HTTP/2 level parameters, including max open QUIC streams and other QUIC connection options.

作为加密参数协商的补充,QUIC握手需协商QUIC和HTTP/2层面的参数,包括最大打开QUIC流数量以及其他QUIC连接选项。

Certificate Compression | 证书压缩

The QUIC handshake compresses certificates so that an REJ, including the common Google certificate chain, is able to fit into two 1350 byte packets. This helps to reduce the amplification attack footprint of QUIC without reducing 0-RTT rate.

QUIC握手需压缩证书,这样,一个REJ,包含公共google证书链条,可以放进两个1350字节的包中。这有助于降低QUIC的签名攻击而不需要降低0-RTT的比例。

Server Config Update | 服务端配置升级

QUIC uses a Server Config Update (SCUP) message to refresh the source-address token (STK) and server config mid-connection, extending the period over which 0-RTT connections can be established by the client.

QUIC使用一个服务端配置升级(SCUP)消息来刷新源地址令牌(STK)以及服务端配置中间连接,延长客户端可以建立0-RTT连接的时间。

Recent Changes By Version

Contributors

This protocol is the outcome of work by many engineers, not just the authors of this document. The design and rationale behind QUIC draw significantly from work by Jim Roskind. In alphabetical order, the contributors to the project are: Britt Cyr, Jeremy Dorfman, Ryan Hamilton, Jana Iyengar, Fedor Kouranov, Charles Krasic, Jo Kulik, Adam Langley, Jim Roskind, Robbie Shade, Satyam Shekhar, Cherie Shi, Ian Swett, Raman Tenneti, Victor Vasiliev, Antonio Vicente, Patrik Westin, Alyssa Wilk, Dale Worley, Fan Yang, Dan Zhang, Daniel Ziegler.

Acknowledgments

Special thanks are due to the following for helping shape QUIC and its deployment: Chris Bentzel, Misha Efimov, Roberto Peon, Alistair Riddoch, Siddharth Vijayakrishnan, and Assar Westerlund. QUIC has also benefited immensely from discussions with folks in private conversations and public ones on the proto-quic@chromium.org mailing list.

英文原文链接

QUIC Wire Layout Specification - Google 文档

上一篇下一篇

猜你喜欢

热点阅读