idnits 2.17.1 draft-duke-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 -- The document date (December 10, 2018) is 1962 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'QUIC-TRANSPORT' is defined on line 830, but no explicit reference was found in the text == Outdated reference: A later version (-34) exists of draft-ietf-quic-transport-16 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 QUIC M. Duke 3 Internet-Draft F5 Networks, Inc. 4 Intended status: Standards Track December 10, 2018 5 Expires: June 13, 2019 7 QUIC-LB: Generating Routable QUIC Connection IDs 8 draft-duke-quic-load-balancers-03 10 Abstract 12 QUIC connection IDs allow continuation of connections across address/ 13 port 4-tuple changes, and can store routing information for stateless 14 or low-state load balancers. They also can prevent linkability of 15 connections across deliberate address migration through the use of 16 protected communications between client and server. This creates 17 issues for load-balancing intermediaries. This specification 18 standardizes methods for encoding routing information and proposes an 19 optional protocol called QUIC_LB to exchange the parameters of that 20 encoding. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on June 13, 2019. 39 Copyright Notice 41 Copyright (c) 2018 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (https://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 57 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 58 2. Protocol Objectives . . . . . . . . . . . . . . . . . . . . . 4 59 2.1. Simplicity . . . . . . . . . . . . . . . . . . . . . . . 4 60 2.2. Security . . . . . . . . . . . . . . . . . . . . . . . . 4 61 2.3. Robustness to Middleboxes . . . . . . . . . . . . . . . . 5 62 2.4. Load Balancer Chains . . . . . . . . . . . . . . . . . . 5 63 3. Routing Algorithms . . . . . . . . . . . . . . . . . . . . . 5 64 3.1. Plaintext CID Algorithm . . . . . . . . . . . . . . . . . 6 65 3.1.1. Load Balancer Actions . . . . . . . . . . . . . . . . 6 66 3.1.2. Server Actions . . . . . . . . . . . . . . . . . . . 7 67 3.2. Stream Cipher CID Algorithm . . . . . . . . . . . . . . . 7 68 3.2.1. Load Balancer Actions . . . . . . . . . . . . . . . . 8 69 3.2.2. Server Actions . . . . . . . . . . . . . . . . . . . 8 70 3.3. Block Cipher CID Algorithm . . . . . . . . . . . . . . . 9 71 3.4. Load Balancer Actions . . . . . . . . . . . . . . . . . . 9 72 3.4.1. Server Actions . . . . . . . . . . . . . . . . . . . 9 73 4. Protocol Description . . . . . . . . . . . . . . . . . . . . 10 74 4.1. Out of band sharing . . . . . . . . . . . . . . . . . . . 10 75 4.2. QUIC-LB Message Exchange . . . . . . . . . . . . . . . . 10 76 4.3. QUIC-LB Packet . . . . . . . . . . . . . . . . . . . . . 11 77 4.4. Message Types and Formats . . . . . . . . . . . . . . . . 12 78 4.4.1. ACK_LB Message . . . . . . . . . . . . . . . . . . . 12 79 4.4.2. FAIL Message . . . . . . . . . . . . . . . . . . . . 12 80 4.4.3. ROUTING_INFO Message . . . . . . . . . . . . . . . . 12 81 4.4.4. STREAM_CID Message . . . . . . . . . . . . . . . . . 13 82 4.4.5. BLOCK_CID Message . . . . . . . . . . . . . . . . . . 14 83 4.4.6. SERVER_ID Message . . . . . . . . . . . . . . . . . . 15 84 4.4.7. MODULUS Message . . . . . . . . . . . . . . . . . . . 15 85 5. Config Rotation . . . . . . . . . . . . . . . . . . . . . . . 15 86 5.1. Configuration Failover . . . . . . . . . . . . . . . . . 16 87 6. Configuration Requirements . . . . . . . . . . . . . . . . . 16 88 7. Security Considerations . . . . . . . . . . . . . . . . . . . 17 89 7.1. Outside attackers . . . . . . . . . . . . . . . . . . . . 17 90 7.2. Inside Attackers . . . . . . . . . . . . . . . . . . . . 18 91 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 92 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 93 9.1. Normative References . . . . . . . . . . . . . . . . . . 18 94 9.2. Informative References . . . . . . . . . . . . . . . . . 18 95 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . 18 96 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 18 97 B.1. Since draft-duke-quic-load-balancers-02 . . . . . . . . . 19 98 B.2. Since draft-duke-quic-load-balancers-01 . . . . . . . . . 19 99 B.3. Since draft-duke-quic-load-balancers-00 . . . . . . . . . 19 100 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 19 102 1. Introduction 104 QUIC packets usually contain a connection ID to allow endpoints to 105 associate packets with different address/port 4-tuples to the same 106 connection context. This feature makes connections robust in the 107 event of NAT rebinding. QUIC endpoints designate the connection ID 108 which peers use to address packets. Server-generated connection IDs 109 create a potential need for out-of-band communication to support 110 QUIC. 112 QUIC allows servers (or load balancers) to designate an initial 113 connection ID to encode useful routing information for load 114 balancers. It also encourages servers, in packets protected by 115 cryptography, to provide additional connection IDs to the client. 116 This allows clients that know they are going to change IP address or 117 port to use a separate connection ID on the new path, thus reducing 118 linkability as clients move through the world. 120 There is a tension between the requirements to provide routing 121 information and mitigate linkability. Ultimately, because new 122 connection IDs are in protected packets, they must be generated at 123 the server if the load balancer does not have access to the 124 connection keys. However, it is the load balancer that has the 125 context necessary to generate a connection ID that encodes useful 126 routing information. In the absence of any shared state between load 127 balancer and server, the load balancer must maintain a relatively 128 expensive table of server-generated connection IDs, and will not 129 route packets correctly if they use a connection ID that was 130 originally communicated in a protected NEW_CONNECTION_ID frame. 132 This specification provides a method of coordination between QUIC 133 servers and low-state load balancers to support connection IDs that 134 encode routing information. It describes desirable properties of a 135 solution, and then specifies a protocol that provides those 136 properties. This protocol supports multiple encoding schemes that 137 increase in complexity as they address paths between load balancer 138 and server with weaker trust dynamics. 140 1.1. Terminology 142 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 143 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 144 document are to be interpreted as described in RFC 2119 [RFC2119]. 146 In this document, these words will appear with that interpretation 147 only when in ALL CAPS. Lower case uses of these words are not to be 148 interpreted as carrying significance described in RFC 2119. 150 In this document, "client" and "server" refer to the endpoints of a 151 QUIC connection unless otherwise indicated. A "load balancer" is an 152 intermediary for that connection that does not possess QUIC 153 connection keys, but it may rewrite IP addresses or conduct other IP 154 or UDP processing. 156 Note that stateful load balancers that act as proxies, by terminating 157 a QUIC connection with the client and then retrieving data from the 158 server using QUIC or another protocol, are treated as a server with 159 respect to this specification. 161 When discussing security threats to QUIC-LB, we distinguish between 162 "inside observers" and "outside observers." The former lie on the 163 path between the load balancer and server, which often but not always 164 lies inside the server's data center or cloud deployment. Outside 165 observers are on the path between the load balancer and client. 166 "Off-path" attackers, though not on any data path, may also be 167 "inside" or "outside" depending on whether not they have network 168 access to the server without intermediation by the load balancer and/ 169 or other security devices. 171 2. Protocol Objectives 173 2.1. Simplicity 175 QUIC is intended to provide unlinkability across connection 176 migration, but servers are not required to provide additional 177 connection IDs that effectively prevent linkability. If the 178 coordination scheme is too difficult to implement, servers behind 179 load balancers using connection IDs for routing will use trivially 180 linkable connection IDs. Clients will therefore be forced choose 181 between terminating the connection during migration or remaining 182 linkable, subverting a design objective of QUIC. 184 The solution should be both simple to implement and require little 185 additional infrastructure for cryptographic keys, etc. 187 2.2. Security 189 In the limit where there are very few connections to a pool of 190 servers, no scheme can prevent the linking of two connection IDs with 191 high probability. In the opposite limit, where all servers have many 192 connections that start and end frequently, it will be difficult to 193 associate two connection IDs even if they are known to map to the 194 same server. 196 QUIC-LB is relevant in the region between these extremes: when the 197 information that two connection IDs map to the same server is helpful 198 to linking two connection IDs. Obviously, any scheme that 199 transparently communicates this mapping to outside observers 200 compromises QUIC's defenses against linkability. 202 However, concealing this mapping from inside observers is beyond the 203 scope of QUIC-LB. By simply observing Link-Layer and/or Network- 204 Layer addresses of packets containing distinct connection IDs, it is 205 trivial to determine that they map to the same server, even if 206 connection IDs are entirely random and do not encode routing 207 information. Schemes that conceal these addresses (e.g., IPsec) can 208 also conceal QUIC-LB messages. 210 Inside observers are generally able to mount Denial of Service (DoS) 211 attacks on QUIC connections regardless of Connection ID schemes. 212 However, QUIC-LB should protect against Denial of Service due to 213 inside off-path attackers in cases where such attackers are possible. 215 Though not an explicit goal of the QUIC-LB design, concealing the 216 server mapping also complicates attempts to focus attacks on a 217 specific server in the pool. 219 2.3. Robustness to Middleboxes 221 The path between load balancer and server may pass through 222 middleboxes that could drop the coordination messages in this 223 protocol. It is therefore advantageous to make messages resemble 224 QUIC traffic as much as possible, as any viable path must obviously 225 admit QUIC traffic. 227 2.4. Load Balancer Chains 229 While it is possible to construct a scheme that supports multiple 230 low-state load balancers in the path, by using different parts of the 231 connection ID to encoding routing information for each load balancer, 232 this use case is out of scope for QUIC-LB. 234 3. Routing Algorithms 236 In QUIC-LB, load balancers do not send individual connection IDs to 237 servers. Instead, they communicate the parameters of an algorithm to 238 generate routable connection IDs. 240 The algorithms differ in the complexity of configuration at both load 241 balancer and server. Increasing complexity improves obfuscation of 242 the server mapping. 244 The load balancer SHOULD route Initial and 0-RTT packets from the 245 client using an alternate algorithm. Note that the SCID in these 246 packets may not be long enough to represent all the routing bits. 247 This algorithm SHOULD generate consistent results for Initial and 248 0RTT packets that arrive with the same source and destination 249 connection ID. The load balancer algorithms below apply to all 250 incoming Handshake and 1-RTT packets. 252 There are situations where a server pool might be operating two or 253 more routing algorithms or parameter sets simultaneously. The load 254 balancer uses the first two bits of the connection ID to multiplex 255 incoming SCIDs over these schemes. 257 3.1. Plaintext CID Algorithm 259 3.1.1. Load Balancer Actions 261 The load balancer selects an arbitrary set of bits of the server 262 connection ID (SCID) that it will use to route to a given server, 263 called the "routing bits". The number of bits MUST have enough 264 entropy to have a different code point for each server, and SHOULD 265 have enough entropy so that there are many codepoints for each 266 server. 268 The load balancer MUST NOT select a routing mask that with more than 269 126 routing bits set to 1, which allows at least 2 bits for config 270 rotation (see Section 5) and 16 for server purposes in a maximum- 271 length connection ID. 273 The first two bits of an SCID MUST NOT be routing bits; these are 274 reserved for config rotation. 276 The load balancer selects a divisor that MUST be larger than the 277 number of servers. It SHOULD be large enough to accommodate 278 reasonable increases in the number of servers. The divisor MUST be 279 an odd integer so certain addition operations do not always produce 280 an even number. 282 The load balancer also assigns each server a "modulus", an integer 283 between 0 and the divisor minus 1. These MUST be unique for each 284 server, and SHOULD be distributed across the entire number space 285 between zero and the divisor. 287 The load balancer shares these three values with servers, as 288 explained in Section 4. 290 Upon receipt of a QUIC packet that is not of type Initial or 0-RTT, 291 the load balancer extracts the selected bits of the SCID and 292 expresses them as an unsigned integer of that length. The load 293 balancer then divides the result by the chosen divisor. The modulus 294 of this operation maps to the modulus for the destination server. 296 Note that any SCID that contains a server's modulus, plus an 297 arbitrary integer multiple of the divisor, in the routing bits is 298 routable to that server regardless of the contents of the non-routing 299 bits. Outside observers that do not know the divisor or the routing 300 bits will therefore have difficulty identifying that two SCIDs route 301 to the same server. 303 Note also that not all Connection IDs are necessarily routable, as 304 the computed modulus may not match one assigned to any server. Load 305 balancers SHOULD drop these packets if not a QUIC Initial or 0-RTT 306 packet. 308 3.1.2. Server Actions 310 The server chooses a connection ID length. This MUST contain all of 311 the routing bits and MUST be at least 8 octets to provide adequate 312 entropy. 314 When a server needs a new connection ID, it adds an arbitrary 315 nonnegative integer multiple of the divisor to its modulus, without 316 exceeding the maximum integer value implied by the number of routing 317 bits. The choice of multiple should appear random within these 318 constraints. 320 The server encodes the result in the routing bits. It MAY put any 321 other value into the non-routing bits except the config rotation 322 bits. The non-routing bits SHOULD appear random to observers. 324 3.2. Stream Cipher CID Algorithm 326 The Encrypted CID algorithm provides true cryptographic protection, 327 rather than mere obfuscation, at the cost of additional per-packet 328 processing at the load balancer to decrypt every incoming connection 329 ID except for Initial and 0RTT packets. 331 3.2.1. Load Balancer Actions 333 The load balancer assigns a server ID to every server in its pool, 334 and determines a server ID length (in octets) sufficiently large to 335 encode all server IDs, including potential future servers. 337 The load balancer also selects a nonce length and an 16-octet AES-CTR 338 key to use for connection ID decryption. The nonce length MUST be at 339 least eight octets and no more than 16 octets. The nonce length and 340 server ID length MUST sum to 18 or fewer octets. 342 The load balancer shares these three values with servers, as 343 explained in Section 4. 345 Upon receipt of a QUIC packet that is not of type Initial or 0-RTT, 346 the load balancer extracts as many of the earliest octets from the 347 destination connection ID as necessary to match the nonce length. 348 The server ID immediately follows. 350 The load balancer decrypts the server ID using 128-bit AES in counter 351 (CTR) mode, much like QUIC packet number decryption. The nonce 352 octets are padded to 16 octets using the as many of the first octets 353 of the token as necessary, and used as counter input to AES-CTR. 355 server_id = AES-CTR(key, padded-nonce, encrypted_server_id) 357 For example, if the nonce length is 10 octets and the server ID 358 length is 2 octets, the connection ID can be as small as 12 octets. 359 The load balancer uses the first 10 octets (including the config 360 rotation bits) of the connection ID for the nonce, pads it to 16 361 octets using the first 6 octets of the token, and uses this to 362 decrypt the server ID in the eleventh and twelfth octet. 364 The output of the decryption is the server ID that the load balancer 365 uses for routing. 367 3.2.2. Server Actions 369 When generating a routable connection ID, the server writes arbitrary 370 bits into its nonce octets, and its provided server ID into the 371 server ID octets. Servers MAY opt to have a longer connection ID 372 beyond the nonce and server ID. The nonce and additional bits MAY 373 encode additional information, but SHOULD appear essentially random 374 to observers. The first two bits of the first octet are reserved for 375 config rotation Section 5, but form part of the nonce. 377 The server then encrypts the server ID octets using 128-bit AES in 378 counter (CTR) mode, much like QUIC packet number encryption. The 379 server pads its nonce to 16 octets using the earliest octets of the 380 token, and uses the result as the counter input to AES-CTR. 382 encrypted_server_id = AES-CTR(key, padded-nonce, server-id) 384 3.3. Block Cipher CID Algorithm 386 The Block Cipher CID Algorithm, by using a full 16 octets of 387 Plaintext and a 128-bit cipher, provides higher cryptographic 388 protection and detection of spurious connection IDs. However, it 389 also requires connection IDs of at least 17 octets, increasing 390 overhead of client-to-server packets. 392 3.4. Load Balancer Actions 394 The load balancer assigns a server ID to every server in its pool, 395 and determines a server ID length (in octets) sufficiently large to 396 encode all server IDs, including potential future servers. The 397 server ID will start in the second octet of the decrypted connection 398 ID and occupy continuous octets beyond that. 400 The load balancer selects a zero-padding length. This SHOULD be at 401 least four octets to allow detection of spurious connection IDs. The 402 server ID and zero- padding length MUST sum to no more than 16 403 octets. They SHOULD sum to no more than 12 octets, to provide 404 servers adequate space to encode their own opaque data. 406 The load balancer also selects an 16-octet AES-ECB key to use for 407 connection ID decryption. 409 The load balancer shares these four values with servers, as explained 410 in Section 4. 412 Upon receipt of a QUIC packet that is not of type Initial or 0-RTT, 413 the load balancer reads the first octet to obtain the config rotation 414 bits. It then decrypts the subsequent 16 octets using AES-ECB 415 decryption and the chosen key. 417 The decrypted plaintext contains the server id, zero padding, and 418 opaque server data in that order. If the zero padding octets are not 419 zero, the load balancer MUST drop the packet. The load balancer uses 420 the server ID octets for routing. 422 3.4.1. Server Actions 424 When generating a routable connection ID, the server MUST choose a 425 connection ID length of 17 or 18 octets. The server writes its 426 provided server ID into the server ID octets, zeroes into the zero- 427 padding octets, and arbitrary bits into the remaining bits. These 428 arbitrary bits MAY encode additional information. Bits in the first 429 and eighteenth octets SHOULD appear essentially random to observers. 430 The first two bits of the first octet are reserved for config 431 rotation Section 5. 433 The server then encrypts the second through seventeenth octets using 434 the 128-bit AES-ECB cipher. 436 4. Protocol Description 438 The fundamental protocol requirement is to share the choice of 439 routing algorithm, and the relevant parameters for that algorithm, 440 between load balancer and server. 442 For Plaintext CID Routing, this consists of the Routing Bits, 443 Divisor, and Modulus. The Modulus is unique to each server, but the 444 others MUST be global. 446 For Stream Cipher CID Routing, this consists of the Server ID, Server 447 ID Length, Key, and Nonce Length. The Server ID is unique to each 448 server, but the others MUST be global. The authentication token MUST 449 be distributed out of band for this algorithm to operate. 451 For Block Cipher CID Routing, this consists of the Server ID, Server 452 ID Length, Key, and Zero-Padding Length. The Server ID is unique to 453 each server, but the others MUST be global. 455 Each routing configuration also requires a unique two-bit config 456 rotation codepoint (see Section 5) to identify it. 458 4.1. Out of band sharing 460 When there are concerns about the integrity of the path between load 461 balancer and server, operators MAY share routing information using an 462 out-of-band technique, which is out of the scope of this 463 specification. 465 To simplify configuration, the global parameters can be shared out- 466 of-band, while the load balancer sends the unique server IDs via the 467 truncated message formats presented below. 469 4.2. QUIC-LB Message Exchange 471 QUIC-LB load balancers and servers exchange messages via the QUIC- 472 LBv1 protocol, which uses the QUIC invariants with version number 473 0xF1000000. The QUIC-LB load balancers send the encoding parameters 474 to servers and periodically retransmit until that server responds 475 with an acknowledgement. Specifics of this retransmission are 476 implementation-dependent. 478 4.3. QUIC-LB Packet 480 A QUIC-LB packet uses a long header. It carries configuration 481 information from the load balancer and acknowledgements from the 482 servers. They are sent when a load balancer boots up, detects a new 483 server in the pool or needs to update the server configuration. 485 0 1 2 3 486 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 487 +-+-+-+-+-+-+-+-+ 488 |1|C R| Reserved| 489 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 490 | Version (32) | 491 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 492 | 0x00 | 0x00 | 493 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 494 | | 495 + Authentication Token (64) + 496 | | 497 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 498 | Message Type | 499 +-+-+-+-+-+-+-+-+ 501 Figure 1: QUIC-LB Packet Format 503 The Version field allows QUIC-LB to use the Version Negotiation 504 mechanism. All messages in this specification are specific to QUIC- 505 LBv1. It should be set to 0xF1000000. 507 Load balancers MUST cease sending QUIC-LB packets of this version to 508 a server when that server sends a Version Negotiation packet that 509 does not advertise the version. 511 The length of the DCIL and SCIL fields are 0x00. 513 CR The 2-bit. CR field indicates the Config Rotation described in 514 Section 5. 516 Authentication Token The Authentication Token is an 8-byte field 517 that both entities obtain at configuration time. It is used to 518 verify that the sender is not an inside off-path attacker. 519 Servers and load balancers SHOULD silently discard QUIC-LB packets 520 with an incorrect token. 522 Message Type The Message Type indicates the type of message payload 523 that follows the QUIC-LB header. 525 4.4. Message Types and Formats 527 As described in Section 4.3, QUIC-LB packets contain a single 528 message. This section describes the format and semantics of the 529 QUIC-LB message types. 531 4.4.1. ACK_LB Message 533 A server uses the ACK_LB message (type=0x00) to acknowledge a QUIC-LB 534 packet received from the load balancer. The ACK-LB message has no 535 additional payload beyond the QUIC-LB packet header. 537 Load balancers SHOULD continue to retransmit a QUIC-LB packet until a 538 valid ACK_LB message, FAIL message or Version Negotiation Packet is 539 received from the server. 541 4.4.2. FAIL Message 543 A server uses the FAIL message (type=0x01) to indicate the 544 configuration received from the load balancer is unsupported. 546 0 1 2 3 547 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 548 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 549 | Supp. Type | Supp. Type | ... 550 +-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 552 Servers MUST send a FAIL message upon receipt of a message type which 553 they do not support, or if they do not possess all of the implied 554 out-of-band configuration to support a particular message type. 556 The payload of the FAIL message consists of a list of all the message 557 types supported by the server. 559 Upon receipt of a FAIL message, Load Balancers MUST either send a 560 QUIC-LB message the server supports or remove the server from the 561 server pool. 563 4.4.3. ROUTING_INFO Message 565 A load balancer uses the ROUTING_INFO message (type=0x02) to exchange 566 all the parameters for the plaintext CID algorithm. 568 0 1 2 3 569 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 570 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 571 | | 572 + + 573 | | 574 + Routing Bit Mask (144) + 575 | | 576 + + 577 | | 578 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 579 | | Modulus (16) | 580 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 581 | Divisor (16) | 582 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 584 Routing Bit Mask The Routing Bit Mask encodes a '1' at every bit 585 position in the server connection ID that will encode routing 586 information. 588 These bits, along with the Modulus and Divisor, are chosen by the 589 load balancer as described in Section 3.1. 591 4.4.4. STREAM_CID Message 593 A load balancer uses the STREAM_CID message (type=0x03) to exchange 594 all the parameters for using Stream Cipher CIDs. 596 0 1 2 3 597 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 598 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 599 | Nonce Len (8) | SIDL (8) | 600 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 601 | Server ID (variable) | 602 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 603 | | 604 + Key (128) + 605 | | 606 + + 607 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 609 Figure 2: Stream CID Payload 611 Nonce Len The Nonce Len field is a one-octet unsigned integer that 612 describes the nonce length necessary to use this routing 613 algorithm, in octets. 615 SIDL The SIDL field is a one-octet unsigned integer that describes 616 the server ID length necessary to use this routing algorithm, in 617 octets. 619 Server ID The Server ID is the unique value assigned to the 620 receiving server. Its length is determined by the SIDL field. 622 Key The Key is an 16-octet field that contains the key that the load 623 balancer will use to decrypt server IDs on QUIC packets. See 624 Section 7 to understand why sending keys in plaintext may be a 625 safe strategy. 627 4.4.5. BLOCK_CID Message 629 A load balancer uses the BLOCK_CID message (type=0x04) to exchange 630 all the parameters for using Stream Cipher CIDs. 632 0 1 2 3 633 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 634 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 635 | ZP Len (8) | SIDL (8) | 636 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 637 | Server ID (variable) | 638 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 639 | | 640 + Key (128) + 641 | | 642 + + 643 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 645 Figure 3: Block CID Payload 647 ZP Len The ZP Len field is a one-octet unsigned integer that 648 describes the zero-padding length necessary to use this routing 649 algorithm, in octets. 651 SIDL The SIDL field is a one-octet unsigned integer that describes 652 the server ID length necessary to use this routing algorithm, in 653 octets. 655 Server ID The Server ID is the unique value assigned to the 656 receiving server. Its length is determined by the SIDL field. 658 Key The Key is an 16-octet field that contains the key that the load 659 balancer will use to decrypt server IDs on QUIC packets. See 660 Section 7 to understand why sending keys in plaintext may be a 661 safe strategy. 663 4.4.6. SERVER_ID Message 665 A load balancer uses the SERVER_ID message (type=0x05) to exchange 666 explicit server IDs. 668 0 1 2 3 669 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 670 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 671 | SIDL (8) | Server ID (variable) | 672 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 674 Load balancers send the SERVER_ID message when all global values for 675 Stream or Block CIDs are sent out-of-band, so that only the server- 676 unique values must be sent in-band. The fields are identical to 677 their counterparts in the Section 4.4.4 payload. 679 4.4.7. MODULUS Message 681 A load balancer uses the MODULUS message (type=0x06) to exchange just 682 the modulus used in the plaintext CID algorithm. 684 0 1 2 3 685 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 686 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 687 | Modulus (16) | 688 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 689 | | 690 + Token (64) + 691 | | 692 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 694 Load balancers send the MODULUS when all global values for Plaintext 695 CIDs are sent out-of-band, so that only the server-unique values must 696 be sent in-band. The Modulus field is identical to its counterpart 697 in the ROUTING_INFO message. 699 5. Config Rotation 701 The first two bits of any connection-ID MUST encode the configuration 702 phase of that ID. QUIC-LB messages indicate the phase of the 703 algorithm and parameters that they encode. 705 A new configuration may change one or more parameters of the old 706 configuration, or change the algorithm used. 708 It is possible for servers to have mutually exclusive sets of 709 supported algorithms, or for a transition from one algorithm to 710 another to result in Fail Payloads. The four states encoded in these 711 two bits allow two mutually exclusive server pools to coexist, and 712 for each of them to transition to a new set of parameters. 714 When new configuration is distributed to servers, there will be a 715 transition period when connection IDs reflecting old and new 716 configuration coexist in the network. The rotation bits allow load 717 balancers to apply the correct routing algorithm and parameters to 718 incoming packets. 720 Servers MUST NOT generate new connection IDs using an old 721 configuration when it has sent an Ack payload for a new 722 configuration. 724 Load balancers SHOULD NOT use a codepoint to represent a new 725 configuration until it takes precautions to make sure that all 726 connections using IDs with an old configuration at that codepoint 727 have closed or transitioned. They MAY drop connection IDs with the 728 old configuration after a reasonable interval to accelerate this 729 process. 731 5.1. Configuration Failover 733 If a server is configured to expect QUIC-LB messages, and it has not 734 received these, it MUST generate connection IDs with the config 735 rotation bits set to '0b11' and MUST use the "disable_migration" 736 transport parameter in all new QUIC connections. It MUST NOT send 737 NEW_CONNECTION_ID frames with new values. 739 A load balancer that sees a connection ID with config rotation bits 740 set to '0b11' MUST revert to 5-tuple routing. 742 6. Configuration Requirements 744 QUIC-LB strives to minimize the configuration load to enable, as much 745 as possible, a "plug-and-play" model. However, there are some 746 configuration requirements based on algorithm and protocol choices 747 above. 749 There are three levels of configuration that correspond to increasing 750 levels of concern about the security of the load balancer-server 751 path. 753 The complete information requirements are described in Section 4. 754 Load balancers MUST have configuration for all parameters of each 755 routing algorithm they support. 757 If there is any in-band communication, servers MUST be explicitly 758 configured with the token of the load balancer they expect to 759 interface with. Endpoints that use Stream Cipher CIDs MUST have this 760 token regardless of the configuration method. 762 Optionally, servers MAY be configured with the global parameters of 763 supported routing algorithms. This allows load balancers to use 764 Server ID and Modulus Payloads, limiting the information sent in- 765 band. 767 Finally, servers MAY be directly configured with their unique server 768 IDs or modulus, eliminating need for in-band messaging at all. In 769 this case, servers and load balancers MUST enable only one routing 770 algorithm, as there is no explicit message to agree on one or the 771 other. 773 7. Security Considerations 775 QUIC-LB is intended to preserve routability and prevent linkability. 776 Attacks on the protocol would compromise at least one of these 777 objectives. 779 A routability attack would inject QUIC-LB messages so that load 780 balancers incorrectly route QUIC connections. 782 A linkability attack would find some means of determining that two 783 connection IDs route to the same server. As described above, there 784 is no scheme that strictly prevents linkability for all traffic 785 patterns, and therefore efforts to frustrate any analysis of server 786 ID encoding have diminishing returns. 788 7.1. Outside attackers 790 For an outside attacker to break routability, it must inject packets 791 that correctly guess the 64-bit token, and servers must be reachable 792 from these outside hosts. Load balancers SHOULD drop QUIC-LB packets 793 that arrive on its external interface. 795 Off-path outside attackers cannot observe connection IDs, and will 796 therefore struggle to link them. 798 On-path outside attackers might try to link connection IDs to the 799 same QUIC connection. The Encrypted CID algorithm provides robust 800 entropy to making any sort of linkage. The Plaintext CID obscures 801 the mapping and prevents trivial brute-force attacks to determine the 802 routing parameters, but does not provide robust protection against 803 sophisticated attacks. 805 7.2. Inside Attackers 807 As described above, on-path inside attackers are intrinsically able 808 to map two connection IDs to the same server. The QUIC-LB algorithms 809 do prevent the linkage of two connection IDs to the same individual 810 connection if servers make reasonable selections when generating new 811 IDs for that connection. 813 On-path inside attackers can break routability for new and migrating 814 connections by copying the token from QUIC-LB messages. From this 815 privileged position, however, there are many other attacks that can 816 break QUIC connections to the server during the handshake. 818 Off-path inside attackers cannot observe connection IDs to link them. 819 To successfully break routability, they must correctly guess the 820 token. 822 8. IANA Considerations 824 There are no IANA requirements. 826 9. References 828 9.1. Normative References 830 [QUIC-TRANSPORT] 831 Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based 832 Multiplexed and Secure Transport", draft-ietf-quic- 833 transport-16 (work in progress). 835 9.2. Informative References 837 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 838 Requirement Levels", BCP 14, RFC 2119, 839 DOI 10.17487/RFC2119, March 1997, 840 . 842 Appendix A. Acknowledgments 844 Appendix B. Change Log 846 *RFC Editor's Note:* Please remove this section prior to 847 publication of a final version of this document. 849 B.1. Since draft-duke-quic-load-balancers-02 851 o Added Config Rotation 853 o Added failover mode 855 o Tweaks to existing CID algorithms 857 o Added Block Cipher CID algorithm 859 o Reformatted QUIC-LB packets 861 B.2. Since draft-duke-quic-load-balancers-01 863 o Complete rewrite 865 o Supports multiple security levels 867 o Lightweight messages 869 B.3. Since draft-duke-quic-load-balancers-00 871 o Converted to markdown 873 o Added variable length connection IDs 875 Author's Address 877 Martin Duke 878 F5 Networks, Inc. 880 Email: martin.h.duke@gmail.com