idnits 2.17.1 draft-ietf-quic-load-balancers-00.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 929 has weird spacing: '...boolean first...' -- The document date (January 28, 2020) is 1550 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 959 -- Looks like a reference, but probably isn't: '19' on line 945 == Unused Reference: 'QUIC-TRANSPORT' is defined on line 1318, but no explicit reference was found in the text Summary: 0 errors (**), 0 flaws (~~), 3 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: July 31, 2020 Microsoft 6 January 28, 2020 8 QUIC-LB: Generating Routable QUIC Connection IDs 9 draft-ietf-quic-load-balancers-00 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 and proposes an 20 optional protocol called QUIC-LB to exchange the parameters of that 21 encoding. This framework also enables offload of other QUIC 22 functions to trusted intermediaries, given the explicit cooperation 23 of the QUIC server. 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at https://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on July 31, 2020. 42 Copyright Notice 44 Copyright (c) 2020 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (https://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 60 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 61 2. Protocol Objectives . . . . . . . . . . . . . . . . . . . . . 5 62 2.1. Simplicity . . . . . . . . . . . . . . . . . . . . . . . 5 63 2.2. Security . . . . . . . . . . . . . . . . . . . . . . . . 5 64 2.3. Robustness to Middleboxes . . . . . . . . . . . . . . . . 6 65 2.4. Load Balancer Chains . . . . . . . . . . . . . . . . . . 6 66 3. First CID octet . . . . . . . . . . . . . . . . . . . . . . . 6 67 3.1. Config Rotation . . . . . . . . . . . . . . . . . . . . . 6 68 3.2. Configuration Failover . . . . . . . . . . . . . . . . . 7 69 3.3. Length Self-Description . . . . . . . . . . . . . . . . . 7 70 4. Routing Algorithms . . . . . . . . . . . . . . . . . . . . . 8 71 4.1. Plaintext CID Algorithm . . . . . . . . . . . . . . . . . 9 72 4.1.1. Load Balancer Actions . . . . . . . . . . . . . . . . 9 73 4.1.2. Server Actions . . . . . . . . . . . . . . . . . . . 9 74 4.2. Obfuscated CID Algorithm . . . . . . . . . . . . . . . . 10 75 4.2.1. Load Balancer Actions . . . . . . . . . . . . . . . . 10 76 4.2.2. Server Actions . . . . . . . . . . . . . . . . . . . 11 77 4.3. Stream Cipher CID Algorithm . . . . . . . . . . . . . . . 11 78 4.3.1. Load Balancer Actions . . . . . . . . . . . . . . . . 12 79 4.3.2. Server Actions . . . . . . . . . . . . . . . . . . . 12 80 4.4. Block Cipher CID Algorithm . . . . . . . . . . . . . . . 13 81 4.4.1. Load Balancer Actions . . . . . . . . . . . . . . . . 13 82 4.4.2. Server Actions . . . . . . . . . . . . . . . . . . . 14 83 5. Retry Service . . . . . . . . . . . . . . . . . . . . . . . . 14 84 5.1. Common Requirements . . . . . . . . . . . . . . . . . . . 15 85 5.2. No-Shared-State Retry Service . . . . . . . . . . . . . . 15 86 5.2.1. Service Requirements . . . . . . . . . . . . . . . . 15 87 5.2.2. Server Requirements . . . . . . . . . . . . . . . . . 17 88 5.3. Shared-State Retry Service . . . . . . . . . . . . . . . 17 89 5.3.1. Service Requirements . . . . . . . . . . . . . . . . 19 90 5.3.2. Server Requirements . . . . . . . . . . . . . . . . . 19 91 6. Configuration Requirements . . . . . . . . . . . . . . . . . 19 92 7. Protocol Description . . . . . . . . . . . . . . . . . . . . 22 93 7.1. Out of band sharing . . . . . . . . . . . . . . . . . . . 22 94 7.2. QUIC-LB Message Exchange . . . . . . . . . . . . . . . . 22 95 7.3. QUIC-LB Packet . . . . . . . . . . . . . . . . . . . . . 22 96 7.4. Message Types and Formats . . . . . . . . . . . . . . . . 23 97 7.4.1. ACK_LB Message . . . . . . . . . . . . . . . . . . . 24 98 7.4.2. FAIL Message . . . . . . . . . . . . . . . . . . . . 24 99 7.4.3. ROUTING_INFO Message . . . . . . . . . . . . . . . . 24 100 7.4.4. STREAM_CID Message . . . . . . . . . . . . . . . . . 25 101 7.4.5. BLOCK_CID Message . . . . . . . . . . . . . . . . . . 26 102 7.4.6. SERVER_ID Message . . . . . . . . . . . . . . . . . . 27 103 7.4.7. MODULUS Message . . . . . . . . . . . . . . . . . . . 27 104 7.4.8. PLAINTEXT Message . . . . . . . . . . . . . . . . . . 27 105 7.4.9. RETRY_SERVICE_STATELESS message . . . . . . . . . . . 28 106 7.4.10. RETRY_SERVICE_STATEFUL message . . . . . . . . . . . 28 107 8. Security Considerations . . . . . . . . . . . . . . . . . . . 28 108 8.1. Outside attackers . . . . . . . . . . . . . . . . . . . . 29 109 8.2. Inside Attackers . . . . . . . . . . . . . . . . . . . . 29 110 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 111 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 29 112 10.1. Normative References . . . . . . . . . . . . . . . . . . 30 113 10.2. Informative References . . . . . . . . . . . . . . . . . 30 114 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . 30 115 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 30 116 B.1. Since draft-duke-quic-load-balancers-06 . . . . . . . . . 30 117 B.2. Since draft-duke-quic-load-balancers-05 . . . . . . . . . 30 118 B.3. Since draft-duke-quic-load-balancers-04 . . . . . . . . . 30 119 B.4. Since draft-duke-quic-load-balancers-03 . . . . . . . . . 31 120 B.5. Since draft-duke-quic-load-balancers-02 . . . . . . . . . 31 121 B.6. Since draft-duke-quic-load-balancers-01 . . . . . . . . . 31 122 B.7. Since draft-duke-quic-load-balancers-00 . . . . . . . . . 31 123 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 31 125 1. Introduction 127 QUIC packets usually contain a connection ID to allow endpoints to 128 associate packets with different address/port 4-tuples to the same 129 connection context. This feature makes connections robust in the 130 event of NAT rebinding. QUIC endpoints usually designate the 131 connection ID which peers use to address packets. Server-generated 132 connection IDs create a potential need for out-of-band communication 133 to support QUIC. 135 QUIC allows servers (or load balancers) to designate an initial 136 connection ID to encode useful routing information for load 137 balancers. It also encourages servers, in packets protected by 138 cryptography, to provide additional connection IDs to the client. 139 This allows clients that know they are going to change IP address or 140 port to use a separate connection ID on the new path, thus reducing 141 linkability as clients move through the world. 143 There is a tension between the requirements to provide routing 144 information and mitigate linkability. Ultimately, because new 145 connection IDs are in protected packets, they must be generated at 146 the server if the load balancer does not have access to the 147 connection keys. However, it is the load balancer that has the 148 context necessary to generate a connection ID that encodes useful 149 routing information. In the absence of any shared state between load 150 balancer and server, the load balancer must maintain a relatively 151 expensive table of server-generated connection IDs, and will not 152 route packets correctly if they use a connection ID that was 153 originally communicated in a protected NEW_CONNECTION_ID frame. 155 This specification provides a method of coordination between QUIC 156 servers and low-state load balancers to support connection IDs that 157 encode routing information. It describes desirable properties of a 158 solution, and then specifies a protocol that provides those 159 properties. This protocol supports multiple encoding schemes that 160 increase in complexity as they address paths between load balancer 161 and server with weaker trust dynamics. 163 Aside from load balancing, a QUIC server may also desire to offload 164 other protocol functions to trusted intermediaries. These 165 intermediaries might include hardware assist on the server host 166 itself, without access to fully decrypted QUIC packets. For example, 167 this document specifies a means of offloading stateless retry to 168 counter Denial of Service attacks. It also proposes a system for 169 self-encoding connection ID length in all packets, so that crypto 170 offload can consistently look up key information. 172 1.1. Terminology 174 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 175 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 176 document are to be interpreted as described in RFC 2119 [RFC2119]. 178 In this document, these words will appear with that interpretation 179 only when in ALL CAPS. Lower case uses of these words are not to be 180 interpreted as carrying significance described in RFC 2119. 182 In this document, "client" and "server" refer to the endpoints of a 183 QUIC connection unless otherwise indicated. A "load balancer" is an 184 intermediary for that connection that does not possess QUIC 185 connection keys, but it may rewrite IP addresses or conduct other IP 186 or UDP processing. 188 Note that stateful load balancers that act as proxies, by terminating 189 a QUIC connection with the client and then retrieving data from the 190 server using QUIC or another protocol, are treated as a server with 191 respect to this specification. 193 When discussing security threats to QUIC-LB, we distinguish between 194 "inside observers" and "outside observers." The former lie on the 195 path between the load balancer and server, which often but not always 196 lies inside the server's data center or cloud deployment. Outside 197 observers are on the path between the load balancer and client. 198 "Off-path" attackers, though not on any data path, may also be 199 "inside" or "outside" depending on whether not they have network 200 access to the server without intermediation by the load balancer and/ 201 or other security devices. 203 2. Protocol Objectives 205 2.1. Simplicity 207 QUIC is intended to provide unlinkability across connection 208 migration, but servers are not required to provide additional 209 connection IDs that effectively prevent linkability. If the 210 coordination scheme is too difficult to implement, servers behind 211 load balancers using connection IDs for routing will use trivially 212 linkable connection IDs. Clients will therefore be forced choose 213 between terminating the connection during migration or remaining 214 linkable, subverting a design objective of QUIC. 216 The solution should be both simple to implement and require little 217 additional infrastructure for cryptographic keys, etc. 219 2.2. Security 221 In the limit where there are very few connections to a pool of 222 servers, no scheme can prevent the linking of two connection IDs with 223 high probability. In the opposite limit, where all servers have many 224 connections that start and end frequently, it will be difficult to 225 associate two connection IDs even if they are known to map to the 226 same server. 228 QUIC-LB is relevant in the region between these extremes: when the 229 information that two connection IDs map to the same server is helpful 230 to linking two connection IDs. Obviously, any scheme that 231 transparently communicates this mapping to outside observers 232 compromises QUIC's defenses against linkability. 234 However, concealing this mapping from inside observers is beyond the 235 scope of QUIC-LB. By simply observing Link-Layer and/or Network- 236 Layer addresses of packets containing distinct connection IDs, it is 237 trivial to determine that they map to the same server, even if 238 connection IDs are entirely random and do not encode routing 239 information. Schemes that conceal these addresses (e.g., IPsec) can 240 also conceal QUIC-LB messages. 242 Inside observers are generally able to mount Denial of Service (DoS) 243 attacks on QUIC connections regardless of Connection ID schemes. 244 However, QUIC-LB should protect against Denial of Service due to 245 inside off-path attackers in cases where such attackers are possible. 247 Though not an explicit goal of the QUIC-LB design, concealing the 248 server mapping also complicates attempts to focus attacks on a 249 specific server in the pool. 251 2.3. Robustness to Middleboxes 253 The path between load balancer and server may pass through 254 middleboxes that could drop the coordination messages in this 255 protocol. It is therefore advantageous to make messages resemble 256 QUIC traffic as much as possible, as any viable path must obviously 257 admit QUIC traffic. 259 2.4. Load Balancer Chains 261 While it is possible to construct a scheme that supports multiple 262 low-state load balancers in the path, by using different parts of the 263 connection ID to encode routing information for each load balancer, 264 this use case is out of scope for QUIC-LB. 266 3. First CID octet 268 The first octet of a Connection ID is reserved for two special 269 purposes, one mandatory (config rotation) and one optional (length 270 self-description). 272 Subsequent sections of this document refer to the contents of this 273 octet as the "first octet." 275 3.1. Config Rotation 277 The first two bits of any connection-ID MUST encode the configuration 278 phase of that ID. QUIC-LB messages indicate the phase of the 279 algorithm and parameters that they encode. 281 A new configuration may change one or more parameters of the old 282 configuration, or change the algorithm used. 284 It is possible for servers to have mutually exclusive sets of 285 supported algorithms, or for a transition from one algorithm to 286 another to result in Fail Payloads. The four states encoded in these 287 two bits allow two mutually exclusive server pools to coexist, and 288 for each of them to transition to a new set of parameters. 290 When new configuration is distributed to servers, there will be a 291 transition period when connection IDs reflecting old and new 292 configuration coexist in the network. The rotation bits allow load 293 balancers to apply the correct routing algorithm and parameters to 294 incoming packets. 296 Servers MUST NOT generate new connection IDs using an old 297 configuration when it has sent an Ack payload for a new 298 configuration. 300 Load balancers SHOULD NOT use a codepoint to represent a new 301 configuration until it takes precautions to make sure that all 302 connections using IDs with an old configuration at that codepoint 303 have closed or transitioned. They MAY drop connection IDs with the 304 old configuration after a reasonable interval to accelerate this 305 process. 307 3.2. Configuration Failover 309 If a server is configured to expect QUIC-LB messages, and it has not 310 received these, it MUST generate connection IDs with the config 311 rotation bits set to '11' and MUST use the "disable_migration" 312 transport parameter in all new QUIC connections. It MUST NOT send 313 NEW_CONNECTION_ID frames with new values. 315 A load balancer that sees a connection ID with config rotation bits 316 set to '11' MUST revert to 5-tuple routing. 318 3.3. Length Self-Description 320 Local hardware cryptographic offload devices may accelerate QUIC 321 servers by receiving keys from the QUIC implementation indexed to the 322 connection ID. However, on physical devices operating multiple QUIC 323 servers, it is impractical to efficiently lookup these keys if the 324 connection ID does not self-encode its own length. 326 Note that this is a function of particular server devices and is 327 irrelevant to load balancers. As such, it is not negotiated between 328 servers and load balancers. However, the remaining 6 bits in the 329 first octet of the Connection ID are reserved to express the length 330 of the following connection ID, not including the first octet. 332 A server not using this functionality SHOULD make the six bits appear 333 to be random. 335 4. Routing Algorithms 337 In QUIC-LB, load balancers do not generate individual connection IDs 338 to servers. Instead, they communicate the parameters of an algorithm 339 to generate routable connection IDs. 341 The algorithms differ in the complexity of configuration at both load 342 balancer and server. Increasing complexity improves obfuscation of 343 the server mapping. 345 As clients sometimes generate the DCIDs in long headers, these might 346 not conform to the expectations of the routing algorithm. These are 347 called "non-compliant DCIDs": 349 o The DCID might not be long enough for the routing algorithm to 350 process. 352 o The extracted server mapping might not correspond to an active 353 server. 355 o A field that should be all zeroes after decryption may not be so. 357 Load balancers MUST forward packets with long headers with non- 358 compliant DCIDs to an active server using an algorithm of its own 359 choosing. It need not coordinate this algorithm with the servers. 360 The algorithm SHOULD be deterministic over short time scales so that 361 related packets go to the same server. For example, a non-compliant 362 DCID might be converted to an integer and divided by the number of 363 servers, with the modulus used to forward the packet. The number of 364 servers is usually consistent on the time scale of a QUIC connection 365 handshake. 367 Load balancers SHOULD drop packets with non-compliant DCIDs in a 368 short header. 370 Load balancers MUST forward packets with compliant DCIDs to a server 371 in accordance with the chosen routing algorithm. 373 The load balancer MUST NOT make the routing behavior dependent on any 374 bits in the first octet of the QUIC packet header, except the first 375 bit, which indicates a long header. All other bits are QUIC version- 376 dependent and intermediaries should not build their design on 377 version-specific templates. 379 There are situations where a server pool might be operating two or 380 more routing algorithms or parameter sets simultaneously. The load 381 balancer uses the first two bits of the connection ID to multiplex 382 incoming DCIDs over these schemes. 384 This section describes two participants: the load balancer and the 385 server. The load balancer, in this description, generates 386 configuration parameters. Note that in practice a third party 387 configuration agent MAY assume this responsibility. 389 4.1. Plaintext CID Algorithm 391 The Plaintext CID Algorithm makes no attempt to obscure the mapping 392 of connections to servers, significantly increasing linkability. The 393 format is depicted in the figure below. 395 0 1 2 3 396 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 397 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 398 | First octet | Server ID (X=8..152) | 399 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 400 | Any (0..152-X) | 401 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 403 Figure 1: Plaintext CID Format 405 4.1.1. Load Balancer Actions 407 The load balancer selects a number of bytes of the server connection 408 ID (SCID) that it will use to route to a given server, called the 409 "routing bytes". The number of bytes MUST have enough entropy to 410 have a different code point for each server. 412 The load balancer shares this value with servers, as explained in 413 Section 7, along with the value that represents that server. 415 On each incoming packet, the load balancer extracts consecutive 416 octets, beginning with the second byte. These bytes represent the 417 server ID. 419 4.1.2. Server Actions 421 The server chooses a connection ID length. This MUST be at least one 422 byte longer than the routing bytes. 424 When a server needs a new connection ID, it encodes its assigned 425 server ID in consecutive octets beginning with the second. All other 426 bits in the connection ID, except for the first octet, MAY be set to 427 any other value. These other bits SHOULD appear random to observers. 429 4.2. Obfuscated CID Algorithm 431 The Obfuscated CID Algorithm makes an attempt to obscure the mapping 432 of connections to servers to reduce linkability, while not requiring 433 true encryption and decryption. The format is depicted in the figure 434 below. 436 0 1 2 3 437 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 438 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 439 | First octet | Mixed routing and non-routing bits (64..152) | 440 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 442 Figure 2: Obfuscated CID Format 444 4.2.1. Load Balancer Actions 446 The load balancer selects an arbitrary set of bits of the server 447 connection ID (SCID) that it will use to route to a given server, 448 called the "routing bits". The number of bits MUST have enough 449 entropy to have a different code point for each server, and SHOULD 450 have enough entropy so that there are many codepoints for each 451 server. 453 The load balancer MUST NOT select a routing mask with more than 136 454 routing bits set to 1, which allows for the first octet and up to 2 455 octets for server purposes in a maximum-length connection ID. 457 The load balancer selects a divisor that MUST be larger than the 458 number of servers. It SHOULD be large enough to accommodate 459 reasonable increases in the number of servers. The divisor MUST be 460 an odd integer so certain addition operations do not always produce 461 an even number. 463 The load balancer also assigns each server a "modulus", an integer 464 between 0 and the divisor minus 1. These MUST be unique for each 465 server, and SHOULD be distributed across the entire number space 466 between zero and the divisor. 468 The load balancer shares these three values with servers, as 469 explained in Section 7. 471 Upon receipt of a QUIC packet, the load balancer extracts the 472 selected bits of the SCID and expresses them as an unsigned integer 473 of that length. The load balancer then divides the result by the 474 chosen divisor. The modulus of this operation maps to the modulus 475 for the destination server. 477 Note that any SCID that contains a server's modulus, plus an 478 arbitrary integer multiple of the divisor, in the routing bits is 479 routable to that server regardless of the contents of the non-routing 480 bits. Outside observers that do not know the divisor or the routing 481 bits will therefore have difficulty identifying that two SCIDs route 482 to the same server. 484 Note also that not all Connection IDs are necessarily routable, as 485 the computed modulus may not match one assigned to any server. These 486 DCIDs are non-compliant as described above. 488 4.2.2. Server Actions 490 The server chooses a connection ID length. This MUST contain all of 491 the routing bits and MUST be at least 9 octets to provide adequate 492 entropy. 494 When a server needs a new connection ID, it adds an arbitrary 495 nonnegative integer multiple of the divisor to its modulus, without 496 exceeding the maximum integer value implied by the number of routing 497 bits. The choice of multiple should appear random within these 498 constraints. 500 The server encodes the result in the routing bits. It MAY put any 501 other value into bits that used neither for routing nor config 502 rotation. These bits SHOULD appear random to observers. 504 4.3. Stream Cipher CID Algorithm 506 The Stream Cipher CID algorithm provides true cryptographic 507 protection, rather than mere obfuscation, at the cost of additional 508 per-packet processing at the load balancer to decrypt every incoming 509 connection ID. The CID format is depicted below. 511 0 1 2 3 512 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 513 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 514 | First Octet | Nonce (X=64..144) | 515 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 516 | Encrypted Server ID (Y=8..152-X) | 517 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 518 | For server use (0..152-X-Y) | 519 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 521 Figure 3: Stream Cipher CID Format 523 4.3.1. Load Balancer Actions 525 The load balancer assigns a server ID to every server in its pool, 526 and determines a server ID length (in octets) sufficiently large to 527 encode all server IDs, including potential future servers. 529 The load balancer also selects a nonce length and an 16-octet AES-ECB 530 key to use for connection ID decryption. The nonce length MUST be at 531 least 8 octets and no more than 16 octets. The nonce length and 532 server ID length MUST sum to 19 or fewer octets. 534 The load balancer shares these three values with servers, as 535 explained in Section 7. 537 Upon receipt of a QUIC packet that is not of type Initial or 0-RTT, 538 the load balancer extracts as many of the earliest octets from the 539 destination connection ID as necessary to match the nonce length. 540 The server ID immediately follows. 542 The load balancer decrypts the server ID using 128-bit AES Electronic 543 Codebook (ECB) mode, much like QUIC header protection. The nonce 544 octets are zero-padded to 16 octets. AES-ECB encrypts this nonce 545 using its key to generate a mask which it applies to the encrypted 546 server id. 548 server_id = encrypted_server_id ^ AES-ECB(key, padded-nonce) 550 For example, if the nonce length is 10 octets and the server ID 551 length is 2 octets, the connection ID can be as small as 13 octets. 552 The load balancer uses the the second through eleventh of the 553 connection ID for the nonce, zero-pads it to 16 octets using the 554 first 6 octets of the token, and uses this to decrypt the server ID 555 in the twelfth and thirteenth octet. 557 The output of the decryption is the server ID that the load balancer 558 uses for routing. 560 4.3.2. Server Actions 562 When generating a routable connection ID, the server writes arbitrary 563 bits into its nonce octets, and its provided server ID into the 564 server ID octets. Servers MAY opt to have a longer connection ID 565 beyond the nonce and server ID. The nonce and additional bits MAY 566 encode additional information, but SHOULD appear essentially random 567 to observers. 569 The server decrypts the server ID using 128-bit AES Electronic 570 Codebook (ECB) mode, much like QUIC header protection. The nonce 571 octets are zero-padded to 16 octets using the as many of the first 572 octets of the token as necessary. AES-ECB encrypts this nonce using 573 its key to generate a mask which it applies to the server id. 575 encrypted_server_id = server_id ^ AES-ECB(key, padded-nonce) 577 4.4. Block Cipher CID Algorithm 579 The Block Cipher CID Algorithm, by using a full 16 octets of 580 plaintext and a 128-bit cipher, provides higher cryptographic 581 protection and detection of non-compliant connection IDs. However, 582 it also requires connection IDs of at least 17 octets, increasing 583 overhead of client-to-server packets. 585 0 1 2 3 586 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 587 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 588 | First octet | Encrypted server ID (X=8..144) | 589 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 590 | Encrypted Zero Padding (Y=0..144-X) | 591 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 592 | Encrypted bits for server use (144-X-Y) | 593 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 594 | Unencrypted bits for server use (0..24) | 595 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 597 Figure 4: Block Cipher CID Format 599 4.4.1. Load Balancer Actions 601 The load balancer assigns a server ID to every server in its pool, 602 and determines a server ID length (in octets) sufficiently large to 603 encode all server IDs, including potential future servers. The 604 server ID will start in the second octet of the decrypted connection 605 ID and occupy continuous octets beyond that. 607 The load balancer selects a zero-padding length. This SHOULD be at 608 least four octets to allow detection of non-compliant DCIDs. The 609 server ID and zero- padding length MUST sum to no more than 16 610 octets. They SHOULD sum to no more than 12 octets, to provide 611 servers adequate space to encode their own opaque data. 613 The load balancer also selects an 16-octet AES-ECB key to use for 614 connection ID decryption. 616 The load balancer shares these four values with servers, as explained 617 in Section 7. 619 Upon receipt of a QUIC packet that is not of type Initial or 0-RTT, 620 the load balancer reads the first octet to obtain the config rotation 621 bits. It then decrypts the subsequent 16 octets using AES-ECB 622 decryption and the chosen key. 624 The decrypted plaintext contains the server id, zero padding, and 625 opaque server data in that order. The load balancer uses the server 626 ID octets for routing. 628 4.4.2. Server Actions 630 When generating a routable connection ID, the server MUST choose a 631 connection ID length between 17 and 20 octets. The server writes its 632 provided server ID into the server ID octets, zeroes into the zero- 633 padding octets, and arbitrary bits into the remaining bits. These 634 arbitrary bits MAY encode additional information. Bits in the first, 635 eighteenth, nineteenth, and twentieth octets SHOULD appear 636 essentially random to observers. The first octet is reserved as 637 described in Section 3. 639 The server then encrypts the second through seventeenth octets using 640 the 128-bit AES-ECB cipher. 642 5. Retry Service 644 When a server is under load, QUICv1 allows it to defer storage of 645 connection state until the client proves it can receive packets at 646 its advertised IP address. Through the use of a Retry packet, a 647 token in subsequent client Initial packets, and the 648 original_connection_id transport parameter, servers verify address 649 ownership and clients verify that there is no "man in the middle" 650 generating Retry packets. 652 As a trusted Retry Service is literally a "man in the middle," the 653 service must communicate the original_connection_id back to the 654 server so that in can pass client verification. It also must either 655 verify the address itself (with the server trusting this 656 verification) or make sure there is common context for the server to 657 verify the address using a service-generated token. 659 There are two different mechanisms to allow offload of DoS mitigation 660 to a trusted network service. One requires no shared state; the 661 server need only be configured to trust a retry service, though this 662 imposes other operational constraints. The other requires shared 663 key, but has no such constraints. 665 Retry services MUST forward all non-Initial QUIC packets, as well as 666 Initial packets from the server. 668 5.1. Common Requirements 670 Regardless of mechanism, a retry service has an active mode, where it 671 is generating Retry packets, and an inactive mode, where it is not, 672 based on its assessment of server load and the likelihood an attack 673 is underway. The choice of mode MAY be made on a per-packet basis, 674 through a stochastic process or based on client address. 676 A retry service MUST forward all packets for a QUIC version it does 677 not understand. Note that if servers support versions the retry 678 service does not, this may unacceptably increase loads on the 679 servers. However, dropping these packets would introduce chokepoints 680 to block deployment of new QUIC versions. Note that future versions 681 of QUIC might not have Retry packets, or require different 682 information. 684 5.2. No-Shared-State Retry Service 686 The no-shared-state retry service requires no coordination, except 687 that the server must be configured to accept this service. The 688 scheme uses the first bit of the token to distinguish between tokens 689 from Retry packets (codepoint '0') and tokens from NEW_TOKEN frames 690 (codepoint '1'). 692 5.2.1. Service Requirements 694 A no-shared-state retry service MUST be present on all paths from 695 potential clients to the server. These paths MUST fail to pass QUIC 696 traffic should the service fail for any reason. That is, if the 697 service is not operational, the server MUST NOT be exposed to client 698 traffic. Otherwise, servers that have already disabled their Retry 699 capability would be vulnerable to attack. 701 The path between service and server MUST be free of any potential 702 attackers. Note that this and other requirements above severely 703 restrict the operational conditions in which a no-shared-state retry 704 service can safely operate. 706 Retry tokens generated by the service MUST have the format below. 708 0 1 2 3 709 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 710 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 711 |0| ODCIL (7) | Original Destination Connection ID (0..160) | 712 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 713 | Original Destination Connection ID (...) | 714 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 715 ... 716 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 717 | Opaque Data (variable) | 718 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 720 Figure 5: Format of non-shared-state retry service tokens 722 The first bit of retry tokens generated by the service must be zero. 723 The token has the following additional fields: 725 ODCIL: The length of the original destination connection ID from the 726 triggering Initial packet. This is in cleartext to be readable for 727 the server, but authenticated later in the token. 729 Original Destination Connection ID: This also in cleartext and 730 authenticated later. 732 Opaque Data: This data MUST contain encrypted information that allows 733 the retry service to validate the client's IP address, in accordance 734 with the QUIC specification. It MUST also encode a secure hash of 735 the original destination connection ID field to verify that this 736 field has not been edited. 738 Upon receipt of an Initial packet with a token that begins with '0', 739 the retry service MUST validate the token in accordance with the QUIC 740 specification. It must also verify that the secure hash of the 741 Connect ID is correct. If incorrect, the token is invalid. 743 In active mode, the service MUST issue Retry packets for all Client 744 initial packets that contain no token, or a token that has the first 745 bit set to '1'. It MUST NOT forward the packet to the server. The 746 service MUST validate all tokens with the first bit set to '0'. If 747 successful, the service MUST forward the packet with the token 748 intact. If unsuccessful, it MUST drop the packet. 750 Note that this scheme has a performance drawback. When the retry 751 service is in active mode, clients with a token from a NEW_TOKEN 752 frame will suffer a 1-RTT penalty even though it has proof of address 753 with its token. 755 In inactive mode, the service MUST forward all packets that have no 756 token or a token with the first bit set to '1'. It MUST validate all 757 tokens with the first bit set to '0'. If successful, the service 758 MUST forward the packet with the token intact. If unsuccessful, it 759 MUST either drop the packet or forward it with the token removed. 760 The latter requires decryption and re-encryption of the entire 761 Initial packet to avoid authentication failure. Forwarding the 762 packet causes the server to respond without the 763 original_connection_id transport parameter, which preserves the 764 normal QUIC signal to the client that there is an unauthorized man in 765 the middle. 767 5.2.2. Server Requirements 769 A server behind a non-shared-state retry service MUST NOT send Retry 770 packets. 772 Tokens sent in NEW_TOKEN frames MUST have the first bit be set to 773 '1'. 775 If a server receives an Initial Packet with the first bit set to '1', 776 it could be from a server-generated NEW_TOKEN frame and should be 777 processed in accordance with the QUIC specification. If a server 778 receives an Initial Packet with the first bit to '0', it is a Retry 779 token and the server MUST NOT attempt to validate it. Instead, it 780 MUST assume the address is validated and MUST extract the Original 781 Destination Connection ID, assuming the format described in 782 Section 5.2.1. 784 5.3. Shared-State Retry Service 786 A shared-state retry service uses a shared key, so that the server 787 can decode the service's retry tokens. It does not require that all 788 traffic pass through the Retry service, so servers MAY send Retry 789 packets in response to Initial packets that don't include a valid 790 token. 792 Both server and service must have access to Universal time, though 793 tight synchronization is not necessary. 795 All tokens, generated by either the server or retry service, MUST use 796 the following format. This format is the cleartext version. On the 797 wire, these fields are encrypted using an AES-ECB cipher and the 798 token key. If the token is not a multiple of 16 octets, the last 799 block is padded with zeroes. 801 0 1 2 3 802 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 803 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 804 | ODCIL | Original Destination Connection ID (0..160) | 805 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 806 | ... | 807 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 808 | | 809 + + 810 | | 811 + Client IP Address (128) + 812 | | 813 + + 814 | | 815 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 816 | | 817 + + 818 | | 819 + + 820 | date-time (160) | 821 + + 822 | | 823 + + 824 | | 825 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 826 | Opaque Data (optional) | 827 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 829 Figure 6: Cleartext format of shared-state retry tokens 831 The tokens have the following fields: 833 ODCIL: The original destination connection ID length. Tokens in 834 NEW_TOKEN frames SHOULD set this field to zero. 836 Original Destination Connection ID: This is copied from the field in 837 the client Initial packet. 839 Client IP Address: The source IP address from the triggering Initial 840 packet. The client IP address is 16 octets. If an IPv4 address, the 841 last 12 octets are zeroes. 843 date-time: The date-time string is a total of 20 octets and encodes 844 the time the token was generated. The format of date-time is 845 described in Section 5.6 of [RFC3339]. This ASCII field MUST use the 846 "Z" character for time-offset. 848 Opaque Data: The server may use this field to encode additional 849 information, such as congestion window, RTT, or MTU. Opaque data 850 SHOULD also allow servers to distinguish between retry tokens (which 851 trigger use of the original_connection_id transport parameter) and 852 NEW_TOKEN frame tokens. 854 5.3.1. Service Requirements 856 The service MUST share a "token key" with all supported servers. 858 When in active mode, the service MUST generate Retry tokens with the 859 format described above when it receives a client Initial packet with 860 no token. 862 In active mode, the service SHOULD decrypt incoming tokens. The 863 service SHOULD drop packets with an IP address that does not match, 864 and SHOULD forward packets that do, regardless of the other fields. 866 In inactive mode, the service SHOULD forward all packets to the 867 server so that the server can issue an up-to-date token to the 868 client. 870 5.3.2. Server Requirements 872 The server MUST validate all tokens that arrive in Initial packets, 873 as they may have bypassed the Retry service. It SHOULD use the date- 874 time field to apply its expiration limits for tokens. This need not 875 be synchronized with the retry service. However, servers MAY allow 876 retry tokens marked as being a few seconds in the future, due to 877 possible clock synchronization issues. 879 A server MUST NOT send a Retry packet in response to an Initial 880 packet that contains a retry token. 882 6. Configuration Requirements 884 QUIC-LB strives to minimize the configuration load to enable, as much 885 as possible, a "plug-and-play" model. However, there are some 886 configuration requirements based on algorithm and protocol choices 887 above. 889 If there is any in-band communication, servers MUST be explicitly 890 configured with the token of the load balancer they expect to 891 interface with. 893 The load balancer and server MUST agree on a routing algorithm and 894 the relevant parameters for that algorithm. 896 For Plaintext CID Routing, this consists of the Server ID and the 897 routing bytes. The Server ID is unique to each server, and the 898 routing bytes are global. 900 For Obfuscated CID Routing, this consists of the Routing Bits, 901 Divisor, and Modulus. The Modulus is unique to each server, but the 902 others MUST be global. 904 For Stream Cipher CID Routing, this consists of the Server ID, Server 905 ID Length, Key, and Nonce Length. The Server ID is unique to each 906 server, but the others MUST be global. The authentication token MUST 907 be distributed out of band for this algorithm to operate. 909 For Block Cipher CID Routing, this consists of the Server ID, Server 910 ID Length, Key, and Zero-Padding Length. The Server ID is unique to 911 each server, but the others MUST be global. 913 A full QUIC-LB configuration MUST also specify the information 914 content of the first CID octet and the presence and mode of any Retry 915 Service. 917 The following pseudocode depicts the data items necessary to store a 918 full QUIC-LB configuration at the server. It is meant to describe 919 the conceptual range and not specify the presentation of such 920 configuration in an internet packet. The comments signify the range 921 of acceptable values where applicable. 923 uint2 config_rotation_bits; 924 enum { in_band_config, out_of_band_config } config_method; 925 select (config_method) { 926 case in_band_config: uint64 config_token; 927 case out_of_band_config: null; 928 } config-method 929 boolean first_octet_encodes_cid_length; 930 enum { none, non_shared_state, shared_state } retry_service; 931 select (retry_service) { 932 case none: null; 933 case non_shared_state: null; 934 case shared_state: uint8 key[16]; 935 } retry_service_config; 936 enum { none, plaintext, obfuscated, stream_cipher, block_cipher } 937 routing_algorithm; 938 select (routing_algorithm) { 939 case none: null; 940 case plaintext: struct { 941 uint8 server_id_length; /* 1..19 */ 942 uint8 server_id[server_id_length]; 943 } plaintext_config; 944 case obfuscated: struct { 945 uint8 routing_bit_mask[19]; 946 uint16 divisor; /* Must be odd */ 947 uint16 modulus; /* 0..(divisor - 1) */ 948 } obfuscated_config; 949 case stream_cipher: struct { 950 uint8 nonce_length; /* 8..16 */ 951 uint8 server_id_length; /* 1..(19 - nonce_length) */ 952 uint8 server_id[server_id_length]; 953 uint8 key[16]; 954 } stream_cipher_config; 955 case block_cipher: struct { 956 uint8 server_id_length; 957 uint8 zero_padding_length; /* 0..(16 - server_id_length) */ 958 uint8 server_id[server_id_length]; 959 uint8 key[16]; 960 } block_cipher_config; 961 } routing_algorithm_config; 963 This specification allows for out-of-band dissemination of this 964 configuration items, but also provides an in-band method for 965 deployment models that need it. 967 7. Protocol Description 969 There are multiple means of configuration that correspond to 970 differing deployment models and increasing levels of concern about 971 the security of the load balancer-server path. 973 7.1. Out of band sharing 975 When there are concerns about the integrity of the path between load 976 balancer and server, operators MAY share routing information using an 977 out-of-band technique, which is out of the scope of this 978 specification. 980 To simplify configuration, the global parameters can be shared out- 981 of-band, while the load balancer sends the unique server IDs via the 982 truncated message formats presented below. 984 7.2. QUIC-LB Message Exchange 986 QUIC-LB load balancers and servers exchange messages via the QUIC- 987 LBv1 protocol, which uses the QUIC invariants with version number 988 0xF1000000. The QUIC-LB load balancers send the encoding parameters 989 to servers and periodically retransmit until that server responds 990 with an acknowledgement. Specifics of this retransmission are 991 implementation-dependent. 993 7.3. QUIC-LB Packet 995 A QUIC-LB packet uses a long header. It carries configuration 996 information from the load balancer and acknowledgements from the 997 servers. They are sent when a load balancer boots up, detects a new 998 server in the pool or needs to update the server configuration. 1000 0 1 2 3 1001 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 1002 +-+-+-+-+-+-+-+-+ 1003 |1|C R| Reserved| 1004 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1005 | Version (32) | 1006 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1007 | 0x00 | 0x00 | 1008 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1009 | | 1010 + Authentication Token (64) + 1011 | | 1012 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1013 | Message Type | 1014 +-+-+-+-+-+-+-+-+ 1016 Figure 7: QUIC-LB Packet Format 1018 The Version field allows QUIC-LB to use the Version Negotiation 1019 mechanism. All messages in this specification are specific to QUIC- 1020 LBv1. It should be set to 0xF1000000. 1022 Load balancers MUST cease sending QUIC-LB packets of this version to 1023 a server when that server sends a Version Negotiation packet that 1024 does not advertise the version. 1026 The length of the DCIL and SCIL fields are 0x00. 1028 CR The 2-bit CR field indicates the Config Rotation described in 1029 Section 3.1. 1031 Authentication Token The Authentication Token is an 8-byte field 1032 that both entities obtain at configuration time. It is used to 1033 verify that the sender is not an inside off-path attacker. 1034 Servers and load balancers SHOULD silently discard QUIC-LB packets 1035 with an incorrect token. 1037 Message Type The Message Type indicates the type of message payload 1038 that follows the QUIC-LB header. 1040 7.4. Message Types and Formats 1042 As described in Section 7.3, QUIC-LB packets contain a single 1043 message. This section describes the format and semantics of the 1044 QUIC-LB message types. 1046 7.4.1. ACK_LB Message 1048 A server uses the ACK_LB message (type=0x00) to acknowledge a QUIC-LB 1049 packet received from the load balancer. The ACK-LB message has no 1050 additional payload beyond the QUIC-LB packet header. 1052 Load balancers SHOULD continue to retransmit a QUIC-LB packet until a 1053 valid ACK_LB message, FAIL message or Version Negotiation Packet is 1054 received from the server. 1056 7.4.2. FAIL Message 1058 A server uses the FAIL message (type=0x01) to indicate the 1059 configuration received from the load balancer is unsupported. 1061 0 1 2 3 1062 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 1063 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1064 | Supp. Type | Supp. Type | ... 1065 +-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1067 Servers MUST send a FAIL message upon receipt of a message type which 1068 they do not support, or if they do not possess all of the implied 1069 out-of-band configuration to support a particular message type. 1071 The payload of the FAIL message consists of a list of all the message 1072 types supported by the server. 1074 Upon receipt of a FAIL message, Load Balancers MUST either send a 1075 QUIC-LB message the server supports or remove the server from the 1076 server pool. 1078 7.4.3. ROUTING_INFO Message 1080 A load balancer uses the ROUTING_INFO message (type=0x02) to exchange 1081 all the parameters for the Obfuscated CID algorithm. 1083 0 1 2 3 1084 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 1085 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1086 | | 1087 + + 1088 | | 1089 + Routing Bit Mask (152) + 1090 | | 1091 + + 1092 | | 1093 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1094 | | Modulus (16) | 1095 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1096 | Divisor (16) | 1097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1099 Routing Bit Mask The Routing Bit Mask encodes a '1' at every bit 1100 position in the server connection ID that will encode routing 1101 information. 1103 These bits, along with the Modulus and Divisor, are chosen by the 1104 load balancer as described in Section 4.2. 1106 7.4.4. STREAM_CID Message 1108 A load balancer uses the STREAM_CID message (type=0x03) to exchange 1109 all the parameters for using Stream Cipher CIDs. 1111 0 1 2 3 1112 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 1113 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1114 | Nonce Len (8) | SIDL (8) | 1115 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1116 | Server ID (variable) | 1117 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1118 | | 1119 + Key (128) + 1120 | | 1121 + + 1122 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1124 Figure 8: Stream CID Payload 1126 Nonce Len The Nonce Len field is a one-octet unsigned integer that 1127 describes the nonce length necessary to use this routing 1128 algorithm, in octets. 1130 SIDL The SIDL field is a one-octet unsigned integer that describes 1131 the server ID length necessary to use this routing algorithm, in 1132 octets. 1134 Server ID The Server ID is the unique value assigned to the 1135 receiving server. Its length is determined by the SIDL field. 1137 Key The Key is an 16-octet field that contains the key that the load 1138 balancer will use to decrypt server IDs on QUIC packets. See 1139 Section 8 to understand why sending keys in plaintext may be a 1140 safe strategy. 1142 7.4.5. BLOCK_CID Message 1144 A load balancer uses the BLOCK_CID message (type=0x04) to exchange 1145 all the parameters for using Stream Cipher CIDs. 1147 0 1 2 3 1148 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 1149 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1150 | ZP Len (8) | SIDL (8) | 1151 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1152 | Server ID (variable) | 1153 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1154 | | 1155 + Key (128) + 1156 | | 1157 + + 1158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1160 Figure 9: Block CID Payload 1162 ZP Len The ZP Len field is a one-octet unsigned integer that 1163 describes the zero-padding length necessary to use this routing 1164 algorithm, in octets. 1166 SIDL The SIDL field is a one-octet unsigned integer that describes 1167 the server ID length necessary to use this routing algorithm, in 1168 octets. 1170 Server ID The Server ID is the unique value assigned to the 1171 receiving server. Its length is determined by the SIDL field. 1173 Key The Key is an 16-octet field that contains the key that the load 1174 balancer will use to decrypt server IDs on QUIC packets. See 1175 Section 8 to understand why sending keys in plaintext may be a 1176 safe strategy. 1178 7.4.6. SERVER_ID Message 1180 A load balancer uses the SERVER_ID message (type=0x05) to exchange 1181 explicit server IDs. 1183 0 1 2 3 1184 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 1185 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1186 | SIDL (8) | Server ID (variable) | 1187 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1189 Load balancers send the SERVER_ID message when all global values for 1190 Stream or Block CIDs are sent out-of-band, so that only the server- 1191 unique values must be sent in-band. It also provides all necessary 1192 paramters for Plaintext CIDs. The fields are identical to their 1193 counterparts in the Section 7.4.4 payload. 1195 7.4.7. MODULUS Message 1197 A load balancer uses the MODULUS message (type=0x06) to exchange just 1198 the modulus used in the Obfuscated CID algorithm. 1200 0 1 2 3 1201 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 1202 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1203 | Modulus (16) | 1204 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1206 Load balancers send the MODULUS when all global values for Obfuscated 1207 CIDs are sent out-of-band, so that only the server-unique values must 1208 be sent in-band. The Modulus field is identical to its counterpart 1209 in the ROUTING_INFO message. 1211 7.4.8. PLAINTEXT Message 1213 A load balancer uses the PLAINTEXT message (type=0x07) to exchange 1214 all parameters needed for the Plaintext CID algorithm. 1216 0 1 2 3 1217 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 1218 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1219 | SIDL (8) | 1220 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1221 | | 1222 + Server ID (variable) + 1223 | | 1224 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1225 The SIDL field indicates the length of the server ID field. The 1226 Server ID field indicates the encoding that represents the 1227 destination server. 1229 7.4.9. RETRY_SERVICE_STATELESS message 1231 A no-shared-state retry service uses this message (type=0x08) to 1232 notify the server of the existence of this service. This message has 1233 no fields. 1235 7.4.10. RETRY_SERVICE_STATEFUL message 1237 A shared-state retry service uses this message (type=0x09) to tell 1238 the server about its existence, and share the key needed to decrypt 1239 server-generated retry tokens. 1241 0 1 2 3 1242 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 1243 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1244 | | 1245 + + 1246 | | 1247 + Key (128) + 1248 | | 1249 + + 1250 | | 1251 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1253 8. Security Considerations 1255 QUIC-LB is intended to preserve routability and prevent linkability. 1256 Attacks on the protocol would compromise at least one of these 1257 objectives. 1259 Note that the Plaintext CID algorithm makes no attempt to obscure the 1260 server mapping, and therefore does not address these concerns. It 1261 exists to allow consistent CID encoding for compatibility across a 1262 network infrastructure. Servers that are running the Plaintext CID 1263 algorithm SHOULD only use it to generate new CIDs for the Server 1264 Initial Packet and SHOULD NOT send CIDs in QUIC NEW_CONNECTION_ID 1265 frames. Doing so might falsely suggest to the client that said CIDs 1266 were generated in a secure fashion. 1268 A routability attack would inject QUIC-LB messages so that load 1269 balancers incorrectly route QUIC connections. 1271 A linkability attack would find some means of determining that two 1272 connection IDs route to the same server. As described above, there 1273 is no scheme that strictly prevents linkability for all traffic 1274 patterns, and therefore efforts to frustrate any analysis of server 1275 ID encoding have diminishing returns. 1277 8.1. Outside attackers 1279 For an outside attacker to break routability, it must inject packets 1280 that correctly guess the 64-bit token, and servers must be reachable 1281 from these outside hosts. Load balancers SHOULD drop QUIC-LB packets 1282 that arrive on its external interface. 1284 Off-path outside attackers cannot observe connection IDs, and will 1285 therefore struggle to link them. 1287 On-path outside attackers might try to link connection IDs to the 1288 same QUIC connection. The Encrypted CID algorithm provides robust 1289 entropy to making any sort of linkage. The Obfuscated CID obscures 1290 the mapping and prevents trivial brute-force attacks to determine the 1291 routing parameters, but does not provide robust protection against 1292 sophisticated attacks. 1294 8.2. Inside Attackers 1296 As described above, on-path inside attackers are intrinsically able 1297 to map two connection IDs to the same server. The QUIC-LB algorithms 1298 do prevent the linkage of two connection IDs to the same individual 1299 connection if servers make reasonable selections when generating new 1300 IDs for that connection. 1302 On-path inside attackers can break routability for new and migrating 1303 connections by copying the token from QUIC-LB messages. From this 1304 privileged position, however, there are many other attacks that can 1305 break QUIC connections to the server during the handshake. 1307 Off-path inside attackers cannot observe connection IDs to link them. 1308 To successfully break routability, they must correctly guess the 1309 token. 1311 9. IANA Considerations 1313 There are no IANA requirements. 1315 10. References 1316 10.1. Normative References 1318 [QUIC-TRANSPORT] 1319 Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 1320 Multiplexed and Secure Transport", draft-ietf-quic- 1321 transport (work in progress). 1323 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 1324 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 1325 . 1327 10.2. Informative References 1329 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1330 Requirement Levels", BCP 14, RFC 2119, 1331 DOI 10.17487/RFC2119, March 1997, 1332 . 1334 Appendix A. Acknowledgments 1336 Appendix B. Change Log 1338 *RFC Editor's Note:* Please remove this section prior to 1339 publication of a final version of this document. 1341 B.1. Since draft-duke-quic-load-balancers-06 1343 o Switch to IETF WG draft. 1345 B.2. Since draft-duke-quic-load-balancers-05 1347 o Editorial changes 1349 o Made load balancer behavior independent of QUIC version 1351 o Got rid of token in stream cipher encoding, because server might 1352 not have it 1354 o Defined "non-compliant DCID" and specified rules for handling 1355 them. 1357 o Added psuedocode for config schema 1359 B.3. Since draft-duke-quic-load-balancers-04 1361 o Added standard for retry services 1363 B.4. Since draft-duke-quic-load-balancers-03 1365 o Renamed Plaintext CID algorithm as Obfuscated CID 1367 o Added new Plaintext CID algorithm 1369 o Updated to allow 20B CIDs 1371 o Added self-encoding of CID length 1373 B.5. Since draft-duke-quic-load-balancers-02 1375 o Added Config Rotation 1377 o Added failover mode 1379 o Tweaks to existing CID algorithms 1381 o Added Block Cipher CID algorithm 1383 o Reformatted QUIC-LB packets 1385 B.6. Since draft-duke-quic-load-balancers-01 1387 o Complete rewrite 1389 o Supports multiple security levels 1391 o Lightweight messages 1393 B.7. Since draft-duke-quic-load-balancers-00 1395 o Converted to markdown 1397 o Added variable length connection IDs 1399 Authors' Addresses 1401 Martin Duke 1402 F5 Networks, Inc. 1404 Email: martin.h.duke@gmail.com 1406 Nick Banks 1407 Microsoft 1409 Email: nibanks@microsoft.com