Modem Tutorial - Error Control Protocols

About Modem Tutorial
Copyright (c) 1991 Patrick Chen. All rights reserved.

Modem Tutorial Index

Error Control (Error-Correcting, Error Correction) Protocols

Besides high-speed modulation protocols, all current models of high-speed modems also support error control and data compression protocols.

V.42 and MNP-4

There are two standards for error control protocols: MNP 4 and V.42. The Microcom Networking Protocol, MNP, is developed by Microcom. MNP 2 to 4 are error correction protocols. MNP-5 is a data compression protocol. V.42 is established by CCITT. V.42 actually incorporates two error control schemes. V.42 uses LAP-M (Link Access Procedure for Modems) as the primary scheme and includes MNP-4 as the alternate scheme. Therefore, a V.42 modem will be able to establish an error-controlled connection with a modem that only supports MNP 4.

A modem that uses a proprietary modulation protocol may also use a non-standard error control protocol. For example, Hayes V-series Smartmodem 9600 supports an error control protocol called LAP-B. CompuCom's SpeedModem Champ also uses a non-standard error control protocol.

V.42 & MNP-4 can provide error-free connections

Modems without error control protocols, such as most 2400 bps Hayes-compatible modems, cannot provide error-free data communications. The noise and other phone line anomalies are beyond the capabilities of any standard modem to deliver error-free data.

V.42 (and MNP 2-4) copes with the phone line impairments by filtering out the line noise and automatically retransmitting corrupted data. If you have used a standard Hayes-compatible modem, you probably notice some garbled characters (like "@8d_\nw`[ce") show up on your screen from time to time. When two modems establish an error-controlled connection, they are said to have a reliable link and are capable of filtering out those garbled characters caused by the line noise. Notice that the line noise is still there, it just does not show up on your screen or the screen on the remote system.

The filtering process used by V.42 (and MNP 2-4) is similar to the error correction scheme used by file transfer protocols (such as Xmodem). The two modems use a sophisticated algorithm to make sure that the data received match with the data sent. If there is a discrepancy, the data is resent.

What is the difference between error control protocols (such as V.42) and file transfer protocols (such as Xmodem)?

For one thing, file transfer protocols provide error detection and correction only during file transfers. File transfer protocols do not provide any error control when you are reading e-mail messages or chatting with other people online. In other words, an error control protocol is "on" all the time during your online session and file transfer protocols are "on" only some of the times, namely when you are sending or receiving files.

Even though an error control protocol is "on" all the time, we still need file transfer protocols when two modems establish a reliable link. A modem works with bit streams, timing and tones. It does not understand what a file is. When you download or upload a file, your communications software needs to take care of the details related to the file: the filename, file size, etc. This is handled by the file transfer protocol which does more than error-checking.

Some file transfer protocols, most notably Ymodem-g and Imodem, are developed to handle file transfer without performing any error-checking. The idea of using a protocol like Ymodem-g is to eliminate the redundancy thus improve the transfer speed. Ymodem-g and Imodem should only be used with modems that provide built-in error control protocols. These file transfer protocols do not provide any error-detection or recovery capability. If a problem occurs during the file transfer, the transfer session will be aborted.

Protocols like Ymodem-g or Imodem depend on the modems to provide assurance for the integrity of data being transferred. However, you should know that a reliable link between two modems does not provide absolute guarantee for the data integrity during file transfer. When you call a remote computer, there are really three links involved in the process. Besides the link between the two modems, there are still one link between your computer and your modem and another link between the remote modem and the remote computer. When two modems make a reliable connection using V.42 or MNP 4, only the data integrity between the two modems is ensured. It is still possible for errors to occur at either end between the serial port and the modem (in the cable) or in the computer itself. (Fortunately, such errors are rare.)

For extra protection, you may still want to use a file transfer protocol - such as Zmodem - which also performs error checking even if you have a reliable link with the remote system. There is a common misconception that Ymodem-g is much faster than other file transfer protocols. Although Ymodem-g is significantly faster than Ymodem, it offers little over Zmodem. Zmodem has proven to be extremely efficient. (See benchmark below)

      
        Filename          Ymodem      Ymodem-g      Zmodem
        -------------------------------------------------------
        the-wave.txt      1527 cps    3261 cps      3296 cps
        dayrpt.arc         761        1042          1025  
        dayrpt.wks        1244        2314          2337
        sunset.arc         745         987           965
        sunset.pic        1297        2594          2588
        text109k.arc       814        1089          1064
        text109k.txt      1351        2812          2885
 
Note: The seven test files used throughout this article are available on the Hayes BBS (800-874-2937). It is an excellent source for information about Hayes products. The BBS also provides a database for thousands of BBS in the U.S. Best of all, it is free.

Unless noted otherwise, the results are obtained by using the following:

Computer: Mac SE with Mobius Two Page Display with 68030 accelerator
Modem: ATI 9600etc/e (the modem is set as V.32 with V.42bis enabled)
Operating System: System 7.0
Communication Software: ZTerm (Comm port speed set to 38400 bps)
File Transfer Protocol: Zmodem

All results are reported by ZTerm. (I use several communication programs on both IBM PC and Mac. All of them show the average throughput while file transfer is in progress, but ZTerm actually produces a report after the transfer is completed).

V.42 & MNP-4 can improve throughput

The other benefit of V.42 (or MNP 4) is that it can improve throughput. Before sending the data to a remote system, a modem with V.42 (or MNP 4) assembles the data into packets and during that process it is able to reduce the size of the data by stripping out the start and stop bits.

A character typically takes up 1 start bit, 8 data bits and 1 stop bit for a total of 10 bits. When two modems establish a reliable link using V.42 or MNP 4, the sending modem strips the start and stop bits (which subtracts 20% of the data) and sends the data to the other end. The receiving modem then reinserts the start and stop bits and pass the data to the remote computer.

Therefore, even without compressing the data you can expect to see as much as 1150 characters per second on a 9600 bps connection. (Although the modem subtracts 20% of the data, the speed increase is less than 20% due to the overhead incurred by the error control protocol.) Here are the test results obtained by downlaoding the same file (1) without any error control protocol, (2) with MNP-4, and (3) with V.42. No data compression protocol is used.

        Filename               No EC        MNP-4        V.42
        ------------------------------------------------------------------
        the-wave.txt           935 cps      1151 cps     1128 cps
        dayrpt.arc             863          1023         1002
        dayrpt.wks             898          1071         1052
        sunset.arc             838           971          953
        sunset.pic             903          1080         1065
        text109k.arc           908          1085         1064
        text109k.txt           937          1150         1127
             
Are MNP4 and V.42 useful?

Absolutely. Anyone that has ever used a standard modem can appreciate the benefit of an error-free connection. And the increase in data throughput, though modest, is nothing to sneeze at.

Next Data Compression Protocols

Modem Tutorial Index