IPsec
From Wikipedia, the free encyclopedia
Internet Protocol Security (IPsec) is a suite of protocols for securing Internet Protocol (IP) communications by authenticating and encrypting each IP packet of a data stream. 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 can be used to protect data flows between a pair of hosts (e.g. computer users or servers), between a pair of security gateways (e.g. routers or firewalls), or between a security gateway and a host. [1]
IPsec is a dual mode, end-to-end, security scheme operating at the Internet Layer of the Internet Protocol Suite, which is approximately Layer 3 in the OSI model. Some other Internet security systems in widespread use, such as SSL, TLS and SSH, operate in the upper layers of these models, SSL VPN being an example. IPsec is more flexible, operating as it does at a lower level in the stack, since it can be used for protecting more traffic (ie, all those above layer 2), because applications need not be designed to use IPsec, whereas the use of TLS/SSL or other higher-layer protocols must be incorporated into the design of applications at that level.
IPsec is a successor of the ISO standard NLSP (Network Layer Security Protocol). The NLSP protocol was based on the SP3 protocol that was published by NIST, but designed by the Secure Data Network System project of the NSA.
"IPsec" is officially specified by the Internet Engineering Task Force (IETF), including the capitalization of the term.
The Internet Protocol Suite | |
Application Layer | |
---|---|
BGP · DHCP · DNS · FTP · GTP · HTTP · IMAP · IRC · Megaco · MGCP · NNTP · NTP · POP · RIP · RPC · RTP · RTSP · SDP · SIP · SMTP · SNMP · SOAP · SSH · Telnet · TLS/SSL · XMPP · (more) | |
Transport Layer | |
TCP · UDP · DCCP · SCTP · RSVP · ECN · (more) | |
Internet Layer | |
IP (IPv4, IPv6) · ICMP · ICMPv6 · IGMP · IPsec · (more) | |
Link Layer | |
ARP · RARP · NDP · OSPF · Tunnels (L2TP) · Media Access Control (Ethernet, MPLS, DSL, ISDN, FDDI) · Device Drivers · (more) | |
Contents |
[edit] Security Architecture
The IPsec suite is a framework of open standards. IPsec uses the following protocols to perform various functions: [2] [3]
- Internet key exchange (IKE and IKEv2) to set up a security association (SA) by handling negotiation of protocols and algorithms and to generate the encryption and authentication keys to be used by IPsec. [4] [5]
- Authentication Header (AH) to provide connectionless integrity and data origin authentication for IP datagrams and to provide protection against replay attacks. [6] [7]
- Encapsulating Security Payload (ESP) to provide confidentiality, data origin authentication, connectionless integrity, an anti-replay service (a form of partial sequence integrity), and limited traffic flow confidentiality. [1]
[edit] Authentication Header (AH)
AH is a member of the IPsec protocol suite. AH is intended to guarantee 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. 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). [6]
- In IPv4, mutable (and therefore unauthenticated) IP header fields include DSCP/TOS, Flags, Fragment Offset, TTL and Header Checksum.
AH operates directly on top of IP, using IP protocol number 51.[8]
The following AH packet diagram shows how an AH packet is constructed and interpreted: [6] [7]
0 - 7 bit | 8 - 15 bit | 16 - 23 bit | 24 - 31 bit |
---|---|---|---|
Next header | Payload length | RESERVED | |
Security parameters index (SPI) | |||
Sequence number | |||
Authentication data (variable) |
Field meanings:
- Next header
- The Next Header is an 8-bit field that identifies the type of the next payload after the Authentication Header. The value of this field is chosen from the set of IP Protocol Numbers defined in the most recent "Assigned Numbers" RFC from the Internet Assigned Numbers Authority. See List of IP protocol numbers.
- Payload length
- Size of AH packet.
- RESERVED
- Reserved for future use (all zero until then).
- Security parameters index (SPI)
- Identifies the security parameters, which, in combination with the IP address, then identify the security association implemented with this packet.
- Sequence number
- A monotonically increasing number, used to prevent replay attacks.
- Authentication data
- Contains the integrity check value (ICV) necessary to authenticate the packet; it may contain padding.
[edit] Encapsulating Security Payload (ESP)
ESP is a member of the IPsec protocol suite. It is the portion of IPsec that 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 insecure. [9] [10] [11]. Unlike Authentication Header (AH), ESP does not protect the IP packet header. 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.[8]
The following ESP packet diagram shows how an ESP packet is constructed and interpreted: [1]
0 - 7 bit | 8 - 15 bit | 16 - 23 bit | 24 - 31 bit |
---|---|---|---|
Security parameters index (SPI) | |||
Sequence number | |||
|
|||
Padding (0-255 bytes) | |||
Pad Length | Next Header | ||
Authentication Data (variable) |
Field meanings:
- Security parameters index (SPI)
- Identifies the security parameters in combination with IP address.
- Sequence number
- A monotonically increasing number, used to prevent replay attacks.
- Payload data
- The data to be transferred.
- Padding
- Used with some block ciphers to pad the data to the full length of a block.
- Pad length
- Size of padding in bytes.
- Next header
- Identifies the protocol of the payload data. The value of this field is chosen from the set of IP Protocol Numbers defined in the most recent "Assigned Numbers" RFC from the Internet Assigned Numbers Authority. See List of IP protocol numbers.
- Authentication data
- Contains the data used to authenticate the packet.
[edit] 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. The actual choice of encryption and authentication algorithms (from a defined list) is left to the IPsec administrator.
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.
[edit] Modes of Operation
There are two modes of IPsec operation:
[edit] Transport mode
In transport mode, only the payload (the data you transfer) of the IP packet is 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.
[edit] Tunnel mode
In tunnel mode, the entire IP packet (data and IP header) 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).
[edit] Implementations
[edit] Cryptographic Algorithms
Cryptographic algorithms defined for use with IPsec include:
Refer to RFC 4835 for details.
[edit] 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. However, as there is a standard interface for key management, it is possible to control one kernel IPsec stack using key management tools from a different implementation.
Because of this, there is sometimes confusion as to the origins of the IPsec implementation in the Linux kernel. The FreeS/WAN project made the first complete and open source implementation of IPsec for Linux. It consists of a kernel IPsec stack (KLIPS), as well as a key management daemon (pluto) and many shell scripts. The FreeS/WAN project was disbanded in March 2004. Openswan and strongSwan are continuations of FreeS/WAN. The KAME project also implemented complete IPsec support for NetBSD, FreeBSD. Its key management daemon is called racoon. OpenBSD made its own ISAKMP/IKE daemon, simply named isakmpd (which was also ported to other systems, including Linux).
None of those kernel IPsec stacks were integrated into the Linux kernel. Alexey Kuznetsov and David S. Miller wrote a kernel IPsec implementation from scratch for the Linux kernel around the end of 2002. This stack was subsequently released as part of Linux 2.6, and is referred to variously as "native" or "NETKEY".
Thus, the current Linux IPsec stack did not originate from the KAME project. Since it supports the standard PF_KEY protocol (RFC 2367) and the native XFRM interface for key management, the Linux IPsec stack can be used in conjunction with either pluto from Openswan/strongSwan, isakmpd from the OpenBSD project, racoon from the KAME project, or without any ISAKMP/IKE daemon (using manual keying).
The new architectures of network processors, including multi-core processors with integrated encryption engines, suggested some changes in the way the IPsec stacks are designed. A dedicated Fast Path is currently being commonly used to offload IPsec processing (SA, SP lookups, encryption, etc.). These Fast-Path IPsec-stack instances, running on dedicated cores, must be integrated with Linux or RTOS instances, running on other cores, which control them.
There exist a number of implementations of IPsec and ISAKMP/IKE protocols. These include:
- 6WINDGate, Network processor MPU Fast Path IPsec stack
- NRL [1] IPsec, one of the original sources of IPsec code [2]
- OpenBSD, with its own code derived from NRL IPsec
- the KAME stack, that is included in Mac OS X, NetBSD and FreeBSD
- "IPsec" in Cisco IOS Software [3]
- "IPsec" in Microsoft Windows, including Windows XP[4] [5], Windows 2000[6], Windows 2003[7], and both Windows Vista and Windows Server 2008 [8].
- SafeNet QuickSec toolkits [9]
- IPsec in Solaris [10]
- IBM AIX operating system
- IBM z/OS
- IPsec and IKE in HP-UX (HP-UX IPSec)
- "IPsec and IKE" in VxWorks [11]
[edit] Current status as a standard
IPsec implementation is a mandatory part of IPv6[12] but is not a required part of IPv4. However, because of the slow uptake of IPv6, IPsec is most commonly used to secure IPv4 traffic. IPsec protocols were originally defined in RFCs 1825 & 1829, published in 1995. In 1998, these documents were made obsolete by RFC 2401 & RFC 2412 (with which they were not compatible) 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, these RFCs were themselves superseded by RFC 4301 & RFC 4309, which are largely a superset of the previous editions, and a by 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 & 1829. “ESP” generally refers to RFC 2406, while ESPbis refers to RFC 4303.
[edit] Other VPN Protocols
- IPsec
- HIP Host Identity Protocol
- L2F Layer 2 Forwarding Protocol
- L2TP Layer 2 Tunneling Protocol
- PLIP Parallel Line Internet Protocol
- PPTP Point-to-Point Tunneling Protocol
- PPP Point-to-Point Protocol
- SLIP Serial Line Internet Protocol
- SSL/TLS Secure Sockets Layer / Transport Layer Security
[edit] See Also
- Information security
- NAT-T
- Secure Sockets Layer Virtual Private Network
- Security association (SA)
- Opportunistic encryption
- Virtual private network
[edit] References
- ^ a b c S. Kent (BBN Corp) and R. Atkinson (@Home Network). ""RFC 2406 IP Encapsulating Security Payload (ESP)"". Internet Engineering Task Force (IETF). http://www.ietf.org/rfc/rfc2406.txt.
- ^ R. Thayer (Sable Technology Corporation), N. Doraswamy (Bay Networks), R. Glenn (NIST). "RFC 2411 IP Security Document Roadmap". National Institute of Standards and Technology (NIST). http://csrc.nist.gov/archive/ipsec/papers/rfc2411-roadmap.txt.
- ^ P. Hoffman (VPN Consortium). "RFC 4308 Cryptographic Suites for IPsec". Internet Engineering Task Force (IETF). http://www.ietf.org/rfc/rfc4308.txt.
- ^ D. Harkins and D. Carrel (Cisco Systems). "RFC 2409 The Internet Key Exchange (IKE)". Internet Engineering Task Force (IETF). http://www.ietf.org/rfc/rfc2409.txt.
- ^ "RFC 4306 IKE Version 2". Internet Engineering Task Force (IETF).
- ^ a b c S. Kent (BBN Corp) and R. Atkinson (@Home Network). "RFC 2402 IP Authentication Header". Internet Engineering Task Force (IETF). http://www.ietf.org/rfc/rfc2402.txt.
- ^ a b "RFC 4302 IP Authentication Header". Internet Engineering Task Force (IETF). http://www.ietf.org/rfc/rfc4302.txt.
- ^ a b "Assigned Internet Protocol Numbers". Internet Assigned Numbers Authority (IANA). http://www.iana.org/assignments/protocol-numbers.
- ^ Bellovin, Steven M. (1996). "Problem Areas for the IP Security Protocols". Proceedings of the Sixth Usenix Unix Security Symposium: 1-16. Retrieved on 2007-07-09.
- ^ K.G. Paterson and A. Yau (2006). "Cryptography in theory and practice: The case of encryption in IPsec". Eurocrypt 2006, Lecture Notes in Computer Science Vol. 4004: 12-29. Retrieved on 2007-08-13.
- ^ J.P. Degabriele and K.G. Paterson (2007). "Attacking the IPsec Standards in Encryption-only Configurations". IEEE Symposium on Security and Privacy, IEEE Computer Society: 335-349. Retrieved on 2007-08-13.
- ^ "RFC 4294 IPv6 Node Requirements". Internet Engineering Task Force (IETF).
[edit] External links
- IP Security Protocol Official Charter, Internet Engineering Task Force (IETF)
- IPsec WG still has important active drafts
- All IETF active security WGs
- IETF BTNS WG (chartered to work on unauthenticated IPsec, IPsec APIs, connection latching)
- Securing Data in Transit with IPsec
- IPsec at the Open Directory Project
- Microsoft IPsec Diagnostic Tool
- An Illustrated Guide to IPsec
- Data Communication Lectures of Manfred Lindner - Part IPsec
[edit] 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 2411: IP Security Document Roadmap
- 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
|