DC-Lec-25, 26 & 27 (Data Link Control Protocols)
DC-Lec-25, 26 & 27 (Data Link Control Protocols)
COMMUNICATION
• Checksum
• Single-Bit Error Correction
• Hamming Code
Overview of Lecture
• Data Link Control
• Framing
• Fixed-Sized Framing
• Variable-Sized Framing
• Character Oriented Protocol
• Bit Oriented Protocol
• Flow Control
• Error Control
• Protocols
• Noiseless Channels
• Simplest
• Stop & Wait
• Noisy Channels
• Stop & Wait ARQ
• Go-Back-N ARQ
• Selective Repeat ARQ
Data link control
• The second function of the data link layer is media access control,
or how to share the link.
• The data link layer, on the other hand, needs to pack bits into
frames, so that each frame is distinguishable from another.
• One reason is that a frame can be very large, making flow and
error control very inefficient.
• It was popular when only text was exchanged by the data link
layers.
• The flag could be selected to be any character not used for text.
• Now, however, we send other types of information such as
graphs, audio, and video. Any pattern used for the flag could also
be part of the information.
• If this happens, the receiver, when it encounters this pattern in
the middle of the data, thinks it has reached the end of the frame.
• The data section is stuffed with an extra byte called the escape
character (ESC), which has a predefined bit pattern.
Character-Oriented Protocols (cont..)
• The receiver removes the escape character, but keeps the flag,
which is incorrectly interpreted as the end of the frame.
• To solve this problem, the escape characters that are part of the
text must also be marked by another escape character.
Character-Oriented Protocols (cont..)
Character-Oriented Protocols (cont..)
• Unidirectional
• Data frames travel from sender to receiver.
• In response to data frame, a special frames, called ACK and
NAK flow in the opposite direction for flow and error
control purposes, data flow in only one direction.
• If data frames arrive at the receiver site faster than they can be
processed, the frames must be stored until their use.
• Normally, the receiver does not have enough storage space,
especially if it is receiving data from many sources.
• This may result in either the discarding of frames or denial of
service.
• To prevent the receiver from becoming overwhelmed with
frames, we somehow need to tell the sender to slow down.
• The sender sends one frame, stops until it receives confirmation
from the receiver, and then sends the next frame.
• When the receiver receives a data frame that is out of order, this
means that frames were either lost or duplicated.
Stop-and-Wait ARQ (cont..)
• Since an ACK frame can also be corrupted and lost, it too needs
redundancy bits and a sequence number.
• The ACK frame for this protocol has a sequence number field.
1. The frame arrives safe and sound at the receiver site; the receiver sends
an acknowledgment. The acknowledgment arrives at the sender site,
causing the sender to send the next frame numbered x + 1.
2. The frame arrives safe and sound at the receiver site; the receiver sends
an acknowledgment, but the acknowledgment is corrupted or lost. The
sender resends the frame (numbered x) after the time-out.
3. The frame is corrupted or never arrives at the receiver site; the sender
resends the frame (numbered x) after the time-out.
Acknowledgment Numbers
• The sequence numbers are suitable for both data frames and ACK
frames.
• For example, if frame 0 has arrived safe and sound, the receiver
sends an ACK frame with acknowledgment 1 (meaning frame 1
is expected next).
• If frame 1 has arrived safe and sound, the receiver sends an ACK
frame with acknowledgment 0 (meaning frame 0 is expected).
Design
Flow diagram
Efficiency
• If the header of the frame allows m bits for the sequence number,
the sequence numbers range from 0 to 2m - 1.
• The range which is the concern of the sender is called the send
sliding window; the range that is the concern of the receiver is
called the receive sliding window.
• Although there can be a timer for each frame that is sent, in this
protocol we use only one.
• The reason is that the timer for the first outstanding frame
always expires first; we send all outstanding frames when this
timer expires.
Acknowledgment
• For example, suppose the sender has already sent frame 6, but
the timer for frame 3 expires.
• This means that frame 3 has not been acknowledged; the sender
goes back and sends frames 3, 4,5, and 6 again.
• Selective Repeat ARQ does not resend N frames when just one
frame is damaged; only the damaged frame is resent.
• It is more efficient for noisy links, but the processing at the
receiver is more complex.
Windows
• Section
• 11.1
• 11.2
• 11.3
• 11.4
• 11.5