Google Custom Search     

Physical Layer

X.21/X.21 bis

In the ISO layered protocol model, a physical layer is responsible for transmitting an arbitrary bit stream across a physical medium. The LayGO® X.21 module uses X.21 or X.21 bis signaling protocol: DTR/DSR for connect/disconnect and RTS/CTS for XON/XOFF.

X.21 layer normally uses the services of a block mode communication driver with HDLC/SDLC or Bi-Synchronous framing. Protocols such as SNA, HDLC, LAPB, LAPD, LAPM (V.42), ISDN, Frame Relay, PPP use HDLC framing.

To save cable costs, hardware control signals are often replaced by software control signals. For synchronous protocols, FLAG or SYNC character detection may replace DTR/DSR to indicate that the physical layer is connected. The use of physical signals is configurable in LayGO®.

X.21 bis Function Mapping
ConnectRequest Enables the line and raises both DTR and RTS signals. When DSR, CTS signals come up and the FLAG character is detected, data transfer state is entered. If DSR, CTS or FLAG signals do not come up before the connect timer expires, returns to the open state.
ConnectAccept Not used (see below under Listen).
ConnectReject Not used.
Listen Enables the line and watches DSR and CTS. If DSR and CTS signals come up, DTR and RTS are raised and data transfer state is entered.
DisconnectRequest DTR and RTS signals are dropped. The open state is entered when DSR drops or the disconnect timer expires.
DisconnectConfirm Not used.
Write Data buffer is queued to the hardware.
WriteSpecial Not used.
Xoff RTS signal is dropped.
Xon RTS signal is raised.
ResetRequest RTS signal is raised and CTS is monitored. If CTS is up, the layer is in data transfer xon state, if not it is in data transfer xoff state.
Reopen Immediately returns the physical layer to the open state. Drops DTR and RTS and disables the line, but does not wait for any response. Use only as a last resort.

Bisynchronous

Bisynchronous is a byte synchronous physical layer transfer protocol. Synchronization between transmitter and receiver is accomplished by starting each frame with a special pattern. The pattern normally consists of a sequence of 2 or more special characters called the SYN character. (The binary pattern of the SYN character varies depending on the implementation.) Frames are normally terminated with a 16-bit Frame Check Sequence to permit error detection (but not error correction).

Since the Bisynchronous protocol determines how frames are physically transferred, the LayGO® Toolkit implements the protocol inside of the hardware device driver retaining the standard X.21 bis protocol layer as the physical layer.

HDLC/SDLC

HDLC or High-level Data Link Control was derived from IBM's Synchronous Data Link Control (SDLC) protocol. Both have in common the use of a unique character, called the FLAG, to delimit each frame.

The closing FLAG is preceded by a 2 (or 4) byte Frame Check Sequence (FCS) better known as CRC (Cyclic Redundancy Check). 7E hex (01111110 binary) is used as the FLAG character. To avoid ambiguity with a 7E character in the user data, the transmitter inserts a 0 after 5 consecutive 1s, and the receiver deletes a 0 if it follows 5 consecutive 1s. This process is called bit-insertion/bit-deletion or "bit-stuffing".

7E 7E Data ... Data FCS FCS 7E Data ... Data FCS FCS 7E 7E

If a frame can not be transmitted in its entirety (transmit under-run), the transmitter may ABORT the frame by sending at least 7 consecutive 1 bits.

If the receiver hardware detects the ABORT sequence, it may signal the driver about this event. It is up to the higher layer to decide what to do with aborted frames.

During the transmission of a frame, a cumulative checksum is calculated and attached to the end of the frame. The receiver recalculates the checksum and compares them. If they do not match, an FCS error is signaled to the driver, It is up to the higher layer to decide what to do with the frame.

If HDLC is used in its raw form (without any additional framing protocol), we call it Raw Mode HDLC (RMH). It can be used for point-to-point connection with error detection (no correction!). The connection may be simplex, half-duplex or full-duplex.

Advanced Relay's X.21/X.21 bis layer normally uses HDLC framing with or without additional hardware signals (DTR/DSR, RTS/CTS). Refer to the X.21/X.21 bis layer documentation for the details of the protocols. It is possible not to use any physical signals, relying only on FLAG detection or unconditional connect if a connect request is issued.

Many of today's link protocols are based on HDLC with additional framing protocol: Frame Relay, LAPM (Link Access Procedures for Modems) better known as V.42, LAPB (Link Access Procedures Balanced), LAPD (Link Access Procedures for ISDN D-Channel), V.120 (used in ISDN Terminal Adapters), synchronous PPP, LLC (logical Link Control) IEEE 802.2. The latter normally uses a 4-byte FCS. Advanced Relay's NT NDIS RAS driver uses RMH. Most WAN Routers and Bridges use HDLC framing.

X.25 indirectly uses HDLC, because it uses LAPB or LAPD as link protocol.