CH 11
CH 11
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11--1 FRAMING
11
11.2
Figure 11.1 A frame in a character-oriented protocol
11.3
Figure 11.2 Byte stuffing and unstuffing
11.4
Note
11.5
Figure 11.3 A frame in a bit-oriented protocol
11.6
Note
11.7
Figure 11.4 Bit stuffing and unstuffing
11.8
11--2 FLOW AND ERROR CONTROL
11
11.9
Note
11.10
Note
11.11
11--3 PROTOCOLS
11
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 another.. The
protocols are normally implemented in software by
using one of the common programming languages
languages.. To
make our discussions language-
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
rules..
11.12
Figure 11.5 Taxonomy of protocols discussed in this chapter
11.13
11--4 NOISELESS CHANNELS
11
11.14
Figure 11.6 The design of the simplest protocol with no flow or error control
11.15
Algorithm 11.1 Sender-site algorithm for the simplest protocol
11.16
Algorithm 11.2 Receiver
Receiver-site
site algorithm for the simplest protocol
11.17
Example 11.1
11.18
Figure 11.7 Flow diagram for Example 11.1
11.19
Figure 11.8 Design of Stop-and-Wait Protocol
11.20
Algorithm 11.3 Sender-site algorithm for Stop-and-Wait Protocol
11.21
Algorithm 11.4 Receiver-site algorithm for Stop-and-Wait Protocol
11.22
Example 11.2
11.23
Figure 11.9 Flow diagram for Example 11.2
11.24
11--5 NOISY CHANNELS
11
11.25
Note
Error correction
E ti in
i Stop-and-Wait
St d W it ARQ is
i
done by keeping a copy of the sent
frame and retransmitting of the frame
e tthe
when e ttimer
e e
expires.
p es
11.26
Note
I Stop-and-Wait
In St d W it ARQ,
ARQ we use sequence
numbers to number the frames.
The sequence numbers are based on
odu o a
modulo-2 arithmetic.
t et c
11.27
Note
In Stop-and-Wait ARQ,
ARQ the
acknowledgment number always
anno nces in modulo-2
announces mod lo 2 arithmetic the
sequence number of the next frame
expected.
11.28
Figure 11.10 Design of the Stop-and-Wait ARQ Protocol
11.29
Algorithm
g 11.5 Sender-site algorithm for Stop-and-Wait ARQ
(
(continued)
ti d)
11.30
Algorithm 11.5 Sender-site algorithm for Stop-and-Wait ARQ (continued)
11.31
Algorithm 11.6 Receiver-site algorithm for Stop-and-Wait ARQ Protocol
11.32
Example 11.3
11.33
Figure 11.11 Flow diagram for Example 11.3
11.34
Example 11.4
Solution
The bandwidth-delay
bandwidth delay product is
11.35
Example 11.4 (continued)
The system can send 20,000 bits during the time it takes
for the data to go from the sender to the receiver and then
back again. However, the system sends only 1000 bits. We
can say that
h theh link
li k utilization
ili i is i only
l 1000/20,000, or 5
percent. For this reason, for a link with a high bandwidth
or long
l d l
delay, the
h use off Stop-and-Wait
S d i ARQ
A Q wastes theh
capacity of the link.
11.36
Example 11.5
Solution
The bandwidth-delay product is still 20,000 bits. The
system can send up to 15 frames or 15,000 bits during a
round trip. This means the utilization is 15,000/20,000, or
75 percent. Of course, if there are damaged frames, the
utilization percentage is much less because frames have
to be resent.
11.37
Note
11.38
Figure 11.12 Send window for Go-Back-N ARQ
11.39
Note
11.40
Note
11.41
Figure 11.13 Receive window for Go-Back-N ARQ
11.42
Note
11.43
Figure 11.14 Design of Go-Back-N ARQ
11.44
Figure 11.15 Window size for Go-Back-N ARQ
11.45
Note
I Go-Back-N
In G B k N ARQARQ, ththe size
i off th
the send
d
window must be less than 2m;
the size of the receiver window
sa
is always
ays 1.
11.46
Algorithm 11.7 Go-Back-N sender algorithm
(continued)
11.47
Algorithm 11.7 Go-Back-N sender algorithm (continued)
11.48
Algorithm 11.8 Go-Back-N receiver algorithm
11.49
Example 11.6
Figure 11.16 shows an example of Go-Back-N. This is an
example of a case where the forward channel is reliable,
but the reverse is not. No data frames are lost, but some
ACKs are delayed and one is lost. The example also
shows how cumulative acknowledgments can help if
acknowledgments are delayed or lost. After initialization,
there are seven sender events. Request events are
triggered by data from the network layer; arrival events
are triggered by acknowledgments from the physical
layer. There is no time-out event here because all
outstanding frames are acknowledged before the timer
expires. Note that although ACK 2 is lost, ACK 3 serves as
both ACK 2 and ACK 3.
11.50
Figure 11.16 Flow diagram for Example 11.6
11.51
Example 11.7
11.53
Figure 11.17 Flow diagram for Example 11.7
11.54
Note
11.55
Figure 11.18 Send window for Selective Repeat ARQ
11.56
Figure 11.19 Receive window for Selective Repeat ARQ
11.57
Figure 11.20 Design of Selective Repeat ARQ
11.58
Figure 11.21 Selective Repeat ARQ, window size
11.59
Note
11.60
Algorithm 11.9 Sender-site Selective Repeat algorithm
(continued)
11.61
Algorithm 11.9 Sender-site Selective Repeat algorithm (continued)
11.62 (continued)
Algorithm 11.9 Sender-site Selective Repeat algorithm (continued)
11.63
Algorithm 11.10 Receiver-site Selective Repeat algorithm
11.64
Algorithm 11.10 Receiver-site Selective Repeat algorithm
11.65
Figure 11.22 Delivery of data in Selective Repeat ARQ
11.66
Example 11.8
11.69
Example 11.8 (continued)
The next point is about the ACKs. Notice that only two
ACK are sentt here.
ACKs h Th first
The fi t one acknowledges
k l d only
l the
th
first frame; the second one acknowledges three frames. In
S l ti Repeat,
Selective R t ACKs
ACK are sentt when
h data
d t are delivered
d li d to
t
the network layer. If the data belonging to n frames are
delivered in one shot,
shot only one ACK is sent for all of them.
them
11.70
Figure 11.23 Flow diagram for Example 11.8
11.71
Figure 11.24 Design of piggybacking in Go-Back-N ARQ
11.72
11--6 HDLC
11
11.73
Figure 11.25 Normal response mode
11.74
Figure 11.26 Asynchronous balanced mode
11.75
Figure 11.27 HDLC frames
11.76
Figure 11.28 Control field format for the different frame types
11.77
T bl 11.1
Table 11 1 U-frame
f controll commandd andd response
11.78
Example 11.9
11.79
Figure 11.29 Example of connection and disconnection
11.80
Example 11.10
11.81
Example 11.10 (continued)
11.82
Figure 11.30 Example of piggybacking without error
11.83
Example 11.11
11.84
Figure 11.31 Example of piggybacking with error
11.85
11--7 POINT
11 POINT--TO-
TO-POINT PROTOCOL
11.86
Figure 11.32 PPP frame format
11.87
Note
11.88
Figure 11.33 Transition phases
11.89
Figure 11.34 Multiplexing in PPP
11.90
Figure 11.35 LCP packet encapsulated in a frame
11.91
Table 11.2 LCP packets
11.92
Table 11.3 Common options
11.93
Figure 11.36 PAP packets encapsulated in a PPP frame
11.94
Figure 11.37 CHAP packets encapsulated in a PPP frame
11.95
Figure 11.38 IPCP packet encapsulated in PPP frame
11.96
Table 11.4 Code value for IPCP packets
11.97
Figure 11.39 IP datagram encapsulated in a PPP frame
11.98
Figure 11.40 Multilink PPP
11.99
Example 11.12
11.100
Example 11.12 (continued)
After data
Af d transfer,
f theh user then
h terminates
i the
h data
d li k
link
connection, which is acknowledged by the system. Of
course the
h user or theh system could ld have
h chosen
h to
terminate the network layer IPCP and keep the data link
l
layer running
i if it
i wantedd to run another
h NCP protocol.l
11.101
Figure 11.41 An example
11.102
Figure 11.41 An example (continued)
11.103