RFC 2393

IP Payload Compression Protocol (IPComp)

๐Ÿ“… published December 1998, from ietf

IP Payload Compression Protocol (IPComp) ๐ŸŽ€

Stream: Network Working Group ๐Ÿงš RFC number: 2393 Category: Standards Track ๐Ÿ‘‘ Date: December 1998 ๐ŸŒธ Authors:

  • A. Shacham (Cisco)
  • R. Monsour (Hi/fn)
  • R. Pereira (TimeStep)
  • M. Thomas (AltaVista Internet)

Obsoletes / Updates: The title block doesn't list any RFCs being obsoleted or updated ๐Ÿซถ


Status of This Memo โœจ

Okay so this doc is an Internet standards track protocol for the Internet community, and it's asking for discussion and suggestions for improvements ๐Ÿ’– If you want the current standardization state and status of this protocol, check the "Internet Official Protocol Standards" (STD 1) ๐Ÿ” Distribution of this memo is unlimited, so share it with everyone ๐Ÿฆ‹

Copyright (C) The Internet Society (1998). All Rights Reserved. ๐Ÿ’…

Abstract ๐ŸŒธ

This document describes a protocol meant to give lossless compression for Internet Protocol datagrams across the Internet. It's giving "make it smaller but keep every bit" energy ๐Ÿซถ

1. Introduction โœจ

So IP payload compression is a protocol that shrinks IP datagrams ๐Ÿฆ‹ Its whole thing is boosting performance between a pair of communicating hosts/gateways (aka "nodes") by compressing the datagrams. But that only works if the nodes have enough computing power, either through CPU capacity or a compression coprocessor, AND the communication is over slow or congested links ๐Ÿข Lowkey the perfect glow-up for bad connections ๐Ÿฅน

IP payload compression is especially useful when encryption is applied to IP datagrams ๐Ÿ” Encrypting a datagram makes the data look random, so compression at lower protocol layers (for example, the PPP Compression Control Protocol [RFC-1962]) stops working ๐Ÿ’€ If you need both compression and encryption, compression MUST be applied before encryption. Non-negotiable, bestie ๐Ÿ’œ

This document defines the IP payload compression protocol (IPComp), the IPComp packet structure, the IPComp Association (IPCA), and several methods to negotiate the IPCA ๐ŸŽ€ Other documents shall specify how a specific compression algorithm can be used with IP payload compression. Those algorithms are beyond the scope of this document, so don't look for them here ๐Ÿ™ˆ

1.1. Specification of Requirements ๐Ÿ“

Okay, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be read as described in RFC 2119 [RFC-2119] ๐Ÿง 

2. Compression Process ๐Ÿ”ฅ

The compression processing of IP datagrams has two phases. First up is compressing outbound IP datagrams ("compression"), and then decompressing inbound datagrams ("decompression") ๐ŸŒ€ The compression processing MUST be lossless. That means the IP datagram, after being compressed and then decompressed, has to be identical to the original IP datagram. Iconic, no notes ๐Ÿ‘‘

Each IP datagram gets compressed and decompressed by itself, with zero relation to other datagrams. That's the "stateless compression" part ๐Ÿฆ‹ It's needed because datagrams can arrive out of order or not arrive at all ๐Ÿ˜ญ Each compressed IP datagram encapsulates a single IP payload ๐ŸŽ

Processing of inbound IP datagrams MUST support both compressed and non-compressed IP datagrams. This is so they can meet the non-expansion policy requirements, as defined in section 2.2 ๐Ÿ’…

The compression of outbound IP datagrams MUST be done before any IP security processing, like encryption and authentication, and before any fragmentation of the IP datagram ๐Ÿ” Also, in IP version 6 [RFC-2460], the compression of outbound IP datagrams MUST be done before adding either a Hop-by-Hop Options header or a Routing Header. Both of those carry information that every node along a packet's delivery path might need to examine and process, so they MUST be sent in the original form ๐Ÿ—บ๏ธ Not me being extra, but this matters ๐Ÿ™ƒ

Similarly, the decompression of inbound IP datagrams MUST be done after the reassembly of the IP datagrams, and after all IP security processing (like authentication and decryption) is complete ๐Ÿ”“

2.1. Compressed Payload ๐ŸŽ€

The compression is applied to a single array of octets that are contiguous in the IP datagram. This array always ends at the last octet of the IP packet payload ๐Ÿงฉ Note: a contiguous array of octets in the IP datagram may not be contiguous in physical memory. Plot twist ๐ŸŒ€

In IP version 4 [RFC-0791], the compression is applied to the upper layer protocol (ULP) payload of the IP datagram. No portion of the IP header or the IP header options gets compressed, so they stay exactly as they are ๐Ÿ’–

In the IPv6 context, IPComp is treated as an end-to-end payload, and it MUST not apply to hop-by-hop, routing, and fragmentation extension headers. The compression starts at the first IP Header Option field that does not carry information which nodes along a packet's delivery path have to examine and process. That's only if such a field exists ๐Ÿ‘€ From there, it continues all the way to the ULP payload of the IP datagram โœจ

The size of a compressed payload, as generated by the compression algorithm, MUST be in whole octet units ๐Ÿ“

As defined in section 3, an IPComp header is inserted right before the compressed payload ๐ŸŽ€ The original IP header gets modified to show that IPComp is being used, along with the reduced size of the IP datagram ๐Ÿฆ‹ The original content of the Next Header (IPv6) or protocol (IPv4) field is stored in the IPComp header, so nothing gets lost ๐Ÿซถ

The decompression is applied to a single contiguous array of octets in the IP datagram. That array starts right after the IPComp header and ends at the last octet of the IP payload ๐Ÿ”„ If decompression finishes successfully, the IP header gets modified to show the size of the decompressed IP datagram, plus the original next header that was stored in the IPComp header ๐ŸŒธ Then the IPComp header is removed, and the decompressed payload sits right after the IP header ๐Ÿงš

2.2. Non-Expansion Policy ๐Ÿšซ

If the total size of a compressed ULP payload plus the IPComp header (as defined in section 3) is not smaller than the size of the original ULP payload, the IP datagram MUST be sent in the original non-compressed form ๐Ÿ™…โ€โ™€๏ธ To clarify: if a datagram is sent non-compressed, no IPComp header gets added at all ๐Ÿ’… This policy saves decompression processing cycles, and it also avoids IP datagram fragmentation that would happen when the expanded datagram is larger than the MTU ๐Ÿง 

Small IP datagrams are likely to expand when compressed ๐Ÿ“ˆ So a numeric threshold should be applied before compression. Any datagram smaller than the threshold gets sent in its original form, with no compression attempt ๐ŸŒฑ The numeric threshold is implementation dependent ๐Ÿ› ๏ธ

An IP datagram whose payload has already been compressed tends not to compress any further ๐Ÿ˜ฉ That previously compressed payload might come from external processes, like compression applied by an upper layer in the communication stack, or from an off-line compression utility ๐ŸŽž๏ธ An adaptive algorithm should be implemented to avoid the performance hit. For example, if compression fails for i consecutive IP datagrams of an IPCA, the next k IP datagrams are sent without attempting compression. If the next j datagrams also fail to compress, the next k+n datagrams are sent without attempting compression. Once a datagram compresses successfully, the normal IPComp process restarts โœจ That adaptive algorithm, including all the related thresholds, is implementation dependent ๐ŸŽ€

During processing of the payload, the compression algorithm MAY periodically apply a test to check how compressible the processed data is, similar to the requirements of [V42BIS] ๐Ÿ” The nature of that test is algorithm dependent ๐Ÿงช Once the compression algorithm detects that the data is non-compressible, the algorithm SHOULD stop processing the data, and the payload is sent in its original non-compressed form ๐Ÿ™ƒ Honestly, know when to quit ๐Ÿ’€

3. Compressed IP Datagram Header Structure ๐Ÿฆ‹

A compressed IP datagram is encapsulated by modifying the IP header and inserting an IPComp header right before the compressed payload ๐ŸŽ This section defines the IP header modifications for both IPv4 and IPv6, plus the structure of the IPComp header ๐Ÿ’œ

3.1. IPv4 Header Modifications ๐ŸŒˆ

The following IPv4 header fields are set before the compressed IP datagram gets transmitted:

  • Total Length: The length of the entire encapsulated IP datagram, including the IP header, the IPComp header, and the compressed payload ๐Ÿ“ฆ
  • Protocol: Set to 108, IPComp Datagram, [RFC-1700] ๐Ÿ”ข
  • Header Checksum: The Internet Header checksum [RFC-0791] of the IP header ๐Ÿงฎ

All other IPv4 header fields are kept unchanged, including any header options ๐Ÿซถ

3.2. IPv6 Header Modifications ๐ŸŒธ

The following IPv6 header fields are set before the compressed IP datagram gets transmitted:

  • Payload Length: The length of the compressed IP payload ๐Ÿ“
  • Next Header: Set to 108, IPComp Datagram, [RFC-1700] ๐Ÿ”ข

All other IPv6 header fields are kept unchanged, including any non-compressed header options ๐Ÿ™Œ

The IPComp header is placed in an IPv6 packet using the same rules as the IPv6 Fragment Header. But if an IPv6 packet contains both an IPv6 Fragment Header and an IPComp header, the IPv6 Fragment Header MUST precede the IPComp header in the packet. Order matters, babe ๐Ÿงฉ

3.3. IPComp Header Structure ๐ŸŽ€

The four-octet header has the following structure ๐Ÿ‘‡

   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  Next Header  |     Flags     | Compression Parameter Index |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  • Next Header: An 8-bit selector. It stores the IPv4 Protocol field or the IPv6 Next Header field of the original IP header ๐Ÿ—‚๏ธ
  • Flags: An 8-bit field, reserved for future use. It MUST be set to zero, and it MUST be ignored by the receiving node ๐Ÿšฉ
  • Compression Parameter Index (CPI): A 16-bit index, stored in network order ๐Ÿ”‘ The values 0-63 define well-known compression algorithms. These need no additional information and are used for manual setup. The values themselves are identical to the IPCOMP Transform identifiers defined in [SECDOI]. Consult [SECDOI] for an initial set of defined values and for instructions on how to assign new ones ๐Ÿ“š The values 64-255 are reserved for future use ๐Ÿ”’ The values 256-61439 are negotiated between the two nodes when defining an IPComp Association, as defined in section 4 ๐Ÿค Note: when negotiating one of the well-known algorithms, the nodes MAY select a CPI in the pre-defined range 0-63 ๐ŸŽฏ The values 61440-65535 are for private use among mutually consenting parties ๐Ÿซ‚ Both nodes can select a CPI value independently of each other, and there's no relationship between the two separately chosen CPIs ๐Ÿ™ƒ The outbound IPComp header MUST use the CPI value chosen by the decompressing node ๐Ÿ‘‘ The CPI, combined with the destination IP address, uniquely identifies the compression algorithm characteristics for the datagram ๐Ÿ’œ

4. IPComp Association (IPCA) Negotiation โœจ

Okay bestie, before IPComp can do anything, two nodes MUST first establish an IPComp Association (IPCA) between them ๐Ÿซถ. The IPCA is the whole care package: it holds all the required info for IPComp to work, including the Compression Parameter Index (CPI) ๐ŸŽ€, the mode of operation, the compression algorithm to be used, and any required parameter for the selected compression algorithm. The mode is either a node-to-node policy, where IPComp is applied to every IP packet between the nodes, or an ULP session based policy, where only selected ULP sessions between the nodes are using IPComp ๐Ÿ’…. For each IPCA, a different compression algorithm may be negotiated in each direction, or only one direction may be compressed. The default is "no IPComp compression" ๐Ÿ™ˆ.

The IPCA gets set up either through dynamic negotiations or manual configuration. The dynamic negotiations SHOULD use the Internet Security Association and Key Management Protocol [ISAKMP], where IPSec is present ๐Ÿ”. The dynamic negotiations MAY be implemented through a different protocol โœจ.

4.1. Use of ISAKMP

For IPComp in the context of IP Security, ISAKMP gives you the mechanisms you need to establish IPCA ๐Ÿงš. The IPComp Association is negotiated by the initiator using a Proposal Payload, which would include one or more Transform Payloads. The Proposal Payload would specify a compression protocol in the protocol id field, and each Transform Payload would contain the specific compression method(s) being offered to the responder ๐Ÿ’œ.

In the Internet IP Security Domain of Interpretation (DOI), IPComp is negotiated as the Protocol ID PROTO_IPCOMP. The compression algorithm is negotiated as one of the defined IPCOMP Transform Identifiers ๐ŸŒธ.

4.2. Use of Non-ISAKMP Protocol

The dynamic negotiations MAY be implemented through a protocol other than ISAKMP. Such protocol is beyond the scope of this document ๐Ÿฆ‹.

4.3. Manual Configuration

Nodes may establish IPComp Associations using manual configuration ๐Ÿ› ๏ธ. For this method, a limited number of Compression Parameters Indexes (CPIs) is designated to represent a list of specific compression methods ๐Ÿ“.

5. Security Considerations ๐Ÿšจ

Okay this section is SERIOUS but also iconic, so let's go ๐Ÿ’€. When IPComp is used in the context of IPSec, it is believed not to have an effect on the underlying security functionality provided by the IPSec protocol. That means, i.e., the use of compression is not known to degrade or alter the nature of the underlying security architecture or the encryption technologies used to implement it ๐Ÿ”’โœจ.

When IPComp is used without IPSec, IP payload compression potentially reduces the security of the Internet ๐Ÿ˜ญ, kind of like the effects of IP encapsulation [RFC-2003]. For example, IPComp may make it difficult for border routers to filter datagrams based on header fields ๐Ÿšง. In particular, the original value of the Protocol field in the IP header is not located in its normal positions within the datagram ๐Ÿ™ƒ. Any transport layer header fields within the datagram, such as port numbers, are neither located in their normal positions within the datagram nor presented in their original values after compression ๐Ÿ’”.

A filtering border router can filter the datagram only if it shares the IPComp Association used for the compression ๐Ÿง. To allow this sort of compression in environments where all packets need to be filtered (or at least accounted for), a mechanism must be in place for the receiving node to securely communicate the IPComp Association to the border router ๐Ÿ›ก๏ธ. This might, more rarely, also apply to the IPComp Association used for outgoing datagrams ๐Ÿ‘€.


6. References ๐Ÿ“š

  • [RFC-0791] Postel, J., Editor, "Internet Protocol", STD 5, RFC 791, September 1981.
  • [RFC-1700] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC 1700, October 1994. Or see: http://www.iana.org/numbers.html
  • [RFC-2460] Deering, S., and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998.
  • [RFC-1962] Rand, D., "The PPP Compression Control Protocol (CCP)", RFC 1962, June 1996.
  • [RFC-2003] Perkins, C., "IP Encapsulation within IP", RFC 2003, October 1996.
  • [RFC-2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [ISAKMP] Maughan, D., Schertler, M., Schneider, M., and J. Turner, "Internet Security Association and Key Management Protocol (ISAKMP)", RFC 2408, November 1998.
  • [SECDOI] Piper, D., "The Internet IP Security Domain of Interpretation for ISAKMP", RFC 2407, November 1998.
  • [V42BIS] CCITT, "Data Compression Procedures for Data Circuit Terminating Equipment (DCE) Using Error Correction Procedures", Recommendation V.42 bis, January 1990.

Authors' Addresses ๐Ÿ’Œ

Abraham Shacham
Cisco Systems
170 West Tasman Drive
San Jose, California 95134
United States of America

EMail: shacham@cisco.com


Robert Monsour
Hi/fn Inc.
2105 Hamilton Avenue, Suite 230
San Jose, California 95125
United States of America

EMail: rmonsour@hifn.com


Roy Pereira
TimeStep Corporation
362 Terry Fox Drive
Kanata, Ontario K2K 2P5
Canada

EMail: rpereira@timestep.com


Matt Thomas
AltaVista Internet Software
30 Porter Road
Littleton, Massachusetts 01460
United States of America

EMail: matt.thomas@altavista-software.com

Working Group ๐Ÿ‘ฏ

The IP Payload Compression Protocol (IPPCP) working group can be contacted through its chair ๐Ÿ“ฌ:

Naganand Dorswamy
Bay Networks

EMail: naganand@baynetworks.com

Copyright (C) The Internet Society (1998). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐Ÿ’–

๐Ÿ“ฆ where this page comes from