What is Generic Routing Encapsulation (GRE)?
Generic Routing Encapsulation (GRE) technology developed by Cisco Systems is a tunneling protocol that enables a wide variety of protocols for the network layer to be encapsulated within virtual point-to-point connections over an Internet Protocol network. GRE is defined by RFC 2784 and, as a tunnel protocol, carries OSI layer 3 protocols in the network. GRE creates a private point-to-point connection, just like that of a virtual private network. Hence it is widely used in the creation of VPNs (with PPTP and IPsec). In contrast to IP-to-IP tunneling, GRE can carry IPv6 and multicast traffic between networks.
Generic routing encapsulation encapsulates a payload that is an inner packet to be delivered to a destination that is an outer IP packet. Endpoints that support GRE can send such routed encapsulated packets over IP networks.
The payload naturally encounters several routers that do not analyze the payload, but only the outer IP packet. Thus, in this way, the payload is forwarded to the endpoint that is the destination. When the payload reaches the GRE tunnel endpoint, the encapsulation is removed (decapsulation) and the inner packet is available.
GRE provides a connection that is both stateless and private. However, it is not considered a secure protocol as there is no encryption. An alternative in this regard would be a protocol like IPsec Encapsulation Security Payload.