Document ID: 14157
Contents
Introduction
Prerequisites
Requirements
Components Used
Conventions
Background Information
Sample Output
Software Compression
Uncompressed Bytes
Compressed Bytes
Throughput Ratio
Buffer Allocation
Restarts
Bytes Transmitted
Bytes Received
Interpret the show compress Output
NetPro Discussion Forums - Featured Conversations
Related Information
Introduction
The show compress command (in user EXEC or privileged EXEC mode) is used to display compression statistics. This document provides an introduction to the show compress command, and explains how to interpret the output generated by it.
Prerequisites
Requirements
Readers of this document should have knowledge of these topics:
-
Cisco IOS Data Compression
For more information, refer to Understanding Data Compression.
Components Used
This document is not restricted to specific software and hardware versions. However, routers that run Cisco IOSĀ® Software release 12.2(10b) have been already configured with Stac compression in this document. The compress stac command is used under the interface configuration mode to accomplish this.
Conventions
For more information on document conventions, refer to the Cisco Technical Tips Conventions.
Background Information
Compression is a link efficiency mechanism, which can be used to reduce the size of the payload and packet headers. This creates more bandwidth on a given link. You can perform compression either in software, or through hardware compression modules.
Cisco IOS supports Stacker, Predictor and MPPC algorithms at link layer for payload compression. Each algorithm differs in the utilization of router resources required, and in their compression efficiency.
Sample Output
Here is a sample output of the show compress command:
router1#show compress
Serial2
Software compression enabled
uncompressed bytes xmt/rcv 81951/85500
compressed bytes xmt/rcv 0/0
1 min avg ratio xmt/rcv 0.789/0.837
5 min avg ratio xmt/rcv 0.789/0.837
10 min avg ratio xmt/rcv 0.789/0.837
no bufs xmt 0 no bufs rcv 0
restarts 0
Additional Stacker Stats:
Transmit bytes: Uncompressed = 28049 Compressed = 65745
Received bytes: Compressed = 74738 Uncompressed =0
These sections explain this sample output.
Software Compression
After the serial number, the first line in the output displays "Software compression enabled".
This line indicates that compression is configured.
Note: Software compression makes heavy demands on the processor of the router. The maximum compressed serial line rate depends on the type of Cisco router you use, and the compression algorithm you specify.
Uncompressed Bytes
uncompressed bytes xmt/rcv 81951/85500
This line in the output provides a count of uncompressed bytes of the compressed data. It does not include packets that cannot be compressed.
Compressed Bytes
compressed bytes xmt/rcv 0/0
This line gives the total number of already compressed bytes that are sent or received.
Throughput Ratio
The next section of output indicates a ratio of the data throughput gained or lost in the compression routine. Any number less than one indicates that the compression actually slows down data throughput. It does not reflect how compressible the data is.
1 min avg ratio xmt/rcv 0.789/0.837 5 min avg ratio xmt/rcv 0.789/0.837 10 min avg ratio xmt/rcv 0.789/0.837
Here are the common causes of poor compression ratios:
-
High CPU utilization.
-
A high percentage of small packets.
-
Data that is not very redundant (for instance, if it has already been compressed).
Buffer Allocation
no bufs xmt 0 no bufs rcv 0
This line indicates the number of times the compression routine was not able to allocate a buffer to compress or decompress a packet.
Restarts
restarts 0
This represents the number of times the compression routine detected that the dictionaries were out of sync and restarted to build a dictionary. Line errors are a common cause of restarts.
Bytes Transmitted
Transmit bytes: Uncompressed = 28049 Compressed= 65745
Here:
-
The uncompressed value is the amount of data that cannot be compressed, and has been sent in uncompressed format.
-
The compressed value represents the byte-count of the data after it is compressed.
The sum of these two values represents the actual number bytes transmitted on the interface, minus the layer two encapsulation overhead.
Bytes Received
Received bytes: Compressed = 74738 Uncompressed= 0
Here:
-
The compressed value is the byte-count of the compressed data received.
-
The uncompressed value is the amount of data that was received in uncompressed format.
The sum of these two values represents the actual byte count received on the interface, minus the layer two encapsulation overhead.
Interpret the show compress Output
From this output, you can calculate:
-
The total amount of data to be transmitted before you apply the compression routine:
81951 + 28049 = 110000
-
The total amount of data to be transmitted after you compress it:
28049 + 65745 = 93794
-
The overall data compression:
110000 / 93794 = 1.17
-
The compression ratio of the compressed packets:
81951 / 65745 = 1.24
Use this formula to calculate the total amount of output in bytes:
Input data + (Number of packets x HDLC encapsulation overhead)= Interface total
93794 + (2500 x 4) = 103794
In order to confirm this calculation, look at this show interface output:
router1#show interface s 2
Serial2 is up, line protocol is up
Hardware is HD64570
Internet address is 10.10.10.1 255.255.255.0
MTU 1500 bytes, BW 56 Kbit, DLY 20000 usec, rely 255/255, load1/25
Encapsulation HDLC, loopback not set
Keepalive set (10 sec)
Last input 0:02:03, output 0:02:03, output hang never
Last clearing of "show interface" counters 0:02:35
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Output queue: 0/64/0 (size/threshold/drops)
Conversations 0/1 (active/max active)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
2500 packets input, 102038 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
2500 packets output, 103794 bytes,0 underruns
0 output errors, 0 collisions, 0 interface resets, 0 restarts
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
This output indicates that the total bytes output is 103794, which validates the calculation.
You can also examine one packet at a time. For example, if you send one 32-byte packet:
router1#show compress
Serial2
Software compression enabled
uncompressed bytes xmt/rcv 0/0
compressed bytes xmt/rcv 0/0
1 min avg ratio xmt/rcv 0.000/0.000
5 min avg ratio xmt/rcv 0.000/0.000
10 min avg ratio xmt/rcv 0.000/0.000
no bufs xmt 0 no bufs rcv 0
restarts 0
Additional Stacker Stats:
Transmit bytes: Uncompressed = 32 Compressed = 0
Received bytes: Compressed = 0 Uncompressed = 0
router1#show interface s 2
Serial2 is up, line protocol is up
Hardware is HD64570
Internet address is 10.10.10.1 255.255.255.0
MTU 1500 bytes, BW 56 Kbit, DLY 20000 usec, rely 255/255, load1/255
Encapsulation HDLC, loopback not set
Keepalive set (10 sec)
Last input 0:00:50, output 0:00:50, output hang never
Last clearing of "show interface" counters 0:08:48
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Output queue: 0/64/0 (size/threshold/drops)
Conversations 0/1 (active/max active)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
1 packets input, 36 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
1 packets output, 36 bytes, 0underruns
0 output errors, 0 collisions, 0 interface resets, 0 restarts
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
Now try to send one 100-byte packet:
router1#show compress
Serial2
Software compression enabled uncompressed bytes xmt/rcv 100/100
compressed bytes xmt/rcv 0/0
1 min avg ratio xmt/rcv 2.272/2.325
5 min avg ratio xmt/rcv 1.250/1.265
10 min avg ratio xmt/rcv 1.250/1.265
no bufs xmt 0 no bufs rcv 0
restarts 0
Additional Stacker Stats:
Transmit bytes: Uncompressed = 32 Compressed = 40
Received bytes: Compressed = 43 Uncompressed =0
Use the results to compute the number of packets and bytes:
(32 + 40) + (2 x 4) = 80
The results of this calculation (that is, two packets output and 80 bytes) match the output of the show interface command:
router1#show interface s 2
Serial2 is up, line protocol is up
Hardware is HD64570
Internet address is 10.10.10.1 255.255.255.0
MTU 1500 bytes, BW 56 Kbit, DLY 20000 usec, rely 255/255, load1/255
Encapsulation HDLC, loopback not set
Keepalive set (10 sec)
Last input 0:00:09, output 0:00:09, output hang never
Last clearing of "show interface" counters 0:09:29
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Output queue: 0/64/0 (size/threshold/drops)
Conversations 0/1 (active/max active)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
2 packets input, 79 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abor
2 packets output, 80 bytes, 0underruns
0 output errors, 0 collisions, 0 interface resets, 0 restarts
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
NetPro Discussion Forums - Featured Conversations
| NetPro Discussion Forums - Featured Conversations for WAN |
| Network Infrastructure: WAN, Routing, and Switching |
Related Information
- The show compress Command
- WAN Compression FAQs
- Understanding Data Compression
- SA-Comp/1 and SA-Comp/4 Data Compression Service Adapters
- Technical Support - Cisco Systems
| Updated: Jun 01, 2005 | Document ID: 14157 |
