Download presentation
Presentation is loading. Please wait.
Published byClement Turner Modified over 9 years ago
1
Data Link Layer We have now discussed the prevalent shared channel technologies Ethernet/IEEE 802.3 Wireless LANs (802.11) We have now covered chapters 1-11 We had previously discussed telephony digital technologies – chapter 12 We now move to look at Wide Area Networks (WAN) technologies Chapter 13 deals forwarding frames in a WAN. We will skip for now Chapter 14 deals with what is called connection oriented networking in the WAN. Skip for now
2
Network Characteristics Chapter 15 Network ownership Private Networks Public Networks Virtual Private Networks Service Paradigm Connection Oriented Service Connectionless Service Most LAN architectures are connectionless Most WAN architectures are connection oriented Addressing considerations
3
Network Characteristics Network Performance Delay Propagation delay Delay through devices (repeaters, bridges) Access delays Queuing delays Throughput Bandwidth Effective throughput Delay and congestion – affect throughput Delay – throughput product –The number of bits that will ‘fit’ on a channel or network Jitter Variance in delay
4
Point-to-Point Communications Chapter 16 discusses protocol layering Previously discussed ISO model of seven layers At data link layer, a number of point-to- point protocols are in wide use We have mentioned HDLC used in point to point circuits A popular protocol is officially call the Point-to- Point Protocol or PPP.
5
Point-to-Point Communications Consider two stations connected by some direct channel. One station has a number of frames to send The second station is ready to receive frames
6
6 5 4 1 3 2 AB 432121321 1 What if receiver cannot receive as fast as sender can send? What if the receiver is not ready to receive? What could we do to effect flow control? Suppose we require receiver to acknowledge a frame before sending another?
7
6 5 4 1 3 2 AB 1 This controls the flow This works fine, if frames are never lost or damaged Suppose we add some checking, like CRC? Receiver could detect error and not send ACK After some period of time (timer) sender could resend Alternative: receiver could send a NAK to cause sender to resend ACK1 1 2 2 ACK2
8
Simple Protocol Suppose frame sent and received correctly ACK frame sent by receiver but never arrives Transmitter resends frame Now we have a duplicate frame Clearly, we must protect against a frame being lost or damaged We must protect against response frame being lost or damaged (ACK,NAK) Must prevent duplicate frames
9
Simple Protocol Clearly, a timer must be involved at the transmitter Receiver must be able to distinguish a new frame from a retransmitted one One approach might be to include a sequence number in each frame If receiver gets duplicate sequence number it could simply throw one away. Does the resulting protocol work? If yes, how large should the sequence number field be?
10
Stop and Wait Protocol There is only one unacknowledged frame at a time Need only two sequence numbers: 0 and 1 Send frame Set timer Wait for ACK or timeout Sender places sequence number in frame Receiver places sequence number in ACK Transmitter never sends new frame until acknowledgement
11
Stop and Wait Protocol In a full duplex environment both sides may be sending frames. It makes sense to carry an ACK for a received frame in a frame being sent seq ack Data
12
Stop and Wait Efficiency Consider a T1 circuit, 1.5 Mbps Suppose circuit is coast to coast, 4000 km Assume a 1000 byte frame Assume size of ACK frame negligible We can calculate efficiency Tx = time to transmit a frame p = one way propagation delay Tx = 8000/1,500,000 = 5.3 ms p = 4,000,000/200,000,000 = 20 ms U = 5.3/(5.3 + 2*20 =.117 U = 11.7 per cent
13
Sliding Window Protocol To improve utilization, we must send more than one frame before receiving an ACK Suppose we use a 3 bit sequence number Frame numbers would range from 0-7 How many frames could we send before receiving an acknowledgement? We could not send all frames numbered 0- 7. Why not? We could send frames numbered 0, 1,.., 6 and wait for an ACK before proceeding
14
Sliding Window Protocol In general, we have n bits for sequence number Sequence runs 0, 1, 2, …., 2 n -1 Stop and Wait protocol is simply the case of n=1 Sender maintains buffers of frames sent but not acknowledged This is the sending window (N frames) Receiver tracks sequence number(s) it is able to receive
15
Sliding Window Protocol If sliding window is large enough, an ACK would arrive before the last frame in the window is sent In this case, we could be sending continuously This is called pipelining Given N, the window size, what is the utilization of this protocol? For the moment, assume no errors
16
6 5 4 1 3 2 AB 432121321 1 54321654321109876511109876987654876543765432 1 11 10 9 8 7 12 13 14 2 3 4 121110987 5 6 ACK1 ACK2ACK3ACK4ACK5ACK6ACK1ACK2ACK1ACK2ACK3ACK1ACK2ACK3ACK4ACK1ACK2ACK3ACK4ACK5 In this case 6 frames fit on the channel The delay-product is 6 * bits/frame It takes 12 unacked frames to keep the channel at 100 per cent utilization
17
6 5 4 1 3 2 AB 432121321 1 54321654321109876511109876987654876543765432 1 11 10 9 8 7 12 13 14 2 3 4 121110987 5 6 ACK1 ACK2ACK3ACK4ACK5ACK6ACK1ACK2ACK1ACK2ACK3ACK1ACK2ACK3ACK4ACK1ACK2ACK3ACK4ACK5 In this case 6 frames fit on the channel The delay-product is 6 * bits/frame It takes 12 unacked frames to keep the channel at 100 percent utilization
18
Sliding Window Utilization We have seen that for Stop and Wait This is the time to send one frame and get an ACK If we could send N frames during this time Assuming of course this does not exceed 1 * *
19
Errors with Sliding Windows Suppose a frame is lost or damaged in transmission Frames following damaged frame continue to arrive Suppose se send f 0, f 1, f 2. f 3, f 4, f 5, f 6 Receiver must pass frames to next layer in order What strategies could we use to address this situation? Couple approaches
20
Handling Errors – Strategy 1 Ignore all frames following damaged one Do not acknowledge damaged frame or any following ones In due time, transmitter will time out for damaged frame and all those following Sender sends all frames starting with damaged one This is called Go Back N Also called Automatic Repeat Request (ARQ)
21
Handling Errors –Strategy 1 In this case the receiver only accepts frames in order The receiver has a receive window of size 1
22
Handling Errors –Strategy 1 Remember, sending window cannot be full range of sequence numbers Suppose you had sequence numbers 0, 1, 2,.., 7 (8 numbers) Send frames 0-7 All received correctly All ACKs lost! Transmitter sends 0-7 (again) Receiver assumes second set Therefore, cannot have 8 outstanding frames
23
Handling Errors –Strategy 2 Let receiver have a larger receive window Let receiver accept and buffer all frames in window Receiver does not acknowledge good frames unless all previous frames are good Transmitter only resends damaged frames or frames that time out In previous example, f 0, f 1, f 2. f 3, f 4, f 5, f 6 Receiver ACKS f 1, buffers f 3, f 4, f 5, f 6,
24
Handling Errors –Strategy 2 This strategy is called Selective Repeat If we have sequence numbers 0, 1, 2, …, 7, what is the sending window in this case?
25
Selective Repeat Accept frames out of order – buffer them if they fit in receive window Suppose we have sequence numbers 0-7 sending windowreceive window 0 1 2 3 4 5 6 Frames 0-6 are sent and received Receiver adjusts receive window Suppose all ACKS are lost Frames 0 – 6 are resent 7 0 1 2 3 4 5
26
Selective Repeat Sending window cannot be simply 1 less than the number of sequence numbers In fact, if we have sequence 0, 1, 2, ….., 2 n -1 window cannot be larger than or half the range of numbers If n = 4, range of sequence numbers 0, 1,.. 15 Window size (N) cannot exceed 8 frames
27
Sliding Window Utilization If there are no errors * where N = window size Let q = probability a frame or ACK in error Selective Repeat * U = 1 – q for N*Tx ≥ Tx + 2p
28
Sliding Window Utilization Go Back N or Automatic Repeat Request (ARQ) N*Tx ≥ Tx + 2p * *
29
Sliding Window Examples HDLC – High Level Data Link Control LAPB – Link Access Protocol PPP - Point to Point Protocol These are all bit oriented protocols All use variations of sliding window protocols
30
HDLC Frame 0111110 Address Control data FCS 0111110 Control 0 SEQ ACK SEQ, ACK = 3 bits or 7 bits
31
Sliding Window Summary Transmitter send N frames before having to receive acknowledgement N is the window size Transmitter sets a timer for each frame Transmitter resends each frame that times out Go Back N (ARQ) Selective Repeat Acknowledging a frame implies all previous frame acknowledged Variation: Instead of acknowledging a received frame, specify the next frame expected
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.