Presentation is loading. Please wait.

Presentation is loading. Please wait.

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.

Similar presentations


Presentation on theme: "McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols."— Presentation transcript:

1 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols

2 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Flow and Error Control Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Error control in the data link layer is based on automatic repeat request (ARQ), which is the retransmission of data. Error control in the data link layer is based on automatic repeat request (ARQ), which is the retransmission of data.

3 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Flow and Error Control Mechanisms Stop-AND-WAIT ARQ Go-BACK-N ARQ SELECTIVE REPEAT ARQ Flow and Error control Mechanisms

4 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Stop-and-Wait ARQ Keep a copy of the frame until ACK is received. Frame 0 is acknowledged by ACK 1 and vice-versa. Lost and corrupted frames are considered as same and No ACK is sent. Sender’s control variable S = holds number of recently sent frame Receiver’s control variable R = holds number of the next frame expected Sender starts a timer when it sends a frame. If an ack does not arrive within an allotted time period, sender assumes that packet is corrupted or lost. Sender will resend the same packet.

5 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Operation of Stop-and-Wait ARQ 1.Normal Operation 2.Frame is lost 3.Acknowledgment is lost 4.Ack nowledgment is delayed

6 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Operation of Stop-and-Wait ARQ Frame is lost

7 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Operation of Stop-and-Wait ARQ lost ACK frame In Stop-and-Wait ARQ, numbering frames prevents the retaining of duplicate frames.

8 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Stop-and-Wait ARQ, delayed ACK The value of R at the receiver site is still 1, which means the receiver expects to see frame 1. Numbered acknowledgments are needed if an acknowledgment is delayed and the next frame is lost.

9 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Piggybacking Bidirectional transmission Method to combine a data frame with an acknowledgement.

10 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Go-back-N ARQ Sending multiple frames at a time. Keep the copy of the frames before ACK is received. Sequence number is included in each frame in the header. If there are m bits for sequence number then we can have maximum 2 m – 1. Sender Sliding Window Window size is fixed here.

11 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Size of window at receiver site is always 1. Receiver is always looking for a specific frame to arrive in a specific order. Receiver sliding window

12 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Control variables S = Sequence number of the recently sent frame S F = Sequence number of first frame in the window S L = Sequence number of last frame in the window Window Size = S L – S F + 1 If sequence number of received frame is same as R, accept it.

13 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Timers The sender set timer for each frame Receiver has no timer. Acknowledgment Resending Frames When a frame is lost or damaged, sender send a block of frames. This block starts from one that has lost or damaged up to the current frame sent. More Important Variables

14 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Go-Back-N ARQ, normal operation

15 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Go-Back-N ARQ, lost frame Frame 2 is lost. When the receiver receives frame 3, it is discarded because the receiver is expecting frame 2, not frame 3 (according to its window) Acknowledgements are cumulative

16 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Go-Back-N ARQ, Lost Acknowledgment Two cases are possible ACK arrives before the expiry of the timer No need to resend the frames ACK arrives before the expiry of the timer Resend all the frames starting with one for which timer has expired to the last one sent. Delayed ACK

17 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Go-Back-N ARQ: sender window size If size of window is less than 2 m, and all three ACK are lost, the frame 0 timer expires and all three frames are resent. Receiver discards them as duplicate. If size of window is equal to 2 m, and all three ACK are lost, sender will send the duplicate frame 0 but receiver will accept it as next frame as it expects that

18 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Selective Repeat ARQ, sender and receiver windows Go-back-N resends multiple frames and its inefficient in noisy links. Sender and receiver window size is at most one-half of the value 2 m. Specifies the range of accepted frames. Receiver reports the damaged frame using negative ACK (NAK)

19 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Selective Repeat ARQ, lost frame

20 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Selective Repeat ARQ, sender window size Size of window is 2 and all acknowledgements are lost, the timer for frame 0 expires and frame 0 is resent. Receiver is expecting frame 2, not frame 0, so this duplicate frame is correctly discarded. Size of window is 3 and all acknowledgements are lost, the sender sends a duplicate of frame 0. Receiver expects 0 as part of window and so accepts it.

21 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 1 In a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the bandwidth-delay product? If the system data frames are 1000 bits in length, what is the utilization percentage of the link? Solution The bandwidth-delay product is 1  10 6  20  10 -3 = 20,000 bits The system can send 20,000 bits during the time it takes for the data to go from the sender to the receiver and then back again. However, the system sends only 1000 bits. We can say that the link utilization is only 1000/20,000, or 5%. For this reason, for a link with high bandwidth or long delay, use of Stop-and-Wait ARQ wastes the capacity of the link.

22 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 2 What is the utilization percentage of the link in Example 1 if the link uses Go- Back-N ARQ with a 15-frame sequence? Solution The bandwidth-delay product is still 20,000. The system can send up to 15 frames or 15,000 bits during a round trip. This means the utilization is 15,000/20,000, or 75 percent. Of course, if there are damaged frames, the utilization percentage is much less because frames have to be resent.

23 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Pipelining A new task is taken before the last task finished is known as pipelining. Stop-and-Wait ARQ Not a pipelined case. Go-Back-N ARQ and Selective Repeat are examples of pipelining.

24 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 HDLC HDLC (High-level Data Link Control) is an actual protocol designed to support both half-duplex and full-duplex communication over point-to- point and multipoint links. NRM- Normal Response Mode ABM- Asynchronous Balanced Mode I-Frame (Information frame): Used to transport user data and control information relating to user data (piggybacking). S-frame (Supervisory frame): Used only to transport control information. U-frame (Unnumbered frame): Reserved for system management.

25 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 HDLC frame types I-Frame has sequence and ACK numbers S-frame contains the code for Receive Ready, Receive Not Ready, Reject, Selective Reject. U-frame is used for session management and control information

26 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.22 Example 3

27 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 4 In Example 3, suppose frame 1 sent from station B to station A has an error. Station A informs station B to resend frames 1 and 2 (the system is using the Go-Back- N mechanism). Station A sends a reject supervisory frame to announce the error in frame 1. Figure 11.23 shows the exchange.

28 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.23 Example 4

29 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Bit stuffing and removal Data field can not have the field reserved for the flag field. Bit stuffing is the process of adding one extra 0 whenever there are five consecutive 1s in the data so that the receiver does not mistake the data for a flag.

30 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Bit stuffing in HDLC


Download ppt "McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols."

Similar presentations


Ads by Google