+ All Categories
Home > Documents > McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.

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

Date post: 17-Dec-2015
Category:
Upload: erik-richard
View: 213 times
Download: 0 times
Share this document with a friend
Popular Tags:
30
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols
Transcript

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Chapter 11

Data LinkControl

andProtocols

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Flow and Error Control

Flow control refers to a set of procedures Flow control refers to a set of procedures used to restrict the amount of data that the used to restrict the amount of data that the sender can send before waiting for sender can send before waiting for acknowledgment.acknowledgment.

Error control in the data link layer is Error control in the data link layer is based on automatic repeat request (ARQ), based on automatic repeat request (ARQ), which is the retransmission of data.which is the retransmission of data.

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

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.

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. Acknowledgment is delayed

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Operation of Stop-and-Wait ARQ

Frame is lost

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.

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.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Piggybacking

Bidirectional transmission Method to combine a data frame with

an acknowledgement.

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 2m – 1.

Sender Sliding Window Window size is fixed here.

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

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Control variables

S = Sequence number of the recently sent frame SF = Sequence number of first frame in the window SL = Sequence number of last frame in the window Window Size = SL – SF + 1 If sequence number of received frame is same as

R, accept it.

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

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Go-Back-N ARQ, normal operation

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

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

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Go-Back-N ARQ: sender window size If size of window is less than 2m, 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 2m, 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

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 2m.

Specifies the range of accepted frames. Receiver reports the damaged frame using negative

ACK (NAK)

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Selective Repeat ARQ, lost frame

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.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Example 1Example 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?

SolutionSolution

The bandwidth-delay product is

1 106 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.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Example 2Example 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?

SolutionSolution

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.

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.

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.

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

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

11.22 Example 3

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Example 4Example 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.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

11.23 Example 4

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.

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2004

Bit stuffing in HDLC


Recommended