2. Introduction
Characters are defined as binary
character codes for the purpose of Digital
Transfer.
Data Link Layer is Concerned with digital
transfer over a link.
Link – P to P circuit or Radio Based
Channel.
Effective Digital Data communication
need Control & Manage the
Exchange
3. Functions
To Establish and maintain Effective
Communication.
Error Control ->
Defines how a station check frames for
errors & What it does if it finds.
Flow Control ->
Defines the way in which many frames
sent and how the stations do error
control.
4. Flow Control
Tells the sender how much data it can
transmit before it must wait for an
acknowledgement from the receiver.
Receiving device has
Limited speed
Limited amount of Memory
So the sending device must not send
frames at a rate faster than a receiving
station can absorb them.
5. Techniques
To control the flow of data across the
communication links:
Stop and Wait flow Control
Sliding Window flowControl.
7. Stop and Wait flow Control
Source transmits frame
Destination receives frame and replies
with acknowledgement (ACK)
Source waits for ACK before sending
next frame
Destination can stop flow by not
sending ACK
Adv ---- Simplicity
Disadv ---- Inefficiency
8. Sliding Window flow Control.
Allows multiple frames to be in transit
Receiver sends acknowledgement with
sequence number of anticipated frame
Sender maintains list of sequence
numbers it can send, receiver maintains
list of sequence numbers it can receive
ACK (acknowledgement, or RR –
Receiver Ready) supplemented with
RNR (receiver not ready).
9.
10. The problem of “Stop and Wait” is not be
able to send multiple packets
Receiver has buffer of W (called window size)
frames
Transmitter can send up to W frames without
ACK
Each frame is numbered
frames are numbered modulo-n (0 … n-1)
ACK includes number of next frame expected
11.
12. ERROR CONTROL:
Error control in the data link layers is
based on automatic repeat
request(ARQ)which means
retransmission of data in three cases:
1. Damaged frame
2. Lost frame
3. Lost acknowledgement
13. DAMAGED FRAME:
A recognizable frame does arrive, but
some of the bits are in error.
14. LOST FRAME:
A frame fails to arrive at the other side.
15. LOST ACKNOWLEDGEMENT:
An acknowledgement fails to arrive at
the source.
The sender is not aware that
acknowledgement has been transmitted
from the receiver
16. Automatic repeat request
The purpose of ARQ is to turn an
unreliable data link into a reliable one.
Three versions of ARQ have been
standardized.
1. stop-and-wait ARQ
2. Go-back-N ARQ
3. selective-reject ARQ
17. STOP-AND-WAIT ARQ:
Stop-and-wait is the simplest of the error
control protocols.
A transmitter sends a frame then stops and
waits for an acknowledgment.
If a positive acknowledgment (ACK) is
received, the next frame is sent.
If a negative acknowledgment (NAK) is
received, the same frame is transmitted
again.
18. Source transmits single frame and Wait
for ACK
If received frame is damaged, discard it
If transmitter receives no ACK within
timeout, retransmits
If ACK damaged,transmitter will not
recognize it
Transmitter will retransmit after timeout
Receiver gets two copies of frame, but
disregards one of them
Use ACK0 and ACK1
ACKi means “I am ready to receive frame i”
19. One frame received and handled at a
time
If frame is damaged, receiver discards
it and sends no acknowledgment
Sender uses timer to determine
whether or not to retransmit
Sender must keep a copy of
transmitted frame until
acknowledgment is received
If acknowledgment is damaged, sender
will know it because of numbering
20.
21.
22. Go-Back-N ARQ
Uses sliding-window flow control.
When receiver detects error, it sends
negative acknowledgment (REJ).
Sender must begin transmitting again
from rejected frame.
Transmitter must keep a copy of all
transmitted frames.
23.
24.
25. Selective Reject
Also called selective retransmission
Only rejected frames are retransmitted
Subsequent frames are accepted by the
receiver and buffered
Minimizes retransmissions
Receiver must maintain large enough
buffer
Complex system
26.
27. Protocols
set of rules that governs the operation
of functional units to achieve
communication .
data link protocol.
The type of protocol used to establish a
link between two stations in accordance
with the second layer of OSI model
28. Data link protocol subgroups
Asynchronous protocols
Synchronous protocols
Asynchronous protocols treat each
character in a bit stream independently.
Synchronous protocols take the whole
bit stream and chop it into characters of
equal size.
29. Asynchronous protocols-used primarily
in modems
feature start and stop bits and variable-length
gaps between characters.
A variety of Asynchronous protocols :-
1. X-modem
2. Y-modem
3. Z-modem
4. Blocked Asynchronous transmission
(BLAST)
30. X-MODEM
File transfer communication for
telephone line communication between
PC‟s.
designed by Ward Christiansen in 1979,
X-modem.
It is a half duplex stop-and-wait ARQ
protocol.
31. In this protocol, transmission begins
with the sending of a NACK frame from
the receiver to the sender.
each time the sender sends a frame, it
must wait for an acknowledgement
before the next frame can be sent.
A frame can be resend either if
response is not received by the sender
after a specified period of time
or if NACK is received by the sender.
32. Y-MODEM:
1. The data unit is 1024 bytes.
2. ITU-T CRC-16 is used for error
checking
3. Multiple files can be sent
simultaneously
33. Z-MODEM:
Z-modem is a protocol which combines
features of both X-modem and Y-modem.
BLAST:
BLAST is more powerful than X-modem.
It is full duplex with sliding window flow
control.
It allows the transfer of data and binary
files.
34.
35. 35
Synchronous Transmission
With Synchronous Transmission all the
letters or data in one group of data is
transmitted at one time as a block of
data called a frame or packet.
The start and end of each packet
sometimes is marked by adding
synchronization characters (SYN) at the
start/end of each packet.
36. Message Format
Start of header (SOH)
Header (Address, sequence, date and
time)
Start of text (STX)
Text
End of text (ETX) or text length
Trailer
Block check character (BCC)
Synchronization character (SYN)
37. Synchronous Data Link Protocols -
Classification
Character-oriented protocols
Special character for start and end of message
Binary Synchronous Communication Protocol (BSC
or BISYNC)
Byte-count-oriented protocols
Special character for start of the header, count
field, message, block check character (BCC)
DEC’s Digital Data Communication Message
Protocol (DDCMP)
Bit-oriented protocols
Use flag character for start and end of message
IBM’s Synchronous Data Link Control (SDLC)
ISO’s High-Level Data Link control (HDLC)
38. Binary Synchronous
Communications
By IBM
For 6-bit transcode (SBT), ASCII, EBCDIC
SYN at start and middle of transmission
Point to point and multipoint (polling)
ARQ approach for error checking (ACK1, ACK0, NAK)
Pros:
Transparency and non-transparency modes
Efficient, understandable, and widely used
Point-to-point & multipoint operations
Cons:
Code dependent
Half-duplex protocol
Cumbersome for transparency mode
39. High Level Data Link Control
HDLC
ISO Standard
Basis for some other DLL protocols
40. 40
High-Level Data Link Control
(HDLC)
The OSI’s data link protocol
A bit-oriented protocol
On transmitting side, HDLC receives data from an
application, and delivers it to the receiver on the
other side of the link
On the receiving side, HDLC accepts the data and
delivers it to the higher level application layer
Both modules exchange control information, encoded
into a frame
(IBM’s SDLC has similar features and the format of HDLC)
41. 41
HDLC Frame Structure
Flag: 01111110, at start
and end
Address: secondary
station (for multidrop
configurations)
Information: the data to
be transmitted
Frame check sequence:
16- or 32-bit CRC
Control: purpose or
function of frame
Information frames:
contain user data
Supervisory frames:
flow/error control
(ACK/ARQ)
Unnumbered frames:
variety of control
functions (see p.131)
42. 42
Transparency Problem
The problem of transparency
Because HDLC uses 01111110 to mark the
start and end of a packet, the character
“01111110” will confuse the receiver.
Solution - Bit Stuffing
Add a 0 after every five 1s at sender side
and delete the 0 at receiver side.
43. 43
HDLC Operation
Initialization: S-frames specify mode
and sequence numbers, U-frames
acknowledge
Data Transfer: I-frames exchange user
data, S-frames acknowledge and
provide flow/error control
Disconnect: U-frames initiate and
acknowledge
44. High-Level Data Link Control (HDLC)
HDLC was defined by ISO for use on both
point-to-point and multipoint data links.
It supports full-duplex communication
Other similar protocols are
Synchronous Data Link Control (SDLC) by IBM
Advanced Data Communication Control Procedure
(ADCCP) by ANSI
Link Access Procedure, Balanced (LAP-B) by
CCITT, as part of its X.25 packet-switched
network standard
45. HDLC Overview
Broadly HDLC features are as follows:
Reliable protocol
selective repeat or go-back-N
Full-duplex communication
receive and transmit at the same time
Bit-oriented protocol
use bits to stuff flags occurring in data
Flow control
adjust window size based on receiver capability
Uses physical layer clocking and
synchronization to send and receive frames
46. HDLC Overview
Defines three types of stations
Primary
Secondary
Combined
Defines three types of data transfer mode
Normal Response mode
Asynchronous Response mode
Asynchronous Balanced mode
Three types of frames
Unnumbered
information
Supervisory
47. HDLC
The three stations are :
Primary station
Has the responsibility of controlling the operation of data
flow the link.
Handles error recovery
Frames issued by the primary station are called
commands.
Secondary station,
Operates under the control of the primary station.
Frames issued by a secondary station are called
responses.
The primary station maintains a separate logical link with
each secondary station.
Combined station,
Acts as both as primary and secondary station.
Does not rely on other for sending data
49. HDLC
The three modes of data transfer operations are
Normal Response Mode (NRM)
Mainly used in terminal-mainframe networks. In this case,
Secondaries (terminals) can only transmit when specifically
instructed by the primary station in response to a polling
Unbalanced configuration, good for multi-point links
Asynchronous Response Mode (ARM)
Same as NRM except that the secondaries can initiate
transmissions without direct polling from the primary station
Reduces overhead as no frames need to be sent to allow
secondary nodes to transmit
Transmission proceeds when channel is detected idle , used
mostly in point-to-point-links
Asynchronous Balanced Mode (ABM)
Mainly used in point-to-point links, for communication between
combined stations
50. Non-operational Modes
Normal Disconnected Mode
Asynchronous Disconnected Mode
Both the above modes mean that the secondary node is
logically disconnected from the primary node
Initialization Mode
A node negotiates transmission parameters with the other
node E.g., flow control information
Parameters negotiated in this mode are used during any of
the data transfer modes
51. Data Link Control HDLC frame
structure
(a) Frame
Format
(b) Control
field
format
52. Data Link Control
HDLC frame structure
(c) Extended address field (d) Extended control field
53. HDLC
Flag: 01111110- start and ending delimiter. Bits are stuffed for flags in
data frames
FCS: 16-bit CRC using generating polynomial
G(x) = x16 + x12 + x5 + 1
Address field:
mainly used in multidrop link configuration, and not used in point-to-point
In unbalanced configuration, every secondary is assigned a unique address.
Contains address of secondary station in both command and response
frames
In balanced mode, command frame has destination address and response
frame has sending node’s address
Group addresses are also possible. E.g., One command sent to all the
secondaries
In I-frames, N(s) is the sequence number of the frame being sent, and
R(s) is the sequence number of the frame being expected.
The P/F bit, known as the poll/final bit, is used with different meaning
in different contexts.
It is used to indicate polling, to indicate the final I-frame, etc
54. HDLC
There are three different classes of frames
used in HDLC
Unnumbered frames, used in link setup and
disconnection, and hence do not contain ACK.
Information frames, which carry actual
information. Such frames can piggyback ACK in
case of ABM
Supervisory frames, which are used for error and
flow control purposes and hence contain send and
receive sequence numbers
55. HDLC
There are four different supervisory frames
SS=00, Receiver Ready (RR), and N(R) ACKs all
frames received up to and including the one with
sequence number N(R) - 1
SS=10, Receiver Not Ready (RNR), and N(R) has
the same meaning as above
SS=01, Reject; all frames with sequence number
N(R) or higher are rejected, which in turns ACKs
frames with sequence number N(R) -1 or lower.
SS=11, Selective Reject; the receive rejects the
frame with sequence number N(R)
56. HDLC
The unnumbered frames can be
grouped into the following categories:
Mode-setting commands and responses
Recovery commends and responses
Miscellaneous commands and responses
57. Review of Link Layer
Services
Framing
Error control
Reliability
Connection management
Medium access control
Switching
Protocols, Standards
Ethernet
Token Ring
FDDI
Wireless
PPP
HDLC
58. HDLC Station Types
Primary station
Controls operation of link
Frames issued are called commands
Secondary station
Under control of primary station
Frames issued called responses
Combined station
May issue commands and responses
59. HDLC Link Configurations
Unbalanced
One primary and one or more secondary
stations
Supports full duplex and half duplex
Balanced
Two combined stations
Supports full duplex and half duplex
60. HDLC Transfer Modes (1)
Normal Response Mode (NRM)
Unbalanced configuration
Primary initiates transfer to secondary
Secondary may only transmit data in
response to command from primary
Terminal-host communication
Host computer as primary
Terminals as secondary
not so common nowadays
61. HDLC Transfer Modes (2)
Asynchronous Balanced Mode (ABM)
Balanced configuration
Either station may initiate transmission
without receiving permission
Most widely used
62. Frame Structure
All transmissions in frames
Single frame format for all data and
control exchanges
64. Flag Fields
Delimit frame at both ends
01111110
Receiver hunts for flag sequence to
synchronize
Bit stuffing used to avoid confusion with
data containing 01111110
0 inserted after every sequence of five 1s
If receiver detects five 1s it checks next bit
If 0, it is deleted
If 1 and seventh bit is 0, accept as flag
66. Address Field
Identifies secondary station that sent or
will receive frame
Usually 8 bits long
May be extended to multiples of 7 bits
with prior agreement
leftmost bit of each octet indicates that it is
the last octet (1) or not (0)
67. Frame Types
Information - data to be transmitted to
user
Acknowledgment is piggybacked on
information frames
Supervisory – ARQ messages
(RR/RNR/REJ/SREJ) when piggyback
not used
Unnumbered – supplementary link
control functions. For examples,
setting the modes
69. Poll/Final Bit
Use depends on context. A typical use
is below.
Command frame
P bit set to 1 to solicit (poll) supervisory
frame from peer
Response frame
F bit set to 1 to indicate response to
soliciting command
70. Information Field
Only in information and some
unnumbered frames
Must contain integral number of octets
Variable length
71. Frame Check Sequence Field
FCS
Error detection
16 bit CRC
Optional 32 bit CRC
72. HDLC Operation
Exchange of information, supervisory
and unnumbered frames
Three phases
Initialization
Data transfer
Disconnect
73. Initialization
Issue one of six set-mode commands
Signals other side that initialization is
requested
Specifies mode (NRM, ABM, ARM)
Specifies 3- or 7-bit sequence numbers
If request accepted HDLC module on
other side transmits unnumbered
acknowledged (UA) frame
If request rejected, disconnected mode
(DM) sent
74. Data Transfer
Both sides may begin to send user data in I-frames
N(S): sequence number of outgoing I-frames
modulo 8 or 128, (3- or 7-bit)
N(R) acknowledgment for I-frames received
seq. number of I-frame expected next
S-frames are also used for flow and error control
Receive ready (RR) frame acknowledges last I-frame received
Indicating next I-frame expected
Used when there is no reverse data
Receive not ready (RNR) acknowledges, but also asks peer to
suspend transmission of I-frames
When ready, send RR to restart
REJ initiates go-back-N ARQ
Indicates last I-frame received has been rejected
Retransmission is requested beginning with N(R)
Selective reject (SREJ) requests retransmission of single frame
75. Disconnect
Send disconnect (DISC) frame
Remote entity must accept by replying
with UA
Informs layer 3 user about the termination
of connection
76. Other DLC Protocols
(LAPB,LAPD)
Link Access Procedure, Balanced (LAPB)
Part of X.25 (ITU-T)
Subset of HDLC - ABM (Async. Balanced
Mode)
Point to point link between user and packet
switching network node
HDLC frame format
Link Access Procedure, D-Channel (LAPD)
Part of ISDN (ITU-T)
ABM
Always 7-bit sequence numbers (no 3-bit)
always 16-bit CRC
77. Other DLC Protocols (LLC)
Logical Link Control (LLC)
IEEE 802
For LANs (Local Area Networks)
Link control split between medium access control layer (MAC) and
LLC (on top of MAC)
Different frame format
Two addresses needed (sender and receiver) – actually at MAC layer
Sender and receiver SAP addresses
Control field is same as HDLC (16-bit version for I and S frames; 8-
bit for U frames)
No primary and secondary - all stations are peers
Error detection at MAC layer
32 bit CRC
78. Other DLC Protocols (LLC)
LLC Services
3 alternatives
Connection Mode Services
Similar to HDLC ABM
Unacknowledged connectionless services
no connection setup
No flow-control, no error control, no acks (thus
not reliable)
good to be used with TCP/IP. Why?
Acknowledged Connectionless Service
No connection setup
reliable communication
79. High-level Data Link Control (HDLC)
- I
Operating modes
Normal response mode (NRM) for a primary node
and one or more secondary modes on a circuit
(polling)
Asynchronous balanced mode (ABM) for nodes
with peers (most used for efficiency with no
polling in full duplex)
Asynchronous response mode (ARM) for primary
and secondary nodes with same transmission right
(rarely used)
Frames
Supervisory or S format: control acknowledge
Unnumbered or U format: (operation mode, start,
termination)
Information or I format: (data)
80. High-level Data Link Control (HDLC)
- I
Flag
01111110
Bit stuffing 0 after five 1s by hardware
For synchronization
Other fields
Address field
Control field: type of frame, sequence number for
information frames
Information field: multiple of 8 bits
Frame check sequence (FCS) field: error checking
Frame flow
Initialization phase, data transfer phase, and
disconnect phase
81. Other Data Link Control Protocols
Link access procedure, balanced (LAPB)
Full-duplex, point-to-point mode
For X.25 DTE and packet switching network
Link access procedure, D-channel (LAPD)
ISDN network
Link access procedure for frame –mode
bearer service (LAPF)
High-speed packet switching network on low error
rate digital circuits
Asynchronous transfer mode
Data transfer on high s-speed, digital, error free
network
82. High Level Data Link Control
One of the more popular data link
control protocols
Similar to IBM’s SDLC but more flexible
Many data link protocols are based on
HDLC – thus if you learn HDLC, you will
understand many others, such as all the
LAP standards
11.82
83. HDLC Station Types
Primary station
11.83
Controls operation of link
Frames issued are called commands
Maintains separate logical link to each secondary
station
Secondary station
Under control of primary station
Frames issued called responses
Combined station
May issue commands and responses
84. HDLC Link Configurations
Unbalanced
11.84
One primary and one or more secondary
stations
Supports full duplex and half duplex
Balanced
Two combined stations
Supports full duplex and half duplex
85. HDLC Transfer Modes (1)
Normal Response Mode (NRM)
11.85
Unbalanced configuration
Primary initiates transfer to secondary
Secondary may only transmit data in
response to command from primary
Used on multi-drop lines
Host computer as primary
Terminals as secondary
86. HDLC Transfer Modes (2)
Asynchronous Balanced Mode (ABM)
11.86
Balanced configuration
Either station may initiate transmission
without receiving permission
Most widely used
No polling overhead
87. HDLC Transfer Modes (3)
Asynchronous Response Mode (ARM)
11.87
Unbalanced configuration
Secondary may initiate transmission
without permission from primary
Primary responsible for line
Rarely used
88. Frame Structure
Synchronous transmission
All transmissions in frames
Single frame format for all data and
control exchanges
11.88
91. Address Field
Identifies secondary station that sent or will
receive frame
Usually 8 bits long
May be extended to multiples of 7 bits
LSB of each octet indicates that it is the last octet (1)
or not (0)
All ones (11111111) is broadcast
11.91
92. Control Field
Different for different frame type
11.92
Information - data to be transmitted to
user (next layer up)
Flow and error control piggybacked on
information frames
Supervisory - ARQ when piggyback not
used
Unnumbered - supplementary link control
First one or two bits of control field
identify frame type
94. Poll/Final Bit
Use depends on context
Command frame
11.94
P bit
1 to solicit (poll) response from peer
Response frame
F bit
1 indicates response to soliciting command
95. Information Field
Only in information and some
unnumbered frames
Must contain integral number of octets
Variable length
11.95
96. Frame Check Sequence Field
FCS
Error detection
16 bit CRC
Optional 32 bit CRC
11.96
97. HDLC Operation
Exchange of information, supervisory
and unnumbered frames
Three phases
11.97
Initialization
Data transfer
Disconnect
98. HDLC Bit-Oriented Frame
Format
Information
Frame
Supervisory
Frame
Unnumbered
Frame
Frame Sequence # Poll/Final Next Frame Expected