idnits 2.17.1 draft-ietf-6man-flow-ecmp-01.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 8 has weird spacing: '...routing and l...' -- The document date (February 10, 2011) is 4823 days in the past. Is this intentional? Checking references for intended status: Best Current Practice ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) ** Obsolete normative reference: RFC 3697 (Obsoleted by RFC 6437) == Outdated reference: A later version (-07) exists of draft-ietf-6man-flow-3697bis-00 -- Obsolete informational reference (is this intentional?): RFC 2629 (Obsoleted by RFC 7749) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group B. Carpenter 3 Internet-Draft Univ. of Auckland 4 Intended status: BCP S. Amante 5 Expires: August 14, 2011 Level 3 6 February 10, 2011 8 Using the IPv6 flow label for equal cost multipath routing and link 9 aggregation in tunnels 10 draft-ietf-6man-flow-ecmp-01 12 Abstract 14 The IPv6 flow label has certain restrictions on its use. This 15 document describes how those restrictions apply when using the flow 16 label for load balancing by equal cost multipath routing, and for 17 link aggregation, particularly for IP-in-IPv6 tunneled traffic. 19 Status of this Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on August 14, 2011. 36 Copyright Notice 38 Copyright (c) 2011 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 1.1. Choice of IP Header Fields for Hash Input . . . . . . . . . 3 55 1.2. Flow label rules . . . . . . . . . . . . . . . . . . . . . 5 56 2. Normative Notation . . . . . . . . . . . . . . . . . . . . . . 6 57 3. Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . 6 58 4. Security Considerations . . . . . . . . . . . . . . . . . . . . 7 59 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 8 60 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 8 61 7. Change log . . . . . . . . . . . . . . . . . . . . . . . . . . 8 62 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8 63 8.1. Normative References . . . . . . . . . . . . . . . . . . . 8 64 8.2. Informative References . . . . . . . . . . . . . . . . . . 9 65 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9 67 1. Introduction 69 When several network paths between the same two nodes are known by 70 the routing system to be equally good (in terms of capacity and 71 latency), it may be desirable to share traffic among them. Two such 72 techniques are known as equal cost multipath routing (ECMP) and link 73 aggregation (LAG) [IEEE802.1AX]. There are of course numerous 74 possible approaches to this, but certain goals need to be met: 75 o Roughly equal share of traffic on each path. 76 (In some cases, the multiple paths might not all have the same 77 capacity and the goal might be appropriately weighted traffic 78 shares rather than equal shares. This would affect the load 79 sharing algorithm, but would not otherwise change the argument.) 80 o Minimize or avoid out-of-order delivery for individual traffic 81 flows. 82 o Minimize idle time on any path when queue is non-empty. 84 There is some conflict between these goals: for example, strictly 85 avoiding idle time could cause a small packet sent on an idle path to 86 overtake a bigger packet from the same flow, causing out-of-order 87 delivery. 89 One lightweight approach to ECMP or LAG is this: if there are N 90 equally good paths to choose from, then form a modulo(N) hash 91 [RFC2991] from a consistent set of fields in each packet header that 92 are certain to have the same values throughout the duration of a 93 flow, and use the resulting output hash value to select a particular 94 path. If the hash function is chosen so that the output values have 95 a uniform statistical distribution, this method will share traffic 96 roughly equally between the N paths. If the header fields included 97 in the hash input are consistent, all packets from a given flow will 98 generate the same hash output value, so out-of-order delivery will 99 not occur. Assuming a large number of unique flows are involved, it 100 is also probable that the method will avoid idle time, since the 101 queue for each link will remain non-empty. 103 1.1. Choice of IP Header Fields for Hash Input 105 In the remainder of this document, we will use the term "flow" to 106 represent a sequence of packets that may be identified by either the 107 source and destination IP addresses alone {2-tuple} or the source and 108 destination IP addresses, protocol and source and destination port 109 numbers {5-tuple}. It should be noted that the latter is more 110 specifically referred to as a "microflow" in [RFC2474], but this term 111 is not used in connection with the flow label in [RFC3697]. 113 The question is, then, which header fields are used to identify a 114 flow and to serve as input keys to a modulo(N) hash algorithm. A 115 common choice when routing general traffic is simply to use a hash of 116 the source and destination IP addresses, i.e., the 2-tuple. This is 117 necessary and sufficient to avoid out-of-order delivery, and with a 118 wide variety of sources and destinations, as one finds in the core of 119 the network, often statistically sufficient to distribute load 120 evenly. In practice, many implementations use the 5-tuple {dest 121 addr, source addr, protocol, dest port, source port} as input keys to 122 the hash function, to maximize the probability of evenly sharing 123 traffic over the equal cost paths. However, including transport 124 layer information as input keys to a hash may be a problem for IP 125 fragments [RFC2991] or for encrypted traffic. Including the protocol 126 and port numbers, totalling 40 bits, in the hash input makes the hash 127 slightly more expensive to compute but does improve the hash 128 distribution, due to the pseudo-random nature of ephemeral ports. 129 Ephemeral port numbers are quite well distributed [Lee10] and will 130 typically contribute 16 variable bits. However, in the case of IPv6, 131 transport layer information is inconvenient to extract, due to the 132 variable placement of and variable length of next-headers; all 133 implementations must be capable of skipping over next-headers, even 134 if they are rarely present in actual traffic. In fact, [RFC2460] 135 implies that next-headers, except hop-by-hop options, are not 136 normally inspected by intermediate nodes in the network. This 137 situation may be challenging for some hardware implementations, 138 raising the potential that network equipment vendors might sacrifice 139 the length of the fields extracted from an IPv6 header. 141 It is worth noting that the possible presence of a GRE header 142 [RFC2784] and the possible presence of a GRE key within that header 143 creates a similar challenge to the possible presence of IPv6 144 extension headers; anything that complicates header analysis is 145 undesirable. 147 The situation is different in IP-in-IP tunneled scenarios. 148 Identifying a flow inside the tunnel is more complicated, 149 particularly because nearly all hardware can only identify flows 150 based on information contained in the outermost IP header. Assume 151 that traffic from many sources to many destinations is aggregated in 152 a single IP-in-IP tunnel from tunnel end point (TEP) A to TEP B (see 153 figure). Then all the packets forming the tunnel have outer source 154 address A and outer destination address B. In all probability they 155 also have the same port and protocol numbers. If there are multiple 156 paths between routers R1 and R2, and ECMP or LAG is applied to choose 157 a particular path, the 2-tuple or 5-tuple, and its hash, will be 158 constant and no load sharing will be achieved. If there is a high 159 proportion of tunnel traffic, traffic will not be distributed as 160 intended across the paths between R1 and R2. 162 _____ _____ _____ _____ 163 | TEP |_________| R1 |-------------| R2 |_________| TEP | 164 |__A__| |_____|-------------|_____| |__B__| 165 tunnel ECMP or LAG tunnel 166 here 168 As noted above, for IPv6, the 5-tuple is in any case quite 169 inconvenient to extract due to the next-header placement. The 170 question therefore arises whether the 20-bit flow label in IPv6 171 packets would be suitable for use as input to an ECMP or LAG hash 172 algorithm, especially in the case of tunnels where the inner packet 173 header is inaccessible. If the flow label could be used in place of 174 the port numbers and protocol number in the 5-tuple, the 175 implementation would be simplified. 177 1.2. Flow label rules 179 The flow label was left experimental by [RFC2460] but was better 180 defined by [RFC3697]. We quote three rules from that RFC: 181 1. "The Flow Label value set by the source MUST be delivered 182 unchanged to the destination node(s)." 183 2. "IPv6 nodes MUST NOT assume any mathematical or other properties 184 of the Flow Label values assigned by source nodes." 185 3. "Router performance SHOULD NOT be dependent on the distribution 186 of the Flow Label values. Especially, the Flow Label bits alone 187 make poor material for a hash key." 189 These rules, especially the last one, have caused designers to 190 hesitate about using the flow label in support of ECMP or LAG. The 191 fact is today that most nodes set a zero value in the flow label, and 192 the first rule definitely forbids the routing system from changing 193 the flow label once a packet has left the source node. Considering 194 normal IPv6 traffic, the fact that the flow label is typically zero 195 means that it would add no value to an ECMP or LAG hash. But neither 196 would it do any harm to the distribution of the hash values. 198 However, in the case of an IP-in-IPv6 tunnel, the TEP is itself the 199 source node of the outer packets. Therefore, a TEP may freely set a 200 flow label in the outer IPv6 header of the packets it sends into the 201 tunnel. 203 The second two rules quoted above need to be seen in the context of 204 [RFC3697], which assumes that routers using the flow label in some 205 way will be involved in some sort of method of establishing flow 206 state: "To enable flow-specific treatment, flow state needs to be 207 established on all or a subset of the IPv6 nodes on the path from the 208 source to the destination(s)." The RFC should perhaps have made 209 clear that a router that has participated in flow state establishment 210 can rely on properties of the resulting flow label values without 211 further signaling. If a router knows these properties, rule 2 is 212 irrelevant, and it can choose to deviate from rule 3. 214 In the tunneling situation sketched above, routers R1 and R2 can rely 215 on the flow labels set by TEP A and TEP B being assigned by a known 216 method. This allows an ECMP or LAG method to be based on the flow 217 label consistently with [RFC3697], regardless of whether the non- 218 tunnel traffic carries non-zero flow label values. 220 At the time of this writing, the IETF is discussing a revision of RFC 221 3697 [I-D.ietf-6man-flow-3697bis]. If adopted, that revision would 222 be fully compatible with the present document and would obviate the 223 concerns resulting from the above three rules. Therefore, the 224 present specification applies both to RFC 3697 and to its expected 225 successor. 227 2. Normative Notation 229 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 230 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 231 document are to be interpreted as described in [RFC2119]. 233 3. Guidelines 235 We assume that the routers supporting ECMP or LAG (R1 and R2 in the 236 above figure) are unaware that they are handling tunneled traffic. 237 If it is desired to include the IPv6 flow label in an ECMP or LAG 238 hash in the tunneled scenario shown above, the following guidelines 239 apply: 240 o Inner packets MUST be encapsulated in an outer IPv6 packet whose 241 source and destination addresses are those of the tunnel end 242 points (TEPs). 243 o The flow label in the outer packet SHOULD be set by the sending 244 TEP to a pseudo-random 20-bit value in accordance with [RFC3697] 245 or its replacement. The same flow label value MUST be used for 246 all packets in a single user flow, as determined by the IP header 247 fields of the inner packet. 248 * A pseudo-random value is recommended on the basis that it will 249 provide uniformly distributed input values for whatever hash 250 function is used for load balancing. 251 * Note that this rule is a recommendation, to permit individual 252 implementers to take an alternative approach if they wish to do 253 so. For example, a simpler solution than a pseudo-random value 254 might be adopted if it was known that the load balancer would 255 continue to provide uniform distribution of flows with it. 256 Such an alternative MUST conform to [RFC3697] or its 257 replacement. 258 o The sending TEP MUST classify all packets into flows, once it has 259 determined that they should enter a given tunnel, and then write 260 the relevant flow label into the outer IPv6 header. A user flow 261 could be identified by the ingress TEP most simply by its 262 {destination, source} address 2-tuple (coarse) or by its 5-tuple 263 {dest addr, source addr, protocol, dest port, source port} (fine). 264 At present, ironically, there would be little advantage for IPv6 265 packets in using the {dest addr, source addr, flow label} 3-tuple. 266 The choice of n-tuple is an implementation detail in the sending 267 TEP. 268 * It might be possible to make this classifier stateless, by 269 using a suitable 20 bit hash of the inner IP header's 2-tuple 270 or 5-tuple as the pseudo-random flow label value. 271 * If the inner packet is an IPv6 packet, its flow label value 272 could also be included in this hash. 273 * This stateless method creates a small probability of two 274 different user flows hashing to the same flow label. Since RFC 275 3697 allows a source (the TEP in this case) to define any set 276 of packets that it wishes as a single flow, occasionally 277 labeling two user flows as a single flow through the tunnel is 278 acceptable. 279 o At intermediate router(s) that perform load distribution, the hash 280 algorithm used to determine the outgoing component-link in an ECMP 281 and/or LAG toward the next-hop MUST minimally include the 3-tuple 282 {dest addr, source addr, flow label}. This applies whether the 283 traffic is tunneled traffic only, or a mixture of normal traffic 284 and tunneled traffic. 285 * Intermediate IPv6 router(s) will presumably encounter a mixture 286 of tunneled traffic and normal IPv6 traffic. Because of this, 287 the design should also include {protocol, dest port, source 288 port} as input keys to the ECMP and/or LAG hash algorithms, to 289 provide additional entropy for flows whose flow label is set to 290 zero, including non-tunneled traffic flows. Whether this is 291 appropriate depends on the expected traffic mix. 293 4. Security Considerations 295 The flow label is not protected in any way and can be forged by an 296 on-path attacker. However, it is expected that tunnel end-points and 297 the ECMP or LAG paths will be part of managed infrastructure that is 298 well protected against on-path attacks. Off-path attackers are 299 unlikely to guess a valid flow label if a pseudo-random value is 300 used. In either case, the worst an attacker could do against ECMP or 301 LAG is to attempt to selectively overload a particular path. For 302 further discussion, see [RFC3697] or its replacement 304 5. IANA Considerations 306 This document requests no action by IANA. 308 6. Acknowledgements 310 This document was suggested by corridor discussions at IETF76. Joel 311 Halpern made crucial comments on an early version. We are grateful 312 to Qinwen Hu for general discussion about the flow label. Valuable 313 comments and contributions were made by Jarno Rajahalme, Brian 314 Haberman, Sheng Jiang, Thomas Narten, and others. 316 This document was produced using the xml2rfc tool [RFC2629]. 318 7. Change log 320 draft-ietf-6man-flow-ecmp-01: updated after WG Last Call, 2011-02-10 322 draft-ietf-6man-flow-ecmp-00: after WG adoption at IETF 79, 323 2010-12-02 325 draft-carpenter-flow-ecmp-03: clarifications after further comments, 326 2010-10-07 328 draft-carpenter-flow-ecmp-02: updated after IETF77 discussion, 329 especially adding LAG, changed to BCP language, added second author, 330 2010-04-14 332 draft-carpenter-flow-ecmp-01: updated after comments, 2010-02-18 334 draft-carpenter-flow-ecmp-00: original version, 2010-01-19 336 8. References 338 8.1. Normative References 340 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 341 Requirement Levels", BCP 14, RFC 2119, March 1997. 343 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 344 (IPv6) Specification", RFC 2460, December 1998. 346 [RFC3697] Rajahalme, J., Conta, A., Carpenter, B., and S. Deering, 347 "IPv6 Flow Label Specification", RFC 3697, March 2004. 349 8.2. Informative References 351 [I-D.ietf-6man-flow-3697bis] 352 Amante, S., Carpenter, B., Jiang, S., and J. Rajahalme, 353 "IPv6 Flow Label Specification", 354 draft-ietf-6man-flow-3697bis-00 (work in progress), 355 January 2011. 357 [IEEE802.1AX] 358 Institute of Electrical and Electronics Engineers, "Link 359 Aggregation", IEEE Standard 802.1AX-2008, 2008. 361 [Lee10] Lee, D., Carpenter, B., and N. Brownlee, "Observations of 362 UDP to TCP Ratio and Port Numbers", Fifth International 363 Conference on Internet Monitoring and Protection ICIMP 364 2010, May 2010, . 367 [RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, 368 "Definition of the Differentiated Services Field (DS 369 Field) in the IPv4 and IPv6 Headers", RFC 2474, 370 December 1998. 372 [RFC2629] Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629, 373 June 1999. 375 [RFC2784] Farinacci, D., Li, T., Hanks, S., Meyer, D., and P. 376 Traina, "Generic Routing Encapsulation (GRE)", RFC 2784, 377 March 2000. 379 [RFC2991] Thaler, D. and C. Hopps, "Multipath Issues in Unicast and 380 Multicast Next-Hop Selection", RFC 2991, November 2000. 382 Authors' Addresses 384 Brian Carpenter 385 Department of Computer Science 386 University of Auckland 387 PB 92019 388 Auckland, 1142 389 New Zealand 391 Email: brian.e.carpenter@gmail.com 392 Shane Amante 393 Level 3 Communications, LLC 394 1025 Eldorado Blvd 395 Broomfield, CO 80021 396 USA 398 Email: shane@level3.net