IPSec protocol framework

IP Security Protocol (IPSec) is a collection of open standards that work together to establish data confidentiality, data integrity, and data authentication between peer devices. These peers can be pairs of hosts or pairs of security gateways (routers, firewalls, VPN concentrators, and so on), or they can be between a host and a security gateway, as in the case of remote access VPNs. IPSec can protect multiple data flows between peers, and a single gateway can support many simultaneous, secure IPSec tunnels between different pair partners.

IPSec works at the IP layer and can use the Internet Key Exchange (IKE) protocol to negotiate protocols between peers and generate encryption and authentication keys to be used by IPSec. IPSec was first described in a series of Requests for Comment (RFCs) from RFC 1825 through RFC 1829. RFCs 1825, 1826, and 1827 have since been updated by subsequent RFCs. Table 2-7 presents a list of the IPSec-related RFCs.

Table 2-7 IPSec RFCs

RFC

Title

Topic

Author

(obsolete)

Security Architecture for the Internet Protocol

IPSec

R. Atkinson

(obsolete)

IP Authentication Header

AH

R. Atkinson

(obsolete)

IP Encapsulating Security Payload (ESP)

ESP

R. Atkinson

Aug. 1995

1828

IP Authentication Using Keyed MD5

MD5

P. Metzger W. Simpson

Aug. 1995

1829

The ESP DES-CBC Transform

DES

P. Karn P. Metzger W. Simpson

Aug. 1995

Table 2-7 IPSec RFCs (Continued)

RFC

Title

Topic

Author

Date

2104

HMAC: Keyed-Hashing for Message Authentication

HMAC

K. Krawczyk M. Bellare R. Canetti

Feb. 1997

2202

Test Cases for HMAC-MD5 and HMAC-SHA-1

HMAC-MD5 HMAC-SHA-1

P. Cheng R. Glenn

Sep.1997

2401

Security Architecture for the Internet Protocol

IPSec

S. Kent R. Atkinson

Nov. 1998

2402

IP Authentication Header

AH

S. Kent R. Atkinson

Nov. 1998

2403

The Use of HMAC-MD5-96 within ESP and AH

HMAC-MD5

C. Madson R. Glenn

Nov. 1998

2404

The Use of HMAC-SHA-1-96 within ESP and AH

HMAC-SHA-1

C. Madson R. Glenn

Nov. 1998

2405

The ESP DES-CBC Cipher Algorithm With Explicit IV

DES

C. Madson N. Doraswamy

Nov. 1998

2406

IP Encapsulating Security Payload (ESP)

ESP

S. Kent R. Atkinson

Nov. 1998

2407

The Internet IP Security Domain of Interpretation for ISAKMP

ISAKMP

D. Piper

Nov. 1998

2408

Internet Security Association and Key Management Protocol

ISAKMP

D. Maughan M. Schertler M. Schneider J. Turner

Nov. 1998

2409

The Internet Key Exchange (IKE)

IKE

D. Harkins D. Carrel

Nov. 1998

2410

The NULL Encryption Algorithm and Its Use With IPSec

NULL

R. Glenn S. Kent

Nov. 1998

2451

The ESP CBC-Mode Cipher Algorithms

CBC

R. Periera R. Adams

Nov. 1998

This is not an exhaustive list of IPSec-related RFCs, but you can find these RFCs and others at the Internet Engineering Task Force (IETF) website:

www.ietf.org/rfc.html

Specific RFCs that relate to IPSec can be found at the following website:

www.ietf.org/html.charters/ipsec-charter.html

Notice that just three years after IPSec was introduced, a veritable army of IPSec tools was developed and quickly accepted by the networking industry.

Some things to remember when you are planning an IPSec deployment are as follows:

• IPSec supports High-Level Data-Link Control (HDLC), ATM, Point -to-Point Protocol (PPP), and Frame Relay serial encapsulation.

• IPSec also works with Generic Routing Encapsulation (GRE) and IP-in-IP (IPinIP) Encapsulation Layer 3 tunneling protocols. IPSec does not support the data-link switching (DLSw) standard, source-route bridging (SRB), or other Layer 3 tunneling protocols.

• IPSec does not support multipoint tunnels.

• IPSec works strictly with unicast IP datagrams only. It does not work with multicast or broadcast IP datagrams.

• IPSec is slower than Cisco Encryption Technology (CET) because IPSec provides perpacket data authentication.

• IPSec provides packet expansion that can cause fragmentation and reassembly of IPSec packets, creating another reason that IPSec is slower than CET.

• When using NAT, be sure that NAT occurs before IPSec encapsulation so that IPSec has global addresses to work with.

Table 2-7 shows the major protocols that you can encounter when working with IPSec. The following is a quick review of these standard protocols:

• IP Security Protocol (IPSec)

— Authentication Header (AH)

— Encapsulating Security Payload (ESP)

• Message Encryption

— Data Encryption Standard (DES)

• Message Integrity (Hash) Functions

— Hash-based Message Authentication Code (HMAC)

— Secure Hash Algorithm-1 (SHA-1)

• Peer Authentication

— Rivest, Shamir, and Adelman (RSA) Digital Signatures

— RSA Encrypted Nonces

• Key Management

— Certificate Authority (CA)

• Security Association

— Internet Key Exchange (IKE)

— Internet Security Association and Key Management Protocol (ISAKMP)

NOTE IKE and ISAKMP are interchangeable in Cisco implementations.

These protocols are examined in more detail in the following sections.

The IPSec Protocols

The protocols that IPSec uses to provide traffic security are Authentication Header (AH) and Encapsulating Security Payload (ESP). These two protocols are considered purely IPSec protocols and were developed strictly for IPSec. Each protocol is described in its own RFC, which was identified in Table 2-7. You can use AH and ESP independently on an IPSec connection, or you can combine their use.

IKE and IPSec negotiate encryption and authentication services between pairs. This negotiation process culminates in establishing Security Associations (SAs) between security pairs. IKE SAs are bidirectional, but IPSec SAs are unidirectional and must be established by each member of the VPN pair to establish bidirectional traffic. There must be an identical SA on each pair to establish secure communications between pairs. The information associated with each SA is stored in a Security Association Database, and each SA is assigned a Security Parameters Index (SPI) number that, when combined with the destination IP address and the security protocol (AH or ESP), uniquely identifies the SA.

The key to IPSec is the establishment of these SAs. SAs are negotiated once at the beginning of an IPSec session and periodically throughout a session when certain conditions are met. To avoid having to negotiate security for each packet, there had to be a way to communicate the use of an already agreed upon SA between security pairs.

That is where the AH and ESP protocols come into use. These two protocols are simply a means of identifying which prenegotiated security features to use for a packet going from one peer to another. Both of these protocols add an extra header to the IP datagram between the Layer 3

(IP) and Layer 4 (usually TCP or UDP) protocol headers. A key element contained in each protocol's header is the SPI, giving the destination peer the information it needs to authenticate and decrypt the packet.

Authentication Header

The Authentication Header (AH) protocol is defined in RFCs 1826 and 2402 and provides for data integrity, data origin authentication, and an optional antireplay service. AH does not provide encryption, which means that the packets are sent as clear text. AH is slightly quicker than ESP, so you might choose to use AH when you need to be certain of the source and integrity of the packet but confidentiality is not a concern.

Devices configured to use AH insert an extra header into the IP datagrams of "interesting traffic," between the IP header and the Layer 4 header. Because a processing cost is associated with IPSec, VPNs can be configured to choose which traffic to secure, and IPSec and non-IPSec traffic can coexist between security pairs. You might choose to secure e-mail traffic but not web traffic, for example. The process of inserting the AH header is shown in Figure 2-5.

Figure 2-5 AH Header in IPSec Datagram

Original IP

Original Layer 4

Data

Header

Header

Original IP

IPSec AH

Original Layer 4

Data

Header

Payload Length

Reserved

Security Parameters Index (SPI)

Sequence Number Field

Authentication Data (Variable Length - Integral Multiple of 32 Bits)

The fields included in the AH are as follows:

• Next Header (8 bits)—This field contains the protocol number of the Layer 4 header that follows the IPSec header. If the Layer 4 protocol were TCP, this field would contain the number 6. For UDP, it would contain the number 17.

NOTE The Next Header or Protocol value within the IP header preceding the IPSec header contains the value of 51 when AH is used as the IPSec protocol.

• Payload Length (8 bits)—This field contains the length of the IPSec header in 32-bit words, minus 2. The fixed portion of the header is 96 bits long, or 3 words. The Authentication Data portion is of variable length but has a standard length of 96 bits, also 3 words. That makes a total of six 32-bit words. Deduct 2 and the value entered in the Payload Length field would be 4.

• Reserved (16 bits)—Currently unused, this portion of the header must be filled with 0s.

• Security Parameters Index (SPI) (32 bits)—The destination IP address, the IPSec protocol, and this number uniquely identify the SA for this packet.

• Sequence Number Field (32 bits)—This is an unsigned, monotonically increasing counter that enables antireplay services for a specific SA. This information does not have to be used by the receiving peer, but it must be included by the sender. This number is initialized to 0 when an SA is established. If antireplay is used, this number can never be allowed to repeat. Because the sender does not know if the receiver is using the antireplay function, the fact that this number cannot be repeated requires that the SA be terminated and a new one established prior to transmitting the 232 packet.

• Authentication Data (Variable)—This field contains the Integrity Check Value (ICV) for the packet. The field must be an integral multiple of 32 bits and can contain padding to fill it out to the next 32-bit increment.

The ICV is computed using authentication algorithms, including keyed Message Authentication Codes (MACs). MACs are based on symmetric encryption algorithms, such as DES and 3DES, or on one-way functions, such as MD5 or SHA-1. When computing the ICV, the computation is done using the entire new packet. To keep the elements aligned properly, any mutable fields that cannot be predicted and the Authentication Data field of the IPSec header are set to 0. Predictable, mutable fields are set to their predictable value. Upper-layer data are assumed to be immutable. A shared secret key is used in the MAC calculation, making it difficult to spoof.

Each peer at the end of the VPN calculates this ICV independently. If these ICVs do not match, the packet is discarded, thereby assuring that the packet has not been tampered with during transit.

Encapsulating Security Payload

The other IPSec protocol is the Encapsulating Security Payload (ESP) protocol. This protocol provides confidentiality by enabling encryption of the original packet. Additionally, ESP provides data origin authentication, integrity, antireplay service, and some limited traffic flow confidentiality. This is the protocol to use when you require confidentiality in your IPSec communications.

ESP acts differently than does AH. As its name implies, ESP encapsulates all or portions of the original IP datagram by surrounding it with both a header and a trailer. Figure 2-6 shows this encapsulation process.

Readers' Questions

  • mariam demsas
    Which of the following are protocols included in the ipsec architecture?
    1 month ago
  • The protocols included in the IPsec architecture are:
    1. Internet Key Exchange (IKE): This protocol is used to establish and manage security associations (SA) between IPsec peers. It negotiates encryption algorithms, authentication methods, and other parameters for secure communication.
    2. Encapsulating Security Payload (ESP): This protocol provides confidentiality, integrity, and authentication for IP packets. ESP encapsulates the original IP packet, adds encryption and authentication information, and delivers it securely.
    3. Authentication Header (AH): This protocol provides authentication and integrity for IP packets. AH adds a header to the original IP packet, which contains authentication information that ensures the packet has not been modified during transmission.
    4. Security Association (SA) Management: SA management protocols define how security associations are created, negotiated, and managed between IPsec peers. These protocols may include IKEv1 and IKEv2.Note: Other common protocols, such as Internet Protocol (IP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP), are not part of the IPsec architecture but are used alongside it for regular network communication.
    • Antje
      How is confidentiality achieved through ipsec?
      4 months ago
    • IPsec (Internet Protocol Security) provides confidentiality by using encryption algorithms to encrypt the data sent across a network. It uses either the AH (Authentication Header) or the ESP (Encapsulating Security Payload) protocols. The AH protocol authenticates and verifies the data integrity but does not provide encryption. It simply adds a header to the IP packet that contains the source and destination address, a sequence number, and a cryptographic authentication key. The ESP protocol, on the other hand, provides encryption in addition to authentication, offering confidentiality by encrypting the data itself.
      • abel
        What algorithm is used with ipsec to provide data confidentiality?
        6 months ago
      • The algorithm used with IPSec to provide data confidentiality is the Advanced Encryption Standard (AES). AES is a symmetric encryption algorithm, which means that the same key is used to both encrypt and decrypt data. It is widely used to provide secure data transmission over the internet and is one of the primary methods used in IPSec.
        • elda loggia
          How is confidentiality ensured using the ipsec vpn protocol?
          7 months ago
        • IPSec VPN uses a combination of strong authentication and encryption to ensure that data is kept confidential. Authentication can be achieved by using IKE (Internet Key Exchange) protocols (e.g. pre-shared keys, digital signatures, and certificates) before any data is sent. Encryption can be achieved by using either ESP (Encapsulated Security Payload) or AH (Authentication Header) protocols. ESP protocol encrypts the data with either DES (Data Encryption Standard) or 3DES (Triple-DES) algorithms, while AH protocol authenticates the data integrity and origin without encrypting it.
          • Wiseman Fairbairn
            What is ipsec service?
            7 months ago
          • IPsec (IP Security) is a framework of open standards that provides data authentication, encryption and integrity for secure IP communications. It ensures private, secure communications over IP networks by authenticating and encrypting each IP packet of a communication session.
            • Rina
              Which of the following protocols establish a secure connection and encrypt data for a vpn?
              7 months ago
              1. IPSec
              2. PPTP
              3. L2TP/IPSec
              4. OpenVPN
              5. SSTP
              • Vincenza Colombo
                Which ipsec component authenticates tcp/ip packets to ensure data integrity?
                7 months ago
              • IPsec authentication header (AH) is the IPsec component that authenticates TCP/IP packets to ensure data integrity. AH provides authentication, integrity and anti-replay services for IP packets.
                • goytiom
                  Which of the following protocols provides authentication and encryption services for vpn traffic?
                  8 months ago
                • Hector Findlay
                  Which vpn protocol works at layer 3 and can encrypt the entire tcp/ip packet?
                  8 months ago
                • IPsec (Internet Protocol Security)
                  • Daniela
                    Which technology has two modes of operation: transport and tunnel?
                    8 months ago
                  • IPsec
                    • Violetta Bianchi
                      When discussing tunneling protocols, which of the following is considered a payload protocol?
                      8 months ago
                    • Transport Layer Security (TLS), Secure Shell (SSH), and Internet Protocol Security (IPSec) are all considered payload protocols when discussing tunneling protocols.
                      • Kayden Findlay
                        Which protocol does IPsec use to authenticate IPsec peer devices?
                        1 year ago
                      • Miniya Aman
                        Which ipsec protocol provides a framework for negotiation of security parameters?
                        1 year ago
                      • IKE (Internet Key Exchange)
                        Figure 2-6 ESP Encapsulation Process

                        Original IP

                        Original Layer 4

                        Data

                        Header

                        Header

                        Original IP

                        IPSec ESP

                        Original Layer 4

                        Data

                        IPSec ESP

                        Header

                        Header

                        Header

                        Trailer

                        Sequence Number

                        Padding

                        Pad Length

                        Next Header

                        ICV

                        Figure 2-7 shows more detail about the lengths and placement of the various ESP components. Figure 2-7 Encapsulating Security Payload

                        Security Parameters Index (SPI)

                        Sequence Number Field

                        Payload Data (Variable Length - Integral Number of Bytes)

                        Padding (0-255 Bytes)

                        Pad Length

                        Next Header

                        Authentication Data (Variable Length) (Optional)

                        The fields included in the ESP are as follows:

                        • Security Parameters Index (SPI) (32 bits)—The destination IP address, the IPSec protocol, and this number uniquely identify the SA for this packet.

                        • Sequence Number Field (32 bits)—This is an unsigned, monotonically increasing counter that enables antireplay services for a specific SA. This information does not have to be used by the receiving peer, but it must be included by the sender. This number is initialized to 0 when an SA is established. If antireplay is used, this number can never be allowed to repeat. Because the sender does not know if the receiver is using the antireplay function, the fact that this number cannot be repeated requires that the SA be terminated

                        and a new one established prior to transmitting the 232 packet.

                        • Payload (Variable)—This is the original IP datagram or portions of that datagram. Whether this is the entire datagram depends on the mode used. When using tunnel mode, this Payload includes the entire original IP datagram. In transport mode, it includes only the upper-layer portions of the original IP datagram. IPSec modes are discussed in an upcoming section. The length of the Payload is always an integral number of bytes.

                        • Padding (0-255 bytes)—The Pad Length and Next Header fields must be right aligned within a 4-byte (32-bit) boundary, as shown in Figure 2-7. If the Payload does not accomplish this, padding must be added to ensure this alignment. Additionally, padding can be added to support the multiple block size requirements of encryption algorithms. Padding can also be added to conceal the true length of the Payload.

                        • Pad Length (8 bits)—This field contains the number of bytes of padding that were included in the previous field.

                        • Next Header (8 bits)—This field contains the protocol number of the Layer 4 header that follows the IPSec header. If the Layer 4 protocol were TCP, this field would contain the number 6. For UDP, it would contain the number 17.

                        NOTE The Next Header or Protocol value within the IP header preceding the IPSec header contains the value of 50 when ESP is used as the IPSec protocol.

                        • Authentication Data (Variable)—This field contains the ICV for the packet. The field must be an integral multiple of 32 bits and can contain padding to fill it out to the next 32-bit increment. This field is optional when authentication has been specified in the SA.

                        Figure 2-7 shows the data areas that are covered by encryption and authentication. If encryption is specified in the SA, the fields from Payload through Next Header are encrypted. If authentication is specified, that occurs on the immutable fields from the SPI field through the Next Header field.

                        AH and ESP Modes of Operation

                        The previous discussion talked about the AH and ESP protocols using several examples that showed sliding the IP header of an IP datagram to the left, inserting either an AH or ESP header, and then appending the upper-layer portion of the datagram to that. This is a classic description of one of the modes of operation for IPSec, namely the Transport mode. The other mode of operation for IPSec is the Tunnel mode.

                        These two modes provide a further level of authentication or encryption support to IPSec. The next sections discuss these two IPSec modes.

                        Continue reading here: Transport Mode

                        Was this article helpful?

                        0 0