3.4.1 GRE Encapsulation

Once a call is established, user data messages can be sent to carry the user data. This document details enhancements to the Generic Routing Encapsulation (GRE) protocol (RFC 1701 and 1702) for use in transporting PPTP packets. The enhanced GRE packet format (GRE v2) is depicted in Figure 4.


    +-----------------------------------------+
    |               Media Header              |
    +-----------------------------------------+
    |                IP Header                |
    +-----------------------------------------+
    |               GRE Header                |
    +-----------------------------------------+
    |             Payload  Packet             |
    +-----------------------------------------+

Figure 4. GRE v2 packet

The GRE v2 header has the following format when used as the PPTP data stream protocol:


                     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 (Opt)                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     Acknowledge Number (Opt)                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 5. GRE v2 packet

where:

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) is actually present, set to zero (0) if no payload is present (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): Acknowledge sequence number. Set to one (1) if packet contains acknowledgment sequence and is used for acknowledging previous data.

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

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

Protocol type (2 octets): Contains the assigned protocol ID for PPTP (see assigned numbers RFC).

Key (4 octets): Use of the Key field is up to the implementation. We propose using it as two fields:

Payload Length (2 octets): Size of payload.

Call ID (2 octets): Contains the peer's call ID.

Sequence number (4 octets): Contains the sequence number of the payload. Present if S bit (Bit 3) is one (1).

Acknowledgment number (4 octets): Contains the acknowledgment number. Present if A bit (Bit 8) is one (1).

The payload sections contain the PPTP payload, which is essentially a PPP packet without the media-specific framing elements.

The proposed solution requires a GRE v2 header and can be used directly over IP. Since the header size is variable in length, it makes the protocol overhead efficient. The maximum total header size at any given time would be 36 (20 IP + 16 GREv2 = 36), if both data and acknowledgments were carried within the packet.

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.

This solution is backward-compatible with GRE v1.