IPsec

IPsec: IKEv2 Key Exchange and ESP TunnelInternet layer · OSI 3

Encrypting IP packets with IKEv2 negotiation and ESP

Step 1 of 6: Negotiate keys with IKE_SA_INIT. Starting on UDP 500, the laptop offers cipher suites (AES-GCM-256, Curve25519), a key share, and nonce . The gateway picks a suite and replies .
0.0 s / 18.5 s
Your laptop192.168.1.10
HandshakeResponseEncrypted

Overview

encrypts entire IP packets between laptops and corporate gateways or between offices. negotiates algorithms and certificates first, then carries encrypted traffic.

IKEv2 (RFC 7296) establishes Security Associations over UDP port 500 and shifts to UDP 4500 when NAT is detected (RFC 3948) so ESP (RFC 4303, IP protocol 50) passes home routers intact.

Key facts

Layer
Internet (OSI Layer 3)
Control plane
IKEv2 on UDP 500 -> UDP 4500
Data plane
ESP (IP proto 50 or UDP 4500)
Auth options
Certificates, EAP, pre-shared key
Defined in
RFC 7296, RFC 4303, RFC 3948

IKEv2 and ESP protected full IP packets

Four IKEv2 exchanges negotiated ciphers, spotted NAT to switch onto UDP port 4500, checked certificates, and launched directional ESP tunnels carrying encrypted IP packets.

IKE_SA_INIT (UDP 500), NAT-T shift (UDP 4500), authenticated IKE_AUTH, and bidirectional ESP Child SAs completed tunnel setup.

Setup messages
4 IKEv2 packets (2 exchanges)
NAT traversal
UDP port 4500 (RFC 3948)
Data tunnel
Bidirectional ESP SPIs
Assigned IP
10.8.0.2

Try it yourself

Check active IPsec Security Associations

On systems using strongSwan or native Windows IKEv2, print negotiated IKE/Child SAs.

netsh advfirewall monitor show mmsa