Chinaunix首页 | 论坛 | 博客
  • 博客访问: 270457
  • 博文数量: 34
  • 博客积分: 903
  • 博客等级: 准尉
  • 技术积分: 428
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-31 10:23
文章分类

全部博文(34)

文章存档

2012年(3)

2011年(31)

我的朋友

分类:

2011-09-28 09:57:45

Fax Operation Overview

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.

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 1. Basic Fax System Structure and Process

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:

  1. An image to be transmitted is first scanned to create a bit map in which black and white dots are represented by ones and zeros.
  2. This bit map is compressed to eliminate redundant data and then passed to a T.30 protocol handler, a set of software routines that manages the exchange of capability information and image transmission.
  3. The data is finally passed to a modem for transmission through the network.

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:

  1. Calling unit dials phone number and waits for answer.
  2. Answering unit detects RING and answers call.
  3. Answering unit identifies itself as a fax device and lists its capabilities.
  4. Calling unit responds with message specifying transmission parameters.
    • data rate
    • image resolution
    • data compression method to be used
    • image size, etc.
  5. Calling unit sends sample data pattern to test phone-line connection.
  6. Answering unit evaluates sample data pattern and either accepts proposed data rate or requests a lower data rate.
  7. Calling unit sends image.
  8. Answering unit acknowledges receipt of image.
  9. Call ends.

Fax Technology and Testing Issues

Figure 1. Basic Fax System Structure and Process

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:

  1. call setup
  2. premessage handshake procedure
    • Calling and answering fax devices identify themselves and exchange capabilities data.
    • Transmission parameters are selected.
  3. line testing procedure
    • The calling unit sends a test pattern to determine the maximum data rate.
    • The answering unit either accepts the data rate or requests a lower rate.
  4. image transmission
    • The calling unit sends image using agreed-upon compression methods.
  5. post-image handshake procedure
    • end of message confirmation
    • multidocument procedures
  6. call release

The basic fax call phases are described in detail in the following sections.

Call-Setup Sequence

The call-setup sequence starts with detecting dial tone and dialing the number and ends with the detection of answer tone as follows:

  1. Detect dial tone.
  2. Dial number.
  3. Calling fax unit sends 1100-Hz announce tone (for automatic operation).
    Note: Not all fax machines generate this signal.
  4. Answering fax unit detects ring signal.
  5. Answering fax unit sends a 2100-Hz answer tone.
    Note: Some fax machines send a Group-2 tone (1850 Hz) instead of 2100 Hz, and other fax machines omit an answer tone altogether and just start with the first handshake message.
  6. Connection is established—begin premessage handshake.

Figures 2 and 3 show the call-setup tones used in fax call setup.

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 2. Calling Unit Announce Tone (CNG)

Frequency tolerance = 1100 Hz ±38 Hz
Timing tolerance = ±15%

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 3. Responding Unit Answer Tone (CED)

Frequency tolerance = 2100 Hz ±15%

Pre-Image Handshake Sequence

After 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)
  • modulation=V.21 frequency shift keying (FSK), 300 bps
  • lists capabilities, including the following:
    • data rates supported
    • image resolution supported
    • data compression mode supported
    • image size supported
  • optionally includes international phone number and manufacturer-specific proprietary features

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)
  • modulation=V.21 FSK, 300 bps
  • lists proposed call parameters:
    • data rate selected
    • image resolution selected
    • data compression mode selected
    • image size selected
  • optionally includes international phone number and manufacturer-specific proprietary features
  • capability data exchanged; continue with the line testing phase
Handshake Message Modulation and Data Format

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

  • data signaling rate=300 bps half-duplex, synchronous
  • bit encoding method (shown in Figure 4)—FSK
  • Zeros are represented by 1850 Hz
  • Ones are represented by 1650 Hz

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 4. Frequency Shift Keying

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.

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 5. Handshake Message Format

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.

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 6. HDLC Frame Structure

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 Sequence

After 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)

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 7. TCF Test Pattern

  • modulation = V.17, V.29, V.27, as specified in digital command signal (DCS) message
  • data rate as specified in DCS message
    • tests phone line to determine maximum acceptable data rate
    • continuous zeros transmitted for 1.5 seconds ±10%
  • The test pattern consists of 1.5 seconds of continuous zero bits.

The answering fax unit responds with a handshake message indicating acceptance or rejection of the test pattern, using either of the following:

  • confirmation to receive (CFR) handshake message
  • modulation=V.21 FSK=300 bps
  • accepts TCF test pattern data rate

Or

  • failure to train (FTT) alternative handshake message
  • modulation=V.21 FSK=300 bps
  • rejects TCF test pattern data rate

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 Sequence

After 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 Data
  • modulation=V.17, V.29, V.27 ter, as specified in DCS message
  • data rate as specified in DCS message
  • data compression, resolution, paper size, etc., as specified in DCS
Post Image Handshake-End of Procedure (EOP), Multipage Signal (MPS), or End of Message (EOM)
  • modulation=V.21 FSK=300 bps
  • EOP indicates final image-disconnect to follow after acknowledgment.
  • MPS indicates more images to follow after acknowledgment.
  • EOM indicates polling request or possible parameter change after acknowledgment.

The answering fax unit analyzes the received image and responds with acceptance or rejection:

Message Confirmation (MCF)–Retrain Positive (RTP) or Retrain Negative (RTN) Handshake Message
  • modulation=V.21 FSK=300 bps
  • MCF accepts image.
  • RTP accepts image but requests retest of line before receiving additional images.
  • RTN rejects image.
  • Image acknowledged; send additional images or send DCN and disconnect.

The 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 Format

Images 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 Images
  • data signaling rate—2.4 to 14.4 kbps half-duplex, synchronous
  • bit encoding method—combination of phase and amplitude modulation (shown in Figure 8)

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 8. Phase and Frequency Modulation

T.4 One-Dimensional (1D) Compression

  • Run length codes (shown in Figure 9) are used to represent strings of all-white or all-black pixels.

    Fax Technology and Testing Issues - foxzenith - foxzenith的博客
    Figure 9. Run Length Codes

  • Run lengths of up to 63 consecutive all-white or all-black pixels are coded with terminating codes.
  • Run lengths of 64 or more pixels are coded with makeup codes plus terminating codes.
  • First data line is preceded by EOL (000000000001).
  • Each line starts with white run length code. If the line starts with black, then a zero run length white code is used (00110101).

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

Table 1. Sample Line Code

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.

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 10. Two-Dimensional Compression

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.

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 11. Passed Block Encoding

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.

Fax Technology and Testing Issues - foxzenith - foxzenith的博客
Figure 12. Horizontal Mode Encoding

阅读(1229) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~