Generic Routing Encapsulation (GRE) Tunnel - GeeksforGeeks (2024)

Skip to content

Generic Routing Encapsulation (GRE) Tunnel - GeeksforGeeks (1)

Last Updated : 12 Aug, 2020

Summarize

Comments

Improve

Suggest changes

Like Article

Like

Save

Report

Generic Routing Encapsulation is a method of encapsulation of IP packet in a GRE header which hides the original IP packet. Also a new header named delivery header is added above GRE header which contains new source and destination address.

GRE header act as new IP header with Delivery header containing new source and destination address. Only routers between which GRE is configured can decrypt and encrypt the GRE header. The original IP packet enters a router, travels in encrypted form and emerges out of another GRE configured router as original IP packet like they have travelled through a tunnel. Hence, this process is called GRE tunneling.

Routing Over GRE Tunnel :
The figure shown below is a part of any enterprise network. PC1 want to communicate with server. PC1 will send packets to server. Router R1 will forward the IP packet out of its Gi0/1 interface to R2’s Gi0/2 interface and packet will reach to its destination server(10.20.2.2). But When GRE is configured on the routers, then they use virtual interfaces called tunnel interfaces instead of normal router’s interface. This virtual interfaces uses new IP address other than originally configured router interface IP address. These new addresses are from company’s IP address pool list.

Generic Routing Encapsulation (GRE) Tunnel - GeeksforGeeks (3)

Figure – GRE Tunneling

After the GRE configuration on routers, when PC1 sends packet to server in subnet 10.20.2.0/24. The router R1 receive this IP packet, encapsulate the original IP packet in a GRE header, adds new tunnel interface IP address 10.40.20.1 as source address & 10.40.20.2 as destination address in Delivery header and sends it out of the tunnel interface (tunnel0).

GRE packet now travel through path in network defined by various routing protocols and reaches R2’s tunnel interface(tunnel 1). R2 upon receiving the GRE packet, decrypt the packet i.e, removes delivery and GRE header. R2 now forwards the IP packet according to original destination address to the server. Also IP routing table of GRE enabled router get changed and contains information as shown in figure.

Generic Routing Encapsulation (GRE) Tunnel - GeeksforGeeks (4)

Figure – GRE Tunneling



Please Login to comment...

Similar Reads

What is Data Encapsulation and de-encapsulation in networking?

This article is all about Data Encapsulation and Decapsulation in Networking. Both encapsulation and decapsulation processes are simultaneously running over a network in order to make effective communication possible. Encapsulation is the process which is executed on the sender's side whereas decapsulation occurs on the receiver's side. Now, let's

3 min read

How Data Encapsulation and De-encapsulation Works?

Data encapsulation and de-encapsulation are fundamental concepts in computer networking and communication protocols. These processes are essential for transferring data across networks efficiently and securely. What is Data Encapsulation?Encapsulation is the process of adding additional information when data is traveling in an OSI or TCP/IP model.

4 min read

What is Routing Loop and How to Avoid Routing Loop?

Routing is a procedure that helps the packet choose an optimal path to reach its destination as soon as possible. For example, a device can be a router, which is used to handle traffic within networks. Optimal network routing methods help maintain your network operating efficiently at help in some ways i.e. faster data access and preventing overloa

3 min read

Unicast Routing - Link State Routing

Prerequisite: Distance Vector Routing, Dijkstra algorithm Unicast means the transmission from a single sender to a single receiver. It is a point-to-point communication between the sender and receiver. There are various unicast protocols such as TCP, HTTP, etc. TCP is the most commonly used unicast protocol. It is a connection-oriented protocol tha

6 min read

Difference between Distance vector routing and Link State routing

Routing, a process in computer networks, is responsible for the best path to transmit data packets from one node to another, Distance Vector Routing and Link State Routing are two of the most prominent dynamic routing algorithms, they each have their own procedures for calculating routes and disseminating information about those routes throughout a

4 min read

Difference Between Classful Routing and Classless Routing

Classful and classless routing are two different ways through which the IP addresses are managed and structured in a network. Classful Routing is an older approach whereby the IP addresses are divided by fixed classes such as A, B, C, and the rest all with a preset mask. This way, the subnet mask information is not carried in routing updates and it

5 min read

What is an IPsec Tunnel?

IPsec might be a gaggle of protocols that square measure used along to line up encrypted connections between devices. It helps keep knowledge sent over public networks securely. IPsec is typically accustomed-based VPNs, and it works by encrypting scientific discipline packets, at the side of authenticating the supply wherever the packets return fro

5 min read

What is IPv6 Intra Site Automatic Tunnel Addressing Protocol (ISATAP)?

ISATAP is a routable tunneling protocol developed by the IETF as an extension to IPv6, used in scenarios where no other encapsulation is available. It uses IPv4 to transmit data packets over the network. IPv6 Intra Site Automatic Tunnel Addressing Protocol (ISATAP): It is a tunneling protocol that was developed as an extension to IPv6 by the IETF a

2 min read

5 min read

How to Check the Status of the Tunnel’s Phase 1 and 2?

Answer: Use the command `show crypto isakmp sa` for Phase 1 and `show crypto ipsec sa` for Phase 2 to check the status of the tunnel's phases on a Cisco device.Checking the status of an IPSec VPN tunnel involves two phases, Phase 1 (IKE or ISAKMP) and Phase 2 (IPSec). Check Phase 1 StatusUse the command `show crypto isakmp sa` on a Cisco device. Th

1 min read

Point-to-Point Protocol (PPP) Encapsulation

Point-to-Point Protocol (PPP) is basically a Wide Area Network (WAN) protocol that performs or works at layer 2 by simply encapsulating frames for transmission or transferring over different physical links or connections like serial cables, cell phones, fiber optic cable among others, etc. Encapsulation is basically a process in which lower-layer p

3 min read

IP-in-IP Encapsulation

In this article, we will discuss the overview of IP-in-IP Encapsulation and then will discuss the working and its process of encapsulation, and then finally conclude and will discuss the Logical and Physical views of the IP-in-IP encapsulation process. Let's discuss it one by one. Encapsulation :In simple terminology, Encapsulation is basically the

4 min read

High-Level Data Link Control (HDLC) Encapsulation

High-Level Data Link Control (HDLC) basically provides reliable delivery of data frames over a network or communication link. HDLC provides various operations such as framing, data transparency, error detection, and correction, and even flow control. Primary stations simply transmit commands that contain address of secondary stations. The secondary

4 min read

Difference between encapsulation and decapsulation

In data communication there are two concept involves in transmission namely encapsulation and decapsulation. Encapsulation adds addition information to a send packet as it travels to its destination,and Decapsulation is the reverse process of encapsulation, So a receiver node can read the original send data/information. This article will make you a

5 min read

Fixed and Flooding Routing algorithms

In most situations, packets require multiple hops to make a journey towards the destination. Routing is one of the most complex and crucial aspects of packet-switched network design. Desirable Properties of Routing Algorithms:- Correctness and SimplicityRobustness: Ability of the network to deliver packets via some route even in the face of failure

5 min read

Difference between Transparent Bridge and Source Routing Bridge

Bridge is a device that is attached to connect two or more LANs to create continued LAN. A bridge works at data link layer of the OSI reference model. Transparent Bridge: Transparent bridge automatically maintains a routing table and update table in response to maintain changing topology. Transparent bridge mechanism consists of three mechanisms: 1

5 min read

Probabilistic shortest path routing algorithm for optical networks

Data transfer operations is a crucial aspect in case of networking and routing. So efficient data transfer operations is a must need, with minimum hardware cost (Optical Cables, WDM Network components, Decoders, Multiplexers) and also in the minimum time possible. Thus, the need is to propose an algorithm that finds the shortest path between two no

5 min read

Inter VLAN Routing by Layer 3 Switch

Prerequisite - Access and trunk ports Normally, Routers are used to divide the broadcast domain and switches (at layer 2) Operate in a single broadcast domain but Switches can also divide the broadcast domain by using the concept of VLAN (Virtual LAN). VLAN is the logical grouping of devices in the same or different broadcast domains. By default, a

5 min read

Features of Enhanced Interior Gateway Routing Protocol (EIGRP)

Enhanced Interior Gateway Routing Protocol (EIGRP) is a Cisco-proprietary Hybrid routing protocol that contains features of distance-vector and link-state routing protocols. It is a network layer protocol that works on protocol number 88. Some of its features are: Rapid convergence - EIGRP uses a DUAL algorithm to support rapid convergence. If a ro

4 min read

Routing Information Protocol (RIP)

Routing Information Protocol (RIP) is a dynamic routing protocol that uses hop count as a routing metric to find the best path between the source and the destination network. It is a distance-vector routing protocol that has an AD value of 120 and works on the Network layer of the OSI model. RIP uses port number 520. Hop Count Hop count is the numb

6 min read

Securing Routing Protocols

Prerequisite - Routing Information Protocol (RIP), EIGRP fundamentals, OSPF protocol fundamentals Routing is a process in which a layer 3 device (either router or layer 3 switch) finds the best path between the source and destination network. Dynamic routing protocols are used to decrease administrator overhead, i.e., administrator have to configur

5 min read

Routing Information Protocol (RIP) V1 & V2

Routing Information Protocol (RIP) protocol are the intradomain (interior) routing protocol which is based on distance vector routing and it is used inside an autonomous system.Routers and network links are called node. The first column of routing table is destination address. The cost of metric in this protocol is hop count which is number of netw

4 min read

IGRP Routing Protocol

In a host network, the Interior Gateway Routing Protocol (IGRP) is a proprietary distance vector routing protocol that is used to exchange routing information. Cisco was the one who came up with the idea. The Interior Gateway Routing Protocol (IGRP) regulates the transfer of routing information among linked routers in the host network or autonomous

5 min read

Differences between Intradomain and Interdomain Routing

In this section, we shall discuss how Intra-domain Routing is different from Inter-domain Routing. Intra domain is any protocol in which Routing algorithm works only within domains on the other hand Inter domain is any protocol in which Routing algorithm works within and between domains. Let us see the differences between Intradomain and Interdomai

1 min read

Routing Tables in Computer Network

Routers: A Router is a networking device that forwards data packets between computer network. This device is usually connected to two or more different networks. When a data packet comes to a router port, the router reads address information in packet to determine out which port the packet will be sent. For example, a router provides you with the i

4 min read

MANET Routing Protocols

In Mobile Ad hoc Network (MANET), nodes do not know the topology of their network, instead they have to discover it by their own as the topology in the ad-hoc network is dynamic topology. The basic rules is that a new node whenever enters into an ad-hoc network, must announce its arrival and presence and should also listen to similar announcement b

5 min read

How does Multiprotocol Label Switching (MPLS) Routing work ?

Multiprotocol Label Switching (MPLS) is a traffic routing mechanism it has significant advantages over the traditional IP based routing mechanism, MPLS is used in telecommunication networking where it shapes the data packet transmission among the nodes. In traditional IP based routing, IP datagram packet is analyzed by the router and according to t

5 min read

Routing for Mobile Hosts

Millions of people use computers while on go, from the truly mobile situations with a wireless device in moving cars, to nomadic situations in which laptop computers are used in a series of a different location. We use the term mobile hosts to mean either category, as distinct from stationary hosts that never move. The mobile hosts introduce a new

3 min read

Trust Based Energy-Efficient and Secure Routing Protocols for IoT

There are many network designs and Internet of Things (IoT) models (devices) that are at work presently, but these lack either in terms of energy efficiency or aren’t optimized. To send information from source to destination node is most important task to be carried out in large scale and dynamic IoT environment. Thus, node may be repeated many tim

4 min read

Difference between Hierarchical and Flat routing protocol

1. Hierarchical Routing Protocol: Hierarchical Routing is the method of routing in networks that is based on hierarchical addressing. Most transmission control protocol, Internet protocol (TCPIP). Routing is based on two level of hierarchical routing in which IP address is divided into a network, person and a host person. Gateways use only the netw

3 min read

We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy

Generic Routing Encapsulation (GRE) Tunnel - GeeksforGeeks (7)

'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id, check: true }), success:function(result) { jQuery.ajax({ url: writeApiUrl + 'suggestions/auth/' + `${post_id}/`, type: "GET", dataType: 'json', xhrFields: { withCredentials: true }, success: function (result) { $('.spinner-loading-overlay:eq(0)').remove(); var commentArray = result; if(commentArray === null || commentArray.length === 0) { // when no reason is availaible then user will redirected directly make the improvment. // call to api create-improvement-post $('body').append('

'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id, }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); return; } var improvement_reason_html = ""; for(var comment of commentArray) { // loop creating improvement reason list markup var comment_id = comment['id']; var comment_text = comment['suggestion']; improvement_reason_html += `

${comment_text}

`; } $('.improvement-reasons_wrapper').html(improvement_reason_html); $('.improvement-bottom-btn').html("Create Improvement"); $('.improve-modal--improvement').hide(); $('.improvement-reason-modal').show(); }, error: function(e){ $('.spinner-loading-overlay:eq(0)').remove(); // stop loader when ajax failed; }, }); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ $('.improvement-reason-modal').hide(); } $('.improve-modal--improvement').show(); }); function loadScript(src, callback) { var script = document.createElement('script'); script.src = src; script.onload = callback; document.head.appendChild(script); } function suggestionCall() { var suggest_val = $.trim($("#suggestion-section-textarea").val()); var array_String= suggest_val.split(" ") var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(suggest_val.length <= 2000){ var payload = { "gfg_post_id" : `${post_id}`, "suggestion" : `

${suggest_val}

`, } if(!loginData || !loginData.isLoggedIn) // User is not logged in payload["g-recaptcha-token"] = gCaptchaToken jQuery.ajax({ type:'post', url: "https://apiwrite.geeksforgeeks.org/suggestions/auth/create/", xhrFields: { withCredentials: true }, crossDomain: true, contentType:'application/json', data: JSON.stringify(payload), success:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-section-textarea').val(""); jQuery('.suggest-bottom-btn').css("display","none"); // Update the modal content const modalSection = document.querySelector('.suggestion-modal-section'); modalSection.innerHTML = `

Thank You!

Your suggestions are valuable to us.

You can now also contribute to the GeeksforGeeks community by creating improvement and help your fellow geeks.

`; }, error:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Something went wrong."); jQuery('#suggestion-modal-alert').show(); error_msg = true; } }); } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Minimum 5 Words and Maximum Character limit is 2000."); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Enter atleast four words !"); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } if(error_msg){ setTimeout(() => { jQuery('#suggestion-section-textarea').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('

'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // load the captcha script and set the token loadScript('https://www.google.com/recaptcha/api.js?render=6LdMFNUZAAAAAIuRtzg0piOT-qXCbDF-iQiUi9KY',[], function() { setGoogleRecaptcha(); }); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('

'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.improvement-reason-modal').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); });

Generic Routing Encapsulation (GRE) Tunnel - GeeksforGeeks (2024)
Top Articles
Amazon Interview Tips From an ex-Hiring Managers
Can I use ChatGPT for my technical interview?
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Rev. Leonie Wyman

Last Updated:

Views: 6158

Rating: 4.9 / 5 (79 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Rev. Leonie Wyman

Birthday: 1993-07-01

Address: Suite 763 6272 Lang Bypass, New Xochitlport, VT 72704-3308

Phone: +22014484519944

Job: Banking Officer

Hobby: Sailing, Gaming, Basketball, Calligraphy, Mycology, Astronomy, Juggling

Introduction: My name is Rev. Leonie Wyman, I am a colorful, tasty, splendid, fair, witty, gorgeous, splendid person who loves writing and wants to share my knowledge and understanding with you.