What's the difference between GRE and IPsec tunnels? | TechTarget (2024)

What's the difference between GRE and IPsec tunnels? | TechTarget (1)

Edelweiss - Fotolia

IPsec provides more comprehensive security for IP tunneling, while GRE tunnels work well when network teams need to tunnel with multiple protocols or multicast.

What's the difference between GRE and IPsec tunnels? | TechTarget (2)

By

Generic Routing Encapsulation, or GRE, and IPsec both encase packets, but the two protocols have different requirements...

Continue Reading This Article

Enjoy this article as well as all of our content, including E-Guides, news, tips and more.

Step 2 of 2:

"}
  • You forgot to provide an Email Address.

    This email address doesn’t appear to be valid.

    This email address is already registered. Please log in.

    You have exceeded the maximum character limit.

    Please provide a Corporate Email Address.

    Please check the box if you want to proceed.

    Please check the box if you want to proceed.

  • when it comes to security, data privacy and encryption.

    Let's explore each protocol and discuss the best use cases for each method of tunneling.

    Generic Routing Encapsulation (GRE)

    GRE, defined by RFC (Request for Comments) 2784 and updated by RFC 2890, creates an unencrypted tunnel that encapsulates an arbitrary protocol over another arbitrary network layer protocol. It can encapsulate any Layer 3 protocol that uses a valid Ethertype, enabling it to transport a variety of protocols, including IP multicast packets. GRE is best used over a trusted network path because the packets aren't encrypted, but it can be combined with an IPsec tunnel if encryption is required.

    GRE headers are added to the packet that is being forwarded. The outer and inner headers are frequently IP headers but may be other Layer 3 protocols.

    A GRE header can be between 4 bytes and 16 bytes long, depending on which options are enabled, with a default of 4 bytes. When used over IP, the minimum additional overhead is 24 bytes -- 20 bytes of IP outer header and 4 bytes of GRE header.

    What's the difference between GRE and IPsec tunnels? | TechTarget (3)

    IP in IP, a similar protocol, only tunnels IP packets over IP networks and adds 20 bytes of encapsulating IP header.

    IPsec

    IPsec, summarized in RFC 6071, is a suite of protocols that creates an encrypted tunnel over an IP network. Its encryption and authentication mechanisms prevent eavesdropping and data modification, which explains the term virtual private network (VPN). IPsec tunnels are frequently used to provide a secure data path between an organization's branches or mobile users and the home office or data center. VPN tunnel terminations can be network gateways at branches or home devices.

    What's the difference between GRE and IPsec tunnels? | TechTarget (4)

    The IPsec encapsulation header size depends on the mode; it's typically 50 bytes to 57 bytes, depending on the padding that is needed to create packets that are a multiple of 8 bytes.

    Common characteristics between GRE and IPsec

    GRE and IPsec protocols share some similar characteristics, including the following:

    Teams can combine GRE on top of IPsec when they need GRE's multiprotocol functionality combined with IPsec's data protection.
    • Single virtual hop. A GRE tunnel and IPsec tunnel each appears as a single virtual hop, even though it may traverse many links between the tunnel endpoints.
    • Increased packet size. The additional headers for both protocols increase the packet size, which can cause packet fragmentation that degrades network performance. Modern OSes use TCP Path Maximum Transmission Unit Discovery (PMTUD) to automatically determine the largest packet. However, PMTUD doesn't work for User Datagram Protocol. The alternative is to manually configure the MTU on the network so IP fragmentation occurs outside the tunnel.
    • Increased overhead when combined. IT teams can securely tunnel non-IP or multicast packets by configuring a GRE tunnel over an IPsec tunnel. The overhead increases when both protocols are used in combination.

    When to use GRE vs. IPsec

    IT teams should use IPsec when they require secure IP tunneling. They should use GRE when they require tunneling without privacy and when they need to tunnel multiple protocols or multicast. Teams can combine GRE on top of IPsec when they need GRE's multiprotocol functionality combined with IPsec's data protection. Finally, keep in mind MTU issues when using tunnels.

    This was last published in July 2020

    Related Resources

    Dig Deeper on Network Infrastructure

    Related Q&A from Terry Slattery

    Network engineer vs. network administrator: What's the difference?

    The difference between a network engineer and network administrator is an engineer is focused on network design, while an administrator is more ...Continue Reading

    6 trends in corporate campus networks

    Networks are evolving, and that evolution includes enterprise campus networks. Trends like network automation, 5G and machine learning are ...Continue Reading

    Sometimes I get a message, 'specified port already open.' What does it mean?

    Find out what error messages 'the specified port is already open' or 'the specified port is already in use' mean, and learn how to troubleshoot and ...Continue Reading

    What's the difference between GRE and IPsec tunnels? | TechTarget (2024)
    Top Articles
    Latest Posts
    Article information

    Author: Duane Harber

    Last Updated:

    Views: 5352

    Rating: 4 / 5 (71 voted)

    Reviews: 86% of readers found this page helpful

    Author information

    Name: Duane Harber

    Birthday: 1999-10-17

    Address: Apt. 404 9899 Magnolia Roads, Port Royceville, ID 78186

    Phone: +186911129794335

    Job: Human Hospitality Planner

    Hobby: Listening to music, Orienteering, Knapping, Dance, Mountain biking, Fishing, Pottery

    Introduction: My name is Duane Harber, I am a modern, clever, handsome, fair, agreeable, inexpensive, beautiful person who loves writing and wants to share my knowledge and understanding with you.