中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

GRE: Generic Routing Encapsulation

Generic Routing Encapsulation is a protocol for encapsulation of an arbitrary network layer protocol over another arbitrary network layer protocol.

In the most general case, a system has a packet that needs to be encapsulated and delivered to some destination, which is called payload . The payload is first encapsulated in a GRE packet. The resulting GRE packet can then be encapsulated in some other protocol and then forwarded. This outer protocol is called the delivery protocol.

When IPv4 is being carried as the GRE payload, the Protocol Type field MUST be set to 0x800. When a tunnel endpoint decapsulates a GRE packet which has an IPv4 packet as the payload, the destination address in the IPv4 payload packet header must be used to forward the packet and the TTL of the payload packet MUST be decremented. Care should be taken when forwarding such a packet, since if the destination address of the payload packet is the encapsulator of the packet (i.e., the other end of the tunnel), looping can occur. In this case, the packet must be discarded. The IPv4 protocol 47 [is used when GRE packets are encapsulated in IPv4.

Security in a network using GRE should be relatively similar to security in a normal IPv4 network, as routing using GRE follows the same routing that IPv4 uses natively. Route filtering will remain unchanged. However packet filtering requires either that a firewall look inside the GRE packet or that the filtering is done on the GRE tunnel endpoints. In those environments in which this is considered to be a security issue it may be desirable to terminate the tunnel at the firewall.

Protocol Structure

In DiffServ, a replacement header field, called the DS field, is defined, which is intended to supersede the existing definitions of the IPv4 TOS octet and the IPv6 Traffic Class octet. The format of the header as follows:

1 13 16 32
C Reserved0 Ver Protocol type
Checksum (optinal) Reserved
  • C - Checksum Present.
  • Reserved 0 & 1 - reserved fpr future use.
  • Ver - version number; must be zero.
  • Protocol Type - contains the protocol type of the payload packet.
  • Checksum - contains the IP checksum sum of the all the 16 bit words in the GRE header and the payload packet.

Related protocols: IPv4

Sponsor Source: GRE is defined by IETF (http://www.ietf.org) in RFC 2784.

Reference: http://www.javvin.com/protocol/rfc2784.pdf: Generic Routing Encapsulation (GRE).

Reply

The content of this field is kept private and will not be shown publicly.
  • Use <!--pagebreak--> to create page breaks.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <!--pagebreak--> <img> <br> <table> <tr> <td> <tbody> <p>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 17 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.