Security

What's the difference between GRE and IPsec tunnels?



Q

Get started
Bring yourself up to speed with our introductory content.





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


In this Q&A, our expert explains the difference between Generic Routing Encapsulation (GRE) and IP Security (IPsec),…

“;
}
});

/**
* remove unnecessary class from ul
*/
$(“#inlineregform”).find( “ul” ).removeClass(“default-list”);

/**
* Replace “errorMessageInput” class with “sign-up-error-msg” class
*/
function renameErrorMsgClass() {
$(“.errorMessageInput”).each(function() {
if ($(this).hasClass(“hidden”)) {
$(this).removeClass(“errorMessageInput hidden”).addClass(“sign-up-error-msg hidden”);
} else {
$(this).removeClass(“errorMessageInput”).addClass(“sign-up-error-msg”);
}
});
}

/**
* when validation function is called, replace “errorMessageInput” with “sign-up-error-msg”
* before return
*/
function validateThis(v, form) {
var validateReturn = urValidation.validate(v, form);
renameErrorMsgClass();
return validateReturn;
}

/**
* DoC pop-up window js – included in moScripts.js which is not included in responsive page
*/
$(“#inlineRegistration”).on(“click”,”a.consentWindow”, function(e) {
window.open(this.href, “Consent”, “width=500,height=600,scrollbars=1”);
e.preventDefault();
});

pointing out that while both encapsulate packets, an IPsec tunnel offers significant security benefits and should be used where data privacy is required.

QUESTION: What is the difference between a GRE tunnel and IPsec tunnel?

Generic Routing Encapsulation (GRE), defined by RFC 2784, is a simple IP packet encapsulation protocol. A GRE tunnel is used when IP packets need to be sent from one network to another, without being parsed or treated like IP packets by any intervening routers.

For example, in Mobile IP, a mobile node registers with a Home Agent. When the mobile node roams to a new network, it registers with a Foreign Agent there. Whenever IP packets addressed to the mobile node are received by the Home Agent, they can be relayed over a GRE tunnel to the Foreign Agent for delivery. It does not matter how the Home Agent and Foreign Agent communicate with each other — hops in between just pass along the GRE packet. Only the GRE tunnel endpoints — the two Agents — actually route the encapsulated IP packet.

The IP Security (IPsec) Encapsulating Security Payload (ESP), defined by RFC 2406, also encapsulates IP packets. However, it does so for a different reason: to secure the encapsulated payload using encryption. IPsec ESP is used when IP packets need to be exchanged between two systems while being protected against eavesdropping or modification along the way.

For example, in a site-to-site VPN, a source host in network “A” transmits an IP packet. When that packet reaches the edge of network “A,” it hits a VPN gateway. VPN gateway “A” encrypts the private IP packet and relays it over an ESP tunnel to a peer VPN gateway at the edge of network “B.” VPN gateway “B” then decrypts the packet and delivers it to the destination host. Like GRE, it doesn’t really matter how the two VPN gateways communicate with each other — hops in between just pass along the ESP packet. But unlike GRE, someone at those hops could not possibly look at or change the encapsulated IP packet, even if they wanted to. That’s because cryptographic algorithms have been applied to scramble the IP packet and detect any modification or replay.

In summary, use a GRE tunnel where IP tunneling without privacy is required — it’s simpler and thus faster. But use IPsec ESP where IP tunneling and data privacy are required — it provides security features that are not even attempted by GRE.


This was last published in January 2009


Dig Deeper on Network protocols and standards





Source link

Tags

About the author

GG

Add Comment

Click here to post a comment

Your email address will not be published. Required fields are marked *

Do NOT follow this link or you will be banned from the site!