Contents
- Configuring TCP Header Compression
- Finding Feature Information
- Prerequisites for Configuring TCP Header Compression
- Information About Configuring TCP Header Compression
- TCP Header-Compression Keywords
- Maximum Compressed IP Header Size and TCP Header Compression
- How to Configure TCP Header Compression
- Enabling TCP Header Compression on an Interface
- Enabling TCP Header Compression on an Interface That Uses Frame Relay Encapsulation
- Enabling Special-VJ Format TCP Header Compression
- Changing the Maximum Size of the Compressed IP Header
- Changing the Number of Header-Compression Connections
- Implications of Changing the Number of Header-Compression Connections
- Displaying Header-Compression Statistics
- Configuration Examples for TCP Header Compression
- Example Enabling TCP Header Compression on an Interface
- Example Enabling TCP Header Compression on an Interface That Uses Frame Relay Encapsulation
- Example Enabling Special-VJ Format TCP Header Compression
- Example Changing the Maximum Size of the Compressed IP Header
- Example Changing the Number of Header-Compression Connections
- Example Displaying Header-Compression Statistics
- Additional References
- Glossary
- Feature Information for Configuring TCP Header Compression
Configuring TCP Header Compression
Header compression is a mechanism that compresses the IP header in a packet before the packet is transmitted. Header compression reduces network overhead and speeds up the transmission of either Real-Time Transport Protocol (RTP) or TCP packets.
Cisco provides two types of header compression: RTP header compression and TCP header compression. This module describes the concepts and tasks related to configuring TCP header compression.
Note | TCP header compression is configured on a per-interface (or subinterface) basis. If you want to configure TCP header compression on a per-class basis, see the "Configuring Class-Based RTP and TCP Header Compression" module. |
- Finding Feature Information
- Prerequisites for Configuring TCP Header Compression
- Information About Configuring TCP Header Compression
- How to Configure TCP Header Compression
- Configuration Examples for TCP Header Compression
- Additional References
- Glossary
- Feature Information for Configuring TCP Header Compression
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Prerequisites for Configuring TCP Header Compression
Information About Configuring TCP Header Compression
TCP Header-Compression Keywords
When you configure TCP header compression, you can specify the circumstances under which the TCP packets are compressed and the format that is used when the packets are compressed. These circumstances and formats are defined by the following keywords:
These keywords (described below) are available with many of the quality of service (QoS) commands used to configure TCP header compression, such as the ip tcp header-compression command. For more information about the ip tcp header-compression command, these keywords, and the other QoS commands, see the Cisco IOS Quality of Service Solutions Command Reference.
The passive Keyword
By default, the ip tcp header-compression command compresses outgoing TCP traffic. If you specify the passive keyword, outgoing TCP traffic is compressed only if incoming TCP traffic on the same interface is compressed. If you do not specify the passive keyword, all outgoing TCP traffic is compressed.
The passive keyword is ignored for PPP interfaces.
The iphc-format Keyword
The iphc-formatkeyword indicates that the IP Header Compression (IPHC) format of header compression will be used. For PPP and HDLC interfaces, when the iphc-format keyword is specified, RTP header compression is also enabled. Since both TCP and RTP header compression are enabled, both TCP and UDP packets are compressed.
The iphc-formatkeyword is not available for interfaces that use Frame Relay encapsulation.
Note | The header compression format (in this case, IPHC) must be the same at both ends of the network. That is, if you specify the iphc-format keyword on the local router, you must also specify the iphc-format keyword on the remote router. |
The ietf-format Keyword
The ietf-format keyword indicates that the Internet Engineering Task Force (IETF) format of header compression will be used. For HDLC interfaces, the ietf-format keyword compresses only TCP packets. For PPP interfaces, when the ietf-formatkeyword is specified, RTP header compression is also enabled. Since both TCP header compression and RTP header compression are enabled, both TCP packets and UDP packets are compressed.
The ietf-format keyword is not available for interfaces that use Frame Relay encapsulation.
Note | The header compression format (in this case, IETF) must be the same at both ends of the network. That is, if you specify the ietf-formatkeyword on the local router, you must also specify the ietf-format keyword on the remote router. |
Maximum Compressed IP Header Size and TCP Header Compression
With TCP header compression, you can configure the maximum size of the compressed IP header by using the ip header-compression max-header command.
The ip header-compression max-header command allows you to define the maximum size of the IP header of a packet to be compressed. Any packet with an IP header that exceeds the maximum size is sent uncompressed. For more information about the ip header-compression max-header command, see the Cisco IOS Quality of Service Solutions Command Reference.
How to Configure TCP Header Compression
- Enabling TCP Header Compression on an Interface
- Enabling TCP Header Compression on an Interface That Uses Frame Relay Encapsulation
- Enabling Special-VJ Format TCP Header Compression
- Changing the Maximum Size of the Compressed IP Header
- Changing the Number of Header-Compression Connections
- Displaying Header-Compression Statistics
Enabling TCP Header Compression on an Interface
Note | To enable TCP header compression on an interface that uses Frame Relay encapsulation, skip these steps and complete the steps in the Enabling TCP Header Compression on an Interface That Uses Frame Relay Encapsulation instead. |
1.
enable
2.
configure
terminal
3.
interface
type
number
[name-tag]
4.
encapsulation
encapsulation-type
5.
ip
address
ip-address
mask
[secondary]
6.
ip
tcp
header-compression
[passive | iphc-format | ietf-format]
7.
end
DETAILED STEPS
Enabling TCP Header Compression on an Interface That Uses Frame Relay Encapsulation
To enable TCP header compression on an interface that uses Frame Relay encapsulation, perform the following steps.
1.
enable
2.
configure
terminal
3.
interface
type
number
[name-tag]
4.
encapsulation
frame-relay
5.
ip
address
ip-address
mask
[secondary]
6.
frame-relay
interface-dlci
dlci
[cisco]
7.
frame-relay
ip
tcp
header-compression
[passive]
8.
9.
frame-relay
map
ip
ip-address
dlci
[broadcast] tcpheader-compression [active | passive] [connectionsnumber]
10.
end
DETAILED STEPS
Enabling Special-VJ Format TCP Header Compression
To enable the special Van Jacobson (VJ) format of TCP header compression so that context IDs are included in compressed packets, perform the following steps.
Enable TCP header compression using the ip tcp header-compression command before configuring the special-VJ format.
Note | This task is unnecessary if IPHC was configured on an interface using the iphc-profilecommand. > |
1.
enable
2.
configure
terminal
3.
interface
type
number
[name-tag]
4.
encapsulation
ppp
5.
ip
address
ip-address
mask
[secondary]
6. ip tcp header-compression
7. ip header-compression special-vj
8.
ip
tcp
compression-connections
number
9.
exit
10.
iphc-profile
profile-name
van-jacobson
11.
special-vj
12.
end
DETAILED STEPS
Changing the Maximum Size of the Compressed IP Header
By default, the maximum size of the compressed IP header is 168 bytes. When you configure TCP header compression, you can change this size to suit the needs of your network.
To change the maximum size of the compressed IP header, perform the following steps.
1.
enable
2.
configure
terminal
3.
interface
type
number
[name-tag]
4.
ip
header-compression
max-header
max-header-size
5.
end
DETAILED STEPS
Changing the Number of Header-Compression Connections
For PPP and HDLC interfaces, the default is 16 compression connections. For interfaces that use Frame Relay encapsulation, the default is 256 compression connections.
To change the default number of header-compression connections, perform the following steps.
Implications of Changing the Number of Header-Compression Connections
Each header-compression connection sets up a compression cache entry, so you are in effect specifying the maximum number of cache entries and the size of the cache. Too few cache entries for the specified interface can lead to degraded performance, and too many cache entries can lead to wasted memory. Choose the number of compression connections according to the network requirements.
1.
enable
2.
configure
terminal
3.
interface
type
number
[name-tag]
4.
ip
tcp
compression-connections
number
5.
6.
frame-relay
ip
tcp
compression-connections
number
7.
end
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
enable
Example: Router> enable |
Enables privileged EXEC mode.
| ||
Step 2 |
configure
terminal
Example: Router# configure terminal |
Enters global configuration mode. | ||
Step 3 |
interface
type
number
[name-tag] Example: Router(config)# interface serial0 |
Configures an interface type and enters interface configuration mode.
| ||
Step 4 |
ip
tcp
compression-connections
number
Example: Router(config-if)# ip tcp compression-connections 150 |
Specifies the total number of TCP header compression connections that can exist on an interface.
| ||
Step 5 |
|
| ||
Step 6 |
frame-relay
ip
tcp
compression-connections
number
Example: Router(config-if)# frame-relay ip tcp compression-connections 150 |
Specifies the maximum number of TCP header compression connections that can exist on an interface that use Frame Relay encapsulation.
| ||
Step 7 |
end
Example: Router(config-if)# end |
(Optional) Exits interface configuration mode. |
Displaying Header-Compression Statistics
You can display header-compression statistics, such as the number of packets sent, received, and compressed, by using either the show ip tcp header-compression command or the show frame-relay ip tcp header-compression command.
To display header-compression statistics, perform the following steps.
1.
enable
2.
show
ip
tcp
header-compression
[interface-type interface-number] [detail]
3.
4.
show
frame-relay
ip
tcp
header-compression
[interface type number]
5.
end
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable
Example: Router> enable |
Enables privileged EXEC mode.
|
Step 2 |
show
ip
tcp
header-compression
[interface-type interface-number] [detail] Example: Router# show ip tcp header-compression Example: |
Displays TCP/IP header compression statistics. |
Step 3 |
|
|
Step 4 |
show
frame-relay
ip
tcp
header-compression
[interface type number] Example: Router# show frame-relay ip tcp header-compression Example: |
Displays Frame Relay TCP/IP header compression statistics for one or all interfaces. |
Step 5 |
end
Example: Router# end |
(Optional) Exits privileged EXEC mode. |
Configuration Examples for TCP Header Compression
- Example Enabling TCP Header Compression on an Interface
- Example Enabling TCP Header Compression on an Interface That Uses Frame Relay Encapsulation
- Example Enabling Special-VJ Format TCP Header Compression
- Example Changing the Maximum Size of the Compressed IP Header
- Example Changing the Number of Header-Compression Connections
- Example Displaying Header-Compression Statistics
Example Enabling TCP Header Compression on an Interface
In the following example, TCP header compression is enabled on serial interface 0.
Router> enable
Router# configure terminal
Router(config)# interface serial0
Router(config-if)# encapsulation ppp
Router(config-if)# ip address 209.165.200.225 255.255.255.224
Router(config-if)# ip tcp header-compression ietf-format
Router(config-if)# end
Example Enabling TCP Header Compression on an Interface That Uses Frame Relay Encapsulation
In the following example, TCP header compression is enabled on serial interface 0. Frame Relay encapsulation has been enabled on this interface by using the encapsulationframe-relay command.
Router> enable
Router# configure terminal
Router(config)# interface serial0
Router(config-if)# encapsulation frame-relay
Router(config-if)# ip address 209.165.200.225 255.255.255.224
Router(config-if)# frame-relay interface-dlci 20
Router(config-if)# frame-relay ip tcp header-compression
Router(config-if)# end
Example Enabling Special-VJ Format TCP Header Compression
In the following example, TCP header compression is enabled on serial interface 0. The special VJ format has been enabled on this interface by using the ip header-compression special-vj, ip tcp compression-connections, and the special-vjcommands:
Router> enable
Router# configure terminal
Router(config)# interface serial0
Router(config-if)# ip address 209.165.200.225 255.255.255.224
Router(config-if)# ip tcp header-compression
Router(config-if)# ip header-compression special-vj
Router(config-if)# ip tcp compression-connections 16
Router(config-if))# exit
Router(config)# iphc-profile profile-name van-jacobson
Router(config-iphcp)# special-vj Router(config-if)# end
Example Changing the Maximum Size of the Compressed IP Header
In the following example, the maximum size of the compressed IP header (100 bytes) has been specified by using the ip header-compression max-header command:
Router> enable
Router# configure terminal
Router(config)# interface serial0
Router(config-if)# ip header-compression max-header 100
Router(config-if)# end
Example Changing the Number of Header-Compression Connections
In the following example, the number of header-compression connections has been changed to 150 by using the ip tcp compression-connectionscommand:
Router> enable
Router# configure terminal
Router(config)# interface serial0
Router(config-if)# ip tcp compression-connections 150
Router(config-if)# end
Example Displaying Header-Compression Statistics
You can use the show ip tcp header-compressioncommand to display header-compression statistics such as the number of packets received, sent, and compressed. The following is sample output from the show ip tcp header-compression command:
Router# show ip tcp header-compression serial0 TCP/IP header compression statistics: Interface Serial0 (compression on, IETF) Rcvd: 53797 total, 53796 compressed, 0 errors, 0 status msgs 0 dropped, 0 buffer copies, 0 buffer failures Sent: 53797 total, 53796 compressed, 0 status msgs, 0 not predicted 1721848 bytes saved, 430032 bytes sent 5.00 efficiency improvement factor Connect: 16 rx slots, 16 tx slots, 1 misses, 0 collisions, 0 negative cache hits, 15 free contexts 99% hit ratio, five minute miss rate 0 misses/sec, 0 max
Additional References
Related Documents
Related Topic |
Document Title |
---|---|
Cisco IOS commands |
|
QoS commands |
Cisco IOS QoS Command Reference |
MQC |
"Applying QoS Features Using the MQC" |
RTP header compression |
"Configuring RTP Header Compression" |
Standards and RFCs
Standard/RFC |
Title |
---|---|
No new or modified standards are supported, and support for existing standards has not been modified. |
-- |
MIBs
MIB |
MIBs Link |
---|---|
No new or modified MIBs are supported, and support for existing MIBs has not been modified. |
To locate and download MIBs for selected platforms, Cisco software releases, and feature sets, use Cisco MIB Locator found at the following URL: |
Technical Assistance
Description |
Link |
---|---|
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password. |
Glossary
compression --The running of a data set through an algorithm that reduces the space required to store the data set or the bandwidth required to transmit the data set.
DLCI --data-link connection identifier. A value that specifies a permanent virtual circuit (PVC) or switched virtual circuit (SVC) in a Frame Relay network. In the basic Frame Relay specification, DLCIs are locally significant (connected devices might use different values to specify the same connection). In the Local Management Interface (LMI) extended specification, DLCIs are globally significant (DLCIs uniquely specify individual end devices).
encapsulation --A method of wrapping data in a particular protocol header. For example, Ethernet data is wrapped in a specific Ethernet header before network transit. Also, when dissimilar networks are bridged, the entire frame from one network is simply placed in the header used by the data link layer protocol of the other network.
full header (header refresh) --An uncompressed header that updates or refreshes the context for a packet stream. It carries a context identifier (CID) that will be used to identify the context. Full headers for non-TCP packet streams also carry the generation of the context that they update or refresh.
HDLC --High-Level Data Link Control. A bit-oriented synchronous data link layer protocol developed by the International Organization for Standardization (ISO). Derived from Synchronous Data Link Control (SDLC), HDLC specifies a data encapsulation method on synchronous serial links using frame characters and checksums.
header --A chain of subheaders.
IETF --Internet Engineering Task Force. A task force that consists of over 80 working groups responsible for developing Internet standards.
IPHC --IP Header Compression. A protocol capable of compressing both TCP and UDP headers.
PPP --Point-to-Point Protocol. A protocol that provides router-to-router and host-to-network connections over synchronous and asynchronous circuits.
regular header --A normal, uncompressed header. A regular header does not carry a context identifier (CID) or generation association.
subheader --An IPv6 base header, an IPv6 extension header, an IPv4 header, a UDP header, an RTP header, or a TCP header.
TCP --Transmission Control Protocol. A connection-oriented transport layer protocol that provides reliable full-duplex data transmission. TCP is part of the TCP/IP protocol stack.
UDP --User Datagram Protocol. A connectionless transport layer protocol in the TCP/IP protocol stack. UDP is a simple protocol that exchanges datagrams without acknowledgments or guaranteed delivery, requiring that error processing and retransmission be handled by other protocols. UDP is defined in RFC 768.
Feature Information for Configuring TCP Header Compression
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Feature Name |
Releases |
Feature Information |
---|---|---|
This table is intentionally left blank because no features were introduced or modified in Cisco IOS Release 12.2(1) or a later release. This table will be updated when feature information is added to this module. |
-- |
-- |