In this lesson,
we're going to cover Generic Routing Encapsulation.
Generic Routing Encapsulation,
more commonly referred to as GRE,
is a tunneling protocol used to encapsulate
a wide variety of network layer protocols
inside a virtual point-to-point link
over an Internet Protocol network.
GRE tunnels will operate at Layer 3
or the network layer of the OSI model,
and they're set up and configured
on your network's routers.
Now, why might we want to use Generic Routing Encapsulation
inside of our networks?
Well, many networks have to send and receive data
while using a wide variety of protocols and technologies.
Each of these will speak its own language
and has its own rules that it relies on.
So to keep everything operating smoothly,
we can opt to use Generic Routing Encapsulation
as a type of universal translator
that will allow all these different protocols
to communicate and traverse
over a shared network infrastructure.
This is especially useful
when we're connecting similar network topologies
over a different intermediate network.
In fact, that's the use case I personally have used GRE for
in my past work.
My organization had multiple branch offices
spread out across the country we were operating in.
We had our main offices in one city.
We had branch locations in other cities
all around the country,
and one such city was about 50 miles away.
Now, each of these offices does have its own network setup,
and they're operating smoothly within their own offices.
But we also wanted these offices to be able to communicate
back with each other and share resources
securely and efficiently over the internet.
But we didn't want to have to pay
for an expensive dedicated lease line
between those two locations.
So, instead, we purchased a local internet connection
for both locations,
and then we create a GRE tunnel between the two offices.
Essentially, we create a private and direct link
over a public internet connection
for our two branch offices.
Now, anytime users need to exchange data
between these two offices,
the data would simply be encapsulated and isolated
from the other traffic on the internet
by sending it through this GRE tunnel
to maintain the integrity and confidentiality
of our user's data.
In essence, GRE forms a protective bubble
around our data packets
that allows them to travel through the other network
without being interfered with
or being subject to prying eyes
that are trying to hurt the confidentiality of that data.
Now, you may be wondering,
"Why would we use a GRE tunnel
"instead of just using a site-to-site VPN
"for this type of configuration?"
Well, GRE is favored for its simplicity and efficiency
in encapsulating multiple protocol types,
and this makes it ideal
for connecting heterogeneous networks
like those of the two branch offices
on different sides of the city.
While A VPN could provide more robust security features,
a GRE tunnel can be used when the main objective
is to encapsulate protocols for tunneling
without the additional overhead created
by using those encryption techniques inside of a VPN.
This means GRE becomes a more lightweight solution
for our network data encapsulation
than it would be if we set up a full site-to-site VPN.
Now, in our specific use case,
we were already using
bulk network traffic encryption devices
to be able to encrypt our data
before we sent it over that GRE tunnel.
And this specialized hardware device was much faster
than using a traditional site-to-site VPN.
So GRE tunnels can be ideal
for some specific use cases like ours,
but other times you might just opt to use
a site-to-site VPN instead.
Or if you really want secure and encrypted communications
over untrusted networks like the internet,
you can also opt to combine GRE
with some kind of VPN technology
to provide you both the encapsulation from GRE
and the encryption from the VPN in your networks.
Now, it's important to note that GRE isn't just about
creating private tunnels though.
GRE is also a great tool
that provides us with the versatility and integration
by allowing different network protocols
to coexist and collaborate
if you're using heterogeneous network environments.
Generic Routing Encapsulation is not merely a bridge
between two points like a VPN would be,
but, instead, it also acts as a type of universal translator
to make seemingly incompatible network protocols
work together harmoniously.
So remember, the Generic Routing Encapsulation, or GRE,
is a tunneling protocol used to encapsulate
a wide variety of network layer protocols
inside of a virtual point-to-point link
over an Internet Protocol network.
Our GRE tunnels operate at Layer 3
or the network layer of the OSI model,
and they're set up and configured on your network's routers.
These GRE tunnels can also be used
to connect multiple branch office locations together
and provide a safe and secure tunneling mechanism
over a public network like the internet
for specific use cases.