5.4 Compression

Compression tools lower the bandwidth needed to transmit or forward packets. Payload compression compresses user data and headers, while header compression compresses just the headers.

Payload compression works well on the larger packets, while header compression is more suited for the smaller packets since headers make up a large portion of the packet. Compression hardware, like Compression Service Adapters (CSAs) proposed by Cisco, can be used to reduce the delay factor brought about by the compression algorithms.

The following considerations should be taken into account when selecting between compression tools:

  • Does the device located at the other side of the link support it? If two Cisco routers are used at each end of the link, this concern is eliminated.

  • The data link protocols supported

  • The compression algorithm used and its capabilities or effectiveness.

Cisco offers the following choices for payload compression tools on serial links:

  • Predictor uses the Predictor Public Domain compression algorithm. This algorithm uses less CPU than the algorithm employed by the other two payload compression tools. Predictor is supported on Point to Point Protocol (PPP), ATM using PPP and Link Access Procedure Balanced (LAPB)

  • Microsoft Point to Point Compression (MPPC): MPPC uses the Lempel-Ziv compression algorithm. This algorithm supplies a more enhanced compression ratio than the Predictor algorithm. MPPC is supported on Point to Point Protocol (PPP) and ATM using PPP

  • Stacker: This tool also uses the Lempel-Ziv compression algorithm. Stacker is supported on High Level Data Link Control (HDLC) and supports the most data link protocols. Stacker is also supported on Frame Relay, Point to Point Protocol (PPP), ATM using PPP, Link Access Procedure Balanced (LAPB) and X.25.

On Frame Relay VCs, additional compression tool choices exist for payload compression:

  • Packet by Packet (Cisco Proprietary)

  • Data Stream (Cisco Proprietary)

  • Frame Relay Forum Implementation Agreement 9 (FRF.9) is compatible with devices that are not Cisco devices.

Each tool uses the Stacker algorithm that is based on the Lempel-Ziv algorithm. However, with Data Stream and FRF.9, the compression dictionary produced by the algorithm is extended for all the packets on the VC. A compression dictionary is a table of short binary codes with their related string of bytes. The compression dictionary created for a packet is dropped in Packet by Packet compression.

Header compression works well for small packets. IP, TCP, UDP and RTP headers of the same flow do not differ significantly. Header compression can compress headers by using a relatively small volume of calculations. TCP header compression compresses the IP and TCP header from 40 bytes to among only 3 bytes to 5 bytes, while RTP header compression compresses the IP, UDP and RTP headers to only 2 bytes to 4 bytes. When the RTP header contains a UDP checksum, the header is compressed to 4 bytes. When the RTP header does not include the checksum, it is merely 2 bytes. RTP header compression is best suited for voice traffic. Voice traffic typically uses small packets.

The table below illustrates the bandwidth needs of different types of voice calls. It also shows the bandwidth requirement including and excluding Compressed RTP (cRTP). For each instance listed here, the payload bandwidth for the G.711 is 64 kbps and for the G.729, it is 8 kbps.

Bandwidth Requirements for Voice Calls with and without Compressed RTP

Codec

Layer 2

IP, UDP, RTP

Layer 2 Header

Total Bandwidth

Header Type

Header Size

Size

Requirement

G.711

Ethernet

40 bytes

14

85.6

G.711

MLPPP/FR

40 bytes

6

82.4

G.711

MLPPP/FR

2 bytes with cRTP

6

67.2

G.729

Ethernet

40 bytes

14

29.6

G.729

MLPPP/FR

40 bytes

6

26.4

G.729

MLPPP/FR

2 bytes with cRTP

6

11.2

5.4.1 Configuring Payload Compression, and TCP and RTP Header Compression

Configuring payload compression is fairly simple. Compression should be enabled on each end of a point to point serial link by using the compress command. With Frame Relay, compression should be enabled on each end of a Frame Relay VC using the frame-relay payload-compression command.

The following commands are relevant for configuring payload compression:

  • compress stac: Used in interface config mode, this command enables Stacker compression

  • compress stac [distributed | software]: Used in interface config mode on the 7500 routers with Versatile Interface Processors (VIPs). This command specifies if the compression algorithm is run in software on the VIP.

  • compress predictor: Used in interface config mode, this command enables Predictor compression

  • compress mppc [ignore-pfc] : Used in interface config mode, this command enables MPPC compression.

  • compress {predictor | stac [csa slot | software ]}: Used in interface config mode on the 7200 routers. This command permits the condition of Predicator or Stacker compression on a Compression Service Adapter (CSA).

  • frame-relay payload-compress {packet-by-packet | frf9 stac [ hardware-options] | data-stream stac [hardware-options]}: This command, used in interface config mode, applies Data Stream or FRF.9 compression at a Frame Relay link.

  • show compress: This command can be used to view statistics on compression.

TCP and RTP header compression should be enabled at each end of a point to point link or Frame Relay VC. The frame-relay ip tcp or frame-relay ip rtp commands are used on point to point sub-interfaces, while the frame-relay map commands are used when using the physical interface or multipoint interfaces. The passive keyword used with these commands, implies that a router tries to carry out compression only when the router at the opposite end of the link / VC performs compression. passive makes it possible to deploy configuration on remote routers. The compression configuration is then appended on the local router when compression commences.

The following commands are relevant for configuring TCP and RTP header compression:

  • ip tcp header-compression [passive]: Used in interface config mode, this command enables TCP header compression

  • frame-relay ip tcp header-compression [passive]: Used in either interface ОГ sub-interface config mode, this command enables TCP header compression

  • ip rtp header-compression [passive]: Used in interface config mode, this command enables RTP header compression

  • frame-relay ip rtp header-compression [passive]: Used in either interface or sub-interface config mode, this command enables RTP header compression

  • frame-relay map ip ip-address dlci [broadcast] tcp header-compression [active | passive] [connections number]: Used in interface / sub-interface config mode, this command enables TCP header compression on the particular VC associated with the map command.

  • frame-relay map ip ip-address dlci [broadcast] rtp header-compression [active | passive] [connections number]: Used in interface / sub-interface config mode, this command enables RTP header compression on the particular VC associated with the map command.

  • show ip tcp header-compression: This command displays statistics on TCP header compression related to point to point links

  • show frame-relay ip tcp header-compression: This command displays statistics on TCP header compression

  • show ip rtp header-compression [type number] [detail]: This command displays statistics on RTP header compression related to point to point links

  • show frame-relay ip rtp header-compression [interface type number]: This command displays statistics on RTP header compression