Understanding IPsec………!!!!!!




IP Security is a suite of protocols which was designed by Internet Engineering Task Force (IETF) to protect data by signing and encrypting data before it is transmitted over public networks. The IETF Request for Comments (RFCs) 2401-2409 defines the IPSec protocols with regard to security protocols, security associations and key management, and authentication and encryption algorithms. IPSec is a framework of open standards for encrypting TCP/IP traffic within networking environments. IPSec works by encrypting the information contained in IP datagrams through encapsulating. This in turn provides network level data integrity, data confidentiality, data origin authentication, and replay protection.

Note:IPsec is described in RFC 3193: Securing L2TP using IPsec.

The primary features of IPsec are:


  • Authentication; protects the private network and the private data it contains. IPSec secures private data from man-in-the-middle attacks, from attackers attempting to access the network, and from an attacker changing the contents of data packets.
  • Encryption; conceals the actual content of data packets so that it cannot be interpreted by unauthorized parties.

##. IPSec can be used to provide packet filtering capabilities. It can also authenticate traffic between two hosts and encrypt traffic passed between the hosts. IPSec can be used to create a virtual private network (VPN). IPSec can also be used to enable communication between remote offices and remote access clients over the Internet.

##. IPSec operates at the network layer to provide end-to-end encryption. This basically means that data is encrypted at the source computer sending the data. All intermediate systems handle the encrypted portion of the packets as payload. Intermediate systems such as routers merely forward the packet to its end destination. Intermediate systems do not decrypt the encrypted data. The encrypted data is only decrypted when it reaches the destination.

##. IPSec interfaces with the TCP/UDP transport layer and the Internet layer, and is applied transparently to applications. IPSec is transparent to users as well. This basically means that IPSec can provide security for most of the protocols within the TCP/IP protocol suite. When it comes to applications, all applications that use TCP/IP can enjoy the security features of IPSec. You do not have to configure security for each specific TCP/IP based application. By using rules and filters, IPSec can receive network traffic and select the required security protocols, determine which algorithms to use, and can apply cryptographic keys required by any of the services.

The security features and capabilities of IPSec can be used to secure the private network and private confidential data from the following:

  • Denial-of-service (Dos) attacks
  • Data pilfering.
  • Data corruption.
  • Theft of user credentials

The security functions and features provided by IPSec are summarized below:

  • Authentication; a digital signature is used to verify the identity of the sender of the information. IPSec can use Kerberos, a preshared key, or digital certificates for authentication.
  • Data integrity; a hash algorithm is used to ensure that data is not tampered with. A checksum called a hash message authentication code (HMAC) is calculated for the data of the packet. When a packet is modified while in transit, the calculated HMAC changes. This change will be detected by the receiving computer.
  • Data privacy; encryption algorithms are utilized to ensure that data being transmitted is undecipherable.
  • Anti-replay; prevents an attacker from resending packets in an attempt to gain access to the privatenetwork.
  • Nonrepudiation; public key digital signatures are used to prove message origin.
  • Dynamic rekeying; keys can be created during data sending to protect segments of the communication with different keys.
  • Key generation; the Diffie-Hellman key agreement algorithm is used to enable two computers to exchange a shared encryption key.
  • IP Packet filtering; the packet filtering capability of IPSec can be used to filter and block specific types of traffic, based on either of the following elements or on a combination of them:
    • IP addresses
    • Protocols
    • Ports

How does IPsec works:

An IPsec enabled server or host contacts the client computer for a list of ciphers and algorithms that both devices support. Once a cipher has been chosen, the client encrypts any data that it sends by using that specific algorithm so that only the server can decrypt the data by using the agreed upon public key. The IPsec enabled server will then re-encrypt any data that is sent back to the client in the same manner. The two devices will communicate in this way until the session has closed.

A security association (SA) has to first be established between two computers before data can be securely passed between the computers. A Security Association (SA) is a relationship between devices that define how they use security services and settings. The SA provides the information necessary for two computers to communicate securely. Internet Security Association and Key Management Protocol (ISAKMP) and the IKE protocol are the mechanism that enables two computers to establish security associations. When an SA is established between two computers, the computers negotiate on which security settings to utilize to secure data. A security key is exchanged and used to enable the computers to communicate securely.

The security association (SA) contains the following:

  • The policy agreement which dictates which algorithms and key lengths the two computers will use to secure data.
  • The security keys used to secure data communication.
  • The security parameters index (SPI).

With IPSec, two separate SAs are established for each direction of data communication:

  • One SA secures inbound traffic.
  • One SA secures outbound traffic.

In addition to the above, there is a unique SA for each IPSec security protocol. There are therefore basically two types of SAs:

  • ISAKMP SA: When traffic flow is two directional and IPSec needs to establish a connection between computers, an ISAKMP SA is established. The ISAKMP SA defines and handles security parameters between the two computers. The two computers agree on a number of elements to establish the ISAKMP SA:IPSec SA: IPSec SAs pertain to the IPSec tunnel and IP packet, and define security parameters to use during a connection. The IPSec SA is derived from the above four elements just negotiated between the two computers.
    • Determine which connections should be authenticated.
    • Determine the encryption algorithm to use.
    • Determine the algorithm to verify message integrity.

#.After the above elements have been negotiated between the two computers, the computers use the Oakley protocol to agree on the ISAKMP master key. This is the shared master key which will be used with the above elements to enable secure data communication.

##. After a secured communication channel is established between the two computers, the computers start to negotiate the following elements:

  • Determine whether the Authentication Header (AH) IPSec protocol should be used for the connection.
  • Determine the authentication protocol which should be used with the AH protocol for the connection.
  • Determine whether the Encapsulating Security Payload (ESP) IPSec protocol should be used for the connection.
  • Determine the encryption algorithm which should be used with the ESP protocol for the connection.

To secure and protect data, IPSec uses cryptography to provide the following capabilities:

  • Authentication: Authentication deals with verifying the identity of the computer sending the data, or the identity of the computer receiving the data. The methods which IPSec can use to authenticate the sender or receiver of data are:
    • Digital certificates: Provides the most secure means of authenticating identities. Certificate authorities (CAs) such as Netscape, Entrust, VeriSign, and Microsoft provide certificates which can be used for authentication purposes.
    • Kerberos authentication: A downside of using the Kerberos v5 authentication protocol is that the identity of the computer remains unencrypted up to the point that the whole payload is encrypted at authentication.
    • Pre-shared keys; should be used when none of the former authentication methods can be used.

    Anti-replay ensures that the authentication data cannot be interpreted as it is sent over the network. In addition to authentication, IPSec can provide nonrepudiation. With nonrepudiation, the sender of the data cannot at a later stage deny actually sending the data.

  • Data integrity: Data integrity deals with ensuring that the data received at the recipient has not been tampered with. A hashing algorithm is used to ensure that the data is not modified as it is passed over the network. The hashing algorithms which can be used by IPSec are:
    • Message Digest (MD5); a one-way hash that results in a 128-bit hash which is used for integrity checking.
    • Secure Hash Algorithm 1 (SHA1); a 160-bit secret key to generate a 160-bit message digest which provides more security than MD5.
  • Data confidentiality: IPSec ensures data confidentiality by applying encryption algorithms to data before it is sent over the network. If the data is intercepted, encryption ensures that the intruder cannot interpret the data. To ensure data confidentiality, IPSec can use either of the following encryption algorithms:
    • Data Encryption Standard (DES); the default encryption algorithm used in Windows Server 2003 which uses 56-bit encryption.
    • Triple DEC (3DES); data is encrypted with one key, decrypted with another key, and encrypted again with a different key.
    • 40-bit DES; the least secure encryption algorithm.

Understanding the IPSec Protocols:

The main IPSec security protocols are the Authentication Header (AH) and Encapsulating Security Payload (ESP) protocols. There are other IPSec protocols such as ISAKMP, IKE, and Oakley that use the Diffie-Hellman algorithm.

Authentication Header (AH) Protocol:

The AH protocol provides the following security services to secure data:

  • Authentication
  • Anti-replay
  • Data integrity

##.The AH protocol ensures that data is not modified as it moves over the network. It also ensures that the data originated from the sender.

The AH protocol does not though provide data confidentiality because it does not encrypt the data contained in the IP packets. This basically means, that if the AH protocol is used by itself; intruders that are able to capture data would be able to read the data. They would not though be able to change the data. The AH protocol can be used in combination with the ESP protocol if you need to ensure data confidentiality as well.

The communication process which occurs when the AH protocol is used is shown here:

  1. One computer transmits data to another computer.
  2. The IP header, AH header, and the data itself is signed to ensure data integrity.
  3. The AH header is inserted between the IP header and IP payload to provide authentication and integrity.

The fields within a AH header, together with the role performed by each field is listed here:

  • Next Header; used to specify the type of IP payload through the IP protocol ID that exists after this AH header.
  • Length; indicates the length of the AH header.
  • Security Parameters Index (SPI); indicates the correct security association for the communication through a combination of the following:Sequence Number; used to provide IPSec anti-replay protection for the communication. The sequence number commences at 1, and is incremented by 1 in each ensuing packet. Packets that have the same sequence number and security association are discarded.
    • IPSec security protocol.
    • Destination IP address
  • Authentication Data; holds the integrity check value (ICV) calculated by the sending computer to provide data integrity and authentication. The receiving computer calculates the ICV over the IP header, AH header, and IP payload, and then compares the two ICV values.
  • Sequence Number; used to provide IPSec anti-replay protection for the communication. The sequence number commences at 1, and is incremented by 1 in each ensuing packet. Packets that have the same sequence number and security association are discarded.

Understanding IPSec Security Filters, Security Methods, and Security Policies:

Security filters basically match security protocols to a specific network address. IPSec filters can be used to filter out unauthorized traffic. The filter contains the following information:

  • Source and destination IP address
  • Protocol used
  • Source and destination ports

Each IP address contains a network ID portion and a host ID portion. Through security filters, you can filter traffic according to the following:

  • Traffic allowed to pass through
  • Traffic to secure
  • Traffic to block

#.Security filters can be grouped into a filter list. There is no limit to the number of filters which can be included in a filter list. IPSec policies uses IP filters to ascertain whether an IP security rule should be used in a packet.

You can use a security method to specify the manner in which an IPSec policy should deal with traffic matching an IP filter. Security methods are also referred to as filter actions. The filter actions result in either of the following events:

  • Drops traffic
  • Allows Traffic
  • Negotiates security.

##.To apply security in your network, IPSec policies are used. The IPSec policies define when and how data should be secured. The IPSec policies also determine which security methods to use when securing data at the different levels in your network. You can configure IPSec policies so that different types of traffic are affected by each individual policy.

IPSec policies can be applied at the following levels within a network:

  • Active Directory domain
  • Active Directory site
  • Active Directory organizational unit
  • Computers
  • Applications

The different components of an IPSec policy are listed here:

  • IP filter; informs the IPSec driver on the type of inbound traffic and outbound traffic which should be secured.
  • IP filter list; used to group multiple IP filters into a single list in order to isolate a specific set of network traffic.
  • Filter action; used to define how the IPSec driver should secure traffic.
  • Security method; refers to security types and algorithms used for the key exchange process and for authentication.
  • Connection type: identifies the type of connection which the IPSec policy impacts.
  • Tunnel setting; the tunnel endpoint’s IP address/DNS name.
  • Rule; a grouping of the following components to secure a specific subset of traffic in a particular manner:
    • IP filter
    • Filter action.
    • Security method
    • Connection type
    • Tunnel setting.



About Author


Leave A Reply

CAPTCHA ImageChange Image