data link control & protocol concepts

99
Data Link Control & Protocol Concepts Chapter 5

Upload: raji-lakshmi

Post on 24-May-2015

425 views

Category:

Technology


4 download

DESCRIPTION

Data Communications and Computer Networks By Brijendra Singh. Second Edition Chapter 5.Data Link Control and Protocol Concepts ppt

TRANSCRIPT

Page 1: Data link control & protocol concepts

Data Link Control & Protocol Concepts

Chapter 5

Page 2: Data link control & protocol concepts

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

Page 3: Data link control & protocol concepts

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.

Page 4: Data link control & protocol concepts

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.

Page 5: Data link control & protocol concepts

Techniques

To control the flow of data across the communication links:

Stop and Wait flow

Control Sliding Window

flowControl.

Page 6: Data link control & protocol concepts

Stop and Wait flow Control

Page 7: Data link control & protocol concepts

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

Page 8: Data link control & protocol concepts

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).

Page 9: Data link control & protocol concepts
Page 10: Data link control & protocol concepts

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

Page 11: Data link control & protocol concepts
Page 12: Data link control & protocol concepts

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

Page 13: Data link control & protocol concepts

DAMAGED FRAME:

A recognizable frame does arrive, but some of the bits are in error.

Page 14: Data link control & protocol concepts

LOST FRAME:

A frame fails to arrive at the other side.

Page 15: Data link control & protocol concepts

LOST ACKNOWLEDGEMENT:

An acknowledgement fails to arrive at the source.

The sender is not aware that acknowledgement has been transmitted from the receiver

Page 16: Data link control & protocol concepts

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

Page 17: Data link control & protocol concepts

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.

Page 18: Data link control & protocol concepts

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”

Page 19: Data link control & protocol concepts

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

Page 20: Data link control & protocol concepts
Page 21: Data link control & protocol concepts
Page 22: Data link control & protocol concepts

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.

Page 23: Data link control & protocol concepts
Page 24: Data link control & protocol concepts
Page 25: Data link control & protocol concepts

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

Page 26: Data link control & protocol concepts
Page 27: Data link control & protocol concepts

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

Page 28: Data link control & protocol concepts

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.

Page 29: Data link control & protocol concepts

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)

Page 30: Data link control & protocol concepts

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.

Page 31: Data link control & protocol concepts

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.

Page 32: Data link control & protocol concepts

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

Page 33: Data link control & protocol concepts

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.

Page 34: Data link control & protocol concepts
Page 35: Data link control & protocol concepts

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.

Page 36: Data link control & protocol concepts

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)

Page 37: Data link control & protocol concepts

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)

Page 38: Data link control & protocol concepts

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

Page 39: Data link control & protocol concepts

High Level Data Link Control

HDLC ISO StandardBasis for some other DLL protocols

Page 40: Data link control & protocol concepts

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)

Page 41: Data link control & protocol concepts

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)

Page 42: Data link control & protocol concepts

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.

Page 43: Data link control & protocol concepts

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

Page 44: Data link control & protocol concepts

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

Page 45: Data link control & protocol concepts

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

Page 46: Data link control & protocol concepts

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

Page 47: Data link control & protocol concepts

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

Page 48: Data link control & protocol concepts

HDLC

Primary

Secondary Secondary

Commands

Responses

Combined Combined

commands/Responses

Unbalanced Mode

Balanced mode

Page 49: Data link control & protocol concepts

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

Page 50: Data link control & protocol concepts

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

Page 51: Data link control & protocol concepts

Data Link Control HDLC frame structure

(a) Frame Format

(b) Control field format

Page 52: Data link control & protocol concepts

Data Link ControlHDLC frame structure

(c) Extended address field (d) Extended control field

Page 53: Data link control & protocol concepts

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

Page 54: Data link control & protocol concepts

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

Page 55: Data link control & protocol concepts

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)

Page 56: Data link control & protocol concepts

HDLC

The unnumbered frames can be grouped into the following categories: Mode-setting commands and

responses Recovery commends and responses Miscellaneous commands and

responses

Page 57: Data link control & protocol concepts

Review of Link Layer

Services Framing Error control Reliability Connection management Medium access control Switching

Protocols, Standards Ethernet Token Ring FDDI Wireless PPP HDLC

Page 58: Data link control & protocol concepts

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

Page 59: Data link control & protocol concepts

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

Page 60: Data link control & protocol concepts

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

Page 61: Data link control & protocol concepts

HDLC Transfer Modes (2)

Asynchronous Balanced Mode (ABM) Balanced configuration Either station may initiate

transmission without receiving permission

Most widely used

Page 62: Data link control & protocol concepts

Frame Structure

All transmissions in frames Single frame format for all data

and control exchanges

Page 63: Data link control & protocol concepts

Frame Structure Diagram

Page 64: Data link control & protocol concepts

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

Page 65: Data link control & protocol concepts

Bit Stuffing Example

Page 66: Data link control & protocol concepts

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)

Page 67: Data link control & protocol concepts

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

Page 68: Data link control & protocol concepts

Control Field Diagram

Page 69: Data link control & protocol concepts

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

Page 70: Data link control & protocol concepts

Information Field

Only in information and some unnumbered frames

Must contain integral number of octets

Variable length

Page 71: Data link control & protocol concepts

Frame Check Sequence Field

FCSError detection16 bit CRCOptional 32 bit CRC

Page 72: Data link control & protocol concepts

HDLC Operation

Exchange of information, supervisory and unnumbered frames

Three phases Initialization Data transfer Disconnect

Page 73: Data link control & protocol concepts

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

Page 74: Data link control & protocol concepts

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

Page 75: Data link control & protocol concepts

Disconnect

Send disconnect (DISC) frameRemote entity must accept by

replying with UA Informs layer 3 user about the

termination of connection

Page 76: Data link control & protocol concepts

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

Page 77: Data link control & protocol concepts

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

Page 78: Data link control & protocol concepts

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

Page 79: Data link control & protocol concepts

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)

Page 80: Data link control & protocol concepts

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

Page 81: Data link control & protocol concepts

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

Page 82: Data link control & protocol concepts

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

Page 83: Data link control & protocol concepts

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

Page 84: Data link control & protocol concepts

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

Page 85: Data link control & protocol concepts

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

Page 86: Data link control & protocol concepts

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

Page 87: Data link control & protocol concepts

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

Page 88: Data link control & protocol concepts

11.88

Frame Structure

Synchronous transmissionAll transmissions in framesSingle frame format for all data

and control exchanges

Page 89: Data link control & protocol concepts

11.89

Frame Structure Diagram

Page 90: Data link control & protocol concepts

11.90

HDLC frame types

Page 91: Data link control & protocol concepts

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

Page 92: Data link control & protocol concepts

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

Page 93: Data link control & protocol concepts

11.93

Control Field Diagram

Page 94: Data link control & protocol concepts

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

Page 95: Data link control & protocol concepts

11.95

Information Field

Only in information and some unnumbered frames

Must contain integral number of octets

Variable length

Page 96: Data link control & protocol concepts

11.96

Frame Check Sequence Field FCSError detection16 bit CRCOptional 32 bit CRC

Page 97: Data link control & protocol concepts

11.97

HDLC Operation

Exchange of information, supervisory and unnumbered frames

Three phases Initialization Data transfer Disconnect

Page 98: Data link control & protocol concepts

HDLC Bit-Oriented Frame Format

Information Frame

Supervisory Frame

Unnumbered Frame

Frame Sequence # Poll/Final Next Frame Expected

Page 99: Data link control & protocol concepts