Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model...

Preview:

Citation preview

Data Communications

Data Link Control

What Is Data Link Control?The Data Link layer of a model typically has

the following responsibilities:1. Creates a frame2. Creates an error-free logical

connectionError controlFlow control

3. Makes sure the receiver stays synchronized with the incoming data stream

Flow ControlEnsuring the sending entity does not

overwhelm the receiving entityPreventing buffer overflow

Transmission timeTime taken to emit all bits into medium

Propagation timeTime for a bit to traverse the link

Model of Frame Transmission

Stop and WaitSource transmits frameDestination receives frame and replies with

acknowledgementSource waits for ACK before sending next

frameDestination can stop flow by not send ACKWorks well for a few large frames

Stop and Wait Link Utilization

Stop and Wait Link UtilizationTF = tprop + tframe + tproc + tprop + tack + tproc

Tproc and tack negligible, so

T = n(2tprop + tframe)

U = (n * tframe) / n(2tprop + tframe)

= tframe / (2tprop + tframe)

With a = tprop / tframe, U = 1 /(1 + 2a)

Stop and Wait Link UtilizationFurthermore, a = tprop / tframe

= Propagation Time / Transmission Time= (d/V) / (L/R) = Rd/VLWhere:

D = distance of linkV = velocity of propagation (air = speed of light

(3 x 108 m/s) ; fiber = same ; copper = 0.67 x speed of light)

L = length of frame in bitsR = data rate in bps

Stop and Wait Link Utilization Example

Consider a WAN using ATM, 2 stations 1000 km apart, ATM frame size = 424 bits, standard data rate = 155.52 Mbps

Transmission Time (L/R) =424/155.52 x 106

= 2.7 x 10-6 secondsAssume optical link:Propagation Time (d/V) = 106 m / 3 x 108

m/sec= 0.33 x 10-2 seconds

Stop and Wait Link Utilization Example

Thus, a = 0.33 x 10-2 / 2.7 x 10-6 = 1222U = 1/(1+2a) = 1/(1+2x1222) = 0.0004

ouch!

Another example: A LANV = 2 x 108 m/sL = 1000 bitsR = 10 MbpsD = 0.1 km = 100 m

Stop and Wait Link Utilization Example

Thus, a = (d/V) / (L/R) = 0.005

U = 1/(1+2a) = 0.99 No ouch!

Sliding Windows Flow Control

Allow multiple frames to be in transitReceiver has buffer W longTransmitter can send up to W frames without

ACKEach frame is numberedACK includes number of next frame expectedSequence number bounded by size of field (k)

Frames are numbered modulo 2k

Sliding Window Diagram

Example Sliding Window

Sliding Window Enhancements

Receiver can acknowledge frames without permitting further transmission (Receive Not Ready)

Must send a normal acknowledge to resumeIf duplex, use piggybacking

If no data to send, use acknowledgement frameIf data but no acknowledgement to send, send

last acknowledgement number again, or have ACK valid flag (TCP)

Sliding Window Performance

U = 1 if W >= 2a + 1 where W = window sizeThus, Utilization = 1 (100%) where ACK for

frame 1 reaches A before A has exhausted its window

U = W / (2a+1) if W < 2a + 1 Utilization = W/(2a+1) where A exhausts its

window at t = W.

Sliding Window Performance

Example: What is U for a 1000-bit frame on a 1 Mbps satellite link with 270 ms delay with a window size of 127?

a = Prop/Tran = .270 sec/(1000/1000000)a = 2702a + 1 = 541Is W < 2a + 1? Yes, so U = W / (2a + 1)U = 127 / 541 = 0.23

Error ControlDetection and correction of errorsLost framesDamaged framesAutomatic repeat request

Error detectionPositive acknowledgmentRetransmission after timeoutNegative acknowledgement and retransmission

Automatic Repeat Request (ARQ)

Stop and waitGo back NSelective reject (selective retransmission)

Stop and WaitSource transmits single frameWait for ACKIf received frame damaged, discard it

Transmitter has timeoutIf no ACK within timeout, retransmit

If ACK damaged,transmitter will not recognize itTransmitter will retransmitReceive gets two copies of frameUse ACK0 and ACK1

Stop and Wait -Diagram

Simple

Inefficient

Go Back NBased on sliding windowIf no error, ACK as usual with next frame

expectedUse window to control number of

outstanding framesIf error, reply with rejection

Discard that frame and all future frames until error frame received correctly

Transmitter must go back and retransmit that frame and all subsequent frames

Go Back N - Damaged Frame

Receiver detects error in frame iReceiver sends rejection iTransmitter gets rejection iTransmitter retransmits frame i and all

subsequent

Go Back N - Lost Frame (1)

Frame i lostTransmitter sends i+1Receiver gets frame i+1 out of sequenceReceiver sends reject iTransmitter goes back to frame i and

retransmits

Go Back N - Lost Frame (2)Frame i lost and no additional frames sentReceiver gets nothing and returns neither

acknowledgement nor rejectionTransmitter times out and sends

acknowledgement frame with P bit set to 1

Receiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i )

Transmitter then retransmits frame i

Go Back N - Damaged Acknowledgement / Rejection

Receiver gets frame i and sends acknowledgement (i+1) which is lost

Acknowledgements are cumulative, so next acknowledgement (i+n) may arrive before transmitter times out on frame i

If transmitter times out, it sends acknowledgement with P bit set as before

This can be repeated a number of times before a reset procedure is initiated

Go Back N - Diagram

Selective Reject

Also called selective retransmissionOnly rejected frames are retransmittedSubsequent frames are accepted by the

receiver and bufferedMinimizes retransmissionReceiver must maintain large enough bufferMore complex login in transmitter

Selective Reject -Diagram

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

HDLC Station TypesPrimary station

Controls operation of linkFrames issued are called commandsMaintains separate logical link to each

secondary station

Secondary stationUnder control of primary stationFrames issued called responses

Combined stationMay issue commands and responses

HDLC Link ConfigurationsUnbalanced

One primary and one or more secondary stationsSupports full duplex and half duplex

BalancedTwo combined stationsSupports full duplex and half duplex

HDLC Transfer Modes (1)Normal Response Mode (NRM)

Unbalanced configurationPrimary initiates transfer to secondarySecondary may only transmit data in response

to command from primaryUsed on multi-drop linesHost computer as primaryTerminals as secondary

HDLC Transfer Modes (2)Asynchronous Balanced Mode (ABM)

Balanced configurationEither station may initiate transmission without

receiving permissionMost widely usedNo polling overhead

HDLC Transfer Modes (3)Asynchronous Response Mode (ARM)

Unbalanced configurationSecondary may initiate transmission without

permission form primaryPrimary responsible for lineRarely used

Frame StructureSynchronous transmissionAll transmissions in framesSingle frame format for all data and control

exchanges

Frame Structure Diagram

Flag FieldsDelimit frame at both ends - 01111110May close one frame and open anotherReceiver hunts for flag sequence to

synchronizeBit stuffing used to avoid confusion with

data containing 011111100 inserted after every sequence of five 1sIf receiver detects five 1s it checks next bitIf 0, it is deletedIf 1 and seventh bit is 0, accept as flagIf sixth and seventh bits 1, sender is indicating abort

Bit StuffingExample with possible errors

Address FieldIdentifies secondary station that sent or will receive

frameUsually 8 bits longMay 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

Control FieldDifferent 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 usedUnnumbered - supplementary link control

First one or two bits of control field identify frame type

Control Field Diagram

Poll/Final BitUse depends on contextCommand frame

P bit1 to solicit (poll) response from peer

Response frameF bit1 indicates response to soliciting command

Information FieldOnly in information and some unnumbered

framesMust contain integral number of octetsVariable length

Frame Check Sequence FieldFCSError detection16 bit CRCOptional 32 bit CRC

HDLC OperationExchange of information, supervisory and

unnumbered framesThree phases

InitializationData transferDisconnect

Examples of Operation (1)

Examples of Operation (2)

Other DLC Protocols (LAPB,LAPD)

Link Access Procedure, Balanced (LAPB)Part of X.25 (ITU-T)Subset of HDLC - ABMPoint to point link between system and packet

switching network node

Link Access Procedure, D-ChannelISDN (ITU-D)ABMAlways 7-bit sequence numbers (no 3-bit)16 bit address field contains two sub-addresses

One for device and one for user (next layer up)

Other DLC Protocols (LLC)Logical Link Control (LLC)

IEEE 802Different frame formatLink control split between medium access layer

(MAC) and LLC (on top of MAC)No primary and secondary - all stations are peersTwo addresses needed

Sender and receiver

Error detection at MAC layer32 bit CRC

Destination and source access points (DSAP, SSAP)

Other DLC Protocols (Frame Relay) (1)

Streamlined capability over high speed packet witched networks

Used in place of X.25Uses Link Access Procedure for Frame-Mode

Bearer Services (LAPF)Two protocols

Control - similar to HDLCCore - subset of control

Other DLC Protocols (Frame Relay) (2)

ABM7-bit sequence numbers16 bit CRC2, 3 or 4 octet address field

Data link connection identifier (DLCI)Identifies logical connection

More on frame relay later

Other DLC Protocols (ATM)Asynchronous Transfer ModeStreamlined capability across high speed

networksNot HDLC basedFrame format called “cell”Fixed 53 octet (424 bit)Details later

Protocol Specification and VerificationBy creating a finite state model, it is

possible to determine which states are reachable and which are not (reachability analysis)

Incompleteness – If it is possible for a certain frame to occur in a certain state and the model does not say what to do next

Deadlock – If there exists a set of states from which there is no exit or no progress

Extraneous transition – Model tells how to handle an event in a state in which the event cannot occur

Protocol Specification and Verification

Many different “tools” for protocol specification and verification

Packages such as SPIN

Finite state graphsPetri Nets

Bisync (BSC)

Review Questions1. What is the utilization of stop and wait

flow control? (Two stations 20 km apart, 1000 byte frames, 256 Kbps, UTP)

2. What is the utilization of a sliding window system where stations are 100 km apart, 500 byte frame, 1 Mbps, microwave, window size = 255?

3. Why is the window size always 2n – 1?4. What are differences between go-back-n

and selective reject?

Review Questions5. Ten frames sent, 5th frame is lost. What

happens with go-back-N? With selective reject?

6. What is normal response mode in HDLC?7. How does bit stuffing work?8. What is the difference between HDLC and

SDLC?

Recommended