Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

IPsec Architecture

Direct answer

IPsec architecture combines IKE for authentication and key exchange, ESP or AH for packet protection, security associations stored per direction, and transport or tunnel mode depending on what is protected.

When to use this

Use this to understand IPsec components and modes.

First 30 seconds

1. Components: SPD (which traffic), SAD (keys), IKE daemon, ESP/AH processing.

2. Policy decides protect/bypass/discard.

3. Kernel does ESP; userspace does IKE.

4. Route-based vs policy-based.

5. Know your model.

Operational verification

packet → SPD lookup → SA → ESP

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Mismatched proxy IDs / traffic selectors between peers.
  • NAT applied to traffic that should enter the tunnel (missing NAT exemption).
  • Routing sends traffic out the internet interface instead of the tunnel (route-based VPNs need a route via the tunnel interface).
  • Lifetimes that differ widely between peers, causing rekey problems on some platforms.
Platform / version applicability
Network security
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformNetwork security
Scope / prerequisiteUse this to understand IPsec components and modes.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • IPsec combines IKE, ESP/AH and security associations.
  • Tunnel mode suits gateways; transport mode suits hosts.
  • Policies decide which traffic is protected.
Key checks
  • ip xfrm policy — SPD (Linux)
  • ip xfrm state — SAD
  • swanctl --list-conns — configuration
ReferenceWhy it matters1 section · depth on demand

Packet journey

1. Traffic matches the tunnel (route to a VTI or a crypto ACL).

2. If no SA exists, IKE negotiates one (IKE SA, then Child/IPsec SA).

3. The packet is encrypted with ESP using the SA's keys and sent to the peer (UDP 4500 if NAT is detected).

4. The peer checks integrity and anti-replay, decrypts and forwards.

Troubleshoot in the same order: routing/selector → IKE → IPsec SA → counters on both sides → return routing.

ReferenceImportant terms & boundaries2 sections · depth on demand

Components

ComponentRole
IKE (UDP 500/4500)Authenticates peers and negotiates keys
SA (Security Association)One-way agreement: SPI, keys, algorithms, lifetime
SPDPolicy: which traffic must be protected
SADDatabase of active SAs
ESP / AHProtect the packets

Each tunnel has a pair of IPsec SAs (one per direction) under one IKE SA.

In depth

IPsec architecture (RFC 4301) defines how IP packets are protected: a Security Policy Database (SPD) decides which traffic must be protected, bypassed or discarded; a Security Association Database (SAD) holds the negotiated SAs; IKE populates the SAs; and ESP/AH process the packets.

ComponentRole
SPDPolicy: protect / bypass / discard per traffic selector
SADActive SAs with keys, algorithms, sequence numbers
PADPeer authorisation (which identities may negotiate)
IKEv2Key management
ESP/AHData protection

Route-based VPNs (VTI) simplify the SPD to "protect everything entering the tunnel interface", while policy-based VPNs rely on explicit traffic selectors — the source of many interoperability problems.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docNetwork security current

Authoritative/upstream documentation reviewed for bounded claims in IPsec → IPsec Architecture. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4301 · confidence 94%
Confirmation

Confirm action

Continue?