XEP-0229: Stream Compression with LZW

This document specifies how to use the LZW algorithm in XML stream compression.
Peter Saint-Andre
© 2007 – 2022 XMPP Standards Foundation. SEE LEGAL NOTICES.


WARNING: This document has been obsoleted by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality are advised to implement the protocol that supersedes this one (if any).
Standards Track
1.1 (2022-02-10)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final
  5. Deprecated
  6. Obsolete

1. Introduction

Stream Compression (XEP-0138) [1] specifies an extensible framework for XML stream compression and defines a registry for compression methods (see <https://xmpp.org/registrar/compress.html>). However, XEP-0138 registers only the ZLIB method (see RFC 1950 [2]). This document specifies usage of the LZW compression method.

2. Background

The "LZW" compression algorithm was originally developed by Abraham Lempel and Jacob Ziv, subsequently improved by Terry Welch [3], and patented by Sperry Corporation (later Unisys Corporation) as U.S. Patent Number 4,464,650 [4]. This patent expired on June 20, 2003 [5] and [6]. Therefore implementations of LZW are no longer patent-encumbered.

The algorithm is specified by Ecma International in Standard ECMA-151 [7] under the name "DCLZ".

3. Definition

If the receiving entity (server) supports the LZW algorithm, it MUST include a <method/> element whose XML character data is "lzw" in the compression stream feature, as follows.

Example 1. Receiving Entity Offers Stream Compression Feature, Including LZW Method
  <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
  <compression xmlns='http://jabber.org/features/compress'>

If the initiating entity wishes to use the LZW algorithm, then it MUST specify that method.

Example 2. Initiating Entity Requests Stream Compression Using LZW
<compress xmlns='http://jabber.org/protocol/compress'>

The initiating entity and receiving entity then MUST attempt to negotiate use of the LZW algorithm in accordance with XEP-0138.

If the use of the LZW algorithm is negotiated, the usage SHOULD follow the definition in ECMA-151.

4. Optionality

The LZW algorithm is OPTIONAL to implement for XEP-0138 implementations and this specification does not define a mandatory-to-implement technology.

5. Security Considerations

Due to attacks like CRIME that apply equally to the lzw method defined here, this method is deemed insecure.

6. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [8].

7. XMPP Registrar Considerations

7.1 Compression Methods Registry

The XMPP Registrar [9] maintains a registry of compression methods at <https://xmpp.org/registrar/compress.html>.

The LZW algorithm is already registered. This specification updates the registry submission as follows:

  <desc>the LZW (DCLZ) compression method</desc>


Appendix A: Document Information

XMPP Standards Foundation
Standards Track
Last Updated
Approving Body
XMPP Council
XMPP Core, XEP-0138
Superseded By
Short Name
Source Control

This document in other formats: XML  PDF

Appendix B: Author Information

Peter Saint-Andre


This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).


Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

1. XEP-0138: Stream Compression <https://xmpp.org/extensions/xep-0138.html>.

2. RFC 1950: ZLIB Compressed Data Format Specification version 3.3 <http://tools.ietf.org/html/rfc1950>.

3. See "A Technique for High-Performance Data Compression", Computer (June 1984), pp. 8-19.

4. See <http://patft.uspto.gov/netacgi/nph-Parser?patentnumber=4,464,650>.

5. See <http://compression-links.info/Link/1264_LZW_Patent_Expiration.htm>

6. See <http://compression-links.info/Link/1814_LZW_Patent_Expiration.htm>.

7. Standard ECMA-151: Data Compression for Information Interchange - Adaptive Coding with Embedded Dictionary - DLCZ Algorithm <http://www.ecma-international.org/publications/standards/Ecma-151.htm>.

8. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

9. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 1.1 (2022-02-10)

    Obsolete due to security vulnerability.

  2. Version 1.0 (2007-09-26)

    Per a vote of the XMPP Council, published as Draft.

  3. Version 0.0.1 (2007-08-30)

    Copied text from XEP-0138.


Appendix I: Bib(La)TeX Entry

  title = {Stream Compression with LZW},
  author = {Saint-Andre, Peter},
  type = {XEP},
  number = {0229},
  version = {1.1},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0229.html},
  date = {2007-08-30/2022-02-10},