CSEC3616Cybersecurity Engineering

    IPSec: architecture, security associations and policy

    What IPSec protects and how it differs operationally from TLS, the six components of its architecture, and how a Security Association and the Security Policy Database decide what protection a packet gets.

    • State what IPSec provides and how it differs from TLS in where it runs and what it protects.
    • Name IPSec's six architecture components.
    • Define a Security Association and reproduce the parameters an SAD entry carries.
    • Reproduce the three-step outbound processing sequence the SPD drives.

    18 min read

    Intuition

    TLS protects what rides on top of TCP. It says nothing about the IP packet itself: an attacker who cannot read the payload can still see, and in principle tamper with, the header carrying it. IPSec closes that gap by moving protection down to the IP layer itself.

    Mechanism

    When a host receives a plain IP packet, it has no assurance of the packet’s origin, no way to check its integrity, and no confidentiality: none of it is protected. IPSec is a set of protocols that, like TLS, provides authentication and key establishment, confidentiality, and integrity, but embeds its protective mechanisms as IP payloads rather than TCP payloads. The idea is to configure protection for IP packets flowing between two IP addresses or address ranges, done with a policy.

    Compare

    EXTRACTION DEFECT: the revisited IPv4 packet format diagram (Figure 21) did not survive extraction. No additional packet-field detail beyond the origin/integrity/confidentiality gap described above survived either.

    Mechanism

    Applications of IPSec. Because it can encrypt and authenticate all traffic at the IP level, IPSec secures every distributed application riding above it, remote logon, client/server traffic, email, file transfer, web access, without needing to touch any of them individually. Concretely, it is used for secure branch office connectivity over the Internet, secure remote access over the Internet, extranet and intranet connectivity with partners, and enhanced electronic commerce security.

    Mechanism

    IPSec Services. RFC 4301 lists: access control, connectionless integrity, data origin authentication, rejection of replayed packets (a form of partial sequence integrity), confidentiality (encryption), and limited traffic flow confidentiality.

    Mechanism

    Architecture overview. IPSec is highly complex, to the point that some functionality is duplicated across it. Its six components:

    1. Security Association Database (SAD)
    2. Security Policy Database (SPD)
    3. ESP: Encapsulating Security Payload (authentication, integrity, confidentiality)
    4. AH: Authentication Header (authentication and integrity for the IP header, not the payload)
    5. IKEv2: Internet Key Exchange, an authenticated key establishment protocol
    6. Two modes: tunnel and transport

    EXTRACTION DEFECT: the IPSec architecture diagram showing the SAD/SPD relationship (Figure 22) did not survive extraction.

    Mechanism

    Security Association (SA). An SA describes the concrete way incoming or outgoing packets are going to be protected. It is a negotiated outcome, based on the Security Policy. An SA describes a simplex connection, one direction only, so bidirectional communication needs two. The lecture states a total of four SAs: two per party (covering both directions) and two per mode, one for ESP and one for AH. SAs are stored in the Security Association Database.

    EXTRACTION DEFECT: the diagram of an SA between two hosts (Figure 23) did not survive extraction.

    Mechanism

    Security Policy Database (SPD). The SPD relates IP traffic to specific SAs, or lets traffic bypass IPsec entirely. Each SPD entry is defined by a set of IP and upper-layer protocol field values called selectors, which define an IP flow and are used to filter outgoing traffic into the right SA.

    Outbound processing follows this sequence for every IP packet:

    1. Compare the packet’s selector fields against the SPD to find a matching entry, which points to zero or more SAs.
    2. Determine the SA, if any, for this packet, and its associated SPI.
    3. Perform the required IPsec processing, i.e. AH or ESP processing.

    A Security Association is normally defined in the SAD by these parameters:

    • Security Parameter Index (SPI): a 32-bit value, chosen by the receiving end, that uniquely identifies the SA. Outbound, it builds the AH or ESP header; inbound, it maps traffic to the right SA.
    • Sequence Number Counter: a 32-bit value generating the sequence number field in AH or ESP headers.
    • Sequence Counter Overflow: a flag controlling whether an overflow triggers an auditable event and halts further transmission on this SA.
    • Anti-Replay Window: used to determine whether an inbound AH or ESP packet is a replay.
    • AH Information: the authentication algorithm, keys, and key lifetimes used with AH.
    • ESP Information: the encryption and authentication algorithms, keys, initialization values, and key lifetimes used with ESP.
    • Lifetime of this Security Association: a time interval or byte count after which the SA must be replaced or terminated.
    • IPsec Protocol Mode: tunnel, transport, or wildcard.
    • Path MTU: the observed maximum transmission unit and any related aging variables.

    EXTRACTION DEFECT: the Host SPD Example diagram (Figure 24, named on its own slide heading too) did not survive extraction.

    Exam detail

    Two numbers are worth memorising exactly: the SPI is 32 bits, chosen by the receiver, and the total SA count for bidirectional AH+ESP traffic is four. State the SAD parameter list in the lecture’s own order if asked to reproduce it; it is the kind of list an exam question names directly.

    Aside

    The next page covers AH, ESP and IKEv2 in detail, and restates the “four SAs” total again in the context of IKEv2 specifically, phrased slightly differently there as “one SA per party and direction”. Both statements describe the lecture’s own total of four; they are not reconciled further here.

    Recall

    • IPSec protects at the IP layer itself, runs in kernel space, and needs admin configuration; TLS runs in user space and never protects TCP header fields.
    • Six architecture components: SAD, SPD, ESP, AH, IKEv2, and the tunnel/transport modes.
    • An SA is simplex; bidirectional AH+ESP traffic needs four SAs total, per the lecture.
    • The SPD uses selectors to map outgoing traffic to an SA, in a fixed three-step sequence.