4.1 Enhanced GRE header

The GRE header used in PPTP is enhanced slightly from that specified in the current GRE protocol specification [1,2].  The main difference involves the definition of a new Acknowledgment Number field, used to determine if a particular GRE packet or set of packets has arrived at the remote end of the tunnel.  This Acknowledgment capability is not used in conjunction with any retransmission of user data packets.  It is used instead to determine the rate at which user data packets are to be transmitted over the tunnel for a given user session.

The format of the enhanced GRE header is as follows:

       0                   1                   2                   3

       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      |C|R|K|S|s|Recur|A| Flags | Ver |         Protocol Type         |

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      |    Key (HW) Payload Length    |       Key (LW) Call ID        |

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      |                  Sequence Number (Optional)                   |

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

      |               Acknowledgment Number (Optional)                |

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

C(Bit 0) Checksum Present.  Set to zero (0).

R(Bit 1) Routing Present.  Set to zero (0).

K(Bit 2) Key Present.  Set to one (1).

S(Bit 3) Sequence Number Present.  Set to one (1) if a payload (data) packet is present.  Set to zero (0) if payload is not present (GRE packet is an Acknowledgment only).

S(Bit 4) Strict source route present.  Set to zero (0).

Recur(Bits 5-7) Recursion control.  Set to zero (0).

A(Bit 8) Acknowledgment sequence number present.  Set to one (1) if packet contains Acknowledgment Number to be used for acknowledging previously transmitted data.

Flags(Bits 9-12) Must be set to zero (0).

Ver(Bits 13-15) Must contain 1 (enhanced GRE).

Protocol TypeSet to hex 880B [8].

KeyUse of the Key field is up to the implementation. PPTP uses it as follows:

Payload Length

(High 2 octets of Key) Size of the payload, not including the GRE header

Call ID

(Low 2 octets) Contains the Peer's Call ID for the session to which this packet belongs.

Sequence NumberContains the sequence number of the payload.  Present if S bit (Bit 3) is one (1).

Acknowledgment NumberContains the sequence number of the highest numbered GRE packet received by the sending peer for this user session. Present if A bit (Bit 8) is one (1).

The payload section contains a PPP data packet without any media specific framing elements.

The sequence numbers involved are per packet sequence numbers.  The sequence number for each user session is set to zero at session startup.  Each packet sent for a given user session which contains a payload (and has the S bit (Bit 3) set to one) is assigned the next consecutive sequence number for that session.

This protocol allows acknowledgments to be carried with the data and makes the overall protocol more efficient, which in turn requires less buffering of packets.