Chapter 7 - Data Link Layer
It is about various protocols being used in
data link layer, the second lowest layer in
ISO/OSI reference model.
The protocols are generally classified into
byte oriented and bit oriented protocols.
Error detection and correction is done in
this layer by re-transmitting the error
Understand the functions of data link layer
Identify the structure of Bisync frame or
Understand high level Data Link Control
Functions of Data Link Layer
Frame Flow control, To prevent the sender from
sending too fast.
Error Control and Detection, To maintain the
frames being transmitted/received are in
sequence and to make sure the frames haven't
been distorted due to transmission error.
Link awareness, To monitor the link conditions
and ensure the other end is still alive.
Example of Flow Control
Other Link Protocols
High Level data Link Control (HDLC: ISO). It is also
the superset of SDLC, LAP and LAPB.
Synchronous Data Link Control (SDLC: IBM). It is
the proprietary product of IBM System Network
Advanced Data Communication Control
Procedure (ADCCP: ANSI)
Link Access Protocol (LAP: ITU-T)
Hewlett Packard Data Link Control (HPDLC: HP)
Layer 2 frame
Protocol Data Unit (PDU) for data link layer
is often called a frame
• Header, Data Field.............., Trailer
The header: called PCI in OSI model) and
contains control information.
Data Field: Data
Trailer: Frame Check Sequence
Sources of error
• It is present in all electronic devices and cannot be
eliminated by any circuits.
• It is caused by picking up the unwanted
electromagnetic signals nearby such as crosstalk due
to adjacent cables transmitting electronic signals or
lightning causing power surge.
• Noise sometimes is caused by human being such as
plugging or unplugging the signal cables, or power
on/off the related communications equipment.
Example of the presence of noise
Shielding (with protection)
Changing multiplexing techniques
Improving connection quality with better
A few codes or bits in association with the
data are appended to the
frame so that the receiver can detect the
presence of error by using a simple
• Vertical Redundancy Check
• Longitudinal Redundancy Check
• Cyclic Redundancy Check
Vertical Redundancy Check
A single bit either '1' or '0' is appended to the end of each
character to produce an odd or even number of '1' bits.
This method is commonly used in start/stop transmission
Longitudinal Redundancy Check
This method is better than a simple Vertical
The data is grouped into blocks of
characters, say for example 12 bytes.
A block check character (BCC) is then
appended to the end of each transmission
The size of BCC can be 8, 12 or 16 bits
depending on the algorithm.
Cyclic Redundancy Check
This is a faster method and is commonly used in protocol
operating at synchronous mode such as SDLC.
In this method, the data to be sent is divided by a set of
binary constant called the generator polynomial.
The remainder after division called Frame Check
Sequence (FCS) will be appended to the original data
The original data plus the frame check sequence will be
transmitted over the transmission media.
Byte and Bit protocols
The data link layer protocols based on the
can be classified into:Byte oriented such
as IBM BSC
• SYN, SYN, DLE, STX, Data, DLE, ETX, BCC, BCC
Bit oriented such as HDLC (High level Data
Link Procedure) or SDLC
• Flag, Address, Control, Data........, FCS, FCS
This type of protocols was developed a long
A well known example is the IBM BISYNC
protocol used in Remote Job Entry (RJE).
Although this protocol is pretty old, it is still
used by Banks as one of the protocols
because of reliability.
Half duplex in Data Link Level ( can have FDX or HDX in
Data link Level (not in physical level)
An industry standard
Used in Synchronous modem (Some users may use
Sync/Async protocol converter to fit into his own system
such as Reuters.)
Uses either ASCII or EBCDIC as the code sets
Ideal for Low speed and High volume transaction
Uses VRC, CRC or LRC to determine transmission error
Since BISYNC uses a lot of binary characters (STX, SYNC)
for control purpose, a pair of special characters DLE is
used to quote the binary data so that the receiver will
transparently treat the bracket data.
For example, Binary data contains STX will be converted
by DLE STX to inform the receiver that STX is not the start of
text but part of data.
Use of DLE to quote data is called byte stuffing
BSC Line States
There are FOUR line states that BSC will be used to
transfer data. Initially, BSC will be in disconnected state
until it receives an event, it will then change to other state
and take appropriate action.
Disconnected, No virtual connection has been established
Connected, A virtual connection has been established.
The line can then move to Text or Control state.
Control, Can exchange control information such as ENQ or
Text, Data frame is exchanged.
It is to lay down rules to control if a sender
can transmit a frame.
For simplicity, both send and receive party
can be considered to consist of a sender
and a receiver.
Normal BSC Data Flow (BSC
It shows the normal data flow with acknowledgment
The transmitter initially transmits an ENQ and waits for an
ACK0 prior to sending the test frame.
Line Bid Time outs (BSC
After polling the remote for eight times, the
sender may assume that the remote
machine is dead (usually power off) and
will stop polling.
Error Control - NAK (BSC Contention)
A NAK (negative acknowledgment) will be sent back to the
transmitter, if the received data has detected a transmission error by
checking the received frame against the Block Check Character
Error Control - Lost Acknowledgment (BSC
If the transmitter cannot receive the acknowledgment
from the receiver, it will send an ENQ instead of data frame
and waits for the positive acknowledgment from the
Error Control - Lost Message (BSC
The transmitter will send an ENQ instead. However, the
receiver will send an ACK0 instead of ACK1 after receiving
the second ENQ
WAIT FOR ACK - WACK (BSC
If the receiver is busy, it will respond an
WACK to temporarily stop the sender until
the busy condition is removed.
Temporary Text Delay - TTD (BSC
In this case, the sender is busy, it delays for
2 seconds and sends an TTD to inform the
receiver to suspend the transmission.
Duplicated frames occur for various reasons such as lost
It shows the duplication of data frame due to lost frame.
and the condition when the receiver is too late to
acknowledge the frame.
These protocols interpret the message as a
stream of unstructured bits and uses the relative
bit position to determine the control information.
This mechanism is more efficient compared to
byte-oriented protocols and is extremely suitable
for simultaneous communications protocols
such as HDLC and SDLC.
The entire message is delineated by a Flag
whereas the BSC has to use numerous control
fields such as SYNC, STX etc.
Control field format
There are three different formats for this fields, with a few
bits assigned to identify which format is being sent.
Information format (I), Supervisory format Non sequence
Bit-oriented protocols use a unique
sequence of bits such as 7E for the start and
end of frame.
To avoid an occurrence of this flag bit
pattern (01111110) anywhere, the sending
station will automatically insert an extra
zero into the five contiguous '1' bit stream.
The receiving station will monitor the bit
stream and delete the extra zero.
The High-level data link control protocol
(HDLC) is a full-duplex bit-oriented protocol.
This protocol has a few configurations
There are two methods namely rate control and sliding
window to regulate the flow of frames.
Sliding window uses the size of sending window to
restrict the number of frames being sent out.
• Link Initialization & Disconnection
• Sliding Window (The normal value is 7 for 3-bit control
• It consists of
– Sending Window
– Receiving Window
– Error Handling
It shows the methods of establishing a call under
three response modes. UA frame is used to
respond to all three cases.
It shows the methods of terminating a call
under three response modes
Sliding Window Example
It shows two examples of using sliding send windows to
control the number of frames to be delivered.
In case 1, the transmitter can send out a series of frame
numbered from 0 to 6 and in case, it sends out from 0 to 4
In case there is a transmission error, the receiver simply
responds a Reject frame against the corrupted frame or a
In case various errors as listed below are not caused by
transmission, the receiver will send a FRMR such as
• Bad Address field
• Fewer than 32 bits between flags
• Information field is not a multiple of 8 bits
Receiver does nothing upon receipt of an invalid frame. It
simply reports this event to higher layer and waits for a
Go Back N, Error Handling
An REJ signal is sent to A for an invalid frame of sequence
5. Note that A has to re-send the data frame starting from
sequence 5. A B
I 6,0 Invalid Frame
REJ 5 frame discarded
Information frame = i
REJ frame = REJ NR
Selective Repeat, Error Handling
An SREJ frame is sent from B to A for an
invalid frame of sequence 4 as shown
below Information frame = i
SREJ frame = SREJ NR
A I 0,0 B
I 5,0 Invalid Frame
I 6,0 frames buffered
I 4,0 Acknowledges