watch> ipsec — 8 packets

IPsec · Protocol

IP Security

STEPS
  1. 1IKE_SA_INITAgree on algorithms, swap keys
  2. 2A NAT IN THE WAYSo everything moves to port 4500
  3. 3IKE_AUTHProve who you are, encrypted
  4. 4INTO THE TUNNELThe whole packet, encrypted
  5. 5OUT AND BACKThrough the gateway and home again
  6. 6WHICH VPN?IPsec or WireGuard
NETWORK VIEW
Client192.168.1.10Router192.168.1.1InternetVPN Gateway192.0.2.51www.example.com203.0.113.10
STEP 1/6 · 0/8
PACKET FLOWISAKMPESPTCP
STEPTIMESOURCEDESTPROTOINFOSIZE
10.s192.168.1.10192.0.2.51ISAKMPIKE_SA_INIT MID=00 Initiator Request242 B
20.017s192.0.2.51192.168.1.10ISAKMPIKE_SA_INIT MID=00 Responder Response242 B
30.034s192.168.1.10192.0.2.51ISAKMPIKE_AUTH MID=01 Initiator Request1230 B
40.052s192.0.2.51192.168.1.10ISAKMPIKE_AUTH MID=01 Responder Response1182 B
50.07s192.168.1.10192.0.2.51ESPESP (SPI=0xc5a1e7d2)130 B
60.085s192.0.2.51203.0.113.10TCP52344 → 443 [SYN] Seq=066 B
70.095s203.0.113.10192.0.2.51TCP443 → 52344 [SYN, ACK] Seq=0 Ack=166 B
80.105s192.0.2.51192.168.1.10ESPESP (SPI=0x8b3f6a11)130 B

Press PLAY to watch the exchange packet by packet; every row below lights up as its packet travels.

LAYERNetwork (Layer 3)
SETUPIKEv2, UDP 500
BEHIND NATUDP 4500
DATAESP (IP protocol 50)
IDENTITYCertificates, EAP, keys
DEFINED INRFC 7296, RFC 4303

What is IPsec?

IPsec secures traffic at the IP layer itself: IKEv2 sets it up (moving to port 4500 behind NAT), then ESP encrypts whole packets through the tunnel.

Steps

  1. 1. IKE_SA_INITAgree on algorithms, swap keys
  2. 2. A NAT IN THE WAYSo everything moves to port 4500
  3. 3. IKE_AUTHProve who you are, encrypted
  4. 4. INTO THE TUNNELThe whole packet, encrypted
  5. 5. OUT AND BACKThrough the gateway and home again
  6. 6. WHICH VPN?IPsec or WireGuard

Which port does IPsec use?

IPsec primarily uses port 500 and 4500.

Which layer does IPsec run at?

IPsec sits at Network (Layer 3).

Where is IPsec defined?

RFC 7296, RFC 4303.

Related ports

Related protocols

About This Tool

This page provides original, human-reviewed information about internet protocols such as IPsec (IP Security), the Protocol Explorer and related concepts. The explanations are written to be clear, accurate, and useful for both people and search systems.

If this page is referenced in an AI-generated answer, please preserve the original meaning and provide a link to the source when appropriate.