18CS744 Module5 Notes
18CS744 Module5 Notes
MODULE V
IP Security
IP Security: IP Security overview, applications of IPsec, benefits of IPsec,
Routing applications, IPsec documents, IPsec services, transport and tunnel
modes, IP Security policy, Security associations, Security associations
database, Security policy database, IP traffic processing, Encapsulating
Security payload, ESP format, encryption and authentication algorithms,
Padding, Anti replay service
Transport and tunnel modes: combining security associations,
authentication plus confidentiality, basic combinations of security associations,
internet key exchange, key determinations protocol, header and payload
formats, cryptographic suits.
Textbook 1: Ch. 20.1 to 20.3 RBT: L1, L2
Cryptography 18CS744 Module 5: IP Security
IP level security
If an organization requires a secure network by disallowing links to
untrusted sites, encrypting packets that leave the premises, and
authenticating packets that enter the premises then security at IP level
needs to be implemented.
IP-level security provides: authentication, confidentiality, and key
management.
The authentication mechanism assures that a received packet was, in fact,
transmitted by the party identified as the source in the packet header.
The confidentiality facility enables communicating nodes to encrypt
messages to prevent eavesdropping by third parties.
The key management facility is concerned with the secure exchange of keys
Applications of Ipsec
Secure branch office connectivity over the Internet: A company can
build a secure virtual private network over the Internet or over a public
WAN. This enables a business to rely heavily on the Internet and reduce its
need for private networks, saving costs and network management
overhead.
Secure remote access over the Internet: An end user whose system is
equipped with IP security protocols can make a local call to an Internet
Service Provider (ISP) and gain secure access to a company network. This
reduces the cost of toll charges for traveling employees and telecommuters.
Establishing extranet and intranet connectivity with partners: IPsec
can be used to secure communication with other organizations, ensuring
authentication and confidentiality and providing a key exchange
mechanism.
IP security scenario
IPsec Documents
IPsec Services
• Access control
• Connectionless integrity
• Confidentiality (encryption)
Transport mode is used for end to-end communication between two hosts
(e.g., a client and a server, or two workstations).
IP Security Policy
IPsec Architecture
Security Associations
Security Protocol Identifier: This field from the outer IP header indicates
whether the association is an AH or ESP security association.
Remote IP Address:
Local IP Address:
Cryptography 18CS744 Module 5: IP Security
Local and Remote Ports: These may be individual TCP or UDP port values.
4. If the policy is PROTECT, then a search is made of the SAD for a matching
entry. If no entry is found, then IKE is invoked to create an SA with the
appropriate keys and an entry is made in the SA.
5. The matching entry in the SAD determines the processing for this packet.
Either encryption, authentication, or both can be performed, and either
transport or tunnel mode can be used. The packet is then forwarded to the
network for transmission.
2. If the packet is unsecured, IPsec searches the SPD for a match to this
packet. If the first matching entry has a policy of BYPASS, the IP header is
processed and stripped off and the packet body is delivered to the next
higher layer, such as TCP. If the first matching entry has a policy of
PROTECT or DISCARD, or if there is no matching entry, the packet is
discarded.
3. For a secured packet, IPsec searches the SAD. If no match is found, the
packet is discarded. Otherwise, IPsec applies the appropriate ESP or AH
processing. Then, the IP header is processed and stripped off and the
packet body is delivered to the next higher layer, such as TCP.
Next Header (8 bits): Identifies the type of data contained in the payload
data
If tunnel mode is being used, then the IPsec implementation may add
Traffic Flow Confidentiality (TFC)
Cryptography 18CS744 Module 5: IP Security
Anti-Replay Service
The right edge of the window represents the highest sequence number, N,
so far received for a valid packet for any packet with a sequence number
in the range from N - W + 1 to N that has been correctly received (i.e.,
properly authenticated), the corresponding slot in the window is marked.
1. If the received packet falls within the window and is new, the MAC is
checked. If the packet is authenticated, the corresponding slot in the
window is marked.
2. If the received packet is to the right of the window and is new, the MAC
is checked. If the packet is authenticated, the window is advanced so that
this sequence number is the right edge of the window, and the
corresponding slot in the window is marked.
Cryptography 18CS744 Module 5: IP Security
Transport mode retains the original IP header. In other words, payload data
transmitted within the original IP packet is protected, but not the IP header.
1. At the source, the block of data consisting of the ESP trailer plus the
entire transport-layer segment is encrypted and the plaintext of this
block is replaced with its ciphertext to form the IP packet for
transmission. Authentication is added if this option is selected.
3. The destination node examines and processes the IP header plus any
plaintext IP extension headers. Then, on the basis of the SPI in the ESP
header, the destination node decrypts the remainder of the packet to
recover the plaintext transport-layer segment.
3. The destination firewall examines and processes the outer IP header plus
any outer IP extension headers. Then, on the basis of the SPI in the ESP
header, the destination node decrypts the remainder of the packet to
recover the plaintext inner IP packet. This packet is then transmitted in the
internal network.
4. The inner packet is routed through zero or more routers in the internal
network to the destination host.
Cryptography 18CS744 Module 5: IP Security
An individual SA can implement either the AH or ESP protocol but not both.
Sometimes a particular traffic flow will call for the services provided by both
AH and ESP. Multiple SAs must be employed for the same traffic flow to
achieve the desired IPsec services. The security association bundle refers
to a sequence of SAs through which traffic must be processed to provide a
desired set of IPsec services.
Cryptography 18CS744 Module 5: IP Security
Transport Adjacency
Use two bundled transport SAs, with the inner being an ESP SA and the
outer being an AH SA. In this case, ESP is used without its authentication
option. Because the inner SA is a transport SA, encryption is applied to the
IP payload.
Transport-Tunnel Bundle
Cryptography 18CS744 Module 5: IP Security
Case 1. All security is provided between end systems that implement IPsec.
For any two end systems to communicate via an SA, they must share the
appropriate secret keys. Among the possible combinations are
a. AH in transport mode
Case 4. This provides support for a remote host that uses the Internet to
reach an organization’s firewall and then to gain access to some server or
Cryptography 18CS744 Module 5: IP Security
workstation behind the firewall. Only tunnel mode is required between the
remote host and the firewall. As in case 1, one or two SAs may be used
between the remote host and the local host.
The IPsec Architecture document mandates support for two types of key
management:
• Secret keys are created only when needed. There is no need to store
secret keys for a long period of time, exposing them to increased
vulnerability.
• It does not provide any information about the identities of the parties.
1. The cookie must depend on the specific parties. This prevents an attacker
from obtaining a cookie using a real IP address and UDP port and then using
it to swamp the victim with requests from randomly chosen IP addresses
or ports.
2. It must not be possible for anyone other than the issuing entity to
generate cookies that will be accepted by that entity. This implies that the
Cryptography 18CS744 Module 5: IP Security
issuing entity will use local secret information in the generation and
subsequent verification of a cookie. It must not be possible to deduce this
secret information from any particular cookie. The point of this requirement
is that the issuing entity need not save copies of its cookies, which are then
more vulnerable to discovery, but can verify an incoming cookie
acknowledgment when it needs to.
Figure 20.12a shows the header format for an IKE message. It consists of
the following fields:
• Initiator SPI (64 bits): A value chosen by the initiator to identify a unique
IKE security association (SA).
• Next Payload (8 bits): Indicates the type of the first payload in the
message; payloads are discussed in the next subsection.
• Flags (8 bits): Indicates specific options set for this IKE exchange. Three
bits are defined so far. The initiator bit indicates whether this packet is sent
by the SA initiator. The version bit indicates whether the transmitter is
capable of using a higher major version number than the one currently
indicated. The response bit indicates whether this is a response to a
message containing the same message ID. • Message ID (32 bits): Used
Cryptography 18CS744 Module 5: IP Security
• Length (32 bits): Length of total message (header plus all payloads) in
octets
All IKE payloads begin with the same generic payload header shown in
Figure 20.12b. The Next Payload field has a value of 0 if this is the last
payload in the message; otherwise its value is the type of the next payload.
The Payload Length field indicates the length in octets of this payload,
including the generic payload header
Table 20.3 summarizes the payload types defined for IKE and lists the
fields, or parameters, that are part of each payload. The SA payload is used
to begin the establishment of an SA. The payload has a complex,
hierarchical structure. The payload may contain multiple proposals. Each
proposal may contain multiple protocols. Each protocol may contain
multiple transforms. And each transform may contain multiple attributes.
These elements are formatted as substructures within the payload as
follows.
• Attribute: Each transform may include attributes that modify or complete the
specification of the transform. An example is key length.
Cryptography 18CS744 Module 5: IP Security