Encapsulated Security Payload Header ● RFC 2406 ● Services – Confidentiality ● Plus – Connectionless integrity – Data origin authentication – Replay protection – As much header authentication as possible
ESP Packet Format Next Header Pad Len Security Parameters Index (SPI) Sequence Number Field Authentication Data (Variable) Payload Data (Variable) Encrypted Layer 4 data Padding ESP Header Encrypted Payload ESP Trailer Auth Data Authenticated Encrypted
ESP Parameters ● SPI – 32-bit value that together with the destination IP address and AH uniquely identifies the Security Association for this datagram ● Sequence Number – function and generation is the same as in the AH. ● Payload Data contains the data described by the Hext Header field, ● Authentication Data – contains the ICV over the ESP packet minus the Authentication Data
ESP Header Location ● IPv6 considerations only ● ESP is viewed as an end-to-end payload ● ESP protects only those fields after the ESP header. ● Occurs before the encrypted payload ● Is part of the ICV
ESP Header Location Transport Mode IPv6 Header ESP Header Payload Transport Mode ESP Trailer ESP Auth Data Hop-by-Hop Routing Frag ext. Headers Authenticated Encrypted
ESP Header Location Tunnel Mode IPv6 Header ESP Header Payload Tunnel Mode ESP Trailer ESP Auth Data Older Ipv6 Header Hop-by-Hop Routing Frag ext. Headers Authenticated Encrypted
Authentication Data ● Authentication Data field is a variable length field that contains the Integrity Check Value (ICV) for this packet ● Multiple of 32-bits ● The ICV algorithm is specified in the SA ● Usually an HMAC (keyed hash) ● ICV is calculated over the Immutable and Predictable values in the IP header, AH header, padding, upper level protocols and payload, etc.
Authenticated Data ● Immutable ● Version, Payload Length, Next Header, Source Address, Destination Address without Routing Extension Header ● Mutable but predictable ● Destination Address with Routing Extension Header ● Mutable ( zeroed prior to ICV cal) ● Class, Flow Label, Hop Limit
Outbound Packet Processing ● Match packet's selectors against the outbound policies in the SPD ● SA Lookup ● Encapsulates the Payload field ● Adds necessary padding ● Encrypts the Payload, Padding, Pad Length and the Next Header ● Sequence Number Generration ● ICV Calculation ● Fragmentation of the IPSec datagram if necessary
Inbound Packet Processing ● Datagram Reassembly ● SA Lookup ● Based on IP address, Security Protocol, The SPI ● ICV Verification ● Calc'ed over Immutable fields ● Mutable but predictable fields ● Options and Payload ● Sequence Number Verification ● Packet decryption