Error Correction &
Data Compression

When transferring data over telephone lines using a modem, accidents can and do happen. Because the telephone network was not originally designed to transfer data, noise on the line can cause a modem to misinterpret the signal received from another modem causing data corruption. Under many circumstances, such corruption can cause severe problems (money lost and data rendered useless).

To combat such problems, the modem incorporates two separate methods of error correction, the Microcom Network Protocol (MNP) and the ITU-T V.42 (V.42) error correction protocol. In addition, MNP5 incorporates a data compression algorithm allowing data to be sent from modem to modem at around twice the normal speed. To further improve data throughput and reduce file transmission times, the modem incorporates the V.42bis data compression standard. This reduces the size of transmitted data by exploiting characteristics of the data to give compression ratios in the range 2:1 to 4:1 depending upon the predictability of the data.

The newer ITU-T V.42 LAPM procedure is considered as more robust than MNP, and has a more sophisticated and powerful data compression option in V.42bis, allowing much greater data throughput. The Microcom Network Protocol is provided for compatibility with older modems which are still in use.

Some recommendations and restrictions are placed on the use of error correction and data compression. Error correction cannot be used in V.21 (300/300 bps), V.23 (1200/75 bps and 75/1200 bps) or Bell 103 (300/300 bps) connections due to serious degradation of throughput at low speeds.

Also, it is recommended that when data compression is enabled, speed buffering is employed with the terminal speed set to at least twice the modem line speed for MNP5 and four times for V.42bis. Some form of flow control should also be enabled between terminal and modem.

To obtain maximum benefit from your modem's data compression abilities for high speed (V.34, V.FC, V.32 and V.32bis) connections, a terminal speed greater than 19200 bps may be desirable. However, some computers operate unreliably at terminal (DTE) speeds above 19200 bps, mainly due to the type of UART fitted in their serial port. For optimum performance, a high speed UART of type 16550 is required.

Both MNP and V.42 operate transparently so that if only one side of the connection can operate in error correction mode, both sides operate without error correction. This transparency is achieved by a process of negotiation between the two modems. Any negotiation takes place shortly after the two modems connect, allowing both systems to identify each others capabilities and decide if error correction is possible.

V.42 and V.42bis

The ITU-T's V.42 error correction protocol incorporates a correction procedure called LAPM (Link Access Procedure for Modems). To increase the acceptance of the V.42 error correction protocol, the ITU-T also defined a secondary procedure option so that a V.42 modem would be able to error correct with a V.42 or an MNP-only modem. Upon connection, V.42 negotiates with the remote modem to establish if it is capable of error correction using LAPM. If the remote modem is not a V.42 modem, the negotiation fails and the two modems then try to negotiate the use of MNP as described below.

V.42bis uses a string encoding algorithm called BTLZ, in which frequently occurring strings of characters are replaced by code words. The "dictionary" of strings is dynamically maintained during transmission and keeps track of changes in the data; new strings are added and old strings are deleted. As the data may not always be compressible (for example encrypted or pre-compressed data) the modem has the ability to switch between compressed and uncompressed modes of operation. Compression performance is continually monitored and, if no compression is obtained, the modem transmits the data in uncompressed form. Even while in uncompressed mode, the modem monitors the characteristics of the data and switches compression back on as soon as some benefit can be achieved.

V.42bis always produces some performance improvement unlike MNP5, which produces a throughput reduction on previously compressed data. This explains why V.42bis is preferred over MNP5 and why it is the modem default compression technique.

MNP 2-5 and MNP 10

MNP incorporates various levels of error correction called classes. These classes are arranged like the layers of an onion. Each layer goes on top of the previous one, incorporating the features of all the lower classes. The modem incorporates the features of MNP classes 2, 3, 4, 5 and 10. The features of each class are:

Class 2: Data can be transferred in both directions simultaneously. Up to 8 consecutive data blocks may be transmitted and left unacknowledged by the remote modem at any one time. This improves data flow and hence throughput.

Class 3: Data can be transferred from modem to modem synchronously (sent as a single block), giving a 20% increase in throughput due to the absence of the start and stop bits found in asynchronous data (alternately sent and received in small blocks).

Class 4: Data phase optimisation increases the efficiency of data transfer by reducing the number of bytes used by the header and tail of the packet thus optimising the total number of bytes per data packet. It allows up to 256 byte data blocks to be transferred.

Class 5: Data compression, using a technique called run length encoding allows data to be transferred at around twice the normal rate.

Class 10: Data throughput optimisation over poor quality lines. As the line condition varies, MNP10 dynamically alters the data packet size to promote optimum throughput. A minimum of an MNP4 connection is required before up-shift to MNP10 can occur.

When two MNP modems negotiate, they inform each other of their capabilities and only use the classes that are common to both modems. So if an MNP 5 modem connects to an MNP 3 modem, both sides use the features of MNP 2 and 3 only.

Selecting the error correction method.

In operation, a simple set of commands are used to select the error correction method needed and set any options required. A description of these commands is given below.

\N0 Disabling error correction :

By default, auto reliable mode is enabled but it may be disabled by issuing the \N0 command. If problems are experienced when using error correction it may be advantageous to disable the in-built error correction facility on your modem.

Some non-error correcting remote modems interpret error correction negotiations as data. This is seen as "garbage" at the remote DTE as first V.42 and then MNP error correction negotiation is attempted. This may cause a problem in certain applications. If it is known that the remote modem is a non-error correcting modem, use the \N0 command to prevent your modem from attempting error correction negotiation.

\N1 Direct mode operation (External modems only) :

Direct mode operation is a communications link set to operate with one common line and DTE speed. This differs from fixed mode operation as the line speed determines the speed for the link. The DTE speed must be matched to the line speed in order for data transfer to take place. With direct mode enabled, the modem performs no speed buffering, error correction or data compression.

\N2 Reliable mode :

In reliable mode (mandatory correction) if your modem fails the error correction negotiation while in error correction mode, it disconnects and issues a NO CARRIER message. Reliable mode lets your modem discriminate between remote error correcting and non-error correcting modems.

\N3 Auto reliable mode :

This is the default mode, and allows the modem to connect to error corrected or non-error corrected modems without switching between error corrected and non-error corrected modes. With auto reliable mode enabled your modem attempts to negotiate a LAPM error corrected link. If the V.42 negotiation fails (indicating that the remote modem is not V.42 compliant and does not support LAPM) your modem attempts to negotiate with the remote modem using the MNP error correction protocol. If the MNP negotiation fails, then your modem stays on-line in non-error corrected mode.

\N4 V.42 error correction :

With \N4 enabled, your modem attempts to make a V.42 LAPM connection only. Failure to connect in this way causes the modem to issue the NO CARRIER message and hang up.

\N5 MNP error correction :

Fixed MNP error correction is enabled by issuing the \N5 command to the modem. On connection, the modem attempts to negotiate MNP error correction at the highest class. If MNP negotiation is successful, the modem issues the appropriate connect message and error corrects at the highest MNP error correction standard common to both modems.

If MNP negotiation is unsuccessful the modem disconnects and issues the NO CARRIER message. Should you wish to make a connection to a remote modem which offers both MNP4 and V.42 LAPM error correction but only MNP5 data compression, it may be necessary to enforce the MNP error correction at the modem by issuing the \N5 command. This allows negotiation for MNP error correction, to ensure MNP5 data compression is achieved.

Selecting the data compression method.

A description of the commands used to select the appropriate data compression method are given below.

%C0 Disabling data compression :

By default, the modem operates with data compression enabled. This takes advantage of the compression facilities of the remote modem to which you are connected. If required, operation without data compression is achieved by issuing the %C0 command.

%C1 MNP5 data compression :

The %C1 command enables MNP5 data compression. MNP5 is not very effective in compressing pre-compressed data (such as 'ZIP' files). Unlike V.42bis, which is able to automatically disable data compression in these circumstances, MNP5 may actually result in lower throughput for pre-compressed data! If this is the case disable data compression by issuing the %C0 command. MNP5 data compression is not possible after V.42 LAPM error correction is negotiated. Additionally, MNP5 data compression is only possible if MNP error correction is already established. See the description for the \N5 command above for more information.

%C2 V.42bis data compression :

V.42bis data compression is enabled by issuing the %C2 command. Having established a valid connection, the modem attempts to negotiate the LAPM protocol. Assuming V.42 compliance, the modem exchanges internal operating parameters to determine whether the remote modem can support the V.42bis standard. These parameters also enable both modems to agree a common mode of operation by providing information such as dictionary size and maximum string length. If a successful V.42bis connection is made then the modem enters the BTLZ data compression algorithm and issues the appropriate connect message. If the remote modem does not support V.42bis, the modem reverts to a V.42 error corrected connection.

%C3 Automatic compression selection :

This is the default data compression mode. Once a connection is established with any type of error correction, the modem attempts V.42bis data compression. Should this fail, an attempt is made at MNP5 data compression, provided an MNP error corrected connection had been agreed. If these attempts fail then the modem retains the error corrected connection without data compression.

Error correction and data compression messages

When the modem establishes a connection it normally produces a CONNECT message with an attached line speed. It is possible to enable additional progress messages which may be helpful in determining the exact type of connection.

The W1 command selects two additional messages and modifies the connect message. When a connection is established, messages of the following form are output:

CARRIER 9600
PROTOCOL: LAPM (or MNP or MNP 10 or NONE)
CONNECT 9600

The carrier message gives the current line speed; protocol shows what type of error correction is in use; and the connect message gives the DTE speed rather than the line speed.

W0 is similar to the default of W2 except that the speed information attached to the connect message refers to the DTE speed rather than the line speed. Further control over the actual messages output during connection may be obtained by use of register S95. For example: ATS95=0 <Return> disables a feature which appends /ARQ to the connect message for any error corrected connections. See the S registers chapter for more information on customising the connect message format.

Command summary
\A MNP Block size :

The \A command determines the maximum size of a data block transferred across the link under the MNP protocol.

%C Data compression select :

This command selects the type of data compression (if any) used on an error corrected link.

*H MNP Class 10 link negotiation speed :

This command controls the connection speed for link negotiations before up-shift occurs between two MNP10 modems.

-K MNP Class 10 extended services :

The -K command selects if a V.42 LAPM connection is converted to an MNP10 connection.

\L MNP block/stream mode select :

Block mode (\L1) only transmits data when a full block of data is received from the DTE.Stream mode(\L0) is the default mode and transmits data as it is received from the DTE.

\N Error correction select :

Determines which (if any) error correction method is enabled.

W Connect message control :

Controls the format of the message output when the modem establishes a connection.


Previous Section | Contents | Search Tools | Glossary | Comments | Next Section

Hosted by www.city-visitor.com

Secure Access Comments Glossary Search Tools Contents Automatic Answering