view Side-By-Side changes
Network Working Group S. Kent Internet Draft K. Seo draft-ietf-ipsec-rfc2401bis-01.txt BBN Technologiesdraft-ietf-ipsec-rfc2401bis-00.txt October 2003Obsoletes: RFC 2401 January 2004 ExpiresAprilJuly 2004 Security Architecture for the Internet Protocol Status of this Memo This document is an Internet Draft and is subject to all provisions of Section 10 of RFC2026. Internet Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet Drafts Internet Drafts are draft documents valid for a maximum of 6 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 a "work in progress". The list of current Internet Drafts can be accessed athttp://www.ietf.org/lid-abstracts.htmlhttp://www.ietf.org/1id-abstracts.html The list of Internet Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html Copyright (C) The Internet Society(2003).(2004). All Rights Reserved. Kent [Page 1] Internet Draft Security Architecture for IPOctober 2003January 2004 Table of Contents 1.Introduction.........................................................4Introduction.........................................................3 1.1 Summary of Contents ofDocument.................................4Document.................................3 1.2Audience........................................................4Audience........................................................3 1.3 RelatedDocuments...............................................5Documents...............................................4 2. DesignObjectives....................................................5Objectives....................................................4 2.1 Goals/Objectives/Requirements/ProblemDescription...............5Description...............4 2.2 Caveats andAssumptions.........................................6Assumptions.........................................5 3. System Overview.....................................................7.....................................................6 3.1 What IPsecDoes.................................................7Does.................................................6 3.2 How IPsec Works.................................................8 3.3 Where IPsec May Be Implemented..................................9 4. SecurityAssociations................................................9Associations...............................................10 4.1 Definition and Scope...........................................10 4.2 Security AssociationFunctionality.............................12Functionality.............................13 4.3 Combining Security Associations................................13 4.4Security Association Databases.................................15Major IPsec Databases..........................................14 4.4.1 The Security Policy Database(SPD)........................16(SPD)........................15 4.4.2Selectors.................................................20Selectors.................................................19 4.4.3 Security Association Database(SAD).......................25(SAD).......................22 4.5Basic Combinations of Security Associations....................28 4.6SA and KeyManagement..........................................31 4.6.1Management..........................................24 4.5.1 ManualTechniques.........................................31 4.6.2Techniques.........................................24 4.5.2 Automated SA and KeyManagement...........................31 4.6.3Management...........................25 4.5.3 Locating a SecurityGateway...............................32 4.7Gateway...............................26 4.6 Security Associations andMulticast............................33Multicast............................26 5. IP TrafficProcessing...............................................34Processing...............................................27 5.1 Outbound IP TrafficProcessing.................................34Processing (protected-to-unprotected)......28 5.1.1Selecting and UsingHandling anSA or SA Bundle....................34Outbound Packet That Must Be Dropped..........?? 5.1.2 Header Construction for TunnelMode.......................35Mode.......................30 5.1.2.1 IPv4 -- Header Construction for TunnelMode..........36Mode..........32 5.1.2.2 IPv6 -- Header Construction for TunnelMode..........37Mode..........33 5.2 Processing Inbound IPTraffic..................................38 5.2.1 Selecting and Using an SA or SA Bundle....................38 5.2.2 Handling of AH and ESP tunnels............................41Traffic (unprotected-to-protected).......34 6. ICMP Processing (relevant toIPsec).................................41 6.1 PMTU/DF Processing.............................................42 6.1.1 DF Bit....................................................42 6.1.2 Path MTU Discovery (PMTU).................................42 6.1.2.1 Propagation of PMTU..................................42 6.1.2.2 Calculation of PMTU..................................43 6.1.2.3 Granularity of PMTU Processing.......................43 6.1.2.4 PMTU Aging...........................................44IPsec).................................36 7.Auditing............................................................45Auditing............................................................37 8.Use in Systems Supporting Information Flow Security.................45 8.1 Relationship Between Security Associations and Data Sensitivity.46 8.2 Sensitivity Consistency Checking...............................47 Kent [Page 2] Internet Draft Security Architecture for IP October 2003 8.3 Additional MLS Attributes for Security Association Databases...47 8.4 Additional Inbound Processing Steps for MLS Networking.........47 8.5 Additional Outbound Processing Steps for MLS Networking........48 8.6 Additional MLS Processing for Security Gateways................48 9. Performance Issues..................................................48 10.ConformanceRequirements...........................................49 11.Requirements............................................37 9. SecurityConsiderations............................................49 12.Considerations.............................................37 10. Differences from RFC2401..........................................49 Acknowledgements.......................................................502401..........................................37 Acknowledgements.......................................................37 Appendix A --Glossary.................................................51Glossary.................................................38 Appendix B --Analysis/Discussion of PMTU/DF/Fragmentation Issues......54 B.1 DF bit.........................................................54 B.2 Fragmentation..................................................54 B.3 Path MTU Discovery.............................................58 B.3.1 Identifying the Originating Host(s).......................59 B.3.2 Calculation of PMTU.......................................61 B.3.3 Granularity of Maintaining PMTU Data......................62 B.3.4 Per Socket Maintenance of PMTU Data.......................63 B.3.5 Delivery of PMTU Data to the Transport Layer..............63 B.3.6 Aging of PMTU Data........................................63Decorrelation............................................41 Appendix C --Sequence Space Window Code Example.......................64 Appendix D --Categorization of ICMPmessages..........................66 References.............................................................69messages [May be deleted].........44 References.............................................................47 AuthorInformation.....................................................71 Notices................................................................71Information.....................................................49 Notices................................................................50 Kent [Page3]2] Internet Draft Security Architecture for IPOctober 2003January 2004 1. Introduction 1.1 Summary of Contents of Document Thismemodocument specifies the base architecture for IPsec compliant systems.The goal of the architecture isIt describes how to providevariousa set of security services for traffic at the IP layer, in both the IPv4 and IPv6 environments. This document describes thegoalsrequirements for systems that implement IPsec, the fundamental elements of such systems,their componentsand howtheythe elements fit togetherwith each otherand fit into the IP environment. It also describes the security services offered by the IPsec protocols, and how these services can be employed in the IP environment. This document does not address all aspects of the IPsec architecture.SubsequentOther documentswilladdress additional architectural detailsof a more advanced nature,in specialized environments, e.g., use of IPsec in NAT environments and morecompletecomprehensive support for IP multicast. Thefollowingfundamental components of the IPsec security architecture are discussed in terms of their underlying, required functionality. Additional RFCs (see Section 1.3 for pointers to other documents) define the protocols in (a), (c), and (d). a. Security Protocols -- Authentication Header (AH) and Encapsulating Security Payload (ESP) b. Security Associations -- what they are and how they work, how they are managed, associated processing c. Key Management -- manual andautomaticautomated (The Internet Key Exchange (IKE)) d.AlgorithmsCryptographic algorithms for authentication and encryption This document is notan overalla Security Architecture for the Internet; it addresses security only at the IP layer, provided through the use of a combination of cryptographic and protocol security mechanisms. The spelling "IPsec" is preferred andstandard.used throughout this and all related IPsec standards. All other capitalizations of IPsec (e.g., IPSEC, IPSec, ipsec) are deprecated. However, any capitalization ofIPsecthe sequence of letters "IPsec" should be understood to refer to the IPsec protocols. The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this document, are to be interpreted as described in RFC 2119 [Bra97]. 1.2 Audience The target audience for this documentincludes implementers ofis primarily individuals who implement this IP security technologyand others interested in gaining a general background understanding ofor who architect systems that will use thissystem. In particular, prospective Kent [Page 4] Internet Draft Security Architecture for IP October 2003technology. Technically adept users of this technology (end users or system administrators) also are part of the target Kent [Page 3] Internet Draft Security Architecture for IP January 2004 audience. A glossary is provided as an appendix to help fill in gaps in background/vocabulary. This document assumes that the reader is familiar with the InternetProtocol,Protocol (IP), related networking technology, and general information system security terms and concepts. 1.3 Related Documents As mentioned above, other documents provide detailed definitions of some of the components of IPsec and of their inter-relationship. They include RFCs on the following topics: a."IP Security Document Roadmap" [TDG97] -- a document providing guidelines for specifications describing encryption and authentication algorithms used in this system. b.security protocols -- RFCs describing the Authentication Header (AH)[KA98a][Ken04b] and Encapsulating Security Payload (ESP)[KA98b][Ken04a] protocols.c.b. cryptographic algorithms forauthenticationintegrity and encryption -- one RFC that defines the mandatory, default algorithms for use with AH and ESP [Eas03], aseparatesimilar RFC that defines the mandatory algorithms foreachuse with IKEv2 [Sch03] plus a separate RFC for each cryptographic algorithm.d.c. automatic key management -- RFCs on "The Internet Key Exchange(IKE)" [HC98], "Internet Security Association and Key Management Protocol (ISAKMP)" [MSST97],"The OAKLEY Key Determination(IKEv2) Protocol"[Orm97],[Kau03] and"The Internet IP Security Domain of Interpretation"Cryptographic Algorithms forISAKMP" [Pip98].use in the Internet Key Exchange Version 2" [Sch03] 2. Design Objectives 2.1 Goals/Objectives/Requirements/Problem Description IPsec is designed to provide interoperable, high quality, cryptographically-based security for IPv4 and IPv6. The set of security services offered includes access control, connectionless integrity, data origin authentication,protection againstdetection and rejection of replays (a form of partial sequence integrity), confidentiality(encryption),(via encryption), and limited traffic flow confidentiality. These services are provided at the IP layer, offering protection for all protocols that may be carried over IPand/or next layer protocols. IPsec providesin arange of security services to help secure communication for the computers and networks it protects. In addition tostandard fashion (including IPlayer confidentiality and integrity, receiver-optional anti- replay and data origin authentication (via SA key management), IPsec also provides access control for all traffic traversing it. Thusitself). IPsec includes a specification for minimal firewall functionality,Kent [Page 5] Internet Draft Security Architecture for IP October 2003since that isa necessary partan essential aspect ofsecure IP.access control at the IP layer. Implementations are free to provide more sophisticated firewall mechanisms, and to implement theIPsec-mandatedIPsec- mandated functionality using those more sophisticated mechanisms.These objectives(Note that interoperability may suffer if additional firewall constraints on traffic flows aremetimposed by an IPsec implementation but cannot be negotiated based on the traffic selector features defined in this document and negotiated via IKEv2.) The IPsec firewall function makes use of the Kent [Page 4] Internet Draft Security Architecture for IP January 2004 cryptographically-enforced authentication and integrity provided for all IPsec traffic to offer better access control than could be obtained through use of an independent firewall (one not privy to IPsec internal parameters). Most of the security services are provided through use of two traffic security protocols, the Authentication Header (AH) and the Encapsulating Security Payload (ESP), and through the use of cryptographic key management procedures and protocols. The set of IPsec protocols employed inanya context, and the ways in which they are employed, will be determined by thesecurityusers/administrators in that context. It is the goal of the IPsec architecture to ensure that compliant implementations include the services andsystemmanagement interfaces needed to meet the security requirements ofusers, applications, and/or sites/organizations.a broad user population. Whenthese mechanisms areIPsec is correctly implemented and deployed,theyit ought nottoadversely affect users, hosts, and other Internet components that do not employthese security mechanismsIPsec forprotection of their traffic. These mechanisms alsotraffic protection. IPsec security protocols (AH & ESP, and to a lesser extent, IKE) are designed to be cryptographic algorithm-independent. This modularity permits selection of different sets of cryptographic algorithms as appropriate, without affecting the other parts of the implementation. For example, different user communities may select different sets of cryptographic algorithms (creating cryptographically-enforced cliques) if required. Astandardset of default cryptographic algorithms for use with AH and ESP is specified [Eas03] to facilitate interoperability in the global Internet. The use of these cryptographic algorithms, in conjunction with IPsec traffic protection and key management protocols, is intended to permit system and application developers to deploy high quality, Internet layer, cryptographic security technology. 2.2 Caveats and Assumptions The suite of IPsec protocols and associated default cryptographic algorithms are designed to provide high quality security for Internet traffic. However, the security offered by use of these protocols ultimately depends on the quality of the their implementation, which is outside the scope of this set of standards. Moreover, the security of a computer system or network is a function of many factors, including personnel, physical, procedural, compromising emanations, and computer security practices. Thus IPsec is only one part of an overall system security architecture. Finally, the security afforded by the use of IPsec is critically dependent on many aspects of the operating environment in which the Kent [Page 5] Internet Draft Security Architecture for IP January 2004 IPsec implementation executes. For example, defects in OS security, poor quality of random number sources, sloppy system management protocols and practices, etc. can all degrade the security provided by IPsec. As above, none of these environmental attributes are within the scope of this or other IPsec standards.Kent [Page 6] Internet Draft Security Architecture for IP October 20033. System Overview[Will change to reflect decisions re: [40],[44],[45] processing model; and [46] nesting and bundling of SAs]This section provides a high level description of how IPsec works, the components of the system, and how they fit together to provide the security services noted above. The goal of this description is to enable the reader to "picture" the overall process/system, see how it fits into the IP environment, and to provide context for later sections of this document, which describe each of the components in more detail. An IPsec implementation operates in ahost orhost, as a securitygateway environment,gateway, or as an independent device, affording protection to IP traffic. (A security gateway is an intermediate system implementing IPsec, e.g., a firewall or router that has been IPsec-enabled.) More detail on these classes of implementations is provided later, in Section 3.3. The protection offered by IPsec is based on requirements defined by a Security Policy Database (SPD) established and maintained by a user or system administrator, or by an application operating within constraints established by either of the above. In general, packets are selected for one of three processing actions based on IP andtransportnext layer header information (Selectors, Section 4.4.2) matched against entries in the database (SPD). Each packet is either afforded IPsec security services, discarded, or allowed to bypassIPsec,IPsec protection, based on the applicabledatabaseSPD policies identified by the Selectors. 3.1 What IPsec Does IPsecprovidescreates a boundary between unprotected and protected interfaces, for a host or a network (See Figure 1 below). Traffic traversing the boundary is subject to the access controls specified by the user or administrator responsible for the IPsec configuration. These controls indicate whether packets cross the boundary unimpeded, are afforded security services via AH or ESP, or are discarded. IPsec security services are offered at the IP layerby enabling a system to select requiredthrough selection of appropriate security protocols,determine the algorithm(s) to use for the service(s),cryptographic algorithms, andput in place anycryptographickeys required to provide the requested services.keys. IPsec can be used to protect one or more "paths" between a pair of hosts, between a pair of security gateways, or between a security gateway and a host.(The term "security gateway" is used throughout the IPsec documents to refer to an intermediate system that implements IPsec protocols. For example, a router or a firewall implementing IPsec is a security gateway.) The set of security services that IPsec can provide includes access control, connectionless integrity, data origin authentication, rejection of replayed packets (a formCompliant implementations MUST support all three forms ofpartial sequence integrity), confidentiality (encryption), and limited traffic flow confidentiality. Because these services are provided at theconnectivity noted here. Kent [Page 6] Internet Draft Security Architecture for IPlayer, they canJanuary 2004 Unprotected ^ ^ | | +-------------|-------|-------+ | +-------+ | | | | |Discard|<--| V | | +-------+ |B +--------+ | ................|y..| AH/ESP |..... IPsec Boundary | +---+ |p +--------+ | | |IKE|<----|a ^ | | +---+ |s | | | +-------+ |s | | | |Discard|<--| | | | +-------+ | | | +-------------|-------|-------+ | | V V Protected Figure 1. Top Level IPsec Processing Model In this diagram, "unprotected" refers to an interface that might also beused by any higher layer protocol,described as "black" or "ciphertext." Here, "protected" refers to an interface that might also be described as "red" or "plaintext." The protected interface noted above may be internal, e.g.,TCP, UDP, ICMP, BGP, etc.in a host implementation of IPsec; the protected interface may link to a socket layer interface presented by the OS. In this document, the term "inbound" refers to traffic entering an IPsec implementation via the unprotected interface. The term "outbound" refers to traffic entering the implementation via the protected interface, or emitted by the implementation on the protected side of the boundary and directed toward the unprotected interface. An IPsecDOI alsoimplementation may support more than one interface on either or both sides of the boundary. Note the facilities for discarding traffic on either side of the IPsec boundary, the bypass facility that allows traffic to transit the boundary without cryptographic protection, and the reference to IKE as a protected-side key and security management function. IPsec optionally supports negotiation of IP compression [SMPT98], motivated in part by the observation that when encryption is employed within IPsec, it prevents effective compression by lower protocol layers. Kent [Page 7] Internet Draft Security Architecture for IPOctober 2003 layers.January 2004 3.2 How IPsec Works IPsec uses two protocols to provide traffic security services -- Authentication Header (AH) and Encapsulating Security Payload (ESP). Both protocols are described inmoredetail in their respective RFCs [KA98a, KA98b]. IPsec implementations MUST support ESP and MAY support AH.o The IP Authentication Header (AH) [KA98a] provides connectionless integrity, data origin authentication, and an optional anti-replay service. o The Encapsulating Security Payload (ESP) protocol [KA98b] may provide confidentiality (encryption), and limited traffic flow confidentiality. It also may provide connectionless(Support for AH has been downgraded to MAY because experience has shown that there are very few contexts in which ESP cannot provide the requisite security services. Note that ESP can be used to provide only integrity, without confidentiality, making it comparable to AH in most contexts.) o The IP Authentication Header (AH) [Ken04b] offers integrity and data origin authentication,and anwith optional (at the discretion of the receiver) anti-replayservice. (One orfeatures. o The Encapsulating Security Payload (ESP) protocol [Ken04a] offers theothersame set ofthese security services must be applied wheneverservices, and also offers confidentially. Use of ESP in a confidentiality-only mode is discouraged. When ESP isinvoked.)used with confidentiality enabled, there are provisions for limited traffic flow confidentiality, i.e., provisions for concealing packet length, and to facilitate efficient generation and discard of dummy packets. This capability is likely to be effective primarily in VPN and overlay network contexts. o Both AH and ESPare vehicles foroffer access control,based onenforced through the distribution of cryptographic keys and the management of traffic flowsrelative to these security protocols.as dictated by the Security Policy Database (SPD, Section 4.4). These protocols may be appliedaloneindividually or in combination with each other to providea desired set ofsecurity services in IPv4 and IPv6. However, most security requirements can be met through the use of ESP by itself. Each protocol supports two modes of use: transport mode and tunnel mode. In transportmode the protocolsmode, AH and ESP provide protection primarily for next layer protocols; in tunnel mode,the protocolsAH and ESP are applied to tunneled IP packets. The differences between the two modes are discussed in Section 4. IPsec allows the user (or system administrator) to control the granularity at which a security service is offered. For example, one can create a single encrypted tunnel to carry all the traffic between two security gateways or a separate encrypted tunnel can be created for each TCP connection between each pair of hosts communicating across these gateways.IPsecIPsec, through the SPD managementmust incorporateparadigm, incorporates facilities for specifying: o which security services to use and in what combinations Kent [Page 8] Internet Draft Security Architecture for IP January 2004 o the granularity at whicha given securityprotection should be applied o the cryptographic algorithms used to effect cryptographic-based security Becausethesemost of the security services provided by IPsec require the useshared secret values (cryptographic keys),of cryptographic keys, IPsec relies on a separate set of mechanismsKent [Page 8] Internet Draft Security Architecture for IP October 2003for putting these keys in place.(The keys are used for authentication/integrity and encryption services.)This document requires support for both manual andautomaticautomated distribution of keys. It specifies a specific public-key based approach(IKE -- [MSST97, Orm97, HC98])(IKEv2 [KAU04]) forautomaticautomated key management, but other automated key distribution techniques MAY be used.For example, KDC-based systems such as Kerberos and other public-key systems such as SKIP could be employed. 3.3 Where IPsec May Be Implemented There are severalNote: This document mandates support for several features for which support is available in IKEv2 but not in IKEv1, e.g., negotiation of an SA representing ranges of source and destination ports or negotiation of multiple SAs with the same selectors. Therefore this document assumes use of IKEv2 or a key and security association management system with comparable features. 3.3 Where IPsec Can Be Implemented There are many ways in which IPsec may be implemented in ahosthost, or in conjunction with a router or firewall(toto create a securitygateway). Several common examples are provided below:gateway, or as an independent security device. a.Integration ofIPsec may be integrated into the native IPimplementation.stack. This requires access to the IP source code and is applicable to both hosts and securitygateways.gateways, although native host implementations benefit the most from this strategy, as explained later (Section 4.4.1, paragraph 4; Section 4.4.2, last paragraph) b."Bump-in-the-stack"In a "bump-in-the-stack" (BITS)implementations, whereimplementation, IPsec is implemented "underneath" an existing implementation of an IP protocol stack, between the native IP and the local network drivers. Source code access for the IP stack is not required in this context, making this implementation approach appropriate for use with legacy systems. This approach, when it is adopted, is usually employed in hosts. c. The use of anoutboard cryptodedicated, inline security protocol processor is a common design feature ofnetwork securitysystems used by the military, and of some commercial systems as well. It is sometimes referred to as a"Bump-in-the-wire""bump-in-the-wire" (BITW) implementation. Such implementations may be designed to serve either a host or agateway (or both).gateway. Usually the BITW device is itself IP addressable. When supporting a single host, it may be quite analogous to a Kent [Page 9] Internet Draft Security Architecture for IP January 2004 BITS implementation, but in supporting a router or firewall, it must operate like a security gateway.4. Security Associations [Will change to reflect decisions re: - [40,44,45] changesThis document often talks inprocessing model (caching, etc.); - [46] nesting/bundlingterms ofSAs; - [67] IPsec management traffic; - [82] clarification re: creationhost or security gateway use ofSAs]IPsec, without regard to whether the implementation is native, BITS or BITW. When the distinctions among these implementation options are significant, the document makes reference to specific implementation approaches. 4. Security Associations This section defines Security Association management requirements for all IPv6 implementations and for those IPv4 implementations that implement AH, ESP, or both. The concept of a "Security Association" (SA) is fundamental to IPsec. Both AH and ESP make use of SAs and a major function of IKE is the establishment and maintenance of Security Associations. All implementations of AH or ESP MUST supportKent [Page 9] Internet Draft Security Architecture for IP October 2003the concept of a Security Association as described below. The remainder of this section describes various aspects of Security Association management, defining required characteristics for SA policy management, traffic processing, and SA management techniques. 4.1 Definition and Scope[May change to reflect decisions re: [50] should transport support by SG be MAY or MUST and [87] follow-on proposed approach]A Security Association (SA) is a simplex "connection" that affords security services to the traffic carried by it. Security services are afforded to an SA by the use of AH, or ESP, but not both. If both AH and ESP protectionisare applied to a traffic stream, then two(or more)SAsaremust be created and coordinated toaffordeffect protectiontothrough iterated application of thetraffic stream.security protocols. To secure typical, bi-directional communication between twohosts, or between two security gateways, twoIPsec-enabled systems, a pair of Security Associations (one in each direction) are required.A security association is uniquely identified by a triple consistingIKE explicitly creates SA pairs in recognition ofa Security Parameter Index (SPI),this common usage requirement. For anIP Destination Address, and a security protocol (AH or ESP) identifier. The set of SPI values in the range 1 through 255 are reserved bySA used to carry unicast (or anycast) traffic, theInternet Assigned Numbers Authority (IANA) for future use. A reservedSPIvalue will not normally be assigned(Security Parameters Index - see Appendix A and AH [Ken04b] and ESP [Ken04a] specifications) byIANA unless the use of the assigned SPI value is specified initself suffices to specify anRFC. The SPI value of zero (0) is reserved for local implementation-specific use and MUST NOT be sent on the wire. For example,SA. However, as akey managementlocal matter, an implementationMAYmay choose to use thezeroSPIvalue to mean "No Security Association Exists" during the period whenin conjunction with the IPsecimplementation has requested that its key management entity establish a new SA, but theprotocol type (AH or ESP) for SAhas not yet been established. In principle, the Destination Address may be a unicast address,identification. If anIP broadcast address, or aIPsec implementation supports multicast, then it MUST support multicastgroup address. However,SAs using the algorithm described in AH and ESP for mapping inbound IPsecSA management mechanisms currently are definedprotected datagrams to SAs. (Implementations that support onlyforunicastSAs. Hence, in the discussionstraffic need not implement thatfollow, SAs will be described primarily in the context of point-to-point communication, even though the concept is applicable in the point-to-multipoint case as well.demultiplexing algorithm.) Note: If different classes of traffic (distinguished by DSCPbits)bits Kent [Page 10] Internet Draft Security Architecture for IP January 2004 [NiBlBaBL98], [Gro02]) are sent on the same SA, this could result in inappropriate discarding of lower priority packets due to the windowing mechanism used by receivers to reject replays. Therefore a sender SHOULD put traffic of different classes, but with the same selector values, on different SAs to appropriately support QoS. To permit this, the IPsec implementation MUST permit establishment and maintenance of multiple SAs between a given sender and receiver, with the same selectors. Distribution of traffic among these parallel SAs to support QoS is locally determined by the sender and is not negotiatedKent [Page 10] Internet Draft Security Architecture for IP October 2003by IKE. The receiver MUST process the packets from the different SAs without prejudice. DISCUSSION: While the DSCP [NiBlBaBL98, Gro02] and ECN [RaFlBL01] fields are not "selectors", as that term in used in this architecture, the sender will need a mechanism to direct packets with a given (set of) DSCP values to the appropriate SA. This mechanism might be termed a"filter"."classifier". As noted above, two types of SAs are defined: transport mode and tunnel mode. IKE creates pairs of SAs, so for simplicity, we choose to require that both SAs in a pair be of the same mode, transport or tunnel. A transport mode SA is a security association typically employed betweentwo hosts. Also, in the case wherea pair of hosts to provide end-to-end security services. When link (vs. end-to-end) security is desired between two intermediate systems along a path, transport mode MAY be used betweentwosecuritygateways.gateways or between a security gateway and a host. In the latter case, transport modewouldmay be used to support IP-in-IP [Per96] or GRE tunneling [FaLiHaMeTr00] over transport mode SAs.Note that theThe access control functions that are an important part of IPsec are significantlyconstrainedlimited in thiscontext. Socontext, as they cannot be applied to the end-to-end headers of the packets that traverse a transport mode SA used in this fashion. Thus this way of using transport mode should be evaluated carefully before beingemployed.employed in a specific context. In IPv4, a transport mode security protocol header appears immediately after the IP header and any options, and before anyhighernext layer protocols (e.g., TCP or UDP). In IPv6, the security protocol header appears after the base IP header andextensions,selected extension headers, but may appear before or after destinationoptions, andoptions; it MUST appear beforehighernext layer protocols. In the case of ESP, a transport mode SA provides security services only for thesehighernext layer protocols, not for the IP header or any extension headers preceding the ESP header. In the case of AH, the protection is also extended to selected portions of the IPheader,header preceding it, selected portions of extension headers, and selected options (contained in the IPv4 header, IPv6Hop- by-HopHop-by-Hop extension header, or IPv6 Destination Kent [Page 11] Internet Draft Security Architecture for IP January 2004 extension headers). For more details on the coverage afforded by AH, see the AH specification[KA98a].[Ken04b]. A tunnel mode SA is essentially an SA applied to an IPtunnel. With only a coupletunnel, with the access controls applied to the headers ofexceptions,the traffic inside the tunnel. In general, whenever either end of a security association is a security gateway, the SA MUST be tunnel mode. Thus an SA between two security gateways is typically a tunnel mode SA, as is an SA between a host and a security gateway. Note that for the case where traffic is destined for a security gateway, e.g., SNMP commands, the security gateway is acting as a host and transport mode is allowed.But in thatIn this case, the SA terminates at a host (management) function within a security gatewayis not acting as a gateway, i.e., not transiting traffic.and thus merits different treatment. Also, as noted above, security gateways MAY support a transport mode SA to provide linksecurity.security for IP traffic. Two hosts MAY establish a tunnel mode SA between themselves.The requirementSeveral concerns motivate the use of tunnel mode forany (transit traffic)an SA involving a securitygateway to be a tunnel SA arises due to the need to avoid potential problems with regard to fragmentation and reassembly of IPsec packets, and in circumstances wheregateway. For example, if there are multiple paths (e.g., via different security gateways)existto the same destination behindthe Kent [Page 11] Internet Draft Security Architecture for IP October 2003securitygateways. For a tunnel mode SA, theregateways, it isan "outer" IP headerimportant thatspecifies the IPsec processing destination, plusan"inner" IP header that specifies the (apparently) ultimate destination forIPsec packet be sent to thepacket. Thesecurityprotocol header appears aftergateway with which theouter IP header, and beforeSA was negotiated. Similarly, a packet that might be fragmented en route must have all the fragments delivered to the same IPsec instance for reassembly. Also, when a fragment is processed by IPsec and transmitted, then fragmented en route, it is critical that there be inner and outer headers to retain the fragmentation state data for the pre- and post-IPsec packet formats. Hence there are several reasons for employing tunnel mode when either end of an SA is a security gateway. Note: AH and ESP cannot be applied using transport mode to IPv4 packets that are fragments. Only tunnel mode can be employed in such cases. For a tunnel mode SA, there is an "outer" IP header that specifies the IPsec processing source and destination, plus an "inner" IP header that specifies the (apparently) ultimate source and destination for the packet. The security protocol header appears after the outer IP header, and before the inner IP header. If AH is employed in tunnel mode, portions of the outer IP header are afforded protection (as above), as well as all of the tunneled IP packet (i.e., all of the inner IP header is protected, as well ashighernext layer protocols). If ESP is employed, the protection is afforded only to the tunneled packet, not to the outer header. In summary, a) A host implementation of IPsec MUST support both transport and tunnel mode. This is true for native, BITS, and BITW implementations for hosts. Kent [Page 12] Internet Draft Security Architecture for IP January 2004 b) A security gatewayis required toMUST supportonlytunnel modebutand MAY support transport mode. If it supports transport mode, that should be used only when the security gateway is acting as a host, e.g., for network management, or to provide link security. 4.2 Security Association Functionality The set of security services offered by an SA depends on the security protocol selected, the SA mode, the endpoints of the SA, and on the election of optional services within the protocol. For example, both AHprovides data originand ESP offer integrity and authentication services, but the coverage differs for each protocol andconnectionlessdiffers for transport vs. tunnel mode. If the integrity of an IPv4 option or IPv6 extension header must be protected en route between sender and receiver, AH can provide this service, except for the mutable (non- predictable) parts of the IPdatagrams (hereafter referredor extension headers. However, the same security may be achieved in some contexts by applying ESP toas just "authentication").a tunnel carrying a packet. The"precision"granularity ofthe authentication serviceaccess control provided isa function ofdetermined by thegranularitychoice of thesecurity association with which AH is employed, as discussed in Section 4.4.2, "Selectors". AH also offers an anti-replay (partial sequence integrity) service at the discretion ofselectors that define each security association. Moreover, thereceiver, to help counter denial of service attacks. AH is an appropriate protocol to employ when confidentiality is not required (or is not permitted, e.g , due to government restrictions on use of encryption). AH also providesauthenticationfor selected portions of the IP header, which may be necessary in some contexts. For example, if the integrity of an IPv4 option or IPv6 extension header must be protected en route between sender and receiver, AH can provide this service (except for the non- predictable but mutable parts of the IP header.) ESP optionally provides confidentiality for traffic. (The strengthmeans employed by IPsec peers, e.g., during creation ofthe confidentiality service depends in part, on the encryption algorithm employed.) ESP also may optionally provide authentication (as defined above). If authentication is negotiated foranESP SA, Kent [Page 12] Internet Draft Security Architecture for IP October 2003 the receiverIKE (vs. child) SA alsomay elect to enforce an anti-replay service with the same features aseffects theAH anti-replay service. The scopegranularity of theauthentication offered by ESP is narrower than for AH, i.e., the IP header(s) "outside" the ESP header is(are) not protected. If only the next layer protocols need to be authenticated, then ESP authentication is an appropriate choice and is more space efficient than use of AH encapsulating ESP. Note that although both confidentiality and authentication are optional, they cannot both be omitted. At least one of them MUST be selected.access control afforded. If confidentialityserviceis selected, then an ESP (tunnel mode) SA between two security gateways can offer partial traffic flow confidentiality. The use of tunnel mode allows the inner IP headers to be encrypted, concealing the identities of the (ultimate) traffic source and destination. Moreover, ESP payload padding also can be invoked to hide the size of the packets, further concealing the external characteristics of the traffic. Similar traffic flow confidentiality services may be offered when a mobile user is assigned a dynamic IP address in a dialup context, and establishes a (tunnel mode) ESP SA to a corporate firewall (acting as a security gateway). Note that fine granularity SAs generally are more vulnerable to traffic analysis than coarse granularity oneswhichthat are carrying traffic from many subscribers.4.3 Combining Security Associations [May change depending on decisions re: [46] nested SAsNOTE: A compliant implementation MUST NOT allow instantiation of an ESP SA that employs both NULL encryption andbundles] The IP datagrams transmitted overno integrity algorithm. An attempt to negotiate such anindividualSAare afforded protectionis an auditable event byexactly one security protocol, either AH or ESP, but not both. Sometimes a security policy may callboth initiator and responder. The audit log entry fora combination of servicesthis event SHOULD include the current date/time, local IKE IP address, and remote IKE IP address. The initiator SHOULD record the relevant SPD entry. Kent [Page 13] Internet Draft Security Architecture fora particular traffic flow that isIP January 2004 4.3 Combining Security Associations This document does notachievable with a single SA. In such instances it will be necessary to employ multiple SAs to implement the requiredrequire support for nested securitypolicy. The term "security association bundle"associations or for what RFC 2401 called "SAbundle" is applied to a sequence of SAs through which traffic mustbundles." These features still can beprocessed to satisfy a security policy. The ordereffected by appropriate configuration of both thesequenceSPD and the local forwarding functions (for inbound and outbound traffic), but this function isdefined byoutside of thepolicy. (Note thatIPsec module and thus theSAs that comprise a bundle may terminate at different endpoints. For example, one SA may extend betweenscope of this specification. As amobile hostresult, management of nested/bundled SAs is potentially more complex and less assured than under the model implied by RFC 2401. An implementation that provides support for nested SAs SHOULD provide asecurity gateway andmanagement interface that enables asecond, nested SA may extenduser or administrator toa host behindexpress thegateway.) Security associations may be combined into bundles in two ways: transport adjacencynesting requirement, anditerated tunneling. o Transport adjacency refersthen create the appropriate SPD entries and forwarding table entries toapplying more than one security protocoleffect the requisite processing. 4.4 Major IPsec Databases IPsec implementation are largely a local matter, not subject to standardization. However, some external aspects of thesame IP datagram, without invoking tunneling. This approachprocessing must be standardized, tocombining AHensure interoperability andESP allowsto provide a minimum management capability that is essential foronly one levelproductive use ofKent [Page 13] Internet Draft Security ArchitectureIPsec. This section describes a general model for processing IPOctober 2003 combination; further nesting yields no added benefit (assuming use of adequately strong algorithmstraffic relative to IPsec functionality, ineach protocol) since the processingsupport of these interoperability and functionality goals. The model described below isperformed at one IPsec instance atnominal; implementations need not match details of this model as presented, but the external behavior of implementations MUST correspond to the externally observable characteristics of this model in order to be deemed compliant. There are two nominal databases in this model: the(ultimate) destination. Host 1 ---Security---- Internet --Policy Database and the Security--- Host 2 | | Gwy 1 Gwy 2 | | | | | | | -----Security Association 1 (ESP transport)------- | | | -------SecurityAssociation2 (AH transport)---------- o Iterated tunneling refers toDatabase. The first specifies theapplication of multiple layerspolicies that determine the disposition ofsecurity protocols effected throughall IPtunneling. This approach allows for multiple levels of nesting, since each tunnel can originatetraffic inbound orterminate atoutbound from adifferent IPsec site along the path. No special treatment is expected for ISAKMP traffic at intermediatehost or securitygateways other than what can be specified through appropriate SPD entries (See Case 3 in Section 4.5) Theregateway. The second database contains parameters that are3 basic cases of iterated tunneling -- supportassociated with each established (keyed) security association. A third database, the Peer Authorization Database (PAD) isrequired only for cases 2also required. The PAD provides a link between an SA management protocol like IKE and3.: 1. both endpoints forthe SPD. The PAD indicates the range of identities that a peer is authorized to represent when (child) SAs are negotiated with thesame --peer. Theinner and outer tunnels could eachidentities may beeither AHa list of IP address ranges orESP, though itsymbolic names. The fundamental requirement associated with the PAD isunlikelythatHost 1 would specify both to bethesame, i.e., AH inside of AH or ESP inside of ESP. Host 1 --- Security ---- Internet -- Security --- Host 2 | | Gwy 1 Gwy 2 | | | | | | | -------Security Association 1 (tunnel)---------- | | | | ---------Security Association 2 (tunnel)-------------- 2. one endpoint oftraffic selectors passed by theSAs isSA management protocol for comparison against thesame -- The inner and outer tunnels could eachSPD MUST beeither AH or ESP. Host 1 --- Security ---- Internet -- Security --- Host 2 | | Gwy 1 Gwy 2 | | | | | | ----Security Association 1 (tunnel)---- | | | ---------Security Association 2 (tunnel)------------- 3. neither endpoint isverified as authorized relative to thesame -- The inner and outer tunnels could each be either AH or ESP.authenticated peer of the SA management protocol. (See also Section 4.5.3, which levies requirements on the PAD in support of locating security gateways.) Kent [Page 14] Internet Draft Security Architecture for IPOctober 2003 Host 1 --- Security ---- Internet -- Security --- Host 2 | Gwy 1 Gwy 2 | | | | | | --Security Assoc 1 (tunnel)- | | | -----------Security Association 2 (tunnel)----------- These two approachesJanuary 2004 The PAD alsocan be combined,specifies how to authenticate each peer, e.g.,an SA bundle could be constructed from one tunnel mode SA and onevia shared secret ortwo transport mode SAs, applied in sequence. (See Section 4.5 "Basic Combinationsuse ofSecurity Associations.") Note that nested tunnels can also occur where neithera certificate. If a shared secret is used, thesource norsecret is stored here. If a certificate is used, thedestination endpoints of anytrust anchor for the certificate is part of thetunnels arePAD. Because thesame. In that case, there wouldPAD might beno host orincorporated into the SA management protocol implementation, it is not discussed extensively in this document. If an IPsec implementation acts as a security gatewaywith a bundle corresponding to the nested tunnels. For transport modefor multiple subscribers, it MAY implement multiple separate IPsec contexts. Each context MAY have and use completely independent identities, policies, key management SAs,only one ordering of security protocols seems appropriate. AHand/or IPsec SAs. This isapplied to both the next layer protocols and (parts of)for theIP header. Thus if AH is used inmost part atransport mode, in conjunctionlocal implementation matter. However, a means for associating inbound (SA) proposals withESP, AH SHOULD appear aslocal contexts is required. To this end, if supported by thefirst header after IP, priorkey management protocol in use, context identifiers MAY be conveyed from initiator to responder in theappearance of ESP. Insignaling messages, with the result thatcontext, AH is appliedIPsec SAs are created with a binding tothe ciphertext output of ESP. In contrast, for tunnel mode SAs, one can imagine uses for various orderings of AH and ESP. The required set of SA bundle types that MUST be supported byacompliantparticular context. The IPsecimplementation ismodel describedin Section 4.5. 4.4 Security Association Databases [Will changehere embodies a clear separation between forwarding (routing) and security decisions, toreflect decisions re: - [40,44,45] changes in processing model (caching, etc.); - [46] nesting/bundlingaccommodate a wide range ofSAs; - [67]contexts where IPsecmanagement traffic; - [82] clarification re: creation of SAs] - Many ofmay be employed. Forwarding may be trivial, in thedetails associated with processing IP trafficcase where there are only two interfaces, or it may be complex, e.g., if there are multiple protected or unprotected interfaces or if the context inanwhich IPsecimplementation are largelyis implemented employs alocal matter, not subject to standardization. However, some external aspects of thesophisticated forwarding function. IPsec assumes only that outbound and inbound traffic that has passed through IPsec processingmust be standardized, to ensure interoperabilityis forwarded in a fashion consistent with the context in which IPsec is implemented. Support for nested SAs is optional; if required, it requires coordination between forwarding tables and SPD entries toprovidecause aminimum management capability thatpacket to traverse the IPsec boundary more than once. 4.4.1 The Security Policy Database (SPD) A security association isessential for productive use of IPsec. This section describesageneral modelmanagement construct used to enforce security policy forprocessing IPtrafficrelativecrossing the IPsec boundary. Thus an essential element of SA processing is an underlying Security Policy Database (SPD) that specifies what services are tosecurity associations,be offered to IP datagrams and insupportwhat fashion. The form ofthese interoperabilitythe database and its interface are outside the scope of this specification. However, this section specifies minimum management functionalitygoals. The model described below is nominal; compliant implementations need not match details of this model as presented, but the external behavior of such implementationsthat must bemappableprovided, tothe externally observable characteristics of this model. There are two nominal databases in this model: the Security Policy Databaseallow a user or system administrator to control whether andthe Security Association Database. The former specifies the policies that determine the disposition of all IPhow IPsec is applied to trafficinboundtransmitted oroutbound fromreceived by ahost, security gateway, or BITShost orBITW IPsec implementation.transiting a security gateway. Thelatter database contains parametersSPD, or relevant caches, must be consulted during the processing of ALL traffic (inbound and outbound), including non-IPsec traffic, thataretraverses the IPsec boundary. This includes IPsec management traffic such as IKE. An IPsec implementation MUST have at least one SPD, and it MAY support Kent [Page 15] Internet Draft Security Architecture for IPOctober 2003 associated with each (active) security association. This section also definesJanuary 2004 multiple SPDs, if appropriate for theconcept of a Selector,context in which the IPsec implementation operates. There is no requirement to maintain SPDs on aset of IP and next layer protocol field valuesper interface basis, as was specified in RFC 2401. However, if an implementation supports multiple SPDs, then it MUST include an explicit SPD selection function, that isused by the Security Policy Databaseinvoked tomapselect the appropriate SPD for outbound traffic processing. The inputs toa policy, i.e., an SA (or SA bundle). Each interface for which IPsec is enabled requires nominally separate inbound vs.this function are the outbounddatabases (SADpacket andSPD), because ofany local metadata (e.g., thedirectionality of many ofinterface via which thefields that are used as selectors. Typically there is just one such interface, for a host or security gateway (SG). Note that an SG would always have at least 2 interfaces, but the "internal" onepacket arrived) required to effect thecorporate net, usually would not have IPsec enabled and so only one pair of SADs and one pairSPD selection function. The output ofSPDs would be needed. Ontheother hand, if a host had multiple interfaces orfunction is anSG had multiple external interfaces, it might be necessarySPD ID. Each SPD entry is either implicitly or explicitly directional. For traffic protected by IPsec, the source and destination address and ports are swapped tohaverepresent directionality, consistent with IKE conventions. For bypassed or discarded traffic, separateSADinbound and outbound entries are supported, e.g., to permit unidirectional flows if required. The SPDpairs for each interface. IPsec devices supporting services such as: security gateway for multiple subscribers, IPsec-protected tunnel links for overlay networks, etc. MAY implement multiple separate IPsec contexts. These contexts MAY have and use completely independent identities, policies, key management SAs, and/or IPsec SAs. Thisisfor the most part a local implementation matter. However, a means for associating inbound proposalsan ordered database, consistent withlocal contexts is required. To this end, if supported bythekey management protocoluse of ACLs or packet filters inuse, context identifiers MAY be conveyed from initiatorfirewalls, routers, etc. The ordering requirement arises because entries often will overlap due toresponder inthesignalling messages, withpresence of (non-trivial) ranges as values for selectors. Thus a user or administrator MUST be able to order theresult that IPsec SAs are created withentries to express abindingdesired access control policy. There is no way to impose aparticular context. 4.4.1 The Security Policy Database (SPD) Ultimately, a security association is a management construct used to enforce a security policy ingeneral, canonical order on SPD entries, because of theIPsec environment. Thus an essential elementallowed use ofSA processing is an underlying Security Policy Database (SPD) that specifies what serviceswildcards for selector values and because the different types of selectors are not hierarchically related. The processing model described in this document assumes the ability tobe offereddecorrelate overlapping SPD entries toIP datagrams andpermit caching, which enables more efficient processing of outbound traffic inwhat fashion. Thesecurity gateways and BITS/BITW implementations. (Native host implementations have an implicit form of caching available, due to thedatabaseuse of, for example, socket interfaces for applications, andits interface are outside the scope of this specification. However, this section does specify certain minimum management functionality that mustthus there is no requirement to beprovided,able toallowdecorrelate SPD entries in these implementations.) Decorrelation is auser or system administrator to control how IPsecmeans of improving performance and simplifying the processing description; it isapplied to traffic transmitted or received bynot ahost or transitingrequirement for asecurity gateway. Thecompliant implementation. Appendix B provides an algorithm that can be used to decorrelate SPDmustentries, but any algorithm that produces equivalent output may beconsulted during the processing ofused. Note that when an SPD entry is decorrelated alltraffic (INBOUND and OUTBOUND), including non-IPsec traffic. In order to support this,theSPD requires distinctresulting entriesfor inbound and outbound traffic. One can thinkMUST be grouped together, so that all members ofthis as separate SPDs (inbound vs. outbound). In addition, a nominally separatethe group derived from an individual, SPDmustentry (prior to decorrelation) can all beKent [Page 16] Internet Draft Security Architecture for IP October 2003 provided for each IPsec-enabled interface.placed into caches and into the SAD at the same time. The intent is that use of a decorrelated SPD ought not create more SAs than would have resulted from use of a not-decorrelated SPD. An SPD must discriminate among traffic that is afforded IPsec Kent [Page 16] Internet Draft Security Architecture for IP January 2004 protection and traffic that is allowed to bypass IPsec. This applies to the IPsec protection to be applied by a sender and to the IPsec protection that must be present at the receiver. For any outbound or inbound datagram, three processing choices are possible: discard, bypass IPsec, or apply IPsec. The first choice refers to traffic that is not allowed toexit the host,traverse thesecurity gateway, or be delivered to an application at all.IPsec boundary (in the specified direction). The second choice refers to traffic that is allowed to pass without additional IPsec protection. The third choice refers to traffic that is afforded IPsec protection, and for such traffic the SPD must specify the securityservices to be provided,protocols to be employed, their mode, security service options, and the cryptographic algorithms to beused, etc. For every IPsec implementation, there MUSTused. An SPD is logically divided into three pieces, all of which should bean administrative interface that allows a user or system administrator to managedecorrelated (with theSPD. Specifically, every inbound or outbound packet isexception noted above for native host implementations) to facilitate caching. The SPD-S (secure traffic) contains entries for all traffic subject toprocessing byIPsecand the SPD must specify what action will be taken in each case. Thus the administrative interface must allow the user (or system administrator) to specify the security processingprotection. SPD-O (outbound) contains entries for all outbound traffic that is to be bypassed or discarded. SPD-I (inbound) is applied toany packet enteringinbound traffic that will be bypassed orexiting the system, on a packet by packet basis. (In a hostdiscarded. If an IPsec implementationmaking use of a socket interface,supports only one SPD, then the SPD consists of all three parts. If multiple SPDs are supported, some of them maynot need tobeconsultedpartial, e.g., some SPDs might contain only SPD-I entries, to control inbound bypassed traffic on aper packet basis, but the effect is still the same.)per-interface basis. Themanagement interfacesplit allows SPD-I to be consulted without having to consult SPD-S, for such traffic. Since the SPD-I is just a part of the SPD, the same rule applies here, i.e., if a packet that is looked up in the SPD-I cannot be matched to an entry there, then the packet MUST be discarded. Note that for outbound traffic, if a match is not found in SPD-S, then SPD-O must be checked to see if the traffic should be bypassed. Similarly, if SPD-O is checked first and no match is found, then SPD- S must be checked. For every IPsec implementation, there MUST be a management interface that allows a user or system administrator to manage the SPD. The interface must allow the user (or administrator) to specify the security processing to be applied to every packet that traverses the IPsec boundary. (In a native host IPsec implementation making use of a socket interface, the SPD may not need to be consulted on a per packet basis, as noted above.) The management interface for the SPD MUST allow creation of entries consistent with the selectors defined in Section 4.4.2, and MUST support (total) ordering of theseentries. It is expected that through the use of wildcards in various selector fields, and because all packets on a single UDP or TCP connection will tend to match a single SPD entry,entries, as seen via thisrequirement will not impose an unreasonably detailed level of SPD specification.interface. The SPD entries' selectors are analogous towhat arethe ACL or packet filters commonly found in a stateless firewall or packet filtering router and which are currentlymanageablemanaged this way. In host systems, applications MAY be allowed toselect what security processing is to be applied to the traffic they generate and consume. (Meanscreate SPD entries. (The means ofsignallingsignaling such requests to the IPsec implementation are outside the scope of this standard.) However, the system administrator MUST be able to specify whether or not a user or Kent [Page 17] Internet Draft Security Architecture for IP January 2004 application can override (default) system policies.Note that application specified policies may satisfy system requirements, so that the system may not need to do additional IPsec processing beyond that needed to meet an application's requirements.The form of the management interface is not specified by this document and may differ for hosts vs. security gateways, and within hosts the interface may differ for socket-based vs. BITS implementations. However, thisKent [Page 17] Internet Draft Security Architecture for IP October 2003document does specify a standard set of SPD elements that all IPsec implementations MUST support.The SPD contains an ordered list of policy entries.EachpolicySPD entry specifies packet disposition as BYPASS, DISCARD, or IPsec. The entry is keyed by a list of one or moreselectors that define the setselectors. The SPD contains an ordered list ofIP traffic encompassed by this policy entry. (Thethese entries. The required selector types are defined in Section4.4.2.)4.4.2. These selectors are used to define the granularity ofpoliciesthe SAs that are created in response to an outbound packet orSAs.in response to a proposal from a peer. The SPD MUST permit asecurityuser or administrator to specify policy entries as follows: -each SPD entrySPD-I: For inbound traffic that isa list of 1to be bypassed ormore selector set pairs - each selector set pairdiscarded, the entry consists ofone selector set fortheSA fromvalues of theinitiatorselectors that apply to thereceiver and one selector set for the SA from the receivertraffic tothe initiator.be bypassed or discarded. -each selector setSPD-O: For outbound traffic that is to be bypassed or discarded, the entry consists of thefollowing selector types: - source IP address range - destination IP address range - protocol(or OPAQUE or ANY) - source port range (or OPAQUE or ANY) - destination port range (or OPAQUEvalues of the selectors that apply to the traffic to be bypassed orANY) - IPv6 mobility header type (MH type) range - ICMP message type range - ICMP codes range - name (list)discarded. -data sensitivity level (list) This will enable policiesSPD-S: For traffic that is to bespecified that, for example, support useprotected using IPsec, the entry consists ofa single SAthe values of the selectors that apply tocarrythe trafficfor multiple protocols. Notethatthis text describestherepresentation ininitiator will send or receive and theSPDvalues thatmaps into IKE payloads. The management GUI can offer the user other forms of data entry and display, e.g.,apply to theoption of using address masks as well as ranges not representable by a mask, and symbolic names for protocols, ports, etc. (Do not confusetraffic that theuse of symbolic namesresponder will receive or send. - The selector types are defined ina management interface with the reference to symbolic SPDSection 4.2.2 below. For each selectortypes.) Ifin an SPD entry, in addition to thereserved, symbolic selectorliteral values that define a match, there are two special values: ANY and OPAQUE. The former valueOPAQUEisemployed foragiven selector type, only it may appear in the list forwildcard thattype, and it must appear only oncematches any value in thelist for that type. Each entry includes an indicationcorresponding field ofwhether traffic matching this policy will be bypassed, discarded, or subject to IPsec processing. If IPsec processing is to be applied,theentry includes an SA (or SA bundle) specification, listingpacket, whereas theIPsec protocols, modes, and algorithms to be employed, including any nesting requirements. For example, an entrylatter value indicates that the corresponding selector field is not examined, e.g., because it maycall for all matching traffic tobeprotectedobscured byESP in transport mode using 3DES-CBC with an explicit IV, nested inside of AHencryption already applied to the packet or may not be present intunnel mode using HMAC/SHA-1.a fragment. For eachselector,selector in an SPD entry, the policy entry specifies how to derive the corresponding values for a new Security Association Database (SAD, see Section 4.4.3) entry from those in the SPD and thepacket (Note that at present, ranges are only supported for IP addresses; but wildcarding canpacket. The goal is to allow an SAD entry and an SPD cache entry to beexpressed for all selectors): a. use the value increated based on specific selector values from thepacket itself -- This will limit usepacket, or from the matching SPD entry. If IPsec processing is specified for an entry, a "populate from packet" (PFP) flag may be asserted for one or more of the selector types in the SPD entry. If present, the flag applies to all selectors of the indicated type in the outbound element of the pair. (PFP does not apply to inbound traffic.) Kent [Page 18] Internet Draft Security Architecture for IPOctober 2003 SA to those packets which haveJanuary 2004 Note that thispacket's value fortext describes theselector even ifrepresentation in theselector forSPD that maps into IKE payloads, i.e., one should not create SPD entries that cannot be mapped into what IKE can negotiate. The management GUI can offer thepolicy entry has a rangeuser other forms ofallowed values or a wildcard for this selector. b. use the value associated with the policydata entry-- If this were to be just a single value, then there would be no difference between (b)and(a). However, ifdisplay, e.g., theallowed valuesoption of using address prefixes as well as ranges, and symbolic names for protocols, ports, etc. (Do not confuse theselector are a range (for IP addresses) or wildcard, then in the case of a range, (b) would enableuse ofthe SA by any packet withsymbolic names in aselector value within the range not just by packetsmanagement interface with the SPD selector "name".) If the reserved, symbolic selector valueofOPAQUE or ANY is employed for a given selector type, only it may appear in thepacketlist for thattriggered the creation of the SA. Intype, and it must appear only once in thecase oflist for that type. Note that "ANY" is awildcard, (b) would allowlocal syntax convention - IKE handles this concept via ranges. The following example illustrates the use of theSA by packets with any value for this selector. For example, suppose there isPFP flag in the context of a security gateway or a BITS/BITW implementation. Consider an SPD entry where the allowed value forsourcedestination address isany ofa range ofhosts (192.168.2.1IPv4 addresses: 192.168.2.1 to192.168.2.10). And suppose that a192.168.2.10. Suppose an outbound packetis to be sent that hasarrives with asourcedestination address of192.168.2.3.192.168.2.3, and there is no extant SA to carry this packet. The valueto beused for the SA created to transmit this packet could beanyeither of thesampletwo valuesbelowshown below, depending on what thepolicySPD entry for this selector says is the source of the selector value: source for the example of new value to benewSAD destination address used in the SA selector value --------------- ------------ a.packetPFP TRUE 192.168.2.3 (one host) b.SPD entryPFP FALSE 192.168.2.1 to 192.168.2.10 (range of hosts) Note that if the SPD entry hadan alloweda value ofwildcardANY for thesourcedestination address, then the SAD selector valuecouldwould have to bewildcard (any host). Case (a)ANY for case (b), but would still be as illustrated for case (a). Thus the PFP flag can be used to prohibitsharing,sharing of an SA, even among packets that match the same SPD entry.As described below in Section 4.4.3, selectors4.4.2 Selectors An SA mayinclude "wildcard" entries and hencebe fine-grained or coarse-grained, depending on the selectors used to define the set of traffic for the SA. For example, all traffic between twoentrieshosts mayoverlap. (This is analogous to the overlap that arises with ACLs or filter entries in routers or packet filtering firewalls.) Thus, to ensure consistent, predictable processing, SPD entries MUSTbeorderedcarried via a single SA, andthe SPD MUST always be searched in the same order, so that the first matching entry is consistently selected. (This requirement is necessary as the effectafforded a uniform set ofprocessingsecurity services. Alternatively, trafficagainst SPD entries mustbetween a pair of hosts might bedeterministic, but there is no way to canonicalize SPD entries givenspread over multiple SAs, depending on theuseapplications being used (as defined by the Next Protocol and Port fields), with different security services offered by different SAs. Similarly, all traffic between a pair ofwildcards for some selectors.) More detailsecurity gateways could be carried onmatching of packets against SPD entries is provided in Section 5. Note that if ESP is specified, either (but not both) authenticationa single SA, orencryption can be omitted. So it MUSTone SA could bepossible to configure the SPD valueassigned forthe authentication or encryption algorithms toeach communicating host pair. The following selector parameters MUST be Kent [Page 19] Internet Draft Security Architecture for IPOctober 2003 "NULL". However, at least one of these services MUST be selected, i.e., it MUST NOT be possibleJanuary 2004 supported by all IPsec implementations toconfigure bothfacilitate control ofthem as "NULL". The SPD can be used to map traffic to specific SAs orSAbundles. Thus it can functiongranularity. Note that bothas the reference database for security policy and as the map to existing SAs (or SA bundles). (To accommodate the bypassSource anddiscard policies cited above, the SPD also MUST provideDestination addresses should either be IPv4 or IPv6, but not ameansmix ofmapping trafficaddress types. Also, note that the source/destination port selectors may be labeled as "OPAQUE" to accommodate situations where thesefunctions, even though theyfields arenot, per se, IPsec processing.) The way in which the SPD operatesinaccessible because of prior encryption or due to packet fragmentation. - Destination IP Address (IPv4 or IPv6): this isdifferent for inbound vs. outbound traffic and it also may differ for host vs. security gateway, BITS, and BITW implementations. Sections 5.1 and 5.2 describe the usea list of ranges of IP addresses (unicast, anycast, broadcast (IPv4 only), or multicast group). This structure allows expression ofthe SPD for outbound and inbound processing, respectively. Becauseasecurity policy may require that more than one SA be applied tosingle IP address (via aspecified settrivial range), or a list oftraffic, inaddresses (each aspecific order, the policy entry in the SPD must preserve these ordering requirements, when present. Thus, it must be possible for an IPsec implementation to determine that an outboundtrivial ranges), orinbound packet must be processed thoroughasequencerange ofSAs. Conceptually, for outbound processing, one might imagine links (toaddresses (high and low values, inclusive), as well as theSAD) from an SPD entry for which theremost generic form of a list of ranges. Address ranges areactive SAs, and each entry would consistused to support more than one destination system sharing the same SA, e.g., behind a security gateway. - Source IP Address(es) (IPv4 or IPv6): this is a list of ranges of IP addresses (unicast, anycast, broadcast (IPv4 only), or multicast group). This structure allows expression ofeithera singleSAIP address (via a trivial range), oran ordereda list ofSAs that comprise an SA bundle. Whenaddresses (each apacket is matched against an SPD entry and there is an existing SAtrivial ranges), orSA bundle that can bea range of addresses (high and low values, inclusive), as well as the most generic form of a list of ranges. Address ranges are used tocarrysupport more than one source system sharing thetraffic,same SA, e.g., behind a security gateway. - Next Layer Protocol: Obtained from theprocessing ofIPv4 "Protocol" or thepacketIPv6 "Next Header" fields. This iscontrolled by the SAan individual protocol number, orSA bundle entry on the list. For an inbound IPsec packet for which multiple IPsec SAs are to be applied, the lookup based on destination address, IPsec protocol, and SPI should identify a single SA.ANY. TheSPDNext Layer Protocol isused to control the flow of ALL traffic through an IPsec system, including security and key management traffic (e.g., ISAKMP) from/to entities behind a security gateway. This meanswhatever comes after any IP extension headers thatISAKMP traffic must be explicitly accounted forare present. To simplify locating the Next Layer Protocol in theSPD, else it willIPv6 context, there SHOULD bediscarded. Note that a security gateway could prohibit traversal of encrypted packets in various ways, e.g., havingaDISCARD entry in the SPDmechanism forESP packets or providing proxy key exchange. In the latter case, the traffic would be internally routedconfiguring which IP extension headers tothe key management module in the security gateway. 4.4.2 Selectors An SA (or SA bundle) may be fine-grained or coarse-grained, dependingskip, e.g., Destination Options, Routing Header, Fragmentation Header, Mobility Header, Hop-by-hop options, etc. Several additional selectors depend on theselectors used to defineNext Layer Protocol value: * If theset of trafficNext Layer Protocol uses ports (e.g., TCP, UDP, SCTP, ...), then there are selectors for Source and Destination Ports: Each of these selectors is a list of ranges of values. Note that theSA. For example, all traffic between two hostssource and destination ports may not becarried viaavailable in the case of receipt of asingle SA, and affordedfragmented packet, thus auniform setvalue ofsecurity services. Alternatively, traffic between"OPAQUE" also MUST be supported. Note: In apair of hosts mightnon-initial fragment, port values will not bespread over multiple SAs, depending on the applications being used (as defined byavailable. If theNextSA requires a non-OPAQUE port value, an arriving fragment MUST be discarded. Kent [Page 20] Internet Draft Security Architecture for IPOctober 2003January 2004 * If the Next Layer Protocoland Port fields), with different security services offered by different SAs. Similarly, all traffic betweenis apair of security gateways could be carried onMobility Header, then there is asingle SA, or one SA could be assigned for each communicating host pair. The followingselectorparameters MUST be supportedforSA management to facilitate control of SA granularity. NoteIPv6 Mobility Header Message Type (MH type) [Mobip]. This is an 8-bit value thatin the case of receipt ofidentifies apacket with an ESP header, e.g., at an encapsulating security gateway or BITW implementation,particular mobility message. * If thetransport layer protocol, source/destination ports,Next Layer Protocol value is ICMP then there are selectors for the ICMP message type andName (if present) may be "OPAQUE", i.e., inaccessible becausecode. The message type is a single 8-bit value, which defines the type ofencryptionan ICMP message, orfragmentation. Note alsoANY. The ICMP code is single 8-bit value thatboth Source and Destination addresses should either be IPv4 or IPv6. - Destination IP Address (IPv4 or IPv6): this maydefines a specific subtype for an ICMP message. This selector can be a singleIP address (unicast, anycast, broadcast (IPv4 only),value, ormulticast group),ANY. - Name: A name is used as arange of addresses (high and low values (inclusive), address + mask,symbolic identifier for an IPsec source ora wildcard address. The last three are used to support more than onedestinationsystem sharing the same SA (e.g., behind a security gateway). Noteaddress. Thus an SPD entry that has a non- null Name selector MUST set either the source or destination IP address selector to NULL in the corresponding, directional SPD entry. a. an RFC 822 address, e.g., mozart@foo.example.com b. X.500 distinguished name c. a fully qualified DNS name, e.g., foo.example.com Use of this selector isconceptuallydifferent from all the"Destination IP Address" fieldother selectors described above. Names do not appear inthe <Destination IP Address, IPsec Protocol, SPI> tuple usedpackets, so it is not possible touniquely identify an SA. Whenmatch atunneledpacketarrives at the tunnel endpoint, its SPI/Destination address/Protocolagainst an SPD entry based on a Name selector. Name selectors are used tolook uptrigger creation of SPD cache (SPD-S and SPD-O) (and SAD) entries, which are then populated with specific IP source or destination addresses provided by the SAfor this packetmanagement protocol. For a native host implementation, a Name may be used in an SPD entry to provide finer granularity access control that would be otherwise be available on multi-user systems. In this case, theSAD. This destination address comes fromentry may be consulted when SA creation is initiated by theencapsulating IP header. Oncehost, or when thepacket has been processed accordinghost is a responder. The Name refers to an entity at thetunnel SAhost in question, andhas come out ofthetunnel,implementation relies on itsselectors are "looked up" inintegration into theInbound SPD.host OS to ensure appropriate linking to the named entity's process. TheInbound SPD has aother use for the Name selectorcalled destination address. This IP destination addressoccurs when any IPsec implementation (native host, BITW, BITS, or security gateway) is contacted by a peer whose address cannot be known a priori, e.g., a road warrior. In this context, theoneName is used in lieu of theinner (encapsulated)IPheader. In the caseaddress ofa transport'd packet, there will be only one IP header and this ambiguity does not exist. [REQUIRED for all implementations] - Source IP Address(es) (IPv4 or IPv6): this maythe peer, who must bea single IP address (unicast, anycast, broadcast (IPv4 only), or multicast group), rangean initiator ofaddresses (high and low values inclusive), address + mask, or a wildcard address. The last three are used to support more than one source system sharingthesameSA(e.g., behind a security gateway or in a multihomed host). [REQUIRED for all implementations] - Name: There are 2 cases (Notecreation. [This selector description may change based on discussion of some name/identity issues thatthese name forms are supported inhaven't yet been posted to the list.] The IPsecDOI.) 1. User ID a. a fully qualified user name string (DNS), e.g.,implementation context determines how selectors are used. Kent [Page 21] Internet Draft Security Architecture for IPOctober 2003 mozart@foo.bar.com b. X.500 distinguished name, e.g., C = US, SP = MA, O = GTE Internetworking, CN = Stephen T. Kent. 2. System name (host, security gateway, etc.) a.January 2004 For example, afully qualified DNS name, e.g., foo.bar.com b. X.500 distinguished name c. X.500 general name NOTE: One of the possible valuesnative host implementation typically makes use ofthis selectora socket interface. When a new connection is"OPAQUE". [REQUIRED forestablished thefollowing cases. NoteSPD can be consulted and an SA bound to the socket. Thus traffic sent via thatsupport for name forms other than addresses issocket need notrequired for manually keyed SAs. o User ID - native host implementations - BITWresult in additional lookups to the SPD (SPD-O andBITS implementations acting as HOSTS with only one user -SPD-S) cache. In contrast, a BITS, BITW, or security gatewayimplementations for INBOUND processing. o System names -- all implementations] - Data sensitivity level: (IPSO/CIPSO labels) [REQUIRED for all systems providing information flow security as per Section 8, OPTIONAL for all other systems.] - Next Layer Protocol: Obtained fromimplementation needs to look at each packet and perform an SPD/SPD-S cache lookup based on theIPv4 "Protocol" orselectors. 4.4.3 Security Association Database (SAD) In each IPsec implementation there is a nominal Security Association Database, in which each entry defines theIPv6 "Next Header" fields. This may beparameters associated with one SA. Each SA has anindividual protocol number. These packet fields may not containentry in theNext Layer Protocol dueSAD. For outbound processing, entries are pointed to by entries in thepresenceSPD-S part ofIP extension headers, e.g., a Routing Header, AH, ESP, Fragmentation Header, Destination Options, Hop-by-hop options, etc. Note thattheNext Layer Protocol may not be availableSPD cache. For inbound processing, each entry in thecase of receipt of a packet withSAD is indexed by an SPI (from the AH or ESPheader, thus a value of "OPAQUE" SHOULD be supported..br [REQUIREDprotocol header), plus source and/or destination address forall implementations] NOTE: To locatemulticast SAs, as noted earlier. The following parameters are associated with each entry in theNext Layer Protocol,SAD. They should all be present except where otherwise noted, e.g., AH Authentication algorithm. This description does not purport to be asystem hasMIB, only a specification of the minimal data items required tochain throughsupport an SA in an IPsec implementation. For each of thepacket headers checkingselectors defined in Section 4.4.2, the"Protocol"entry for an inbound SA in the SAD MUST contain the value or"Next Header" field until it encounters either one it recognizes as a Next Layer Protocol, or until it reaches one that isn't on its list of extension headers, or until it encounters an ESP header that rendersvalues negotiated at theNext Layer Protocol opaque. Note: The IPv6 mobility header istime the SA was created. For apossible next layer protocol. - Source and Destination (e.g., TCP/UDP) Ports: These may be individual UDP or TCP portreceiver, these valuesor a wildcard port. (The use of the Next Protocol field andare used to check that theSource and/or Destination Portheader fields(in conjunction with the Source and/or Destination Kent [Page 22] Internet Draft Security Architecture for IP October 2003 Address fields), asof anSAinbound packet match the selectoris sometimes referred to as "session-oriented keying."). Note thatvalues negotiated for thesource and destination ports may not be available inSA. For thecase of receiptreceiver, this is part of verifying that a packetwitharriving on anESP header, thus a valueSA is consistent with the policy for the SA. (See Section 6 for rules for ICMP messages.) These fields can have the form of specific values, ranges, ANY, or "OPAQUE"SHOULD be supported.as described in section 4.4.2, "Selectors." The followingtable summarizes the relationship betweendata items MUST be in the"Next Header"SAD: o Security Parameter Index (SPI): a 32-bit valueinselected by thepacket and SPD andreceiving end of an SA to uniquely identify thederived Port Selector valueSA. In an SAD entry for an outbound SA, theSPD and SAD. Next Hdr Transport Layer Derived Port Selector Field in Packet Protocol in SPD Value in SPD and SAD -------- --------------- --------------------------- ESP ESPSPI is used to construct the packet's AH orANY ANY (i.e., don't look at it) -don't care- ANY ANY (i.e., don't look at it) specific value specific value NOT ANY (i.e., drop packet) fragment specific value specific value actual port selector field not fragment IfESP header. In an SAD entry for an inbound SA, thepacket has been fragmented, thenSPI is used to map traffic to theport information may not be availableappropriate SA (see text on unicast/multicast in Section 4.1). o Sequence Number Counter: a 64-bit or 32-bit value used to generate thecurrent fragment. If so, discardSequence Number field in AH or ESP headers. 64-bit sequence numbers are thefragment. An ICMP PMTU should be sentdefault, but 32-bit sequence numbers are also supported if negotiated. Kent [Page 22] Internet Draft Security Architecture for IP January 2004 o Sequence Counter Overflow: a flag indicating whether overflow of thefirst fragment, which will haveSequence Number Counter should generate an auditable event and prevent transmission of additional packets on theport information. [MAY be supported] - IPv6 Mobility Header Message Type (MH type) [Mobip]: ThisSA, or whether rollover isan 8-bit selector that identifiespermitted. The audit log entry for this event SHOULD include theparticular mobility message in question. This MUST be used only ifSPI value, current date/time, Source Address, Destination Address, and theNext Layer Protocol is definedselectors from the relevant SAD entry. o Anti-Replay Window: a 64-bit counter and a bit-map (or equivalent) used tobedetermine whether anIPv6 Mobility Header. Note thatinbound AH or ESP packet is a replay. NOTE: If anti-replay has been disabled by theMH type may not be availablereceiver for an SA, e.g., in the case ofreceipt of a packet with an ESP header, thusavalue of "OPAQUE" SHOULD be supported. - ICMP message type: This definesmanually keyed SA, then thetype of ICMP message.Anti-Replay Window is ignored for the SA in question. 64-bit sequence numbers are the default, but this counter size accommodates 32-bit sequence numbers. o AH Authentication algorithm, key, etc. Thisselector can be a list. Note thatis required only if AH is supported. o ESP Encryption algorithm, key, mode, IV, etc. o ESP integrity algorithm, keys, etc. If theICMP message type mayintegrity service is not selected, these fields will beavailable in the case of receipt of a packet with annull. o ESPheader, thuscombined mode algorithms, key(s), etc. This data is used when avaluecombined mode (encryption and integrity) algorithm is used with ESP. o Lifetime of"OPAQUE" SHOULD be supported. - ICMP code: This definesthis Security Association: aspecific cause for the ICMP message. This selector cantime interval after which an SA must be replaced with alist. Note that the ICMP code may not be available in the casenew SA (and new SPI) or terminated, plus an indication ofreceiptwhich of these actions should occur. This may be expressed as apacket with an ESP header, thustime or byte count, or avaluesimultaneous use of"OPAQUE" SHOULD be supported. The IPsecboth with the first lifetime to expire taking precedence. A compliant implementationcontext determines how selectors are used. For example,MUST support both types of lifetimes, and must support ahost implementation integrated into the stack may makesimultaneous use ofa socket interface. When a new connectionboth. If time isestablished the Kent [Page 23] Internet Draft Security Architecture for IP October 2003 SPD can be consultedemployed, andan SA (orif IKE employs X.509 certificates for SAbundle) bound toestablishment, thesocket. Thus traffic sent via that socket need not result in additional lookups toSA lifetime must be constrained by theSPD/SAD. In contrast, a BITS, BITW, or security gateway implementation needs to look at each packetvalidity intervals of the certificates, andperform an SPD/SAD lookup based ontheselectors. The allowable values forNextIssueDate of theselector fields differ betweenCRLs used in thetraffic flow,IKE exchange for thesecurity association,SA. Both initiator andthe security policy.responder are responsible for constraining SA lifetime in this fashion. NOTE: Thefollowing table summarizesdetails of how to handle thekindsrefreshing ofentries thatkeys when SAs expire is a local matter. However, oneneeds to be able to express inreasonable approach is: (a) If byte count is used, then theSPD and SAD. It shows how they relate toimplementation SHOULD count thefields in data traffic being subjectednumber of bytes to which the IPsecscreening. (Note:cryptographic algorithm is applied. For ESP, this is the"wild" or "wildcard" entry for src and dst addresses includes a mask, range, etc.) Field Traffic Value SAD Entry SPD Entry -------- ------------- ---------------- -------------------- src addr single IP addr single,range,wild single,range,wildcard dst addr single IP addr single,range,wild single,range,wildcard xpt protocol* xpt protocol single,wildcard single,wildcard src port* single src port single,wildcard single,wildcard dst port* single dst port single,wildcard single,wildcard user id* single user id single,wildcard single,wildcard sec. labels single value single,wildcard single,wildcard mh type single value single,wildcard single,wildcard ICMP type single value single,wildcard single,wildcard ICMP code single value single,wildcard single,wildcard * The SADencryption algorithm (including Null encryption) andSPD entriesforthese fields could be "OPAQUE" because the traffic valueAH, this isencrypted. NOTE: In principle, one could have selectors and/or selector values intheSPD which cannotauthentication algorithm. This includes pad bytes, etc. Note that implementations SHOULD benegotiated for an SA or SA bundle. Examples might include selector values used to select traffic for discarding or enumerated lists which cause a separate SAable tobe created for each item on the list. For now, this is left for future versions of this document and the list of required selectors and selector values is the same forhandle having theSPD andcounters at theSAD. However, it is acceptable to have an administrative interface that supports useends ofselector values which cannot be negotiated provided that it does not mislead the user into believing it is creatingan SAwith these selector values. For example, the interface may allow the user to specify an enumerated listget out ofvalues but would result in the creationsynch, e.g., because ofa separate policy and SA for each item onpacket loss or because thelist. A vendor might support such an interface to make it easier for its customers to specify clear and concise policy specifications.implementations at each Kent [Page24]23] Internet Draft Security Architecture for IPOctober 2003 4.4.3 Security Association Database (SAD) In each IPsec implementation there is a nominal Security Association Database, in which each entry definesJanuary 2004 end of theparameters associated with one SA. EachSAhas an entry in the SAD. For outbound processing, entries are pointed to by entries inaren't doing things theSPD. Note that if an SPD entry does not currently point to an SAsame way. (b) There SHOULD be two kinds of lifetime -- a soft lifetime thatis appropriate for the packet,warns the implementationcreates an appropriate SA (or SA Bundle)to initiate action such as setting up a replacement SA; andlinksa hard lifetime when theSPD entry tocurrent SA ends and is destroyed. (c) If theSAD entry (see Section 5.1.1). For inbound processing, each entry inentire packet does not get delivered during theSADSAs lifetime, the packet SHOULD be discarded. o IPsec protocol mode: tunnel or transport. Indicates which mode of AH or ESP isindexed by aapplied to traffic on this SA. o Path MTU: any observed path MTU and aging variables. See Section 6.1.2.4 o Tunnel header IP source and destination address - both addresses must be either IPv4 or IPv6 addresses. The version implies the type of IPaddress,header to be used. Only used when the IPsec protocoltype, and SPI.mode is tunnel. The followingparameters are associated with each entrytable summarizes the kinds of entries that one needs to be able to express in the SPD and SAD.This description does not purportIt also shows how they relate tobe a MIB, but only a specification oftheminimalfields in dataitems requiredtraffic being subjected tosupport an SAIPsec screening. [Table to be added inana future draft.] 4.5 SA and Key Management IPsecimplementation. For inbound processing:mandates support for both manual and automated SA and cryptographic key management. Thefollowing packet fieldsIPsec protocols, AH and ESP, areused to look uplargely independent of the associated SAinmanagement techniques, although theSAD. For a unicast SA,techniques involved do affect some of theSPI can be usedsecurity services offered byitself to specify an SA, or it may be used in conjunction with the IPsec protocol type (AH or ESP). SincetheSPI value is generated byprotocols. For example, thereceiveroptional anti- replay service available fora unicast SA, whether the value is sufficient to identify anAH and ESP requires automated SAby itself, or whether it must be used in conjunction with the IPsec protocol value is a local matter. This mechanism for mapping inbound traffic to unicast SAs MUST be supported by all IPsec implementations. If an IPsec implementation supports multicast SAs as well as unicast SAs, then it MUST usemanagement. Moreover, thefollowing algorithm for mapping all inboundgranularity of key distribution employed with IPsecdatagrams to SAs. (Implementations that support only unicast traffic need not implement this algorithm.) Each entry in the Security Association Database (SAD) must indicate whetherdetermines theSA lookup makes usegranularity of(a) the SPI but neither the source or destination address (unicast), (b) the destination IP address plus the SPI, or (c) source plus destination IP addressesauthentication provided. In general, data origin authentication inaddition to the SPI. (For multicast SAs, the protocol fieldAH and ESP isnot employed for SA lookups.) Nominally, this indication can be representedlimited bytwo bits, one associated withthesource IP address andextent to which secrets used with theother forintegrity algorithm (or with a key management protocol that creates such secrets) are shared among multiple possible sources. The following text describes thedestination IP address. A "1" valueminimum requirements foreach bit indicates the need to match against the corresponding address field as partboth types oftheSAlookup process. Thus,management. Kent [Page 24] Internet Draft Security Architecture forexample, unicast SAs would have both bits set to zero, since neither the source nor destinationIPaddressJanuary 2004 4.5.1 Manual Techniques The simplest form of management isrequired for SA matching. For multicast methods that rely only on the destination addressmanual management, in which a person manually configures each system with keying material and security association management data relevant tospecifysecure communication with other systems. Manual techniques are practical in small, static environments but they do not scale well. For example, amulticast group, onlycompany could create a Virtual Private Network (VPN) using IPsec in security gateways at several sites. If thedestination bit would be set to "1," implyingnumber of sites is small, and since all theneed to usesites come under thedestination address pluspurview of a single administrative domain, this might be a feasible context for manual management techniques. In this case, theSPIsecurity gateway might selectively protect traffic todetermine the appropriate SA. For multicast methods (e.g., SSM [HC03]) that also requireand from other sites within thesource address to identifyorganization using amulticast Kent [Page 25] Internet Draft Security Architecturemanually configured key, while not protecting traffic forIP October 2003 group, both bits wouldother destinations. It also might besetappropriate when only selected communications need to"1." (There is no current requirementbe secured. A similar argument might apply tosupport multicast SA mapping based on the source address but not the destination address, thus oneuse ofthe possible four values is not meaningful.) The indication as to whether source and destination address matching is required to map inboundIPsectraffic to SAs MUST be set either asentirely within an organization for aside effectsmall number ofmanual SA configuration or via negotiation using an SAhosts and/or gateways. Manual managementprotocol, e.g., IKE. For each of the selectors defined in Section 4.4.2, thetechniques often employ statically configured, symmetric keys, though other options also exist. 4.5.2 Automated SAentry in the SAD MUST contain the value or values which were negotiated at the time theand Key Management Widespread deployment and use of IPsec requires an Internet-standard, scalable, automated, SAwas created. Formanagement protocol. Such support is required to facilitate use of thesender, these values are usedanti-replay features of AH and ESP, and todecide whetheraccommodate on-demand creation of SAs, e.g., for user- and session- oriented keying. (Note that the notion of "rekeying" an SA actually implies creation of agivennew SAis appropriatewith a new SPI, a process that generally implies use of an automated SA/key management protocol.) The default automated key management protocol selected for use withan outbound packet. This is part of checking to see if thereIPsec isan existingIKEv2 [Kau04]. Other automated SAthat canmanagement protocols MAY beused. For the receiver, these values are used to check that the selector values inemployed. When aninbound packet match those for the SA (and thus indirectly those for the matching policy). For the receiver, thisautomated SA/key management protocol ispart of verifying thatemployed, theSA was appropriate foroutput from thispacket. (See Section 6protocol is used to generate multiple keys forrulesa single SA. This also occurs because distinct keys are used forICMP messages.) These fields can have the formeach ofspecific values, ranges, wildcards, or "OPAQUE" as described in section 4.4.2, "Selectors". Note that for an ESP SA, the encryption algorithm ortheauthentication algorithm could be "NULL". However they MUST not both be "NULL". The following SAD fieldstwo SAs created by IKE. If both integrity and confidentiality areused in doing IPsec processing: o Sequence Number Counter:employed, then a32-bit value used to generate the Sequence Number field in AH or ESP headers. [REQUIREDminimum of four keys are required. Additionally, some cryptographic algorithms may require multiple keys, e.g., 3DES. The Key Management System may provide a separate string of bits for each key or it may generate one string of bits from which allimplementations, but used only for outbound traffic.] o Sequence Counter Overflow:keys are extracted. If aflag indicating whether overflowsingle string of bits is provided, care needs to be taken to ensure that theSequence Number Counter should generate an auditable event and prevent transmissionparts ofadditional packets ontheSA. [REQUIRED for all implementations, but used only for outbound traffic.] o Anti-Replay Window: a 32-bit counter and a bit-map (or equivalent) usedsystem that map the string of bits todetermine whether an inbound AH or ESP packet is a replay. [REQUIRED for all implementations but used only for inbound traffic. NOTE: If anti-replay has been disabled bythereceiver, e.g.,required keys do so in thecasesame fashion at both ends ofa manually keyed SA, thentheAnti-Replay Window is not used.] o AH Authentication algorithm, keys, etc. [REQUIRED for AH implementations]SA. To ensure that the IPsec implementations at each end of Kent [Page26]25] Internet Draft Security Architecture for IPOctober 2003 o ESP Encryption algorithm, keys, IV mode, IV, etc. [REQUIREDJanuary 2004 the SA use the same bits forESP implementations] o ESP authentication algorithm,the same keys,etc. Ifand irrespective of which part of theauthentication service is not selected, this field will be null. [REQUIRED for ESP implementations] o Lifetime of this Security Association: a time interval after which an SA must be replaced with a new SA (and new SPI) or terminated, plus an indication of whichsystem divides the string ofthese actions should occur. This maybits into individual keys, the encryption keys MUST beexpressed as a time or byte count, or a simultaneous use of both,taken from the firstlifetime to expire taking precedence. A compliant implementation MUST support both types of lifetimes, and must support a simultaneous use of both. If time is employed,(left-most, high- order) bits andif IKE employs X.509 certificates for SA establishment,theSA lifetime mustintegrity keys MUST beconstrained bytaken from thevalidity intervalsremaining bits. The number of bits for each key is defined in thecertificates, andrelevant cryptographic algorithm specification RFC. In theNextIssueDatecase of multiple encryption keys or multiple integrity keys, theCRLs usedspecification for the cryptographic algorithm must specify the order in which they are to be selected from a single string of bits provided to theIKE exchange forcryptographic algorithm. 4.5.3 Locating a Security Gateway This section discusses issues relating to how a host learns about theSA. Both initiatorexistence of relevant security gateways andresponderonce a host has contacted these security gateways, how it knows that these areresponsible for constraining SA lifetime in this fashion. [REQUIRED for all implementations] NOTE:the correct security gateways. The details ofhow to handlewhere therefreshing of keys when SAs expirerequired information is stored is a localmatter. However, one reasonable approach is: (a) If byte count is used, thenmatter, but theimplementation SHOULD countPeer Authorization database described in Section 4.4 is thenumber of bytes tomost likely candidate. Consider a situation in whichthe IPsec algorithm is applied. For ESP, thisa remote host (H1) is using theencryption algorithm (including Null encryption)Internet to gain access to a server or other machine (H2) andfor AH, thisthere isthe authentication algorithm. This includes pad bytes, etc. Note that implementations SHOULD be able to handle having the counters at the ends of an SA get out of synch,a security gateway (SG2), e.g.,because of packet loss or because the implementations at each enda firewall, through which H1's traffic must pass. An example ofthe SA aren't doing things the same way. (b) There SHOULDthis situation would betwo kinds of lifetime --asoft lifetime which warnsmobile host (road warrior) crossing theimplementationInternet toinitiate action such as setting up a replacement SA and a hard lifetime when the current SA ends. (c) If the entire packethis home organization's firewall (SG2). This situation raises several issues: 1. How doesnot get delivered during the SAs lifetime,H1 know/learn about thepacket SHOULD be discarded. o IPsec protocol mode: tunnel, transport or wildcard. Indicates which modeexistence ofAH or ESP is appliedthe security gateway SG2? 2. How does it authenticate SG2, and once it has authenticated SG2, how does it confirm that SG2 has been authorized totraffic on this SA. Noterepresent H2? 3. How does SG2 authenticate H1 and verify thatif this fieldH1 is"wildcard" at the sending end of the SA, then the application hasauthorized tospecify the modecontact H2? 4. How does H1 know/learn about any additional gateways that provide alternate paths to H2? To address these problems, a host or security gateway MUST have an administrative interface that allows the user/administrator to configure theIPsec implementation. This useaddress ofwildcard allowsone or more security gateways for ranges of destination addresses that require its use. This includes thesame SAability tobe usedconfigure information foreither tunnellocating and authenticating one ortransport mode traffic on a per packet basis, e.g., by different sockets. Themore security gateways and verifying the authorization of these gateways to represent the destination host. (The authorization function is implied in the PAD.) This document does not address the Kent [Page27]26] Internet Draft Security Architecture for IPOctober 2003 receiver does not need to know the mode in orderJanuary 2004 issue of how toproperly processautomate thepacket's IPsec headers. [REQUIRED as follows, unless implicitly defined by context: - host implementations must support all modes - gateway implementations must support tunnel mode] NOTE: The usediscovery/verification ofwildcard for the protocol modesecurity gateways. 4.6 Security Associations and Multicast The receiver-orientation ofan inbound SA may add complexity tothesituationSecurity Association implies that, in thereceiver (host only). Sincecase of unicast traffic, thepackets on such an SA could be delivered in either tunnel or transport mode,destination system will select thesecurity of an incoming packet could depend in part on which mode had been used to deliver it. If, as a result, an application cared aboutSPI value. By having theSA mode of a given packet, thendestination select theapplication would need a mechanismSPI value, there is no potential for manually configured Security Associations toobtain this mode information. o Path MTU: any observed path MTU and aging variables. See Section 6.1.2.4 [REQUIRED for all implementations but used onlyconflict with automatically configured (e.g., via a key management protocol) Security Associations or foroutbound traffic] 4.5 Basic Combinations ofSecurity Associations[May change depending on decisions re: [46] nesting/bundling SAs] This section describes four examples of combinations of security associations that MUST be supported by compliant IPsec hostsfrom multiple sources to conflict with each other. For multicast traffic, there are multiple destination systems associated with a single SA. So some system orsecurity gateways. Additional combinationsperson will need to coordinate among all multicast groups to select an SPI or SPIs on behalf ofAH and/or ESP in tunnel and/or transport modes MAY be supported ateach multicast group and then communicate thediscretiongroup's IPsec information to all of theimplementor. Compliant implementations MUST be capable of generating these four combinations and on receipt,legitimate members ofprocessing them, butthat multicast group via mechanisms not defined here. Multiple senders to a multicast group SHOULD use a single Security Association (and hence Security Parameter Index) for all traffic to that group when a symmetric key encryption or integrity algorithm is employed. In such circumstances, the receiver knows only that the message came from a system possessing the key for that multicast group. In such circumstances, a receiver generally will not be able toreceive and process any combination. The diagrams and text below describeauthenticate which system sent thebasic cases. The legendmulticast traffic. Specifications forthe diagrams is: ==== = one orother, moresecurity associations (AH or ESP, transport or tunnel) ---- = connectivity (or if so labelled, administrative boundary) Hx = host x SGx = security gateway x X* = X supports IPsec NOTE: The security associations below cangeneral multicast approaches are deferred to the IETF's Multicast Security Working Group. 5. IP Traffic Processing As mentioned in Section 4.4.1 "The Security Policy Database (SPD)", the SPD (or associated caches) must be be consulted during the processing of all traffic that crosses the IPsec boundary, including IPsec management traffic. If no policy is found in the SPD that matches a packet (for eitherAHinbound orESP. The mode (tunnel vs transport) is determined byoutbound traffic), the packet MUST be discarded. To simplify processing, and to allow for very fast SA lookups (for SG/BITS/BITW), this document introduces thenaturenotion of an SPD cache for all outbound traffic (SPD-O plus SPD-S), and a cache for inbound, non-IPsec traffic (SPD-I). There is nominally one cache per SPD. Since SPD entries may overlap, one cannot safely cache these entries in general. Simple caching might result in a match against a cache entry whereas an ordered search of theendpoints. For host-to-host SAs,SPD would have resulted in a match against a different entry. But, if themodeSPD entries are first decorrelated, then the resulting entries can safely beeither transport or tunnel.cached, and Kent [Page28]27] Internet Draft Security Architecture for IPOctober 2003 Case 1. The case of providing end-to-end security between 2 hosts across the Internet (orJanuary 2004 each cached entry will map to anIntranet). ==================================== | | H1* ------ (Inter/Intranet) ------ H2* Note that either transportSA (or multiple SAs if "populate from packet" (PFP) is specified), ortunnel mode canindicate that matching traffic should beselected by the hosts. So the headers inbypassed or discarded, appropriately. Note: In apacket between H1 and H2 could look like any ofhost IPsec implementation based on sockets, thefollowing: Transport Tunnel ----------------- --------------------- 1. [IP1][AH][next] 4. [IP2][AH][IP1][next] 2. [IP1][ESP][next] 5. [IP2][ESP][IP1][next] 3. [IP1][AH][ESP][next] Note that thereSPD will be consulted whenever a new socket isno requirementcreated, tosupport general nesting, but in transport mode, both AH and ESP candetermine what, if any, IPsec processing will be applied to thepacket. In this event,traffic that will flow on that socket. This provides an implicit caching mechanism and theSA establishment procedure MUST ensureportions of the preceding discussion thatfirst ESP, then AHaddress caching can be ignored in such implementations. Note: It is assumed that one starts with a correlated SPD, because that is how users and administrators areappliedaccustomed to managing these sorts of access control lists or firewall filter rules. Then thepacket. Case 2. This case illustrates simple virtual private networks support. =========================== | | ---------------------|---- ---|----------------------- | | | | | | | H1 -- (Local --- SG1* |--- (Internet) ---| SG2* --- (Local --- H2 | | Intranet) | | Intranet) | -------------------------- --------------------------- admin. boundary admin. boundary Only tunnel modedecorrelation algorithm isrequired here. Soapplied, to allow caching of SPD entries. The decorrelation is invisible at theheaders inmanagement interface. For inbound IPsec traffic, the SAD entry selected by the SPI serves as the cache for the selectors to be matched against arriving IPsec packets, after AH or ESP processing has been performed. 5.1 Outbound IP Traffic Processing (protected-to-unprotected) First consider the path for traffic entering the implementation via apacket between SG1protected interface andSG2 could look like either of the following: Tunnel --------------------- 4. [IP2][AH][IP1][next] 5. [IP2][ESP][IP1][next]exiting via an unprotected interface. Kent [Page29]28] Internet Draft Security Architecture for IPOctober 2003 Case 3. This case combines cases 1 and 2, adding end-to-end security between the sending and receiving hosts. It imposes no new requirements on the hosts or security gateways, other than a requirement for a security gateway to be configurable to pass IPsec traffic (including ISAKMP traffic) for hosts behind it. =============================================================== | | | =========================January 2004 Unprotected Interface ^ | +----------+ ...................|Forwarding|<-----+ : +----------+ | : ^ | : | Bypass |---|-----------------|---- ---|-------------------|---: +-----+ | +-------+ +-------+ | SPD | +--------+ | SPD-I | |Discard|<---|Cache|---->| AH/ESP | +-------+ +-------+ +-----+ +--------+ : ^ : | : +-------------+ :................>|SPD Selection| +-------------+ ^ || H1* -- (Local --- SG1* |-- (Internet) --| SG2* --- (Local --- H2* | | Intranet) | | Intranet) | -------------------------- --------------------------- admin. boundary admin. boundary Case 4. This covers the situation where a remote host (H1) usesProtected Interface Figure 2. Processing Model for Outbound Traffic IPsec MUST perform theInternet to reach an organization's firewall (SG2) and to then gain access to some server or other machine (H2). The remote host could be a mobile host (H1) dialing up tofollowing steps when processing outbound packets: 1. when alocal PPP/ARA server (not shown) onpacket arrives from theInternet and then crossingsubscriber (protected) interface, invoke theInternetSPD lookup function to select thehome organization's firewall (SG2), etc. The details of support forappropriate SPD. (If the implementation uses only one SPD, thiscase, (how H1 locates SG2, authenticates it, and verifies its authorization to represent H2) are discussed in Section 4.6.3, "Locating a Security Gateway". ====================================================== | | |============================== | || | | || ---|----------------------|--- || | | | | H1* ----- (Internet) ------| SG2* ---- (Local ----- H2* | ^ | Intranet) | | ------------------------------ could be dialup admin. boundary (optional) to PPP/ARA server Only tunnel modestep isrequired between H1 and SG2. So the choices fora no-op.) 2. Match theSA between H1 and SG2 would be one ofpacket headers against theones in case 2. The choicescache for theSA between H1 and H2 would be one ofSPD specified by theones in caseSPD-ID from step 1. Note thatinthiscase, the sender MUST apply the transport header beforecache contains entries from SPD-O and SPD-S. 3a. If there is a match, then process thetunnel header. Thereforepacket as specified by themanagement interface tomatching cache entry, i.e., bypass, discard, or apply AH or ESP in the specified mode. If IPsecimplementation MUST support configuration ofprocessing is applied, there is a link from the SPDand SADcache entry toensure this ordering of IPsec header application. As noted above, support for additional combinations ofthe relevant SAD entry (specifying the cryptographic algorithms, keys, SPI, etc.). IPsec processing is as previously defined, for tunnel or transport modes and for AH or ESP, as specified in their respective RFCs [Ken04b andESPKen04a]. 3b. If no match isoptional. Usefound in the cache, search the SPD (SPD-S and SPD- O parts) specified by SPD-ID. If the SPD entry calls for bypass or discard, create new outbound and inbound SPD cache entries. If the SPD entry calls for creation ofother, optional combinations may adversely affect interoperability.an SA, the key management mechanism Kent [Page30]29] Internet Draft Security Architecture for IPOctober 2003 4.6 SA and Key Management IPsec mandates support for both manual and automated SA and cryptographic key management. The IPsec protocols, AH and ESP, are largely independent ofJanuary 2004 (e.g., IKEv2) is invoked to create theassociatedSA. If SAmanagement techniques, although the techniques involved do affect some ofcreation succeeds, a new outbound (SPD-S) cache entry is created, along with an SAD entry, otherwise thesecurity services offeredpacket is discarded. (A packet that triggers an SPD lookup MAY be discarded by theprotocols. For example,implementation, or it may be processed against theoptional anti- replay services availablenewly created cache entry, if one is created.) Since SAs are created in pairs, an SAD entry forAH and ESP require automated SA management. Moreover, the granularity of key distribution employed with IPsec determinesthegranularity of authentication provided. (Seecorresponding inbound SA alsoa discussion of this issue in Section 4.7.) In general, data origin authentication in AH and ESPislimited bycreated, and it contains theextent to which secretsselector values derived from the SPD entry usedwithto create theauthentication algorithm (or with a key management protocol that creates such secrets) are shared among multiple possible sources. The following text describes the minimum requirementsinbound SA, forboth types ofuse in checking inbound traffic delivered via the SAmanagement. 4.6.1 Manual Techniques. 4. Thesimplest form of managementpacket ismanual management, in which a person manually configures each system with keying material and security association management data relevantpassed tosecure communication with other systems. Manual techniques are practical in small, static environments but they do not scale well. For example, a company could create a Virtual Private Network (VPN) using IPsec in security gateways at several sites. Ifthenumberoutbound forwarding function (operating outside ofsites is small, and since all the sites come underthepurview of a single administrative domain, this is likelyIPsec implementation), tobe a feasible context for manual management techniques. In this case,select thesecurity gateway might selectively protect trafficinterface toand from other sites withinwhich theorganization using a manually configured key, while not protecting traffic for other destinations. It also mightpacket will beappropriate when only selected communications needdirected. This function may cause the packet to besecured. A similar argument might apply to use ofpassed back across the IPsecentirely within an organizationboundary, fora small numberadditional IPsec processing, e.g., in support ofhosts and/or gateways. Manual management techniques often employ statically configured, symmetric keys, though other options also exist. 4.6.2 Automated SA and Key Management Widespread deployment and usenested SAs. If so, there MUST be an entry in SPD-I database that permits bypass of the packet. 5.1.1 Handling an Outbound Packet That Must Be Dropped If an IPsecrequiressystem receives anInternet-standard, scalable, automated, SA management protocol. Such support is required to facilitate useoutbound packet which it finds it must drop, it SHOULD be capable of generating and sending an ICMP message to indicate to theanti-replay featuressender ofAH and ESP,the outbound packet that the packet was dropped. The type andto accommodate on-demand creationcode ofSAs, e.g.,the ICMP message will depend on the reason foruser-dropping the packet, as specified below. The reason SHOULD be recorded in the audit log. The audit log entry for this event SHOULD include the reason, current date/time, andsession-oriented keying. (Note thatthenotionselector values of"rekeying"the packet. a. the selectors of the packet matched an SPD entry requiring the packet to be dropped --> IPv4 Type = 3 (destination unreachable) Code = 13 (Communication Administratively Prohibited) IPv6 Type = 1 (destination unreachable) Code = 1 (Communication with destination administratively prohibited) b1. the IPsec system was unable to set up the SAactually implies creationrequired by the SPD entry matching the packet because the IPsec peer at the other end ofa new SAthe exchange is administratively prohibited from communicating witha new SPI, a process thatthe initiator and rejects the negotiation. IPv4 Type = 3 (destination unreachable) Code = 13 (Communication Administratively Prohibited) Kent [Page31]30] Internet Draft Security Architecture for IPOctober 2003 generally implies use of an automated SA/key management protocol.) The default automated key management protocol selected for useJanuary 2004 IPv6 Type = 1 (destination unreachable) Code = 1 (Communication withIPsec is IKE [MSST97, Orm97, HC98] underdestination administratively prohibited) b2. the IPsecdomain of interpretation [Pip98]. Other automatedsystem was unable to set up the SAmanagement protocols MAY be employed. When an automated SA/key management protocol is employed,required by theoutput from this protocol maySPD entry matching the packet because the IPsec peer at the other end of the exchange could not beusedcontacted. IPv4 Type = 3 (destination unreachable) Code = 1 (host unreachable) IPv6 Type = 1 (destination unreachable) Code = 3 (address unreachable) Note that an attacker behind a security gateway could send packets with a spoofed source address, W.X.Y.Z, togenerate multiple keys, e.g.,an IPsec entity causing it to send ICMP messages to W.X.Y.Z. This creates an opportunity for asingle ESP SA. This may arise because: o the encryption algorithm uses multiple keys (e.g., triple DES) o the authentication algorithm uses multiple keys o both encryption and authentication algorithms are employed The Key Management System may provideDoS attack among hosts behind aseparate string of bits for each key or it may generate one string of bits from which all of them are extracted. Ifsecurity gateway. To address this, asingle string of bits is provided, care needssecurity gateway SHOULD include a management control tobe takenallow an administrator toensure that the parts of the system that map the string of bitsconfigure an IPsec implementation to send or not send therequired keys do so inICMP messages under these circumstances, and if this facility is selected, to rate limit thesame fashion at both endstransmission of such ICMP responses. 5.1.2 Header Construction for Tunnel Mode This section describes theSA. To ensure that the IPsec implementations at each endhandling of theSA use the same bitsinner and outer IP headers, extension headers, and options forthe same keys,AH andirrespective of which part of the system dividesESP tunnels, with regard to outbound traffic processing. This includes how to construct thestring of bits into individual keys,encapsulating (outer) IP header, how to process fields in theencryption key(s) MUSTinner IP header, and what other actions should be takenfrom the first (left-most, high- order) bitsfor outbound, tunnel mode traffic. The general processing described here is modeled after RFC 2003, "IP Encapsulation with IP" [Per96]: o The outer IP header Source Address and Destination Address identify theauthentication key(s) MUST be taken from"endpoints" of theremaining bits.tunnel (the encapsulator and decapsulator). Thenumberinner IP header Source Address and Destination Addresses identify the original sender and recipient ofbits for each key is defined intherelevant algorithm specification RFC. Indatagram, (from thecaseperspective ofmultiple encryption keys or multiple authentication keys,this tunnel), respectively. (see footnote 3 after thespecificationtable in 5.1.2.1 for more details on thealgorithm must specifyencapsulating source IP address.) o The inner IP header is not changed except as noted below for TTL (or Hop Limit) and theorder in which they are to be selected from a single string of bits providedECN Field. The inner IP header otherwise remains unchanged during its delivery to thealgorithm. 4.6.3 Locating a Security Gateway This section discusses issues relatingtunnel exit point. o No change tohow a host learns aboutIP options or extension headers in theexistenceinner header Kent [Page 31] Internet Draft Security Architecture for IP January 2004 occurs during delivery ofrelevant security gateways and once a host has contacted these security gateways, how it knows that these arethecorrect security gateways. The details of whereencapsulated datagram through therequired information is storedtunnel. Note: IPsec tunnel mode isa local matter. Consider a situationdifferent from IP-in-IP tunneling (RFC 2003) inwhich a remote host (H1) is using the Internet to gain accessseveral ways: o IPsec offers certain controls to aserver or other machine (H2) and there is asecuritygateway (SG2), e.g., a firewall, through which H1's traffic must pass. An example of this situationadministrator to manage covert channels (which would not normally be amobile host (Road Warrior) crossing the Internetconcern for tunneling) and to ensure that thehome organization's firewall (SG2). (See Case 4 inreceiver examines thesection 4.5 Basic Combinationsright portions ofSecurity Associations.) This situation raises several issues: Kent [Page 32] Internet Draft Security Architecture for IP October 2003 1. How does H1 know/learn abouttheexistencereceived packet re: application ofthe security gateway SG2? 2. How does it authenticate SG2, and once it has authenticated SG2,access controls. An IPsec implementation MAY be configurable with regard to howdoesitconfirm that SG2 has been authorized to represent H2? 3. How does SG2 authenticate H1processes the DSCP field for tunnel mode for transmitted packets. For outbound traffic, one configuration setting for DSCP will operate as described in the following sections on IPv4 andverify that H1 is authorizedIPv6 header processing for IPsec tunnels. Another will allow the DSCPfield tocontact H2? 4. How does H1 know/learn about backup gateways which provide alternate pathsbe mapped toH2? To address these problems,ahost or security gateway MUST have an administrative interface that allows the user/administrator to configure the address offixed value, which MAY be configured on asecurity gatewayper SA basis. (The value might really be fixed forany sets of destination addressesall traffic outbound from a device, but per SA granularity allows thatrequire its use.as well.) Thisincludes the abilityconfiguration option allows a local administrator toconfigure: odecide whether therequisite information for locating and authenticatingcovert channel provided by copying these bits outweighs thesecurity gateway and verifying its authorizationbenefits of copying. o IPsec describes how torepresent the destination host.handle ECN or DSCP. o IPsec allows therequisite information for locating and authenticating any backup gateways and verifying their authorization to representIP version of thedestination host. It is assumedencapsulating header to be different from that of theSPD is also configured with policy information that covers any other IPsec requirements forinner header. The tables in thepath tofollowing sub-sections show thesecurity gateway andhandling for thedestination host. This document does not addressdifferent header/option fields ("constructed" means that theissue of how to automatevalue in thediscovery/verification of security gateways. Note: The IP Security Policy (IPSP) working groupouter field isworking on an"SG discovery, Policy Exchange and Negotiation Protocol". 4.7 Security Associations and Multicast The receiver-orientationconstructed independently of theSecurity Association implies that,value in thecase of unicast traffic, the destination system will normally select the SPI value. By having the destination select the SPI value, there is no potential for manually configured Security Associations to conflict with automatically configured (e.g., via a key management protocol)inner). Kent [Page 32] Internet Draft SecurityAssociations or for Security Associations from multiple sources to conflict with each other. For multicast traffic, there are multiple destination systems per multicast group. So some system or person will need to coordinate among all multicast groups to select an SPI or SPIs on behalf of each multicast group and then communicate the group's IPsec information to all of the legitimate members of that multicast group via mechanisms not defined here. Multiple senders to a multicast group SHOULD use a single Security Kent [Page 33] Internet Draft Security Architecture for IP October 2003 Association (and hence Security Parameter Index) for all traffic to that group when a symmetric key encryption or authentication algorithm is employed. In such circumstances, the receiver knows only that the message came from a system possessing the key for that multicast group. In such circumstances, a receiver generally will not be able to authenticate which system sent the multicast traffic. Specifications for other, more general multicast cases are deferred to later IPsec documents. 5. IP Traffic Processing As mentioned in Section 4.4.1 "The Security Policy Database (SPD)", the SPD must be consulted during the processing of all traffic (INBOUND and OUTBOUND), including non-IPsec traffic. If no policy is found in the SPD that matches the packet (for either inbound or outbound traffic), the packet MUST be discarded. NOTE: All of the cryptographic algorithms used in IPsec expect their input in canonical network byte order (see Appendix in RFC 791) and generate their output in canonical network byte order. IP packets are also transmitted in network byte order. 5.1 Outbound IP Traffic Processing [Will change to reflect decisions re: [40],[44],[45] new processing model; [46] nested/bundled SAs; and [81] handling outbound fragments] 5.1.1 Selecting and Using an SA or SA Bundle In a security gateway or BITW implementation (and in many BITS implementations), each outbound packet is compared against the SPD to determine what processing is required for the packet. If the packet is to be discarded, this is an auditable event. If the traffic is allowed to bypass IPsec processing, the packet continues through "normal" processing for the environment in which the IPsec processing is taking place. If IPsec processing is required, the packet is either mapped to an existing SA (or SA bundle), or a new SA (or SA bundle) is created for the packet. Since a packet's selectors might match multiple policies or multiple extant SAs and since the SPD is ordered, but the SAD is not, IPsec MUST: 1. Match the packet's selector fields against the outbound policies in the SPD to locate the first appropriate policy, which will point to zero or more SA bundles in the SAD. 2. Match the packet's selector fields against those in the SA bundles found in (1) to locate the first SA bundle that matches. If no SAs Kent [Page 34] Internet Draft Security Architecture for IP October 2003 were found or none match, create an appropriate SA bundle and link the SPD entry to the SAD entry. If no key management entity is found, drop the packet. 3. Use the SA bundle found/created in (2) to do the required IPsec processing, e.g., authenticate and encrypt. In a host IPsec implementation based on sockets, the SPD will be consulted whenever a new socket is created, to determine what, if any, IPsec processing will be applied to the traffic that will flow on that socket. NOTE: A compliant implementation MUST not allow instantiation of an ESP SA that employs both a NULL encryption and a NULL authentication algorithm. An attempt to negotiate such an SA is an auditable event. 5.1.2 Header Construction for Tunnel Mode This section describes the handling of the inner and outer IP headers, extension headers, and options for AH and ESP tunnels. This includes how to construct the encapsulating (outer) IP header, how to handle fields in the inner IP header, and what other actions should be taken. The general idea is modeled after the one used in RFC 2003, "IP Encapsulation with IP": o The outer IP header Source Address and Destination Address identify the "endpoints" of the tunnel (the encapsulator and decapsulator). The inner IP header Source Address and Destination Addresses identify the original sender and recipient of the datagram, (from the perspective of this tunnel), respectively. (see footnote 3 after the table in 5.1.2.1 for more details on the encapsulating source IP address.) o The inner IP header is not changed except to decrement the TTL as noted below, and remains unchanged during its delivery to the tunnel exit point. o No change to IP options or extension headers in the inner header occurs during delivery of the encapsulated datagram through the tunnel. o If need be, other protocol headers such as the IP Authentication header may be inserted between the outer IP header and the inner IP header. The tables in the following sub-sections show the handling for the different header/option fields (constructed = the value in the outer field is constructed independently of the value in the inner). Kent [Page 35] Internet Draft Security Architecture for IP October 2003 5.1.2.1 IPv4 -- Header Construction for Tunnel Mode [May be affected by decisions on [75] "TOS (now DSCP and ECN) copying in tunnel mode"] <-- How Outer Hdr Relates to Inner Hdr --> Outer Hdr at Inner Hdr at IPv4 Encapsulator Decapsulator Header fields: -------------------- ------------ version 4 (1) no change header length constructed no change DS Field copied from inner hdr (5) no change ECN Field copied from inner hdr constructed (6) total length constructed no change ID constructed no change flags (DF,MF) constructed, DF (4) no change fragmt offset constructed no change TTL constructed (2) decrement (2) protocol AH, ESP, routing hdr no change checksum constructed constructed (2) src address constructed (3) no change dest address constructed (3) no change Options never copied no change 1. The IP version in the encapsulating header can be different from the value in the inner header. 2. The TTL in the inner header is decremented by the encapsulator prior to forwarding and by the decapsulator if it forwards the packet. (The checksum changes when the TTL changes.) NOTE: The decrementing of the TTL is one of the usual actions that takes place when forwarding a packet. Packets originating from the same node as the encapsulator do not have their TTL's decremented, as the sending node is originating the packet rather than forwarding it. 3. src and dest addresses depend on the SA, which is used to determine the dest address which in turn determines which src address (net interface) is used to forward the packet. NOTE: In principle, the encapsulating IP source address can be any of the encapsulator's interface addresses or even an address different from any of the encapsulator's IP addresses, (e.g., if it's acting as a NAT box) so long as the address is reachable through the encapsulator from the environment into which the packet is sent. This does not cause a problem because IPsec does not currently have any INBOUND processing requirement that involves the Source Address of the encapsulating IP header. So while the receiving tunnel endpoint looks at Kent [Page 36] Internet Draft Security Architecture for IP October 2003 the Destination Address in the encapsulating IP header, it only looks at the Source Address in the inner (encapsulated) IP header. 4. configuration determines whether to copy from the inner header (IPv4 only), clear or set the DF. 5. If the packet will immediately enter a domain for which the DSCP value in the outer header is not appropriate, that value MUST be mapped to an appropriate value for the domain [RFC 2474]. See [RFC 2475 for further information. 6. If the ECN field in the inner header is set to ECT(0) or ECT(1) and the ECN field in the outer header is set to CE, then set the ECN field in the inner header to CE, otherwise make no change to the ECN field in the inner header. Note: IPsec does not copy the options from the inner header into the outer header, and IPsec does not construct the options in the outer header. However, post-IPsec code MAY insert/construct options for the outer header. 5.1.2.2 IPv6 -- Header Construction for Tunnel Mode [May be affected by decisions on [75] "TOS (now DSCP and ECN) copying in tunnel mode"] See previous section 5.1.2 for notes 1-5 indicated by (footnote number). <-- How Outer Hdr Relates Inner Hdr ---> Outer Hdr at Inner Hdr at IPv6 Encapsulator Decapsulator Header fields: -------------------- ------------ version 6 (1) no change DS Field copied from inner hdr (6) no change ECN Field copied from inner hdr constructed (7) flow id copied or configured no change len constructed no change next header AH,ESP,routing hdr no change hop limit constructed (2) decrement (2) src address constructed (3) no change dest address constructed (3) no change Extension headers never copied no change 6. If the packet will immediately enter a domain for which the DSCP value in the outer header is not appropriate, that value MUST be mapped to an appropriate value for the domain [RFC 2474]. See [RFC 2475] for further information. (7) If the ECN field in the inner header is set to ECT(0) or ECT(1) and Kent [Page 37] Internet Draft Security Architecture for IP October 2003 the ECN field in the outer header is set to CE, then set the ECN field in the inner header to CE, otherwise make no change to the ECN field in the inner header. Note: IPsec does not copy the extension headers from the inner header into the outer header, and IPsec does not construct the extension headers in the outer header. However, post-IPsec code MAY insert/construct extension headers for the outer header. 5.2 Processing Inbound IP Traffic [Will change to reflect [40],[44],[45] new processing model and [46] SA nesting/bundles. Prior to performing AH or ESP processing, any IP fragments are reassembled. Each inbound IP datagram to which IPsec processing will be applied is identified by the appearance of the AH or ESP values in the IP Next Protocol field (or of AH or ESP as an extension header in the IPv6 context). Note: Appendix C contains sample code for a bitmask check for a 32 packet window that can be used for implementing anti-replay service. 5.2.1 Selecting and Using an SA or SA Bundle [May change to reflect decisions re: [85] DROPØd inbound packet Ï does not match SA] Mapping the IP datagram to the appropriate SA is simplified because of the presence of the SPI in the AH or ESP header. Note that the selector checks are made on the inner headers not the outer (tunnel) headers. The steps followed are: 1. To look up an SA: For unicast, the SPI may be used alone to select an SA, or may be combined with the protocol, at the option of the receiver. For multicast SAs, the SPI is combined with the destination address, and optionally the source address, to select an SA. (See Section 4.4.3 for more details.) If the SA lookup fails, drop the packet and log/report the error. 2. Use the SA found in (1) to do the IPsec processing, e.g., authenticate and decrypt. This step includes matching the packet's (Inner Header if tunneled) selectors to the selectors in the SA. Local policy determines the specificity of the SA selectors (single value, list, range, wildcard). In general, a packet's source address MUST match the SA selector value. However, an ICMP packet received on a tunnel mode SA may have a source address other than that bound to the SA and thus such packets should be permitted as exceptions to this check. For an ICMP packet, the selectors from the enclosed problem packet (the source and destination addresses and ports should be swapped) should be checked against the selectors for the SA. Note that some or all of these selectors may be inaccessible because of limitations on how many bits of the problem packet the ICMP packet is allowed to Kent [Page 38] Internet Draft Security Architecture for IP October 2003 carry or due to encryption. See Section 6. Do (1) and (2) for every IPsec header until a Transport Protocol Header or an IP header that is NOT for this system is encountered. Keep track of what SAs have been used and their order of application. 3. Find an incoming policy in the SPD that matches the packet. This could be done, for example, by use of backpointers from the SAs to the SPD or by matching the packet's selectors (Inner Header if tunneled) against those of the policy entries in the SPD. 4. Check whether the required IPsec processing has been applied, i.e., verify that the SA's found in (1) and (2) match the kind and order of SAs required by the policy found in (3). NOTE: The correct "matching" policy will not necessarily be the first inbound policy found. If the check in (4) fails, steps (3) and (4) are repeated until all policy entries have been checked or until the check succeeds. If an IPsec system receives an inbound (unprotected) packet for which the matching SPD entry requires IPsec protection, it MUST drop the packet. It SHOULD also be capable of generating and sending an ICMP message to indicate to the sender that the receiver dropped the packet. The reason SHOULD be recorded in the audit log. IPv4 Type = 3 (destination unreachable) Code = 13 (Communication Administratively Prohibited) IPv6 Type = 1 (destination unreachable) Code = 1 (Communication with Destination Administratively Prohibited Note that an attacker could send packets with a spoofed source address, W.X.Y.Z, to an IPsec entity causing it to send ICMP messages to W.X.Y.Z. This creates an opportunity to use an IPsec receiver in a DoS attack. To address this, the implementation SHOULD provide management controls to allow an administrator to configure an IPsec implementation to silently discard the packet or to respond with the above ICMP message, and if this facility is selected, to rate limit the transmission of such ICMP responses. If responding with an ICMP message is supported, then rate limiting MUST be supported. If an IPsec system receives an outbound packet which it finds it must drop, it SHOULD be capable of generating and sending an ICMP message to indicate to the sender of the outbound packet that the packet was dropped. The type and code of the ICMP message will depend on the reason for dropping the packet. The reason SHOULD be recorded in the audit log. a. the selectors of the packet matched an SPD entry requiring the packet to be dropped --> Kent [Page 39] Internet Draft Security Architecture for IP October 2003 IPv4 Type = 3 (destination unreachable) Code = 13 (Communication Administratively Prohibited) IPv6 Type = 1 (destination unreachable) Code = 1 (Communication with destination administratively prohibited b1. the IPsec system was unable to set up the SA required by the SPD entry matching the packet because the IPsec peer at the other end of the exchange is administratively prohibited from communicating with the initiator and rejects the negotiation. IPv4 Type = 3 (destination unreachable) Code = 13 (Communication Administratively Prohibited) IPv6 Type = 1 (destination unreachable) Code = 1 (Communication with destination administratively prohibited b2. the IPsec system was unable to set up the SA required by the SPD entry matching the packet because the IPsec peer at the other end of the exchange could not be contacted. IPv4 Type = 3 (destination unreachable) Code = 1 (host unreachable) IPv6 Type = 1 (destination unreachable) Code = 3 (address unreachable) Note that an attacker behind a security gateway could send packets with a spoofed source address, W.X.Y.Z, to an IPsec entity causing it to send ICMP messages to W.X.Y.Z. This creates an opportunity for a DoS attack among hosts behind a security gateway. To address this, a security gateway SHOULD include a management control to allow an administrator to configure an IPsec implementation to send or not send the above ICMP message, and if this facility is selected, to rate limit the transmission of such ICMP responses. At the end of these steps, pass the resulting packet to the Transport Layer or forward the packet. Note that any IPsec headers processed in these steps may have been removed, but that this information, i.e., what SAs were used and the order of their application, may be needed for subsequent IPsec or firewall processing. Note that in the case of a security gateway, if forwarding causes a packet to exit via an IPsec-enabled interface, then additional IPsec Kent [Page 40] Internet Draft Security Architecture for IP October 2003 processing may be applied. 5.2.2 Handling of AH and ESP tunnels The handling of the inner and outer IP headers, extension headers, and options for AH and ESP tunnels should be performed as described in the tables in Section 5.1. 6. ICMP Processing (relevant to IPsec).fi The focus of this section is on the handling of ICMP error messages. Other ICMP traffic, e.g., Echo/Reply, should be treated like other traffic and can be protected on an end-to-end basis using SAs in the usual fashion. An ICMP error message protected by AH or ESP and generated by a router SHOULD be processed and forwarded in a tunnel mode SA. Local policy determines whether or not it is subjected to source address checks by the router at the destination end of the tunnel. Note that if the router at the originating end of the tunnel is forwarding an ICMP error message from another router, the source address check would fail. An ICMP message protected by AH or ESP and generated by a router MUST NOT be forwarded on a transport mode SA (unless the SA has been established to the router acting as a host, e.g., a Telnet connection used to manage a router). An ICMP message generated by a host SHOULD be checked against the source IP address selectors bound to the SA in which the message arrives. Note that even if the source of an ICMP error message is authenticated, the returned IP header could be invalid. Accordingly, the selector values in the IP header SHOULD also be checked to be sure that they are consistent with the selectors for the SA over which the ICMP message was received. The table in Appendix D characterize ICMP messages as being either host generated, router generated, both, unknown/unassigned. ICMP messages falling into the last two categories should be handled as determined by the receiver's policy. An ICMP message not protected by AH or ESP is unauthenticated and its processing and/or forwarding may result in denial of service. This suggests that, in general, it would be desirable to ignore such messages. However, it is expected that many routers (vs. security gateways) will not implement IPsec for transit traffic and thus strict adherence to this rule would cause many ICMP messages to be discarded. The result is that some critical IP functions would be lost, e.g., redirection and PMTU processing. Thus it MUST be possible to configure an IPsec implementation to accept or reject (router) ICMP traffic as per local security policy. Kent [Page 41] Internet Draft Security Architecture for IP October 2003 The remainder of this section addresses how PMTU processing MUST be performed at hosts and security gateways. It addresses processing of both authenticated and unauthenticated ICMP PMTU messages. However, as noted above, unauthenticated ICMP messages MAY be discarded based on local policy. Note: An IPsec system SHOULD provide controls that allow an administrator to configure the IPsec system to set a threshold for the minimum size to which the PTMU can be set via processing an ICMP PMTU from a public Internet source. The default might be that the ciphertext size would be 576 bytes (IPv4) or 1280 (IPv6). 6.1 PMTU/DF Processing 6.1.1 DF Bit In cases where a system (host or gateway) adds an encapsulating header (ESP tunnel or AH tunnel), it MUST support the option of copying the DF bit from the original packet to the encapsulating header (and processing ICMP PMTU messages). This means that it MUST be possible to configure the system's treatment of the DF bit (set, clear, copy from encapsulated header) for each interface. (See Appendix B for rationale.) 6.1.2 Path MTU Discovery (PMTU) [May change to reflect decisions re: [78] PMTU discovery] This section discusses IPsec handling for Path MTU Discovery messages. ICMP PMTU is used here to refer to an ICMP message for: IPv4 (RFC 792): - Type = 3 (Destination Unreachable) - Code = 4 (Fragmentation needed and DF set) - Next-Hop MTU in the low-order 16 bits of the second word of the ICMP header (labelled "unused" in RFC 792), with high-order 16 bits set to zero IPv6 (RFC 1885): - Type = 2 (Packet Too Big) - Code = 0 (Fragmentation needed) - Next-Hop MTU in the 32 bit MTU field of the ICMP6 message 6.1.2.1 Propagation of PMTU The amount of information returned with the ICMP PMTU message (IPv4 or IPv6) is limited and this affects what selectors are available for use in further propagating the PMTU information. (See Appendix B for more detailed discussion of this topic.) Kent [Page 42] Internet Draft Security Architecture for IP October 2003 o PMTU message with 64 bits of IPsec header -- If the ICMP PMTU message contains only 64 bits of the IPsec header (minimum for IPv4), then a security gateway MUST support the following options on a per SPI/SA basis: a. if the originating host can be determined (or the possible sources narrowed down to a manageable number), send the PMTU information to all the possible originating hosts. b. if the originating host cannot be determined, store the PMTU with the SA and wait until the next packet(s) arrive from the originating host for the relevant security association. If the packet(s) are bigger than the PMTU, drop the packet(s), and compose ICMP PMTU message(s) with the new packet(s) and the updated PMTU, and send the ICMP message(s) about the problem to the originating host. Retain the PMTU information for any message that might arrive subsequently (see Section 6.1.2.4, "PMTU Aging"). o PMTU message with >64 bits of IPsec header -- If the ICMP message contains more information from the original packet then there may be enough non-opaque information to immediately determine to which host to propagate the ICMP/PMTU message and to provide that system with the 5 fields (source address, destination address, source port, destination port, transport protocol) needed to determine where to store/update the PMTU. Under such circumstances, a security gateway MUST generate an ICMP PMTU message immediately upon receipt of an ICMP PMTU from further down the path. o Distributing the PMTU to the Transport Layer -- The host mechanism for getting the updated PMTU to the transport layer is unchanged, as specified in RFC 1191 (Path MTU Discovery). 6.1.2.2 Calculation of PMTU The calculation of PMTU from an ICMP PMTU MUST take into account the addition of any IPsec header -- AH transport, ESP transport, AH/ESP transport, ESP tunnel, AH tunnel. (See Appendix B for discussion of implementation issues.) Note: In some situations the addition of IPsec headers could result in an effective PMTU (as seen by the host or application) that is unacceptably small. To avoid this problem, the implementation may establish a threshold below which it will not report a reduced PMTU. In such cases, the implementation would apply IPsec and then fragment the resulting packet according to the PMTU. This would result in a more efficient use of the available bandwidth. 6.1.2.3 Granularity of PMTU Processing In hosts, the granularity with which ICMP PMTU processing can be done differs depending on the implementation situation. Looking at a Kent [Page 43] Internet Draft Security Architecture for IP October 2003 host, there are 3 situations that are of interest with respect to PMTU issues (See Appendix B for additional details on this topic.): a. Integration of IPsec into the native IP implementation b. Bump-in-the-stack implementations, where IPsec is implemented "underneath" an existing implementation of a TCP/IP protocol stack, between the native IP and the local network drivers c. No IPsec implementation -- This case is included because it is relevant in cases where a security gateway is sending PMTU information back to a host. Only in case (a) can the PMTU data be maintained at the same granularity as communication associations. In (b) and (c), the IP layer will only be able to maintain PMTU data at the granularity of source and destination IP addresses (and optionally TOS), as described in RFC 1191. This is an important difference, because more than one communication association may map to the same source and destination IP addresses, and each communication association may have a different amount of IPsec header overhead (e.g., due to use of different transforms or different algorithms). Implementation of the calculation of PMTU and support for PMTUs at the granularity of individual communication associations is a local matter. However, a socket- based implementation of IPsec in a host SHOULD maintain the information on a per socket basis. Bump in the stack systems MUST pass an ICMP PMTU to the host IP implementation, after adjusting it for any IPsec header overhead added by these systems. The calculation of the overhead SHOULD be determined by analysis of the SPI and any other selector information present in a returned ICMP PMTU message. 6.1.2.4 PMTU Aging In all systems (host or gateway) implementing IPsec and maintaining PMTU information, the PMTU associated with a security association (transport or tunnel) MUST be "aged" and some mechanism put in place for updating the PMTU in a timely manner, especially for discovering if the PMTU is smaller than it needs to be. A given PMTU has to remain in place long enough for a packet to get from the source end of the security association to the system at the other end of the security association and propagate back an ICMP error message if the current PMTU is too big. Note that if there are nested tunnels, multiple packets and round trip times might be required to get an ICMP message back to an encapsulator or originating host. Systems SHOULD use the approach described in the Path MTU Discovery Kent [Page 44] Internet Draft Security Architecture for IP October 2003 document (RFC 1191, Section 6.3), which suggests periodically resetting the PMTU to the first- hop data-link MTU and then letting the normal PMTU Discovery processes update the PMTU as necessary. The period SHOULD be configurable. 7. Auditing Not all systems that implement IPsec will implement auditing. For the most part, the granularity of auditing is a local matter. However, several auditable events are identified in the AH and ESP specifications and for each of these events a minimum set of information that SHOULD be included in an audit log is defined. Additional information also MAY be included in the audit log for each of these events, and additional events, not explicitly called out in this specification, also MAY result in audit log entries. There is no requirement for the receiver to transmit any message to the purported transmitter in response to the detection of an auditable event, because of the potential to induce denial of service via such action. 8. Use in Systems Supporting Information Flow Security Information of various sensitivity levels may be carried over a single network. Information labels (e.g., Unclassified, Company Proprietary, Secret) [DoD85, DoD87] are often employed to distinguish such information. The use of labels facilitates segregation of information, in support of information flow security models, e.g., the Bell-LaPadula model [BL73]. Such models, and corresponding supporting technology, are designed to prevent the unauthorized flow of sensitive information, even in the face of Trojan Horse attacks. Conventional, discretionary access control (DAC) mechanisms, e.g., based on access control lists, generally are not sufficient to support such policies, and thus facilities such as the SPD do not suffice in such environments. In the military context, technology that supports such models is often referred to as multi-level security (MLS). Computers and networks often are designated "multi-level secure" if they support the separation of labelled data in conjunction with information flow security policies. Although such technology is more broadly applicable than just military applications, this document uses the acronym "MLS" to designate the technology, consistent with much extant literature. IPsec mechanisms can easily support MLS networking. MLS networking requires the use of strong Mandatory Access Controls (MAC), which unprivileged users or unprivileged processes are incapable of controlling or violating. This section pertains only to the use of Kent [Page 45] Internet Draft Security Architecture for IP October 2003 these IP security mechanisms in MLS (information flow security policy) environments. Nothing in this section applies to systems not claiming to provide MLS. As used in this section, "sensitivity information" might include implementation- defined hierarchic levels, categories, and/or releasability information. AH can be used to provide strong authentication in support of mandatory access control decisions in MLS environments. If explicit IP sensitivity information (e.g., IPSO [Ken91]) is used and confidentiality is not considered necessary within the particular operational environment, AH can be used to authenticate the binding between sensitivity labels in the IP header and the IP payload (including user data). This is a significant improvement over labeled IPv4 networks where the sensitivity information is trusted even though there is no authentication or cryptographic binding of the information to the IP header and user data. IPv4 networks might or might not use explicit labelling. IPv6 will normally use implicit sensitivity information that is part of the IPsec Security Association but not transmitted with each packet instead of using explicit sensitivity information. All explicit IP sensitivity information MUST be authenticated using either ESP, AH, or both. Encryption is useful and can be desirable even when all of the hosts are within a protected environment, for example, behind a firewall or disjoint from any external connectivity. ESP can be used, in conjunction with appropriate key management and encryption algorithms, in support of both DAC and MAC. (The choice of encryption and authentication algorithms, and the assurance level of an IPsec implementation will determine the environments in which an implementation may be deemed sufficient to satisfy MLS requirements.) Key management can make use of sensitivity information to provide MAC. IPsec implementations on systems claiming to provide MLS SHOULD be capable of using IPsec to provide MAC for IP-based communications. 8.1 Relationship Between Security Associations and Data Sensitivity Both the Encapsulating Security Payload and the Authentication Header can be combined with appropriate Security Association policies to provide multi-level secure networking. In this case each SA (or SA bundle) is normally used for only a single instance of sensitivity information. For example, "PROPRIETARY - Internet Engineering" must be associated with a different SA (or SA bundle) from "PROPRIETARY - Finance". Kent [Page 46] Internet Draft Security Architecture for IP October 2003 8.2 Sensitivity Consistency Checking An MLS implementation (both host and router) MAY associate sensitivity information, or a range of sensitivity information with an interface, or a configured IP address with its associated prefix (the latter is sometimes referred to as a logical interface, or an interface alias). If such properties exist, an implementation SHOULD compare the sensitivity information associated with the packet against the sensitivity information associated with the interface or address/prefix from which the packet arrived, or through which the packet will depart. This check will either verify that the sensitivities match, or that the packet's sensitivity falls within the range of the interface or address/prefix. The checking SHOULD be done on both inbound and outbound processing. 8.3 Additional MLS Attributes for Security Association Databases Section 4.4 discussed two Security Association databases (the Security Policy Database (SPD) and the Security Association Database (SAD)) and the associated policy selectors and SA attributes. MLS networking introduces an additional selector/attribute: - Sensitivity information. The Sensitivity information aids in selecting the appropriate algorithms and key strength, so that the traffic gets a level of protection appropriate to its importance or sensitivity as described in section 8.1. The exact syntax of the sensitivity information is implementation defined. 8.4 Additional Inbound Processing Steps for MLS Networking After an inbound packet has passed through IPsec processing, an MLS implementation SHOULD first check the packet's sensitivity (as defined by the SA (or SA bundle) used for the packet) with the interface or address/prefix as described in section 8.2 before delivering the datagram to an next layer protocol or forwarding it. The MLS system MUST retain the binding between the data received in an IPsec protected packet and the sensitivity information in the SA or SAs used for processing, so appropriate policy decisions can be made when delivering the datagram to an application or forwarding engine. The means for maintaining this binding are implementation specific. Kent [Page 47] Internet Draft Security Architecture for IP October 2003 8.5 Additional Outbound Processing Steps for MLS Networking An MLS implementation of IPsec MUST perform two additional checks besides the normal steps detailed in section 5.1.1. When consulting the SPD or the SAD to find an outbound security association, the MLS implementation MUST use the sensitivity of the data to select an appropriate outbound SA or SA bundle. The second check comes before forwarding the packet out to its destination, and is the sensitivity consistency checking described in section 8.2. 8.6 Additional MLS Processing for Security Gateways An MLS security gateway MUST follow the previously mentioned inbound and outbound processing rules as well as perform some additional processing specific to the intermediate protection of packets in an MLS environment. A security gateway MAY act as an outbound proxy, creating SAs for MLS systems that originate packets forwarded by the gateway. These MLS systems may explicitly label the packets to be forwarded, or the whole originating network may have sensitivity characteristics associated with it. The security gateway MUST create and use appropriate SAs for AH, ESP, or both, to protect such traffic it forwards. Similarly such a gateway SHOULD accept and process inbound AH and/or ESP packets and forward appropriately, using explicit packet labeling, or relying on the sensitivity characteristics of the destination network. 9. Performance Issues [May change to reflect changes in [40],[44],[45] processing model and [46] SA nesting/bundles. The use of IPsec imposes computational performance costs on the hosts or security gateways that implement these protocols. These costs are associated with the memory needed for IPsec code and data structures, and the computation of integrity check values, encryption and decryption, and added per-packet handling. The per- packet computational costs will be manifested by increased latency and, possibly, reduced throughout. Use of SA/key management protocols, especially ones that employ public key cryptography, also adds computational performance costs to use of IPsec. These per- association computational costs will be manifested in terms of increased latency in association establishment. For many hosts, it is anticipated that software-based cryptography will not appreciably reduce throughput, but hardware may be required for security gateways (since they represent aggregation points), and for some hosts. Kent [Page 48] Internet Draft Security Architecture for IP October 2003 The use of IPsec also imposes bandwidth utilization costs on transmission, switching, and routing components of the Internet infrastructure, components not implementing IPsec. This is due to the increase in the packet size resulting from the addition of AH and/or ESP headers, AH and ESP tunneling (which adds a second IP header), and the increased packet traffic associated with key management protocols. It is anticipated that, in most instances, this increased bandwidth demand will not noticeably affect the Internet infrastructure. However, in some instances, the effects may be significant, e.g., transmission of ESP encrypted traffic over a dialup link that otherwise would have compressed the traffic. Note: The initial SA establishment overhead will be felt in the first packet. This delay could impact the transport layer and application. For example, it could cause TCP to retransmit the SYN before the ISAKMP exchange is done. The effect of the delay would be different on UDP than TCP because TCP shouldn't transmit anything other than the SYN until the connection is set up whereas UDP will go ahead and transmit data beyond the first packet. Note: As discussed earlier, compression can still be employed at layers above IP. There is an IETF working group (IP Payload Compression Protocol (ippcp)) working on "protocol specifications that make it possible to perform lossless compression on individual payloads before the payload is processed by a protocol that encrypts it. These specifications will allow for compression operations to be performed prior to the encryption of a payload by IPsec protocols." 10. Conformance Requirements All IPv4 systems that claim to implement IPsec MUST comply with all requirements of the Security Architecture document. All IPv6 systems MUST comply with all requirements of the Security Architecture document. 11. Security Considerations The focus of this document is security; hence security considerations permeate this specification. 12. Differences from RFC 2401 [Will change] This architecture document differs substantially from RFC 2401 in detail and in organization, but the fundamental notions are unchanged. This document provides considerable additional detail in terms of compliance specifications. It introduces the SPD and SAD, and the notion of SA selectors. It is aligned with the new versions of AH and ESP, which also differ from their predecessors. Specific Kent [Page 49] Internet Draft Security Architecture for IP October 2003 requirements for supported combinations of AH and ESP are newly added, as are details of PMTU management. Acknowledgements The author would like to acknowledge the contributions of Ran Atkinson, who played a critical role in initial IPsec activities, and who authored the first series of IPsec standards: RFCs 1825-1827. Karen Seo deserves special thanks for providing help in the editing of this and the previous version of this specification. The author also would like to thank the members of the IPsec and MSEC working groups who have contributed to the development of this protocol specification. [For implementors using decorrelation, there may be an appendix with implementor's notes describing how to avoid creating any unnecessary SAs for a set of decorrelated SPD entries created from the same original correlated SPD entry when one or more selector values are populated from subscriber traffic.] Kent [Page 50] Internet Draft Security ArchitectureArchitecture for IPOctober 2003 Appendix AJanuary 2004 5.1.2.1 IPv4 --Glossary This section provides definitions for several key terms that are employed in this document. Other documents provide additional definitions and background information relevant to this technology, e.g., [VK83, HA94]. Included in this glossary are generic security service and security mechanism terms, plus IPsec- specific terms. Access Control Access control is a security service that prevents unauthorized use of a resource, including the prevention of use of a resource in an unauthorized manner. In the IPsec context, the resource to which access is being controlled is often: o for a host, computing cycles or data o for a security gateway, a network behind the gateway or bandwidth on that network. Anti-replay [See "Integrity" below] Authentication This term is used informally to refer to the combination of two nominally distinct security services, data origin authentication and connectionless integrity. See the definitions belowHeader Construction foreach of these services. Availability Availability, when viewed as a security service, addresses the security concerns engendered by attacks against networks that deny or degrade service. For example, in the IPsec context, the use of anti-replay mechanisms in AH and ESP support availability. Confidentiality Confidentiality is the security service that protects dataTunnel Mode <-- How Outer Hdr Relates to Inner Hdr --> Outer Hdr at Inner Hdr at IPv4 Encapsulator Decapsulator Header fields: -------------------- ------------ version 4 (1) no change header length constructed no change DS Field copied fromunauthorized disclosure.inner hdr (5) no change ECN Field copied from inner hdr constructed (6) total length constructed no change ID constructed no change flags (DF,MF) constructed, DF (4) no change fragment offset constructed no change TTL constructed (2) decrement (2) protocol AH, ESP no change checksum constructed constructed (2)(6) src address constructed (3) no change dest address constructed (3) no change Options never copied no change 1. Theprimary confidentiality concern in most instances is unauthorized disclosure of application level data, but disclosure of the external characteristics of communication also can be a concernIP version insome circumstances. Traffic flow confidentiality is the service that addresses this latter concern by concealing source and destination addresses, message length, or frequency of communication. IntheIPsec context, using ESP in tunnel mode, especially at a security gateway, can provide some level of traffic flow confidentiality. (See also traffic analysis, below.) Kent [Page 51] Internet Draft Security Architecture for IP October 2003 Encryption Encryption is a security mechanism used to transform dataencapsulating header can be different froman intelligible form (plaintext) into an unintelligible form (ciphertext), to provide confidentiality.the value in the inner header. 2. Theinverse transformation process is designated "decryption". OftimesTTL in theterm "encryption"inner header isused to generically referdecremented by the encapsulator prior toboth processes. Data Origin Authentication Data origin authentication is a security service that verifiesforwarding and by theidentity ofdecapsulator if it forwards theclaimed source of data. This service is usually bundled with connectionless integrity service. Integrity Integritypacket. (The checksum changes when the TTL changes.) Note: Decrementing the TTL value is asecurity service that ensures that modifications to data are detectable. Integrity comes in various flavors to match application requirements. IPsec supports two formsnormal part ofintegrity: connectionless andforwarding aform of partial sequence integrity. Connectionless integrity ispacket. Thus, aservice that detects modification of an individual IP datagram, without regard to the ordering ofpacket originating from thedatagram in a stream of traffic. The form of partial sequence integrity offered in IPsec is referred tosame node asanti-replay integrity, and it detects arrival of duplicate IP datagrams (within a constrained window). This is in contrast to connection- oriented integrity, which imposes more stringent sequencing requirements on traffic, e.g., to be able to detect lost or re- ordered messages. Although authentication and integrity services often are cited separately, in practice they are intimately connected and almost always offered in tandem. Security Association (SA) A simplex (uni-directional) logical connection, created for security purposes. All traffic traversing an SAthe encapsulator does not have its TTL decremented, since the sending node isprovidedoriginating thesame security processing. In IPsec, an SApacket rather than forwarding it. 3. src and dest addresses depend on the SA, which isan internet layer abstraction implemented throughused to determine theuse of AH or ESP. Security Gateway A security gatewaydest address which in turn determines which src address (net interface) isan intermediate system that acts asused to forward thecommunications interface between two networks.packet. Note: Theset of hosts (and networks) onsource address that appears in theexternal side ofencapsulating tunnel header MUST be thesecurity gateway is viewed as untrusted (or less trusted), whileone that was negotiated during thenetworks and hosts and onSA establishment process. In principle, theinternal side are viewed as trusted (or more trusted). The internal subnets and hosts served by a security gateway are presumed toencapsulating IP source address can betrusted by virtueany ofsharing a common, local, security administration. (See "Trusted Subnetwork" below.) IntheIPsec context,encapsulator's interface addresses or even an address different from any of the encapsulator's IP addresses, (e.g., if it's acting as asecurity gatewayNAT box) so long as the address isa point atreachable through the encapsulator from the environment into whichAH and/or ESPthe packet isimplementedsent. Kent [Page 33] Internet Draft Security Architecture for IP January 2004 4. configuration determines whether to copy from the inner header (IPv4 only), clear or set the DF. 5. If the packet will immediately enter a domain for which the DSCP value inorderthe outer header is not appropriate, that value MUST be mapped toserve a set of internal hosts, providing security servicesan appropriate value forthese hosts when they communicate with external hosts also employing IPsec (either Kent [Page 52] Internet Draft Security Architecturethe domain [RFC 2474]. See [RFC 2475] forIP October 2003 directlyfurther information. 6. If the ECN field in the inner header is set to ECT(0) orvia another security gateway). SPI Acronym for "Security Parameters Index". The combination of a destination address, a security protocol,ECT(1) andan SPI uniquely identifies a security association (SA, see above). The SPI is carriedthe ECN field inAH and ESP protocolsthe outer header is set toenableCE, then set thereceiving systemECN field in the inner header to CE, otherwise make no change toselecttheSA under which a received packet will be processed. An SPI has only local significance, as defined byECN field in thecreator ofinner header. The checksum changes when the ECN changes.) Note: IPsec does not copy the options from the inner header into the outer header, nor does IPsec construct the options in the outer header. However, post-IPsec code MAY insert/construct options for the outer header. 5.1.2.2 IPv6 -- Header Construction for Tunnel Mode See previous section 5.1.2.1 for notes 1-6 indicated by (footnote number). <-- How Outer Hdr Relates Inner Hdr ---> Outer Hdr at Inner Hdr at IPv6 Encapsulator Decapsulator Header fields: -------------------- ------------ version 6 (1) no change DS Field copied from inner hdr (5) no change ECN Field copied from inner hdr constructed (6) flow label copied or configured no change payload length constructed no change next header AH,ESP,routing hdr no change hop limit constructed (2) decrement (2) src address constructed (3) no change dest address constructed (3) no change Extension headers never copied no change Note: IPsec does not copy theSA (usuallyextension headers from thereceiver ofinner header into thepacket carryingouter header, nor does IPsec construct extension headers in theSPI); thus an SPI is generally viewed as an opaque bit string.outer header. However,the creator of an SA may choose to interpret the bits in an SPI to facilitate local processing. Traffic Analysis The analysis of network traffic flowpost-IPsec code MAY insert/construct extension headers for thepurpose of deducing information that is useful to an adversary. Examples of such information are frequency of transmission, the identities of the conversing parties, sizes of packets, flow identifiers, etc. [Sch94] Trusted Subnetwork A subnetwork containing hosts and routers that trust each other not to engage in active or passive attacks. There also is an assumption that the underlying communications channel (e.g., a LAN or CAN) isn't being attacked by other means.outer header. Kent [Page53]34] Internet Draft SecurityArchitecture for IP October 2003 Appendix B -- Analysis/Discussion of PMTU/DF/Fragmentation Issues [May be changed depending on decisions re: [78] PMTU handling] B.1 DF bit In cases where a system (host or gateway) adds an encapsulating header (e.g., ESP tunnel), should/must the DF bit in the original packet be copied to the encapsulating header? Fragmenting seems correct for some situations, e.g., it might be appropriate to fragment packets over a network with a very small MTU, e.g., a packet radio network, or a cellular phone hop to mobile node, rather than propagate back a very small PMTU for use over the restArchitecture for IP January 2004 5.2 Processing Inbound IP Traffic (unprotected-to-protected) Inbound processing is somewhat different from outbound processing, because of thepath. In other situations, it might be appropriateuse of SPIs toset the DF bit in ordermap IPsec protected traffic toget feedback from later routers about PMTU constraints which require fragmentation.SAs. Theexistence of both of these situations argues for enabling a systeminbound SPD cache (SPD-I) is applied only todecide whetherbypassed ornot to fragment over a particular network "link", i.e., for requiringdiscarded traffic. If animplementationarriving packet appears to beable to copy the DF bit (and to process ICMP PMTU messages), but making itanoption to be selected on a per interface basis. In other words,IPsec fragment from anadministrator should be ableunprotected interface, reassembly is performed prior toconfigure the router's treatment oftheDF bit (set, clear, copy from encapsulated header)IPsec processing. The intent foreach interface. Note: Ifany SPD cache is that abump-in-the-stack implementation of IPsec attemptspacket that fails toapply different IPsec algorithms based on source/destination ports, it will be difficultmatch any entry is then referred toapply Path MTU adjustments. B.2 Fragmentation [May change depending on decisions re: [78] PMTU handlingthe corresponding SPD. Every SPD SHOULD have a nominal, final entry that catches anything that is otherwise unmatched, andcommunity response to Mark DuffyØs proposed approach to red-side fragmentation.discards it. Thisassumesensures thatssues [49] & [81] red-side fragmentation and handling outbound fragments] have been rejected by the list.].fi If required, IP fragmentation occurs after IPsec processing within an IPsec implementation. Thus, transport mode AH or ESP is applied only to whole IP datagrams (not to IP fragments). An IP packet to which AH or ESP has been applied may itself be fragmented by routers en route,non-IPsec protected traffic that arrives andsuch fragments MUSTdoes not match any SPD-I entry will bereassembled prior todiscarded. Unprotected Interface | V +-----+ IPsecprocessing at a receiver. In tunnel mode,protected ...................>|Demux|-------------------+ : +-----+ | : | | : | Not IPsec | : |-----------+ | : V | | : +-------+ V V +-----+ +-------+ |Bypass/| +------+ +------+ |SPD-O| |Discard|<---|Discard| | ICMP | |AH/ESP| +-----+ +-------+ +-------+ +------+ +------+ ^ | | : | +---+ | : Bypass | +-->|IKE| | : | | +---+ | : V | V : +----------+ +---------+ :...............|Forwarding|<------------|SAD Check| +----------+ +---------+ | V Protected Interface Figure 3. Inbound Traffic Processing Model Prior to performing AH or ESPis applied to an IP packet, the payload of which may be a fragmentedprocessing, any IPpacket. For example, a security gateway, "bump-in-the-stack" (BITS), or "bump-in- the-wire" (BITW) IPsec implementation may apply tunnel mode AH to such fragments. Notefragments thatBITS or BITW implementationsarrive via the unprotected interface areexamples of where a host IPsec implementation might receive fragmentsreassembled (by IP). Each inbound IP datagram to whichtunnel mode is toIPsec processing will beapplied. However, if transport modeapplied isto be applied, then these implementations MUST reassemble the fragments prior to applying IPsec.Kent [Page54]35] Internet Draft Security Architecture for IPOctober 2003 NOTE: IPsec always has to figure out whatJanuary 2004 identified by theencapsulating IP header fields are. This is independentappearance ofwhere you insert IPsec and is intrinsic tothedefinition of IPsec. Therefore any IPsec implementation that is not integrated into an IP implementation must include code to constructAH or ESP values in thenecessaryIPheaders (e.g., IP2): o AH-tunnel --> IP2-AH-IP1-Transport-Data o ESP-tunnel --> IP2-ESP_hdr-IP1-Transport-Data-ESP_trailer ********************************************************************* Overall, the fragmentation/reassembly approach described above works for all cases examined. AH XportNext Protocol field (or of AHTunnel ESP Xportor ESPTunnel Implementation approach IPv4 IPv6 IPv4 IPv6 IPv4 IPv6 IPv4as an extension header in the IPv6----------------------- ---- ---- ---- ---- ---- ---- ---- ---- Hosts (integr w/ IP stack) Y Y Y Y Y Y Y Y Hosts (betw/ IP and drivers) Y Y Y Y Y Y Y Y S. Gwy (integr w/ IP stack) Y Y Y Y Outboard crypto processor * *context). IPsec MUST perform the following steps: 1. When a packet arrives, it may be tagged with the ID of the interface (physical or virtual) via which it arrived, if necessary to support multiple SPDs with different SPD-I entries. 2. The packet is examined and demuxed into one of three categories: - If thecrypto processor system has its own IP address, thenpacket appears to be IPsec protected and it iscovered byaddressed to this device, an attempt is made to map it to an active SA via thesecurity gateway case. This box receivesSAD. - Traffic not addressed to this device is directed to BYPASS/DISCARD lookup. If multiple SPDs are employed, the tag assigned to the packetfromin step 1 is used to select thehost and performs IPsec processing. It hasappropriate SPD-I (and cache) tobe ablesearch. - ICMP traffic directed tohandle the same AH, ESP, and related IPv4/IPv6 tunnel processing that a security gateway would havethis device is directed tohandle."unprotected" ICMP processing (see Section 6). 3a. Ifit doesn't have it's own address, then itthe packet issimilaraddressed to thebump-in-the stack implementation between IPIPsec device and AH or ESP is specified as thenetwork drivers. The following analysis assumes that: 1. Thereprotocol, the packet isonly one IPsec modulelooked up ina given system's stack. There isn't an IPsec module A (adding ESP/encryption and thus) hidingthetransport protocol, SRC port, and DEST portSAD identified by the SPD-ID fromIPsec module B. 2. There are several places where IPsec could be implemented (as shown instep 1. For unicast traffic, use only thetable above). a. Hosts with integration of IPsec intoSPI. For multicast traffic, use thenative IP implementation. Implementer has access toSPI plus the sourceforand/or destination addresses, as specified in thestack. b. Hosts with bump-in-the-stack implementations, where IPsecSAD. If there isimplemented between IP andno match, discard thelocal network drivers. Source access for stacktraffic. This isnot available; but there are well-defined interfaces that allows the IPsec code to be incorporated intoan auditable event. The audit log entry for this event SHOULD include thesystem. c. Security gatewayscurrent date/time, SPI, source andoutboard crypto processors with integrationdestination ofIPsec intothestack. Kent [Page 55] Internet Draft Security Architecture for IP October 2003 3. Not allpacket, IPsec protocol, and any other selector values of theabove approaches are feasible in all hosts. But it was assumedpacket thatfor each approach, therearesome hosts for whomavailable. If theapproachpacket isfeasible. For each offound in theabove 3 categories, there are IPv4 and IPv6, AH transport and tunnel modes, and ESP transport and tunnel modes -- for a total of 24 cases (3 x 2 xSAD, process it accordingly (see step 4).Some header fields and interface fields are listed here for ease of reference -- they're not in3b. If theheader order, but instead listedpacket is not addressed toallow comparison betweenthecolumns. (* = not covered by AH authentication. ESP authentication doesn't cover any headers that precede it.) IP/Transport Interface IPv4 IPv6 (RFC 1122 -- Sec 3.4) ---- ---- ---------------------- Version = 4 Version = 6 Header Len *TOS Class,Flow Lbl TOS Packet Len Payload Len Len ID ID (optional) *Flags DF *Offset *TTL *Hop Limit TTL Protocol Next Header *Checksum Src Address Src Address Src Address Dst Address Dst Address Dst Address Options? Options? Opt ? = AH covers Option-Type and Option-Length, but might not cover Option-Data. The results for each ofdevice, look up the20 cases is shown below ("works" = will work if system fragments after outbound IPsec processing, reassembles before inbound IPsec processing). Notes indicate implementation issues. a. Hosts (integrated into IP stack) o AH-transport --> (IP1-AH-Transport-Data) - IPv4 -- works - IPv6 -- works o AH-tunnel --> (IP2-AH-IP1-Transport-Data) - IPv4 -- works - IPv6 -- works o ESP-transport --> (IP1-ESP_hdr-Transport-Data-ESP_trailer) Kent [Page 56] Internet Draft Security Architecture for IP October 2003 - IPv4 -- works - IPv6 -- works o ESP-tunnel --> (IP2-ESP_hdr-IP1-Transport-Data-ESP_trailer) - IPv4 -- works - IPv6 -- works b. Hosts (Bump-in-the-stack) -- put IPsec between IP layerpacket header in the (appropriate) SPD-I cache. If there is a match andnetwork drivers. In this case,theIPsec module would havepacket is to be discarded or bypassed, dosomething like oneso. If there is no cache match, look up the packet in the corresponding SPD-I and create a cache entry as appropriate. (No SAs are created in response to receipt of a packet that requires IPsec protection; only bypass or discard entries can be created this way.) If there is no match, discard thefollowingtraffic. This is an auditable event. The audit log entry forfragmentationthis event SHOULD include the current date/time, SPI if available, IPsec protocol if available, source andreassembly. - dodestination of thefragmentation/reassembly work itselfpacket, andsend/receiveany other selector values of the packetdirectly to/fromthat are available. 3c. Unprotected ICMP processing is assumed to take place on thenetwork layer. In AH or ESP transport mode, thisunprotected side of the IPsec boundary. Unprotected ICMP messages are examined and local policy isfine. In AHapplied to determine whether to accept orESP tunnel mode where the tunnel endreject these messages and, if accepted, what action to take as a Kent [Page 36] Internet Draft Security Architecture for IP January 2004 result. For example, if an ICMP unreachable message isatreceived, theultimate destination, this is fine. But inimplementation must decide whether to act on it, reject it, or act on it with constraints. [See Section 6.] 4. Apply AH or ESPtunnel modes where the tunnel end is different from the ultimate destination and whereprocessing as specified, using thesource host is multi-homed, this approach could resultSAD entry selected insub-optimal routing becausestep 2a above. Then match theIPsec module may be unable to obtainpacket against theinformation needed (LAN interface and next-hop gateway)inbound selectors identified by the SAD entry todirectverify that the received packetto the appropriate network interface. Thisisnot a problem ifappropriate for theinterfaceSA via which it was received. If an IPsec system receives an inbound packet on an SA andnext-hop gatewaythe packet's header fields are not consistent with thesameselectors for theultimate destination andSA, it MUST drop the packet. This is an auditable event. The audit log entry for this event SHOULD include thetunnel end. But if they are different, thencurrent date/time, SPI, IPsecwould need to know the LAN interfaceprotocol(s), source and destination of thenext-hop gateway forpacket, and any other selector values of thetunnel end. (Note: The tunnel end (security gateway) is highly likely to be onpacket that are available, and theregular path toselector values from theultimate destination. But there couldrelevant SAD entry. The system SHOULD also bemore than one pathcapable of generating and sending an IKE notification to thedestination, e.g.,sender (IPsec peer), indicating that thehost couldreceived packet was dropped because of failure to pass selector checks. NOTIFY MESSAGES - ERROR TYPES Value ----------------------------- ----- INVALID_SELECTORS iana-tbd MAY beatsent in anorganization with 2 firewalls. AndIKE INFORMATIONAL Exchange when a node receives an ESP or AH packet whose selectors do not match those of thepath being used could involveSA on which it was delivered (and which caused theless commonly chosen firewall.) OR - passpacket to be dropped). The Notification Data contains the start of theIPsec'doffending packetback(as in ICMP messages) and the SPI field of the notification is set to match theIP layer whereSPI of the IPsec SA. To minimize the impact of a DoS attack or a mis-configured peer, the IPsec system SHOULD include a management control to allow anextra IP header would end up being pre-pendedadministrator to configure the IPsec implementation to send or not send this IKE notification, and if this facility is selected, to rate limit theIPsec module would havetransmission of such notifications. After traffic is bypassed or processed through IPsec, it is handed tocheck and let IPsec'd fragments go by. OR - passthe inbound forwarding function for disposition. This function may cause the packetcontentsto be sent across theIP layerIPsec boundary for additional inbound IPsec processing, e.g., ina form suchsupport of nested SAs. If so, then as with ALL outbound traffic thatthe IP layer recreates an appropriate IP header At the network layer, the IPsec module will have accessis tothe following selectors frombe bypassed, the packet-- SRC address, DST address, Next Protocol, and if there's a transport layer header --> SRC port and DST port. One cannot assume IPsec has access to the Name. It is assumed thatMUST be matched against an SPD-O entry. Ultimately, theavailable selector information is sufficientpacket should be forwarded tofigure outtherelevant Security Policy entry and Security Association(s). o AH-transport --> (IP1-AH-Transport-Data) - IPv4 -- works - IPv6 -- works o AH-tunnel --> (IP2-AH-IP1-Transport-Data) - IPv4 -- works - IPv6 -- works o ESP-transport --> (IP1-ESP_hdr-Transport-Data-ESP_trailer) - IPv4 -- worksdestination host or process for disposition. Kent [Page57]37] Internet Draft Security Architecture for IPOctober 2003 - IPv6 -- works o ESP-tunnel --> (IP2-ESP_hdr-IP1-Transport-Data-ESP_trailer) - IPv4 -- works - IPv6 -- works c. Security gateways -- integrateJanuary 2004 6. ICMP Processing [This section will be filled in when IPsecinto the IP stackissue # 91 is resolved. The following text needs to be inserted somewhere, possibly this section.] NOTE: With the exception of IPv4 transport mode, an SG, BITS, or BITW implementation MAY fragment packets before applying IPsec. The device SHOULD have a configuration setting to disable this. The resulting fragments are evaluated against the SPD in the normal manner. Thus, fragments not containing port numbers may only match rules having port selectors of OPAQUE or "ANY". 7. Auditing Not all systems that implement IPsecmodulewillhave access toimplement auditing. For thefollowing selectors frommost part, thepacket -- SRC address, DST address, Next Protocol, and if there'sgranularity of auditing is atransport layer header --> SRC portlocal matter. However, several auditable events are identified in this document andDST port. It won't have access to the User ID (only Hosts have access to User ID information.) Unlike some Bump-in-the-stack implementations, security gateways mayfor each of these events a minimum set of information that SHOULD beable to look up the Source Addressincluded inthe DNS to provide a System Name, e.g.,an audit log is defined. Additional information also MAY be included insituations involving usethe audit log for each ofdynamically assigned IP addressesthese events, and additional events, not explicitly called out inconjunction with dynamically updated DNS entries. Itthis specification, alsowon't have accessMAY result in audit log entries. There is no requirement for the receiver to transmit any message to thetransport layer information if there ispurported transmitter in response to the detection of anESP header, or if it's notauditable event, because of thefirst fragmentpotential to induce denial ofa fragmented message. It is assumedservice via such action. 8. Conformance Requirements All IPv4 systems thatthe available selector information is sufficientclaim tofigure out the relevantimplement IPsec MUST comply with all requirements of this document. All IPv6 systems that claim to implement IPsec MUST comply with all requirements of this document. 9. SecurityPolicy entryConsiderations The focus of this document is security; hence security considerations permeate this specification. 10. Differences from RFC 2401 [Will be updated when things have settled down.] This architecture document differs substantially from RFC 2401 in detail andSecurity Association(s). o AH-tunnel --> (IP2-AH-IP1-Transport-Data) - IPv4 -- works - IPv6 -- works o ESP-tunnel --> (IP2-ESP_hdr-IP1-Transport-Data-ESP_trailer) - IPv4 -- works - IPv6 -- works ********************************************************************** B.3 Path MTU Discovery As mentioned earlier, "ICMP PMTU" refers to an ICMP message used for Path MTU Discovery.in organization, but the fundamental notions are unchanged. Acknowledgements Thelegend forauthors would like to acknowledge thediagrams belowcontributions of Ran Atkinson, who played a critical role inB.3.1initial IPsec activities, andB.3.3 (but not B.3.2) is:who authored the first series of IPsec standards: RFCs 1825-1827. Kent [Page58]38] Internet Draft Security Architecture for IPOctober 2003 ==== = security association (AH or ESP, transport or tunnel) ---- = connectivity (or if so labelled, administrative boundary) .... = ICMP message (hereafter referredJanuary 2004 Also a contributor who wishes toas ICMP PMTU)remain nameless, deserves special thanks forIPv4: - Type = 3 (Destination Unreachable) - Code = 4 (Fragmentation needed and DF set) - Next-Hop MTUproviding extensive help in thelow-order 16 bits of the second wordediting ofthe ICMP header (labelled unused in RFC 792), with high-order 16 bits setthis specification. The authors also would like tozero IPv6 (RFC 1885): - Type = 2 (Packet Too Big) - Code = 0 (Fragmentation needed and DF set) - Next-Hop MTU inthank the32 bit MTU fieldmembers of theICMP6 Hx = host x Rx = router x SGx = security gateway x X* = X supportsIPsecB.3.1 Identifyingand MSEC working groups who have contributed to theOriginating Host(s) The amountdevelopment ofinformation returned with the ICMP message is limitedthis protocol specification. Kent [Page 39] Internet Draft Security Architecture for IP January 2004 Appendix A -- Glossary This section provides definitions for several key terms that are employed in this document. Other documents provide additional definitions and background information relevant to this technology, e.g., [Shi00, VK83, HA94]. Included in thisaffects what selectorsglossary areavailable to identifygeneric securityassociations, originating hosts, etc. for use in further propagating the PMTU information. In brief... An ICMP message must contain the following information from the "offending" packet: - IPv4 (RFC 792) -- IP headerservice and security mechanism terms, plus IPsec-specific terms. Access Control Access control is aminimumsecurity service that prevents unauthorized use of64 bits Accordingly,a resource, including the prevention of use of a resource in an unauthorized manner. In theIPv4IPsec context,an ICMP PMTU may identify onlythefirst (outermost)resource to which access is being controlled is often: o for a host, computing cycles or data o for a securityassociation.gateway, a network behind the gateway or bandwidth on that network. Anti-replay [See "Integrity" below] Authentication This term isbecauseused informally to refer to theICMP PMTU may contain only 64 bitscombination of two nominally distinct security services, data origin authentication and connectionless integrity. See the"offending" packet beyond the IP header, which would capture onlydefinitions below for each of these services. Availability Availability, when viewed as a security service, addresses thefirst SPI from AHsecurity concerns engendered by attacks against networks that deny orESP. Indegrade service. For example, in theIPv6IPsec context,an ICMP PMTU will probably provide alltheSPIsuse of anti-replay mechanisms in AH and ESP support availability. Confidentiality Confidentiality is theselectorssecurity service that protects data from unauthorized disclosure. The primary confidentiality concern inthe IP header,most instances is unauthorized disclosure of application level data, butmaybe notdisclosure of theSRC/DST ports (inexternal characteristics of communication also can be a concern in some circumstances. Traffic flow confidentiality is thetransport header)service that addresses this latter concern by concealing source and destination addresses, message length, or frequency of communication. In theencapsulated (TCP, UDP, etc.) protocol. Moreover, ifIPsec context, using ESPis used, the transport ports and protocol selectors may be encrypted. Lookingin tunnel mode, especially atthe diagram below ofa securitygateway tunnel (as mentioned elsewhere,gateway, can provide some level of traffic flow confidentiality. (See also traffic analysis, below.) Data Origin Authentication Data origin authentication is a securitygateways do not use transport mode)...service that verifies the Kent [Page59]40] Internet Draft Security Architecture for IPOctober 2003 H1 =================== H3 \ | | / H0 -- SG1* ---- R1 ---- SG2* ---- R2 -- H5 / ^ | \ H2 |........| H4 Suppose thatJanuary 2004 identity of the claimed source of data. This service is usually bundled with connectionless integrity service. Encryption Encryption is a securitypolicy for SG1mechanism used to transform data from an intelligible form (plaintext) into an unintelligible form (ciphertext), to provide confidentiality. The inverse transformation process is designated "decryption". Oftimes the term "encryption" is used tousegenerically refer to both processes. Integrity Integrity is asingle SAsecurity service that ensures that modifications toSG2 for all the traffic between hosts H0, H1, and H2data are detectable. Integrity comes in various flavors to match application requirements. IPsec supports two forms of integrity: connectionless andhosts H3, H4,a form of partial sequence integrity. Connectionless integrity is a service that detects modification of an individual IP datagram, without regard to the ordering of the datagram in a stream of traffic. The form of partial sequence integrity offered in IPsec is referred to as anti-replay integrity, andH5. And suppose H0 sendsit detects arrival of duplicate IP datagrams (within adata packetconstrained window). This is in contrast toH5connection- oriented integrity, whichcauses R1 to send an ICMP PMTU messageimposes more stringent sequencing requirements on traffic, e.g., toSG1. If the PMTU message has only the SPI, SG1 willbe able tolook up the SAdetect lost or re- ordered messages. Although authentication andfind the list of possible hosts (H0, H1, H2, wildcard); but SG1 will have no wayintegrity services often are cited separately, in practice they are intimately connected and almost always offered in tandem. Protected vs Unprotected "Protected" refers tofigure out that H0 sentthetrafficsystems or interfaces thattriggeredare inside theICMP PMTU message. original afterIPsecICMP packet processing packet -------- ----------- ------ IP-3 header (S = R1, D = SG1) ICMP header (includes PMTU) IP-2 header IP-2 header (S = SG1, D = SG2) ESP header minimum of 64 bits of ESP hdr (*) IP-1 header IP-1 header TCP header TCP header TCP data TCP data ESP trailer (*) The 64 bits will include enough of the ESP (or AH) headerprotection boundary and "unprotected" refers toincludetheSPI. - ESP -- SPI (32 bits), Seq number (32 bits) - AH -- Next header (8 bits), Payload Len (8 bits), Reserved (16 bits), SPI (32 bits) This limitation onsystems or interfaces that are outside theamount of information returned with an ICMP message createsIPsec protection boundary. IPsec provides aproblembarrier through which traffic passes. There is an asymmetry to this barrier, which is reflected inidentifying the originating hosts forthepacket (so as to know where to further propagateprocessing model. Outbound data, if not discarded or bypassed, is protected via theICMP PMTU information). Ifapplication of AH or ESP and theICMP message contains only 64 bitsaddition of theIPsec header (minimum for IPv4), thencorresponding headers. Inbound data, if not discarded or bypassed, is processed via the removal of AH or ESP headers. In this document, inbound traffic enters an IPsecselectors (e.g., Source and Destination addresses, Next Protocol, Source and Destination ports, etc.) will have been lost. Butimplementation from theICMP error message will still provide SG1 with"unprotected" interface. Outbound traffic enters theSPI,implementation via the "protected" interface, or is emitted by the implementation on the "protected" side of thePMTU informationboundary and directed toward thesource and destination gateways for"unprotected" interface. An IPsec implementation may support more than one interface on either or both sides of therelevant security association.boundary. Thedestination security gateway and SPI uniquely define a security association whichprotected interface may be internal, e.g., inturn definesasethost implementation ofpossible originating hosts. At this point, SG1 could:IPsec. The protected interface may link to a socket layer interface presented by the Kent [Page60]41] Internet Draft Security Architecture for IPOctober 2003 a. send the PMTU information to all the possible originating hosts. This would not work well if the host listJanuary 2004 OS. Security Association (SA) A simplex (uni-directional) logical connection, created for security purposes. All traffic traversing an SA isa wild card or if many/most ofprovided thehosts weren't sending to SG1; but it might work ifsame security processing. In IPsec, an SA is an internet layer abstraction implemented through theSPI/destination/etc mapped to just one or a small numberuse ofhosts. b. store the PMTUAH or ESP. State data associated with an SA is represented in theSPI/etc and wait untilSecurity Association Database (SAD). Security Gateway A security gateway is an intermediate system that acts as thenext packet(s) arrive fromcommunications interface between two networks. The set of hosts (and networks) on theoriginating host(s) forexternal side of therelevantsecurityassociation. If it/theygateway is termed unprotected (they arebiggerat generally at least less protected than those "behind thePMTU, dropSG), while thepacket(s),networks andcompose ICMP PMTU message(s) with the new packet(s)hosts and on theupdated PMTU,internal side are viewed as protected. The internal subnets andsend the originating host(s) the ICMP message(s) about the problem. This involveshosts served by adelay in notifying the originating host(s), but avoids the problemssecurity gateway are presumed to be trusted by virtue of(a). Since onlysharing a common, local, security administration. (See "Trusted Subnetwork" below.) In thelatter approach is feasible in all instances,IPsec context, a security gatewayMUST provide such support, as an option. However, if the ICMP message contains more information from the original packet, then there may be enough information to immediately determine tois a point at whichhost to propagate the ICMP/PMTU message andAH and/or ESP is implemented in order toprovide that systemserve a set of internal hosts, providing security services for these hosts when they communicate withthe 5 fields (source address,external hosts also employing IPsec (either directly or via another security gateway). SPI Acronym for "Security Parameters Index" (SPI). The combination of a destination address,source port, destination port, and transport protocol) needed to determine where to store/update the PMTU. Under such circumstances,a securitygateway MUST generate an ICMP PMTU message immediately upon receipt ofprotocol, and anICMP PMTU from further downSPI uniquely identifies a security association (SA, see above) in thepath. NOTE:context of unicast or anycast traffic. Additional IP address information is used to identify multicast SAs. TheNext Protocol field may not be containedSPI is carried inthe ICMP messageAH andthe use ofESPencryption may hideprotocols to enable theselector fields that have been encrypted. B.3.2 Calculationreceiving system to select the SA under which a received packet will be processed. An SPI has only local significance, as defined by the creator ofPMTU The calculationthe SA (usually the receiver ofPMTU fromthe packet carrying the SPI); thus anICMP PMTU has to take into accountSPI is generally viewed as an opaque bit string. However, theadditioncreator ofany IPsec header by H1 -- AH and/or ESP transport, or ESP or AH tunnel. Within a single host, multiple applicationsan SA maysharechoose to interpret the bits in an SPIand nesting of security associations may occur. (See Section 4.5 Basic Combinationsto facilitate local processing. Traffic Analysis The analysis ofSecurity Associationsnetwork traffic flow fordescription ofthecombinationspurpose of deducing information thatMUST be supported). The diagram below illustratesis useful to anexampleadversary. Examples ofsecurity associations between a pairsuch information are frequency ofhosts (as viewed fromtransmission, theperspective of oneidentities of thehosts.) (ESPx or AHx = transport mode) Socket 1 -------------------------| | Socket 2 (ESPx/SPI-A) ---------- AHx (SPI-B) -- Internet In order to figure out the PMTU for each socket that maps to SPI-B, it will be necessary to have backpointers from SPI-B to eachconversing parties, sizes ofthe 2 paths that lead to it - - Socket 1 and Socket 2/SPI-A.packets, flow identifiers, etc. [Sch94] Kent [Page61]42] Internet Draft Security Architecture for IPOctober 2003 B.3.3 Granularity of Maintaining PMTU Data In hosts, the granularity with which PMTU ICMP processing can be done differs dependingJanuary 2004 Appendix B - Decorrelation This section is based on work done in theimplementation situation. Looking at a host, there are three situations that are of interest with respect to PMTU issues: a. Integration of IPsec into the nativeIPimplementation b. Bump-in-the-stack implementations, where IPsecSecurity Policy Working Group by Luis Sanchez, Matt Condell, and John Zao. Two SPD entries are correlated if there isimplemented "underneath" an existing implementation ofaTCP/IP protocol stack,non-null intersection between thenative IP and the local network drivers c. No IPsec implementation -- This case is included because it is relevantvalues of corresponding selectors incases where a security gatewayeach entry. Caching correlated SPD entries can lead to incorrect policy enforcement. A solution to this problem, that still allows for caching, issending PMTU information backto remove the ambiguities by decorrelating the entries. That is, the SPD entries must be rewritten so that for every pair of entries there exists a selector for which there is ahost. Only in case (a) can the PMTU data be maintained atnull intersection between thesame granularity as communication associations. Invalues in both of theother cases,entries. Once theIP layerentries are decorrelated, there is no longer any ordering requirement on them, since only one entry willmaintain PMTU data at the granularity of Source and Destination IP addresses (and optionally TOS/Class), as describedmatch any lookup. The next section describes decorrelation inRFC 1191. This is an important difference, becausemorethan one communication associationdetail and presents an algorithm that maymapbe used tothe same source and destination IP addresses, andimplement decorrelation. B.1 Decorrelation Algorithm The basic decorrelation algorithm takes eachcommunication association may haveentry in adifferent amountcorrelated SPD and divides it up into a set ofIPsec header overhead (e.g., due to useentries using a tree structure. Those ofdifferent transforms or different algorithms). The examples below illustrate this. In cases (a) and (b)... Suppose you have the following situation. H1 is sending to H2 andthepacket to be sent from R1 to R2 exceedsresulting entries that are decorrelated with thePMTUdecorrelated set ofthe network hop between them. ================================== | | H1* --- R1 ----- R2 ---- R3 ---- H2* ^ | |.......| If R1 is configuredentries are then added to that decorrelated set. The basic algorithm does notfragment subscriber traffic, then R1 sendsguarantee anICMP PMTU message with the appropriate PMTU to H1. H1's processing would vary with the natureoptimal set of decorrelated entries. That is, theimplementation. In case (a) (native IP), the security services are bound to sockets or the equivalent. Here the IP/IPsec implementation in H1 can store/update the PMTU for the associated socket. In case (b), the IP layer in H1 can store/update the PMTU but only at the granularity of Source and Destination addresses and possibly TOS/Class, as noted above. Soentries may be broken up into smaller sets than is necessary, though they will still provide all theresult may be sub- optimal, sincenecessary policy information. Some extensions to thePMTU for a given SRC/DST/TOS/Class will bebasic algorithm are described later to improve this and improve thesubtractionperformance of thelargest amountalgorithm. C A set ofIPsec header used for any communication association betweenordered, correlated entries (a correlated SPD) Ci The ith entry in C. U The set of decorrelated entries being built from C Ui The ith entry in U. A policy (SPD entry) P may be expressed as agivensequence of selector values and an action (Bypass, Discard, or apply IPsec): Pi = Si1 x Si2 x ... x Sik -> Ai 1) Put C1 in set U as U1 For each policy Cj (j > 1) in C 2) If Cj is decorrelated with every entry in U, then add it to U. Kent [Page62]43] Internet Draft Security Architecture for IPOctober 2003 source and destination. In case (c), thereJanuary 2004 3) If Cj is correlated with one or more entries in U, create a tree rooted at the policy Cj that partitions Cj into a set of decorrelated entries. The algorithm starts with a root node where no selectors have yet been chosen. A) Choose a selector in Cj, Scjn, that has not yet been chosen when traversing the tree from the root tobe a security gatewaythis node. If there are no selectors not yet used, continue to the next unfinished branch until all branches haveany IPsec processing. So suppose you havebeen completed. When thefollowing situation. H1tree issendingcompleted, go toH2 andstep D. T is thepacket to be sent from SG1 to R exceedsset of entries in U that are correlated with the entry at this node. The entry at this node is the entry formed by thePMTUselector values of each of thenetwork hopbranches betweenthem. ================ | | H1 ---- SG1* --- R --- SG2* ---- H2 ^ | |.......| As described abovethe root and this node. Any selector values that are not yet represented by branches assume the corresponding selector value in Cj, since the values in Cj represent the maximum value forcase (b),each selector. B) Add a branch to the tree for each value of theIP layerselector Scjn that appears inH1 can store/updateany of thePMTU but only atentries in T. (If thegranularityvalue is a superset ofSource and Destination addresses, and possibly TOS/Class. Sotheresult may be sub-optimal,value of Scjn in Cj, then use the value in Cj, since that value represents thePMTU foruniversal set.) Also add agiven SRC/DST/TOS/Class will bebranch for thesubtractioncomplement of thelargest amount of IPsec header used for any communication association between a given source and destination. B.3.4 Per Socket Maintenanceunion ofPMTU Data Implementationall the values of thecalculationselector Scjn in T. When taking the complement, remember that the universal set is the value ofPMTU (Section B.3.2) and supportScjn in Cj. A branch need not be created forPMTUs atthegranularity of individual "communication associations" (Section B.3.3)null set. C) Repeat A and B until the tree is completed. D) The entry to each leaf now represents an entry that is alocal matter. However, a socket- based implementationsubset ofIPsec in a host SHOULD maintainCj. The entries at theinformation onleaves completely partition Cj in such aper socket basis. Bumpway that each entry is either completely overridden by an entry in U, or is decorrelated with thestack systems MUST pass an ICMP PMTU toentries in U. Add all thehost IP implementation, after adjusting it for any IPsec header overhead added by these systems. The determination ofdecorrelated entries at theoverhead SHOULD be determined by analysisleaves of theSPItree to U. 4) Get next Cj andany other selector information presentgo to 2. 5) When all entries ina returned ICMP PMTU message. B.3.5 DeliveryC have been processed, then U will contain an decorrelated version ofPMTU DataC. There are several optimizations that can be made tothe Transport Layer The host mechanism for getting the updated PMTUthis algorithm. A few of them are presented here. It is possible to optimize, or at least improve, thetransport layer is unchanged, as specified in RFC 1191 (Path MTU Discovery). B.3.6 Agingamount ofPMTU Data This topic is covered in Section 6.1.2.4.branching that occurs by carefully choosing the order of the Kent [Page63]44] Internet Draft Security Architecture for IPOctober 2003 Appendix C -- Sequence Space Window Code Example [Will change to reflect ESN mod to AH and ESP] This appendix contains a routine that implements a bitmask checkJanuary 2004 selectors used for the next branch. For example, if a32 packet window. It was provided by James Hughes (jim_hughes@stortek.com) and Harry Varnis (hgv@anubis.network.com) and is intended as an implementation example. Noteselector Scjn can be chosen so thatthis code both checksall the values for that selector in T are equal to or areplay and updates the window. Thussuperset of thealgorithm, as shown, shouldvalue of Scjn in Cj, then only a single branch needs to becalled AFTERcreated (since thepacket has been authenticated. Implementers might wish to consider splittingcomplement will be null). Branches of thecode totree do not have to proceed with thecheck for replays before computing the ICV. Ifentire decorrelation algorithm. For example, if a node represents an entry that is decorrelated with all thepacketentries in U, then there isnotno reason to continue decorrelating that branch. Also, if areplay, the code wouldbranch is completely overridden by an entry in U, thencomputethere is no reason to continue decorrelating theICV, (discard any bad packets), andbranch. An additional optimization is to check to see ifthe packeta branch isOK, updateoverridden by one of thewindow. #include <stdio.h> #include <stdlib.h> typedef unsigned long u_long; enum { ReplayWindowSize = 32 }; u_long bitmap = 0; /* session state - must be 32 bits */ u_long lastSeq = 0; /* session state */ /* Returns 0 if packet disallowed, 1 if packet permitted */ int ChkReplayWindow(u_long seq); int ChkReplayWindow(u_long seq) { u_long diff; if (seq == 0) return 0; /* first == 0 or wrapped */CORRELATED entries in set C that has already been decorrelated. That is, if(seq > lastSeq) { /* new larger sequence number */ diff = seq - lastSeq;the branch is part of decorrelating Cj, then check to see if(diffit was overridden by an entry Cm, m <ReplayWindowSize) { /* In window */ bitmap <<= diff; bitmap |= 1; /* set bit for this packet */ } else bitmap = 1; /*j. Thispacket hasis a"way larger" */ lastSeq = seq; return 1; /* larger is good */ } diff = lastSeq - seq; if (diff >= ReplayWindowSize) return 0; /* too old or wrapped */valid check, since all the entries Cm are already expressed in U. Along with checking if(bitmap & ((u_long)1 << diff)) return 0; /*an entry is alreadyseen */ bitmap |= ((u_long)1 << diff); /* mark as seen */ return 1; /* out of order but good */ } Kent [Page 64] Internet Draft Security Architecture for IP October 2003 char string_buffer[512]; #define STRING_BUFFER_SIZE sizeof(string_buffer) int main() { int result; u_long last, current, bits; printf("Input initial state (bitsdecorrelated inhex, last msgnum):\n");step 2, check if(!fgets(string_buffer, STRING_BUFFER_SIZE, stdin)) exit(0); sscanf(string_buffer, "%lx %lu", &bits, &last);Cj is overridden by any entry in U. If it is, skip it since it is not relevant. An entry x is overridden by another entry y if(last != 0) bits |= 1; bitmap = bits; lastSeq = last; printf("bits:%08lx last:%lu\n", bitmap, lastSeq); printf("Input valueevery selector in x is equal totest (current):\n"); while (1) { if (!fgets(string_buffer, STRING_BUFFER_SIZE, stdin)) break; sscanf(string_buffer, "%lu", ¤t); result = ChkReplayWindow(current); printf("%-3s", result ? "OK" : "BAD"); printf(" bits:%08lx last:%lu\n", bitmap, lastSeq); } return 0; }or a subset of the corresponding selector in entry y. Kent [Page65]45] Internet Draft Security Architecture for IPOctober 2003January 2004 AppendixDC -- Categorization of ICMP messages [May be deleted] The tables below characterize ICMP messages as being either host generated, router generated, both, unassigned/unknown. The first set of messages are for IPv4. The second set of messages are for IPv6. IPv4 Type Name/Codes Reference ======================================================================== HOST GENERATED: 3 Destination Unreachable 2 Protocol Unreachable [RFC792] 3 Port Unreachable [RFC792] 8 Source Host Isolated [RFC792] 14 Host Precedence Violation [RFC1812] 10 Router Selection [RFC1256] Type Name/Codes Reference ======================================================================== ROUTER GENERATED: 3 Destination Unreachable 0 Net Unreachable [RFC792] 4 Fragmentation Needed, Don't Fragment was Set [RFC792] 5 Source Route Failed [RFC792] 6 Destination Network Unknown [RFC792] 7 Destination Host Unknown [RFC792] 9 Comm. w/Dest. Net. is Administratively Prohibited [RFC792] 11 Destination Network Unreachable for Type of Service[RFC792] 5 Redirect 0 Redirect Datagram for the Network (or subnet) [RFC792] 2 Redirect Datagram for the Type of Service & Network[RFC792] 9 Router Advertisement [RFC1256] 18 Address Mask Reply [RFC950] Kent [Page66]46] Internet Draft Security Architecture for IPOctober 2003January 2004 IPv4 Type Name/Codes Reference ======================================================================== BOTH ROUTER AND HOST GENERATED: 0 Echo Reply [RFC792] 3 Destination Unreachable 1 Host Unreachable [RFC792] 10 Comm. w/Dest. Host is Administratively Prohibited [RFC792] 12 Destination Host Unreachable for Type of Service [RFC792] 13 Communication Administratively Prohibited [RFC1812] 15 Precedence cutoff in effect [RFC1812] 4 Source Quench [RFC792] 5 Redirect 1 Redirect Datagram for the Host [RFC792] 3 Redirect Datagram for the Type of Service and Host [RFC792] 6 Alternate Host Address [JBP] 8 Echo [RFC792] 11 Time Exceeded [RFC792] 12 Parameter Problem [RFC792,RFC1108] 13 Timestamp [RFC792] 14 Timestamp Reply [RFC792] 15 Information Request [RFC792] 16 Information Reply [RFC792] 17 Address Mask Request [RFC950] 30 Traceroute [RFC1393] 31 Datagram Conversion Error [RFC1475] 32 Mobile Host Redirect [Johnson] 39 SKIP [Markson] 40 Photuris [Simpson] Type Name/Codes Reference ======================================================================== UNASSIGNED TYPE OR UNKNOWN GENERATOR: 1 Unassigned [JBP] 2 Unassigned [JBP] 7 Unassigned [JBP] 19 Reserved (for Security) [Solo] 20-29 Reserved (for Robustness Experiment) [ZSu] 33 IPv6 Where-Are-You [Simpson] 34 IPv6 I-Am-Here [Simpson] 35 Mobile Registration Request [Simpson] 36 Mobile Registration Reply [Simpson] 37 Domain Name Request [Simpson] 38 Domain Name Reply [Simpson] 41-255 Reserved [JBP] Kent [Page67]47] Internet Draft Security Architecture for IPOctober 2003January 2004 IPv6 Type Name/Codes Reference ======================================================================== HOST GENERATED: 1 Destination Unreachable [RFC 1885] 4 Port Unreachable Type Name/Codes Reference ======================================================================== ROUTER GENERATED: 1 Destination Unreachable [RFC1885] 0 No Route to Destination 1 Comm. w/Destination is Administratively Prohibited 2 Not a Neighbor 3 Address Unreachable 2 Packet Too Big [RFC1885] 0 3 Time Exceeded [RFC1885] 0 Hop Limit Exceeded in Transit 1 Fragment reassembly time exceeded Type Name/Codes Reference ======================================================================== BOTH ROUTER AND HOST GENERATED: 4 Parameter Problem [RFC1885] 0 Erroneous Header Field Encountered 1 Unrecognized Next Header Type Encountered 2 Unrecognized IPv6 Option Encountered Kent [Page68]48] Internet Draft Security Architecture for IPOctober 2003January 2004 References [Will be updated after the text settles down] Normative [Bra97] Bradner, S., "Key words for use in RFCs to Indicate Requirement Level", BCP 14, RFC 2119, March 1997. [DH98] Deering, S., and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998. [Eas03] Eastlake, D., "Cryptographic Algorithm Implementation Requirements For ESP And AH", draft-ietf-ipsec-esp-ah- algorithms-00.txt, December 2003. [HC03] Holbrook, H., and Cain, B., "Source Specific Multicast for IP", Internet Draft,draft-ietf-ssm- arch-01.txt,draft-ietf-ssm-arch-01.txt, November 3, 2002.[Kau04][Kau03] Kaufman, C., "The Internet Key Exchange(IKEv2)", RFC ???, ??? 2004(IKEv2) Protocol", draft-ietf- ipsec-ikev2-11.txt, October 2003 [Ken04a] Kent, S., "IP Encapsulating Security Payload (ESP)", RFC ???, ???? 2004. [Ken04b] Kent, S., "IP Authentication Header", RFC ???, ??? 2004. [Mobip] Johnson, D., Perkins, C., Arkko, J., "Mobility Support in IPv6", Internet Draft, draft-ietf-mobileip-ipv6-24.txt, June 2003 [Pos81] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981 [Sch03] Schiller, J., "Cryptographic Algorithms for use in the Internet Key Exchange Version 2", draft-ietf-ipsec- ikev2-algorithms-04.txt, September 2003 Informative [BL73] Bell, D.E. & LaPadula, L.J., "Secure Computer Systems: Mathematical Foundations and Model", Technical Report M74-244, The MITRE Corporation, Bedford, MA, May 1973. [DoD85] US National Computer Security Center, "Department of Defense Trusted Computer System Evaluation Criteria", DoD 5200.28-STD, US Department of Defense, Ft. Meade, MD., December 1985. Kent [Page 49] Internet Draft Security Architecture for IP January 2004 [DoD87] US National Computer Security Center, "Trusted Network Interpretation of the Trusted Computer System Evaluation Criteria", NCSC-TG-005, Version 1, US Department of Defense, Ft. Meade, MD., 31 July 1987. [FaLiHaMeTr00]Farinacci, D., Li, T., Hanks, S., Meyer, D., Traina, P., "Generic Routing Encapsulation (GRE), RFC 2784, March 2000. [Gro02] Grossman, D., "New Terminology and Clarifications for Diffserv", RFC 3260, April 2002. [HA94] Haller, N., andR.Atkinson, R., "On Internet Authentication", RFC 1704, October1994. Kent [Page 69] Internet Draft Security Architecture for IP October 20031994 [ISO] ISO/IEC JTC1/SC6, Network Layer Security Protocol, ISO-IEC DIS 11577, International Standards Organisation, Geneva, Switzerland, 29 November 1992. [IB93]John IoannidisIoannidis, J. andMattBlaze, M., "Architecture and Implementation of Network-layer Security Under Unix", Proceedings of USENIX Security Symposium, Santa Clara, CA, October 1993. [IBK93]JohnIoannidis,MattJ., Blaze,& PhilM., and Karn, P., "swIPe: Network- Layer Security for IP", presentation at the Spring 1993 IETF Meeting, Columbus, Ohio [Ken91] Kent, S., "US DoD Security Options for the Internet Protocol", RFC 1108, November 1991. [MSST97] Maughan, D., Schertler, M., Schneider, M., and J. Turner, "Internet Security Association and Key Management Protocol (ISAKMP)", RFC 2408, November 1998. [NiBlBaBL98]Nichols, K., Blake, S., Baker, F., Black, D., "Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers", RFC2474, December 1998. [Orm97] Orman, H., "The OAKLEY Key Determination Protocol", RFC 2412, November 1998. [Per96] Perkins, C., "IP Encapsulation within IP", RFC 2003, October 1996. [Pip98] Piper, D., "The Internet IP Security Domain of Interpretation for ISAKMP", RFC 2407, November 1998. Kent [Page 50] Internet Draft Security Architecture for IP January 2004 [RaFlBL01]Ramakrishnan, K., Floyd, S., Black, D., "The Addition of Explicit Congestion Notification (ECN) to IP", RFC 3168, September 2001. [Sch94]BruceSchneier, B., Applied Cryptography, Section 8.6, John Wiley & Sons, New York, NY, 1994. [Shi00] Shirey, R., "Internet Security Glossary", RFC 2828, May 2000. [SDNS] SDNS Secure Data Network System, Security Protocol 3, SP3, Document SDN.301, Revision 1.5, 15 May 1989, published in NIST Publication NIST-IR-90-4250, February 1990. [SMPT98] Shacham, A., Monsour, R., Pereira, R., and M. Thomas, "IP Payload Compression Protocol (IPComp)", RFC 2393, August 1998.[TDG97] Thayer, R., Doraswamy, N., and R. Glenn, "IP Security Document Roadmap", RFC 2411, November 1998.[VK83] V.L. Voydock & S.T. Kent, "Security Mechanisms in High- level Networks", ACM Computing Surveys, Vol. 15, No. 2, June 1983.Kent [Page 70] Internet Draft Security Architecture for IP October 2003Author Information Stephen Kent BBNCorporation 70 FawcettTechnologies 10 Moulton Street Cambridge, MA0214002138 USA Phone: +1 (617) 873-3988 EMail: kent@bbn.com Karen Seo BBN Technologies 10 Moulton Street Cambridge, MA 02138 USA Phone: +1 (617) 873-3152 EMail: kseo@bbn.com Kent [Page 51] Internet Draft Security Architecture for IP January 2004 Notices The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards- related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director. Copyright (C) The Internet Society(2003).(2004). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other thanKent [Page 71] Internet Draft Security Architecture for IP October 2003English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF Kent [Page 52] Internet Draft Security Architecture for IP January 2004 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ExpiresAprilJuly 2004 Kent [Page72]53] ----