Error Control in DLL
Error Control in DLL
• Virtual communication
• Actual communication
• Types of services provided for n/w layer
– Unacknowledged connectionless service
– Acknowledged connectionless service
– Acknowledged connection oriented service
11-1 FRAMING
11.4
• Translation of physical layers raw bits into a larger
aggregate or discrete units called frames.
• Here beginning and end of the data are marked to
recognize the frame & used in synchronization.
• Frames are
– Fixed size framing ( ATM WAN) Asynchronous transfer
mode
– Variable size framing (LAN)
• Character oriented protocol (ASCII)
• Bit oriented protocol
Figure 11.1 A frame in a character-oriented protocol
11.6
Figure 11.2 Byte stuffing and unstuffing
11.7
Note
11.8
Figure 11.3 A frame in a bit-oriented protocol
11.9
Note
11.10
Figure 11.4 Bit stuffing and unstuffing
11.11
11-2 FLOW AND ERROR CONTROL
11.12
Note
11.13
Note
11.14
Note
10.15
Types of errors
10.17
Figure 10.1 Single-bit error
10.18
Note
10.19
Figure 10.2 Burst error of length 8
10.20
Note
Redundancy
10.21
Detection Vs Correction
– Block coding
– Convolution coding (more complex)
Figure 10.3 The structure of encoder and decoder
10.24
Note
10.25
Figure 10.4 XORing of two single bits or two words
10.26
Block coding
10.28
Note
10.29
Example 10.4
10.30
Note
10.31
Example 10.5
10.32
Example 10.6
Solution
We first find all the Hamming distances.
10.33
Figure 10.11 Two-dimensional parity-check code
10.34
Cyclic redundancy check
10.36
Figure 10.16 Division in the CRC decoder for two cases
10.37
Note
10.38
11-3 PROTOCOLS
Now let us see how the data link layer can combine
framing, flow control, and error control to achieve the
delivery of data from one node to another. The protocols
are normally implemented in software by using one of
the common programming languages. To make our
discussions language-free, we have written in
pseudocode a version of each protocol that concentrates
mostly on the procedure instead of delving into the
details of language rules.
11.39
Figure 11.5 Taxonomy of protocols discussed in this chapter
11.40
11-4 NOISELESS CHANNELS
11.41
Elementary data link layer protocol
An unrestricted simplest protocol
•In order to appreciate the step by step development of efficient and complex
protocols such as SDLC, HDLC etc., we will begin with a simple but
unrealistic protocol.
In this protocol:
•Data are transmitted in one direction only
•The transmitting (Tx) and receiving (Rx) hosts are always ready
•Processing time can be ignored
•Infinite buffer space is available
•No errors occur; i.e. no damaged frames and no lost frames (perfect channel)
Difference between hdlc & sdlc
• Hdlc: high level data link control protocol
• sdlc : synchronous data link control protocol
• Two protocols that provide point to multipoint interconnection
between computers.
• The main difference between HDLC and SDLC is actually their origin.
• SDLC was developed by IBM for use with their computers.
• They eventually moved for it SDLC to be standardized by governing
bodies like ISO and ANSI. ISO adopted SDLC but renamed it to
HDLC but introduced a number of changes that make it distinct.
• Because of this, HDLC is actually a standard protocol that was used
by many hardware makers while SDLC is not but is still used in some
IBM hardware.
1.HDLC is actually adopted from SDLC
11.45
Algorithm 11.1 Sender-site algorithm for the simplest protocol
11.46
Algorithm 11.2 Receiver-site algorithm for the simplest protocol
11.47
Example 11.1
11.48
Figure 11.7 Flow diagram for Example 11.1
11.49
A simplex stop-and-wait protocol
In this protocol
• we assume that Data are transmitted in one direction only
• No errors occur (perfect channel)
• The receiver can only process the received information at a finite rate
• These assumptions imply that the transmitter cannot send frames at a rate
faster than the receiver can process them. The problem here is how to
prevent the sender from flooding the receiver.
• A general solution to this problem is to have the receiver provide some sort
of feedback to the sender. The process could be as follows: The receiver
send an acknowledge frame back to the sender telling the sender that the
last received frame has been processed and passed to the host; permission
to send the next frame is granted. The sender, after having sent a frame,
must wait for the acknowledge frame from the receiver before sending
another frame. This protocol is known as stop-and-wait.
Figure 11.8 Design of Stop-and-Wait Protocol
11.51
Algorithm 11.3 Sender-site algorithm for Stop-and-Wait Protocol
11.52
Algorithm 11.4 Receiver-site algorithm for Stop-and-Wait Protocol
11.53
Example 11.2
11.54
Figure 11.9 Flow diagram for Example 11.2
11.55
Noisy channels
• In this protocol the unreal "error free" assumption in protocol 2 is dropped. Frames
may be either damaged or lost completely. We assume that transmission errors in the
frame are detected by the hardware checksum.
• One suggestion is that the sender would send a frame, the receiver would send an
ACK frame only if the frame is received correctly. If the frame is in error the receiver
simply ignores it; the transmitter would time out and would retransmit it.
• One fatal flaw with the above scheme is that if the ACK frame is lost or damaged,
duplicate frames are accepted at the receiver without the receiver knowing it.
• Imagine a situation where the receiver has just sent an ACK
frame back to the sender saying that it correctly received and
already passed a frame to its host. However, the ACK frame
gets lost completely, the sender times out and retransmits the
frame. There is no way for the receiver to tell whether this
frame is a retransmitted frame or a new frame, so the receiver
accepts this duplicate happily and transfers it to the host. The
protocol thus fails in this aspect.
This protocol can handle lost frames by timing out. The timeout
interval has to be long enough to prevent premature timeouts
which could cause a "deadlock" situation.
Note
11.59
Note
11.60
Note
11.61
Figure 11.10 Design of the Stop-and-Wait ARQ Protocol
11.62
Example 11.3
11.63
Figure 11.11 Flow diagram for Example 11.3
11.64
Note
11.65
Note
11.66
Figure 11.12 Send window for Go-Back-N ARQ
11.67
Note
11.68
Figure 11.13 Receive window for Go-Back-N ARQ
11.69
Note
11.70
Figure 11.14 Design of Go-Back-N ARQ
11.71
Figure 11.15 Window size for Go-Back-N ARQ
11.72
Note
In Go-Back-N ARQ, the size of the send window must
be less than 2m;
the size of the receiver window
is always 1.
11.73
Note
11.74
Selective Repeat Automatic Repeat Request
•If protocol 2 or 3 is used in these situations the data frames and ACK (control)
frames in the reverse direction have to be interleaved. This method is acceptable but
not efficient. An efficient method is to absorb the ACK frame into the header of the
data frame going in the same direction. This technique is known as piggybacking.
A flexible concept of sequencing is referred to as the sliding window concept and the next three
protocols are all sliding window protocols.
In all sliding window protocols, each outgoing frame contains a sequence number SN ranging
from 0 to 2^(n -1)(where n is the number of bits reserved for the sequence number field).
• At any instant of time the sender maintains a list of consecutive sequence numbers corresponding to
frames it is permitted to send. These frames are said to fall within the sending window. Similarly, the
receiver maintains a receiving window corresponding to frames it is permitted to accept.
• At the receiving node, any frame falling outside the window is discarded. Frames falling
within the receiving window are accepted and arranged into sequence. Once sequenced,
the frames at the left of the window are delivered to the host and an acknowledgement of
the delivered frames is transmitted to their sender. The window is then rotated to the
position where the left edge corresponds to the next expected frame, RN.
•
Whenever a new frame arrives from the host, it is given the next highest
sequence number, and the upper edge of the sending window is advanced by
one. The sequence numbers within the sender's window represent frames sent
but as yet not acknowledged. When an acknowledgement comes in, it gives the
position of the receiving left window edge which indicates what frame the
receiver expects to receive next. The sender then rotates its window to this
position, thus making buffers available for continuous transmission.