idnits 2.17.1 draft-carpenter-flow-ecmp-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 8 has weird spacing: '...routing and l...' -- The document date (October 7, 2010) is 4949 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) -- Obsolete informational reference (is this intentional?): RFC 2629 (Obsoleted by RFC 7749) Summary: 2 errors (**), 0 flaws (~~), 2 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: April 10, 2011 Level 3 6 October 7, 2010 8 Using the IPv6 flow label for equal cost multipath routing and link 9 aggregation in tunnels 10 draft-carpenter-flow-ecmp-03 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 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 April 10, 2011. 36 Copyright Notice 38 Copyright (c) 2010 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 2. Normative Notation . . . . . . . . . . . . . . . . . . . . . . 6 55 3. Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . 6 56 4. Security Considerations . . . . . . . . . . . . . . . . . . . . 7 57 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7 58 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 7 59 7. Change log . . . . . . . . . . . . . . . . . . . . . . . . . . 7 60 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 61 8.1. Normative References . . . . . . . . . . . . . . . . . . . 7 62 8.2. Informative References . . . . . . . . . . . . . . . . . . 8 63 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 8 65 1. Introduction 67 When several network paths between the same two nodes are known by 68 the routing system to be equally good (in terms of capacity and 69 latency), it may be desirable to share traffic among them. Two such 70 techniques are known as equal cost multipath routing (ECMP) and link 71 aggregation (LAG) [IEEE802.1AX]. There are of course numerous 72 possible approaches to this, but certain goals need to be met: 73 o Roughly equal share of traffic on each path. 74 o Work-conserving method (no idle time when queue is non-empty). 75 o Minimize or avoid out-of-order delivery for individual traffic 76 flows. 78 There is some conflict between these goals: for example, strictly 79 avoiding idle time could cause a small packet sent on an idle path to 80 overtake a bigger packet from the same flow, causing out-of-order 81 delivery. 83 One lightweight approach to ECMP or LAG is this: if there are N 84 equally good paths to choose from, then form a modulo(N) hash 85 [RFC2991] from a consistent set of fields in each packet header, and 86 use the resulting value to select a particular path. If the hash 87 function is chosen so that the hash values have a uniform statistical 88 distribution, this method will share traffic roughly equally between 89 the N paths. If the header fields included in the hash are 90 consistent, all packets from a given flow will generate the same 91 hash, so out-of-order delivery will not occur. Assuming a large 92 number of unique flows are involved, it is also probable that the 93 method will be work-conserving, since the queue for each link will 94 remain non-empty. 96 The question with such a method is which IP header fields are chosen 97 to identify a flow and, consequently, are used as input keys to a 98 modulo(N) hash algorithm. 100 In the remainder of this document, we will use the term "flow" to 101 represent a sequence of packets that may be identified by either the 102 source and destination IP addresses alone {2-tuple} or the source and 103 destination IP addresses, protocol and source and destination port 104 numbers {5-tuple}. It should be noted that the latter is more 105 specifically referred to as a "microflow" in [RFC2474], but this term 106 is not used in connection with the flow label in [RFC3697]. 108 The question with such a method, then, is which IP header fields to 109 include to identify a flow. A minimal choice in the routing system 110 is simply to use a hash of the source and destination IP addresses, 111 i.e., the 2-tuple. This is necessary and sufficient to avoid out-of- 112 order delivery, and with a wide variety of sources and destinations, 113 as one finds in the core of the network, sometimes sufficient to 114 achieve work-conserving load sharing. In practice, implementations 115 often use the 5-tuple {dest addr, source addr, protocol, dest port, 116 source port} as input keys to the hash function, to maximize the 117 probability of evenly sharing traffic over the equal cost paths. 118 However, including transport layer information as input keys to a 119 hash may be a problem for IPv4 fragments [RFC2991]. In addition, 120 protocol and destination port numbers in the hash will not only make 121 the hash slightly more expensive to compute, but will not 122 particularly improve the hash distribution, due to the prevalence of 123 well known port numbers and popular protocol numbers. Ephemeral 124 ports, on the other hand, are quite well distributed [Lee10]. In the 125 case of IPv6, protocol numbers are particularly inconvenient due to 126 the variable placement of and variable length of next-headers. In 127 addition, [RFC2460] recommends that all next-headers, except hop-by- 128 hop options, should not be inspected by intermediate nodes in the 129 network, presumably to make introduction of new next-headers more 130 straightforward. 132 The situation is different in tunneled scenarios. Identifying a flow 133 inside the tunnel is more complicated, particularly because nearly 134 all hardware can only identify flows based on information contained 135 in the outermost IP header. Assume that traffic from many sources to 136 many destinations is aggregated in a single IP-in-IP tunnel from 137 tunnel end point (TEP) A to TEP B (see figure). Then all the packets 138 forming the tunnel have outer source address A and outer destination 139 address B. In all probability they also have the same port and 140 protocol numbers. If there are multiple paths between routers R1 and 141 R2, and ECMP or LAG is applied to choose a particular path, the 142 5-tuple and its hash will be constant and no load sharing will be 143 achieved. If there is much tunnel traffic, this will result in a 144 high probability of congestion on one of the paths between R1 and R2. 146 _____ _____ _____ _____ 147 | TEP |_________| R1 |-------------| R2 |_________| TEP | 148 |__A__| |_____|-------------|_____| |__B__| 149 tunnel ECMP or LAG tunnel 150 here 152 Also, for IPv6, the total number of bits in the 5-tuple is quite 153 large (296), as well as inconvenient to extract due to the next- 154 header placement. This may be challenging for some hardware 155 implementations, raising the potential that network equipment vendors 156 might sacrifice the length of the fields extracted from an IPv6 157 header. The question therefore arises whether the 20-bit flow label 158 in IPv6 packets would be suitable for use as input to an ECMP or LAG 159 hash algorithm. If it could be used in place of the port numbers and 160 protocol number in the 5-tuple, the hash calculation would be 161 simplified. 163 The flow label is left experimental by [RFC2460] but is better 164 defined by [RFC3697]. We quote three rules from that RFC: 165 1. "The Flow Label value set by the source MUST be delivered 166 unchanged to the destination node(s)." 167 2. "IPv6 nodes MUST NOT assume any mathematical or other properties 168 of the Flow Label values assigned by source nodes." 169 3. "Router performance SHOULD NOT be dependent on the distribution 170 of the Flow Label values. Especially, the Flow Label bits alone 171 make poor material for a hash key." 173 These rules, especially the last one, have caused designers to 174 hesitate about using the flow label in support of ECMP or LAG. The 175 fact is today that most nodes set a zero value in the flow label, and 176 the first rule definitely forbids the routing system from changing 177 the flow label once a packet has left the source node. Considering 178 normal IPv6 traffic, the fact that the flow label is typically zero 179 means that it would add no value to an ECMP or LAG hash. But neither 180 would it do any harm to the distribution of the hash values. If the 181 community at some stage agrees to set pseudo-random flow labels in 182 the majority of traffic flows, this would add to the value of the 183 hash. 185 However, in the case of an IP-in-IPv6 tunnel, the TEP is itself the 186 source node of the outer packets. Therefore, a TEP may freely set a 187 flow label in the outer IPv6 header of the packets it sends into the 188 tunnel. In particular, it may follow the [RFC3697] suggestion to set 189 a pseudo-random value. 191 The second two rules quoted above need to be seen in the context of 192 [RFC3697], which assumes that routers using the flow label in some 193 way will be involved in some sort of method of establishing flow 194 state: "To enable flow-specific treatment, flow state needs to be 195 established on all or a subset of the IPv6 nodes on the path from the 196 source to the destination(s)." The RFC should perhaps have made 197 clear that a router that has participated in flow state establishment 198 can rely on properties of the resulting flow label values without 199 further signaling. If a router knows these properties, rule 2 is 200 irrelevant, and it can choose to deviate from rule 3. 202 In the tunneling situation sketched above, routers R1 and R2 can rely 203 on the flow labels set by TEP A and TEP B being assigned by a known 204 method. This allows a safe ECMP or LAG method to be based on the 205 flow label without breaching [RFC3697]. 207 2. Normative Notation 209 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 210 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 211 document are to be interpreted as described in [RFC2119]. 213 3. Guidelines 215 We assume that the routers supporting ECMP or LAG (R1 and R2 in the 216 above figure) are unaware that they are handling tunneled traffic. 217 If it is desired to include the IPv6 flow label in an ECMP or LAG 218 hash in the tunneled scenario shown above, the following guidelines 219 apply: 220 o Inner packets MUST be encapsulated in an outer IPv6 packet whose 221 source and destination addresses are those of the tunnel end 222 points (TEPs). 223 o The flow label in the outer packet SHOULD be set by the sending 224 TEP to a pseudo-random 20-bit value in accordance with [RFC3697]. 225 The same flow label value MUST be used for all packets in a single 226 user flow, as determined by the IP header fields of the inner 227 packet. 228 * Note that this rule is a SHOULD rather than a MUST, to permit 229 individual implementers to take an alternative approach if they 230 wish to do so. Such an alternative MUST conform to [RFC3697]. 231 o The sending TEP MUST classify all packets into flows, once it has 232 determined that they should enter a given tunnel, and then write 233 the relevant flow label into the outer IPv6 header. A user flow 234 could be identified by the ingress TEP most simply by its 235 {destination, source} address pair (coarse) or by its 5-tuple 236 {dest addr, source addr, protocol, dest port, source port} (fine). 237 This is an implementation detail in the sending TEP. 238 * It might be possible to make this classifier stateless, by 239 using a suitable 20 bit hash of the inner IP header's 2-tuple 240 or 5-tuple as the pseudo-random flow label value. 241 o At intermediate router(s) that perform load distribution of 242 tunneled packets whose source address is a TEP, the hash algorithm 243 used to determine the outgoing component-link in an ECMP and/or 244 LAG toward the next-hop MUST minimally include the triple {dest 245 addr, source addr, flow label} to meet the [RFC3697] rules. 246 * Intermediate router(s) MAY also include {protocol, dest port, 247 source port} as input keys to the ECMP and/or LAG hash 248 algorithms, to provide sufficient entropy in cases where the 249 flow-label is currently set to zero. 251 4. Security Considerations 253 The flow label is not protected in any way and can be forged by an 254 on-path attacker. Off-path attackers are unlikely to guess a valid 255 flow label if a pseudo-random value is used. In either case, the 256 worst an attacker could do against ECMP or LAG is to attempt to 257 selectively overload a particular path. For further discussion, see 258 [RFC3697]. 260 5. IANA Considerations 262 This document requests no action by IANA. 264 6. Acknowledgements 266 This document was suggest by corridor discussions at IETF76. Joel 267 Halpern made crucial comments on an early version. We are grateful 268 to Qinwen Hu for general discussion about the flow label. Valuable 269 comments and contributions were made by Jarno Rajahalme, Brian 270 Haberman, Sheng Jiang, and others. 272 This document was produced using the xml2rfc tool [RFC2629]. 274 7. Change log 276 draft-carpenter-flow-ecmp-03: clarifications after further comments, 277 2010-10-07 279 draft-carpenter-flow-ecmp-02: updated after IETF77 discussion, 280 especially adding LAG, changed to BCP language, added second author, 281 2010-04-14 283 draft-carpenter-flow-ecmp-01: updated after comments, 2010-02-18 285 draft-carpenter-flow-ecmp-00: original version, 2010-01-19 287 8. References 289 8.1. Normative References 291 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 292 Requirement Levels", BCP 14, RFC 2119, March 1997. 294 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 295 (IPv6) Specification", RFC 2460, December 1998. 297 [RFC3697] Rajahalme, J., Conta, A., Carpenter, B., and S. Deering, 298 "IPv6 Flow Label Specification", RFC 3697, March 2004. 300 8.2. Informative References 302 [IEEE802.1AX] 303 Institute of Electrical and Electronics Engineers, "Link 304 Aggregation", IEEE Standard 802.1AX-2008, 2008. 306 [Lee10] Lee, D., Carpenter, B., and N. Brownlee, "Observations of 307 UDP to TCP Ratio and Port Numbers", Fifth International 308 Conference on Internet Monitoring and Protection ICIMP 309 2010, May 2010, . 312 [RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, 313 "Definition of the Differentiated Services Field (DS 314 Field) in the IPv4 and IPv6 Headers", RFC 2474, 315 December 1998. 317 [RFC2629] Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629, 318 June 1999. 320 [RFC2991] Thaler, D. and C. Hopps, "Multipath Issues in Unicast and 321 Multicast Next-Hop Selection", RFC 2991, November 2000. 323 Authors' Addresses 325 Brian Carpenter 326 Department of Computer Science 327 University of Auckland 328 PB 92019 329 Auckland, 1142 330 New Zealand 332 Email: brian.e.carpenter@gmail.com 333 Shane Amante 334 Level 3 Communications, LLC 335 1025 Eldorado Blvd 336 Broomfield, CO 80021 337 USA 339 Email: shane@level3.net