[Home] [Downloads] [Search] [Help/forum]

MUD Client Compression Protocol

This is a protocol for servers to compress messages to MUD clients, on-the-fly. To use it you need to use an MCCP-compliant server (the references below show how to patch your server to achieve this), and an MCCP-compliant client. MUSHclient is such a client.


zlib

MCCP uses the zlib library, a publicly-distributable compression algorithm. You can read about it at:

http://www.info-zip.org/pub/infozip/zlib/


MCCP protocol

The MCCP protocol uses telnet negotiation to see if a client handles decompression, if not it proceeds normally, if so it then compresses everything.

MUSHclient now supports both version 1 and version 2 of MCCP. Version 3.05 onwards of MUSHclient supports version 2 of MCCP (as well as version 1). Version 3.04 of MUSHclient supports version 1 of MCCP only.


#define TELOPT_COMPRESS 85
#define TELOPT_COMPRESS2 86

/* Server sends  IAC WILL COMPRESS
 * We reply with IAC DO COMPRESS
 *
 * Later the server sends IAC SB COMPRESS WILL SE, and immediately following
 * that, begins compressing the data.
 *
 * Compression ends on a Z_STREAM_END, no other marker is used
 *
 * For MCCP version 2, the protocol is slightly different ...
 *
 * Server sends  IAC WILL COMPRESS2
 * We reply with IAC DO COMPRESS2
 *
 * Later the server sends IAC SB COMPRESS2 IAC SE, and immediately following
 * that, begins compressing the data.
 * 
 */

My own figures found after about 10 minutes that the amount of data needed to be sent dropped to around 25% which significantly helps server bandwidth.

Read about MCCP at:

http://www.randomly.org/projects/MCCP/


RFCs

There are two RFCs about telnet negotiation, 854/855. The RFC for zlib is 1950.


[Back] [Home]
Written by Nick Gammon - 5K

Comments to Gammon Software support

[Best viewed with any browser - 2K]    Internet Contents Rating Association (ICRA) - 2K    [Web site powered by FutureQuest.Net]

Page updated on Tuesday, 6 December 2005