![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Configuring TCP Header Compression
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contents
Configuring TCP Header CompressionLast Updated: June 17, 2011
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.
Finding Feature InformationYour software release may not support all the features documented in this module. For the latest feature information and caveats, see 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 document. 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. Information About Configuring TCP Header CompressionTCP Header-Compression KeywordsWhen 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 KeywordBy 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 KeywordThe 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. The ietf-format KeywordThe 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. Maximum Compressed IP Header Size and TCP Header CompressionWith 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
To enable TCP header compression on an interface, perform the following steps. DETAILED STEPS Enabling TCP Header Compression on an Interface That Uses Frame Relay EncapsulationTo enable TCP header compression on an interface that uses Frame Relay encapsulation, perform the following steps. DETAILED STEPS Enabling Special-VJ Format TCP Header CompressionTo enable the special Van Jacobson (VJ) format of TCP header compression so that context IDs are included in compressed packets, perform the following steps. Before You Begin
SUMMARY STEPS
Enable TCP header compression using the ip tcp header-compression command before configuring the special-VJ format.
DETAILED STEPS Changing the Maximum Size of the Compressed IP HeaderBy 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. DETAILED STEPS Changing the Number of Header-Compression ConnectionsFor 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 ConnectionsEach 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. DETAILED STEPS
Displaying Header-Compression StatisticsYou 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. DETAILED STEPS
Configuration Examples for TCP Header Compression
Example Enabling TCP Header Compression on an InterfaceIn 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 EncapsulationIn 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 CompressionIn 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 HeaderIn 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 Displaying Header-Compression StatisticsYou 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 ReferencesRelated Documents
MIBsTechnical Assistance
Glossarycompression --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 CompressionThe 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.
Cisco and the Cisco Logo are trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and other countries. A listing of Cisco's trademarks can be found at www.cisco.com/go/trademarks. Third party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1005R) Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|