CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version
description
Transcript of CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version
![Page 1: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/1.jpg)
CS3502:CS3502:
Data and Computer NetworksData and Computer Networks
DATA LINK LAYER - 2DATA LINK LAYER - 2WB versionWB version
![Page 2: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/2.jpg)
data link layer : flow and error data link layer : flow and error control control
purpose : regulate the flow of data from sender S to receiver R, so that R is neither overwhelmed nor kept idle unnecessarily.
secondary purpose may also be used to avoid swamping the network or link with traffic.
technique : send control information between S and R, synchronizing on buffer space, transmission rates, etc.
protocols: stop-and-wait, alternating bit sliding window (go-back-N, selective repeat/reject)
![Page 3: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/3.jpg)
performance analysis of performance analysis of networks networks
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
examples stop and wait alternating bit
more complex networks need the use of probability and queueing theory
![Page 4: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/4.jpg)
data link layer : stop-and -wait data link layer : stop-and -wait protocolprotocol
send 1 frame, then stop, and wait for an acknowledgment before sending the next.
RXdata
ack
data
![Page 5: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/5.jpg)
data link layer : stop and waitdata link layer : stop and wait what happens if a message is lost?
to tolerate losses, must add timeouts (TO) and retransmissions what happens if data is lost? what happens if ack is lost? what is the obvious solution?
alternating bit protocol:add a number to data frames, to uniquely identify; enable repeated messages to be safely discarded
![Page 6: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/6.jpg)
data link layer : stop and wait data link layer : stop and wait protocolsprotocols
what is the efficiency of this S&W protocol? i.e., of the total time spent, how much is actually spent sending the data?
variables
td, time spent transmitting the data
tp, propagation delay
tproc, processing time
tack, time spent transmitting the ack.
U, utilization or efficiency of the protocol
![Page 7: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/7.jpg)
performance of A-B protocolperformance of A-B protocol
AB protocolU = td /( td + 2 tprop), error free
case
or U = (1-PE)td /( td + 2 tprop, )error case
td
tp
tp
![Page 8: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/8.jpg)
link utilization of AB protocollink utilization of AB protocol
suppose we use a satellite link, tprop = 250ms; data frame is 16K bits; transmission rate is 1 Mbps. What is U ? Assume negligible error rate.
how might this be improved?
earth
![Page 9: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/9.jpg)
sliding window protocols: no sliding window protocols: no errorerror
send a series of data frames, without waiting for acknowledgments 1 at a time
window W : the number of frames in transit between sender and receiver (max, current)
each frame numbered from 0, 1, 2, ..., w
receiver may ack 1 or more frames at a time
X sends up to max window, then waits for acks;
R uses acks to control and maximize utilization
![Page 10: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/10.jpg)
sliding window protocol : no sliding window protocol : no errorerror
suppose w = 3: NOTE: By Convention
ack# = sequence # of next frame
expected by receiver
d0d1d2
ack3
![Page 11: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/11.jpg)
sliding window protocolsliding window protocol
sequencing for w = 3: d0, d1, d2 wait for ack3 d3, d0, d1 wait for ack2 etc.
exercise: show all sequences possible on timing diagram for w=3. (include 3 at a time, 2 at a time, 1 at a time)
![Page 12: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/12.jpg)
sliding window protocol : no sliding window protocol : no errorerror
what is the efficiency of the protocol? ie, what is the best utilization possible? (assume no errors in the channel)
sliding window: no channel errors
U = W td /( td + 2 tprop ), if less than 1,
U = 1, otherwise.
![Page 13: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/13.jpg)
Why sliding window protocol?Why sliding window protocol?
for large windows, what if a message is lost? what problem do you see with this?
suppose w = 63: what if d61 lost?
d0d1
d62d61
ack61
Tw d6
1
![Page 14: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/14.jpg)
sliding window: variables, nackssliding window: variables, nacks
standard variables NS and NR : used to keep track of sequence numbers NS : send sequence number; seq. number of the
next data frame to be sent . Increments modulo Wmax +1.
NR : receive sequence number; seq. number of the last (most recent) nack. frame received
both are local variables of the sender current window in sender is found by subtracting
the difference, NS _- NR , from maximum window size --
Wcurrent = Wmax - [NS _- NR ]
![Page 15: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/15.jpg)
sliding window: variables, sliding window: variables, nacksnacks
go-back-N nacks: if a frame lost, it and all subsequent frames retransmitted nack: (1) acknowledges previous frames, and
(2) rejects numbered frame and all subsequent frames. Sequence numbers convention same as acks# ie. Next frame expected.
when sender gets a nack, NS must be rolled back to the value of the nack, and
NR must be rolled forward to the nack
examples
![Page 16: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/16.jpg)
sliding window: sliding window: variables, variables, nacksnacks Initially, NS = NR = 0
NS incremented each time a frame sent
NR updated each time a nack frame received example: suppose Wmax = 5; show values
after each of following: send d0, d1, d2 receive nack1 send d1, d2, d3, d4, d5 receive nack4 send d4, d5, d0
what is current window size? Calculated modulo Wmax +1
![Page 17: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/17.jpg)
sliding window protocolsliding window protocol Go-back-n needlessly repeats frames sliding window: selective repeat (also
called selective reject) only retransmit messages which were lost window size at most half the range of sequence
numbers (why?) timing diagrams disadvantage
more buffers, more complex algorithm, costs more advantage
higher efficiency in noisy channels
![Page 18: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/18.jpg)
data link protocol performance data link protocol performance
go-back-N, selective repeat : no channel errors
U = W td /( td + 2 tprop ),if less than 1,
U = 1, otherwise.
![Page 19: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/19.jpg)
performance of data link performance of data link protocolsprotocols
selective repeat: with errors U = 1 - P, for Wtd > td + 2 tprop
= (1 - P) Wtd / td + 2 tprop , otherwise
go-back-N, with errorsU = (1 - P)td/(td + 2tpP), W > 2tp/td +
1,
= W(1 - P)td/ (2tp + td)(1 - P + WP), O.W.
see Stallings Appendix 6A
![Page 20: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/20.jpg)
HDLC: high level data link HDLC: high level data link controlcontrol
ISO standard for a data link protocol other DL standards exist, but are very
similar; e.g., PPP HDLC combines various functions of the DL
layer - flow control, error control, sequencing, framing, etc. - into a single protocol standard
HDLC standard is broad, covering several different cases
3 general classes: station type link configuration mode of operation
![Page 21: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/21.jpg)
HDLCHDLC
station types primary P secondary S combined C types P and S are for multipoint network with
polling hub polling, etc. --> master/slave network
type C for point-to-point link
link configurations balanced : 2 combined stations on 1 direct link unbalanced : 1 P, n S’s directly connected
(e.g., bus)
![Page 22: CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version](https://reader035.fdocuments.us/reader035/viewer/2022062805/56814cf3550346895db9f7a6/html5/thumbnails/22.jpg)
HDLCHDLC frame types and formats
I-frame(information/data) S-frame (supervisory)U-frame (data)