Computer Communication Networks CS-418: Lecture 4 - 1 Data Link Layer Protocols - HDLC
Computer Communication Networks CS-418: Lecture 4 - 1 Data Link Layer Protocols - HDLC
CS-418
Lecture 4 – 1
Data Link Layer Protocols - HDLC
• Asynchronous response mode (ARM): Used with an unbalanced configuration. The secondary may
initiate transmission without explicit permission of the primary. The primary still retains
responsibility for the line, including initialization, error recovery, and logical disconnection.
Original Pattern
111111111111011111101111110
• The address field identifies the secondary station that transmitted or is to receive the
frame.
• This field is not needed for point to point links but is always included for the sake of
uniformity.
• The address field is usually 8 bits long but, by prior agreement, an extended format may be
used in which the actual address length is a multiple of 7 bits.
• The leftmost bit of each octet is 1 or 0 according as it is or is not the last octet of the
address field. The remaining 7 bits of each octet form part of the address.
• The single octet address of 11111111 is interpreted as the all stations address in both basic
and extended formats. It is used to allow the primary to broadcast a frame for reception by
all secondaries.
• Information frames (I-frames) carry the data to be transmitted for the user . Additionally, flow and error control
data, using the ARQ mechanism, are piggybacked on an information frame.
• An I-frame is distinguished by the first bit of the control field being a binary 0.
• The control field of an I-frame contains both a send sequence number, N(S), and a receive sequence number,
N(R), which are used to facilitate flow control.
• N(S) is the sequence number of frames sent and N(R) the sequence number of frames successfully received by
the sending node prior to the present frame being sent.
• Thus the first frame transmitted in a data transfer has send and receive sequence numbers 0,0.
• Since 3 bits are available for each of the sequence numbers N(S) and N(R), they can have values only between 0
and 7, that is they use modulo-8 numbering. This imposes a limit on the size of the windows used for flow control.
• I-frames also contain a poll/final (P/F) bit. This acts as a poll bit when used by a primary station and a final bit by
a secondary.
• A poll bit is set when a primary is transmitting to a secondary and requires a frame or frames to be returned in
response, and the final bit is set in the final frame of a response.
• Unnumbered frames do not contain any sequence numbers and are used for various control functions.
• They have five function bits which allow for the fairly large number of commands and responses , but not all 32
possibilities are used.
24
Spring Semester 2021
HDLC - Information & FCS Field
25
Spring Semester 2021
HDLC Operation
• HDLC operation consists of the exchange of I-frames, S-frames,
and U-frames between two stations.
• The operation of HDLC involves three phases.
• First, one side or another initializes the data link so that
frames may be exchanged in an orderly fashion. During this
phase, the options that are to be used are agreed upon.
• After initialization, the two sides exchange user data and the
control information to exercise flow and error control.
• Finally, one of the two sides signals the termination of the
operation.
26
Spring Semester 2021
HDLC Operation - Initialization
• Either side may request initialization by issuing one of the set mode
commands. This command serves three purposes:
• It signals the other side that initialization is requested.
• It specifies which of the three modes (NRM,ABM,ARM) is
requested.
• It specifies whether 3- or 7-bit sequence numbers are to be used.
• If the other side accepts this request, then the HDLC module on that
end transmits an unnumbered acknowledged (UA) frame back to the
initiating side.
• If the request is rejected, then a disconnected mode (DM) frame is
sent.
27
Spring Semester 2021
• Figure shows the frames involved in link setup and
disconnect.
• The HDLC protocol entity for one side issues an SABM
command to the other side and starts a timer.
• The other side, upon receiving the SABM, returns a UA
response and sets local variables and counters to their initial
values.
• The initiating entity receives the UA response, sets its
variables and counters, and stops the timer.
• The logical connection is now active, and both sides may
begin transmitting frames.
• If the timer expire without a response to an SABM, the
originator will repeat the SABM.
• This would be repeated until a UA or DM is received or until,
after a given number of tries, the entity attempting initiation
gives up and reports failure.
• The figure shows the disconnect procedure. One side issues
a DISC command, and the other responds with a UA
response.
Spring Semester 2021 28
HDLC Operation – Data Transfer
• When the initialization has been requested and accepted, then a logical
connection is established.
• Both sides may begin to send user data in I-frames, starting with
sequence number 0.
• The 𝑁(𝑆) and 𝑁(𝑅) fields of the I-frame are sequence numbers that
support flow control and error control.
• An HDLC module sending a sequence of I-frames will number them
sequentially, modulo 8 or 128, depending on whether 3- or 7-bit sequence
numbers are used, and place the sequence number in 𝑁(𝑆).
• 𝑁(𝑅) is the acknowledgment for I-frames received; it enables the HDLC
module to indicate which number I-frame it expects to receive next.
29
Spring Semester 2021
• Figure shows full duplex exchange of I-frames.
• When an entity sends a number of I-frames in a
row with no incoming data, then the receive
sequence number is simply repeated.
• When an entity receives a number of I-frames in a
row with no outgoing frames, then the receive
sequence number in the next outgoing frame
must reflect the cumulative activity.
• Note that, in addition to I-frames, data exchange
may involve supervisory frames.
34
Spring Semester 2021
• The figure shows the disconnect procedure. One side issues
a DISC command, and the other responds with a UA
response.