data communications data link control. what is data link control? the data link layer of a model...

58
Data Communications Data Link Control

Post on 22-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Data Communications

Data Link Control

Page 2: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 3: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 4: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Model of Frame Transmission

Page 5: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 6: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Stop and Wait Link Utilization

Page 7: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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)

Page 8: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 9: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 10: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 11: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Stop and Wait Link Utilization Example

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

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

Page 12: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 13: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Sliding Window Diagram

Page 14: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Example Sliding Window

Page 15: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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)

Page 16: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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.

Page 17: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 18: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Error ControlDetection and correction of errorsLost framesDamaged framesAutomatic repeat request

Error detectionPositive acknowledgmentRetransmission after timeoutNegative acknowledgement and retransmission

Page 19: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Automatic Repeat Request (ARQ)

Stop and waitGo back NSelective reject (selective retransmission)

Page 20: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 21: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Stop and Wait -Diagram

Simple

Inefficient

Page 22: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 23: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Go Back N - Damaged Frame

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

subsequent

Page 24: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 25: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 26: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 27: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Go Back N - Diagram

Page 28: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 29: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Selective Reject -Diagram

Page 30: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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 31: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 32: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

HDLC Link ConfigurationsUnbalanced

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

BalancedTwo combined stationsSupports full duplex and half duplex

Page 33: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 34: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Balanced configurationEither station may initiate transmission without

receiving permissionMost widely usedNo polling overhead

Page 35: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Unbalanced configurationSecondary may initiate transmission without

permission form primaryPrimary responsible for lineRarely used

Page 36: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

exchanges

Page 37: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Frame Structure Diagram

Page 38: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 39: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Bit StuffingExample with possible errors

Page 40: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 41: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 42: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Control Field Diagram

Page 43: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Poll/Final BitUse depends on contextCommand frame

P bit1 to solicit (poll) response from peer

Response frameF bit1 indicates response to soliciting command

Page 44: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Information FieldOnly in information and some unnumbered

framesMust contain integral number of octetsVariable length

Page 45: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Frame Check Sequence FieldFCSError detection16 bit CRCOptional 32 bit CRC

Page 46: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

HDLC OperationExchange of information, supervisory and

unnumbered framesThree phases

InitializationData transferDisconnect

Page 47: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Examples of Operation (1)

Page 48: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Examples of Operation (2)

Page 49: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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)

Page 50: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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)

Page 51: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 52: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 53: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

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

Page 54: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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

Page 55: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Protocol Specification and Verification

Many different “tools” for protocol specification and verification

Packages such as SPIN

Finite state graphsPetri Nets

Page 56: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

Bisync (BSC)

Page 57: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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?

Page 58: Data Communications Data Link Control. What Is Data Link Control? The Data Link layer of a model typically has the following responsibilities: 1. Creates

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?