idnits 2.17.1 draft-ietf-quic-load-balancers-03.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1001 has weird spacing: '...boolean first...' -- The document date (10 July 2020) is 1384 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '16' on line 1031 -- Looks like a reference, but probably isn't: '19' on line 1017 Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 4 comments (--). 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: 11 January 2021 Microsoft 6 10 July 2020 8 QUIC-LB: Generating Routable QUIC Connection IDs 9 draft-ietf-quic-load-balancers-03 11 Abstract 13 QUIC connection IDs allow continuation of connections across address/ 14 port 4-tuple changes, and can store routing information for stateless 15 or low-state load balancers. They also can prevent linkability of 16 connections across deliberate address migration through the use of 17 protected communications between client and server. This creates 18 issues for load-balancing intermediaries. This specification 19 standardizes methods for encoding routing information given a small 20 set of configuration parameters. This framework also enables offload 21 of other QUIC functions to trusted intermediaries, given the explicit 22 cooperation of the QUIC 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 11 January 2021. 41 Copyright Notice 43 Copyright (c) 2020 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 . . . . . . . . . . . . . . . . . . . . . . . . 3 58 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 59 2. Protocol Objectives . . . . . . . . . . . . . . . . . . . . . 5 60 2.1. Simplicity . . . . . . . . . . . . . . . . . . . . . . . 5 61 2.2. Security . . . . . . . . . . . . . . . . . . . . . . . . 5 62 3. First CID octet . . . . . . . . . . . . . . . . . . . . . . . 6 63 3.1. Config Rotation . . . . . . . . . . . . . . . . . . . . . 6 64 3.2. Configuration Failover . . . . . . . . . . . . . . . . . 7 65 3.3. Length Self-Description . . . . . . . . . . . . . . . . . 7 66 4. Routing Algorithms . . . . . . . . . . . . . . . . . . . . . 7 67 4.1. Plaintext CID Algorithm . . . . . . . . . . . . . . . . . 9 68 4.1.1. Configuration Agent Actions . . . . . . . . . . . . . 9 69 4.1.2. Load Balancer Actions . . . . . . . . . . . . . . . . 9 70 4.1.3. Server Actions . . . . . . . . . . . . . . . . . . . 9 71 4.2. Obfuscated CID Algorithm . . . . . . . . . . . . . . . . 10 72 4.2.1. Configuration Agent Actions . . . . . . . . . . . . . 10 73 4.2.2. Load Balancer Actions . . . . . . . . . . . . . . . . 10 74 4.2.3. Server Actions . . . . . . . . . . . . . . . . . . . 11 75 4.3. Stream Cipher CID Algorithm . . . . . . . . . . . . . . . 11 76 4.3.1. Configuration Agent Actions . . . . . . . . . . . . . 12 77 4.3.2. Load Balancer Actions . . . . . . . . . . . . . . . . 12 78 4.3.3. Server Actions . . . . . . . . . . . . . . . . . . . 13 79 4.4. Block Cipher CID Algorithm . . . . . . . . . . . . . . . 13 80 4.4.1. Configuration Agent Actions . . . . . . . . . . . . . 14 81 4.4.2. Load Balancer Actions . . . . . . . . . . . . . . . . 14 82 4.4.3. Server Actions . . . . . . . . . . . . . . . . . . . 15 83 5. ICMP Processing . . . . . . . . . . . . . . . . . . . . . . . 15 84 6. Retry Service . . . . . . . . . . . . . . . . . . . . . . . . 15 85 6.1. Common Requirements . . . . . . . . . . . . . . . . . . . 16 86 6.2. No-Shared-State Retry Service . . . . . . . . . . . . . . 16 87 6.2.1. Configuration Agent Actions . . . . . . . . . . . . . 17 88 6.2.2. Service Requirements . . . . . . . . . . . . . . . . 17 89 6.2.3. Server Requirements . . . . . . . . . . . . . . . . . 18 90 6.3. Shared-State Retry Service . . . . . . . . . . . . . . . 19 91 6.3.1. Configuration Agent Actions . . . . . . . . . . . . . 21 92 6.3.2. Service Requirements . . . . . . . . . . . . . . . . 21 93 6.3.3. Server Requirements . . . . . . . . . . . . . . . . . 21 94 7. Configuration Requirements . . . . . . . . . . . . . . . . . 22 95 8. Additional Use Cases . . . . . . . . . . . . . . . . . . . . 23 96 8.1. Load balancer chains . . . . . . . . . . . . . . . . . . 23 97 8.2. Moving connections between servers . . . . . . . . . . . 24 98 9. Version Invariance of QUIC-LB . . . . . . . . . . . . . . . . 24 99 10. Security Considerations . . . . . . . . . . . . . . . . . . . 25 100 10.1. Attackers not between the load balancer and server . . . 25 101 10.2. Attackers between the load balancer and server . . . . . 26 102 10.3. Limited configuration scope . . . . . . . . . . . . . . 26 103 10.4. Stateless Reset Oracle . . . . . . . . . . . . . . . . . 26 104 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 105 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 106 12.1. Normative References . . . . . . . . . . . . . . . . . . 27 107 12.2. Informative References . . . . . . . . . . . . . . . . . 27 108 Appendix A. Load Balancer Test Vectors . . . . . . . . . . . . . 27 109 A.1. Obfuscated Connection ID Algorithm . . . . . . . . . . . 27 110 A.2. Stream Cipher Connection ID Algorithm . . . . . . . . . . 28 111 A.3. Block Cipher Connection ID Algorithm . . . . . . . . . . 29 112 Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 30 113 Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 30 114 C.1. since-draft-ietf-quic-load-balancers-02 . . . . . . . . . 30 115 C.2. since-draft-ietf-quic-load-balancers-01 . . . . . . . . . 30 116 C.3. since-draft-ietf-quic-load-balancers-00 . . . . . . . . . 30 117 C.4. Since draft-duke-quic-load-balancers-06 . . . . . . . . . 30 118 C.5. Since draft-duke-quic-load-balancers-05 . . . . . . . . . 31 119 C.6. Since draft-duke-quic-load-balancers-04 . . . . . . . . . 31 120 C.7. Since draft-duke-quic-load-balancers-03 . . . . . . . . . 31 121 C.8. Since draft-duke-quic-load-balancers-02 . . . . . . . . . 31 122 C.9. Since draft-duke-quic-load-balancers-01 . . . . . . . . . 31 123 C.10. Since draft-duke-quic-load-balancers-00 . . . . . . . . . 32 124 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 126 1. Introduction 128 QUIC packets [QUIC-TRANSPORT] usually contain a connection ID to 129 allow endpoints to associate packets with different address/port 130 4-tuples to the same connection context. This feature makes 131 connections robust in the event of NAT rebinding. QUIC endpoints 132 usually designate the connection ID which peers use to address 133 packets. Server-generated connection IDs create a potential need for 134 out-of-band communication to support QUIC. 136 QUIC allows servers (or load balancers) to designate an initial 137 connection ID to encode useful routing information for load 138 balancers. It also encourages servers, in packets protected by 139 cryptography, to provide additional connection IDs to the client. 140 This allows clients that know they are going to change IP address or 141 port to use a separate connection ID on the new path, thus reducing 142 linkability as clients move through the world. 144 There is a tension between the requirements to provide routing 145 information and mitigate linkability. Ultimately, because new 146 connection IDs are in protected packets, they must be generated at 147 the server if the load balancer does not have access to the 148 connection keys. However, it is the load balancer that has the 149 context necessary to generate a connection ID that encodes useful 150 routing information. In the absence of any shared state between load 151 balancer and server, the load balancer must maintain a relatively 152 expensive table of server-generated connection IDs, and will not 153 route packets correctly if they use a connection ID that was 154 originally communicated in a protected NEW_CONNECTION_ID frame. 156 This specification provides common algorithms for encoding the server 157 mapping in a connection ID given some shared parameters. The mapping 158 is generally only discoverable by observers that have the parameters, 159 preserving unlinkability as much as possible. 161 Aside from load balancing, a QUIC server may also desire to offload 162 other protocol functions to trusted intermediaries. These 163 intermediaries might include hardware assist on the server host 164 itself, without access to fully decrypted QUIC packets. For example, 165 this document specifies a means of offloading stateless retry to 166 counter Denial of Service attacks. It also proposes a system for 167 self-encoding connection ID length in all packets, so that crypto 168 offload can consistently look up key information. 170 While this document describes a small set of configuration parameters 171 to make the server mapping intelligible, the means of distributing 172 these parameters between load balancers, servers, and other trusted 173 intermediaries is out of its scope. There are numerous well-known 174 infrastructures for distribution of configuration. 176 1.1. Terminology 178 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 179 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 180 document are to be interpreted as described in RFC 2119 [RFC2119]. 182 In this document, these words will appear with that interpretation 183 only when in ALL CAPS. Lower case uses of these words are not to be 184 interpreted as carrying significance described in RFC 2119. 186 In this document, "client" and "server" refer to the endpoints of a 187 QUIC connection unless otherwise indicated. A "load balancer" is an 188 intermediary for that connection that does not possess QUIC 189 connection keys, but it may rewrite IP addresses or conduct other IP 190 or UDP processing. A "configuration agent" is the entity that 191 determines the QUIC-LB configuration parameters for the network and 192 leverages some system to distribute that configuration. 194 Note that stateful load balancers that act as proxies, by terminating 195 a QUIC connection with the client and then retrieving data from the 196 server using QUIC or another protocol, are treated as a server with 197 respect to this specification. 199 For brevity, "Connection ID" will often be abbreviated as "CID". 201 2. Protocol Objectives 203 2.1. Simplicity 205 QUIC is intended to provide unlinkability across connection 206 migration, but servers are not required to provide additional 207 connection IDs that effectively prevent linkability. If the 208 coordination scheme is too difficult to implement, servers behind 209 load balancers using connection IDs for routing will use trivially 210 linkable connection IDs. Clients will therefore be forced to choose 211 between terminating the connection during migration or remaining 212 linkable, subverting a design objective of QUIC. 214 The solution should be both simple to implement and require little 215 additional infrastructure for cryptographic keys, etc. 217 2.2. Security 219 In the limit where there are very few connections to a pool of 220 servers, no scheme can prevent the linking of two connection IDs with 221 high probability. In the opposite limit, where all servers have many 222 connections that start and end frequently, it will be difficult to 223 associate two connection IDs even if they are known to map to the 224 same server. 226 QUIC-LB is relevant in the region between these extremes: when the 227 information that two connection IDs map to the same server is helpful 228 to linking two connection IDs. Obviously, any scheme that 229 transparently communicates this mapping to outside observers 230 compromises QUIC's defenses against linkability. 232 Though not an explicit goal of the QUIC-LB design, concealing the 233 server mapping also complicates attempts to focus attacks on a 234 specific server in the pool. 236 3. First CID octet 238 The first octet of a Connection ID is reserved for two special 239 purposes, one mandatory (config rotation) and one optional (length 240 self-description). 242 Subsequent sections of this document refer to the contents of this 243 octet as the "first octet." 245 3.1. Config Rotation 247 The first two bits of any connection-ID MUST encode the configuration 248 phase of that ID. QUIC-LB messages indicate the phase of the 249 algorithm and parameters that they encode. 251 A new configuration may change one or more parameters of the old 252 configuration, or change the algorithm used. 254 It is possible for servers to have mutually exclusive sets of 255 supported algorithms, or for a transition from one algorithm to 256 another to result in Fail Payloads. The four states encoded in these 257 two bits allow two mutually exclusive server pools to coexist, and 258 for each of them to transition to a new set of parameters. 260 When new configuration is distributed to servers, there will be a 261 transition period when connection IDs reflecting old and new 262 configuration coexist in the network. The rotation bits allow load 263 balancers to apply the correct routing algorithm and parameters to 264 incoming packets. 266 Configuration Agents SHOULD make an effort to deliver new 267 configurations to load balancers before doing so to servers, so that 268 load balancers are ready to process CIDs using the new parameters 269 when they arrive. 271 A Configuration Agent SHOULD NOT use a codepoint to represent a new 272 configuration until it takes precautions to make sure that all 273 connections using CIDs with an old configuration at that codepoint 274 have closed or transitioned. 276 Servers MUST NOT generate new connection IDs using an old 277 configuration after receiving a new one from the configuration agent. 278 Servers MUST send NEW_CONNECTION_ID frames that provide CIDS using 279 the new configuration, and retire CIDs using the old configuration 280 using the "Retire Prior To" field of that frame. 282 3.2. Configuration Failover 284 If a server has not received a valid QUIC-LB configuration, and 285 believes that low-state, Connection-ID aware load balancers are in 286 the path, it SHOULD generate connection IDs with the config rotation 287 bits set to '11' and SHOULD use the "disable_migration" transport 288 parameter in all new QUIC connections. It SHOULD NOT send 289 NEW_CONNECTION_ID frames with new values. 291 A load balancer that sees a connection ID with config rotation bits 292 set to '11' MUST revert to 5-tuple routing. 294 3.3. Length Self-Description 296 Local hardware cryptographic offload devices may accelerate QUIC 297 servers by receiving keys from the QUIC implementation indexed to the 298 connection ID. However, on physical devices operating multiple QUIC 299 servers, it is impractical to efficiently lookup these keys if the 300 connection ID does not self-encode its own length. 302 Note that this is a function of particular server devices and is 303 irrelevant to load balancers. As such, load balancers MAY omit this 304 from their configuration. However, the remaining 6 bits in the first 305 octet of the Connection ID are reserved to express the length of the 306 following connection ID, not including the first octet. 308 A server not using this functionality SHOULD make the six bits appear 309 to be random. 311 4. Routing Algorithms 313 In QUIC-LB, load balancers do not generate individual connection IDs 314 to servers. Instead, they communicate the parameters of an algorithm 315 to generate routable connection IDs. 317 The algorithms differ in the complexity of configuration at both load 318 balancer and server. Increasing complexity improves obfuscation of 319 the server mapping. 321 As clients sometimes generate the DCIDs in long headers, these might 322 not conform to the expectations of the routing algorithm. These are 323 called "non-compliant DCIDs": 325 * The DCID might not be long enough for the routing algorithm to 326 process. 328 * The extracted server mapping might not correspond to an active 329 server. 331 * A field that should be all zeroes after decryption may not be so. 333 Load balancers MUST forward packets with long headers with non- 334 compliant DCIDs to an active server using an algorithm of its own 335 choosing. It need not coordinate this algorithm with the servers. 336 The algorithm SHOULD be deterministic over short time scales so that 337 related packets go to the same server. The design of this algorithm 338 SHOULD consider the version-invariant properties of QUIC described in 339 [QUIC-INVARIANTS] to maximize its robustness to future versions of 340 QUIC. For example, a non-compliant DCID might be converted to an 341 integer and divided by the number of servers, with the modulus used 342 to forward the packet. The number of servers is usually consistent 343 on the time scale of a QUIC connection handshake. See also 344 Section 9. 346 As a partial exception to the above, load balancers MAY drop packets 347 with long headers and non-compliant DCIDs if and only if it knows 348 that the encoded QUIC version does not allow a non-compliant DCID in 349 a packet with that signature. For example, a load balancer can 350 safely drop a QUIC version 1 Handshake packet with a non-compliant 351 DCIDs. The prohibition against dropping packets with long headers 352 remains for unknown QUIC versions. 354 Load balancers SHOULD drop packets with non-compliant DCIDs in a 355 short header. 357 A QUIC-LB configuration MAY significantly over-provision the server 358 ID space (i.e., provide far more codepoints than there are servers) 359 to increase the probability that a randomly generated Destination 360 Connection ID is non- compliant. 362 Load balancers MUST forward packets with compliant DCIDs to a server 363 in accordance with the chosen routing algorithm. 365 The load balancer MUST NOT make the routing behavior dependent on any 366 bits in the first octet of the QUIC packet header, except the first 367 bit, which indicates a long header. All other bits are QUIC version- 368 dependent and intermediaries would cannot build their design on 369 version-specific templates. 371 There are situations where a server pool might be operating two or 372 more routing algorithms or parameter sets simultaneously. The load 373 balancer uses the first two bits of the connection ID to multiplex 374 incoming DCIDs over these schemes. 376 This section describes three participants: the configuration agent, 377 the load balancer, and the server. 379 4.1. Plaintext CID Algorithm 381 The Plaintext CID Algorithm makes no attempt to obscure the mapping 382 of connections to servers, significantly increasing linkability. The 383 format is depicted in the figure below. 385 0 1 2 3 386 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 387 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 388 | First octet | Server ID (X=8..152) | 389 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 390 | Any (0..152-X) | 391 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 393 Figure 1: Plaintext CID Format 395 4.1.1. Configuration Agent Actions 397 The configuration agent selects a number of bytes of the server 398 connection ID to encode individual server IDs, called the "routing 399 bytes". The number of bytes MUST have enough entropy to have a 400 different code point for each server. 402 It also assigns a server ID to each server. 404 4.1.2. Load Balancer Actions 406 On each incoming packet, the load balancer extracts consecutive 407 octets, beginning with the second octet. These bytes represent the 408 server ID. 410 4.1.3. Server Actions 412 The server chooses a connection ID length. This MUST be at least one 413 byte longer than the routing bytes. 415 When a server needs a new connection ID, it encodes its assigned 416 server ID in consecutive octets beginning with the second. All other 417 bits in the connection ID, except for the first octet, MAY be set to 418 any other value. These other bits SHOULD appear random to observers. 420 4.2. Obfuscated CID Algorithm 422 The Obfuscated CID Algorithm makes an attempt to obscure the mapping 423 of connections to servers to reduce linkability, while not requiring 424 true encryption and decryption. The format is depicted in the figure 425 below. 427 0 1 2 3 428 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 429 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 430 | First octet | Mixed routing and non-routing bits (64..152) | 431 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 433 Figure 2: Obfuscated CID Format 435 4.2.1. Configuration Agent Actions 437 The configuration agent selects an arbitrary set of bits of the 438 server connection ID that it will use to route to a given server, 439 called the "routing bits". The number of bits MUST have enough 440 entropy to have a different code point for each server, and SHOULD 441 have enough entropy so that there are many codepoints for each 442 server. 444 The configuration agent MUST NOT select a routing mask with more than 445 136 routing bits set to 1, which allows for the first octet and up to 446 2 octets for server purposes in a maximum-length connection ID. 448 The configuration agent selects a divisor that MUST be larger than 449 the number of servers. It SHOULD be large enough to accommodate 450 reasonable increases in the number of servers. The divisor MUST be 451 an odd integer so certain addition operations do not always produce 452 an even number. 454 The configuration agent also assigns each server a "modulus", an 455 integer between 0 and the divisor minus 1. These MUST be unique for 456 each server, and SHOULD be distributed across the entire number space 457 between zero and the divisor. 459 4.2.2. Load Balancer Actions 461 Upon receipt of a QUIC packet, the load balancer extracts the 462 selected bits of the Server CID and expresses them as an unsigned 463 integer of that length. The load balancer then divides the result by 464 the chosen divisor. The modulus of this operation maps to the 465 modulus for the destination server. 467 Note that any Server CID that contains a server's modulus, plus an 468 arbitrary integer multiple of the divisor, in the routing bits is 469 routable to that server regardless of the contents of the non-routing 470 bits. Outside observers that do not know the divisor or the routing 471 bits will therefore have difficulty identifying that two Server CIDs 472 route to the same server. 474 Note also that not all Connection IDs are necessarily routable, as 475 the computed modulus may not match one assigned to any server. These 476 DCIDs are non-compliant as described above. 478 4.2.3. Server Actions 480 The server chooses a connection ID length. This MUST contain all of 481 the routing bits and MUST be at least 9 octets to provide adequate 482 entropy. 484 When a server needs a new connection ID, it adds an arbitrary 485 nonnegative integer multiple of the divisor to its modulus, without 486 exceeding the maximum integer value implied by the number of routing 487 bits. The choice of multiple should appear random within these 488 constraints. 490 The server encodes the result in the routing bits. It MAY put any 491 other value into bits that used neither for routing nor config 492 rotation. These bits SHOULD appear random to observers. 494 4.3. Stream Cipher CID Algorithm 496 The Stream Cipher CID algorithm provides true cryptographic 497 protection, rather than mere obfuscation, at the cost of additional 498 per-packet processing at the load balancer to decrypt every incoming 499 connection ID. The CID format is depicted below. 501 0 1 2 3 502 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 503 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 504 | First Octet | Nonce (X=64..128) | 505 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 506 | Encrypted Server ID (Y=8..152-X) | 507 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 508 | For server use (0..152-X-Y) | 509 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 511 Figure 3: Stream Cipher CID Format 513 4.3.1. Configuration Agent Actions 515 The configuration agent assigns a server ID to every server in its 516 pool, and determines a server ID length (in octets) sufficiently 517 large to encode all server IDs, including potential future servers. 519 The configuration agent also selects a nonce length and an 16-octet 520 AES-ECB key to use for connection ID decryption. The nonce length 521 MUST be at least 8 octets and no more than 16 octets. The nonce 522 length and server ID length MUST sum to 19 or fewer octets. 524 4.3.2. Load Balancer Actions 526 Upon receipt of a QUIC packet, the load balancer extracts as many of 527 the earliest octets from the destination connection ID as necessary 528 to match the nonce length. The server ID immediately follows. 530 The load balancer decrypts the nonce and the server ID using the 531 following three pass algorithm: 533 * Pass 1: The load balancer decrypts the server ID using 128-bit AES 534 Electronic Codebook (ECB) mode, much like QUIC header protection. 535 The encrypted nonce octets are zero-padded to 16 octets. AES-ECB 536 encrypts this encrypted nonce using its key to generate a mask 537 which it applies to the encrypted server id. This provides an 538 intermediate value of the server ID, referred to as server-id 539 intermediate. 541 server_id_intermediate = encrypted_server_id ^ AES-ECB(key, padded- 542 encrypted-nonce) 544 * Pass 2: The load balancer decrypts the nonce octets using 128-bit 545 AES ECB mode, using the server-id intermediate as "nonce" for this 546 pass. The server-id intermediate octets are zero-padded to 16 547 octets. AES-ECB encrypts this padded server-id intermediate using 548 its key to generate a mask which it applies to the encrypted 549 nonce. This provides the decrypted nonce value. 551 nonce = encrypted_nonce ^ AES-ECB(key, padded-server_id_intermediate) 553 * Pass 3: The load balancer decrypts the server ID using 128-bit AES 554 ECB mode. The nonce octets are zero-padded to 16 octets. AES-ECB 555 encrypts this nonce using its key to generate a mask which it 556 applies to the intermediate server id. This provides the 557 decrypted server ID. 559 server_id = server_id_intermediate ^ AES-ECB(key, padded-nonce) 560 For example, if the nonce length is 10 octets and the server ID 561 length is 2 octets, the connection ID can be as small as 13 octets. 562 The load balancer uses the the second through eleventh octets of the 563 connection ID for the nonce, zero-pads it to 16 octets, uses xors the 564 result with the twelfth and thirteenth octet. The result is padded 565 with 14 octets of zeros and encrypted to obtain a mask that is xored 566 with the nonce octets. Finally, the nonce octets are padded with six 567 octets of zeros, encrypted, and the first two octets xored with the 568 server ID octets to obtain the actual server ID. 570 This three-pass algorithm is a simplified version of the FFX 571 algorithm, with the property that each encrypted nonce value depends 572 on all server ID bits, and each encrypted server ID bit depends on 573 all nonce bits and all server ID bits. This mitigates attacks 574 against stream ciphers in which attackers simply flip encrypted 575 server-ID bits. 577 The output of the decryption is the server ID that the load balancer 578 uses for routing. 580 4.3.3. Server Actions 582 When generating a routable connection ID, the server writes arbitrary 583 bits into its nonce octets, and its provided server ID into the 584 server ID octets. Servers MAY opt to have a longer connection ID 585 beyond the nonce and server ID. The additional bits MAY encode 586 additional information, but SHOULD appear essentially random to 587 observers. 589 If the decrypted nonce bits increase monotonically, that guarantees 590 that nonces are not reused between connection IDs from the same 591 server. 593 The server encrypts the server ID using exactly the algorithm as 594 described in Section 4.3.2, performing the three passes in reverse 595 order. 597 4.4. Block Cipher CID Algorithm 599 The Block Cipher CID Algorithm, by using a full 16 octets of 600 plaintext and a 128-bit cipher, provides higher cryptographic 601 protection and detection of non-compliant connection IDs. However, 602 it also requires connection IDs of at least 17 octets, increasing 603 overhead of client-to-server packets. 605 0 1 2 3 606 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 607 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 608 | First octet | Encrypted server ID (X=8..128) | 609 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 610 | Encrypted Zero Padding (Y=0..128-X) | 611 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 612 | Encrypted bits for server use (128-X-Y) | 613 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 614 | Unencrypted bits for server use (0..24) | 615 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 617 Figure 4: Block Cipher CID Format 619 4.4.1. Configuration Agent Actions 621 The configuration agent assigns a server ID to every server in its 622 pool, and determines a server ID length (in octets) sufficiently 623 large to encode all server IDs, including potential future servers. 624 The server ID will start in the second octet of the decrypted 625 connection ID and occupy continuous octets beyond that. 627 The configuration agent selects a zero-padding length. This SHOULD 628 be at least four octets to allow detection of non-compliant DCIDs. 629 The server ID and zero- padding length MUST sum to no more than 16 630 octets. They SHOULD sum to no more than 12 octets, to provide 631 servers adequate space to encode their own opaque data. 633 The configuration agent also selects an 16-octet AES-ECB key to use 634 for connection ID decryption. 636 4.4.2. Load Balancer Actions 638 Upon receipt of a QUIC packet, the load balancer reads the first 639 octet to obtain the config rotation bits. It then decrypts the 640 subsequent 16 octets using AES-ECB decryption and the chosen key. 642 The decrypted plaintext contains the server id, zero padding, and 643 opaque server data in that order. The load balancer uses the server 644 ID octets for routing. 646 4.4.3. Server Actions 648 When generating a routable connection ID, the server MUST choose a 649 connection ID length between 17 and 20 octets. The server writes its 650 provided server ID into the server ID octets, zeroes into the zero- 651 padding octets, and arbitrary bits into the remaining bits. These 652 arbitrary bits MAY encode additional information. Bits in the first, 653 eighteenth, nineteenth, and twentieth octets SHOULD appear 654 essentially random to observers. The first octet is reserved as 655 described in Section 3. 657 The server then encrypts the second through seventeenth octets using 658 the 128-bit AES-ECB cipher. 660 5. ICMP Processing 662 For protocols where 4-tuple load balancing is sufficient, it is 663 straightforward to deliver ICMP packets from the network to the 664 correct server, by reading the IP and transport-layer headers to 665 obtain the 4-tuple. When routing is based on connection ID, further 666 measures are required, as most QUIC packets that trigger ICMP 667 responses will only contain a client-generated connection ID that 668 contains no routing information. 670 To solve this problem, load balancers MAY maintain a mapping of 671 Client IP and port to server ID based on recently observed packets. 673 Alternatively, servers MAY implement the technique described in 674 Section 14.4.1 of [QUIC-TRANSPORT] to increase the likelihood a 675 Source Connection ID is included in ICMP responses to Path Maximum 676 Transmission Unit (PMTU) probes. Load balancers MAY parse the echoed 677 packet to extract the Source Connection ID, if it contains a QUIC 678 long header, and extract the Server ID as if it were in a Destination 679 CID. 681 6. Retry Service 683 When a server is under load, QUICv1 allows it to defer storage of 684 connection state until the client proves it can receive packets at 685 its advertised IP address. Through the use of a Retry packet, a 686 token in subsequent client Initial packets, and the 687 original_destination_connection_id transport parameter, servers 688 verify address ownership and clients verify that there is no "man in 689 the middle" generating Retry packets. 691 As a trusted Retry Service is literally a "man in the middle," the 692 service must communicate the original_destination_connection_id back 693 to the server so that it can pass client verification. It also must 694 either verify the address itself (with the server trusting this 695 verification) or make sure there is common context for the server to 696 verify the address using a service-generated token. 698 The service must also communicate the source connection ID of the 699 Retry packet to the server so that it can include it in a transport 700 parameter for client verification. 702 There are two different mechanisms to allow offload of DoS mitigation 703 to a trusted network service. One requires no shared state; the 704 server need only be configured to trust a retry service, though this 705 imposes other operational constraints. The other requires shared 706 key, but has no such constraints. 708 Retry services MUST forward all QUIC packets that are not of type 709 Initial or 0-RTT. Other packets types might involve changed IP 710 addresses or connection IDs, so it is not practical for Retry 711 Services to identify such packets as valid or invalid. 713 6.1. Common Requirements 715 Regardless of mechanism, a retry service has an active mode, where it 716 is generating Retry packets, and an inactive mode, where it is not, 717 based on its assessment of server load and the likelihood an attack 718 is underway. The choice of mode MAY be made on a per-packet or per- 719 connection basis, through a stochastic process or based on client 720 address. 722 A retry service MUST forward all packets for a QUIC version it does 723 not understand. Note that if servers support versions the retry 724 service does not, this may increase load on the servers. However, 725 dropping these packets would introduce chokepoints to block 726 deployment of new QUIC versions. Note that future versions of QUIC 727 might not have Retry packets, require different information in Retry, 728 or use different packet type indicators. 730 6.2. No-Shared-State Retry Service 732 The no-shared-state retry service requires no coordination, except 733 that the server must be configured to accept this service and know 734 which QUIC versions the retry service supports. The scheme uses the 735 first bit of the token to distinguish between tokens from Retry 736 packets (codepoint '0') and tokens from NEW_TOKEN frames (codepoint 737 '1'). 739 6.2.1. Configuration Agent Actions 741 The configuration agent distributes a list of QUIC versions to be 742 served by the Retry Service. 744 6.2.2. Service Requirements 746 A no-shared-state retry service MUST be present on all paths from 747 potential clients to the server. These paths MUST fail to pass QUIC 748 traffic should the service fail for any reason. That is, if the 749 service is not operational, the server MUST NOT be exposed to client 750 traffic. Otherwise, servers that have already disabled their Retry 751 capability would be vulnerable to attack. 753 The path between service and server MUST be free of any potential 754 attackers. Note that this and other requirements above severely 755 restrict the operational conditions in which a no-shared-state retry 756 service can safely operate. 758 Retry tokens generated by the service MUST have the format below. 760 0 1 2 3 761 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 762 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 763 |0| ODCIL (7) | RSCIL (8) | 764 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 765 | Original Destination Connection ID (0..160) | 766 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 767 | ... | 768 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 769 | Retry Source Connection ID (0..160) | 770 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 771 | ... | 772 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 773 | Opaque Data (variable) | 774 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 776 Figure 5: Format of non-shared-state retry service tokens 778 The first bit of retry tokens generated by the service MUST be zero. 779 The token has the following additional fields: 781 ODCIL: The length of the original destination connection ID from the 782 triggering Initial packet. This is in cleartext to be readable for 783 the server, but authenticated later in the token. 785 RSCIL: The retry source connection ID length. 787 Original Destination Connection ID: This also in cleartext and 788 authenticated later. 790 Retry Source Connection ID: This also in cleartext and authenticated 791 later. 793 Opaque Data: This data MUST contain encrypted information that allows 794 the retry service to validate the client's IP address, in accordance 795 with the QUIC specification. It MUST also provide a 796 cryptographically secure means to validate the integrity of the 797 entire token. 799 Upon receipt of an Initial packet with a token that begins with '0', 800 the retry service MUST validate the token in accordance with the QUIC 801 specification. 803 In active mode, the service MUST issue Retry packets for all Client 804 initial packets that contain no token, or a token that has the first 805 bit set to '1'. It MUST NOT forward the packet to the server. The 806 service MUST validate all tokens with the first bit set to '0'. If 807 successful, the service MUST forward the packet with the token 808 intact. If unsuccessful, it MUST drop the packet. The Retry Service 809 MAY send an Initial Packet containing a CONNECTION_CLOSE frame with 810 the INVALID_TOKEN error code when dropping the packet. 812 Note that this scheme has a performance drawback. When the retry 813 service is in active mode, clients with a token from a NEW_TOKEN 814 frame will suffer a 1-RTT penalty even though it has proof of address 815 with its token. 817 In inactive mode, the service MUST forward all packets that have no 818 token or a token with the first bit set to '1'. It MUST validate all 819 tokens with the first bit set to '0'. If successful, the service 820 MUST forward the packet with the token intact. If unsuccessful, it 821 MUST either drop the packet or forward it with the token removed. 822 The latter requires decryption and re-encryption of the entire 823 Initial packet to avoid authentication failure. Forwarding the 824 packet causes the server to respond without the 825 original_destination_connection_id transport parameter, which 826 preserves the normal QUIC signal to the client that there is an 827 unauthorized man in the middle. 829 6.2.3. Server Requirements 831 A server behind a non-shared-state retry service MUST NOT send Retry 832 packets for a QUIC version the retry service understands. It MAY 833 send Retry for QUIC versions the Retry Service does not understand. 835 Tokens sent in NEW_TOKEN frames MUST have the first bit be set to 836 '1'. 838 If a server receives an Initial Packet with the first bit set to '1', 839 it could be from a server-generated NEW_TOKEN frame and should be 840 processed in accordance with the QUIC specification. If a server 841 receives an Initial Packet with the first bit to '0', it is a Retry 842 token and the server MUST NOT attempt to validate it. Instead, it 843 MUST assume the address is validated and MUST extract the Original 844 Destination Connection ID and Retry Source Connection ID, assuming 845 the format described in Section 6.2.2. 847 6.3. Shared-State Retry Service 849 A shared-state retry service uses a shared key, so that the server 850 can decode the service's retry tokens. It does not require that all 851 traffic pass through the Retry service, so servers MAY send Retry 852 packets in response to Initial packets that don't include a valid 853 token. 855 Both server and service must have access to Universal time, though 856 tight synchronization is not necessary. 858 All tokens, generated by either the server or retry service, MUST use 859 the following format. This format is the cleartext version. On the 860 wire, these fields are encrypted using an AES-ECB cipher and the 861 token key. If the token is not a multiple of 16 octets, the last 862 block is padded with zeroes. 864 0 1 2 3 865 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 866 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 867 | ODCIL | RSCIL | 868 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 869 | Original Destination Connection ID (0..160) | 870 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 871 | ... | 872 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 873 | Retry Source Connection ID (0..160) | 874 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 875 | ... | 876 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 877 | | 878 + + 879 | | 880 + Client IP Address (128) + 881 | | 882 + + 883 | | 884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 885 | | 886 + + 887 | | 888 + + 889 | date-time (160) | 890 + + 891 | | 892 + + 893 | | 894 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 895 | Opaque Data (optional) | 896 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 898 Figure 6: Cleartext format of shared-state retry tokens 900 The tokens have the following fields: 902 ODCIL: The original destination connection ID length. Tokens in 903 NEW_TOKEN frames MUST set this field to zero. 905 RSCIL: The retry source connection ID length. Tokens in NEW_TOKEN 906 frames MUST set this field to zero. 908 Original Destination Connection ID: The server or Retry Service 909 copies this from the field in the client Initial packet. 911 Retry Source Connection ID: The server or Retry service copies this 912 from the Source Connection ID of the Retry packet. 914 Client IP Address: The source IP address from the triggering Initial 915 packet. The client IP address is 16 octets. If an IPv4 address, the 916 last 12 octets are zeroes. 918 date-time: The date-time string is a total of 20 octets and encodes 919 the time the token was generated. The format of date-time is 920 described in Section 5.6 of [RFC3339]. This ASCII field MUST use the 921 "Z" character for time-offset. 923 Opaque Data: The server may use this field to encode additional 924 information, such as congestion window, RTT, or MTU. Opaque data 925 SHOULD also allow servers to distinguish between retry tokens (which 926 trigger use of the original_destination_connection_id transport 927 parameter) and NEW_TOKEN frame tokens. 929 6.3.1. Configuration Agent Actions 931 The configuration agent generates and distributes a "token key." 933 6.3.2. Service Requirements 935 When in active mode, the service MUST generate Retry tokens with the 936 format described above when it receives a client Initial packet with 937 no token. 939 In active mode, the service SHOULD decrypt incoming tokens. The 940 service SHOULD drop packets with an IP address that does not match, 941 and SHOULD forward packets that do, regardless of the other fields. 943 In inactive mode, the service SHOULD forward all packets to the 944 server so that the server can issue an up-to-date token to the 945 client. 947 6.3.3. Server Requirements 949 The server MUST validate all tokens that arrive in Initial packets, 950 as they may have bypassed the Retry service. It SHOULD use the date- 951 time field to apply its expiration limits for tokens. This need not 952 be synchronized with the retry service. However, servers MAY allow 953 retry tokens marked as being a few seconds in the future, due to 954 possible clock synchronization issues. 956 After decrypting the token, the server uses the corresponding fields 957 to populate the original_destination_connection_id transport 958 parameter, with a length equal to ODCIL, and the 959 retry_source_connection_id transport parameter, with length equal to 960 RSCIL. 962 As discussed in [QUIC-TRANSPORT], a server MUST NOT send a Retry 963 packet in response to an Initial packet that contains a retry token. 965 7. Configuration Requirements 967 QUIC-LB requires common configuration to synchronize understanding of 968 encodings and guarantee explicit consent of the server. 970 The load balancer and server MUST agree on a routing algorithm and 971 the relevant parameters for that algorithm. 973 For Plaintext CID Routing, this consists of the Server ID and the 974 routing bytes. The Server ID is unique to each server, and the 975 routing bytes are global. 977 For Obfuscated CID Routing, this consists of the Routing Bits, 978 Divisor, and Modulus. The Modulus is unique to each server, but the 979 others MUST be global. 981 For Stream Cipher CID Routing, this consists of the Server ID, Server 982 ID Length, Key, and Nonce Length. The Server ID is unique to each 983 server, but the others MUST be global. The authentication token MUST 984 be distributed out of band for this algorithm to operate. 986 For Block Cipher CID Routing, this consists of the Server ID, Server 987 ID Length, Key, and Zero-Padding Length. The Server ID is unique to 988 each server, but the others MUST be global. 990 A full QUIC-LB configuration MUST also specify the information 991 content of the first CID octet and the presence and mode of any Retry 992 Service. 994 The following pseudocode describes the data items necessary to store 995 a full QUIC-LB configuration at the server. It is meant to describe 996 the conceptual range and not specify the presentation of such 997 configuration in an internet packet. The comments signify the range 998 of acceptable values where applicable. 1000 uint2 config_rotation_bits; 1001 boolean first_octet_encodes_cid_length; 1002 enum { none, non_shared_state, shared_state } retry_service; 1003 select (retry_service) { 1004 case none: null; 1005 case non_shared_state: uint32 list_of_quic_versions[]; 1006 case shared_state: uint8 key[16]; 1007 } retry_service_config; 1008 enum { none, plaintext, obfuscated, stream_cipher, block_cipher } 1009 routing_algorithm; 1010 select (routing_algorithm) { 1011 case none: null; 1012 case plaintext: struct { 1013 uint8 server_id_length; /* 1..19 */ 1014 uint8 server_id[server_id_length]; 1015 } plaintext_config; 1016 case obfuscated: struct { 1017 uint8 routing_bit_mask[19]; 1018 uint16 divisor; /* Must be odd */ 1019 uint16 modulus; /* 0..(divisor - 1) */ 1020 } obfuscated_config; 1021 case stream_cipher: struct { 1022 uint8 nonce_length; /* 8..16 */ 1023 uint8 server_id_length; /* 1..(19 - nonce_length) */ 1024 uint8 server_id[server_id_length]; 1025 uint8 key[16]; 1026 } stream_cipher_config; 1027 case block_cipher: struct { 1028 uint8 server_id_length; 1029 uint8 zero_padding_length; /* 0..(16 - server_id_length) */ 1030 uint8 server_id[server_id_length]; 1031 uint8 key[16]; 1032 } block_cipher_config; 1033 } routing_algorithm_config; 1035 8. Additional Use Cases 1037 This section discusses considerations for some deployment scenarios 1038 not implied by the specification above. 1040 8.1. Load balancer chains 1042 Some network architectures may have multiple tiers of low-state load 1043 balancers, where a first tier of devices makes a routing decision to 1044 the next tier, and so on until packets reach the server. Although 1045 QUIC-LB is not explicitly designed for this use case, it is possible 1046 to support it. 1048 If each load balancer is assigned a range of server IDs that is a 1049 subset of the range of IDs assigned to devices that are closer to the 1050 client, then the first devices to process an incoming packet can 1051 extract the server ID and then map it to the correct forwrading 1052 address. Note that this solution is extensible to arbitrarily large 1053 numbers of load-balancing tiers, as the maximum server ID space is 1054 quite large. 1056 8.2. Moving connections between servers 1058 Some deployments may transparently move a connection from one server 1059 to another. The means of transferring connection state between 1060 servers is out of scope of this document. 1062 To support a handover, a server involved in the transition could 1063 issue CIDs that map to the new server via a NEW_CONNECTION_ID frame, 1064 and retire CIDs associated with the new server using the "Retire 1065 Prior To" field in that frame. 1067 Alternately, if the old server is going offline, the load balancer 1068 could simply map its server ID to the new server's address. 1070 9. Version Invariance of QUIC-LB 1072 Retry Services are inherently dependent on the format (and existence) 1073 of Retry Packets in each version of QUIC, and so Retry Service 1074 configuration explicitly includes the supported QUIC versions. 1076 The server ID encodings, and requirements for their handling, are 1077 designed to be QUIC version independent (see [QUIC-INVARIANTS]). A 1078 QUIC-LB load balancer will generally not require changes as servers 1079 deploy new versions of QUIC. However, there are several unlikely 1080 future design decisions that could impact the operation of QUIC-LB. 1082 The maximum Connection ID length could be below the minimum necessary 1083 for one or more encoding algorithms. 1085 Section 4 provides guidance about how load balancers should handle 1086 non-compliant DCIDs. This guidance, and the implementation of an 1087 algorithm to handle these DCIDs, rests on some assumptions: 1089 * Incoming short headers do not contain DCIDs that are client- 1090 generated. 1092 * The use of client-generated incoming DCIDs does not persist beyond 1093 a few round trips in the connection. 1095 * While the client is using DCIDs it generated, some exposed fields 1096 (IP address, UDP port, client-generated destination Connection ID) 1097 remain constant for all packets sent on the same connection. 1099 While this document does not update the commitments in 1100 [QUIC-INVARIANTS], the additional assumptions are minimal and 1101 narrowly scoped, and provide a likely set of constants that load 1102 balancers can use with minimal risk of version- dependence. 1104 If these assumptions are invalid, this specification is likely to 1105 lead to loss of packets that contain non-compliant DCIDs, and in 1106 extreme cases connection failure. 1108 10. Security Considerations 1110 QUIC-LB is intended to prevent linkability. Attacks would therefore 1111 attempt to subvert this purpose. 1113 Note that the Plaintext CID algorithm makes no attempt to obscure the 1114 server mapping, and therefore does not address these concerns. It 1115 exists to allow consistent CID encoding for compatibility across a 1116 network infrastructure, which makes QUIC robust to NAT rebinding. 1117 Servers that are running the Plaintext CID algorithm SHOULD only use 1118 it to generate new CIDs for the Server Initial Packet and SHOULD NOT 1119 send CIDs in QUIC NEW_CONNECTION_ID frames, except that it sends one 1120 new Connection ID in the event of config rotation Section 3.1. Doing 1121 so might falsely suggest to the client that said CIDs were generated 1122 in a secure fashion. 1124 A linkability attack would find some means of determining that two 1125 connection IDs route to the same server. As described above, there 1126 is no scheme that strictly prevents linkability for all traffic 1127 patterns, and therefore efforts to frustrate any analysis of server 1128 ID encoding have diminishing returns. 1130 10.1. Attackers not between the load balancer and server 1132 Any attacker might open a connection to the server infrastructure and 1133 aggressively simulate migration to obtain a large sample of IDs that 1134 map to the same server. It could then apply analytical techniques to 1135 try to obtain the server encoding. 1137 The Stream and Block Cipher CID algorithms provide robust entropy to 1138 making any sort of linkage. The Obfuscated CID obscures the mapping 1139 and prevents trivial brute-force attacks to determine the routing 1140 parameters, but does not provide robust protection against 1141 sophisticated attacks. 1143 Were this analysis to obtain the server encoding, then on-path 1144 observers might apply this analysis to correlating different client 1145 IP addresses. 1147 10.2. Attackers between the load balancer and server 1149 Attackers in this privileged position are intrinsically able to map 1150 two connection IDs to the same server. The QUIC-LB algorithms do 1151 prevent the linkage of two connection IDs to the same individual 1152 connection if servers make reasonable selections when generating new 1153 IDs for that connection. 1155 10.3. Limited configuration scope 1157 A simple deployment of QUIC-LB in a cloud provider might use the same 1158 global QUIC-LB configuration across all its load balancers that route 1159 to customer servers. An attacker could then simply become a 1160 customer, obtain the configuration, and then extract server IDs of 1161 other customers' connections at will. 1163 To avoid this, the configuration agent SHOULD issue QUIC-LB 1164 configurations to mutually distrustful servers that have different 1165 keys (for the block cipher or stream cipher algorithms) or routing 1166 masks and divisors (for the obfuscated algorithm). The load 1167 balancers can distinguish these configurations by external IP 1168 address, or by assigning different values to the config rotation bits 1169 (Section 3.1). Note that either of these techniques exposes 1170 information to outside observers, as traffic destined for each server 1171 set can be easily distinguished. 1173 These techniques are not necessary for the plaintext algorithm, as it 1174 does not attempt to conceal the server ID. 1176 10.4. Stateless Reset Oracle 1178 Section 21.9 of [QUIC-TRANSPORT] discusses the Stateless Reset Oracle 1179 attack. For a server deployment to be vulnerable, an attacking 1180 client must be able to cause two packets with the same Destination 1181 CID to arrive at two different servers that share the same 1182 cryptographic context for Stateless Reset tokens. As QUIC-LB 1183 requires deterministic routing of DCIDs over the life of a 1184 connection, it is a sufficient means of avoiding an Oracle without 1185 additional measures. 1187 11. IANA Considerations 1189 There are no IANA requirements. 1191 12. References 1193 12.1. Normative References 1195 [QUIC-INVARIANTS] 1196 Thomson, M., Ed., "Version-Independent Properties of 1197 QUIC", Work in Progress, Internet-Draft, draft-ietf-quic- 1198 invariants, 1199 . 1201 [QUIC-TRANSPORT] 1202 Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 1203 Multiplexed and Secure Transport", Work in Progress, 1204 Internet-Draft, draft-ietf-quic-transport, 1205 . 1207 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1208 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 1209 . 1211 12.2. Informative References 1213 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1214 Requirement Levels", BCP 14, RFC 2119, 1215 DOI 10.17487/RFC2119, March 1997, 1216 . 1218 Appendix A. Load Balancer Test Vectors 1220 Because any connection ID encoding in this specification includes 1221 many bits for server use without affecting extraction of the server 1222 ID, there are many possible connection IDs for any given set of 1223 parameters. However, every connection ID should result in a unique 1224 server ID. The following connection IDs can be used to verify that a 1225 load balancer implementation extracts the correct server ID. 1227 A.1. Obfuscated Connection ID Algorithm 1229 The following section lists a set of OCID load balancer 1230 configuration, followed by five CIDs from which the load balancer can 1231 extract the server ID. 1233 cr_bits 0x0 length_self_encoding: y bitmask ddc2f17788d77e3239b4ea 1234 divisor 345 1235 cid 0b72715d4745ce26cca8c750 sid b 1236 cid 0b63a1785b6c0b0857225e96 sid 3f 1237 cid 0b66474fa11329e6bb947818 sid 147 1238 cid 0b34bd7c0882deb0252e2a58 sid ca 1239 cid 0b0506ee792163bf9330dc0a sid 14d 1241 cr_bits 0x1 length_self_encoding: n bitmask 1242 4855d35f5b88ddada153af61b6707ee646 divisor 301 1244 cid 542dc4c09e2d548e508dc825bbbca991c131 sid 8 1245 cid 47988071f9f03a25c322cc6fb1d57151d26f sid 93 1246 cid 6a13e05071f74cdb7d0dc24d72687b21e1d1 sid c0 1247 cid 4323c129650c7ee66f37266044ef52e74ffa sid 60 1248 cid 5e95f77e7e66891b57c224c5781c8c5dd8ba sid 8f 1250 cr_bits 0x0 length_self_encoding: y bitmask 9f98bd3df66338c2d2c6 1251 divisor 459 1253 cid 0ad52216e7798c28340fd6 sid 125 1254 cid 0a78f8ecbd087083639f94 sid 4b 1255 cid 0ac7e70a5fe6b353b824aa sid 12 1256 cid 0af9612ae5ccba3ef98b81 sid d1 1257 cid 0a94ab209ea1d2e1e23751 sid 5d 1259 cr_bits 0x2 length_self_encoding: n bitmask dfba93c4f98f57103f5ae331 1260 divisor 461 1262 cid 8b70b8c69e40ef2f3f8937e817 sid d3 1263 cid b1828830ea1789dab13a043795 sid 44 1264 cid 90604a580baa3eb0a47812e490 sid 137 1265 cid a5b4bc309337ff73e143ff6deb sid 9f 1266 cid fce75c0a984a79d3b4af40d155 sid 127 1268 cr_bits 0x0 length_self_encoding: y bitmask 8320fefc5309f7aa670476 1269 divisor 379 1271 cid 0bb110af53dca7295e7d4b7e sid 101 1272 cid 0b0d284cdff364a634a4b93b sid e3 1273 cid 0b82ff1555c4a95f9b198090 sid 14e 1274 cid 0b7a427d3e508ad71e98b797 sid 14e 1275 cid 0b71d1d4e3e3cd54d435b3fd sid eb 1277 A.2. Stream Cipher Connection ID Algorithm 1279 TBD 1281 A.3. Block Cipher Connection ID Algorithm 1283 Like the previous section, the text below lists a set of load 1284 balancer configuration and 5 CIDs generated with that configuration. 1286 cr_bits 0x0 length_self_encoding: y sid_len 1 zp_len 11 key 1287 8c24cb9b9c3289b4ee63c3f3d7f93a9a 1289 cid: 1378e44f874642624fa69e7b4aec15a2a678b8b5 sid: 48 1290 cid: 13772c82fe8ce6a00813f76a211b730eb4b20363 sid: 66 1291 cid: 135ccf507b1c209457f80df0217b9a1df439c4b2 sid: 30 1292 cid: 13898459900426c073c66b1001c867f9098a7aab sid: fe 1293 cid: 1397a18da00bf912f20049d9f0a007444f8b6699 sid: 30 1295 cr_bits 0x0 length_self_encoding: n sid_len 2 zp_len 10 key 1296 cc7ec42794664a8428250c12a7fb16fa 1298 cid: 0cb28bfc1f65c3de14752bc0fc734ef824ce8f78 sid: 33fa 1299 cid: 2345e9fc7a7be55b4ba1ff6ffa04f3f5f8c67009 sid: ee47 1300 cid: 0d32102be441600f608c95841fd40ce978aa7a02 sid: 0c8b 1301 cid: 2e6bfc53c91c275019cd809200fa8e23836565ab sid: feca 1302 cid: 29b87a902ed129c26f7e4e918a68703dc71a6e0a sid: 8941 1304 cr_bits 0x1 length_self_encoding: y sid_len 3 zp_len 9 key 1305 42e657946b96b7052ab8e6eeb863ee24 1307 cid: 53c48f7884d73fd9016f63e50453bfd9bcfc637d sid: b46b68 1308 cid: 53f45532f6a4f0e1757fa15c35f9a2ab0fcce621 sid: 2147b4 1309 cid: 5361fd4bbcee881a637210f4fffc02134772cc76 sid: e4bf4b 1310 cid: 53881ffde14e613ef151e50ba875769d6392809b sid: c2afee 1311 cid: 53ad0d60204d88343492334e6c4c4be88d4a3add sid: ae0331 1313 cr_bits 0x0 length_self_encoding: n sid_len 4 zp_len 8 key 1314 ee2dc6a3359a94b0043ca0c82715ce71 1316 cid: 058b9da37f436868cca3cef40c7f98001797c611 sid: eaf846c7 1317 cid: 1259fc97439adaf87f61250afea059e5ddf66e44 sid: 4cc5e84a 1318 cid: 202f424376f234d5f014f41cebc38de2619c6c71 sid: f94ff800 1319 cid: 146ac3e4bbb750d3bfb617ef4b0cb51a1cae5868 sid: c2071b1b 1320 cid: 36dfe886538af7eb16a196935b3705c9d741479f sid: 26359dbb 1322 cr_bits 0x2 length_self_encoding: y sid_len 5 zp_len 7 key 1323 700837da8834840afe7720186ec610c9 1324 cid: 931ef3cc07e2eaf08d4c1902cd564d907cc3377c sid: 759b1d419a 1325 cid: 9398c3d0203ab15f1dfeb5aa8f81e52888c32008 sid: 77cc0d3310 1326 cid: 93f4ba09ab08a9ef997db4fa37a97dbf2b4c5481 sid: f7db9dce32 1327 cid: 93744f4bedf95e04dd6607592ecf775825403093 sid: e264d714d2 1328 cid: 93256308e3d349f8839dec840b0a90c7e7a1fc20 sid: 618b07791f 1330 Appendix B. Acknowledgments 1332 Appendix C. Change Log 1334 *RFC Editor's Note:* Please remove this section prior to 1335 publication of a final version of this document. 1337 C.1. since-draft-ietf-quic-load-balancers-02 1339 * Replaced stream cipher algorithm with three-pass version 1341 * Updated Retry format to encode info for required TPs 1343 * Added discussion of version invariance 1345 * Cleaned up text about config rotation 1347 * Added Reset Oracle and limited configuration considerations 1349 * Allow dropped long-header packets for known QUIC versions 1351 C.2. since-draft-ietf-quic-load-balancers-01 1353 * Test vectors for load balancer decoding 1355 * Deleted remnants of in-band protocol 1357 * Light edit of Retry Services section 1359 * Discussed load balancer chains 1361 C.3. since-draft-ietf-quic-load-balancers-00 1363 * Removed in-band protocol from the document 1365 C.4. Since draft-duke-quic-load-balancers-06 1367 * Switch to IETF WG draft. 1369 C.5. Since draft-duke-quic-load-balancers-05 1371 * Editorial changes 1373 * Made load balancer behavior independent of QUIC version 1375 * Got rid of token in stream cipher encoding, because server might 1376 not have it 1378 * Defined "non-compliant DCID" and specified rules for handling 1379 them. 1381 * Added psuedocode for config schema 1383 C.6. Since draft-duke-quic-load-balancers-04 1385 * Added standard for retry services 1387 C.7. Since draft-duke-quic-load-balancers-03 1389 * Renamed Plaintext CID algorithm as Obfuscated CID 1391 * Added new Plaintext CID algorithm 1393 * Updated to allow 20B CIDs 1395 * Added self-encoding of CID length 1397 C.8. Since draft-duke-quic-load-balancers-02 1399 * Added Config Rotation 1401 * Added failover mode 1403 * Tweaks to existing CID algorithms 1405 * Added Block Cipher CID algorithm 1407 * Reformatted QUIC-LB packets 1409 C.9. Since draft-duke-quic-load-balancers-01 1411 * Complete rewrite 1413 * Supports multiple security levels 1415 * Lightweight messages 1417 C.10. Since draft-duke-quic-load-balancers-00 1419 * Converted to markdown 1421 * Added variable length connection IDs 1423 Authors' Addresses 1425 Martin Duke 1426 F5 Networks, Inc. 1428 Email: martin.h.duke@gmail.com 1430 Nick Banks 1431 Microsoft 1433 Email: nibanks@microsoft.com