Defer ACK-only packets while delivering queued packets to a new session when the client sends SDAO.

When `QuicDispatcher` creates a session for a multi-packet `ClientHello`, it delivers the packet that completed the `ClientHello` and then the buffered `INITIAL` fragments, flushing after each individual packet. Since `INITIAL` packets are ACKed immediately, the server sent a standalone 1200-byte padded `INITIAL` ACK packet after the first packet was processed, before the full `ClientHello` was available, instead of bundling the ACK with the ServerHello.

Protected by reloadable flag `gfe2_reloadable_flag_quic_defer_ack_only_packets_for_queued_packets`, and enabled per connection by the new `SDAO` client connection option so the impact can be measured with a client-side experiment:
- When `QuicDispatcher::ProcessChlo` or `QuicDispatcher::ProcessBufferedChlos` creates a session for a multi-packet `ClientHello`, it checks `packet_list.tls_chlo_extractor.transport_params()` for `SDAO` and calls `QuicConnection::set_allow_deferring_ack_only_packets(true)`. Single-packet `ClientHello`s have no buffered packets, so they are unaffected.
- `QuicDispatcher::ProcessChlo` and `QuicDispatcher::DeliverPacketsToSession` hold a `QuicConnection::ScopedAckDeferrer` (added in cl/1015665961) while the current and queued packets are processed. Pending ACKs are then bundled with outgoing data (e.g. the ServerHello) or sent once when the deferrer goes out of scope.
- Guards moving `transport_params_` in `TlsChloExtractor::operator=` behind the flag.

The packet delivery order is unchanged. With ACK-only packets deferred for the whole batch, processing the completing packet first produces the same single ServerHello with a bundled ACK as processing the packets in order.

`SDAO` is not detected for draft-29, which uses the legacy transport parameters TLS extension.

Protected by quic_reloadable_flag_quic_defer_ack_only_packets_for_queued_packets.

PiperOrigin-RevId: 1029354817
10 files changed
tree: 3f9f7565c1cb48e63b465131f7c03cddd42cb881
  1. build/
  2. depstool/
  3. quiche/
  4. .bazelrc
  5. .bazelversion
  6. BUILD.bazel
  7. CONTRIBUTING.md
  8. LICENSE
  9. MODULE.bazel
  10. MODULE.bazel.lock
  11. README.md
  12. WHITESPACE
README.md

QUICHE

QUICHE stands for QUIC, Http, Etc. It is Google‘s production-ready implementation of QUIC, HTTP/2, HTTP/3, and related protocols and tools. It powers Google’s servers, Chromium, Envoy, and other projects. It is actively developed and maintained.

There are two public QUICHE repositories. Either one may be used by embedders, as they are automatically kept in sync:

To embed QUICHE in your project, platform APIs need to be implemented and build files need to be created. Note that it is on the QUICHE team's roadmap to include default implementation for all platform APIs and to open-source build files. In the meanwhile, take a look at open source embedders like Chromium and Envoy to get started:

To contribute to QUICHE, follow instructions at CONTRIBUTING.md.

QUICHE is only supported on little-endian platforms.

Build and run standalone QUICHE

QUICHE has binaries that can run on Linux platforms.

Follow the instructions to install Bazel.

sudo apt install libicu-dev clang lld
cd <directory that will be the root of your quiche implmentation>
git clone https://github.com/google/quiche.git
cd quiche
CC=clang bazel build -c opt //...
./bazel-bin/quiche/<target_name> <arguments>

There are several targets that can be built and then run. Full usage instructions are available using the --helpfull flag on any binary.

  • quic_packet_printer: from a provided packet, parses and prints out the contents that are accessible without decryption.

Usage: quic_packet_printer server|client <hex dump of packet>

  • crypto_message_printer: dumps the contents of a QUIC crypto handshake message in a human readable format.

Usage: crypto_message_printer_bin <hex of message>

  • quic_client: connects to a host using QUIC and HTTP/3, sends a request to the provided URL, and displays the response.

Usage: quic_client <URL>

  • quic_server: listens forever on --port (default 6121) until halted via ctrl-c.

  • masque_client: tunnels to a URL via an identified proxy (See RFC 9298).

Usage: masque_client [options] <proxy-url> <urls>

  • masque_server: a MASQUE tunnel proxy that defaults to port 9661.

Usage: masque_server

  • web_transport_test_server: a server that clients can connect to via WebTransport.

  • moqt_relay: a relay for the Media Over QUIC transport for publishers and subscribers can connect to.

Usage: moqt_relay

Logging

Most log messages in QUICHE use the QUICHE_DLOG macro. In standalone quiche, these all either go to stderr, or are suppressed, based on the --stderrthreshold flag.

To send INFO level log messages to a file, you would therefore invoke

<binary> <args> > <logfile> 2>&1

Use the --helpfull flag for more.