IPsec
Internet Protocol Security (IPsec) is a protocol suite for securing Internet Protocol (IP) communications by authenticating and encrypting each IP packet of a communication session. IPsec also includes protocols for establishing mutual authentication between agents at the beginning of the session and negotiation of cryptographic keys to be used during the session.
IPsec is an end-to-end security scheme operating in the Internet Layer of the Internet Protocol Suite. It can be used in protecting data flows between a pair of hosts (host-to-host), between a pair of security gateways (network-to-network), or between a security gateway and a host (network-to-host).[1]
Some other Internet security systems in widespread use, such as Secure Sockets Layer (SSL), Transport Layer Security (TLS) and Secure Shell (SSH), operate in the upper layers of the TCP/IP model. Hence, IPsec protects any application traffic across an IP network. Applications do not need to be specifically designed to use IPsec. The use of TLS/SSL, on the other hand, must be designed into an application to protect the application protocols.
IPsec is a successor of the ISO standard Network Layer Security Protocol (NLSP). NLSP was based on the SP3 protocol that was published by NIST, but designed by the Secure Data Network System project of the National Security Agency (NSA).
IPsec is officially specified by the Internet Engineering Task Force (IETF) in a series of Request for Comment documents addressing various components and extensions. It specifies the spelling of the protocol name to be IPsec.[2]
Internet protocol suite |
---|
Application layer |
Transport layer |
Internet layer |
Link layer |
Security architecture
The IPsec suite is an open standard. IPsec uses the following protocols to perform various functions:[3][4]
- Authentication Headers (AH) provide connectionless integrity and data origin authentication for IP datagrams and provides protection against replay attacks.[5][6]
- Encapsulating Security Payloads (ESP) provide confidentiality, data origin authentication, connectionless integrity, an anti-replay service (a form of partial sequence integrity), and limited traffic flow confidentiality.[1]
- Security Associations (SA) provide the bundle of algorithms and data that provide the parameters necessary to operate the AH and/or ESP operations. The Internet Security Association and Key Management Protocol (ISAKMP) provides a framework for authentication and key exchange,[7] with actual authenticated keying material provided either by manual configuration with pre-shared keys, Internet Key Exchange (IKE and IKEv2), Kerberized Internet Negotiation of Keys (KINK), or IPSECKEY DNS records.[8][9][10][11]
Authentication Header
Authentication Header (AH) is a member of the IPsec protocol suite. AH guarantees connectionless integrity and data origin authentication of IP packets. Further, it can optionally protect against replay attacks by using the sliding window technique and discarding old packets (see below).
- In IPv4, the AH protects the IP payload and all header fields of an IP datagram except for mutable fields (i.e. those that might be altered in transit). Mutable (and therefore unauthenticated) IP header fields are DSCP/TOS, ECN, Flags, Fragment Offset, TTL and Header Checksum.[6]
- In IPv6, the AH protects the AH itself, the Destination Options extension header after the AH, and the IP payload. It also protects the fixed IPv6 header and all extension headers before the AH, except for the mutable fields: DSCP, ECN, Flow Label, and Hop Limit.[6]
AH operates directly on top of IP, using IP protocol number 51.[12]
The following AH packet diagram shows how an AH packet is constructed and interpreted:[5][6]
Offsets | Octet16 | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet16 | Bit10 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | Next Header | Payload Len | Reserved | |||||||||||||||||||||||||||||
4 | 32 | Security Parameters Index (SPI) | |||||||||||||||||||||||||||||||
8 | 64 | Sequence Number | |||||||||||||||||||||||||||||||
C | 96 | Integrity Check Value (ICV) … | |||||||||||||||||||||||||||||||
… | … |
- Next Header (8 bits)
- Type of the next header, indicating what upper-layer protocol was protected. The value is taken from the list of IP protocol numbers.
- Payload Len (8 bits)
- The length of this Authentication Header in 4-octet units, minus 2 (a value of 0 means 8 octets, 1 means 12 octets, etcetera). Although the size is measured in 4-octet units, the length of this header needs to be a multiple of 8 octets if carried in an IPv6 packet. This restriction does not apply to an Authentication Header carried in an IPv4 packet.
- Reserved (16 bits)
- Reserved for future use (all zeroes until then).
- Security Parameters Index (32 bits)
- Arbitrary value which is used (together with the source IP address) to identify the security association of the sending party.
- Sequence Number (32 bits)
- A monotonic strictly increasing sequence number (incremented by 1 for every packet sent) to prevent replay attacks. When replay detection is enabled, sequence numbers are never reused because a new security association must be renegotiated before an attempt to increment the sequence number beyond its maximum value.[6]
- Integrity Check Value (multiple of 32 bits)
- Variable length check value. It may contain padding to align the field to an 8-octet boundary for IPv6, or a 4-octet boundary for IPv4.
Encapsulating Security Payload
Encapsulating Security Payload (ESP) is a member of the IPsec protocol suite. In IPsec it provides origin authenticity, integrity, and confidentiality protection of packets. ESP also supports encryption-only and authentication-only configurations, but using encryption without authentication is strongly discouraged because it is unsecure.[13][14][15] Unlike Authentication Header (AH), ESP in transport mode does not provide integrity and authentication for the entire IP packet. However, in Tunnel Mode, where the entire original IP packet is encapsulated with a new packet header added, ESP protection is afforded to the whole inner IP packet (including the inner header) while the outer header remains unprotected. ESP operates directly on top of IP, using IP protocol number 50.[12]
The following ESP packet diagram shows how an ESP packet is constructed and interpreted:[1][16]
Offsets | Octet16 | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet16 | Bit10 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | Security Parameters Index (SPI) | |||||||||||||||||||||||||||||||
4 | 32 | Sequence Number | |||||||||||||||||||||||||||||||
8 | 64 | Payload data | |||||||||||||||||||||||||||||||
… | … | ||||||||||||||||||||||||||||||||
… | … | ||||||||||||||||||||||||||||||||
… | … | Padding (0-255 octets) | |||||||||||||||||||||||||||||||
… | … | Pad Length | Next Header | ||||||||||||||||||||||||||||||
… | … | Integrity Check Value (ICV) … | |||||||||||||||||||||||||||||||
… | … |
- Security Parameters Index (32 bits)
- Arbitrary value which is used (together with the source IP address) to identify the security association of the sending party.
- Sequence Number (32 bits)
- A monotonically increasing sequence number (incremented by 1 for every packet sent) to protect against replay attacks. There is a separate counter kept for every security association.
- Payload data (variable)
- The protected contents of the original IP packet, including any data used to protect the contents (e.g. an Initialisation Vector for the cryptographic algorithm). The type of content that was protected is indicated by the Next Header field.
- Padding (0-255 octets)
- Padding for encryption, to extend the payload data to a size that fits the encryption's cypher block size, and to align the next field.
- Pad Length (8 bits)
- Size of the padding in octets.
- Next Header (8 bits)
- Type of the next header. The value is taken from the list of IP protocol numbers.
- Integrity Check Value (multiple of 32 bits)
- Variable length check value. It may contain padding to align the field to an 8-octet boundary for IPv6, or a 4-octet boundary for IPv4.
Security association
The IP security architecture uses the concept of a security association as the basis for building security functions into IP. A security association is simply the bundle of algorithms and parameters (such as keys) that is being used to encrypt and authenticate a particular flow in one direction. Therefore, in normal bi-directional traffic, the flows are secured by a pair of security associations.
Security associations are established using the Internet Security Association and Key Management Protocol (ISAKMP). ISAKMP is implemented by manual configuration with pre-shared secrets, Internet Key Exchange (IKE and IKEv2), Kerberized Internet Negotiation of Keys (KINK), and the use of IPSECKEY DNS records.[11][17][18]
In order to decide what protection is to be provided for an outgoing packet, IPsec uses the Security Parameter Index (SPI), an index to the security association database (SADB), along with the destination address in a packet header, which together uniquely identify a security association for that packet. A similar procedure is performed for an incoming packet, where IPsec gathers decryption and verification keys from the security association database.
For multicast, a security association is provided for the group, and is duplicated across all authorized receivers of the group. There may be more than one security association for a group, using different SPIs, thereby allowing multiple levels and sets of security within a group. Indeed, each sender can have multiple security associations, allowing authentication, since a receiver can only know that someone knowing the keys sent the data. Note that the relevant standard does not describe how the association is chosen and duplicated across the group; it is assumed that a responsible party will have made the choice.
Modes of operation
IPsec can be implemented in a host-to-host transport mode, as well as in a network tunnel mode.
Transport mode
In transport mode, only the payload (the data you transfer) of the IP packet is usually encrypted and/or authenticated. The routing is intact, since the IP header is neither modified nor encrypted; however, when the authentication header is used, the IP addresses cannot be translated, as this will invalidate the hash value. The transport and application layers are always secured by hash, so they cannot be modified in any way (for example by translating the port numbers). Transport mode is used for host-to-host communications.
A means to encapsulate IPsec messages for NAT traversal has been defined by RFC documents describing the NAT-T mechanism.
Tunnel mode
In tunnel mode, the entire IP packet is encrypted and/or authenticated. It is then encapsulated into a new IP packet with a new IP header. Tunnel mode is used to create virtual private networks for network-to-network communications (e.g. between routers to link sites), host-to-network communications (e.g. remote user access), and host-to-host communications (e.g. private chat).
Tunnel mode supports NAT traversal.
Cryptographic algorithms
Cryptographic algorithms defined for use with IPsec include:
- HMAC-SHA1 for integrity protection and authenticity.
- TripleDES-CBC for confidentiality
- AES-CBC for confidentiality.
Refer to RFC 4835 for details.
Software implementations
IPsec support is usually implemented in the kernel with key management and ISAKMP/IKE negotiation carried out from user-space. Existing IPsec implementations often include both.
There exist a number of implementations of IPsec and ISAKMP/IKE protocols. These include:
- NRL[19] IPsec, one of the original sources of IPsec code.[20]
- OpenBSD, with its own code derived from a BSD/OS implementation written by John Ioannidis and Angelos D. Keromytis in 1996.
- The KAME stack, that is included in Mac OS X, NetBSD and FreeBSD.
- "IPsec" in Juniper Operating Systems [21]
- "IPsec" in Cisco IOS Software [22]
- "IPsec" in Microsoft Windows, including Windows XP,[23][24] Windows 2000,[25] Windows 2003,[26] Windows Vista, Windows Server 2008,[27] and Windows 7.[28]
- Authentec QuickSec toolkits[29]
- IPsec in Solaris[30]
- IBM AIX operating system
- IBM z/OS
- IPsec and IKE in HP-UX (HP-UX IPsec)
- The Linux IPsec stack written by Alexey Kuznetsov and David S. Miller.
- Openswan on Linux, FreeBSD and Mac OS X using the native Linux IPsec stack, or its own KLIPS stack. KLIPS offers hardware acceleration and SAref tracking.
- strongSwan on Linux, FreeBSD, Mac OS X, and Android using the native IPsec stack.
Standards status
IPsec was developed in conjunction with IPv6 and is therefore mandatory in all standards-compliant implementations of IPv6,[31] but its implementation is an optional extension to IPv4. However, because of the slow deployment of IPv6, IPsec is most commonly used to secure IPv4 traffic. IPsec protocols were originally defined in RFC 1825 and RFC 1829, published in 1995. In 1998, these documents were superseded by RFC 2401 and RFC 2412 with incompatible aspects, although they were conceptually identical. In addition, a mutual authentication and key exchange protocol Internet Key Exchange (IKE) was defined to create and manage security associations. In December 2005, new standards were defined in RFC 4301 and RFC 4309 which are largely a superset of the previous editions with a second version of the Internet Key Exchange standard IKEv2. These third-generation documents standardized the abbreviation of IPsec to uppercase “IP” and lowercase “sec”. It is unusual to see any product that offers support for RFCs 1825 and 1829. “ESP” generally refers to RFC 2406, while ESPbis refers to RFC 4303.
Since mid-2008, an IPsec Maintenance and Extensions working group is active at the IETF.[32][33]
See also
- IPsec Passthrough
- Information security
- Secure Sockets Layer Virtual Private Network
- Opportunistic encryption
- Dynamic Multipoint Virtual Private Network
- tcpcrypt
References
- ^ a b c Kent, S.; Atkinson, R. (1998). IP Encapsulating Security Payload (ESP). IETF. doi:10.17487/RFC2406. RFC 2406.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^
"RFC4301: Security Architecture for the Internet Protocol". Network Working Group of the IETF. December 2005. p. 4.
The spelling "IPsec" is preferred and used throughout this and all related IPsec standards. All other capitalizations of IPsec [...] are deprecated.
- ^ Thayer, R.; Doraswamy, N.; Glenn, R. (1998). IP Security Document Roadmap. IETF. doi:10.17487/RFC2411. RFC 2411.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ Hoffman, P. (2005). Cryptographic Suites for IPsec. IETF. doi:10.17487/RFC4308. RFC 4308.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ a b Kent, S.; Atkinson, R. (1998). IP Authentication Header. IETF. doi:10.17487/RFC2402. RFC 2402.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ a b c d e Kent, S. (2005). IP Authentication Header. IETF. doi:10.17487/RFC4302. RFC 4302.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ The Internet Key Exchange (IKE), RFC 2409, §1 Abstract
- ^ Harkins, D.; Carrel, D. (1998). The Internet Key Exchange (IKE). IETF. doi:10.17487/RFC2409. RFC 2409.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ Kaufman, C. (ed.). IKE Version 2. IETF. doi:10.17487/RFC4306. RFC 4306.
- ^ Sakane, S.; Kamada, K.; Thomas, M.; Vilhuber, J. (1998). Kerberized Internet Negotiation of Keys (KINK). IETF. doi:10.17487/RFC4430. RFC 4430.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ a b Richardson, M. (2005). A Method for Storing IPsec Keying Material in DNS. IETF. doi:10.17487/RFC4025. RFC 4025.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ a b "Protocol Numbers". IANA. IANA. 2010-05-27. Archived from the original on 2010-07-27.
- ^ Bellovin, Steven M. (1996). "Problem Areas for the IP Security Protocols" (PostScript). Proceedings of the Sixth Usenix Unix Security Symposium. San Jose, CA. pp. 1–16. Retrieved 2007-07-09.
{{cite conference}}
: Unknown parameter|booktitle=
ignored (|book-title=
suggested) (help) - ^ Paterson, Kenneth G.; Yau, Arnold K.L. (2006-04-24). "Cryptography in theory and practice: The case of encryption in IPsec" (PDF). Eurocrypt 2006, Lecture Notes in Computer Science Vol. 4004. Berlin. pp. 12–29. Retrieved 2007-08-13.
{{cite conference}}
: Unknown parameter|booktitle=
ignored (|book-title=
suggested) (help) - ^ Degabriele, Jean Paul; Paterson, Kenneth G. (2007-08-09). "Attacking the IPsec Standards in Encryption-only Configurations" (PDF). IEEE Symposium on Security and Privacy, IEEE Computer Society. Oakland, CA. pp. 335–349. Retrieved 2007-08-13.
{{cite conference}}
: Unknown parameter|booktitle=
ignored (|book-title=
suggested) (help) - ^ Kent, S. (2005). IP Encapsulating Security Payload (ESP). IETF. doi:10.17487/RFC4303. RFC 4303.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ RFC 2406, §1, page 2
- ^ RFC 3129
- ^ "Information Technology Division, Naval Research Laboratory". NRL ITD. 2009-10-29. Retrieved 2010-12-31.
- ^ "Best Software Review". Daemon News. Retrieved 2010-12-31.
- ^ Worldwide. "Internet Protocol Security (IPsec) - JUNOS Software Security Configuration Guide". Juniper Networks. Retrieved 2011-05-04.
- ^ Worldwide. "An Introduction to IP Security (IPSec) Encryption [IPSec Negotiation/IKE Protocols]". Cisco Systems. Retrieved 2010-12-31.
- ^ "Modifying an Internet Protocol security (IPSec) policy from a Windows XP SP1-based or Windows 2000-based client may corrupt the IPSec policy". Microsoft Support. 2006-12-25. Retrieved 2010-12-31.
- ^ "L2TP/IPsec NAT-T update for Windows XP and Windows 2000". Microsoft Support. 2006-10-26. Retrieved 2010-12-31.
- ^ [1][dead link]
- ^ [2][dead link]
- ^ "IPsec". Microsoft TechNet. Retrieved 2010-12-31.
- ^ "Windows Firewall with Advanced Security Getting Started Guide". Microsoft TechNet. Retrieved 2010-12-31.
- ^ "Products | Toolkits". AuthenTec. Retrieved 2010-12-31.
- ^ "IPsec and IKE Administration Guide". Sun Microsystems. 2003-12-09. Retrieved 2010-12-31.
- ^ Loughney, J., ed. (2006). IPv6 Node Requirements. IETF. sec. 8.1. doi:10.17487/RFC4294. RFC 4294.
{{citation}}
: Unknown parameter|month=
ignored (help) - ^ ipsecme charter
- ^ ipsecme status
External links
- All IETF active security WGs
- IETF ipsecme WG ("IP Security Maintenance and Extensions" Working Group)
- IETF btns WG ("Better-Than-Nothing Security" Working Group) (chartered to work on unauthenticated IPsec, IPsec APIs, connection latching)]
- Securing Data in Transit with IPsec WindowsSecurity.com article by Deb Shinder
- IPsec at the Open Directory Project
- IPsec on Microsoft TechNet
- Microsoft IPsec Diagnostic Tool on Microsoft Download Center
- An Illustrated Guide to IPsec by Steve Friedl
- Security Architecture for IP (IPsec) lecture by Manfred Lindner of Vienna University of Technology
- Creating VPNs with IPsec and SSL/TLS Linux Journal article by Rami Rosen
Standards
- RFC 2367: PF_KEY Interface
- RFC 2401: Security Architecture for the Internet Protocol (IPsec overview) Obsolete by RFC 4301
- RFC 2403: The Use of HMAC-MD5-96 within ESP and AH
- RFC 2404: The Use of HMAC-SHA-1-96 within ESP and AH
- RFC 2405: The ESP DES-CBC Cipher Algorithm With Explicit IV
- RFC 2409: The Internet Key Exchange
- RFC 2410: The NULL Encryption Algorithm and Its Use With IPsec
- RFC 2412: The OAKLEY Key Determination Protocol
- RFC 2451: The ESP CBC-Mode Cipher Algorithms
- RFC 2857: The Use of HMAC-RIPEMD-160-96 within ESP and AH
- RFC 3526: More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)
- RFC 3706: A Traffic-Based Method of Detecting Dead Internet Key Exchange (IKE) Peers
- RFC 3715: IPsec-Network Address Translation (NAT) Compatibility Requirements
- RFC 3947: Negotiation of NAT-Traversal in the IKE
- RFC 3948: UDP Encapsulation of IPsec ESP Packets
- RFC 4106: The Use of Galois/Counter Mode (GCM) in IPsec Encapsulating Security Payload (ESP)
- RFC 4301: Security Architecture for the Internet Protocol
- RFC 4302: IP Authentication Header
- RFC 4303: IP Encapsulating Security Payload
- RFC 4304: Extended Sequence Number (ESN) Addendum to IPsec Domain of Interpretation (DOI) for Internet Security Association and Key Management Protocol (ISAKMP)
- RFC 4306: Internet Key Exchange (IKEv2) Protocol
- RFC 4307: Cryptographic Algorithms for Use in the Internet Key Exchange Version 2 (IKEv2)
- RFC 4308: Cryptographic Suites for IPsec
- RFC 4309: Using Advanced Encryption Standard (AES) CCM Mode with IPsec Encapsulating Security Payload (ESP)
- RFC 4478: Repeated Authentication in Internet Key Exchange (IKEv2) Protocol
- RFC 4543: The Use of Galois Message Authentication Code (GMAC) in IPsec ESP and AH
- RFC 4555: IKEv2 Mobility and Multihoming Protocol (MOBIKE)
- RFC 4621: Design of the IKEv2 Mobility and Multihoming (MOBIKE) Protocol
- RFC 4718: IKEv2 Clarifications and Implementation Guidelines
- RFC 4806: Online Certificate Status Protocol (OCSP) Extensions to IKEv2
- RFC 4809: Requirements for an IPsec Certificate Management Profile
- RFC 4835: Cryptographic Algorithm Implementation Requirements for Encapsulating Security Payload (ESP) and Authentication Header (AH)
- RFC 4945: The Internet IP Security PKI Profile of IKEv1/ISAKMP, IKEv2, and PKIX
- RFC 6071: IPsec and IKE Document Roadmap