Internet Protocol Security Tunneling
Summary
Internet Protocol Security (IPsec) protects traffic at the network layer, so any application benefits without changes. It provides authentication and integrity with the Authentication Header and adds encryption with the Encapsulating Security Payload. It runs in transport mode between hosts or tunnel mode between gateways.
In plain words
IPsec secures traffic at layer 3, so applications don't need to support it. AH (Authentication Header) provides integrity and authentication for the whole packet, including the IP header, but no encryption. ESP (Encapsulating Security Payload) adds encryption. Transport mode protects the payload between hosts; tunnel mode wraps the whole original packet in a new IP header, which is what site-to-site VPNs use.
Detailed explanation
- Internet Protocol Security (IPsec): A suite of protocols that authenticate and encrypt IP packets at layer 3.
- Authentication Header (AH): Provides integrity and authentication for the whole packet, including most of the IP header, but no encryption.
- Encapsulating Security Payload (ESP): Provides encryption plus integrity and authentication of the payload.
- Transport mode: Protects only the payload and keeps the original IP header; used between two hosts.
- Tunnel mode: Encrypts the entire original packet and wraps it in a new IP header; used for site-to-site and remote access VPNs.
- NAT traversal: ESP is encapsulated in UDP port 4500 so it can pass through address translation.
Important terms
taken from the text above- Internet Protocol Security (IPsec)
- A suite of protocols that authenticate and encrypt IP packets at layer 3.
- Authentication Header (AH)
- Provides integrity and authentication for the whole packet, including most of the IP header, but no encryption.
- Encapsulating Security Payload (ESP)
- Provides encryption plus integrity and authentication of the payload.
- Transport mode
- Protects only the payload and keeps the original IP header; used between two hosts.
- Tunnel mode
- Encrypts the entire original packet and wraps it in a new IP header; used for site-to-site and remote access VPNs.
- NAT traversal
- ESP is encapsulated in UDP port 4500 so it can pass through address translation.
Examples & real-world scenarios
- ESP in tunnel mode between two office gateways.
- Transport mode protecting traffic between two internal servers.
- AH used where integrity matters but confidentiality isn't needed.
Scenario
A site-to-site link must hide internal addressing and content from the ISP. ESP in tunnel mode encrypts the entire original packet, including its internal IP header.
Common mistakes
- Thinking AH encrypts data. It provides integrity only.
- Mixing up transport mode (payload only) and tunnel mode (whole packet, new header).
Practical skills
- Pick AH or ESP and transport or tunnel mode for a requirement.
What I should remember
- AH: Integrity and authentication, no confidentiality.
- ESP: Adds encryption; the usual choice.
- Tunnel mode: Encrypts the whole original packet; used for VPNs.
- Transport mode: Protects only the payload between hosts.