0% found this document useful (0 votes)
189 views10 pages

LECTURE 4-Direct Link Networks PART IV

A set of procedures used to restrict the amount of data that the sender can send. A session can be initiated by either station of equal rank. The initiator first transmits a frame called an enquiry (ENQ) asking if the receiver is available to receive the data. When ACK or NAK is not received within a specified time limit, the initiator sends another.

Uploaded by

yesmurali
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views10 pages

LECTURE 4-Direct Link Networks PART IV

A set of procedures used to restrict the amount of data that the sender can send. A session can be initiated by either station of equal rank. The initiator first transmits a frame called an enquiry (ENQ) asking if the receiver is available to receive the data. When ACK or NAK is not received within a specified time limit, the initiator sends another.

Uploaded by

yesmurali
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Dept.

of EEE CS 65 Computer Networks

Data Link Control

Direct Link Networks


Line Discipline Who Should send data
and When ?

How much data may


Flow Control
be sent?

How can errors be


Error Control
Detected and correct?
146

ENQ / ACK

Data Link Control

ENQ / ACK
Line Discipline
Who Should send data
and When ? Poll / Select
• Used primarily between two devices.
Stop-and-wait • A session can be initiated by either station of equal rank.
Flow Control (one frame at a time) • The initiator first transmits a frame called an enquiry (ENQ) asking if the receiver
a set of procedures used to
restrict the amount of data is available to receive the data.
that the sender can send Sliding window
• The receiver must answer with either with an acknowledgement (ACK) frame if it
(several frames at a time)
is ready or with negative acknowledgement (NAK) frame if it is not.
Error Control • When ACK or NAK is not received within a specified time limit, the initiator sends
How can errors be Stop-and-wait ARQ another.
Detected and correct? • At the end of transmission sending system finishes it with end of transmission
Sliding window ARQ (EOT).

147
Go-back-n Selective-reject 148

Prepared by Dr.S.Muralidharan 1
Dept. of EEE CS 65 Computer Networks

Poll / Select
• This method works with topologies where one device is designated as a primary
station and others are secondary stations.
• All the data exchanges must be made through the primary device.
• In such multipoint topology identify each device with an address, poll/select
identify each frame as being either to or from a specific device on the link.
• It is up to the primary to determine which device is allowed to use the channel at a
given time.
• If the primary wants to send data, it asks the target secondary to get ready by
“selecting”. This is done by sending SEL frame containing the intended
secondary. Also primary wait till it gets “acknowledgement” from the target
secondary device.

149 150

• As an initiator of a session, primary conducts “polling” among the


attached devices for any data transmission.
• If the first secondary device responses with NAK frame (if nothing to
send), it approaches the next secondary and it goes on till it receives a
data frame.

151 152

Prepared by Dr.S.Muralidharan 2
Dept. of EEE CS 65 Computer Networks

STOP-AND-WAIT SLIDING WINDOW


• Sender waits for an acknowledgment after every frame it sends. • Sender can transmit several frames before needing an acknowledgement.
• Only after getting acknowledgement the sender will send the next frame. • Sliding window refers to imaginary boxes at both the sender and the
• This procedure will repeat till the sender transmits “end of transmission” receiver. This window can hold frames at either end and provides the
(EOT) frame. upper limit on the number of frames that can be transmitted before
• Advantage : simplicity requiring an acknowledgement.
• Disadvantage : slow • Frames may be acknowledged at any point without waiting for the window
to fill up and may be transmitted as long as the window is not yet full.
• To keep track of which frames have been transmitted and which received,
sliding window introduces an identification scheme based on the size of
the window.
• The frames are numbered in modulo-n, ie. they are numbered from 0 to n-
1, for a window of size n.
• Eg. If n=8, then frames are numbered as
0,1,2,3,4,5,6,7,01,2,3,4,5,6,7,0,1,….
and the size of the window is n-1

153 154

• When the receiver sends an ACK, it includes the number of • SENDER SLIDING WINDOW
the next frame it expects to receive. • At the beginning of a transmission, the sender’s window contains n-1 frames.
As frames are sent out, the left boundary of the window moves inward,
• ie. in order to acknowledge the receipt of frames ending in frame 4,
shrinking the size of the window.
the receiver sends acknowledgement containing the number 5.
• Once an ACK arrives, the window expands to allow in a number of new
• This ACK informs the sender about the proper delivery of frames up to frames equal to the number of frames acknowledged by that ACK frame
frame 4. • For a given window size 7, if frames 0 through 4 have been sent and no
• SENDER SLIDING WINDOW acknowledgement has been received, the sender window contains two
• At the beginning of a transmission, the sender’s window contains n-1 frames. frames, numbered 5 and 6.
As frames are sent out, the left boundary of the window moves inward, • If an ACK numbered 4 is received, four frames (0 to 3) are known to have
shrinking the size of the window. arrived undamaged and the sender’s window expands to include the next four
• Once an ACK arrives, the window expands to allow in a number of new frames inside the window.
frames equal to the number of frames acknowledged by that ACK frame

155 156

Prepared by Dr.S.Muralidharan 3
Dept. of EEE CS 65 Computer Networks

RECEIVER SLIDING WINDOW


• At the beginning of the transmission, the receiver window contains not n-1 frames
but n-1 spaces for frames.
• As new frames come in the size of the receiver window shrinks.
• The receiver window therefore represents not the number of frames received but
the number of frames that may still be received before an ACK must be sent.
• In the above fig. the window contains 7 spaces to accept 7 frames.

157 158

• As the frames 0-4 arrived the window shrinks by 5 from left to right.

shrinks

• As the ACK is sent out, the receiving window expands to include as many
new frames as newly acknowledged.

Expands

159 160

Prepared by Dr.S.Muralidharan 4
Dept. of EEE CS 65 Computer Networks

AUTOMATIC REPEAT REQUEST (ARQ) Stop-and-Wait ARQ


• Error control in data link layer is based on Automatic Repeat • It is a form of stop-and-wait flow control extended to
Request (ARQ), which means retransmission of data in three include retransmission of data in case of lost or
damaged frames.
cases : damaged frame, lost frame, and lost • The sending device keeps a copy of the last frame
acknowledgement. transmitted until it receives an acknowledgement for that
frame.
• For identification purposes, both data frame and ACK
frames are numbered alternatively 0 and 1. A data 0
frame is acknowledged by ACK 1 frame, indicating that
the receiver has got data 0 and is now expecting data 1.
• The receipt of NAK frame (which is not numbered) by
the sender indicate that the last frame sent was
damaged or lost.
• Sending end can also retransmit if it has not received
the ACK frame after the ‘time out’ period.

Stop-and-wait ARQ: Normal Operation Stop-and-wait ARQ: Damaged frame

Prepared by Dr.S.Muralidharan 5
Dept. of EEE CS 65 Computer Networks

Stop-and-wait ARQ: Lost data frame Stop-and-wait ARQ: Lost ACK frame

Stop-and-wait ARQ: Delay ACK Stop-and-wait ARQ: Piggybacking

Prepared by Dr.S.Muralidharan 6
Dept. of EEE CS 65 Computer Networks

SLIDING WINDOW ARQ


• Popular protocols for continuous transmission • The sending end device is equipped with a timer to enable it
error control are to handle lost acknowledgements.
• Go-back-n ARQ
• In sliding window ARQ, there is no way of knowing whether
• Selective Reject ARQ
the lost frames are dat, ACK or NAK frames. By
• The sending device keeps copies of all
retransmitting the data frames, two possibilities are covered :
transmitted frames
lost data and last NAK. If lost frame was an ACK frame, the
• In addition to ACK frames, the receiver has the
receiver can recognize the redundancy by the number on the
option of returning a NAK frame if the data has
been received in a damaged form. For this frames frame and discard the redundant data.
must be numbered.
• Eg. If the last ACK was numbered 3, an ACK numbered
6 acknowledges the receipt of frames 3,4 & 5. Every
damaged frame must be acknowledged. NAK4 and
NAK5 tells that both frames 4 & 5 are damaged and
NAK4 also informs that the frames prior to frame 4 are
intact.

Sliding Window Sliding Window


Go-back-n: Normal Operation Go-back-n: Damaged data frame

Prepared by Dr.S.Muralidharan 7
Dept. of EEE CS 65 Computer Networks

Sliding Window Sliding Window


Go-back-n: Damaged data frame Go-back-n: Lost Data Frame
• A ACK3 indicates that the prior frames(0,1 & 2) are accepted
in fine form and the next expected frame is 3.
• An NAK3 also indicates the prior frames(0,1 &2) are in good
condition and only 3rd frame is damaged.
• If the receiver receives 4th & 5th frames before getting the
retransmitted 3rd frame, it will discard the 4th & 5th frames.

Sliding Window Sliding Window


Go-back-n: Lost Data Frame Go-back-n: Lost ACK
• Frames 0 & 1 arrived perfectly but frame 2 is lost. The next
frame to arrive at the receiver is data 3.
• Meanwhile if data frame 3 reaches the destination, it will be
assumed to be an error and discards it and returns NAK 2,
indicating 0&1 are correct but 2 is in error.
• Data frame 4 which was sent just before receiving NAK 2 is
also discarded by the receiver.
• Hence a retransmission of frame 2 is done followed by
others.

Prepared by Dr.S.Muralidharan 8
Dept. of EEE CS 65 Computer Networks

Sliding Window
Sliding Window - Selective-reject
Go-back-n: Lost ACK
• The sender is not expecting acknowledgement for each • In selective-reject ARQ, only the specific damaged or lost
frame. Instead it expects a ACK signal for a group of frames. frame is retransmitted. NAK will be sent only for the corrupted
• This ACK is expected before the expiry of a timer. frame. Upon retransmission, the receiver must be able to sort
the frames it has and insert the retransmitted frame into its
proper place in the sequence.
• Sending device should have the capability to retransmit only
the requested frame.
• To help in this process, ACK numbers, like NAK numbers,
must refer to the frame received (or lost) instead of the next
frame expected.

Sliding Window Sliding Window


Selective-reject: Damaged data frame Selective-reject: Damaged data frame
• Frames 0 & 1 are received undamaged but not
acknowledged. Frame 2 is found to contain an error, so a
NAK 2 is returned.
• This NAK informs the sender that frame 0 & 1 are received
intact and accepted but frame 2 needs to be retransmitted.
• Unlike go-back-n system, the receiver continues to accept
new frames while the request for retransmission of earlier
frame is sent. In the example it is frames 3,4 & 5.
• But the next ACK will be sent only after receiving the new
undamaged copy of 2 is received. ie. ACK 5 will be sent after
receiving fresh frame 2.

Prepared by Dr.S.Muralidharan 9
Dept. of EEE CS 65 Computer Networks

Sliding Window Sliding Window


Selective-reject: Lost data frame Selective-reject: Lost Acknowledgement
• If a frame is lost, the next frame is received out of • Lost acknowledgement is identified using timer.
sequence. • If the timer elapses, the sender retransmits all the frames that
• When the receiver tries to reorder the existing frames, it finds remain unacknowledged.
the discrepancy and return NAK. • It is the responsibility of the receiver to identify the duplication
• If the lost frame was the last of the transmission, the receiver and discard them.
does nothing and the sender treats the silence like a lost
acknowledgement.

COMPARISON
Selective-reject Go-Back-n
Retransmit only the Retransmit all the
specific damaged or frames following the
lost frame damaged or lost frame
Involves complexity of Complexity of sorting,
sorting and storage requirement of more
required by the storage and selective
receiver. retransmission are not
Sender needs a logic to needed
select and retransmit
the damaged frame
alone
Efficient but Complex Simple but less efficient

Prepared by Dr.S.Muralidharan 10

You might also like