Internet Protocol Security (IPsec)
What is IPsec (Internet Protocol Security)?
IPsec (Internet Protocol Security) is a suite of protocols and algorithms for securing data transmitted over the internet or any public network. The Internet Engineering Task Force, or IETF, developed the IPsec protocols in the mid-1990s to provide security at the IP layer through authentication and encryption of IP network packets.
IPsec originally defined two protocols for securing IP packets: Authentication Header (AH) and Encapsulating Security Payload (ESP). The former provides data integrity and anti-replay services, and the latter encrypts and authenticates data.
The IPsec suite also includes Internet Key Exchange (IKE), which is used to generate shared security keys to establish a security association (SA). SAs are needed for the encryption and decryption processes to negotiate a security level between two entities. A special router or firewall that sits between two networks usually handles the SA negotiation process.
In the IPsec protocol suite there are two principal protocols: the Authentication Header (AH) protocol and the Encapsulation Security Payload (ESP) protocol. When a source host sends secure datagrams to a destination host, it does so with either the AH protocol or the ESP protocol. The AH protocol provides source authentication and data integrity but does not provide confidentiality. The ESP protocol provides authentication, data integrity, and confidentiality. Providing more services, the ESP protocol is naturally more complicated and requires more processing than the AH protocol.
IN both the AH and the ESP protocols, before secured datagrams are sent from a source host to a destination host, the source and network hosts handshake and create a network-layer logical connection. This logical channel is called a security association (SA).
An SA is uniquely identified by a three-tipple consisting of:
- A security protocol (AH or ESP) identifier.
- The source IP address for the simplex connection
- A 32-bit connection identifier called the Security Parameter Index (SPI).
Authentication Header (AH) Protocol
The AH protocol provides source host authentication and data integrity but not confidentiality. When a particular source host wants to send one or more datagrams to a particular destination, it first establishes an SA with the destination. After having established the SA, the source can send secure datagrams to the destination host. The secure datagrams include the AH header, which is inserted between the original IP datagram data and the IP header.
The AH Header includes several fields:
- Next Header field, which has the role that the protocol field has for an ordinary datagram.
- Security Parameter Index (SPI) field, an arbitrary 32-bit value that, in combination with the destination IP address and the security protocol, uniquely identifies the SA for the datagram.
- Sequence Number field, a 32-bit field containing a sequence number for each datagram.
- Authentication Data field, a variable-length field containing a signed message digest for this datagram.
When the destination host receives an IP datagram with an AH header, it determines the SA for the datagram and then authenticates the datagram's integrity by processing the authentication data field.
The ESP Protocol
The ESP protocol provides network-layer confidentiality as well as source host authentication and data integrity. It all begins with a source host establishing an SA with a destination host. Then the source host can send secured datagrams to the destination host. A secured datagram is created by surrounding the original IP datagram into the data field of an IP datagram. For the protocol field in the header of the IP datagram, the value 50 is used to indicate that the datagram includes an ESP header and trailer. When the destination host receives the IP datagram, it takes note of the 50 in the protocol field and processes the datagram using the ESP protocol.
SA and Key Management
For successful deployment of IPsec, a scalable and automated SA and key management scheme is necessary. Several protocols have been defined for these tasks.
- The Internet Key Exchange (IKE) algorithm is the default key management protocol for IPsec.
- The Internet Security Association and Key Management Protocol (ISKMP) defines procedures for establishing and tearing down SAs.