344 
As shown in Figure 134, an IPv6 protocol packet traverses an IPv4 network through a GRE tunnel as 
follows: 
1.  After receiving an IPv6 packet from the interface connected to IPv6 network 1, Device A 
processes the packet as follows: 
a.  Looks up the routing table to identify the outgoing interface for the IPv6 packet. 
b.  Submits the IPv6 packet to the outgoing interface—the GRE tunnel interface Tunnel 0. 
2.  Upon receiving the packet, the tunnel interface encapsulates the packet with GRE and then 
with IPv4. In the IPv4 header: 
{  The source address is the tunnel's source address (the IP address of interface 
GigabitEthernet 1/0/1 of Device A). 
{  The destination address is the tunnel's destination address (the IP address of interface 
GigabitEthernet 1/0/1 of Device B). 
3.  Device A looks up the routing table according to the destination address in the IPv4 header, and 
forwards the IPv4 packet out of the physical interface (GigabitEthernet 1/0/1) of the GRE tunnel. 
4.  When the IPv4 arrives at the GRE tunnel destination Device B, Device B checks the destination 
address. Because the destination is Device B itself and the protocol number in the IP header is 
47 (the protocol number for GRE), Device B submits the packet to GRE for de-encapsulation. 
5.  GRE first removes the IPv4 header, and then checks the GRE key, checksum, and packet 
sequence number. After GRE finishes the checking, it removes the GRE header, and submits 
the payload to the IPv6 protocol for forwarding. 
 
 
NOTE: 
GRE encapsulation and de-encapsulation can decrease the forwarding efficiency of tunnel-end 
devices. 
 
GRE security mechanisms 
GRE supports the following security mechanisms: 
• GRE key—Ensures packet validity. The sender adds a GRE key into a packet. The receiver 
compares the GRE key with its own GRE key. If the two keys are the same, the receiver accepts 
the packet. If the two keys are different, the receiver drops the packet. 
• GRE checksum—Ensures packet integrity. The sender calculates a checksum for the GRE 
header and payload and sends the packet containing the checksum to the tunnel peer. The 
receiver calculates a checksum for the received packet and compares it with that carried in the 
packet. If the checksums are the same, the receiver considers the packet intact and continues 
to process the packet. If the checksums are different, the receiver discards the packet. 
GRE application scenarios 
The following shows typical GRE application scenarios: