Course contentsShow
← Security
Lesson 476 of 3,05211. Network Security - VPNs and TunnelingFree lesson

IPsec Modes: Transport vs Tunnel

Differences between transport mode (end-to-end) and tunnel mode (gateway-to-gateway) encapsulation.

IPsec Modes: Transport vs Tunnel

What you'll learn: How IPsec's two encapsulation modes differ in what they protect and where they're used.

The Two Modes of Protection

IPsec can protect your network traffic in two distinct ways: transport mode and tunnel mode. Think of these as two different strategies for securing a package during delivery.

Transport Mode: End-to-End Protection

In transport mode, IPsec protects only the payload (the actual data) of the IP packet. The original IP header remains visible and unchanged—only the contents are encrypted or authenticated.

Analogy: Imagine sending a letter where you seal the contents in an opaque envelope, but the original address labels remain visible on the outside. The postal service can still route it normally, but the message inside is protected.

Use case: Transport mode is ideal for direct host-to-host communication, such as securing traffic between two specific servers or a client and a server endpoint.

Tunnel Mode: Gateway-to-Gateway Protection

In tunnel mode, IPsec encrypts the entire original IP packet—both header and payload. This encrypted packet is then wrapped in a new IP packet with new headers for routing.

Analogy: Your sealed letter gets placed inside another envelope with a completely different address. The inner envelope (original packet) is completely hidden until the outer envelope is opened at the destination gateway.

Use case: Tunnel mode is the standard for site-to-site VPNs, where gateways (routers/firewalls) protect traffic flowing between entire networks. It's also used for remote access VPNs.

Key Differences

  • Transport mode preserves the original IP addresses and is more efficient (less overhead), but both endpoints must support IPsec
  • Tunnel mode hides the original source/destination, allows gateway-based deployment, and supports routing through intermediate networks

Key Takeaway: Transport mode protects payload between endpoints; tunnel mode encapsulates entire packets between gateways, making it ideal for VPN infrastructure.