Datalink Control
Datalink Control
11.1
Data Link
Control
The two main functions of the
data link layer are :-
1 data link control (deals with the design
and procedures for communication
between two
adjacent nodes: node-to-node
communication).
11.3
• Data transmission in the physical
layer means moving bits in the form
of a signal from the source to the
destination.
• The physical layer provides bit
synchronization to ensure that the
sender and receiver use the same bit
durations and timing.
11.4
11- FRAMING
1
The data link layer needs to pack bits into frames, so
that each frame is distinguishable from another.
Our postal system practices a type of framing. The
simple act of inserting a letter into an envelope
separates one piece of information from another;
the envelope serves as the delimiter.
Topics discussed in this section:
Fixed-Size Framing – no boundaries for frames, size used as
the delimeter
Variable-Size Framing – define begining and end of frame,
character oriented or bit oriented approach
11.5
• Framing in the data link layer separates
a message from one source to a
destination, or from other messages to
other destinations, by adding a sender
address and a destination address.
11.6
Fixed-Size
•Framing
Frames can be of fixed or variable size. In
fixed-size framing, there is no need for defining
the boundaries of the frames; the size itself can
be used as a delimiter.
11.7
Variable-Size
Framing
• In variable-size framing, we need a way
to define the end of the frame and the
beginning of the next.
•Two approaches were used for this purpose:
a character-oriented approach and a bit-
oriented approach.
11.8
Character-Oriented
Protocols
• In a character-oriented protocol, data to be
carried are 8- bit characters from a coding
system such as ASCII .
• The header, which normally carries the source
11.9
Figure 11.1 A frame in a character-oriented
protocol
11.10
Bit-Oriented
Protocols
In a bit-oriented protocol, the data section of a
frame is a sequence of bits to be interpreted by
the upper layer as text, graphic, audio, video,
and so on. However, in addition to headers (and
possible trailers), we still need a delimiter to
separate one frame from the other.
11.14
11-2 FLOW AND ERROR
CONTROL
The most important responsibilities of the data link
layer are flow control and error control. Collectively,
these functions are known as data link control.
11.16
Flow control refers to a set of procedures
used to restrict the amount of data
that the sender can send
before waiting for
acknowledgment.
•Each receiving device has a block of memory, called a
buffer, reserved for storing incoming data until they are
processed.
•If the buffer begins to fill up, the receiver must be able to
tell the sender to halt transmission until it is once again
able to receive.
11.17
Error control is both error detection and error
correction. It allows the receiver to tell the sender
of any frames lost or damaged in transmission
and coordinates the retransmission of those
frames by the sender.
11.18
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 deeply the details of
language rules.
11.19
Figure 11.5 classification of protocols discussed in this
chapter
11.20
11-4 NOISELESS CHANNELS
11.21
1-Simplest
Protocol
Our first protocol, which we call the Simplest Protocol, is one
that has no flow or error control. Like other protocols, it is a
unidirectional protocol in which data frames are traveling in
only one direction-from the sender to receiver.
The receiver can immediately handle any frame it receives
with a processing time that is small enough to be negligible.
The data link layer of the receiver immediately removes the
header from the frame and hands the data packet to network
layer, which can also accept the packet immediately.
In other words, the receiver can never be fill out with
incoming frames.
11.22
Figure 11.6 The design of the simplest protocol with no flow or error
control
11.23
11.24
11.25
Example 11.1
Figure 11.7 shows an example of communication using this protocol. It is very
simple. The sender sends a sequence of frames without even thinking about
the receiver. To send three frames, three events occur at the sender site and
three events at the receiver site. Note that the data frames are shown by tilted
boxes; the height of the box defines the transmission time difference between
the first bit and the last bit in the frame.
Figure 11.7 Flow diagram for Example
11.1
11.26
Stop-and-Wait
Protocol
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.
We need to tell the sender to slow down. There
must be
feedback from the receiver to the sender.
The sender sends one frame, stops until it
receives agreement the receiver (okay to go
ahead), and then sends the next frame. We still
have unidirectional communication for data
frames, but auxiliary ACK frames (simple tokens
of acknowledgment) travel from the other
11.27 direction. We add flow control to our previous
Figure 11.8 Design of Stop-and-Wait Protocol
11.28
Example 11.2
Figure 11.7 shows an example of communication using this protocol. It is still
very simple. The sender sends one frame and waits for feedback from the
receiver. When the ACK arrives, the sender sends the next frame. Note that
sending two frames in the protocol involves the sender in four events and the
receiver in two events.
Figure 11.7 Flow diagram for Example
11.2
11.29
11-5 NOISY
CHANNELS
11.32
Error correction in Stop-and-Wait ARQ is done by
keeping a copy of the sent frame and retransmitting
of the frame when the timer expires.
11.33
Figure 11.10 Design of the Stop-and-Wait ARQ
Protocol
11.34
Example 11.3
Figure 11.11 shows an example of Stop-and-Wait ARQ. Frame 0 is sent and
acknowledged. Frame 1 is lost and resent after the time-out. The resent frame 1 is
acknowledged and the timer stops. Frame 0(second ) is sent and acknowledged, but
the acknowledgment is lost. The sender has no idea if the frame or the
acknowledgment is lost, so after the time-out, it resends frame 0, is
acknowledged
which
.
Figure 11.11 Flow
diagram for Example
11.3
1
Efficiency
•very inefficient if our channel is thick and long.
•By thick, we mean that our channel has a large bandwidth; by
long, we mean the round-trip delay is long. The product of these
two is called the bandwidth delay product.
•The bandwidth-delay product is a measure of the number of bits
we can send out of our system while waiting for news from the
receiver.
Pipelinin
gInbegun
networking and in other areas, a task is often
before the previous task has ended. This is
known as pipelining. There is no pipelining in Stop-
and-Wait ARQ because we need to wait for a frame
to reach the destination and be acknowledged
before the next frame can be sent.
11.39
Go-Back-N Automatic Repeat
Request
To improve the efficiency of transmission
(filling the pipe), multiple frames must be
in transition while waiting for
acknowledgment. In other words, we
need to let more than one frame be
outstanding to keep the channel busy
while the sender is waiting for
acknowledgment.
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,….
Sliding Window
•Is a feature of packet based data transmission protocols.
•Each portion of the data transmission is assigned a unique consecutive
sequence number, and the receiver uses the numbers to place received
packets in the correct order, discarding duplicate packets and
identifying missing ones.
•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.
•The maximum size of the window is 2m – 1.
Figure 11.12 Send window for Go-Back-N
ARQ
11.43
The send window is an abstract concept
defining an imaginary box of size 2m − 1 with
three variables: Sf, Sn, and Ssize.
Sf defines the sequence number of the first (oldest)
outstanding frame.
Sn holds the sequence number that will be
assigned to the next frame to be sent.
Ssize defines the size of the window, which is fixed
in our protocol.
11.48
Selective Repeat Automatic
Repeat Request
Go-Back-N ARQ simplifies the process at the receiver
site. The receiver keeps track of only one variable,
and there is no need to buffer out-of-order frames;
they are simply discarded. However, this protocol is
very inefficient for a noisy link. Why ? In a noisy link a
frame has a higher probability of damage, which
means the resending of multiple frames.
11.55
Figure 11.18 Send window for Selective Repeat
ARQ
11.56
The receive window in Selective Repeat is totally
different from the one in Go Back-N. First, the size
of the receive window is the same as the size of the
send window(2m-1). The Selective Repeat Protocol
allows as many frames as the size of the receive
window to arrive out of order and be kept until
there is a set of in-order frames to be delivered to
the network layer.
11.58
Figure 11.20 Design of Selective Repeat
ARQ
11.59
Note
11.63
Piggybacki
ng
The three protocols we discussed in this section are all
unidirectional: data frames flow in only one direction although
control information such as ACK and NAK frames can travel in
the other direction. In real life, data frames are normally flowing
in both directions: from node A to node B and from node B to
node A. This means that the control information also needs to
flow in both directions.
A technique called piggybacking is used to improve the
efficiency of the bidirectional protocols. When a frame is
carrying data from A to B, it can also carry control information
about arrived (or lost) frames from B; and verse versa.
11.64
Figure 11.24 Design of piggybacking in Go-Back-N
ARQ
Piggybacking – control information flow in both directions
and improves the efficiency of bidirectional protocols
11.65
Note that each node now has two windows: one send
window and one receive window. Both also need to
use a timer.
An important point about piggybacking is that both
sites must use the same algorithm.
This algorithm is complicated because it needs to
combine two arrival events into one.
11.66