Professional Documents
Culture Documents
Chapter 11
11--11
11 11.
1 .FRAMING
1 Flow
FLOW ANDand Error
ERROR Control
CONTROL
1
03/12/31
Note
Error control in the data link layer is
based on automatic repeat request, which
is the retransmission of data.
Section 11.4 is excluded
2
03/12/31
PROTOCOLS
Now let us see how the data link layer can combine flow control, and
error control to achieve the delivery of data from one node to another
another..
The protocols are normally implemented in software by using one of the
common programming languages.
Stop-and-Wait ARQ
1. Stop-
Stop-and
and--Wait ARQ
It is the simplest flow and error control mechanism. A transmitter
sends a frame then stops and waits for an acknowledgment.
Stop--and
Stop and--Wait ARQ has the following features:
The sending device keeps a copy of the sent frame transmitted until
it receives an acknowledgment( ACK)
3
03/12/31
1. Stop-
Stop-and
and--Wait ARQ
The acknowledgment number defines the number of next expected
frame. (frame 0 received ACK 1 is sent)
The receiver send only positive ACK for frames received safe; it is
silent about the frames damage or lost.
The sender has a control variable S that holds the number of most
recently sent frame (0 or 1). The receiver has control variable R, that
holds the number of the next frame expected (0,or 1)
Behrouz A. Forouzan “Data communication and Networking”
Dr. Gihan Naguib 7
4
03/12/31
Stop-and-Wait ARQ
Cases of Operations:
1. Normal operation
Stop-and-Wait ARQ
1. Normal operation
5
03/12/31
Stop-and-Wait ARQ
2. Lost or damaged frame
Stop-and-Wait ARQ
6
03/12/31
In Stop-
Stop-and
and--Wait ARQ, numbering
frames prevents the retaining of
duplicate frames.
Stop-and-Wait ARQ,
7
03/12/31
8
03/12/31
Stop-and-Wait ARQ,
Pipelining
9
03/12/31
Sequence Numbers
Sent frames are numbered sequentially
Sequence number is stored in the header of the frame
10
03/12/31
2. Go-
Go-Back
Back--N ARQ
Sender sliding window
The sender window is an abstract concept defining an
imaginary box of size 2m − 1 ( sequence numbers – 1)
The sender window can slide one or more slots when a valid
acknowledgment arrives. Sequence
number
If m = 3; sequence numbers = 8
and window size =7
Acknowledged
frames
Behrouz A. Forouzan “Data communication and Networking”
Dr. Gihan Naguib 21
11
03/12/31
Control variables
Outstanding frames: frames
sent but not acknowledged
2. Go-
Go-Back
Back--N ARQ
m=4
12
03/12/31
2. Go-
Go-Back
Back--N ARQ
In Go-Back-N ARQ we use one timer for the first outstanding frame
The receiver sends a positive ACK if a frame has arrived safe and in
order.
if a frame is damaged or out of order ,the receiver is silent and will
discard all subsequent frames
When the timer of an unacknowledged frame at the sender site is
expired , the sender goes back and resend all frames , beginning with
the one with expired timer.( that is why the protocol is called Go-Back-
N ARQ)
The receiver doesn't have to acknowledge each frame received . It can
send cumulative Ack for several frame
Example:
The sender has sent frame 6 , and timer expires for frame 3( frame
3 has not been acknowledge); the sender goes back and resends
frames 3, 4,5 and 6
Behrouz A. Forouzan “Data communication and Networking”
Dr. Gihan Naguib 25
Go-Back-N ARQ
Normal operation
m= 2
ACK1 is not
necessary if ACK2
is sent: Cumulative ACK
13
03/12/31
Go-Back-N ARQ
Damage or Lost Frame
Correctly received
out of order packets are not
Buffered
= 2m -1
Behrouz A. Forouzan “Data communication and Networking”
Dr. Gihan Naguib 28
14
03/12/31
Notes::
Notes
In Go-
Go-Back
Back--N ARQ, the size of the sender
window must be less than 2m = (2m-1) ; the
size of the receiver window is always 1.
Bidirectional transmission : piggybacking
As Stop-and-Wait we can use piggybacking
to improve the efficiency of bidirectional
transmission . Each direction needs both a
sender window and a receiver window.
Behrouz A. Forouzan “Data communication and Networking”
Dr. Gihan Naguib 29
Note::
Note
15
03/12/31
16
03/12/31
m=3
Selective Repeat ARQ Example Sequences no=2m =8 : 0,1,2
,3,4,5,6,7
Lost frame Window size =2m/2= 8/2=4
17
03/12/31
Example (continued)
At the receiver site we need to distinguish between the
acceptance of a frame and its delivery to the network
layer. At the second arrival, frame 2 arrives and is
stored and marked, but it cannot be delivered because
frame 1 is missing. At the next arrival, frame 3 arrives
and is marked and stored, but still none of the frames
can be delivered. Only at the last arrival, when finally a
copy of frame 1 arrives, can frames 1, 2, and 3 be
delivered to the network layer. There are two conditions
for the delivery of frames to the network layer: First, a
set of consecutive frames must have arrived. Second,
the set starts from the beginning of the window.
Behrouz A. Forouzan “Data communication and Networking”
Dr. Gihan Naguib 35
Example (continued)
The next point is about the ACKs. Notice that only two
ACKs are sent here. The first one acknowledges only the
first frame; the second one acknowledges three frames.
In Selective Repeat, ACKs are sent when data are
delivered to the network layer. If the data belonging to n
frames are delivered in one shot, only one ACK is sent for
all of them.
18
03/12/31
Note::
Note
19
03/12/31
Example 1
In a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps,
and 1 bit takes 20 ms to make a round trip(RTT). What is the
bandwidth-delay product? If the system data frames are 1000 bits in
length, what is the utilization percentage of the link?
Solution
The bandwidth-delay product is
20
03/12/31
Example 2
What is the utilization percentage of the link in
Example 1 if the link uses Go-Back-N ARQ with a 15-
frame sequence?
Solution
The bandwidth-delay product is still 20,000. The system can
send up to 15 frames or 15,000 bits during a round trip. This
means :
Utilization%= (15 x 1000/20,000) x100= 75%.
Of course, if there are damaged frames, the utilization
percentage is much less because frames have to be resent.
Example 3
What is the utilization percentage of the link in Example
2 if the link uses Selective repeat ARQ?
Solution
21
03/12/31
22
03/12/31
23
03/12/31
HDLC frame
Flag: 8-bit ; 01111110 that identifies the beginning and end of the
frame
FCS: frame check sequence is error detection field
Address: contain the address of the secondary station . It can be one
byte or more . If the address is more than one bytes , all bytes end with
zero except the last byte ends with one. Ending each intermediate byte
with 0 indicates to the receiver.
Control Field : determine the type of frame and defines its
functionality.
Behrouz A. Forouzan “Data communication and Networking”
Dr. Gihan Naguib 47
24
03/12/31
I-frame
25
03/12/31
26
03/12/31
GO- back-NARQ
27
03/12/31
28
03/12/31
Data transparency
29
03/12/31
30