6MAN W. Kumari Internet-Draft Google Intended status: Best Current Practice J. Jaeggli Expires:January 05,April 24, 2014 Zynga R. Bonica Juniper NetworksJuly 04,October 21, 2013 Operational Issues Associated With Long IPv6ExtensionHeader Chainsdraft-wkumari-long-headers-01draft-wkumari-long-headers-02 Abstract Thisdocument explains whymemo specifies requirements for IPv6 forwarders as they process packets with long headerchain length affects the cost of ASIC-based packet forwarding.chains. It also provides guidance for application developers whose applications might rely on long headers chains. As background, this memo explains how many ASIC-based IPv6 forwarders process packets and whysome network service providers discardprocessing of packets withexceptionallylong headerchains. Finally, it identifies a reasonable header chain length. While a network service provider can enforce any filtering policy that supports its security model, a network service provider should not discard IPv6 packets based solely upon header chain length if the header chain is not longer than the value specified herein.chains might be problematic. Requirements Language The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire onJanuary 05,April 24, 2014. Copyright Notice Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.TermnologyTerminology . . . . . . . . . . . . . . . . . . . . . . . 3 2.BackgroundForwarder Information Requirements . . . . . . . . . . . . . 4 3. Requirements For IPv6 Forwarders . . . . . . . . . . . .4 3. Need to see upper-layer to filter. . 5 4. Recommendations For Application Developers . . . . . . . . . 7 5. IANA Considerations . . .5 4. Recommendations. . . . . . . . . . . . . . . . . . 7 6. Security Considerations . . . . .6 5. IANA Considerations .. . . . . . . . . . . . . . 7 7. Acknowledgements . . . . . .6 6. Security Considerations. . . . . . . . . . . . . . . . 7 8. References . . .6 7. Acknowledgements. . . . . . . . . . . . . . . . . . . . . .7 8.8 8.1. Normative References . . . . . . . . . . . . . . . . . . 8 8.2. Informative References . .7. . . . . . . . . . . . . . . 8 Appendix A. Changes / Author Notes. . . . . . . . . . . . . . .78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . .79 1. IntroductionIn order to make a forwarding decision,IPv6 [RFC2460] forwarders can acquire information from theforwarding device may requirefollowing sources: o The IPv6 header o One or more IPv6 extension headers o An upper-layer header Section 2 of this document explains how IPv6 forwarders use information fromboththe IPv6 header andan upper layer header.IPv6 extension headers to provide traditional forwarding services. It also explains how IPv6 forwarders use information from the upper-layer header to provide enhanced forwarding services. When a software-based forwarderencountersprocesses an IPv6datagram that includes a long header chain,datagram, it parses the header chain, regardless of its length, acquires the required information and makesitsa forwarding decision. Typically,software-basedsoftware- based forwardersare not required toprocess alargerelatively small number of packets per second. Therefore, they can perform the above mentioned procedure within the constraints of their processing budget. By contrast, ASIC-based forwardersare engineered to forwardprocess many more packets per second. In order to fulfill this requirement,the forwarder copiesASIC-based forwarders copy a fixed number of bytes from the beginning of the packet toon-chipon- chip memory.The ASIC doesForwarders do this becauseitthey can access on-chip memory much more quickly thanitthey can access off-chip memory. Once the beginning of the packet has been transferred to on-chip memory, subsequent processingand forwarding decisionscanbe madeproceed very quickly. The act of copying bytes from the beginning of a packet to on-chip memoryconsumes both wall-time and processor cycles.consumes: o Processor cycles o On-chip memory o Wall-time Therefore, the number of bytes copied to on-chip memory must be chosen wisely. If a forwarder copies more bytes than it needs, it wastesresources, significantly increasing costresources anddecreasing maximumadversely impacts performance. If it copies too few bytes, itcannot parse the header chain andmay not have sufficient information to make a correct forwarding decision.As currently specified in [RFC2460], theThe IPv6 header chain is a variable-length data structure, whose size can exceed 64 kilobytes. However, packets with header chains exceeding128256 bytes are rarely observed on the Internet. Therefore, mostASIC- basedASIC-based forwarders copy a relatively small number of bytes from the beginning ofthea packet into on-chip memory.This document explains whyWhile this small number varies from platform to platform, it is generally much closer to 256 bytes than it is to 64 kilobytes. IPv6 forwarders MUST behave in a predictable manner when they process a packet whose header chain lengthaffectsexceeds thecostnumber of bytes copied to on-chip memory. Section 3 of this memo defines required behaviors. Application developers should be aware of how ASIC-basedpacket forwarding. It also explains why some network service providers discardforwarders process packets withexceptionallylong extension header chains.Finally, it identifies a reasonable header chain length. While a network service provider can enforce any filtering policy that supports its security model, a network service provider SHOULD NOT discard IPv6 packets based upon header chain length if the header chain is not longer than the value specified herein.Therefore, Section 4 of this document provides guidance to application developers. 1.1.TermnologyTerminology For the purposes of this document, the termsExtension Header, Header Chain"header chain" andUpper-layer Header"upper-layer" header are used asfollows: Extension Header : Extension Headers aredefined inSection 4 of [RFC2460]. Currently, six extension header types are defined. [RFC2460] defines[I-D.ietf-6man-oversized-header-chain]. This document also introduces thehop-by-hop, routing, fragmentfollowing terms: o forwarding service - a service that accepts a packet from one interface anddestination options extension header types. [RFC4302] definesforwards it through another o traditional forwarding service - a forwarding service in which all parameters to theauthentication header (AH) typeforwarding algorithm are drawn from the IPv6 header, the hop-by-hop extension header, and[RFC4303] definestheencapsulating security payload (ESP)routing extension headertype. Header Chain : The initialo enhanced forwarding service - a forwarding service in which parameters to the forwarding algorithm can be drawn from any portion ofan IPv6 datagram containing headers. The first member ofthe IPv6 header chainis always2. Forwarder Information Requirements When an IPv6header. For a subsequent header to qualify as a member of the header chain,forwarder provides traditional forwarding services, itmust be referencedextracts all information required by the"Next Header" field of the previous member offorwarding algorithm from theheader chain. The header chain can include IPv6 headers,IPv6 header, the hop-by-hop extensionheadersheader (if present), andan upper-layer header. Ifthe routing extension headerchain includes two IPv6 headers, as is(if present). In thecase when IPv6 is tunneled over IPv6,nominal case, thesecondIPv6 headerterminatescontains all information required by theheader chain. Any headers followingforwarding algorithm. However, thesecond IPv6hop-by-hop and routing extension headersare not memberscan also impact forwarding behavior. Section 4.2 of [RFC2460] explains how the hop-by-hop extension headerchain. Likewise, ifimpacts forwarding behavior. When theheader chain includes an ESPforwarder processes a hop-by- hop extension header, it examines each option contained by theESP header terminates the header chain. Onlyheader. If forwarder encounters an unrecognized hop-by-hop option, and thefirst 8 byteshigh-order bits of theESP header contributeoption type are "00", the forwarder skips over the option and continues to process subsequent options. However, if an forwarder encounters an unrecognized option, and theheader chain length. Any headers following ESP header are not membershigh-order bits of theheader chain. Upper-layer Header : In the general case,option type are "01", "10" or "11", theupper-layer header isforwarder discards thefirst memberpacket. Section 4.4 of [RFC2460] explains how theheader chain that is neither an IPv6 header nor an IPv6routing extensionheader. Typically, the upper-layerheaderrepresents a transport protocol (e.g., TCP, UDP, SCTP). However, it can representimpacts forwarding behavior. When the forwarder processes anon-transport layer protocol. For example, when IPv4packet whose destination address istunneled over IPv6,local to itself, it scans theupper-layerheaderis an IPv4chain, searching for a routing extension header. If the packet contains a routing extension headerchain includes two IPv6 headers, as isand thecase when IPv6 is tunneled over IPv6,forwarder recognizes thesecond IPv6routing headeris considered to betype, it processes theupper-layer header and terminatesheader. If the forwarder does not recognize the routing headerchain. Fortype, thepurposes of this document, whenrequired behavior depends upon theupper-layer protocolSegments Left field. If the Segments Left field isICMPv6,equal to zero, thefirst 32 bits offorwarder ignores theICMPv6 message (i.e.,routing extension header. Otherwise, thetype, code fieldsforwarder discards the packet. [RFC6275] andchecksum fields) are considered[RFC6554] describe currently defined routing extension header types. Some IPv6 forwarders provide enhanced forwarding services, such as firewall filtering, rate limiting and load balancing. In order tobeprovide these services, theICMPv6forwarder requires access to an upper layer header. Theupper-layer payload is not part of the upper-layer header and therefore, is not partfollowing are examples of enhanced services that require theIPv6 header chain. For example, if the upper-layer protocol is TCP,forwarder to examine the upper layer header: o Discard all packets directed to TCP port 25 o Rate limit packets destined for a particular address whose payload isnot part ofTCP and have the TCPheader orSYN bit set o Load balance packets across parallel links so that all packet belonging to particular TCP session traverse the same link 3. Requirements For IPv6header chain. 2. Background When IPv6 was first conceived, forwarding was largely performed in software running on general-purpose processors. DueForwarders The following requirements apply to all IPv6 forwarders: o REQ-1: An IPv6 forwarder SHOULD NOT discard a valid packet because of its header chain length. However, therequired performance, parsingforwarder MAY support alongconfiguration option that causes it to discard packets whose header chainwas notlength exceeds a specified value. o REQ-2: When processing packet that contains a hop-by-hop extension header, anissue. In the years between the conception ofIPv6and publication of this documentation, the Internet evolved as follows: o Throughput requirements increased dramatically, requiringforwarder MUST process thedeploymententire hop-by-hop extension header, regardless ofASIC-based forwardersits length. The forwarder MUST process each option as specified inboth core and edge networksSection 4.2 of [RFC2460]. oNew network types emerged, including very large enterprises, social networks, data centers and "clouds". Like core networks, these network require very high throughput. Like edge networks, these networks require "high-touch" edge services, which require the forwarderREQ-3: When processing a packet whose destination address is local toaccessitself, an IPv6 forwarder MUST scan the entire headerchain o Requirements for "high-touch" service, which require the forwarderchain, regardless of its length, in order toaccessdetermine whether theentirepacket contains a routing extension header. If the packet contains a routing extension header, the forwarder MUST process routing extension headerchain, increasedas specified innetworksSection 4.4 of [RFC2460]. The length ofall kinds During those years, IPv4 [RFC0791] wasthemost commonly deployed protocol onIPv6 header plus theInternet.length of the hop-by-hop extension header can exceed the number of bytes that an ASIC-based forwarder copies into on-chip memory. Therefore, in order to support REQ-2, ASIC-based forwarderscould meettypically support a special processing mechanism for packets containing hop-by-hop extensions. Also, therequirementscombined length of all headers preceding theevolving Internet because ASICs could predictrouting extension header may exceed the number of bytes thatneeded to be copiedan ASIC-based forwarder copies into on-chipmemorymemory. Therefore, in order tomakesupport REQ-3, ASIC-based forwarders typically support aforwarding decision. Today, asspecial processing mechanism for packets whose IPv6 destination address isbeing deployed, ASIC-forwarders cannot safely predictlocal to thesizeforwarder. This forwarding mechanism is capable of processing theheader chain. This leads to complexity and vulnerability in handlingrouting extensionheaders. For this reason, many network operators filter all IPv6 packets containing extension headers. 3. Needheader, even if it begins beyond of the portion of the packet that was copied tosee upper-layeron-chip memory. The following requirements apply tofilter There isIPv6 forwarders that provide enhanced forwarding services: o REQ-4: If aschool of thoughtforwarder's ability to deliver enhanced services is limited in any way by extension header length, thatISPs, content-providers and enterprises should notlimitation MUST beperforming any sort of filteringreflected inthe networkuser documentation. For example, assume that a forwarder provides a load balancing service, and that it acquires information required by thefiltering is more appropriately performed atservice from theend hosts. Unfortunately this solution, while clean and elegant, simply doesn't work inIPv6 header and thereal world. Filtering unknown traffic atupper-layer header. If theedge (and / orservice behaves in one manner when all required information is contained by thecore)first N bytes of thenetworkheader chain and in another manner when all required information isneeded for a numbernot contained by the first N bytes ofreasons, somethe header chain, user documentation MUST reflect both behaviors as well as the value ofwhich are discussed below.N. oISPs (and cloud providers) are routinely called uponREQ-5: If a forwarder's ability tofilter DoS traffic aimed at their customers (for example to block multi-Gbps DNS reflection attacks aimed at web servers, etc). At Large Edge Sites thisdeliver an enhanced service isoften a large part of the "service" providedlimited by extension header length, thenetwork team. o IPv6 stacks are still relatively immature and operators still have concerns that stack or kernel vulnerabilities may still surface. If this turns outpolicy specification language used to configure the enhanced service MUST be sufficiently robust to address thecase,limitation. For example, assume that the forwarder provides ameansfirewall service. The firewall service is capable of filtering packets directed toprotecta particular TCP port, but only if theend nodesTCP header isneeded. o In many enterprisescontained by theend systems are not sufficiently hardened to be exposed onfirst N bytes of thepublic Internet. Even if there were no remotely exploitable operating system vulnerabilities there is significant risk that an employee may install vulnerable software, accidentally share confidential files or folders publicly or start offering (unauthorized) services. o Content providers (and similar) need toheader chain. In this case, it MUST beablepossible tofilter traffic and only allow "expected" traffic into their networks. This is needed bothconfigure one policy forDoS protection, but alsopackets directed toensure that development systems, databases, test systems, etc arethe specified port, another policy for packet notaccidentally exposed. o While it would be nice if all employees, system and database administrators could be trusteddirected toalways ensure that onlythe"correct" services were listening on ports, that all software was always fully patches (and contained no vulnerabilities), that confidential data was only shared with internal addressedspecified port, and a third policy for packets whose TCP destination port is unknown. 4. Recommendations For Application Developers Applications developers should be aware thatall credentials were strongmany ISPs andregularly changed,enterprises filter or severely rate limit packets containing long header chains. They do thissimply does not reflect reality. Allbecause ofthese lead tolimitations imposed by therequirement that operators be able to filterASIC-based forwarders deployed atLayer 3their edges. ISPs andLayer 4, at line rate,enterprises accept these limitations as part of an engineering trade off, inthe network. Obviously, to be able to filterwhich high-speed forwarding is achieved atlayers 3 and 4,therouter needs to be able to see the layer 3 and 4 information. Unfortunately, if the sizecost of limiting enhanced services for packets with long extensionheader chain varies between 0 and 64 kilobytes, extension headers cannot be processed efficiently in ASICs. Because many implementation do not process IPv6 extension headers well, many operators filterheaders. For example, assume that an enterprise deploys the following firewall filtering policy at its edge: o Permit allIPv6packetsthat include them. 4. Recommendations An ISP SHOULD NOT discard IPv6whose destination is TCP port 80 o Discard all packetsbased solely uponwhose destination is not TCP port 80 o Discard all packets whose header chainlength ifis so long that TCP port information is not accessible to the filtering function In this case, the enterprise discards all packets whose destination cannot be determined by the filtering function. Aside from the issue of header chaincontains 128 bytes or fewer. However, it is common practice ISPs tolength, operators may filterIPv6packetswith longcontaining extensionheader chains. This document offers no recommendation regardingheaders that may either compromise the network's security posture or require inordinate processing resources. This memo does not specify a maximumextensionheader chainlengthlength. However, this memo does note thatan ISP should forward. See Section 1.1 for a formal definitionat the time of its publication, the number of bytes that ASIC-based forwarders copy from the beginning of a packet to on-chip memory varies from platform to platform. Typical platforms copy between 128 and 384 bytes. Therefore, application developers should avoid sending packets who headerchain.chain length is in that range, unless they have some assurance that their packets will not be discarded. 5. IANA Considerations This document makes no requests of the IANA 6. Security ConsiderationsThere are potential implications to the filtering or acceptances of packets which cannot be processed according to the configuration of the network operator. It is clear from the vantage point of the authors that implementors and operators should be aware of implications of relying on extension header chains or apply policies that must necessarily discard packets which contain them.TBD 7. Acknowledgements The authors wish to thank Paul Hoffman, KK and Fernando Gont. The authors also express their gratitude to an anonymous donor, without whom this document would not have been written. 8. References 8.1. Normative References[RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.[I-D.ietf-6man-oversized-header-chain] Gont, F., Manral, V., and R. Bonica, "Implications of Oversized IPv6 Header Chains", draft-ietf-6man-oversized- header-chain-08 (work in progress), October 2013. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998.[RFC4302] Kent,[RFC2474] Nichols, K., Blake, S.,"IP Authentication Header",Baker, F., and D. Black, "Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers", RFC4302,2474, December2005. [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)",1998. 8.2. Informative References [RFC6275] Perkins, C., Johnson, D., and J. Arkko, "Mobility Support in IPv6", RFC4303, December 2005.6275, July 2011. [RFC6554] Hui, J., Vasseur, JP., Culler, D., and V. Manral, "An IPv6 Routing Header for Source Routes with the Routing Protocol for Low-Power and Lossy Networks (RPL)", RFC 6554, March 2012. Appendix A. Changes / Author Notes. [RFC Editor: Please remove this section before publication ] Template to -00 o Initial submission. -00 to -01 o Added maximum header chain recommendation. o Rewrite the forwarding description. Authors' Addresses Warren Kumari Google 1600 Amphitheatre Parkway Mountain View, CA 94043 US Email: warren@kumari.net Joel Jaeggli Zynga 675 East Middlefield Mountain View, CA USA Email: jjaeggli@zynga.com Ronald P Bonica Juniper Networks 2251 Corporate Park Drive Herndon, VA USA Email: rbonica@juniper.net