Unit 2

Lesson 4 - HDLC Protocol

Overview

Originally, WAN network speeds were low compared to LAN speeds, but modern carrier technologies have raised the transfer rates by several orders of magnitude. Whereas 9,600 bits per second (bps) and 19.2 kilobits per second (Kbps) WANs were commonplace in earlier days, services such as T1 (1.544 megabits per second [Mbps]), T3 (45 Mbps), and SONET OC-12 (622 Mbps) are more prevalent in today's wide area networks.

In addition to carrier technologies, more efficient protocols are being utilized in WANs. For example, frame relay has replaced X.25 and offers increased efficiency by taking advantage of the higher reliability inherent in today's fiber link infrastructure. Frame relay is often found riding on T1 (E1--European standard) carriers and is being seen more frequently as the protocol used between network routers.

Wide area networking is generally placed into two categories:

Circuit switched--After a circuit is established, such as a telephone call, a connection is made and the path is static (there are some exceptions). The session then takes place with very little addressing overhead. A certain amount of addressing is still required, because multiple stations can exist in a multipoint or cloud-type network.

Packet switched--Information packets, carrying full addressing as well as data, are sent over virtual circuits established between end nodes.

One of the more common Data Link Layer protocols is HDLC. Two legacy protocols that are subsets of this Data Link Layer protocol are Synchronous Data Link Control (SDLC), which is still used in IBM SNA remote environments, and Link Access Protocol Balanced (LAPB), which is used in X.25 environments. In HDLC, there are three types of link stations defined as shown on the HDLC Configurations Diagram.

HDLC Configurations

HDLC Configurations

Primary station--Sends command and accepts responses (the controlling node). This configuration is seen in IBM hosts, specifically in front-end communications controllers. It is further described as a polling environment.

Secondary station--Accepts commands and sends responses (the controlled node). This configuration is seen in equipment called cluster controllers that communicate over remote lines with an IBM mainframe.

Combined station--Sends or accepts commands and responses (this type appears in what is called balanced configurations, such as LAPB).

The HDLC Frame Format Diagram shows the fields in an HDLC frame.

HDLC Frame Format

HDLC Frame Format

The fields are defined as:

Flag (1 byte [octet])--Used for synchronization of the bit stream. Each frame starts off with this flag containing a 7Eh character. Only the flag byte will have 6 bits in a row turned on. There are 6 contiguous bits set to a binary one in a hexadecimal 7E. If a character that has 6 or more consecutive bits set to one needs to be transmitted, a technique called zero bit insertion, or "bit stuffing," is used to ensure the data character is not mistaken for a flag character. If a data character were mistaken for a flag, a false end-of-frame condition would occur. This extra 0 bit is stripped off by the hardware at the receiver before forwarding the frame to the higher layers.

Address, (1 or 2 bytes)--Contains the address of the secondary station.

Control (1 or 2 bytes)--Denotes the type of frame (information, supervisory or unnumbered) and contains counters to keep track of received and sent frames for acknowledgment and flow control. The Control field is used much like as described in an earlier lesson on the LLC 802.2 frame, where "RR" (Receiver Ready) and "RNR" (Receiver Not Ready) serve as flow control characters and N (r and s) track frame counts.

Information (the "I" field, variable)--Contains the data, if any. For most HDLC stations, this field is usually no larger than either 256 or 512 bytes, although there are some implementations that may transmit larger frames.

FCS (Frame Check Sequence, 2 or 4 bytes)--Contains a checksum to ensure data integrity.

Flag (1 byte)--Used to signal the end of a frame and possibly the start of the next frame if the next frame immediately follows.

The various commands used in HDLC are listed in the HDLC Commands Table.

HDLC Commands

Field Type

Field ID

Function

Information

I

 Exchange user data (data from the
 Network Layer)

Supervisory

RR

 Receiver ready--positive
 acknowledgment

Supervisory

RNR

 Receiver not ready--positive
 acknowledgment

Supervisory

REJ

 Reject--negative
 acknowledgment, go back N frames

Supervisory

SREJ

 Selective reject--negative
 acknowledgment, selective repeat

Unnumbered

DISC

 Disconnect--terminate connection

Unnumbered

DM

Disconnect mode--secondary
 disconnect

Unnumbered

FRMR

Frame reject

Unnumbered

RSET

Reset

Unnumbered

SABM

Set asynchronous balanced mode

Unnumbered

SARM

Set asynchronous response mode

Unnumbered

SIM

Set initialization mode

Unnumbered

SNRM

Set normal response mode

Unnumbered

TEST

Test

Unnumbered

UA

Unnumbered acknowledgment

Unnumbered

RIM

Request initialization mode

Unnumbered

RD

Request disconnect

Unnumbered

UI

Unnumbered information

Unnumbered

UP

Unnumbered poll

Unnumbered

XID

Exchange identification

Operation

A typical unbalanced HDLC session would use the following command and response sequence to connect:

SNRM (Set Normal Response Mode) command would be sent from the primary station.

UA (Unnumbered Acknowledgment) response would then be returned from the secondary.

The primary station would then issue an RR command with the "p" bit (p/f) set, in effect polling the secondary for information, or just sending information of its own followed by an RR sequence with the Poll bit set in the Control field. The Poll bit gives the secondary permission to send, and when it is finished, it sets the same bit in the Control field that is occupied by the Poll bit. However when the secondary sets it, it is referred to as the Final bit. If, for any reason, the secondary were not at a point where it could receive more data, an RNR command would be sent back to the primary station. The primary would continue polling the secondary until an RR command was returned. Data transfers could then continue. When the communication session is over, the primary sends a DISC (Disconnect) command, and the secondary responds with UA to acknowledge, often followed with a DM (Disconnect Mode) to confirm the secondary is now disconnected.

In a balanced configuration, a SABM or SABME (E = Extended) would be used. The SABME command (not shown in the table) is used to indicate a station's desire to use the larger window size (modulo 128) versus the smaller size (modulo 8), which would be selected if a SABM command were issued. This would affect whether the HDLC Control field uses one or two bytes.

[ Previous Section ] [ Unit Contents ] [ Next Lesson ]