idnits 2.17.1 draft-ietf-quic-load-balancers-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 39 instances of too long lines in the document, the longest one being 7 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- The document date (4 February 2021) is 1169 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 QUIC M. Duke 3 Internet-Draft F5 Networks, Inc. 4 Intended status: Standards Track N. Banks 5 Expires: 8 August 2021 Microsoft 6 4 February 2021 8 QUIC-LB: Generating Routable QUIC Connection IDs 9 draft-ietf-quic-load-balancers-06 11 Abstract 13 The QUIC protocol design is resistant to transparent packet 14 inspection, injection, and modification by intermediaries. However, 15 the server can explicitly cooperate with network services by agreeing 16 to certain conventions and/or sharing state with those services. 17 This specification provides a standardized means of solving three 18 problems: (1) maintaining routability to servers via a low-state load 19 balancer even when the connection IDs in use change; (2) explicit 20 encoding of the connection ID length in all packets to assist 21 hardware accelerators; and (3) injection of QUIC Retry packets by an 22 anti-Denial-of-Service agent on behalf of the server. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on 8 August 2021. 41 Copyright Notice 43 Copyright (c) 2021 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 48 license-info) in effect on the date of publication of this document. 49 Please review these documents carefully, as they describe your rights 50 and restrictions with respect to this document. Code Components 51 extracted from this document must include Simplified BSD License text 52 as described in Section 4.e of the Trust Legal Provisions and are 53 provided without warranty as described in the Simplified BSD License. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 58 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 59 1.2. Notation . . . . . . . . . . . . . . . . . . . . . . . . 5 60 2. Protocol Objectives . . . . . . . . . . . . . . . . . . . . . 6 61 2.1. Simplicity . . . . . . . . . . . . . . . . . . . . . . . 6 62 2.2. Security . . . . . . . . . . . . . . . . . . . . . . . . 6 63 3. First CID octet . . . . . . . . . . . . . . . . . . . . . . . 7 64 3.1. Config Rotation . . . . . . . . . . . . . . . . . . . . . 7 65 3.2. Configuration Failover . . . . . . . . . . . . . . . . . 8 66 3.3. Length Self-Description . . . . . . . . . . . . . . . . . 8 67 3.4. Format . . . . . . . . . . . . . . . . . . . . . . . . . 8 68 4. Load Balancing Preliminaries . . . . . . . . . . . . . . . . 9 69 4.1. Non-Compliant Connection IDs . . . . . . . . . . . . . . 9 70 4.2. Arbitrary Algorithms . . . . . . . . . . . . . . . . . . 10 71 4.3. Server ID Allocation . . . . . . . . . . . . . . . . . . 11 72 4.3.1. Static Allocation . . . . . . . . . . . . . . . . . . 11 73 4.3.2. Dynamic Allocation . . . . . . . . . . . . . . . . . 12 74 5. Routing Algorithms . . . . . . . . . . . . . . . . . . . . . 14 75 5.1. Plaintext CID Algorithm . . . . . . . . . . . . . . . . . 14 76 5.1.1. Configuration Agent Actions . . . . . . . . . . . . . 14 77 5.1.2. Load Balancer Actions . . . . . . . . . . . . . . . . 14 78 5.1.3. Server Actions . . . . . . . . . . . . . . . . . . . 14 79 5.2. Stream Cipher CID Algorithm . . . . . . . . . . . . . . . 15 80 5.2.1. Configuration Agent Actions . . . . . . . . . . . . . 15 81 5.2.2. Load Balancer Actions . . . . . . . . . . . . . . . . 15 82 5.2.3. Server Actions . . . . . . . . . . . . . . . . . . . 17 83 5.3. Block Cipher CID Algorithm . . . . . . . . . . . . . . . 17 84 5.3.1. Configuration Agent Actions . . . . . . . . . . . . . 17 85 5.3.2. Load Balancer Actions . . . . . . . . . . . . . . . . 17 86 5.3.3. Server Actions . . . . . . . . . . . . . . . . . . . 18 87 6. ICMP Processing . . . . . . . . . . . . . . . . . . . . . . . 18 88 7. Retry Service . . . . . . . . . . . . . . . . . . . . . . . . 18 89 7.1. Common Requirements . . . . . . . . . . . . . . . . . . . 19 90 7.2. No-Shared-State Retry Service . . . . . . . . . . . . . . 20 91 7.2.1. Configuration Agent Actions . . . . . . . . . . . . . 20 92 7.2.2. Service Requirements . . . . . . . . . . . . . . . . 20 93 7.2.3. Server Requirements . . . . . . . . . . . . . . . . . 22 94 7.3. Shared-State Retry Service . . . . . . . . . . . . . . . 22 95 7.3.1. Token Protection with AEAD . . . . . . . . . . . . . 24 96 7.3.2. Configuration Agent Actions . . . . . . . . . . . . . 25 97 7.3.3. Service Requirements . . . . . . . . . . . . . . . . 25 98 7.3.4. Server Requirements . . . . . . . . . . . . . . . . . 26 99 8. Configuration Requirements . . . . . . . . . . . . . . . . . 27 100 9. Additional Use Cases . . . . . . . . . . . . . . . . . . . . 28 101 9.1. Load balancer chains . . . . . . . . . . . . . . . . . . 28 102 9.2. Moving connections between servers . . . . . . . . . . . 28 103 10. Version Invariance of QUIC-LB . . . . . . . . . . . . . . . . 28 104 11. Security Considerations . . . . . . . . . . . . . . . . . . . 30 105 11.1. Attackers not between the load balancer and server . . . 30 106 11.2. Attackers between the load balancer and server . . . . . 30 107 11.3. Multiple Configuration IDs . . . . . . . . . . . . . . . 31 108 11.4. Limited configuration scope . . . . . . . . . . . . . . 31 109 11.5. Stateless Reset Oracle . . . . . . . . . . . . . . . . . 31 110 11.6. Connection ID Entropy . . . . . . . . . . . . . . . . . 31 111 11.7. Shared-State Retry Keys . . . . . . . . . . . . . . . . 32 112 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 33 113 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 114 13.1. Normative References . . . . . . . . . . . . . . . . . . 33 115 13.2. Informative References . . . . . . . . . . . . . . . . . 33 116 Appendix A. QUIC-LB YANG Model . . . . . . . . . . . . . . . . . 34 117 A.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 39 118 Appendix B. Load Balancer Test Vectors . . . . . . . . . . . . . 39 119 B.1. Plaintext Connection ID Algorithm . . . . . . . . . . . . 40 120 B.2. Stream Cipher Connection ID Algorithm . . . . . . . . . . 41 121 B.3. Block Cipher Connection ID Algorithm . . . . . . . . . . 42 122 Appendix C. Acknowledgments . . . . . . . . . . . . . . . . . . 44 123 Appendix D. Change Log . . . . . . . . . . . . . . . . . . . . . 44 124 D.1. since draft-ietf-quic-load-balancers-05 . . . . . . . . . 44 125 D.2. since draft-ietf-quic-load-balancers-04 . . . . . . . . . 44 126 D.3. since-draft-ietf-quic-load-balancers-03 . . . . . . . . . 44 127 D.4. since-draft-ietf-quic-load-balancers-02 . . . . . . . . . 45 128 D.5. since-draft-ietf-quic-load-balancers-01 . . . . . . . . . 45 129 D.6. since-draft-ietf-quic-load-balancers-00 . . . . . . . . . 45 130 D.7. Since draft-duke-quic-load-balancers-06 . . . . . . . . . 45 131 D.8. Since draft-duke-quic-load-balancers-05 . . . . . . . . . 45 132 D.9. Since draft-duke-quic-load-balancers-04 . . . . . . . . . 46 133 D.10. Since draft-duke-quic-load-balancers-03 . . . . . . . . . 46 134 D.11. Since draft-duke-quic-load-balancers-02 . . . . . . . . . 46 135 D.12. Since draft-duke-quic-load-balancers-01 . . . . . . . . . 46 136 D.13. Since draft-duke-quic-load-balancers-00 . . . . . . . . . 46 137 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 46 139 1. Introduction 141 QUIC packets [QUIC-TRANSPORT] usually contain a connection ID to 142 allow endpoints to associate packets with different address/ port 143 4-tuples to the same connection context. This feature makes 144 connections robust in the event of NAT rebinding. QUIC endpoints 145 usually designate the connection ID which peers use to address 146 packets. Server-generated connection IDs create a potential need for 147 out-of-band communication to support QUIC. 149 QUIC allows servers (or load balancers) to designate an initial 150 connection ID to encode useful routing information for load 151 balancers. It also encourages servers, in packets protected by 152 cryptography, to provide additional connection IDs to the client. 153 This allows clients that know they are going to change IP address or 154 port to use a separate connection ID on the new path, thus reducing 155 linkability as clients move through the world. 157 There is a tension between the requirements to provide routing 158 information and mitigate linkability. Ultimately, because new 159 connection IDs are in protected packets, they must be generated at 160 the server if the load balancer does not have access to the 161 connection keys. However, it is the load balancer that has the 162 context necessary to generate a connection ID that encodes useful 163 routing information. In the absence of any shared state between load 164 balancer and server, the load balancer must maintain a relatively 165 expensive table of server-generated connection IDs, and will not 166 route packets correctly if they use a connection ID that was 167 originally communicated in a protected NEW_CONNECTION_ID frame. 169 This specification provides common algorithms for encoding the server 170 mapping in a connection ID given some shared parameters. The mapping 171 is generally only discoverable by observers that have the parameters, 172 preserving unlinkability as much as possible. 174 Aside from load balancing, a QUIC server may also desire to offload 175 other protocol functions to trusted intermediaries. These 176 intermediaries might include hardware assist on the server host 177 itself, without access to fully decrypted QUIC packets. For example, 178 this document specifies a means of offloading stateless retry to 179 counter Denial of Service attacks. It also proposes a system for 180 self-encoding connection ID length in all packets, so that crypto 181 offload can consistently look up key information. 183 While this document describes a small set of configuration parameters 184 to make the server mapping intelligible, the means of distributing 185 these parameters between load balancers, servers, and other trusted 186 intermediaries is out of its scope. There are numerous well-known 187 infrastructures for distribution of configuration. 189 1.1. Terminology 191 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 192 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 193 document are to be interpreted as described in RFC 2119 [RFC2119]. 195 In this document, these words will appear with that interpretation 196 only when in ALL CAPS. Lower case uses of these words are not to be 197 interpreted as carrying significance described in RFC 2119. 199 In this document, "client" and "server" refer to the endpoints of a 200 QUIC connection unless otherwise indicated. A "load balancer" is an 201 intermediary for that connection that does not possess QUIC 202 connection keys, but it may rewrite IP addresses or conduct other IP 203 or UDP processing. A "configuration agent" is the entity that 204 determines the QUIC-LB configuration parameters for the network and 205 leverages some system to distribute that configuration. 207 Note that stateful load balancers that act as proxies, by terminating 208 a QUIC connection with the client and then retrieving data from the 209 server using QUIC or another protocol, are treated as a server with 210 respect to this specification. 212 For brevity, "Connection ID" will often be abbreviated as "CID". 214 1.2. Notation 216 All wire formats will be depicted using the notation defined in 217 Section 1.3 of [QUIC-TRANSPORT]. There is one addition: the function 218 len() refers to the length of a field which can serve as a limit on a 219 different field, so that the lengths of two fields can be concisely 220 defined as limited to a sum, for example: 222 x(A..B) y(C..B-len(x)) 224 indicates that x can be of any length between A and B, and y can be 225 of any length between C and B provided that (len(x) + len(y)) does 226 not exceed B. 228 The example below illustrates the basic framework: 230 Example Structure { 231 One-bit Field (1), 232 7-bit Field with Fixed Value (7) = 61, 233 Field with Variable-Length Integer (i), 234 Arbitrary-Length Field (..), 235 Variable-Length Field (8..24), 236 Variable-Length Field with Dynamic Limit (8..24-len(Variable-Length Field)), 237 Field With Minimum Length (16..), 238 Field With Maximum Length (..128), 239 [Optional Field (64)], 240 Repeated Field (8) ..., 241 } 243 Figure 1: Example Format 245 2. Protocol Objectives 247 2.1. Simplicity 249 QUIC is intended to provide unlinkability across connection 250 migration, but servers are not required to provide additional 251 connection IDs that effectively prevent linkability. If the 252 coordination scheme is too difficult to implement, servers behind 253 load balancers using connection IDs for routing will use trivially 254 linkable connection IDs. Clients will therefore be forced to choose 255 between terminating the connection during migration or remaining 256 linkable, subverting a design objective of QUIC. 258 The solution should be both simple to implement and require little 259 additional infrastructure for cryptographic keys, etc. 261 2.2. Security 263 In the limit where there are very few connections to a pool of 264 servers, no scheme can prevent the linking of two connection IDs with 265 high probability. In the opposite limit, where all servers have many 266 connections that start and end frequently, it will be difficult to 267 associate two connection IDs even if they are known to map to the 268 same server. 270 QUIC-LB is relevant in the region between these extremes: when the 271 information that two connection IDs map to the same server is helpful 272 to linking two connection IDs. Obviously, any scheme that 273 transparently communicates this mapping to outside observers 274 compromises QUIC's defenses against linkability. 276 Though not an explicit goal of the QUIC-LB design, concealing the 277 server mapping also complicates attempts to focus attacks on a 278 specific server in the pool. 280 3. First CID octet 282 The first octet of a Connection ID is reserved for two special 283 purposes, one mandatory (config rotation) and one optional (length 284 self-description). 286 Subsequent sections of this document refer to the contents of this 287 octet as the "first octet." 289 3.1. Config Rotation 291 The first two bits of any connection ID MUST encode an identifier for 292 the configuration that the connection ID uses. This enables 293 incremental deployment of new QUIC-LB settings (e.g., keys). 295 When new configuration is distributed to servers, there will be a 296 transition period when connection IDs reflecting old and new 297 configuration coexist in the network. The rotation bits allow load 298 balancers to apply the correct routing algorithm and parameters to 299 incoming packets. 301 Configuration Agents SHOULD deliver new configurations to load 302 balancers before doing so to servers, so that load balancers are 303 ready to process CIDs using the new parameters when they arrive. 305 A Configuration Agent SHOULD NOT use a codepoint to represent a new 306 configuration until it takes precautions to make sure that all 307 connections using CIDs with an old configuration at that codepoint 308 have closed or transitioned. 310 Servers MUST NOT generate new connection IDs using an old 311 configuration after receiving a new one from the configuration agent. 312 Servers MUST send NEW_CONNECTION_ID frames that provide CIDs using 313 the new configuration, and retire CIDs using the old configuration 314 using the "Retire Prior To" field of that frame. 316 It also possible to use these bits for more long-lived distinction of 317 different configurations, but this has privacy implications (see 318 Section 11.3). 320 3.2. Configuration Failover 322 If a server has not received a valid QUIC-LB configuration, and 323 believes that low-state, Connection-ID aware load balancers are in 324 the path, it SHOULD generate connection IDs with the config rotation 325 bits set to '11' and SHOULD use the "disable_active_migration" 326 transport parameter in all new QUIC connections. It SHOULD NOT send 327 NEW_CONNECTION_ID frames with new values. 329 A load balancer that sees a connection ID with config rotation bits 330 set to '11' MUST revert to 5-tuple routing. 332 3.3. Length Self-Description 334 Local hardware cryptographic offload devices may accelerate QUIC 335 servers by receiving keys from the QUIC implementation indexed to the 336 connection ID. However, on physical devices operating multiple QUIC 337 servers, it is impractical to efficiently lookup these keys if the 338 connection ID does not self-encode its own length. 340 Note that this is a function of particular server devices and is 341 irrelevant to load balancers. As such, load balancers MAY omit this 342 from their configuration. However, the remaining 6 bits in the first 343 octet of the Connection ID are reserved to express the length of the 344 following connection ID, not including the first octet. 346 A server not using this functionality SHOULD make the six bits appear 347 to be random. 349 3.4. Format 351 First Octet { 352 Config Rotation (2), 353 CID Len or Random Bits (6), 354 } 356 Figure 2: First Octet Format 358 The first octet has the following fields: 360 Config Rotation: Indicates the configuration used to interpret the 361 CID. 363 CID Len or Random Bits: Length Self-Description (if applicable), or 364 random bits otherwise. Encodes the length of the Connection ID 365 following the First Octet. 367 4. Load Balancing Preliminaries 369 In QUIC-LB, load balancers do not generate individual connection IDs 370 for servers. Instead, they communicate the parameters of an 371 algorithm to generate routable connection IDs. 373 The algorithms differ in the complexity of configuration at both load 374 balancer and server. Increasing complexity improves obfuscation of 375 the server mapping. 377 This section describes three participants: the configuration agent, 378 the load balancer, and the server. For any given QUIC-LB 379 configuration that enables connection-ID-aware load balancing, there 380 must be a choice of (1) routing algorithm, (2) server ID allocation 381 strategy, and (3) algorithm parameters. 383 Fundamentally, servers generate connection IDs that encode their 384 server ID. Load balancers decode the server ID from the CID in 385 incoming packets to route to the correct server. 387 There are situations where a server pool might be operating two or 388 more routing algorithms or parameter sets simultaneously. The load 389 balancer uses the first two bits of the connection ID to multiplex 390 incoming DCIDs over these schemes (see Section 3.1). 392 4.1. Non-Compliant Connection IDs 394 QUIC-LB servers will generate Connection IDs that are decodable to 395 extract a server ID in accordance with a specified algorithm and 396 parameters. However, QUIC often uses client-generated Connection IDs 397 prior to receiving a packet from the server. 399 These client-generated CIDs might not conform to the expectations of 400 the routing algorithm and therefore not be routable by the load 401 balancer. These are called "non-compliant DCIDs": 403 * The config rotation bits (Section 3.1) may not correspond to an 404 active configuration. Note: a packet with a DCID that indicates 405 5-tuple routing (see Section 3.2) is always compliant. 407 * The DCID might not be long enough for the decoder to process. 409 * The extracted server mapping might not correspond to an active 410 server. 412 All other DCIDs are compliant. 414 Load balancers MUST forward packets with compliant DCIDs to a server 415 in accordance with the chosen routing algorithm. 417 Load balancers SHOULD drop packets with non-compliant DCIDs in a 418 short header. 420 The routing of long headers with non-compliant DCIDs depends on the 421 server ID allocation strategy, described in Section 4.3. However, 422 the load balancer MUST NOT drop these packets, with one exception. 424 Load balancers MAY drop packets with long headers and non-compliant 425 DCIDs if and only if it knows that the encoded QUIC version does not 426 allow a non- compliant DCID in a packet with that signature. For 427 example, a load balancer can safely drop a QUIC version 1 Handshake 428 packet with a non-compliant DCID, as a version 1 Handshake packet 429 sent to a QUIC-LB compliant server will always have a server- 430 generated compliant CID. The prohibition against dropping packets 431 with long headers remains for unknown QUIC versions. 433 Furthermore, while the load balancer function MUST NOT drop packets, 434 the device might implement other security policies, outside the scope 435 of this specification, that might force a drop. 437 Servers that receive packets with noncompliant CIDs MUST use the 438 available mechanisms to induce the client to use a compliant CID in 439 future packets. In QUIC version 1, this requires using a compliant 440 CID in the Source CID field of server-generated long headers. 442 4.2. Arbitrary Algorithms 444 There are conditions described below where a load balancer routes a 445 packet using an "arbitrary algorithm." It can choose any algorithm, 446 without coordination with the servers, but the algorithm SHOULD be 447 deterministic over short time scales so that related packets go to 448 the same server. The design of this algorithm SHOULD consider the 449 version-invariant properties of QUIC described in [QUIC-INVARIANTS] 450 to maximize its robustness to future versions of QUIC. 452 An arbitrary algorithmr MUST NOT make the routing behavior dependent 453 on any bits in the first octet of the QUIC packet header, except the 454 first bit, which indicates a long header. All other bits are QUIC 455 version-dependent and intermediaries should not base their design on 456 version-specific templates. 458 For example, one arbitrary algorithm might convert a non-compliant 459 DCID to an integer and divided by the number of servers, with the 460 modulus used to forward the packet. The number of servers is usually 461 consistent on the time scale of a QUIC connection handshake. Another 462 might simply hash the address/port 4-tuple. See also Section 10. 464 4.3. Server ID Allocation 466 For any given configuration, the configuration agent must specify if 467 server IDs will be statically or dynamically allocated. Load 468 Balancer configurations with statically allocated server IDs 469 explicitly include a mapping of server IDs to forwarding addresses. 470 The corresponding server configurations contain one or more unique 471 server IDs. 473 A dynamically allocated configuration does not include any bespoke 474 assignment, reducing configuration complexity. However, it places 475 limits on the maximum server ID length and requires more state at the 476 load balancer. In certain edge cases, it can force parts of the 477 system to fail over to 5-tuple routing for a short time. 479 In either case, the configuration agent chooses a server ID length 480 for each configuration that MUST be at least one octet. For Static 481 Allocation, the maximum length depends on the algorithm. For dynamic 482 allocation, the maximum length is 7 octets. 484 A QUIC-LB configuration MAY significantly over-provision the server 485 ID space (i.e., provide far more codepoints than there are servers) 486 to increase the probability that a randomly generated Destination 487 Connection ID is non- compliant. 489 Conceptually, each configuration has its own set of server ID 490 allocations, though two static configurations with identical server 491 ID lengths MAY use a common allocation between them. 493 A server encodes one of its assigned server IDs in any CID it 494 generates using the relevant configuration. 496 4.3.1. Static Allocation 498 In the manual allocation method, the configuration agent assigns at 499 least one server ID to each server. 501 When forwarding a packet with a long header and non-compliant DCID, 502 load balancers MUST forward packets with long headers and non- 503 compliant DCIDs using an arbitrary algorithm as specified in 504 Section 4.2. 506 4.3.2. Dynamic Allocation 508 In the dynamic allocation method, the load balancer assigns server 509 IDs dynamically so that configuration does not require bespoke server 510 ID assignment. This also reduces linkability. However, it requires 511 state at the load balancer that roughly scales with the number of 512 connections, until the server ID codespace is exhausted. 514 4.3.2.1. Configuration Agent Actions 516 The configuration agent does not assign server IDs, but does 517 configure a server ID length and an "LB timeout". The server ID MUST 518 be at least one and no more than seven octets. 520 4.3.2.2. Load Balancer Actions 522 The load balancer maintains a table of all assigned server IDs and 523 corresponding routing information, which is initialized empty. These 524 tables are independent for each operating configuration. 526 The load balancer MUST keep track of the most recent observation of 527 each server ID, in any sort of packet it forwards, in the table and 528 delete the entries when the time since that observation exceeds the 529 LB Timeout. 531 Note that when the load balancer's table for a configuration is 532 empty, all incoming DCIDs corresponding to that configuration are 533 non-compliant by definition. 535 The handling of a non-compliant long-header packet depends on the 536 reason for non-compliance. The load balancer MUST applyt this logic: 538 * If the config rotation bits do not match a known configuration, 539 the load balancer routes the packet using an arbitrary algorithm 540 (see Section 4.2). 542 * If there is a matching configuration, but the CID is not long 543 enough to apply the algorithm, the load balancer skips the first 544 octet of the CID and then reads a server ID from the following 545 octets, up to the server ID length. If this server ID matches a 546 known server ID for that configuration, it forwards the packet 547 accordingly and takes no further action. If it does not match, it 548 routes using an arbitrary algorithm and adds the new server ID to 549 that server's table entry. 551 * If the sole reason for non-compliance is that the server ID is not 552 in the load balancer's table, the load balancer routes the packet 553 with an arbitrary algorithm. It adds the decoded server ID to 554 table entry for the server the algorithm chooses and forwards the 555 packet accordingly. 557 4.3.2.3. Server actions 559 Each server maintains a list of server IDs assigned to it, 560 initialized empty. For each SID, it records the last time it 561 received any packet with an CID that encoded that SID. 563 Upon receipt of a packet with a client-generated DCID, the server 564 MUST follow these steps in order: 566 * If the config rotation bits do not correspond to a known 567 configuration, do not attempt to extract a server ID. 569 * If the DCID is not long enough to decode using the configured 570 algorithm, extract a number of octets equal to the server ID 571 length, beginning with the second octet. If the extracted value 572 does not match a server ID in the server's list, add it to the 573 list. 575 * If the DCID is long enough to decode but the server ID is not in 576 the server's list, add it to the list. 578 After any possible SID is extracted, the server processes the packet 579 normally. 581 When a server needs a new connection ID, it uses one of the server 582 IDs in its list to populate the server ID field of that CID. It 583 SHOULD vary this selection to reduce linkability within a connection. 585 After loading a new configuration or long periods of idleness, a 586 server may not have any available SIDs. This is because an incoming 587 packet may not the config rotation bits necessary to extract a server 588 ID in accordance with the algorithm above. When required to generate 589 a CID under these conditions, the server MUST generate CIDs using the 590 5-tuple routing codepoint (see Section 3.2. Note that these 591 connections will not be robust to client address changes while they 592 use this connection ID. For this reason, a server SHOULD retire 593 these connection IDs and replace them with routable ones once it 594 receives a client-generated CID that allows it to acquire a server 595 ID. As, statistically, one in every four such CIDs can provide a 596 server ID, this is typically a short interval. 598 If a server has not received a connection ID encoding a particular 599 server ID within the LB timeout, it MUST retire any outstanding CIDs 600 that use that server ID and cease generating any new ones. 602 A server SHOULD have a mechanism to stop using some server IDs if the 603 list gets large relative to its share of the codepoint space, so that 604 these allocations time out and are freed for reuse by servers that 605 have recently joined the pool. 607 5. Routing Algorithms 609 Encryption in the algorithms below uses the AES-128-ECB cipher. 610 Future standards could add new algorithms that use other ciphers to 611 provide cryptographic agility in accordance with [RFC7696]. QUIC-LB 612 implementations SHOULD be extensible to support new algorithms. 614 5.1. Plaintext CID Algorithm 616 The Plaintext CID Algorithm makes no attempt to obscure the mapping 617 of connections to servers, significantly increasing linkability. The 618 format is depicted in the figure below. 620 Plaintext CID { 621 First Octet (8), 622 Server ID (8..128), 623 For Server Use (8..152-len(Server ID)), 624 } 626 Figure 3: Plaintext CID Format 628 5.1.1. Configuration Agent Actions 630 For static SID allocation, the server ID length is limited to 16 631 octets. There are no parameters specific to this algorithm. 633 5.1.2. Load Balancer Actions 635 On each incoming packet, the load balancer extracts consecutive 636 octets, beginning with the second octet. These bytes represent the 637 server ID. 639 5.1.3. Server Actions 641 The server chooses how many octets to reserve for its own use, which 642 MUST be at least one octet. 644 When a server needs a new connection ID, it encodes one of its 645 assigned server IDs in consecutive octets beginning with the second. 646 All other bits in the connection ID, except for the first octet, MAY 647 be set to any other value. These other bits SHOULD appear random to 648 observers. 650 5.2. Stream Cipher CID Algorithm 652 The Stream Cipher CID algorithm provides cryptographic protection at 653 the cost of additional per-packet processing at the load balancer to 654 decrypt every incoming connection ID. The CID format is depicted 655 below. 657 Stream Cipher CID { 658 First Octet (8), 659 Nonce (64..120), 660 Encrypted Server ID (8..128-len(Nonce)), 661 For Server Use (0..152-len(Nonce)-len(Encrypted Server ID)), 662 } 664 Figure 4: Stream Cipher CID Format 666 5.2.1. Configuration Agent Actions 668 The configuration agent assigns a server ID to every server in its 669 pool, and determines a server ID length (in octets) sufficiently 670 large to encode all server IDs, including potential future servers. 672 The configuration agent also selects a nonce length and an 16-octet 673 AES-ECB key to use for connection ID decryption. The nonce length 674 MUST be at least 8 octets and no more than 16 octets. The nonce 675 length and server ID length MUST sum to 19 or fewer octets, but 676 SHOULD sum to 15 or fewer to allow space for server use. 678 5.2.2. Load Balancer Actions 680 Upon receipt of a QUIC packet, the load balancer extracts as many of 681 the earliest octets from the destination connection ID as necessary 682 to match the nonce length. The server ID immediately follows. 684 The load balancer decrypts the nonce and the server ID using the 685 following three pass algorithm: 687 * Pass 1: The load balancer decrypts the server ID using 128-bit AES 688 Electronic Codebook (ECB) mode, much like QUIC header protection. 689 The encrypted nonce octets are zero-padded to 16 octets. AES-ECB 690 encrypts this encrypted nonce using its key to generate a mask 691 which it applies to the encrypted server id. This provides an 692 intermediate value of the server ID, referred to as server-id 693 intermediate. 695 server_id_intermediate = encrypted_server_id ^ AES-ECB(key, padded- 696 encrypted-nonce) 698 * Pass 2: The load balancer decrypts the nonce octets using 128-bit 699 AES ECB mode, using the server-id intermediate as "nonce" for this 700 pass. The server-id intermediate octets are zero-padded to 16 701 octets. AES-ECB encrypts this padded server-id intermediate using 702 its key to generate a mask which it applies to the encrypted 703 nonce. This provides the decrypted nonce value. 705 nonce = encrypted_nonce ^ AES-ECB(key, padded-server_id_intermediate) 707 * Pass 3: The load balancer decrypts the server ID using 128-bit AES 708 ECB mode. The nonce octets are zero-padded to 16 octets. AES-ECB 709 encrypts this nonce using its key to generate a mask which it 710 applies to the intermediate server id. This provides the 711 decrypted server ID. 713 server_id = server_id_intermediate ^ AES-ECB(key, padded-nonce) 715 For example, if the nonce length is 10 octets and the server ID 716 length is 2 octets, the connection ID can be as small as 13 octets. 717 The load balancer uses the the second through eleventh octets of the 718 connection ID for the nonce, zero-pads it to 16 octets, uses xors the 719 result with the twelfth and thirteenth octet. The result is padded 720 with 14 octets of zeros and encrypted to obtain a mask that is xored 721 with the nonce octets. Finally, the nonce octets are padded with six 722 octets of zeros, encrypted, and the first two octets xored with the 723 server ID octets to obtain the actual server ID. 725 This three-pass algorithm is a simplified version of the FFX 726 algorithm, with the property that each encrypted nonce value depends 727 on all server ID bits, and each encrypted server ID bit depends on 728 all nonce bits and all server ID bits. This mitigates attacks 729 against stream ciphers in which attackers simply flip encrypted 730 server-ID bits. 732 The output of the decryption is the server ID that the load balancer 733 uses for routing. 735 5.2.3. Server Actions 737 When generating a routable connection ID, the server writes arbitrary 738 bits into its nonce octets, and its provided server ID into the 739 server ID octets. Servers MAY opt to have a longer connection ID 740 beyond the nonce and server ID. The additional bits MAY encode 741 additional information, but SHOULD appear essentially random to 742 observers. 744 If the decrypted nonce bits increase monotonically, that guarantees 745 that nonces are not reused between connection IDs from the same 746 server. 748 The server encrypts the server ID using exactly the algorithm as 749 described in Section 5.2.2, performing the three passes in reverse 750 order. 752 5.3. Block Cipher CID Algorithm 754 The Block Cipher CID Algorithm, by using a full 16 octets of 755 plaintext and a 128-bit cipher, provides higher cryptographic 756 protection and detection of non-compliant connection IDs. However, 757 it also requires connection IDs of at least 17 octets, increasing 758 overhead of client-to-server packets. 760 Block Cipher CID { 761 First Octet (8), 762 Encrypted Server ID (8..128), 763 Encrypted Bits for Server Use (128-len(Encrypted Server ID)), 764 Unencrypted Bits for Server Use (0..24), 765 } 767 Figure 5: Block Cipher CID Format 769 5.3.1. Configuration Agent Actions 771 If server IDs are statically allocated, the server ID length MUST be 772 no more than 12 octets, to provide servers adequate entropy to 773 generate unique CIDs. 775 The configuration agent also selects an 16-octet AES-ECB key to use 776 for connection ID decryption. 778 5.3.2. Load Balancer Actions 780 Upon receipt of a QUIC packet, the load balancer reads the first 781 octet to obtain the config rotation bits. It then decrypts the 782 subsequent 16 octets using AES-ECB decryption and the chosen key. 784 The decrypted plaintext contains the server id and opaque server data 785 in that order. The load balancer uses the server ID octets for 786 routing. 788 5.3.3. Server Actions 790 When generating a routable connection ID, the server MUST choose a 791 connection ID length between 17 and 20 octets. The server writes its 792 server ID into the server ID octets and arbitrary bits into the 793 remaining bits. These arbitrary bits MAY encode additional 794 information, and MUST differ between connection IDs. Bits in the 795 eighteenth, nineteenth, and twentieth octets SHOULD appear 796 essentially random to observers. The first octet is reserved as 797 described in Section 3. 799 The server then encrypts the second through seventeenth octets using 800 the 128-bit AES-ECB cipher. 802 6. ICMP Processing 804 For protocols where 4-tuple load balancing is sufficient, it is 805 straightforward to deliver ICMP packets from the network to the 806 correct server, by reading the echoed IP and transport-layer headers 807 to obtain the 4-tuple. When routing is based on connection ID, 808 further measures are required, as most QUIC packets that trigger ICMP 809 responses will only contain a client-generated connection ID that 810 contains no routing information. 812 To solve this problem, load balancers MAY maintain a mapping of 813 Client IP and port to server ID based on recently observed packets. 815 Alternatively, servers MAY implement the technique described in 816 Section 14.4.1 of [QUIC-TRANSPORT] to increase the likelihood a 817 Source Connection ID is included in ICMP responses to Path Maximum 818 Transmission Unit (PMTU) probes. Load balancers MAY parse the echoed 819 packet to extract the Source Connection ID, if it contains a QUIC 820 long header, and extract the Server ID as if it were in a Destination 821 CID. 823 7. Retry Service 825 When a server is under load, QUICv1 allows it to defer storage of 826 connection state until the client proves it can receive packets at 827 its advertised IP address. Through the use of a Retry packet, a 828 token in subsequent client Initial packets, and transport parameters, 829 servers verify address ownership and clients verify that there is no 830 on-path attacker generating Retry packets. 832 A "Retry Service" detects potential Denial of Service attacks and 833 handles sending of Retry packets on behalf of the server. As it is, 834 by definition, literally an on-path entity, the service must 835 communicate some of the original connection IDs back to the server so 836 that it can pass client verification. It also must either verify the 837 address itself (with the server trusting this verification) or make 838 sure there is common context for the server to verify the address 839 using a service-generated token. 841 There are two different mechanisms to allow offload of DoS mitigation 842 to a trusted network service. One requires no shared state; the 843 server need only be configured to trust a retry service, though this 844 imposes other operational constraints. The other requires a shared 845 key, but has no such constraints. 847 Retry services MUST forward all QUIC packets that are not of type 848 Initial or 0-RTT. Other packet types might involve changed IP 849 addresses or connection IDs, so it is not practical for Retry 850 Services to identify such packets as valid or invalid. 852 7.1. Common Requirements 854 Regardless of mechanism, a retry service has an active mode, where it 855 is generating Retry packets, and an inactive mode, where it is not, 856 based on its assessment of server load and the likelihood an attack 857 is underway. The choice of mode MAY be made on a per-packet or per- 858 connection basis, through a stochastic process or based on client 859 address. 861 A configuration agent MUST distribute a list of QUIC versions the 862 Retry Service supports. It MAY also distribute either an "Allow- 863 List" or a "Deny-List" of other QUIC versions. It MUST NOT 864 distribute both an Allow-List and a Deny-List. 866 The Allow-List or Deny-List MUST NOT include any versions included 867 for Retry Service Support. 869 The Configuration Agent MUST provide a means for the entity that 870 controls the Retry Service to report its supported version(s) to the 871 configuration Agent. If the entity has not reported this 872 information, it MUST NOT activate the Retry Service and the 873 configuration agent MUST NOT distribute configuration that activates 874 it. 876 The configuration agent MAY delete versions from the final supported 877 version list if policy does not require the Retry Service to operate 878 on those versions. 880 The configuration Agent MUST provide a means for the entities that 881 control servers behind the Retry Service to report either an Allow- 882 List or a Deny-List. 884 If all entities supply Allow-Lists, the consolidated list MUST be the 885 union of these sets. If all entities supply Deny-Lists, the 886 consolidated list MUST be the intersection of these sets. 888 If entities provide a mixture of Allow-Lists and Deny-Lists, the 889 consolidated list MUST be a Deny-List that is the intersection of all 890 provided Deny-Lists and the inverses of all Allow-Lists. 892 If no entities that control servers have reported Allow-Lists or 893 Deny-Lists, the default is a Deny-List with the null set (i.e., all 894 unsupported versions will be admitted). This preserves the future 895 extensibilty of QUIC. 897 A retry service MUST forward all packets for a QUIC version it does 898 not support that are not on a Deny-List or absent from an Allow-List. 899 Note that if servers support versions the retry service does not, 900 this may increase load on the servers. 902 Note that future versions of QUIC might not have Retry packets, 903 require different information in Retry, or use different packet type 904 indicators. 906 7.2. No-Shared-State Retry Service 908 The no-shared-state retry service requires no coordination, except 909 that the server must be configured to accept this service and know 910 which QUIC versions the retry service supports. The scheme uses the 911 first bit of the token to distinguish between tokens from Retry 912 packets (codepoint '0') and tokens from NEW_TOKEN frames (codepoint 913 '1'). 915 7.2.1. Configuration Agent Actions 917 See Section 7.1. 919 7.2.2. Service Requirements 921 A no-shared-state retry service MUST be present on all paths from 922 potential clients to the server. These paths MUST fail to pass QUIC 923 traffic should the service fail for any reason. That is, if the 924 service is not operational, the server MUST NOT be exposed to client 925 traffic. Otherwise, servers that have already disabled their Retry 926 capability would be vulnerable to attack. 928 The path between service and server MUST be free of any potential 929 attackers. Note that this and other requirements above severely 930 restrict the operational conditions in which a no-shared-state retry 931 service can safely operate. 933 Retry tokens generated by the service MUST have the format below. 935 Non-Shared-State Retry Service Token { 936 Token Type (1) = 0, 937 ODCIL (7) = 8..20, 938 RSCIL (8) = 0..20, 939 Original Destination Connection ID (64..160), 940 Retry Source Connection ID (0..160), 941 Opaque Data (..), 942 } 944 Figure 6: Format of non-shared-state retry service tokens 946 The first bit of retry tokens generated by the service MUST be zero. 947 The token has the following additional fields: 949 ODCIL: The length of the original destination connection ID from the 950 triggering Initial packet. This is in cleartext to be readable for 951 the server, but authenticated later in the token. The Retry Service 952 SHOULD reject any token in which the value is less than 8. 954 RSCIL: The retry source connection ID length. 956 Original Destination Connection ID: This also in cleartext and 957 authenticated later. 959 Retry Source Connection ID: This also in cleartext and authenticated 960 later. 962 Opaque Data: This data MUST contain encrypted information that allows 963 the retry service to validate the client's IP address, in accordance 964 with the QUIC specification. It MUST also provide a 965 cryptographically secure means to validate the integrity of the 966 entire token. 968 Upon receipt of an Initial packet with a token that begins with '0', 969 the retry service MUST validate the token in accordance with the QUIC 970 specification. 972 In active mode, the service MUST issue Retry packets for all Client 973 initial packets that contain no token, or a token that has the first 974 bit set to '1'. It MUST NOT forward the packet to the server. The 975 service MUST validate all tokens with the first bit set to '0'. If 976 successful, the service MUST forward the packet with the token 977 intact. If unsuccessful, it MUST drop the packet. The Retry Service 978 MAY send an Initial Packet containing a CONNECTION_CLOSE frame with 979 the INVALID_TOKEN error code when dropping the packet. 981 Note that this scheme has a performance drawback. When the retry 982 service is in active mode, clients with a token from a NEW_TOKEN 983 frame will suffer a 1-RTT penalty even though its token provides 984 proof of address. 986 In inactive mode, the service MUST forward all packets that have no 987 token or a token with the first bit set to '1'. It MUST validate all 988 tokens with the first bit set to '0'. If successful, the service 989 MUST forward the packet with the token intact. If unsuccessful, it 990 MUST either drop the packet or forward it with the token removed. 991 The latter requires decryption and re-encryption of the entire 992 Initial packet to avoid authentication failure. Forwarding the 993 packet causes the server to respond without the 994 original_destination_connection_id transport parameter, which 995 preserves the normal QUIC signal to the client that there is an on- 996 path attacker. 998 7.2.3. Server Requirements 1000 A server behind a non-shared-state retry service MUST NOT send Retry 1001 packets for a QUIC version the retry service understands. It MAY 1002 send Retry for QUIC versions the Retry Service does not understand. 1004 Tokens sent in NEW_TOKEN frames MUST have the first bit set to '1'. 1006 If a server receives an Initial Packet with the first bit set to '1', 1007 it could be from a server-generated NEW_TOKEN frame and should be 1008 processed in accordance with the QUIC specification. If a server 1009 receives an Initial Packet with the first bit to '0', it is a Retry 1010 token and the server MUST NOT attempt to validate it. Instead, it 1011 MUST assume the address is validated and MUST extract the Original 1012 Destination Connection ID and Retry Source Connection ID, assuming 1013 the format described in Section 7.2.2. 1015 7.3. Shared-State Retry Service 1017 A shared-state retry service uses a shared key, so that the server 1018 can decode the service's retry tokens. It does not require that all 1019 traffic pass through the Retry service, so servers MAY send Retry 1020 packets in response to Initial packets that don't include a valid 1021 token. 1023 Both server and service must have access to Universal time, though 1024 tight synchronization is unnecessary. 1026 The tokens are protected using AES128-GCM AEAD, as explained in 1027 Section 7.3.1. All tokens, generated by either the server or retry 1028 service, MUST use the following format, which includes: 1030 * A 96 bit unique token number transmitted in clear text, but 1031 protected as part of the AEAD associated data. 1033 * An 8 bit token key identifier. 1035 * A token body, encoding the Original Destination Connection ID, the 1036 Retry Source Connection ID, and the Timestamp, optionally followed 1037 by server specific Opaque Data. 1039 The token protection uses an 128 bit representation of the source IP 1040 address from the triggering Initial packet. The client IP address is 1041 16 octets. If an IPv4 address, the last 12 octets are zeroes. 1043 If there is a Network Address Translator (NAT) in the server 1044 infrastructure that changes the client IP, the Retry Service MUST 1045 either be positioned behind the NAT, or the NAT must have the token 1046 key to rewrite the Retry token accordingly. Note also that a host 1047 that obtains a token through a NAT and then attempts to connect over 1048 a path that does not have an identically configured NAT will fail 1049 address validation. 1051 The 96 bit unique token number is set to a random value using a 1052 cryptography- grade random number generator. 1054 The token key identifier and the corresponding AEAD key and AEAD IV 1055 are provisioned by the configuration agent. 1057 The token body is encoded as follows: 1059 Shared-State Retry Service Token Body { 1060 ODCIL (8) = 0..20, 1061 RSCIL (8) = 0..20, 1062 [Port (16)], 1063 Original Destination Connection ID (0..160), 1064 Retry Source Connection ID (0..160), 1065 Timestamp (64), 1066 Opaque Data (..), 1067 } 1069 Figure 7: Body of shared-state retry service tokens 1071 The token body has the following fields: 1073 ODCIL: The original destination connection ID length. Tokens in 1074 NEW_TOKEN frames MUST set this field to zero. 1076 RSCIL: The retry source connection ID length. Tokens in NEW_TOKEN 1077 frames MUST set this field to zero. 1079 Port: The Source Port of the UDP datagram that triggered the Retry 1080 packet. This field MUST be present if and only if the ODCIL is 1081 greater than zero. This field is therefore always absent in tokens 1082 in NEW_TOKEN frames. 1084 Original Destination Connection ID: The server or Retry Service 1085 copies this from the field in the client Initial packet. 1087 Retry Source Connection ID: The server or Retry service copies this 1088 from the Source Connection ID of the Retry packet. 1090 Timestamp: The Timestamp is a 64-bit integer, in network order, that 1091 expresses the expiration time of the token as a number of seconds in 1092 POSIX time (see Sec. 4.16 of [TIME_T]). 1094 Opaque Data: The server may use this field to encode additional 1095 information, such as congestion window, RTT, or MTU. The Retry 1096 Service MUST have zero-length opaque data. 1098 Some implementations of QUIC encode in the token the Initial Packet 1099 Number used by the client, in order to verify that the client sends 1100 the retried Initial with a PN larger that the triggering Initial. 1101 Such implementations will encode the Initial Packet Number as part of 1102 the opaque data. As tokens may be generated by the Service, servers 1103 MUST NOT reject tokens because they lack opaque data and therefore 1104 the packet number. 1106 7.3.1. Token Protection with AEAD 1108 On the wire, the token is presented as: 1110 Shared-State Retry Service Token { 1111 Unique Token Number (96), 1112 Key Sequence (8), 1113 Encrypted Shared-State Retry Service Token Body (80..), 1114 AEAD Checksum (length depends on encryption algorithm), 1115 } 1117 Figure 8: Wire image of shared-state retry service tokens 1119 The tokens are protected using AES128-GCM as follows: 1121 * The token key and IV are retrieved using the Key Sequence. 1123 * The nonce, N, is formed by combining the IV with the 96 bit unique 1124 token number. The 96 bits of the unique token number are left- 1125 padded with zeros to the size of the IV. The exclusive OR of the 1126 padded unique token number and the IV forms the AEAD nonce. 1128 * The associated data is a formatted as a pseudo header by combining 1129 the cleartext part of the token with the IP address of the client. 1131 Shared-State Retry Service Token Pseudoheader { 1132 IP Address (128), 1133 Unique Token Number (96), 1134 Key Sequence (8), 1135 } 1137 Figure 9: Psuedoheader for shared-state retry service tokens 1139 * The input plaintext for the AEAD is the token body. The output 1140 ciphertext of the AEAD is transmitted in place of the token body. 1142 * The AEAD Checksum is computed as part of the AEAD encryption 1143 process, and is verified during decryption. 1145 7.3.2. Configuration Agent Actions 1147 The configuration agent generates and distributes a "token key", a 1148 "token IV", a key sequence, and the information described in 1149 Section 7.1. 1151 7.3.3. Service Requirements 1153 In inactive mode, the Retry service forwards all packets without 1154 further inspection or processing. 1156 Retry services MUST NOT issue Retry packets except where explicitly 1157 allowed below, to avoid sending a Retry packet in response to a Retry 1158 token. 1160 When in active mode, the service MUST generate Retry tokens with the 1161 format described above when it receives a client Initial packet with 1162 no token. 1164 The service SHOULD decrypt incoming tokens. The service SHOULD drop 1165 packets with unknown key sequence, or an AEAD checksum that does not 1166 match the expected value. (By construction, the AEAD checksum will 1167 only match if the client IP Address also matches.) 1169 If the token checksum passes, and the ODCIL and RSCIL fields are both 1170 zero, then this is a NEW_TOKEN token generated by the server. 1171 Processing of NEW_TOKEN tokens is subtly different from Retry tokens, 1172 as described below. 1174 The service SHOULD drop a packet containing a token where the ODCIL 1175 is greater than zero and less than the minimum number of octets for a 1176 client-generated CID (8 in QUIC version 1). The service also SHOULD 1177 drop a packet containing a token where the ODCIL is zero and RSCIL is 1178 nonzero. 1180 If the Timestamp of a token points to time in the past, the token has 1181 expired; however, in order to allow for clock skew, it SHOULD NOT 1182 consider tokens to be expired if the Timestamp encodes a few seconds 1183 in the past. An active Retry service SHOULD drop packets with 1184 expired tokens. If a NEW_TOKEN token, the service MUST generate a 1185 Retry packet in response. It MUST NOT generate a Retry packet in 1186 response to an expired Retry token. 1188 If a Retry token, the service SHOULD drop packets where the port 1189 number encoded in the token does not match the source port in the 1190 encapsulating UDP header. 1192 All other packets SHOULD be forwarded to the server. 1194 7.3.4. Server Requirements 1196 When issuing Retry or NEW_TOKEN tokens, the server MUST include the 1197 client IP address in the authenticated data as specified in 1198 Section 7.3.1. The ODCIL and RSCIL fields are zero for NEW_TOKEN 1199 tokens, making them easily distinguishable from Retry tokens. 1201 The server MUST validate all tokens that arrive in Initial packets, 1202 as they may have bypassed the Retry service. 1204 For Retry tokens that follow the format above, servers SHOULD use the 1205 timestamp field to apply its expiration limits for tokens. This need 1206 not be precisely synchronized with the retry service. However, 1207 servers MAY allow retry tokens marked as being a few seconds in the 1208 past, due to possible clock synchronization issues. 1210 After decrypting the token, the server uses the corresponding fields 1211 to populate the original_destination_connection_id transport 1212 parameter, with a length equal to ODCIL, and the 1213 retry_source_connection_id transport parameter, with length equal to 1214 RSCIL. 1216 For QUIC versions the service does not support, the server MAY use 1217 any token format. 1219 As discussed in [QUIC-TRANSPORT], a server MUST NOT send a Retry 1220 packet in response to an Initial packet that contains a retry token. 1222 8. Configuration Requirements 1224 QUIC-LB requires common configuration to synchronize understanding of 1225 encodings and guarantee explicit consent of the server. 1227 The load balancer and server MUST agree on a routing algorithm, 1228 server ID allocation method, and the relevant parameters for that 1229 algorithm. 1231 All algorithms require a server ID length. If server IDs are 1232 statically allocated, the load balancer MUST receive the full table 1233 of mappings, and each server must receive its assigned SID(s), from 1234 the configuration agent. 1236 For Stream Cipher CID Routing, the servers and load balancer also 1237 MUST have a common understanding of the key and nonce length. 1239 For Block Cipher CID Routing, the servers and load balancer also MUST 1240 have a common understanding of the key. 1242 Note that server IDs are opaque bytes, not integers, so there is no 1243 notion of network order or host order. 1245 A server configuration MUST specify if the first octet encodes the 1246 CID length. Note that a load balancer does not need the CID length, 1247 as the required bytes are present in the QUIC packet. 1249 A full QUIC-LB server configuration MUST also specify the supported 1250 QUIC versions of any Retry Service. If a shared-state service, the 1251 server also must have the token key. 1253 A non-shared-state Retry Service need only be configured with the 1254 QUIC versions it supports, and an Allow- or Deny-List. A shared- 1255 state Retry Service also needs the token key, and to be aware if a 1256 NAT sits between it and the servers. 1258 Appendix A provides a YANG Model of the a full QUIC-LB configuration. 1260 9. Additional Use Cases 1262 This section discusses considerations for some deployment scenarios 1263 not implied by the specification above. 1265 9.1. Load balancer chains 1267 Some network architectures may have multiple tiers of low-state load 1268 balancers, where a first tier of devices makes a routing decision to 1269 the next tier, and so on, until packets reach the server. Although 1270 QUIC-LB is not explicitly designed for this use case, it is possible 1271 to support it. 1273 If each load balancer is assigned a range of server IDs that is a 1274 subset of the range of IDs assigned to devices that are closer to the 1275 client, then the first devices to process an incoming packet can 1276 extract the server ID and then map it to the correct forwarding 1277 address. Note that this solution is extensible to arbitrarily large 1278 numbers of load-balancing tiers, as the maximum server ID space is 1279 quite large. 1281 9.2. Moving connections between servers 1283 Some deployments may transparently move a connection from one server 1284 to another. The means of transferring connection state between 1285 servers is out of scope of this document. 1287 To support a handover, a server involved in the transition could 1288 issue CIDs that map to the new server via a NEW_CONNECTION_ID frame, 1289 and retire CIDs associated with the new server using the "Retire 1290 Prior To" field in that frame. 1292 Alternately, if the old server is going offline, the load balancer 1293 could simply map its server ID to the new server's address. 1295 10. Version Invariance of QUIC-LB 1297 Non-shared-state Retry Services are inherently dependent on the 1298 format (and existence) of Retry Packets in each version of QUIC, and 1299 so Retry Service configuration explicitly includes the supported QUIC 1300 versions. 1302 The server ID encodings, and requirements for their handling, are 1303 designed to be QUIC version independent (see [QUIC-INVARIANTS]). A 1304 QUIC-LB load balancer will generally not require changes as servers 1305 deploy new versions of QUIC. However, there are several unlikely 1306 future design decisions that could impact the operation of QUIC-LB. 1308 The maximum Connection ID length could be below the minimum necessary 1309 for one or more encoding algorithms. 1311 Section 4.1 provides guidance about how load balancers should handle 1312 non-compliant DCIDs. This guidance, and the implementation of an 1313 algorithm to handle these DCIDs, rests on some assumptions: 1315 * Incoming short headers do not contain DCIDs that are client- 1316 generated. 1318 * The use of client-generated incoming DCIDs does not persist beyond 1319 a few round trips in the connection. 1321 * While the client is using DCIDs it generated, some exposed fields 1322 (IP address, UDP port, client-generated destination Connection ID) 1323 remain constant for all packets sent on the same connection. 1325 * Dynamic server ID allocation is dependent on client-generated 1326 Destination CIDs in Initial Packets being at least 8 octets in 1327 length. If they are not, the load balancer may not be able to 1328 extract a valid server ID to add to its table. Configuring a 1329 shorter server ID length can increase robustness to a change. 1331 While this document does not update the commitments in 1332 [QUIC-INVARIANTS], the additional assumptions are minimal and 1333 narrowly scoped, and provide a likely set of constants that load 1334 balancers can use with minimal risk of version- dependence. 1336 If these assumptions are invalid, this specification is likely to 1337 lead to loss of packets that contain non-compliant DCIDs, and in 1338 extreme cases connection failure. 1340 Some load balancers might inspect elements of the Server Name 1341 Indication (SNI) extension in the TLS Client Hello to make a routing 1342 decision. Note that the format and cryptographic protection of this 1343 information may change in future versions or extensions of TLS or 1344 QUIC, and therefore this functionality is inherently not version- 1345 invariant. 1347 11. Security Considerations 1349 QUIC-LB is intended to prevent linkability. Attacks would therefore 1350 attempt to subvert this purpose. 1352 Note that the Plaintext CID algorithm makes no attempt to obscure the 1353 server mapping, and therefore does not address these concerns. It 1354 exists to allow consistent CID encoding for compatibility across a 1355 network infrastructure, which makes QUIC robust to NAT rebinding. 1356 Servers that are running the Plaintext CID algorithm SHOULD only use 1357 it to generate new CIDs for the Server Initial Packet and SHOULD NOT 1358 send CIDs in QUIC NEW_CONNECTION_ID frames, except that it sends one 1359 new Connection ID in the event of config rotation Section 3.1. Doing 1360 so might falsely suggest to the client that said CIDs were generated 1361 in a secure fashion. 1363 A linkability attack would find some means of determining that two 1364 connection IDs route to the same server. As described above, there 1365 is no scheme that strictly prevents linkability for all traffic 1366 patterns, and therefore efforts to frustrate any analysis of server 1367 ID encoding have diminishing returns. 1369 11.1. Attackers not between the load balancer and server 1371 Any attacker might open a connection to the server infrastructure and 1372 aggressively simulate migration to obtain a large sample of IDs that 1373 map to the same server. It could then apply analytical techniques to 1374 try to obtain the server encoding. 1376 The Stream and Block Cipher CID algorithms provide robust protection 1377 against any sort of linkage. The Plaintext CID algorithm makes no 1378 attempt to protect this encoding. 1380 Were this analysis to obtain the server encoding, then on-path 1381 observers might apply this analysis to correlating different client 1382 IP addresses. 1384 11.2. Attackers between the load balancer and server 1386 Attackers in this privileged position are intrinsically able to map 1387 two connection IDs to the same server. The QUIC-LB algorithms do 1388 prevent the linkage of two connection IDs to the same individual 1389 connection if servers make reasonable selections when generating new 1390 IDs for that connection. 1392 11.3. Multiple Configuration IDs 1394 During the period in which there are multiple deployed configuration 1395 IDs (see Section 3.1), there is a slight increase in linkability. 1396 The server space is effectively divided into segments with CIDs that 1397 have different config rotation bits. Entities that manage servers 1398 SHOULD strive to minimize these periods by quickly deploying new 1399 configurations across the server pool. 1401 11.4. Limited configuration scope 1403 A simple deployment of QUIC-LB in a cloud provider might use the same 1404 global QUIC-LB configuration across all its load balancers that route 1405 to customer servers. An attacker could then simply become a 1406 customer, obtain the configuration, and then extract server IDs of 1407 other customers' connections at will. 1409 To avoid this, the configuration agent SHOULD issue QUIC-LB 1410 configurations to mutually distrustful servers that have different 1411 keys for encryption algorithms. The load balancers can distinguish 1412 these configurations by external IP address, or by assigning 1413 different values to the config rotation bits (Section 3.1). Note 1414 that either solution has a privacy impact; see Section 11.3. 1416 These techniques are not necessary for the plaintext algorithm, as it 1417 does not attempt to conceal the server ID. 1419 11.5. Stateless Reset Oracle 1421 Section 21.9 of [QUIC-TRANSPORT] discusses the Stateless Reset Oracle 1422 attack. For a server deployment to be vulnerable, an attacking 1423 client must be able to cause two packets with the same Destination 1424 CID to arrive at two different servers that share the same 1425 cryptographic context for Stateless Reset tokens. As QUIC-LB 1426 requires deterministic routing of DCIDs over the life of a 1427 connection, it is a sufficient means of avoiding an Oracle without 1428 additional measures. 1430 11.6. Connection ID Entropy 1432 The Stream Cipher and Block Cipher algorithms need to generate 1433 different cipher text for each generated Connection ID instance to 1434 protect the Server ID. To do so, at least four octets of the Block 1435 Cipher CID and at least eight octets of the Stream Cipher CID are 1436 reserved for a nonce that, if used only once, will result in unique 1437 cipher text for each Connection ID. 1439 If servers simply increment the nonce by one with each generated 1440 connection ID, then it is safe to use the existing keys until any 1441 server's nonce counter exhausts the allocated space and rolls over to 1442 zero. Whether or not it implements this method, the server MUST NOT 1443 reuse a nonce until it switches to a configuration with new keys. 1445 Configuration agents SHOULD implement an out-of-band method to 1446 discover when servers are in danger of exhausting their nonce space, 1447 and SHOULD respond by issuing a new configuration. A server that has 1448 exhausted its nonces MUST either switch to a different configuration, 1449 or if none exists, use the 4-tuple routing config rotation codepoint. 1451 11.7. Shared-State Retry Keys 1453 The Shared-State Retry Service defined in Section 7.3 describes the 1454 format of retry tokens or new tokens protected and encrypted using 1455 AES128-GCM. Each token includes a 96 bit randomly generated unique 1456 token number, and an 8 bit identifier of the AES-GCM encryption key. 1457 There are three important security considerations for these tokens: 1459 * An attacker that obtains a copy of the encryption key will be able 1460 to decrypt and forge tokens. 1462 * Attackers may be able to retrieve the key if they capture a 1463 sufficently large number of retry tokens encrypted with a given 1464 key. 1466 * Confidentiality of the token data will fail if separate tokens 1467 reuse the same 96 bit unique token number and the same key. 1469 To protect against disclosure of keys to attackers, service and 1470 servers MUST ensure that the keys are stored securely. To limit the 1471 consequences of potential exposures, the time to live of any given 1472 key should be limited. 1474 Section 6.6 of [QUIC-TLS] states that "Endpoints MUST count the 1475 number of encrypted packets for each set of keys. If the total 1476 number of encrypted packets with the same key exceeds the 1477 confidentiality limit for the selected AEAD, the endpoint MUST stop 1478 using those keys." It goes on with the specific limit: "For 1479 AEAD_AES_128_GCM and AEAD_AES_256_GCM, the confidentiality limit is 1480 2^23 encrypted packets; see Appendix B.1." It is prudent to adopt 1481 the same limit here, and configure the service in such a way that no 1482 more than 2^23 tokens are generated with the same key. 1484 In order to protect against collisions, the 96 bit unique token 1485 numbers should be generated using a cryptographically secure 1486 pseudorandom number generator (CSPRNG), as specified in Appendix C.1 1487 of the TLS 1.3 specification [RFC8446]. With proper random numbers, 1488 if fewer than 2^40 tokens are generated with a single key, the risk 1489 of collisions is lower than 0.001%. 1491 12. IANA Considerations 1493 There are no IANA requirements. 1495 13. References 1497 13.1. Normative References 1499 [QUIC-INVARIANTS] 1500 Thomson, M., "Version-Independent Properties of QUIC", 1501 Work in Progress, Internet-Draft, draft-ietf-quic- 1502 invariants-13, 14 January 2021, . 1505 [QUIC-TRANSPORT] 1506 Iyengar, J. and M. Thomson, "QUIC: A UDP-Based Multiplexed 1507 and Secure Transport", Work in Progress, Internet-Draft, 1508 draft-ietf-quic-transport-34, 14 January 2021, 1509 . 1512 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1513 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 1514 . 1516 [TIME_T] "Open Group Standard: Vol. 1: Base Definitions, Issue 7", 1517 IEEE Std 1003.1 , 2018, 1518 . 1521 13.2. Informative References 1523 [QUIC-TLS] Thomson, M. and S. Turner, "Using TLS to Secure QUIC", 1524 Work in Progress, Internet-Draft, draft-ietf-quic-tls-34, 1525 14 January 2021, . 1528 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1529 Requirement Levels", BCP 14, RFC 2119, 1530 DOI 10.17487/RFC2119, March 1997, 1531 . 1533 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1534 the Network Configuration Protocol (NETCONF)", RFC 6020, 1535 DOI 10.17487/RFC6020, October 2010, 1536 . 1538 [RFC7696] Housley, R., "Guidelines for Cryptographic Algorithm 1539 Agility and Selecting Mandatory-to-Implement Algorithms", 1540 BCP 201, RFC 7696, DOI 10.17487/RFC7696, November 2015, 1541 . 1543 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 1544 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 1545 . 1547 Appendix A. QUIC-LB YANG Model 1549 This YANG model conforms to [RFC6020] and expresses a complete QUIC- 1550 LB configuration. 1552 module ietf-quic-lb { 1553 yang-version "1.1"; 1554 namespace "urn:ietf:params:xml:ns:yang:ietf-quic-lb"; 1555 prefix "quic-lb"; 1557 import ietf-yang-types { 1558 prefix yang; 1559 reference 1560 "RFC 6991: Common YANG Data Types."; 1561 } 1563 import ietf-inet-types { 1564 prefix inet; 1565 reference 1566 "RFC 6991: Common YANG Data Types."; 1567 } 1569 organization 1570 "IETF QUIC Working Group"; 1572 contact 1573 "WG Web: 1574 WG List: 1576 Authors: Martin Duke (martin.h.duke at gmail dot com) 1577 Nick Banks (nibanks at microsoft dot com)"; 1579 description 1580 "This module enables the explicit cooperation of QUIC servers with 1581 trusted intermediaries without breaking important protocol features. 1583 Copyright (c) 2021 IETF Trust and the persons identified as 1584 authors of the code. All rights reserved. 1586 Redistribution and use in source and binary forms, with or 1587 without modification, is permitted pursuant to, and subject to 1588 the license terms contained in, the Simplified BSD License set 1589 forth in Section 4.c of the IETF Trust's Legal Provisions 1590 Relating to IETF Documents 1591 (https://trustee.ietf.org/license-info). 1593 This version of this YANG module is part of RFC XXXX 1594 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself 1595 for full legal notices. 1597 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL 1598 NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 1599 'MAY', and 'OPTIONAL' in this document are to be interpreted as 1600 described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, 1601 they appear in all capitals, as shown here."; 1603 revision "2021-01-29" { 1604 description 1605 "Initial Version"; 1606 reference 1607 "RFC XXXX, QUIC-LB: Generating Routable QUIC Connection IDs"; 1608 } 1610 container quic-lb { 1611 presence "The container for QUIC-LB configuration."; 1613 description 1614 "QUIC-LB container."; 1616 typedef quic-lb-key { 1617 type yang:hex-string { 1618 length 47; 1619 } 1620 description 1621 "This is a 16-byte key, represented with 47 bytes"; 1622 } 1624 list cid-configs { 1625 key "config-rotation-bits"; 1626 description 1627 "List up to three load balancer configurations"; 1629 leaf config-rotation-bits { 1630 type uint8 { 1631 range "0..2"; 1632 } 1633 mandatory true; 1634 description 1635 "Identifier for this CID configuration."; 1636 } 1638 leaf first-octet-encodes-cid-length { 1639 type boolean; 1640 default false; 1641 description 1642 "If true, the six least significant bits of the first CID 1643 octet encode the CID length minus one."; 1644 } 1646 leaf cid-key { 1647 type quic-lb-key; 1648 description 1649 "Key for encrypting the connection ID. If absent, the 1650 configuration uses the Plaintext algorithm."; 1651 } 1653 leaf nonce-length { 1654 type uint8 { 1655 range "8..16"; 1656 } 1657 must '(../cid-key)' { 1658 error-message "nonce-length only valid if cid-key is set"; 1659 } 1660 description 1661 "Length, in octets, of the nonce. If absent when cid-key is 1662 present, the configuration uses the Block Cipher Algorithm. 1663 If present along with cid-key, the configurationuses the 1664 Stream Cipher Algorithm."; 1665 } 1667 leaf lb-timeout { 1668 type uint32; 1669 description 1670 "Existence means the configuration uses dynamic Server ID allocation. 1671 Time (in seconds) to keep a server ID allocation if no packets with 1672 that server ID arrive."; 1673 } 1675 leaf server-id-length { 1676 type uint8 { 1677 range "1..18"; 1678 } 1679 must '(../lb-timeout and . <= 7) or 1680 (not(../lb-timeout) and 1681 (not(../cid-key) and . <= 16) or 1682 ((../nonce-length) and . <= (19 - ../nonce-length)) or 1683 ((../cid-key) and not(../nonce-length) and . <= 12))' { 1684 error-message 1685 "Server ID length too long for routing algorithm and server ID 1686 allocation method"; 1687 } 1688 mandatory true; 1689 description 1690 "Length (in octets) of a server ID. Further range-limited 1691 by sid-allocation, cid-key, and nonce-length."; 1692 } 1694 list server-id-mappings { 1695 when "not(../lb-timeout)"; 1696 key "server-id"; 1697 description "Statically allocated Server IDs"; 1699 leaf server-id { 1700 type yang:hex-string; 1701 must "string-length(.) = 3 * ../../server-id-length - 1"; 1702 mandatory true; 1703 description 1704 "An allocated server ID"; 1705 } 1707 leaf server-address { 1708 type inet:ip-address; 1709 mandatory true; 1710 description 1711 "Destination address corresponding to the server ID"; 1712 } 1713 } 1714 } 1716 container retry-service-config { 1717 description 1718 "Configuration of Retry Service. If supported-versions is empty, there 1719 is no retry service. If token-keys is empty, it uses the non-shared- 1720 state service. If present, it uses shared-state tokens."; 1722 leaf-list supported-versions { 1723 type uint32; 1724 description 1725 "QUIC versions that the retry service supports. If empty, there 1726 is no retry service."; 1727 } 1729 leaf unsupported-version-default { 1730 type enumeration { 1731 enum allow { 1732 description "Unsupported versions admitted by default"; 1733 } 1734 enum deny { 1735 description "Unsupported versions denied by default"; 1736 } 1737 } 1738 default allow; 1739 description 1740 "Are unsupported versions not in version-exceptions allowed 1741 or denied?"; 1742 } 1744 leaf-list version-exceptions { 1745 type uint32; 1746 description 1747 "Exceptions to the default-deny or default-allow rule."; 1748 } 1750 list token-keys { 1751 key "key-sequence-number"; 1752 description 1753 "list of active keys, for key rotation purposes. Existence implies 1754 shared-state format"; 1756 leaf key-sequence-number { 1757 type uint8; 1758 mandatory true; 1759 description 1760 "Identifies the key used to encrypt the token"; 1761 } 1763 leaf token-key { 1764 type quic-lb-key; 1765 mandatory true; 1766 description 1767 "16-byte key to encrypt the token"; 1768 } 1770 leaf token-iv { 1771 type yang:hex-string { 1772 length 23; 1774 } 1775 mandatory true; 1776 description 1777 "8-byte IV to encrypt the token, encoded in 23 bytes"; 1778 } 1779 } 1780 } 1781 } 1782 } 1784 A.1. Tree Diagram 1786 This summary of the YANG model uses the notation in [RFC8340]. 1788 module: ietf-quic-lb 1789 +--rw quic-lb 1790 +--rw cid-configs* 1791 | [config-rotation-bits] 1792 | +--rw config-rotation-bits uint8 1793 | +--rw first-octet-encodes-cid-length? boolean 1794 | +--rw cid-key? yang:hex-string 1795 | +--rw nonce-length? uint8 1796 | +--rw lb-timeout? uint32 1797 | +--rw server-id-length uint8 1798 | +--rw server-id-mappings*? 1799 | | [server-id] 1800 | | +--rw server-id yang:hex-string 1801 | | +--rw server-address inet:ip-address 1802 +--ro retry-service-config 1803 | +--rw supported-versions* 1804 | | +--rw version uint32 1805 | +--rw unsupported-version-default enumeration {allow deny} 1806 | +--rw version-exceptions* 1807 | | +--rw version uint32 1808 | +--rw token-keys*? 1809 | | [key-sequence-number] 1810 | | +--rw key-sequence-number uint8 1811 | | +--rw token-key yang:hex-string 1812 | | +--rw token-iv yang:hex-string 1814 Appendix B. Load Balancer Test Vectors 1816 Each section of this draft includes multiple sets of load balancer 1817 configuration, each of which has five examples of server ID and 1818 server use bytes and how they are encoded in a CID. 1820 In some cases, there are no server use bytes. Note that, for 1821 simplicity, the first octet bits used for neither config rotation nor 1822 length self-encoding are random, rather than listed in the server use 1823 field. Therefore, a server implementation using these parameters may 1824 generate CIDs with a slightly different first octet. 1826 This section uses the following abbreviations: 1828 cid Connection ID 1829 cr_bits Config Rotation Bits 1830 LB Load Balancer 1831 sid Server ID 1832 sid_len Server ID length 1833 su Server Use Bytes 1835 All values except length_self_encoding and sid_len are expressed in 1836 hexidecimal format. 1838 B.1. Plaintext Connection ID Algorithm 1839 LB configuration: cr_bits 0x0 length_self_encoding: y sid_len 1 1841 cid 01be sid be su 1842 cid 0221b7 sid 21 su b7 1843 cid 03cadfd8 sid ca su dfd8 1844 cid 041e0c9328 sid 1e su 0c9328 1845 cid 050c8f6d9129 sid 0c su 8f6d9129 1847 LB configuration: cr_bits 0x0 length_self_encoding: n sid_len 2 1849 cid 02aab0 sid aab0 su 1850 cid 3ac4b106 sid c4b1 su 06 1851 cid 08bd3cf4a0 sid bd3c su f4a0 1852 cid 3771d59502d6 sid 71d5 su 9502d6 1853 cid 1d57dee8b888f3 sid 57de su e8b888f3 1855 LB configuration: cr_bits 0x0 length_self_encoding: y sid_len 3 1857 cid 0336c976 sid 36c976 su 1858 cid 04aa291806 sid aa2918 su 06 1859 cid 0586897bd8b6 sid 86897b su d8b6 1860 cid 063625bcae4de0 sid 3625bc su ae4de0 1861 cid 07966fb1f3cb535f sid 966fb1 su f3cb535f 1863 LB configuration: cr_bits 0x0 length_self_encoding: n sid_len 4 1865 cid 185172fab8 sid 5172fab8 su 1866 cid 2eb7ff2c9297 sid b7ff2c92 su 97 1867 cid 14f3eb3dd3edbe sid f3eb3dd3 su edbe 1868 cid 3feb31cece744b74 sid eb31cece su 744b74 1869 cid 06b9f34c353ce23bb5 sid b9f34c35 su 3ce23bb5 1871 LB configuration: cr_bits 0x0 length_self_encoding: y sid_len 5 1873 cid 05bdcd8d0b1d sid bdcd8d0b1d su 1874 cid 06aee673725a63 sid aee673725a su 63 1875 cid 07bbf338ddbf37f4 sid bbf338ddbf su 37f4 1876 cid 08fbbca64c26756840 sid fbbca64c26 su 756840 1877 cid 09e7737c495b93894e34 sid e7737c495b su 93894e34 1879 B.2. Stream Cipher Connection ID Algorithm 1881 In each case below, the server is using a plain text nonce value of 1882 zero. 1884 LB configuration: cr_bits 0x0 length_self_encoding: y nonce_len 12 sid_len 1 1885 key 4d9d0fd25a25e7f321ef464e13f9fa3d 1887 cid 0d69fe8ab8293680395ae256e89c sid c5 su 1888 cid 0e420d74ed99b985e10f5073f43027 sid d5 su 27 1889 cid 0f380f440c6eefd3142ee776f6c16027 sid 10 su 6027 1890 cid 1020607efbe82049ddbf3a7c3d9d32604d sid 3c su 32604d 1891 cid 11e132d12606a1bb0fa17e1caef00ec54c10 sid e3 su 0ec54c10 1893 LB configuration: cr_bits 0x0 length_self_encoding: n nonce_len 12 sid_len 2 1894 key 49e1cec7fd264b1f4af37413baf8ada9 1896 cid 3d3a5e1126414271cc8dc2ec7c8c15 sid f7fe su 1897 cid 007042539e7c5f139ac2adfbf54ba748 sid eaf4 su 48 1898 cid 2bc125dd2aed2aafacf59855d99e029217 sid e880 su 9217 1899 cid 3be6728dc082802d9862c6c8e4dda3d984d8 sid 62c6 su d984d8 1900 cid 1afe9c6259ad350fc7bad28e0aeb2e8d4d4742 sid 8502 su 8d4d4742 1902 LB configuration: cr_bits 0x0 length_self_encoding: y nonce_len 14 sid_len 3 1903 key 2c70df0b399bd33a7335523dcdb884ad 1905 cid 11d62e8670565cd30b552edff6782ff5a740 sid d794bb su 1906 cid 12c70e481f49363cabd9370d1fd5012c12bca5 sid 2cbd5d su a5 1907 cid 133b95dfd8ad93566782f8424df82458069fc9e9 sid d126cd su c9e9 1908 cid 13ac6ffcd635532ab60370306c7ee572d6b6e795 sid 539e42 su e795 1909 cid 1383ed07a9700777ff450bb39bb9c1981266805c sid 9094dd su 805c 1911 LB configuration: cr_bits 0x0 length_self_encoding: n nonce_len 12 sid_len 4 1912 key 2297b8a95c776cf9c048b76d9dc27019 1914 cid 32873890c3059ca62628089439c44c1f84 sid 7398d8ca su 1915 cid 1ff7c7d7b9823954b178636c99a7dc93ac83 sid 9655f091 su 83 1916 cid 31044000a5ebb3bf2fa7629a17f2c78b077c17 sid 8b035fc6 su 7c17 1917 cid 1791bd28c66721e8fea0c6f34fd2d8e663a6ef70 sid 6672e0e2 su a6ef70 1918 cid 3df1d90ad5ccd5f8f475f040e90aeca09ec9839d sid b98b1fff su c9839d 1920 LB configuration: cr_bits 0x0 length_self_encoding: y nonce_len 8 sid_len 5 1921 key 484b2ed942d9f4765e45035da3340423 1923 cid 0da995b7537db605bfd3a38881ae sid 391a7840dc su 1924 cid 0ed8d02d55b91d06443540d1bf6e98 sid 10f7f7b284 su 98 1925 cid 0f3f74be6d46a84ccb1fd1ee92cdeaf2 sid 0606918fc0 su eaf2 1926 cid 1045626dbf20e03050837633cc5650f97c sid e505eea637 su 50f97c 1927 cid 11bb9a17f691ab446a938427febbeb593eaa sid 99343a2a96 su eb593eaa 1929 B.3. Block Cipher Connection ID Algorithm 1930 LB configuration: cr_bits 0x0 length_self_encoding: y sid_len 1 1931 key 411592e4160268398386af84ea7505d4 1933 cid 10564f7c0df399f6d93bdddb1a03886f25 sid 23 su 05231748a80884ed58007847eb9fd0 1934 cid 10d5c03f9dd765d73b3d8610b244f74d02 sid 15 su 76cd6b6f0d3f0b20fc8e633e3a05f3 1935 cid 108ca55228ab23b92845341344a2f956f2 sid 64 su 65c0ce170a9548717498b537cb8790 1936 cid 10e73f3d034aef2f6f501e3a7693d6270a sid 07 su f9ad10c84cc1e89a2492221d74e707 1937 cid 101a6ce13d48b14a77ecfd365595ad2582 sid 6c su 76ce4689b0745b956ef71c2608045d 1939 LB configuration: cr_bits 0x0 length_self_encoding: n sid_len 2 1940 key 92ce44aecd636aeeff78da691ef48f77 1942 cid 20aa09bc65ed52b1ccd29feb7ef995d318 sid a52f su 99278b92a86694ff0ecd64bc2f73 1943 cid 30b8dbef657bd78a2f870e93f9485d5211 sid 6c49 su 7381c8657a388b4e9594297afe96 1944 cid 043a8137331eacd2e78383279b202b9a6d sid 4188 su 5ac4b0e0b95f4e7473b49ee2d0dd 1945 cid 3ba71ea2bcf0ab95719ab59d3d7fde770d sid 8ccc su 08728807605db25f2ca88be08e0f 1946 cid 37ef1956b4ec354f40dc68336a23d42b31 sid c89d su 5a3ccd1471caa0de221ad6c185c0 1948 LB configuration: cr_bits 0x0 length_self_encoding: y sid_len 3 1949 key 5c49cb9265efe8ae7b1d3886948b0a34 1951 cid 10efcffc161d232d113998a49b1dbc4aa0 sid 0690b3 su 958fc9f38fe61b83881b2c5780 1952 cid 10fc13bdbcb414ba90e391833400c19505 sid 031ac3 su 9a55e1e1904e780346fcc32c3c 1953 cid 10d3cc1efaf5dc52c7a0f6da2746a8c714 sid 572d3a su ff2ec9712664e7174dc03ca3f8 1954 cid 107edf37f6788e33c0ec7758a485215f2b sid 562c25 su 02c5a5dcbea629c3840da5f567 1955 cid 10bc28da122582b7312e65aa096e9724fc sid 2fa4f0 su 8ae8c666bfc0fc364ebfd06b9a 1957 LB configuration: cr_bits 0x0 length_self_encoding: n sid_len 4 1958 key e787a3a491551fb2b4901a3fa15974f3 1960 cid 26125351da12435615e3be6b16fad35560 sid 0cb227d3 su 65b40b1ab54e05bff55db046 1961 cid 14de05fc84e41b611dfbe99ed5b1c9d563 sid 6a0f23ad su d73bee2f3a7e72b3ffea52d9 1962 cid 1306052c3f973db87de6d7904914840ff1 sid ca21402d su 5829465f7418b56ee6ada431 1963 cid 1d202b5811af3e1dba9ea2950d27879a92 sid b14e1307 su 4902aba8b23a5f24616df3cf 1964 cid 26538b78efc2d418539ad1de13ab73e477 sid a75e0148 su 0040323f1854e75aeb449b9f 1966 LB configuration: cr_bits 0x0 length_self_encoding: y sid_len 5 1967 key d5a6d7824336fbe0f25d28487cdda57c 1969 cid 10a2794871aadb20ddf274a95249e57fde sid 82d3b0b1a1 su 0935471478c2edb8120e60 1970 cid 108122fe80a6e546a285c475a3b8613ec9 sid fbcc902c9d su 59c47946882a9a93981c15 1971 cid 104d227ad9dd0fef4c8cb6eb75887b6ccc sid 2808e22642 su 2a7ef40e2c7e17ae40b3fb 1972 cid 10b3f367d8627b36990a28d67f50b97846 sid 5e018f0197 su 2289cae06a566e5cb6cfa4 1973 cid 1024412bfe25f4547510204bdda6143814 sid 8a8dd3d036 su 4b12933a135e5eaaebc6fd 1974 Appendix C. Acknowledgments 1976 The authors would like to thank Christian Huitema and Ian Swett for 1977 their major design contributions. 1979 Manasi Deval, Erik Fuller, Toma Gavrichenkov, Jana Iyengar, Subodh 1980 Iyengar, Ladislav Lhotka, Jan Lindblad, Ling Tao Nju, Kazuho Oku, 1981 Udip Pant, Martin Thomson, Dmitri Tikhonov, Victor Vasiliev, and 1982 William Zeng Ke all provided useful input to this document. 1984 Appendix D. Change Log 1986 *RFC Editor's Note:* Please remove this section prior to 1987 publication of a final version of this document. 1989 D.1. since draft-ietf-quic-load-balancers-05 1991 * Added low-config CID for further discussion 1993 * Complete revision of shared-state Retry Token 1995 * Added YANG model 1997 * Updated configuration limits to ensure CID entropy 1999 * Switched to notation from quic-transport 2001 D.2. since draft-ietf-quic-load-balancers-04 2003 * Rearranged the shared-state retry token to simplify token 2004 processing 2006 * More compact timestamp in shared-state retry token 2008 * Revised server requirements for shared-state retries 2010 * Eliminated zero padding from the test vectors 2012 * Added server use bytes to the test vectors 2014 * Additional compliant DCID criteria 2016 D.3. since-draft-ietf-quic-load-balancers-03 2018 * Improved Config Rotation text 2020 * Added stream cipher test vectors 2021 * Deleted the Obfuscated CID algorithm 2023 D.4. since-draft-ietf-quic-load-balancers-02 2025 * Replaced stream cipher algorithm with three-pass version 2027 * Updated Retry format to encode info for required TPs 2029 * Added discussion of version invariance 2031 * Cleaned up text about config rotation 2033 * Added Reset Oracle and limited configuration considerations 2035 * Allow dropped long-header packets for known QUIC versions 2037 D.5. since-draft-ietf-quic-load-balancers-01 2039 * Test vectors for load balancer decoding 2041 * Deleted remnants of in-band protocol 2043 * Light edit of Retry Services section 2045 * Discussed load balancer chains 2047 D.6. since-draft-ietf-quic-load-balancers-00 2049 * Removed in-band protocol from the document 2051 D.7. Since draft-duke-quic-load-balancers-06 2053 * Switch to IETF WG draft. 2055 D.8. Since draft-duke-quic-load-balancers-05 2057 * Editorial changes 2059 * Made load balancer behavior independent of QUIC version 2061 * Got rid of token in stream cipher encoding, because server might 2062 not have it 2064 * Defined "non-compliant DCID" and specified rules for handling 2065 them. 2067 * Added psuedocode for config schema 2069 D.9. Since draft-duke-quic-load-balancers-04 2071 * Added standard for retry services 2073 D.10. Since draft-duke-quic-load-balancers-03 2075 * Renamed Plaintext CID algorithm as Obfuscated CID 2077 * Added new Plaintext CID algorithm 2079 * Updated to allow 20B CIDs 2081 * Added self-encoding of CID length 2083 D.11. Since draft-duke-quic-load-balancers-02 2085 * Added Config Rotation 2087 * Added failover mode 2089 * Tweaks to existing CID algorithms 2091 * Added Block Cipher CID algorithm 2093 * Reformatted QUIC-LB packets 2095 D.12. Since draft-duke-quic-load-balancers-01 2097 * Complete rewrite 2099 * Supports multiple security levels 2101 * Lightweight messages 2103 D.13. Since draft-duke-quic-load-balancers-00 2105 * Converted to markdown 2107 * Added variable length connection IDs 2109 Authors' Addresses 2111 Martin Duke 2112 F5 Networks, Inc. 2114 Email: martin.h.duke@gmail.com 2115 Nick Banks 2116 Microsoft 2118 Email: nibanks@microsoft.com