Share via


3.2.5.1.1 Setting the Compression Flags

The sender MUST always specify the compression flags associated with a compressed payload. These flags MUST be set in the flags field in the compression packet header.

The compression flags are produced by performing a logical OR of the values in PACKET_FLUSHED, PACKET_AT_FRONT, and PACKET_COMPRESSED.

PACKET_FLUSHED: Indicates that the history buffer MUST be reinitialized. This value corresponds to the MPPC protocol bit A, as specified in [RFC2118] section 3.1. This flag MUST be set without setting any other flags.

This flag MUST be set if the compression generates an expansion of the data and the flag indicates to the decompressor that it needs to reset its history buffer, reset its HistoryOffset value, and then restart the reception of the next batch of compressed bytes. If this condition occurs, the data MUST be sent in uncompressed form.

PACKET_AT_FRONT: Indicates that the decompressed data MUST be placed at the beginning of the local history buffer. This value corresponds to the MPPC protocol bit B, as specified in [RFC2118] section 3.1. This flag MUST be set in conjunction with the PACKET_COMPRESSED (0x2) flag.

The following conditions on the compressor side generate this scenario:

§ This is the first packet to be compressed.

§ The data to be compressed will not fit at the end of the history buffer but, instead, needs to be placed at the start of the history buffer.

PACKET_COMPRESSED: Indicates that the data is compressed. This value corresponds to the MPPC protocol bit C, as specified in [RFC2118] section 3.1. This flag MUST be set when the data is compressed.

The following figure shows the general operation of the compressor and the production of the various flag values.

Compression flowchart

Figure 3: Compression flowchart