Data link control & protocol concepts
-
Upload
raji-lakshmi -
Category
Technology
-
view
421 -
download
4
description
Transcript of Data link control & protocol concepts
Data Link Control & Protocol Concepts
Chapter 5
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
FunctionsTo 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.
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 MemorySo the sending device must not
send frames at a rate faster than a receiving station can absorb them.
Techniques
To control the flow of data across the communication links:
Stop and Wait flow
Control Sliding Window
flowControl.
Stop and Wait flow Control
Stop and Wait flow Control
Source transmits frameDestination 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
Sliding Window flow Control.Allows multiple frames to be in
transitReceiver 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).
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
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
DAMAGED FRAME:
A recognizable frame does arrive, but some of the bits are in error.
LOST FRAME:
A frame fails to arrive at the other side.
LOST ACKNOWLEDGEMENT:
An acknowledgement fails to arrive at the source.
The sender is not aware that acknowledgement has been transmitted from the receiver
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
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.
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”
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
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.
Selective Reject
Also called selective retransmission
Only rejected frames are retransmitted
Subsequent frames are accepted by the receiver and buffered
Minimizes retransmissionsReceiver must maintain large
enough bufferComplex system
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
Data link protocol subgroups
Asynchronous protocolsSynchronous protocolsAsynchronous protocols treat each
character in a bit stream independently.
Synchronous protocols take the whole bit stream and chop it into characters of equal size.
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)
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.
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.
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
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.
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.
Message Format
Start of header (SOH) Header (Address, sequence, date and
time) Start of text (STX)
TextEnd of text (ETX) or text lengthTrailer
Block check character (BCC) Synchronization character (SYN)
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)
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
High Level Data Link Control
HDLC ISO StandardBasis for some other DLL protocols
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
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
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
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
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
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
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
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
HDLC
Primary
Secondary Secondary
Commands
Responses
Combined Combined
commands/Responses
Unbalanced Mode
Balanced mode
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
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
Data Link Control HDLC frame structure
(a) Frame Format
(b) Control field format
Data Link ControlHDLC frame structure
(c) Extended address field (d) Extended control field
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
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
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)
HDLC
The unnumbered frames can be grouped into the following categories: Mode-setting commands and
responses Recovery commends and responses Miscellaneous commands and
responses
Review of Link Layer
Services Framing Error control Reliability Connection management Medium access control Switching
Protocols, Standards Ethernet Token Ring FDDI Wireless PPP HDLC
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
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
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
HDLC Transfer Modes (2)
Asynchronous Balanced Mode (ABM) Balanced configuration Either station may initiate
transmission without receiving permission
Most widely used
Frame Structure
All transmissions in frames Single frame format for all data
and control exchanges
Frame Structure Diagram
Flag Fields
Delimit frame at both ends01111110Receiver hunts for flag sequence to
synchronizeBit 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
If sixth and seventh bits 1, sender is indicating abort
Bit Stuffing Example
Address Field Identifies secondary station that sent
or will receive frameUsually 8 bits longMay 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)
Frame Types
Information - data to be transmitted to user Acknowledgment is piggybacked on
information framesSupervisory – ARQ messages
(RR/RNR/REJ/SREJ) when piggyback not used
Unnumbered – supplementary link control functions. For examples, setting the modes disconnect
Control field is different for each frame type
Control Field Diagram
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
Information Field
Only in information and some unnumbered frames
Must contain integral number of octets
Variable length
Frame Check Sequence Field
FCSError detection16 bit CRCOptional 32 bit CRC
HDLC Operation
Exchange of information, supervisory and unnumbered frames
Three phases Initialization Data transfer Disconnect
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
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
Disconnect
Send disconnect (DISC) frameRemote entity must accept by
replying with UA Informs layer 3 user about the
termination of connection
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 16-bit address field
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
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
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)
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
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
11.82
High Level Data Link ControlOne of the more popular data link
control protocolsSimilar to IBM’s SDLC but more
flexibleMany data link protocols are based
on HDLC – thus if you learn HDLC, you will understand many others, such as all the LAP standards
11.83
HDLC Station Types
Primary station 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
11.84
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
11.85
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 Used on multi-drop lines Host computer as primary Terminals as secondary
11.86
HDLC Transfer Modes (2)
Asynchronous Balanced Mode (ABM) Balanced configuration Either station may initiate
transmission without receiving permission
Most widely used No polling overhead
11.87
HDLC Transfer Modes (3)
Asynchronous Response Mode (ARM) Unbalanced configuration Secondary may initiate transmission
without permission from primary Primary responsible for line Rarely used
11.88
Frame Structure
Synchronous transmissionAll transmissions in framesSingle frame format for all data
and control exchanges
11.89
Frame Structure Diagram
11.90
HDLC frame types
11.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.92
Control Field
Different for different frame type 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
11.93
Control Field Diagram
11.94
Poll/Final Bit
Use depends on contextCommand frame
P bit 1 to solicit (poll) response from peer
Response frame F bit 1 indicates response to soliciting
command
11.95
Information Field
Only in information and some unnumbered frames
Must contain integral number of octets
Variable length
11.96
Frame Check Sequence Field FCSError detection16 bit CRCOptional 32 bit CRC
11.97
HDLC Operation
Exchange of information, supervisory and unnumbered frames
Three phases Initialization Data transfer Disconnect
HDLC Bit-Oriented Frame Format
Information Frame
Supervisory Frame
Unnumbered Frame
Frame Sequence # Poll/Final Next Frame Expected