分类:
2011-09-28 09:57:45
Sending a fax is far more complex than just dialing a phone number and sending an image. The calling unit must first confirm that the call is being answered by an actual fax device rather than a data modem, answering machine, or human being. Once it is determined that two fax devices are talking to each other, these devices must then exchange information to find out what capabilities they both support (e.g., data transmission rate, image resolution, data compression schemes, paper size). They then must agree on a mutually supported subset of these capabilities. Next, the phone connection must be evaluated to determine the maximum practical data rate available. Finally, the fax image is sent. However, it is possible that noise or distortion will corrupt the image during its transit of the connecting network. To check for this possibility, the receiving fax device must evaluate the image and send an acknowledge message indicating whether the image was received correctly or whether it had an unacceptable number of errors.
The basic system structure of the typical fax device is shown in Figure 1.
The protocol for sending or receiving a fax image and exchanging associated messages is defined in the International Telecommunications Union (ITU) Recommendation T.30. The sequence proceeds as follows:
In a similar manner, received images are extracted from the T.30 message sequences, decompressed, and printed or stored. The sequence of events in a simple call with no errors is shown as the following:
As mentioned earlier, a fax call consists of different phases, starting with dialing the number, proceeding through exchange of capabilities data and the transmission of the image, and ending with hanging up. These phases are as follows:
The basic fax call phases are described in detail in the following sections.
Call-Setup SequenceThe call-setup sequence starts with detecting dial tone and dialing the number and ends with the detection of answer tone as follows:
Figures 2 and 3 show the call-setup tones used in fax call setup.
Frequency tolerance = 1100 Hz ±38 Hz
Timing tolerance = ±15%
Frequency tolerance = 2100 Hz ±15%
Pre-Image Handshake SequenceAfter sending a 2100-Hz answer tone for approximately 3 seconds, the answering fax unit sends a handshake message to identify itself and list its capabilities.
Digital Identification Signal (DIS) Handshake Message(comment: Send by the receiver)The calling fax unit responds with configuration data specifying the parameters to be used in transmitting the image.
Digital Command Signal (DCS) Handshake Message(comment: send by the sender)Handshake messages are strings of data bytes used to negotiate image data rate, resolution, compression, and so on. The modulation used is defined in ITU Recommendation V.21
Handshake messages start with a preamble of flag characters (01111110 in binary or 7E in hex) repeated for 1 second ±15% and followed by one or more frames of five or more bytes each (see Figure 5). Each frame is preceded and followed by at least one flag character.
Each frame ends with a 2-byte, frame check sequence, which is calculated over all the data in the frame and is used as a validation check. Data within frames (including the frame check sequence) is processed according to the high-level data link control (HDLC) standard (shown in Figure 6), in which temporary zeros are inserted in the frame data after every five consecutive ones before transmission to prevent false flags from being detected. These temporary zeros are removed when the frame is received.
Note: In multiframe handshake messages, such as those used to exchange capabilities data at the beginning of a call, the T.30 standard specifies the order in which the frames should be transmitted. However, there are many fax machines in use today that do not follow the standard in this regard. Testing is required to make sure that any new fax system is compatible with these older fax machines, which violate the standard.
Line Testing SequenceAfter the initial handshake messages exchanged to determine mutually supported capabilities (including the proposed modulation scheme and data rate), the calling unit sends a test pattern to test the phone line.
Training Check Function (TCF) Test Pattern (shown in Figure 7)(comment: send by the sender)The answering fax unit responds with a handshake message indicating acceptance or rejection of the test pattern, using either of the following:
Or
The basic line testing sequence starts with DCS sent by the calling unit to specify proposed data rate and image parameters. The DCS is followed with a training pattern at the specified data rate. The answering unit responds to the TCF with CFR if the TCF pattern was received correctly or with FTT if the TCF test pattern was judged to be faulty. If the calling unit receives an FTT, it then sends a new DCS specifying a new data rate followed by a TCF test pattern at the new rate. This process is continued until a TCF test pattern is received or until all data rates have been attempted.
Note: No guidance is provided in the T.30 standard for evaluating a TCF test pattern. The algorithm used to decide whether the phone line is adequate for the proposed data rate is at the discretion of each manufacturer. Also, if an FTT message is received, the standard provides no guidance as to what action to take next: drop down to a lower data rate, try the same data rate again, or discontinue the call.
Image Transmission SequenceAfter testing the phone line and agreeing on a data rate, the calling fax unit sends one or more image sequences consisting of an image followed by a post-image handshake message and an acknowledging handshake message from the receiving unit:
Image DataThe answering fax unit analyzes the received image and responds with acceptance or rejection:
Message Confirmation (MCF)–Retrain Positive (RTP) or Retrain Negative (RTN) Handshake MessageThe basic image transmission sequence starts with the calling unit sending an image using the agreed-upon data rate and image parameters. Immediately following the image, the calling unit sends an EOP, MPS, or EOM handshake message to indicate final image, more images to come, a request for polling, or a change of parameters (for example, different resolution, paper size). The answering unit responds to the EOP, MPS, or EOM message with MCF if the image was received, responds to the RTP if image was received with some errors and the phone line must be retested before receiving additional images, or responds to the RTN if the image was unacceptable. If the calling unit receives an MCF message, then it sends additional images, if any, or sends DCN and disconnects if done. If the calling unit receives an RTP or RTN message, then it sends a new DCS/TCF sequence to retest the phone line before sending any more images.
Note: No guidance is provided in the T.30 standard for evaluating an image. The algorithm used to decide whether an image is acceptable or whether the phone line should be retested is the discretion of each manufacturer.
Image Modulation and Data FormatImages are transmitted at data rates from 2.4 kbps to 14.4 kbps using V.27 ter, V.29, or V.17 modulation, as determined during the pre-image handshake exchange and line testing sequence. Images are compressed prior to transmission using compression schemes specified in the T.4 or T.6 standards.
V.27 ter, V.29, V.17—Used for Transmitting ImagesT.4 One-Dimensional (1D) Compression
Coding for sample line in Figure 9 is shown in Table 1.
2 white | 4 black | 7 white | 2 black | 10 white | 7 black | 10 white |
0111 | 011 | 1111 | 11 | 00111 | 00011 | 00111 |
T.4 Two-Dimensional (2D) Compression
Each scan line is compared with the immediately preceding line (reference line), and the differences are encoded. Three different types of coding are used: vertical mode, pass mode, and horizontal mode. Vertical mode is used when a color transition in the coding line is within 3 pixels of a reference line transition. Code words represent transition separations from zero to 3 pixels.
Pass mode (shown in Figure 11) is used when a complete block of pixels in the reference line is absent from the following line. Each missing block is encoded as: 0001.
Horizontal mode (shown in Figure 12) is used when other modes are less efficient or when color transitions are displaced by 4 or more pixels. A 001 code word is followed by 1D coding words for the next two run lengths.