Presentation is loading. Please wait.

Presentation is loading. Please wait.

3.2 Data Link Layer : Error & Flow Control

Similar presentations


Presentation on theme: "3.2 Data Link Layer : Error & Flow Control"— Presentation transcript:

1 3.2 Data Link Layer : Error & Flow Control
data link configurations connectionless & connection oriented services flow control - avoiding buffer overflow error control - backward error control via re-transmission data link protocols - stop & wait, sliding window protocol performance issues - link utilization the high level data link control (HDLC) protocol

2 Line Configurations Topology point to point multipoint Duplicity simplex half duplex full duplex .

3 Point to Point - example
Establishment - ENQ (enquiry), ACK, NAC, ERP (error procedure) Data Transfer Termination - EOT ENQ A ACK B frame ACK

4 Multipoint Links - Primary & Secondary Nodes
Polling P : POLL - X (note: need address) X : NAK or X : frame to P P : ACK Select P : SEL - X X : ACK P : frame to X

5 Flow Control - Stop & Wait
Receiver (B) needs one buffer A sends Frame to B B sends ACK to A A sends Frame to B ... Assumes no errors, in frames or ACKs Small frames, or blocks, are: fairer, fewer re-xmit, smaller buffers required

6 Performance - Link Utilization = U
TF = total time to send frame = one way propagation delay TF = Tf +2  +Tack ~= Tf +2  U ~= n Tf / (2n  +nTf) => U = 1/ (1+2a) where a =  / Tf Tf B A

7 Definition of Parameter “a”
a = propagation time / transmission time d = distance V = velocity of light = 2 or 3 * 8 meters/sec R = data rate in bits/sec L = length of frame in bits a =  / Tf a = (d/ V)/ (L/ R) a = Rd/ VL

8 Impact of a on Utilization
a =  / Tf < 1 Tf B A Tf a > 1 B A

9 Flow Control - Sliding Window
Consider A to B on full duplex link B allocates N frame buffers each frame given sequence number ack includes 1+ sequence# of last frame rec’d A can send N frames before receiving an ACK frames that can be sent sender received receiver

10 Flow Control - Sliding Window (N=4)
A’s window: & B’s window: A sends B F0, F1, F2 & B receives all A’s window: & B’s window: 3 B sends ACK 3 A’s window: & B’s window: A receives ACK 3 A’s window: & B’s window: U = 1 if N > 2a+1 else U = N/ (1+2a)

11 Error Control-ARQ (automatic repeat request)
Two basic error types: lost frame (or ack/ control frame) damaged frame (or ack/ control frame) Control Mechanisms error detection via CRC retransmission after timeout negative acks & retransmission Three Common Versions: Stop & Wait ARQ Go-back-N ARQ Selective-reject ARQ

12 Automatic Repeat Request protocols (ARQ)
sender required to retransmit erroneous frames receiver detects errors fewer bits needed to reliably detect errors sender notified to re-send frame positive ack of frames received sender times out on frames that are not acknowledged and re-transmits negative acknowledgement for frames received with errors - more efficient

13 Error Control Stop & Wait ARQ (automatic repeat request) F0 A1 F1 alternate 0/ 1 labels to avoid receiving duplicates A0 F0 lost F0 re-sent after timeout A1 lost F0 re-sent after timeout

14 Sliding Window Based- Go-back-N ARQ
Damaged Frame B has correctly received frames up to I-1, A sends I, B detects error, sends NAK I frame I lost in transit, I+1 sent, B receives I+1 out of order, sends NAK I, else A sends nothing after I, hears nothing, resends after timeout Damaged ACK B receives I, sends ACK I+1 which is lost, A may receive subsequent ACK or timeout Damaged NAK A will eventually timeout and resend all

15 Go-back-N ARQ frames ACK1 ACK3 ACK5 ACK2 ACK4 NAK2 X X X X error discarded

16 Performance of Stop & Wait ARQ
Without frame xmission errors & Tack = 0 U = Tf / ( Tf + 2 ) U = 1/ (1 + 2a) where a =  / Tf With frame probability error = P & Tack = 0 U = Tf / Nretrans(Tf + 2 ) U = 1/ Nretrans(1 + 2a) Nretrans =  i P i-1(1-P) = 1/ (1 - P) U = (1 - P)/ (1 + 2a)

17 Performance of Sliding Window: no errors
N = window size, Tack = 0 & Tf = 1 if N > 1 + 2a then receive an ACK before window exhausted, can xmit continuously => U = 1 if N< 1 + 2a window exhausted at t0 + N, must wait till t0 + 2a + 1 to send again, thus get N time units busy during 2a + 1 => U = N/ (1 + 2a)

18 Performance of Sliding Window (N<1+2a)
B t0 A (assuming Tf = 1) fa . . . f2 f1 t0+a fa+1 f3 f2 . . . t0+a+1 ack1 N fa+3 fa+2 t0+2a+1 . . . ack1 => N frames sent in 1+2a time => U = N/ (1+2a)

19 Performance of Selective Repeat with Errors
without errors: U = 1 if N> 1+2a else = N/ (1+2a) U = time to send 1 frame / total time per frame *Nr where Nr = number of times must be resent U = 1/ Nr if N> 1+2a else N/ (1+2a)*Nr again Nr = f(i) P i-1(1-P) = 1/ (1-P) thus U = (1-P) if N>1+2a else (1-P)N/ (1+2a)

20 Performance of Go-back-N ARQ : with errors
again just consider the Nretrans, ie U = Tf / Nr (Tf + 2 ) U = 1/ Nr (1 + 2a) here each erroneous frame requires retransmission of K frames Nr = Exp{#frames xmitted to send 1} Nr = f(i) P i-1(1-P) where f(i) = total # frames xmitted if 1st frame must be sent i times = 1 + (i-1)K Nr = 1 - K + K/ (1 - P)

21 Performance of Go-back-N ARQ
U = 1/ Nr(1 + 2a) Nr = 1 - K + K/ (1 - P) U = 1/ (1 - K + K/ (1 - P))(1 + 2a) note K ~= 2a + 1 for N> 2a + 1 etc, thus: U = (1 - P)/ (1 + 2aP) if N > 1 + 2a U = N(1 - P)/ (1 + 2a)(1 - P + NP) if N < 1 + 2a

22 Performance Comparison
1.0 Go-back-N=127 Go-back-N=7 0.5 stop&wait Utilization 0.1 1.0 10 1000 a =  / Tf

23 Sliding Window with Selective Repeat & NAKs
window size = 2, sequence range =4 frames ACK0 ACK3 ACK2 ACK1 NAK2 ACK0 X Tanenbaum Section 3.4.3 error

24 HDLC-High Level Data Link Control-ISO 3309
Three stations types: primary - issues command frames secondary - response frames combined - primary & secondary fcns Two Link configurations unbalanced - 1 primary & full/half duplex balanced - only point to point combined Three Data Transfer Modes normal response mode (NRM) - unbalanced asynchronous balanced mode (ABM) asynchronoous response mode (ARM) -unbal.

25 HDLC -synchronous xmission -1 frame format
flag - 8 bits - (bit stuffing used to avoid in data) address - one or more octets control 8 or 16 bits information - variable frame check sequence CRC-16 or 32 flag - 8 bits - 1 flag can close & open frames flag address control data FCS flag

26 Control Field Format - three frame types
Information frame (ARQ piggybacked in data) send-seq# P/ F rec-seq# (3 or 7 bits) (3 or 7 bits) Supervisory (ARQ if not piggybacked) sup-fcn P/ F rec-seq# Unnumbered (other functions) unn-fcn P/ F unn-fcn

27 HDLC Commands & Responses
I - Information exchange user data S - Supervisory RR ACK, ready to receive I RNR ACK, not ready to receive REJ NAK, go back N SREJ NAK selective reject U - Unnumbered SNMR/ SNME set mode, 2 octet control SARM/ SARME set mode, 2 octet control SABM/SABE, SIM, DISC, UA, DM, RD, RIM, UI,UP, RSET, XID, TEST, FMR

28 HDLC example - one way, reject recovery
I - 1 I - 2 X I - 3 REJ - 2 I - 2 I - 3

29 HDLC example - busy condition
RNR - 2 RR - P RNR - 2 I - 1 RNR - 2 RR - P

30 Protocol Analysis - Finite State Machines
FSM model of communication protocol objects state defined for sending, receiving, link objects typical state = waiting (some event) very large number of states for simple protocols state transitions occur when events occur FSM = (S, M, I, T) where: S is set of states of all objects M is set of all types of messages I is the set of object initial states T is the set of state transitions correctness, reachability, deadlock

31 • Petri Net Models places can be occupied by tokens
directed arcs connect places and transitions transitions are enabled if all its input arcs come from places occupied by tokens enabled transitions can fire removing all incoming tokens and placing tokens at all places connected to it by output arcs

32 Tanenbaum’s Protocol 3 - Petri Net Model
link send 0 0 on link loss wait ack 0 sender timeout receiver ack on link loss send 1 wait ack 1 timeout 1 on link loss


Download ppt "3.2 Data Link Layer : Error & Flow Control"

Similar presentations


Ads by Google