Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version.

Similar presentations


Presentation on theme: "CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version."— Presentation transcript:

1 CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version

2 data link layer : flow and error control u purpose : regulate the flow of data from sender S to receiver R, so that R is neither overwhelmed nor kept idle unnecessarily. u secondary purpose may also be used to avoid swamping the network or link with traffic. u technique : send control information between S and R, synchronizing on buffer space, transmission rates, etc. u protocols: u stop-and-wait, alternating bit u sliding window (go-back-N, selective repeat/reject)

3 performance analysis of networks u attempts to determine the efficiency of a network; that is, for various traffic loads, how well the network uses its resources to meet the needs of the traffic u examples u stop and wait u alternating bit u more complex networks need the use of probability and queueing theory

4 data link layer : stop-and -wait protocol send 1 frame, then stop, and wait for an acknowledgment before sending the next. R X data ack data

5 data link layer : stop and wait u what happens if a message is lost? u to tolerate losses, must add timeouts (TO) and retransmissions u what happens if data is lost? u what happens if ack is lost? u what is the obvious solution? u alternating bit protocol:add a number to data frames, to uniquely identify; enable repeated messages to be safely discarded

6 data link layer : stop and wait protocols u what is the efficiency of this S&W protocol? i.e., of the total time spent, how much is actually spent sending the data? u variables t d, time spent transmitting the data t p, propagation delay t proc, processing time t ack, time spent transmitting the ack. U, utilization or efficiency of the protocol

7 performance of A-B protocol u AB protocol U = t d /( t d + 2 t prop ), error free case or U = (1-P E )t d /( t d + 2 t prop, )error case tdtptptdtptp

8 link utilization of AB protocol u suppose we use a satellite link, t prop = 250ms; data frame is 16K bits; transmission rate is 1 Mbps. What is U ? Assume negligible error rate. u how might this be improved? eart h

9 sliding window protocols: no error u send a series of data frames, without waiting for acknowledgments 1 at a time u window W : the number of frames in transit between sender and receiver (max, current) u each frame numbered from 0, 1, 2,..., w u receiver may ack 1 or more frames at a time u X sends up to max window, then waits for acks; u R uses acks to control and maximize utilization

10 sliding window protocol : no error suppose w = 3: NOTE: By Convention ack# = sequence # of next frame expected by receiver d0 d1 d2 ack3

11 sliding window protocol u sequencing for w = 3: u d0, d1, d2 u wait for ack3 u d3, d0, d1 u wait for ack2 u etc. u exercise: show all sequences possible on timing diagram for w=3. (include 3 at a time, 2 at a time, 1 at a time)

12 sliding window protocol : no error u what is the efficiency of the protocol? ie, what is the best utilization possible? (assume no errors in the channel) u sliding window: no channel errors U = W t d /( t d + 2 t prop ), if less than 1, U = 1, otherwise.

13 Why sliding window protocol? u for large windows, what if a message is lost? what problem do you see with this? u suppose w = 63: what if d61 lost? d0 d1 d62 d61 ack61 TwTw d6 1

14 sliding window: variables, nacks u standard variables N S and N R : used to keep track of sequence numbers u N S : send sequence number; seq. number of the next data frame to be sent. Increments modulo W max +1. u N R : receive sequence number; seq. number of the last (most recent) nack. frame received u both are local variables of the sender u current window in sender is found by subtracting the difference, N S _ - N R, from maximum window size -- W current = W max - [ N S _ - N R ]

15 sliding window: variables, nacks u go-back-N nacks: if a frame lost, it and all subsequent frames retransmitted u nack : (1) acknowledges previous frames, and (2) rejects numbered frame and all subsequent frames. Sequence numbers convention same as acks# ie. Next frame expected. u when sender gets a nack, N S must be rolled back to the value of the nack, and u N R must be rolled forward to the nack u examples

16 sliding window: variables, nacks u Initially, N S = N R = 0 u N S incremented each time a frame sent u N R updated each time a nack frame received u example: suppose Wmax = 5; show values after each of following: u send d0, d1, d2 u receive nack1 u send d1, d2, d3, d4, d5 u receive nack4 u send d4, d5, d0 u what is current window size? Calculated modulo Wmax +1

17 sliding window protocol u Go-back-n needlessly repeats frames u sliding window: selective repeat (also called selective reject) u only retransmit messages which were lost u window size at most half the range of sequence numbers (why?) u timing diagrams u disadvantage u more buffers, more complex algorithm, costs more u advantage u higher efficiency in noisy channels

18 data link protocol performance u go-back-N, selective repeat : no channel errors U = W t d /( t d + 2 t prop ),if less than 1, U = 1, otherwise.

19 performance of data link protocols u selective repeat: with errors U = 1 - P, for Wt d > t d + 2 t prop = (1 - P) Wt d / t d + 2 t prop, otherwise u go-back-N, with errors U = (1 - P)t d /(t d + 2t p P), W > 2t p /t d + 1, = W(1 - P)t d / (2t p + t d )(1 - P + WP), O.W. u see Stallings Appendix 6A

20 HDLC: high level data link control u ISO standard for a data link protocol u other DL standards exist, but are very similar; e.g., PPP u HDLC combines various functions of the DL layer - flow control, error control, sequencing, framing, etc. - into a single protocol standard u HDLC standard is broad, covering several different cases u 3 general classes: u station type u link configuration u mode of operation

21 HDLC u station types u primary P u secondary S u combined C u types P and S are for multipoint network with polling u hub polling, etc. --> master/slave network u type C for point-to-point link u link configurations u balanced : 2 combined stations on 1 direct link u unbalanced : 1 P, n S ’s directly connected (e.g., bus)

22 HDLC u frame types and formats u I-frame(information/data) u S-frame (supervisory) u U-frame (data)


Download ppt "CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version."

Similar presentations


Ads by Google