Data Link Control We want to minimize the amount of error correcting and detecting we need to do.
-
Upload
prudence-hall -
Category
Documents
-
view
221 -
download
0
Transcript of Data Link Control We want to minimize the amount of error correcting and detecting we need to do.
![Page 1: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/1.jpg)
Data Link Control
We want to minimize the amount of error correcting and detecting we
need to do
![Page 2: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/2.jpg)
Framing• The primary purpose of the data link layer is to ensure
data moves from one end of a link to the other accurately.
• One issue is how to separate different information being sent over the link. The way this is done is through framing.
• Framing adds addresses for the sender and receiver to facilitate communication between mutiple devices sharing a physical link.
• It also provides a way of dividing up large transmissions to reduce the quantity of material that needs to be resent in case of an error.
![Page 3: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/3.jpg)
Two types of framing• Fixed-size: Pretty self explanatory
– Wastes resources if we are sending lots of half-empty frames.
• Variable-size:– Frames can be sized to match data segments, so
no wasted resources– More overhead to mark beginning and end of
frame.
![Page 4: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/4.jpg)
• Character-oriented framing:– Frame length is in multiples of bytes. – Headers and trailers also in multiples of bytes.– Use special 1 byte flags at beginning and end of
frame.– Fine if all you’re sending is text, but if you’re
sending other data, some might match the flag.– Byte stuffing inserts a special byte (usually
ESC) into the data section before a byte that matches the flag.
![Page 5: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/5.jpg)
• Bit-oriented framing:– Mostly use pattern 0111110 as the flag.– If that pattern appears in the data segment, we
use bit stuffing to insert an extra 0 after an sequence that looks like 011111.
![Page 6: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/6.jpg)
Data rate control
• What if the two ends of a given link cannot communicate at the same speed?
• Flow control is the process by which the sender and receiver negotiate how much data can be sent before the receiver needs to send an acknowledgement.
• Error control is the process by which the receiver informs the sender about lost/damaged frames and arranges to have those frames resent.
![Page 7: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/7.jpg)
Protocols• These negotiations are not left entirely up to
the devices on either side of a link. Rather, they agree on a system to decide these things. This system is called a protocol.
![Page 8: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/8.jpg)
Noiseless channels• If we can presume the channel is noiseless (which
we never can), the protocols are very simple:– Simplest protocol has no flow or error control.
• Event driven
• Frames are simply sent and assumed to be received and processsed
– Stop-and-Wait has maximal flow control; no error control
• Sender sends a frame
• Sender won’t send another frame until it receives an ACK from the receiver.
![Page 9: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/9.jpg)
Noisy channelsOf course, most channels are noisy, so we need to
have some level of error control.– Stop-and-Wait Automatic Repeat Request (ARQ)
• If a damaged frame arrives at the receiver, no ACK is sent.
• If a certain time passes without receiving an ACK, the frame is re-sent.
• In order to know which frames are being sent, frames need to be numbered.
![Page 10: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/10.jpg)
QuickTime™ and a decompressor
are needed to see this picture.
![Page 11: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/11.jpg)
• Go-Back-N ARQ– Stop-and-wait is inefficient. The link spends a lot of time idle.– Pipelining is where we start a new task before a previous task
is done. So the sender can start sending further frames before receiving an ACK about one already sent.
– A sliding window is the range of frames (sequence numbers) that the sender and receiver are concerned with.
• For the sender, the window is frames sent for which it hasn’t received an ACK and the frames that it is waiting to send.
QuickTime™ and a decompressor
are needed to see this picture.
![Page 12: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/12.jpg)
– For the receiver the window is always 1 frame - the next one it is expecting to receive.
– When the receiver gets a frame, it sends an ACK and moves its window over one.
– If the frame is damaged, no ACK is sent and the window doesn’t move.
– Frames that aren’t in the window that arrive are discarded.
– After the minimal time to wait for an ACK passes, the sender resends all the already sent frames in its window.
![Page 13: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/13.jpg)
QuickTime™ and a decompressor
are needed to see this picture.
![Page 14: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/14.jpg)
• Selective Repeat ARQ– Go-Back-N is inefficient in that lots of
otherwise valid frames get discarded because the receiver’s window only has size 1.
– Why not make the receiver’s window the same size as the sender’s window?
– The primary restriction is that the start of the sender’s window must always be the earliest non-ACKed frame.
– If a frame is lost, it is re-sent after the timer expires.
– If a frame is corrupted, the receiver sends a NAK to the sender, and the frame is resent.
![Page 15: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/15.jpg)
QuickTime™ and a decompressor
are needed to see this picture.
![Page 16: Data Link Control We want to minimize the amount of error correcting and detecting we need to do.](https://reader034.fdocuments.in/reader034/viewer/2022051517/56649cf45503460f949c26e6/html5/thumbnails/16.jpg)
Piggybacking• All of the protocols we’ve just discussed
apply specifically to communication in one direction.
• Most communication, of course, is bi-directional.
• Piggybacking is the process by which ACK and NAK signals are attached to normal data frames that are sent back and forth, to maximize the amount of data being sent.