background image
314 Chapter 10: Managing Network Performance with Queuing and Compression
Link Compression
Link compression (also known as per-interface compression) is the compression of the entire
transported entity. In other words, it compresses the header and the payload.
Link compression is not dependent on any particular protocol function. Cisco supports two
algorithms on its router chassis to compress traffic: STAC and Predictor. For HDLC links,
STAC is the only available choice.
For data transmission over point-to-point dedicated connections, use link compression. In link
compression, the complete packet is compressed and any header information specific to WAN
switching technologies is not available to the network.
STAC
You might remember that a few years ago, a company known as STAC electronics successfully
sued Microsoft for illegal use of a disk compression utility. That utility was DoubleSpace, and
it was initially included with DOS 5.0. After the lawsuit, Microsoft altered the algorithm,
purchased a substantial stake in STAC Electronics, and released the DriveSpace compression
utility. That same STAC electronics provides the STAC compression algorithm for Cisco
routers. (The algorithm is also known as stacker.) Fortunately, Cisco legally utilizes the
algorithm.
STAC is based on an algorithm known as Lempel-Ziv (LZ), which searches the data stream for
redundant strings and replaces them with a token. The token is an information pointer that is
significantly shorter than the string it replaces. If LZ cannot find any duplicated strings in the
data, no compression occurs and transmission occurs as if the link had no compression
activated.
There are cases, such as the sending of encrypted data, in which compression actually expands
the size of a transmission. In such cases, the original transmission is sent untouched. The STAC
compression algorithm tends to be quite CPU-intensive and should not be implemented on
routers with an already high CPU utilization.
Predictor
The Predictor compression method is rightly named. This Cisco-proprietary algorithm attempts
to predict the coming character sequences by an implementing and indexing system that is
based on a compression dictionary. It is essentially a code book that is based on possible data
sequences. If a character string can be found that matches an entry in the dictionary, the string
is replaced with the entry from the dictionary. That entry comprises a much shorter sequence of
characters. At the remote end, the characters are compared to the data dictionary once again to
be decoded. The strings are looked up and replaced with the appropriate information.