Internet-Draft | QUIC-LB | January 2022 |
Duke & Banks | Expires 8 July 2022 | [Page] |
The QUIC protocol design is resistant to transparent packet inspection, injection, and modification by intermediaries. However, the server can explicitly cooperate with network services by agreeing to certain conventions and/or sharing state with those services. This specification provides a standardized means of solving three problems: (1) maintaining routability to servers via a low-state load balancer even when the connection IDs in use change; (2) explicit encoding of the connection ID length in all packets to assist hardware accelerators; and (3) injection of QUIC Retry packets by an anti-Denial-of-Service agent on behalf of the server.¶
Discussion of this document takes place on the QUIC Working Group mailing list (quic@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/quic/.¶
Source for this draft and an issue tracker can be found at https://github.com/quicwg/load-balancers.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 8 July 2022.¶
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
QUIC packets [RFC9000] usually contain a connection ID to allow endpoints to associate packets with different address/port 4-tuples to the same connection context. This feature makes connections robust in the event of NAT rebinding. QUIC endpoints usually designate the connection ID which peers use to address packets. Server-generated connection IDs create a potential need for out-of-band communication to support QUIC.¶
QUIC allows servers (or load balancers) to designate an initial connection ID to encode useful routing information for load balancers. It also encourages servers, in packets protected by cryptography, to provide additional connection IDs to the client. This allows clients that know they are going to change IP address or port to use a separate connection ID on the new path, thus reducing linkability as clients move through the world.¶
There is a tension between the requirements to provide routing information and mitigate linkability. Ultimately, because new connection IDs are in protected packets, they must be generated at the server if the load balancer does not have access to the connection keys. However, it is the load balancer that has the context necessary to generate a connection ID that encodes useful routing information. In the absence of any shared state between load balancer and server, the load balancer must maintain a relatively expensive table of server-generated connection IDs, and will not route packets correctly if they use a connection ID that was originally communicated in a protected NEW_CONNECTION_ID frame.¶
This specification provides common algorithms for encoding the server mapping in a connection ID given some shared parameters. The mapping is generally only discoverable by observers that have the parameters, preserving unlinkability as much as possible.¶
Aside from load balancing, a QUIC server may also desire to offload other protocol functions to trusted intermediaries. These intermediaries might include hardware assist on the server host itself, without access to fully decrypted QUIC packets. For example, this document specifies a means of offloading stateless retry to counter Denial of Service attacks. It also proposes a system for self-encoding connection ID length in all packets, so that crypto offload can consistently look up key information.¶
While this document describes a small set of configuration parameters to make the server mapping intelligible, the means of distributing these parameters between load balancers, servers, and other trusted intermediaries is out of its scope. There are numerous well-known infrastructures for distribution of configuration.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].¶
In this document, these words will appear with that interpretation only when in ALL CAPS. Lower case uses of these words are not to be interpreted as carrying significance described in RFC 2119.¶
In this document, "client" and "server" refer to the endpoints of a QUIC connection unless otherwise indicated. A "load balancer" is an intermediary for that connection that does not possess QUIC connection keys, but it may rewrite IP addresses or conduct other IP or UDP processing. A "configuration agent" is the entity that determines the QUIC-LB configuration parameters for the network and leverages some system to distribute that configuration.¶
Note that stateful load balancers that act as proxies, by terminating a QUIC connection with the client and then retrieving data from the server using QUIC or another protocol, are treated as a server with respect to this specification.¶
For brevity, "Connection ID" will often be abbreviated as "CID".¶
All wire formats will be depicted using the notation defined in Section 1.3 of [RFC9000]. There is one addition: the function len() refers to the length of a field which can serve as a limit on a different field, so that the lengths of two fields can be concisely defined as limited to a sum, for example:¶
x(A..B) y(C..B-len(x))¶
indicates that x can be of any length between A and B, and y can be of any length between C and B provided that (len(x) + len(y)) does not exceed B.¶
The example below illustrates the basic framework:¶
QUIC is intended to provide unlinkability across connection migration, but servers are not required to provide additional connection IDs that effectively prevent linkability. If the coordination scheme is too difficult to implement, servers behind load balancers using connection IDs for routing will use trivially linkable connection IDs. Clients will therefore be forced to choose between terminating the connection during migration or remaining linkable, subverting a design objective of QUIC.¶
The solution should be both simple to implement and require little additional infrastructure for cryptographic keys, etc.¶
In the limit where there are very few connections to a pool of servers, no scheme can prevent the linking of two connection IDs with high probability. In the opposite limit, where all servers have many connections that start and end frequently, it will be difficult to associate two connection IDs even if they are known to map to the same server.¶
QUIC-LB is relevant in the region between these extremes: when the information that two connection IDs map to the same server is helpful to linking two connection IDs. Obviously, any scheme that transparently communicates this mapping to outside observers compromises QUIC's defenses against linkability.¶
Though not an explicit goal of the QUIC-LB design, concealing the server mapping also complicates attempts to focus attacks on a specific server in the pool.¶
The first octet of a Connection ID is reserved for two special purposes, one mandatory (config rotation) and one optional (length self-description).¶
Subsequent sections of this document refer to the contents of this octet as the "first octet."¶
The first two bits of any connection ID MUST encode an identifier for the configuration that the connection ID uses. This enables incremental deployment of new QUIC-LB settings (e.g., keys).¶
When new configuration is distributed to servers, there will be a transition period when connection IDs reflecting old and new configuration coexist in the network. The rotation bits allow load balancers to apply the correct routing algorithm and parameters to incoming packets.¶
Configuration Agents SHOULD deliver new configurations to load balancers before doing so to servers, so that load balancers are ready to process CIDs using the new parameters when they arrive.¶
A Configuration Agent SHOULD NOT use a codepoint to represent a new configuration until it takes precautions to make sure that all connections using CIDs with an old configuration at that codepoint have closed or transitioned.¶
Servers MUST NOT generate new connection IDs using an old configuration after receiving a new one from the configuration agent. Servers MUST send NEW_CONNECTION_ID frames that provide CIDs using the new configuration, and retire CIDs using the old configuration using the "Retire Prior To" field of that frame.¶
It also possible to use these bits for more long-lived distinction of different configurations, but this has privacy implications (see Section 11.3).¶
If a server has not received a valid QUIC-LB configuration, and believes that low-state, Connection-ID aware load balancers are in the path, it SHOULD generate connection IDs with the config rotation bits set to '11' and SHOULD use the "disable_active_migration" transport parameter in all new QUIC connections. It SHOULD NOT send NEW_CONNECTION_ID frames with new values.¶
A load balancer that sees a connection ID with config rotation bits set to '11' MUST revert to 5-tuple routing. These connection IDs may be of any length; however, see Section 11.6 for limits on this length.¶
Local hardware cryptographic offload devices may accelerate QUIC servers by receiving keys from the QUIC implementation indexed to the connection ID. However, on physical devices operating multiple QUIC servers, it is impractical to efficiently lookup these keys if the connection ID does not self-encode its own length.¶
Note that this is a function of particular server devices and is irrelevant to load balancers. As such, load balancers MAY omit this from their configuration. However, the remaining 6 bits in the first octet of the Connection ID are reserved to express the length of the following connection ID, not including the first octet.¶
A server not using this functionality SHOULD make the six bits appear to be random.¶
In QUIC-LB, load balancers do not generate individual connection IDs for servers. Instead, they communicate the parameters of an algorithm to generate routable connection IDs.¶
The algorithms differ in the complexity of configuration at both load balancer and server. Increasing complexity improves obfuscation of the server mapping.¶
This section describes three participants: the configuration agent, the load balancer, and the server. For any given QUIC-LB configuration that enables connection-ID-aware load balancing, there must be a choice of (1) routing algorithm, (2) server ID allocation strategy, and (3) algorithm parameters.¶
Fundamentally, servers generate connection IDs that encode their server ID. Load balancers decode the server ID from the CID in incoming packets to route to the correct server.¶
There are situations where a server pool might be operating two or more routing algorithms or parameter sets simultaneously. The load balancer uses the first two bits of the connection ID to multiplex incoming DCIDs over these schemes (see Section 3.1).¶
QUIC-LB servers will generate Connection IDs that are decodable to extract a server ID in accordance with a specified algorithm and parameters. However, QUIC often uses client-generated Connection IDs prior to receiving a packet from the server.¶
These client-generated CIDs might not conform to the expectations of the routing algorithm and therefore not be routable by the load balancer. Those that are not routable are "unroutable DCIDs" and receive similar treatment regardless of why they're unroutable:¶
All other DCIDs are routable.¶
Load balancers MUST forward packets with routable DCIDs to a server in accordance with the chosen routing algorithm.¶
Load balancers SHOULD drop short header packets with unroutable DCIDs.¶
When forwarding a packet with a long header and unroutable DCID, load balancers MUST use a fallback algorithm as specified in Section 4.2.¶
Load balancers MAY drop packets with long headers and unroutable DCIDs if and only if it knows that the encoded QUIC version does not allow an unroutable DCID in a packet with that signature. For example, a load balancer can safely drop a QUIC version 1 Handshake packet with an unroutable DCID, as a version 1 Handshake packet sent to a QUIC-LB routable server will always have a server-generated routable CID. The prohibition against dropping packets with long headers remains for unknown QUIC versions.¶
Furthermore, while the load balancer function MUST NOT drop packets, the device might implement other security policies, outside the scope of this specification, that might force a drop.¶
Servers that receive packets with unroutable CIDs MUST use the available mechanisms to induce the client to use a routable CID in future packets. In QUIC version 1, this requires using a routable CID in the Source CID field of server-generated long headers.¶
There are conditions described below where a load balancer routes a packet using a "fallback algorithm." It can choose any algorithm, without coordination with the servers, but the algorithm SHOULD be deterministic over short time scales so that related packets go to the same server. The design of this algorithm SHOULD consider the version-invariant properties of QUIC described in [RFC8999] to maximize its robustness to future versions of QUIC.¶
A fallback algorithm MUST NOT make the routing behavior dependent on any bits in the first octet of the QUIC packet header, except the first bit, which indicates a long header. All other bits are QUIC version-dependent and intermediaries SHOULD NOT base their design on version-specific templates.¶
For example, one fallback algorithm might convert a unroutable DCID to an integer and divided by the number of servers, with the modulus used to forward the packet. The number of servers is usually consistent on the time scale of a QUIC connection handshake. Another might simply hash the address/port 4-tuple. See also Section 10.¶
Load Balancer configurations include a mapping of server IDs to forwarding addresses. The corresponding server configurations contain one or more unique server IDs.¶
The configuration agent chooses a server ID length for each configuration that MUST be at least one octet.¶
A QUIC-LB configuration MAY significantly over-provision the server ID space (i.e., provide far more codepoints than there are servers) to increase the probability that a randomly generated Destination Connection ID is unroutable.¶
The configuration agent SHOULD provide a means for servers to express the number of server IDs it can usefully employ, because a single routing address actually corresponds to multiple server entities (see Section 9.1).¶
Conceptually, each configuration has its own set of server ID allocations, though two static configurations with identical server ID lengths MAY use a common allocation between them.¶
A server encodes one of its assigned server IDs in any CID it generates using the relevant configuration.¶
All connection IDs use the following format:¶
Each configuration specifies the length of the Server ID and Nonce fields, with limits defined for each algorithm. When using a given configuration, the server MUST generate CIDs of length equal to the lengths of these three fields.¶
The Server ID is assigned to each server in accordance with Section 4.3. Dynamically allocated SIDs are limited to seven octets or fewer. Statically allocated ones have different limits for each algorithm.¶
The configuration agent assigns a server ID to every server in its pool, and determines a server ID length (in octets) sufficiently large to encode all server IDs, including potential future servers.¶
The Nonce is selected by the server when it generates a CID. As the name implies, a server MUST use a nonce no more than once when generating a CID for a given server ID and unique set of configuration parameters.¶
The nonce length MUST be at least 4 octets. Additional limits on its length are different for each algorithm. See Section 11.6 for limits on nonce generation.¶
As QUIC version 1 limits connection IDs to 20 octets, the server ID and nonce lengths MUST sum to 19 octets or less.¶
Encryption in the algorithms below uses the AES-128-ECB cipher. Future standards could add new algorithms that use other ciphers to provide cryptographic agility in accordance with [RFC7696]. QUIC-LB implementations SHOULD be extensible to support new algorithms.¶
The Plaintext CID Algorithm makes no attempt to obscure the mapping of connections to servers, significantly increasing linkability.¶
On each incoming packet, the load balancer extracts consecutive octets, beginning with the second octet. These bytes represent the server ID. It ignores the nonce.¶
When a server needs a new connection ID, it encodes one of its assigned server IDs in consecutive octets beginning with the second and chooses a nonce. This nonce MUST appear to be random (see Section 11.6).¶
The Encrypted Short CID algorithm provides cryptographic protection at the cost of additional per-packet processing at the load balancer to decrypt every incoming connection ID, unless the load balancer maintains state for the routing information of any given 4-tuple.¶
The nonce length MUST be no fewer than 4 octets. The nonce SHOULD be at least as long as the server ID in order to save the load balancer an encryption pass; see below.¶
The configuration agent also selects an 16-octet AES-ECB key to use for connection ID decryption.¶
When generating a routable connection ID, the server writes arbitrary bits into its nonce octets, and its provided server ID into the server ID octets. See Section 11.6 for nonce generation considerations.¶
The server encrypts the server ID using the following four pass algorithm, which leverages 128-bit AES Electronic Codebook (ECB) mode, much like QUIC header protection.¶
In the text below, ^ is the XOR function and || is concatenation. The truncate() function takes the most significant octets of its argument, so that the XOR function operates on fields of the same length. The expand() function outputs 16 octets, with its first argument in the most significant bits, its second argument in the least significant bits, and zeros in all other positions. Thus,¶
expand(0xaaba3c, 0x13) = 0xaaba3c00000000000000000000000013¶
The example at the end of this section helps to clarify the steps described below.¶
XOR the most significant bits of the ciphertext with right_0 to form right_1.¶
Thus steps 3 and 4 can be expressed as¶
right_1 = right_0 ^ truncate(AES_ECB(key, expand(left_0, 0x01))
¶
Repeat steps 3 and 4, but use them to compute left_1 by expanding and encrypting right_1 with the least significant octet as 0x02 and XOR the results with left_0.¶
left_1 = left_0 ^ truncate(AES_ECB(key, expand(right_1), 0x02))
¶
Repeat steps 3 and 4, but use them to compute right_2 by expanding and encrypting left_1 with the least significant octet as 0x03 and XOR the results with right_1.¶
right_2 = right_1 ^ truncate(AES_ECB(key, expand(left_1, 0x03))
¶
Repeat steps 3 and 4, but use them to compute left_2 by expanding and encrypting right_2 with the least significant octet as 0x04 and XOR the results with left_1.¶
left_2 = left_1 ^ truncate(AES_ECB(key, expand(right_2), 0x04))
¶
The following example executes the steps for the provided inputs. Note that the plaintext is of odd octet length, so the middle octet will be split evenly left_0 and right_0.¶
server_id = 0x3144a nonce = 0x9c69c275 key = 0xfdf726a9893ec05c0632d30z6680baf0 // step 1 plaintext_CID = 0x31441a9c69c275 // step 2 left_0 = 0x31441a9 right_0 = 0xc69c275 // step 3 aes_input = 0x31441a90000000000000000000000001 ciphertext = 0xdea73834473e88afee51be7f6bdff0e7 // step 4 right_1 = 0xc69c275 ^ 0xdea7383 = 0x183b1f6 // step 5 aes_input = 0x183b1f60000000000000000000000002 aes_output = 0x15ab4a6f252c0283a0446c74c3f98860 left_1 = 0x31441a9 ^ 0x15ab4a6 = 0x24ef50f // step 6 AES input = 0x24ef50f0000000000000000000000003 AES output = 0xbeaca161e903ebb97cfda599a29ad8ff right_2 = 0x183b1f6 ^ 0xbeaca16 = 0xa697be0 // step 7 AES input: = 0xa697be00000000000000000000000004 AES output = 0x13ea04a5e3c707bf197e8fcbcd43ef98 left_2 = 0x24ef50f ^ 0x13ea04a = 0x3705545 // step 8 cid = first_octet || left_2 || right_2 = 0x073705545a697be0¶
Upon receipt of a QUIC packet, the load balancer extracts as many of the earliest octets from the destination connection ID as necessary to match the server ID. The nonce immediately follows.¶
The load balancer decrypts the nonce and the server ID using the reverse of the algorithm above.¶
First, split the ciphertext CID (excluding the first octet) into its equal- length components left_2 and right_2. Then follow the process below:¶
left_1 = left_2 ^ truncate(AES_ECB(key, expand(right_2), 0x04)) right_1 = right_2 ^ truncate(AES_ECB(key, expand(left_1, 0x03)) left_0 = left_1 ^ truncate(AES_ECB(key, expand(right_1), 0x02))¶
As the load balancer has no need for the nonce, it can conclude after 3 passes as long as the server ID is entirely contained in left_0 (i.e., the nonce is at least as large as the server ID). If the server ID is longer, a fourth pass is necessary:¶
right_0 = right_1 ^ truncate(AES_ECB(key, expand(left_0, 0x01)))
¶
and the load balancer has to concatenate left_0 and right_0 to obtain the complete server ID.¶
The Encrypted Long CID Algorithm, by using a full 16 octets of plaintext and a 128-bit cipher, protects the server ID with a single encryption pass. However, it also requires connection IDs of at least 17 octets, increasing overhead of client-to-server packets.¶
The server ID length MUST be no more than 12 octets. The nonce and server ID MUST sum to at least 16 octets.¶
The configuration agent also selects an 16-octet AES-ECB key to use for connection ID decryption.¶
Upon receipt of a QUIC packet, the load balancer reads the first octet to obtain the config rotation bits. It then decrypts the subsequent 16 octets using AES-ECB decryption and the chosen key.¶
The first octets of the plaintext contains the server id.¶
The server encrypts both its server ID and enough octets in a nonce to form a 16-octet block using the configured AES-ECB key. Note that any remaining octets in the nonce are transmitted as plaintext, and should consider the constraints in Section 11.6.¶
For protocols where 4-tuple load balancing is sufficient, it is straightforward to deliver ICMP packets from the network to the correct server, by reading the echoed IP and transport-layer headers to obtain the 4-tuple. When routing is based on connection ID, further measures are required, as most QUIC packets that trigger ICMP responses will only contain a client-generated connection ID that contains no routing information.¶
To solve this problem, load balancers MAY maintain a mapping of Client IP and port to server ID based on recently observed packets.¶
Alternatively, servers MAY implement the technique described in Section 14.4.1 of [RFC9000] to increase the likelihood a Source Connection ID is included in ICMP responses to Path Maximum Transmission Unit (PMTU) probes. Load balancers MAY parse the echoed packet to extract the Source Connection ID, if it contains a QUIC long header, and extract the Server ID as if it were in a Destination CID.¶
When a server is under load, QUICv1 allows it to defer storage of connection state until the client proves it can receive packets at its advertised IP address. Through the use of a Retry packet, a token in subsequent client Initial packets, and transport parameters, servers verify address ownership and clients verify that there is no on-path attacker generating Retry packets.¶
A "Retry Service" detects potential Denial of Service attacks and handles sending of Retry packets on behalf of the server. As it is, by definition, literally an on-path entity, the service must communicate some of the original connection IDs back to the server so that it can pass client verification. It also must either verify the address itself (with the server trusting this verification) or make sure there is common context for the server to verify the address using a service-generated token.¶
There are two different mechanisms to allow offload of DoS mitigation to a trusted network service. One requires no shared state; the server need only be configured to trust a retry service, though this imposes other operational constraints. The other requires a shared key, but has no such constraints.¶
Regardless of mechanism, a retry service has an active mode, where it is generating Retry packets, and an inactive mode, where it is not, based on its assessment of server load and the likelihood an attack is underway. The choice of mode MAY be made on a per-packet or per-connection basis, through a stochastic process or based on client address.¶
A configuration agent MUST distribute a list of QUIC versions the Retry Service supports. It MAY also distribute either an "Allow-List" or a "Deny-List" of other QUIC versions. It MUST NOT distribute both an Allow-List and a Deny-List.¶
The Allow-List or Deny-List MUST NOT include any versions included for Retry Service Support.¶
The Configuration Agent MUST provide a means for the entity that controls the Retry Service to report its supported version(s) to the configuration Agent. If the entity has not reported this information, it MUST NOT activate the Retry Service and the configuration agent MUST NOT distribute configuration that activates it.¶
The configuration agent MAY delete versions from the final supported version list if policy does not require the Retry Service to operate on those versions.¶
The configuration Agent MUST provide a means for the entities that control servers behind the Retry Service to report either an Allow-List or a Deny-List.¶
If all entities supply Allow-Lists, the consolidated list MUST be the union of these sets. If all entities supply Deny-Lists, the consolidated list MUST be the intersection of these sets.¶
If entities provide a mixture of Allow-Lists and Deny-Lists, the consolidated list MUST be a Deny-List that is the intersection of all provided Deny-Lists and the inverses of all Allow-Lists.¶
If no entities that control servers have reported Allow-Lists or Deny-Lists, the default is a Deny-List with the null set (i.e., all unsupported versions will be admitted). This preserves the future extensibilty of QUIC.¶
A retry service MUST forward all packets for a QUIC version it does not support that are not on a Deny-List or absent from an Allow-List. Note that if servers support versions the retry service does not, this may increase load on the servers.¶
Note that future versions of QUIC might not have Retry packets, require different information in Retry, or use different packet type indicators.¶
Initial Packets are especially effective at consuming server resources because they cause the server to create connection state. Even when mitigating this load with Retry Packets, the act of validating an Initial Token and sending a Retry Packet is more expensive than the response to a non-Initial packet with an unknown Connection ID: simply dropping it and/or sending a Stateless Reset.¶
Nevertheless, a Retry Service in Active Mode might desire to shield servers from non-Initial packets that do not correspond to a previously admitted Initial Packet. This has a number of considerations.¶
Nothing in this section prevents Retry Services from making basic syntax correctness checks on packets with QUIC versions that it understands (e.g., enforcing the Initial Packet datagram size minimum in version 1) and dropping packets that are not routable with the QUIC specification.¶
QUIC-LB requires common configuration to synchronize understanding of encodings and guarantee explicit consent of the server.¶
The load balancer and server MUST agree on a routing algorithm and the relevant parameters for that algorithm.¶
All algorithm configurations can have a server ID length, nonce length, and key. However, for Plaintext CID, there is no key.¶
The load balancer MUST receive the full table of mappings, and each server must receive its assigned SID(s), from the configuration agent.¶
Note that server IDs are opaque bytes, not integers, so there is no notion of network order or host order.¶
A server configuration MUST specify if the first octet encodes the CID length. Note that a load balancer does not need the CID length, as the required bytes are present in the QUIC packet.¶
A full QUIC-LB server configuration MUST also specify the supported QUIC versions of any Retry Service. If a shared-state service, the server also must have the token key.¶
A non-shared-state Retry Service need only be configured with the QUIC versions it supports, and an Allow- or Deny-List. A shared-state Retry Service also needs the token key, and to be aware if a NAT sits between it and the servers.¶
Appendix A provides a YANG Model of the a full QUIC-LB configuration.¶
This section discusses considerations for some deployment scenarios not implied by the specification above.¶
Some network architectures may have multiple tiers of low-state load balancers, where a first tier of devices makes a routing decision to the next tier, and so on, until packets reach the server. Although QUIC-LB is not explicitly designed for this use case, it is possible to support it.¶
If each load balancer is assigned a range of server IDs that is a subset of the range of IDs assigned to devices that are closer to the client, then the first devices to process an incoming packet can extract the server ID and then map it to the correct forwarding address. Note that this solution is extensible to arbitrarily large numbers of load-balancing tiers, as the maximum server ID space is quite large.¶
Some deployments may transparently move a connection from one server to another. The means of transferring connection state between servers is out of scope of this document.¶
To support a handover, a server involved in the transition could issue CIDs that map to the new server via a NEW_CONNECTION_ID frame, and retire CIDs associated with the new server using the "Retire Prior To" field in that frame.¶
Alternately, if the old server is going offline, the load balancer could simply map its server ID to the new server's address.¶
Non-shared-state Retry Services are inherently dependent on the format (and existence) of Retry Packets in each version of QUIC, and so Retry Service configuration explicitly includes the supported QUIC versions.¶
The server ID encodings, and requirements for their handling, are designed to be QUIC version independent (see [RFC8999]). A QUIC-LB load balancer will generally not require changes as servers deploy new versions of QUIC. However, there are several unlikely future design decisions that could impact the operation of QUIC-LB.¶
The maximum Connection ID length could be below the minimum necessary for one or more encoding algorithms.¶
Section 4.1 provides guidance about how load balancers should handle unroutable DCIDs. This guidance, and the implementation of an algorithm to handle these DCIDs, rests on some assumptions:¶
While this document does not update the commitments in [RFC8999], the additional assumptions are minimal and narrowly scoped, and provide a likely set of constants that load balancers can use with minimal risk of version- dependence.¶
If these assumptions are invalid, this specification is likely to lead to loss of packets that contain unroutable DCIDs, and in extreme cases connection failure.¶
Some load balancers might inspect elements of the Server Name Indication (SNI) extension in the TLS Client Hello to make a routing decision. Note that the format and cryptographic protection of this information may change in future versions or extensions of TLS or QUIC, and therefore this functionality is inherently not version-invariant.¶
QUIC-LB is intended to prevent linkability. Attacks would therefore attempt to subvert this purpose.¶
Note that the Plaintext CID algorithm makes no attempt to obscure the server mapping, and therefore does not address these concerns. It exists to allow consistent CID encoding for compatibility across a network infrastructure, which makes QUIC robust to NAT rebinding. Servers that are running the Plaintext CID algorithm SHOULD only use it to generate new CIDs for the Server Initial Packet and SHOULD NOT send CIDs in QUIC NEW_CONNECTION_ID frames, except that it sends one new Connection ID in the event of config rotation Section 3.1. Doing so might falsely suggest to the client that said CIDs were generated in a secure fashion.¶
A linkability attack would find some means of determining that two connection IDs route to the same server. As described above, there is no scheme that strictly prevents linkability for all traffic patterns, and therefore efforts to frustrate any analysis of server ID encoding have diminishing returns.¶
Any attacker might open a connection to the server infrastructure and aggressively simulate migration to obtain a large sample of IDs that map to the same server. It could then apply analytical techniques to try to obtain the server encoding.¶
The Encrypted CID algorithms provide robust protection against any sort of linkage. The Plaintext CID algorithm makes no attempt to protect this encoding.¶
Were this analysis to obtain the server encoding, then on-path observers might apply this analysis to correlating different client IP addresses.¶
Attackers in this privileged position are intrinsically able to map two connection IDs to the same server. The QUIC-LB algorithms do prevent the linkage of two connection IDs to the same individual connection if servers make reasonable selections when generating new IDs for that connection.¶
During the period in which there are multiple deployed configuration IDs (see Section 3.1), there is a slight increase in linkability. The server space is effectively divided into segments with CIDs that have different config rotation bits. Entities that manage servers SHOULD strive to minimize these periods by quickly deploying new configurations across the server pool.¶
A simple deployment of QUIC-LB in a cloud provider might use the same global QUIC-LB configuration across all its load balancers that route to customer servers. An attacker could then simply become a customer, obtain the configuration, and then extract server IDs of other customers' connections at will.¶
To avoid this, the configuration agent SHOULD issue QUIC-LB configurations to mutually distrustful servers that have different keys for encryption algorithms. In many cases, the load balancers can distinguish these configurations by external IP address.¶
However, assigning multiple entities to an IP address is complimentary with concealing DNS requests (e.g., DoH [RFC8484]) and the TLS Server Name Indicator (SNI) ([I-D.ietf-tls-esni]) to obscure the ultimate destination of traffic. While the load balancer's fallback algorithm (Section 4.2) can use the SNI to make a routing decision on the first packet, there are three ways to route subsequent packets:¶
When configuring QUIC-LB, administrators must evaluate the privacy tradeoff considering the relative value of each of these properties, given the trust model between tenants, the presence of methods to obscure the domain name, and value of address migration in the tenant use cases.¶
As the plaintext algorithm makes no attempt to conceal the server mapping, these deployments SHOULD simply use a common configuration.¶
Section 21.9 of [RFC9000] discusses the Stateless Reset Oracle attack. For a server deployment to be vulnerable, an attacking client must be able to cause two packets with the same Destination CID to arrive at two different servers that share the same cryptographic context for Stateless Reset tokens. As QUIC-LB requires deterministic routing of DCIDs over the life of a connection, it is a sufficient means of avoiding an Oracle without additional measures.¶
Note also that when a server starts using a new QUIC-LB config rotation codepoint, new CIDs might not be unique with respect to previous configurations that occupied that codepoint, and therefore different clients may have observed the same CID and stateless reset token. A straightforward method of managing stateless reset keys is to maintain a separate key for each config rotation codepoint, and replace each key when the configuration for that codepoint changes. Thus, a server transitions from one config to another, it will be able to generate correct tokens for connections using either type of CID.¶
If a server ever reuses a nonce in generating a CID for a given configuration, it risks exposing sensitive information. Given the same server ID, the CID will be identical (aside from a possible difference in the first octet). This can risk exposure of the QUIC-LB key. If two clients receive the same connection ID, they also have each other's stateless reset token unless that key has changed in the interim.¶
The Encrypted Short and Encrypted Long algorithms need to generate different cipher text for each generated Connection ID instance to protect the Server ID. To do so, at least four octets of the CID are reserved for a nonce that, if used only once, will result in unique cipher text for each Connection ID.¶
If servers simply increment the nonce by one with each generated connection ID, then it is safe to use the existing keys until any server's nonce counter exhausts the allocated space and rolls over. To maximize entropy, servers SHOULD start with a random nonce value, in which case the configuration is usable until the nonce value wraps around to zero and then reaches the initial value again.¶
Whether or not it implements the counter method, the server MUST NOT reuse a nonce until it switches to a configuration with new keys.¶
Both the Plaintext CID and Encrypted Long CID algorithms send parts of their nonce in plaintext. Servers MUST generate nonces so that the plaintext portion appears to be random. Observable correlations between plaintext nonces would provide trivial linkability between individual connections, rather than just to a common server.¶
For any algorithm, configuration agents SHOULD implement an out-of-band method to discover when servers are in danger of exhausting their nonce space, and SHOULD respond by issuing a new configuration. A server that has exhausted its nonces MUST either switch to a different configuration, or if none exists, use the 4-tuple routing config rotation codepoint.¶
When sizing a nonce that is to be randomly generated, the configuration agent SHOULD consider that a server generating a N-bit nonce will create a duplicate about every 2^(N/2) attempts, and therefore compare the expected rate at which servers will generate CIDs with the lifetime of a configuration.¶
There are no IANA requirements.¶
This YANG model conforms to [RFC6020] and expresses a complete QUIC-LB configuration.¶
module ietf-quic-lb { yang-version "1.1"; namespace "urn:ietf:params:xml:ns:yang:ietf-quic-lb"; prefix "quic-lb"; import ietf-yang-types { prefix yang; reference "RFC 6991: Common YANG Data Types."; } import ietf-inet-types { prefix inet; reference "RFC 6991: Common YANG Data Types."; } organization "IETF QUIC Working Group"; contact "WG Web: <http://datatracker.ietf.org/wg/quic> WG List: <quic@ietf.org> Authors: Martin Duke (martin.h.duke at gmail dot com) Nick Banks (nibanks at microsoft dot com)"; description "This module enables the explicit cooperation of QUIC servers with trusted intermediaries without breaking important protocol features. Copyright (c) 2021 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself for full legal notices. The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document are to be interpreted as described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, they appear in all capitals, as shown here."; revision "2021-01-29" { description "Initial Version"; reference "RFC XXXX, QUIC-LB: Generating Routable QUIC Connection IDs"; } container quic-lb { presence "The container for QUIC-LB configuration."; description "QUIC-LB container."; typedef quic-lb-key { type yang:hex-string { length 47; } description "This is a 16-byte key, represented with 47 bytes"; } typedef algorithm-type { type enumeration { enum plaintext { description "Plaintext CID Algorithm"; } enum encrypted-short { description "Encrypted Short CID Algorithm"; } enum encrypted-long { description "Encrypted Long CID Algorithm"; } } } list cid-configs { key "config-rotation-bits"; description "List up to three load balancer configurations"; leaf config-rotation-bits { type uint8 { range "0..2"; } mandatory true; description "Identifier for this CID configuration."; } leaf first-octet-encodes-cid-length { type boolean; default false; description "If true, the six least significant bits of the first CID octet encode the CID length minus one."; } leaf cid-key { type quic-lb-key; description "Key for encrypting the connection ID. If absent, the configuration uses the Plaintext algorithm."; } leaf algorithm { type algorithm-type; mandatory true; description "The algorithm that encodes the server ID"; } must 'cid-key or (algorithm = "plaintext")' { error-message "Encrypted algorithm requires key"; } leaf nonce-length { type uint8 { range "4..18"; } mandatory true; description "Length, in octets, of the nonce. Short nonces mean there will be frequent configuration updates."; } leaf server-id-length { type uint8 { range "1..15"; } must '. <= (19 - ../nonce-length)' { error-message "Server ID and nonce lengths must sum to no more than 19."; } must '(../algorithm != "encrypted-long") or (. <= 12)' { error-message "encrypted-long requires server ID length <= 12."; } must '(../algorithm != "encrypted-long") or ((. + ../nonce-length) >= 16)' { error-message "For Encrypted Long CIDs, server ID length plus nonce length must be at least 16"; } mandatory true; description "Length (in octets) of a server ID. Further range-limited by sid-allocation, cid-key, and nonce-length."; } list server-id-mappings { key "server-id"; description "Statically allocated Server IDs"; leaf server-id { type yang:hex-string; must "string-length(.) = 3 * ../../server-id-length - 1"; mandatory true; description "An allocated server ID"; } leaf server-address { type inet:ip-address; mandatory true; description "Destination address corresponding to the server ID"; } } } container retry-service-config { description "Configuration of Retry Service. If supported-versions is empty, there is no retry service. If token-keys is empty, it uses the non-shared- state service. If present, it uses shared-state tokens."; leaf-list supported-versions { type uint32; description "QUIC versions that the retry service supports. If empty, there is no retry service."; } leaf unsupported-version-default { type enumeration { enum allow { description "Unsupported versions admitted by default"; } enum deny { description "Unsupported versions denied by default"; } } default allow; description "Are unsupported versions not in version-exceptions allowed or denied?"; } leaf-list version-exceptions { type uint32; description "Exceptions to the default-deny or default-allow rule."; } list token-keys { key "key-sequence-number"; description "list of active keys, for key rotation purposes. Existence implies shared-state format"; leaf key-sequence-number { type uint8 { range "0..127"; } mandatory true; description "Identifies the key used to encrypt the token"; } leaf token-key { type quic-lb-key; mandatory true; description "16-byte key to encrypt the token"; } leaf token-iv { type yang:hex-string { length 23; } mandatory true; description "8-byte IV to encrypt the token, encoded in 23 bytes"; } } } } }¶
This summary of the YANG model uses the notation in [RFC8340].¶
module: ietf-quic-lb +--rw quic-lb +--rw cid-configs* [config-rotation-bits] | +--rw config-rotation-bits uint8 | +--rw first-octet-encodes-cid-length? boolean | +--rw cid-key? quic-lb-key | +--rw algorithm algorithm-tyype | +--rw nonce-length uint8 | +--rw server-id-length uint8 | +--rw server-id-mappings* [server-id] | | +--rw server-id yang:hex-string | | +--rw server-address inet:ip-address +--ro retry-service-config | +--rw supported-versions* uint32 | +--rw unsupported-version-default? enumeration | +--rw version-exceptions* uint32 | +--rw token-keys*? [key-sequence-number] | | +--rw key-sequence-number uint8 | | +--rw token-key quic-lb-key | | +--rw token-iv yang:hex-string¶
Each section of this draft includes multiple sets of load balancer configuration, each of which has five examples of server ID and server use bytes and how they are encoded in a CID.¶
In some cases, there are no server use bytes. Note that, for simplicity, the first octet bits used for neither config rotation nor length self-encoding are random, rather than listed in the server use field. Therefore, a server implementation using these parameters may generate CIDs with a slightly different first octet.¶
This section uses the following abbreviations:¶
cid Connection ID cr_bits Config Rotation Bits LB Load Balancer sid Server ID sid_len Server ID length¶
All values except length_self_encoding and sid_len are expressed in hexidecimal format.¶
In each case below, the server is using a plain text nonce value of zero.¶
TBD¶
In each case below, the server is using a plain text nonce value of zero.¶
TBD¶
Some environments may contain DTLS traffic as well as QUIC operating over UDP, which may be hard to distinguish.¶
In most cases, the packet parsing rules above will cause a QUIC-LB load balancer to route DTLS traffic in an appropriate way. DTLS 1.3 implementations that use the connection_id extension [I-D.ietf-tls-dtls-connection-id] might use the techniques in this document to generate connection IDs and achieve robust routability for DTLS associations if they meet a few additional requirements. This non-normative appendix describes this interaction.¶
DTLS 1.0 [RFC4347] and 1.2 [RFC6347] use packet formats that a QUIC-LB router will interpret as short header packets with CIDs that request 4-tuple routing. As such, they will route such packets consistently as long as the 4-tuple does not change. Note that DTLS 1.0 has been deprecated by the IETF.¶
The first octet of every DTLS 1.0 or 1.2 datagram contains the content type. A QUIC-LB load balancer will interpret any content type less than 128 as a short header packet, meaning that the subsequent octets should contain a connection ID.¶
Existing TLS content types comfortably fit in the range below 128. Assignment of codepoints greater than 64 would require coordination in accordance with [RFC7983], and anyway would likely create problems demultiplexing DTLS and version 1 of QUIC. Therefore, this document believes it is extremely unlikely that TLS content types of 128 or greater will be assigned. Nevertheless, such an assignment would cause a QUIC-LB load balancer to interpret the packet as a QUIC long header with an essentially random connection ID, which is likely to be routed irregularly.¶
The second octet of every DTLS 1.0 or 1.2 datagram is the bitwise complement of the DTLS Major version (i.e. version 1.x = 0xfe). A QUIC-LB load balancer will interpret this as a connection ID that requires 4-tuple based load balancing, meaning that the routing will be consistent as long as the 4-tuple remains the same.¶
[I-D.ietf-tls-dtls-connection-id] defines an extension to add connection IDs to DTLS 1.2. Unfortunately, a QUIC-LB load balancer will not correctly parse the connection ID and will continue 4-tuple routing. An modified QUIC-LB load balancer that correctly identifies DTLS and parses a DTLS 1.2 datagram for the connection ID is outside the scope of this document.¶
DTLS 1.3 [I-D.draft-ietf-tls-dtls13] changes the structure of datagram headers in relevant ways.¶
Handshake packets continue to have a TLS content type in the first octet and 0xfe in the second octet, so they will be 4-tuple routed, which should not present problems for likely NAT rebinding or address change events.¶
Non-handshake packets always have zero in their most significant bit and will therefore always be treated as QUIC short headers. If the connection ID is present, it follows in the succeeding octets. Therefore, a DTLS 1.3 association where the server utilizes Connection IDs and the encodings in this document will be routed correctly in the presence of client address and port changes.¶
However, if the client does not include the connection_id extension in its ClientHello, the server is unable to use connection IDs. In this case, non- handshake packets will appear to contain random connection IDs and be routed randomly. Thus, unmodified QUIC-LB load balancers will not work with DTLS 1.3 if the client does not advertise support for connection IDs, or the server does not request the use of a compliant connection ID.¶
A QUIC-LB load balancer might be modified to identify DTLS 1.3 packets and correctly parse the fields to identify when there is no connection ID and revert to 4-tuple routing, removing the server requirement above. However, such a modification is outside the scope of this document, and classifying some packets as DTLS might be incompatible with future versions of QUIC.¶
As DTLS does not have an IETF consensus document that defines what parts of DTLS will be invariant in future versions, it is difficult to speculate about the applicability of this section to future versions of DTLS.¶
Manasi Deval, Erik Fuller, Toma Gavrichenkov, Jana Iyengar, Subodh Iyengar, Ladislav Lhotka, Jan Lindblad, Ling Tao Nju, Ilari Liusvaara, Kazuho Oku, Udip Pant, Ian Swett, Martin Thomson, Dmitri Tikhonov, Victor Vasiliev, and William Zeng Ke all provided useful input to this document.¶
RFC Editor's Note: Please remove this section prior to publication of a final version of this document.¶