home *** CD-ROM | disk | FTP | other *** search
/ Internet Core Protocols / Oreilly-InternetCoreProtocols.iso / RFCs / rfc2395.txt < prev    next >
Encoding:
Text File  |  1999-10-14  |  15.0 KB  |  508 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                        R. Friend
  8. Request for Comments: 2395                                  R. Monsour
  9. Category: Informational                                    Hi/fn, Inc.
  10.                                                          December 1998
  11.  
  12.  
  13.                     IP Payload Compression Using LZS
  14.  
  15. Status of this Memo
  16.  
  17.    This memo provides information for the Internet community.  It does
  18.    not specify an Internet standard of any kind.  Distribution of this
  19.    memo is unlimited.
  20.  
  21. Copyright Notice
  22.  
  23.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  24.  
  25. Abstract
  26.  
  27.    This document describes a compression method based on the LZS
  28.    compression algorithm. This document defines the application of the
  29.    LZS algorithm to the IP Payload Compression Protocol [IPCOMP].
  30.    [IPCOMP] defines a method for applying lossless compression to the
  31.    payloads of Internet Protocol datagrams.
  32.  
  33. Table of Contents
  34.  
  35.    1. Introduction...................................................2
  36.       1.1 General....................................................2
  37.       1.2 Background of LZS Compression..............................2
  38.       1.3 Licensing..................................................3
  39.       1.4 Specification of Requirements..............................3
  40.    2. Compression Process............................................3
  41.       2.1 Compression History........................................3
  42.       2.2 Compression Encoding Format................................3
  43.       2.3 Padding....................................................4
  44.    3. Decompression Process..........................................4
  45.    4. IPComp Association (IPCA) Parameters...........................4
  46.       4.1 ISAKMP Transform ID........................................5
  47.       4.2 ISAKMP Security Association Attributes.....................5
  48.       4.3 Manual configuration.......................................5
  49.       4.4 Minimum packet size threshold..............................5
  50.       4.5 Compressibility test.......................................5
  51.    5. Security Considerations........................................5
  52.    6. Acknowledgements...............................................5
  53.    7. References.....................................................6
  54.    8. Authors' Addresses.............................................7
  55.  
  56.  
  57.  
  58. Friend & Monsour             Informational                      [Page 1]
  59.  
  60. RFC 2395            IP Payload Compression Using LZS       December 1998
  61.  
  62.  
  63.    9. Appendix: Compression Efficiency versus Datagram Size..........8
  64.    10. Full Copyright Statement......................................9
  65.  
  66. 1. Introduction
  67.  
  68. 1.1 General
  69.  
  70.    This document specifies the application of LZS compression, a
  71.    lossless compression algorithm, to IP datagram payloads. This
  72.    document is to be used in conjunction with the IP Payload Compression
  73.    Protocol [IPCOMP].  This specification assumes a thorough
  74.    understanding of the IPComp protocol.
  75.  
  76. 1.2 Background of LZS Compression
  77.  
  78.    Starting with a sliding window compression history, similar to [LZ1],
  79.    Hi/fn developed a new, enhanced compression algorithm identified as
  80.    LZS. The LZS algorithm is a general purpose lossless compression
  81.    algorithm for use with a wide variety of data types.  Its encoding
  82.    method is very efficient, providing compression for strings as short
  83.    as two octets in length.
  84.  
  85.    The LZS algorithm uses a sliding window of 2,048 bytes.  During
  86.    compression, redundant sequences of data are replaced with tokens
  87.    that represent those sequences. During decompression, the original
  88.    sequences are substituted for the tokens in such a way that the
  89.    original data is exactly recovered. LZS differs from lossy
  90.    compression algorithms, such as those often used for video
  91.    compression, that do not exactly reproduce the original data.
  92.  
  93.    The details of LZS compression can be found in [ANSI94].
  94.  
  95.    The efficiency of the LZS algorithm depends on the degree of
  96.    redundancy in the original data.  A table of compression ratios for
  97.    the [Calgary] Corpus file set is provided in the appendix in Section
  98.    7.
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Friend & Monsour             Informational                      [Page 2]
  115.  
  116. RFC 2395            IP Payload Compression Using LZS       December 1998
  117.  
  118.  
  119. 1.3 Licensing
  120.  
  121.    Hi/fn, Inc. holds patents on the LZS algorithm. Licenses for a
  122.    reference implementation are available for use in IPPCP, IPSec, TLS
  123.    and PPP applications at no cost.  Source and object licenses are
  124.    available on a non-discriminatory basis. Hardware implementations are
  125.    also available.  For more information, contact Hi/fn at the address
  126.    listed with the authors' addresses.
  127.  
  128. 1.4 Specification of Requirements
  129.  
  130.    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  131.    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
  132.    document are to be interpreted as described in [RFC-2119].
  133.  
  134. 2. Compression Process
  135.  
  136. 2.1 Compression History
  137.  
  138.    The sender MUST reset the compression history prior to processing
  139.    each datagram's payload. This ensures that each datagram's payload
  140.    can be decompressed independently of any other, as is needed when
  141.    datagrams are received out of order.
  142.  
  143.    The sender MUST flush the compressor each time it transmits a
  144.    compressed datagram.  Flushing means that all data going into the
  145.    compressor is included in the output, i.e., no data is held back in
  146.    the hope of achieving better compression.  Flushing is necessary to
  147.    prevent a datagram's data from spilling over into a later datagram.
  148.  
  149. 2.2 Compression Encoding Format
  150.  
  151.    The input to the payload compression algorithm is an IP datagram
  152.    payload. The output of the algorithm is a new (and hopefully smaller)
  153.    payload. The output payload contains the input payload's data in
  154.    either compressed or uncompressed format. The input and output
  155.    payloads are each an integral number of bytes in length.
  156.  
  157.    If the uncompressed form is used, the output payload is identical to
  158.    the input payload and the IPComp header is omitted.  If the
  159.    compressed form is used, the output payload is prepended with the
  160.    IPComp header and encoded as defined in [ANSI94], which is repeated
  161.    here for informational purposes ONLY.
  162.  
  163.    <Compressed Stream> := [<Compressed String>] <End Marker>
  164.    <Compressed String> := 0 <Raw Byte> | 1 <Compressed Bytes>
  165.    <Raw Byte> := <b><b><b><b><b><b><b><b>          (8-bit byte)
  166.    <Compressed Bytes> := <Offset> <Length>
  167.  
  168.  
  169.  
  170. Friend & Monsour             Informational                      [Page 3]
  171.  
  172. RFC 2395            IP Payload Compression Using LZS       December 1998
  173.  
  174.  
  175.    <Offset> := 1 <b><b><b><b><b><b><b> |           (7-bit offset)
  176.                0 <b><b><b><b><b><b><b><b><b><b><b> (11-bit offset)
  177.    <End Marker> := 110000000
  178.  
  179.    <b> := 1 | 0
  180.  
  181.    <Length> :=
  182.    00        = 2     1111 0110      = 14
  183.    01        = 3     1111 0111      = 15
  184.    10        = 4     1111 1000      = 16
  185.    1100      = 5     1111 1001      = 17
  186.    1101      = 6     1111 1010      = 18
  187.    1110      = 7     1111 1011      = 19
  188.    1111 0000 = 8     1111 1100      = 20
  189.    1111 0001 = 9     1111 1101      = 21
  190.    1111 0010 = 10    1111 1110      = 22
  191.    1111 0011 = 11    1111 1111 0000 = 23
  192.    1111 0100 = 12    1111 1111 0001 = 24
  193.    1111 0101 = 13     ...
  194.  
  195. 2.3 Padding
  196.  
  197.    A datagram payload compressed using LZS always ends with the last
  198.    compressed data byte (also known as the <end marker>), which is used
  199.    to disambiguate padding.  This allows trailing bits as well as bytes
  200.    to be considered padding.
  201.  
  202.    The size of a compressed payload MUST be in whole octet units.
  203.  
  204. 3. Decompression Process
  205.  
  206.    If the received datagram is compressed, the receiver MUST reset the
  207.    decompression history prior to processing the datagram. This ensures
  208.    that each datagram can be decompressed independently of any other, as
  209.    is needed when datagrams are received out of order. Following the
  210.    reset of the decompression history, the receiver decompresses the
  211.    Payload Data field according to the encoding specified in section 3.2
  212.    of [ANSI94].
  213.  
  214.    If the received datagram is not compressed, the receiver needs to
  215.    perform no decompression processing and the Payload Data field of the
  216.    datagram is ready for processing by the next protocol layer.
  217.  
  218. 4. IPComp Association (IPCA) Parameters
  219.  
  220.    ISAKMP MAY be used to negotiate the use of the LZS compression method
  221.    to establish an IPCA, as defined in [IPCOMP].
  222.  
  223.  
  224.  
  225.  
  226. Friend & Monsour             Informational                      [Page 4]
  227.  
  228. RFC 2395            IP Payload Compression Using LZS       December 1998
  229.  
  230.  
  231. 4.1 ISAKMP Transform ID
  232.  
  233.    The LZS Transform ID as IPCOMP_LZS, as specified in The Internet IP
  234.    Security Domain of Interpretation [SECDOI].  This value is used to
  235.    negotiate the LZS compression algorithm under the ISAKMP protocol.
  236.  
  237. 4.2 ISAKMP Security Association Attributes
  238.  
  239.    There are no other parameters required for LZS compression negotiated
  240.    under ISAKMP.
  241.  
  242. 4.3 Manual configuration
  243.  
  244.    The CPI value IPCOMP_LZS is used for a manually configured IPComp
  245.    Compression Associations.
  246.  
  247. 4.4 Minimum packet size threshold
  248.  
  249.    As stated in [IPCOMP], small packets may not compress well.  Informal
  250.    tests using the LZS algorithm over the Calgary Corpus data set show
  251.    that the average payload size that may produce expanded data is
  252.    approximately 90 bytes.  Thus implementations may not want to attempt
  253.    to compress payloads smaller than 90 bytes.
  254.  
  255. 4.5 Compressibility test
  256.  
  257.    There is no adaptive algorithm embodied in the LZS algorithm, for
  258.    compressibility testing, as referenced in [IPCOMP].
  259.  
  260. 5. Security Considerations
  261.  
  262.    This document does not add any further security considerations that
  263.    [IPCOMP] and [Deutsch96] have already declared.
  264.  
  265. 6. Acknowledgments
  266.  
  267.    The LZS details presented here are similar to those in PPP LZS-DCP
  268.    Compression Protocol (LZS-DCP), [RFC-1967].
  269.  
  270.    The author wishes to thank the participants of the IPPCP working
  271.    group mailing list whose discussion is currently active and is
  272.    working to generate the protocol specification for integrating
  273.    compression with IP.
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Friend & Monsour             Informational                      [Page 5]
  283.  
  284. RFC 2395            IP Payload Compression Using LZS       December 1998
  285.  
  286.  
  287. 7. References
  288.  
  289.    [AH]       Kent, S., and R., Atkinson, "IP Authentication Header",
  290.               RFC 2402, November 1998.
  291.  
  292.    [ANSI94]   American National Standards Institute, Inc., "Data
  293.               Compression Method for Information Systems," ANSI X3.241-
  294.               1994, August 1994.
  295.  
  296.    [Calgary]  Text Compression Corpus, University of Calgary, available
  297.               at ftp://ftp.cpsc.ucalgary.ca/pub/projects/text.
  298.               compression.corpus.
  299.  
  300.    [IPCOMP]   Shacham, A., "IP Payload Compression Protocol (IPComp)",
  301.               RFC 2393, December 1998.
  302.  
  303.    [LZ1]      Lempel, A., and Ziv, J., "A Universal Algorithm for
  304.               Sequential Data Compression", IEEE Transactions On
  305.               Information Theory, Vol.  IT-23, No. 3, May 1977.
  306.  
  307.    [RFC-1962] Rand, D., "The PPP Compression Control Protocol (CCP)",
  308.               RFC 1962, June 1996.
  309.  
  310.    [RFC-1967] Schneider, K., and R. Friend, "PPP LZS-DCP Compression
  311.               Protocol (LZS-DCP)", RFC 1967, August 1996.
  312.  
  313.    [RFC-2003] Perkins, C., "IP Encapsulation within IP", RFC 2003,
  314.               October 1996.
  315.  
  316.    [RFC-2119] Bradner, S., "Key words for use in RFCs to Indicate
  317.               Requirement Levels", BCP 14, RFC 2119, March 1997.
  318.  
  319.    [SECDOI]   Piper, D., "The Internet IP Security Domain of
  320.               Interpretation for ISAKMP", RFC 2407, November 1998.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Friend & Monsour             Informational                      [Page 6]
  339.  
  340. RFC 2395            IP Payload Compression Using LZS       December 1998
  341.  
  342.  
  343. 8. Authors' Addresses
  344.  
  345.    Robert Friend
  346.    Hi/fn Inc.
  347.    5973 Avenida Encinas
  348.    Suite 110
  349.    Carlsbad, CA  92008
  350.  
  351.    EMail: rfriend@hifn.com
  352.  
  353.  
  354.    Robert Monsour
  355.    Hi/fn Inc.
  356.    2105 Hamilton Avenue
  357.    Suite 230
  358.    San Jose, CA 95125
  359.  
  360.    EMail: rmonsour@hifn.com
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Friend & Monsour             Informational                      [Page 7]
  395.  
  396. RFC 2395            IP Payload Compression Using LZS       December 1998
  397.  
  398.  
  399. 9. Appendix: Compression Efficiency versus Datagram Size
  400.  
  401.    The following table offers some guidance on the compression
  402.    efficiency that can be achieved as a function of datagram size.  Each
  403.    entry in the table shows the compression ratio that was achieved when
  404.    LZS was applied to a test file using datagrams of a specified size.
  405.  
  406.    The test file was the University of Calgary Text Compression Corpus
  407.    [Calgary].  The Calgary Corpus consists of 18 files with a total size
  408.    (all files) of 3.278MB.
  409.  
  410.     Datagram size,|
  411.     bytes         |  64   128   256   512  1024  2048  4096  8192 16384
  412.     --------------|----------------------------------------------------
  413.     Compression   |1.18  1.28  1.43  1.58  1.74  1.91  2.04  2.11  2.14
  414.     ratio         |
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Friend & Monsour             Informational                      [Page 8]
  451.  
  452. RFC 2395            IP Payload Compression Using LZS       December 1998
  453.  
  454.  
  455. 10.  Full Copyright Statement
  456.  
  457.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  458.  
  459.    This document and translations of it may be copied and furnished to
  460.    others, and derivative works that comment on or otherwise explain it
  461.    or assist in its implementation may be prepared, copied, published
  462.    and distributed, in whole or in part, without restriction of any
  463.    kind, provided that the above copyright notice and this paragraph are
  464.    included on all such copies and derivative works.  However, this
  465.    document itself may not be modified in any way, such as by removing
  466.    the copyright notice or references to the Internet Society or other
  467.    Internet organizations, except as needed for the purpose of
  468.    developing Internet standards in which case the procedures for
  469.    copyrights defined in the Internet Standards process must be
  470.    followed, or as required to translate it into languages other than
  471.    English.
  472.  
  473.    The limited permissions granted above are perpetual and will not be
  474.    revoked by the Internet Society or its successors or assigns.
  475.  
  476.    This document and the information contained herein is provided on an
  477.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  478.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  479.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  480.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  481.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Friend & Monsour             Informational                      [Page 9]
  507.  
  508.