Pcornel
Browse topics
Options
Recent
Favorites
Security · Technical reference

Security Association

Direct answer

An IPsec Security Association is a unidirectional set of peer, protocol, SPI, algorithms, keys, selectors, sequence/anti-replay and lifetime state used to process protected traffic; bidirectional communication normally uses paired SAs.

When to use this

Use it when configuring, checking or troubleshooting Security Association in VPN.

First 30 seconds

1. A Security Association is a one-way set of keys/algorithms identified by SPI.

2. Two SAs per tunnel (in/out).

3. Lifetimes trigger rekey.

4. Counters show traffic.

5. Mismatch → drops.

Operational verification

SPI → keys/algorithms → protected packets

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common traps

An SA entry shows installed cryptographic state, but it does not show traffic use, opposite-direction state or destination acceptance.

Suspicious evidence: orphan one-way SA, zero bytes, SPI not found, mismatched keys, replay window drop, expired lifetime, duplicate stale SAs or selector narrower than route.

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 it when configuring, checking or troubleshooting Security Association in VPN.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

policy/child negotiation → outbound SA/SPI/keys → ESP/AH packets → inbound SA lookup → replay/integrity/decrypt → inner packet → rekey/delete

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
  • One SA ≠ bidirectional protection.
  • SA present ≠ packets match its selectors or keys remain synchronized.
  • Tunnel or SA up ≠ protected application traffic succeeds.
  • Cryptographic negotiation ≠ correct identity, selector, route or application outcome.
Key checks
  • ip xfrm state — SAs with SPIs
  • show crypto ipsec sa — SPI, counters, lifetimes
  • swanctl --list-sas — SA details
ReferenceWhat it is1 section · depth on demand

SA details

Each tunnel has at least two IPsec SAs (one per direction), each with its own SPI, keys and counters. SAs expire by time (e.g. 3600 s) or volume and are rekeyed. show crypto ipsec sa shows SPIs, encrypt/decrypt counters and errors (#pkts decrypt failed, replay errors). Mismatched traffic selectors produce SAs that do not cover the traffic.

ReferenceHow it works1 section · depth on demand

Decision and enforcement journey

Security Association is verified as a decision/enforcement journey: policy match → SA lookup/negotiation → SPI/keys/lifetime → encapsulation/anti-replay → peer decapsulation → application.

ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

An SA entry shows installed cryptographic state, but it does not show traffic use, opposite-direction state or destination acceptance.

In depth

A Security Association (SA) in a VPN is the agreed set of parameters for protecting traffic in one direction between two peers: algorithms, keys, SPI, lifetime and traffic selectors. An IKE SA protects the control channel; IPsec (child) SAs protect data.

show crypto ipsec sa
  local  ident (addr/mask/prot/port): (10.20.0.0/255.255.0.0/0/0)
  remote ident (addr/mask/prot/port): (10.0.0.0/255.0.0.0/0/0)
  #pkts encaps: 154822, #pkts decaps: 151877
  inbound esp sas:  spi: 0xC81B9A2E
  outbound esp sas: spi: 0x5D3A11F0

Documented example, not captured output.

If encaps increase but decaps stay at zero, traffic leaves but nothing returns — check the remote side's routing, policy and NAT. SAs are rekeyed before expiry; problems at rekey often point to PFS or lifetime mismatches.

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 VPN → Security Association. Documentation verification only; this is not observed lab or production Evidence.

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

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
IPsec SAsecurity association databaseVPN SA
Embedded reference data

Quick lookup tables

VPN → Security Association proof map

Fast scope, effective-policy, runtime-evidence and closure boundaries for VPN → Security Association.

BoundaryEstablishDoes not establish
Scope and intentExact subjects, destinations, application, direction, trust zone and expected decisionDoes not prove effective path, identity, cryptography or enforcement
Effective control stateResolved rule/policy, session/SA, identity/posture, translation and selected pathObject/config presence does not prove a match or packet outcome
Runtime evidenceCorrelated client, authenticator/firewall/VPN, AAA and destination observations for one flow/timeA single log or success does not prove every packet, peer, path or failover state
ClosureOriginal allowed/denied operation behaves as intended and regression/failure tests passAdministrative commit or tunnel-up state alone is not closure
Confirmation

Confirm action

Continue?