LSQUIC Documentation
This is the documentation for LSQUIC 4.0.12, last updated Sep 25, 2024.
LiteSpeed QUIC (LSQUIC) Library is an open-source implementation of QUIC and HTTP/3 functionality for servers and clients. LSQUIC is:
fast;
flexible; and
production-ready.
Most of the code in this distribution has been used in our own products – LiteSpeed Web Server, LiteSpeed Web ADC, and OpenLiteSpeed – since 2017.
Currently supported QUIC versions are v1, Internet-Draft versions 29, and 27; and the older “Google” QUIC versions Q043, Q046, an Q050.
LSQUIC is licensed under the MIT License; see LICENSE in the source distribution for details.
Features
LSQUIC supports nearly all QUIC and HTTP/3 features, including
DPLPMTUD
ECN
Spin bits (allowing network observer to calculate a connection’s RTT)
Path migration
NAT rebinding
Push promises
TLS Key updates
Extensions:
Loss bits extension (allowing network observer to locate source of packet loss)
Timestamps extension (allowing for one-way delay calculation, improving performance of some congestion controllers)
Delayed ACKs (this reduces number of ACK frames sent and processed, improving throughput)
QUIC grease bit to reduce ossification opportunities
Architecture
The LSQUIC library does not use sockets to receive and send packets; that is handled by the user-supplied callbacks. The library also does not mandate the use of any particular event loop. Instead, it has functions to help the user schedule events. (Thus, using an event loop is not even strictly necessary.) The various callbacks and settings are supplied to the engine constructor. LSQUIC keeps QUIC connections in several data structures in order to process them efficiently. Connections that need processing are kept in two priority queues: one holds connections that are ready to be processed (or “ticked”) and the other orders connections by their next timer value. As a result, no connection is processed needlessly.
Contents
- Getting Started
- Tutorial
- Introduction
- Library Initialization
- Engine Instantiation
- Receiving Packets
- Sending Packets
- When to process connections
- Required Engine Callbacks
- Stream and connection callbacks
- Using Streams
- Client: making connection
- Specifying QUIC version
- Server callbacks
- Engine settings
- Logging
- Key logging and Wireshark
- Connection IDs
- Get this-and-that API
- API Reference
- Preliminaries
- Library Version
- QUIC Versions
- LSQUIC Types
- Library Initialization
- Logging
- Engine Instantiation and Destruction
- Engine Callbacks
- Engine Settings
- Receiving Packets
- Sending Packets
- Stream Callback Interface
- Creating Connections
- Closing Connections
- Creating Streams
- Stream Events
- Reading From Streams
- Writing To Streams
- Closing Streams
- Sending HTTP Headers
- Receiving HTTP Headers
- Push Promises
- Stream Priorities
- Miscellaneous Engine Functions
- Miscellaneous Connection Functions
- Miscellaneous Stream Functions
- Other Functions
- Miscellaneous Types
- Global Variables
- List of Log Modules
- Extensible HTTP Priorities
- Datagrams
- Developing lsquic
- Library Guts
- Introduction
- Coding Style
- List of Common Terms
- High-Level Structure
- Engine
- Connection
- Stream
- Parsing
- Mini vs Full Connections
- Mini gQUIC Connection
- Mini IETF Connection
- Connection Public Interface
- Full gQUIC Connection
- Full IETF Connection
- Anatomy of Outgoing Packet
- Evanescent Connection
- Send Controller
- Alarm Set
- Tickable Queue
- Advisory Tick Time Queue
- CID Purgatory
- Memory Manager
- Malo Allocator
- Receive History
- Tiny Receive History
- Set64
- Appendix A: List of Data Structures
- Appendix B: Obsolete and Defunct Code
- Frequently Asked Questions