lecture 24

22
DATA COMMUNICATIONS & NETWORKING LECTURE- 24 Course Instructor : Sehrish Rafiq Department Of Computer Science University Of Peshawar

Upload: sehrish-rafiq

Post on 07-Jul-2015

98 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Lecture 24

DATA COMMUNICATIONS & NETWORKING

LECTURE-24

Course Instructor : Sehrish Rafiq

Department Of Computer Science

University Of Peshawar

Page 2: Lecture 24

LECTURE OVERVIEW

Go-Back N-ARQ Selective Repeat ARQ

Page 3: Lecture 24

GO-BACK-N ARQ &

SELECTIVE- REPEAT-ARQ

To improve the efficiency, multiple frames should be in-transition while waiting for acknowledgement.

Go-Back N-ARQ Selective Repeat ARQ

Page 4: Lecture 24

GO-BACK N-ARQ

In Go-Back N-ARQ ,we can send W frames before worrying about acknowledgements.

We keep a copy of these frames until an acknowledgement arrive.

Page 5: Lecture 24

SEQUENCE NUMBERS

Frames from a sending station are numbered sequentially.

sequence number is included in the header ,we need to set a limit.

If the header of the frame allows m bits for the sequence number the sequence number range from 0 to 2m -1.

E.g. For m=3 the sequence numbers would be 0 to 7. However we can repeat the sequence.

Page 6: Lecture 24

SENDER SLIDING WINDOW

At the sender site to hold the outstanding frames until they are acknowledged we use the concept of a window.

We imagine that all frames are stored in a buffer.

The outstanding frames are enclosed in a window.

The frames to the left of the window are those that have already being acknowledged.

Page 7: Lecture 24

SENDER SLIDING WINDOW

Those to the right of the window cannot be sent before the window slides over them.

The size of the window is at most 2m -1. The size of this window is fixed. The window slides to include new unsent frames

when correct acknowledgements are received.

Page 8: Lecture 24

SENDER SLIDING WINDOW

Page 9: Lecture 24

RECEIVER SLIDING WINDOW

The size of the window at the receiver site in this protocol is 1.

The receiver is always looking for a specific frame to arrive in a specific order.

Any frame arriving out of order is discarded and needs to be resent.

The receiver window also slides .

Page 10: Lecture 24

RECEIVER WINDOW

Page 11: Lecture 24

CONTROL VARIABLES

The sender has three variables , S, SF and SL. The S variable holds the sequence number of the

recently sent frame. SF holds the sequence number of the first frame of

the window. SL holds the sequence number of the last frame of

the window. The size of the window is W= SL - SF +1. The receiver only has one variable R holding the

sequence number of the frame it expects to receive.

Page 12: Lecture 24

CONTROL VARIABLES CONT…

If the sequence number of the received frame is the same as the value of R, the frame is accepted, if not it is rejected.

Page 13: Lecture 24

TIMERS

The sender sets a timer for each frame sent. The receiver has no timers.

Page 14: Lecture 24

ACKNOWLEDGEMENT

The receiver sends positive acknowledgements if a frame has arrived safe and sound and in order.

If a frame is damaged or is received out of order ,the receiver is silent and will discard all subsequent frames until it receives the one it is expecting .

The silence of the receiver causes the timer of the unacknowledged frame to expire.

This in turn causes the sender to go back and resend all frames beginning one with the expired timer.

Page 15: Lecture 24

GO-BACK-N-ARQ NORMAL OPERATION

Page 16: Lecture 24

DAMAGED OR LOST FRAME

Page 17: Lecture 24

DAMAGED OR LOST ACKNOWLEDGEMENT

If an acknowledgement is damaged or lost we can have two situations.

If the next acknowledgement arrives before the expiration of any timer there is no need for retransmission of frames because acknowledgements are cumulative in this protocol.

However if the next ACK arrives after the timeout, the frame and all the frames after that are resent.

The receiver never resends an ACK.

Page 18: Lecture 24

SELECTIVE REPEAT ARQ

Go-Back-N-ARQ protocol is very inefficient for a noisy link.

In a noisy link a frame has a high probability of damage, which means the resending of multiple frames.

This resending uses up the bandwidth and slows down the transmission.

For noisy links there is another mechanism that does not resend N frames when just one frame is damaged, only the damaged frame is resent.

This mechanism is called Selective-Repeat-ARQ.

Page 19: Lecture 24

SENDER AND RECEIVER WINDOWS

The configuration of the sender and its control variables for Selective-Repeat ARQ are the same as for Go-Back-N ARQ.

However, the size of the window should be at most one half of the value 2m.

The receiver window must have the same size. This window however specifies the range of the

accepted received frame. In selective –Repeat ARQ the receiver is looking

for a range of sequence numbers.

Page 20: Lecture 24

CONTROL VARIABLES

The receiver has two control variables RF and RL to define the boundaries of the window.

Page 21: Lecture 24

SELECTIVE REPEAT ARQ, LOST FRAME

Page 22: Lecture 24

THANKS!!!