CH 11
CH 11
11.1
11-1 FRAMING
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 Variable-Size Framing
11.2
11.3
11.4
ote
Byte stuffing is the process of adding 1 extra byte hene!er there is a flag or escape character in the text.
11.5
11."
ote
Bit stuffing is the process of adding one extra $ hene!er fi!e consecuti!e 1s follo a $ in the data% so that the recei!er does not &istake the pattern $11111$ for a flag.
11.#
11.'
11.(
ote
)lo
control refers to a set of procedures used to restrict the a&ount of data that the sender can send before aiting for ackno ledg&ent.
11.1$
ote
*rror control in the data link layer is based on auto&atic repeat re+uest% hich is the retrans&ission of data.
11.11
11-3 PROTOCOLS
o! let us see ho! the data link layer can combine framing, flo! control, and error control to achieve the delivery of data from one node to another. The protocols are normally implemented in soft!are by using one of the common programming languages. To make our discussions language-free, !e have !ritten in pseudocode a version of each protocol that concentrates mostly on the procedure instead of delving into the details of language rules.
11.12
11.13
11.14
Figure 11.# The design of the simplest protocol !ith no flo! or error control
11.15
11.1"
11.1#
-#ample )).)
(igure )).* sho!s an e#ample of communication using this protocol. +t is very simple. The sender sends a se,uence of frames !ithout even thinking about the receiver. To send three frames, three events occur at the sender site and three events at the receiver site. ote that the data frames are sho!n by tilted bo#es; the height of the bo# defines the transmission time difference bet!een the first bit and the last bit in the frame.
11.1'
11.1(
11.2$
11.21
11.22
-#ample )).2
(igure )).0 sho!s an e#ample of communication using this protocol. +t is still very simple. The sender sends one frame and !aits for feedback from the receiver. %hen the A"1 arrives, the sender sends the ne#t frame. ote that sending t!o frames in the protocol involves the sender in four events and the receiver in t!o events.
11.23
11.24
ote
*rror correction in ,top-and-.ait /01 is done by keeping a copy of the sent fra&e and retrans&itting of the fra&e hen the ti&er expires.
11.2"
ote
2n ,top-and-.ait /01% e use se+uence nu&bers to nu&ber the fra&es. 3he se+uence nu&bers are based on &odulo-2 arith&etic.
11.2#
ote
2n ,top-and-.ait /01% the ackno ledg&ent nu&ber al ays announces in &odulo-2 arith&etic the se+uence nu&ber of the next fra&e expected.
11.2'
11.2(
(continued)
11.3$
(continued)
11.31
11.32
-#ample )).5
(igure )).)) sho!s an e#ample of &top-and-%ait A'3. (rame 4 is sent and ackno!ledged. (rame ) is lost and resent after the time-out. The resent frame ) is ackno!ledged and the timer stops. (rame 4 is sent and ackno!ledged, but the ackno!ledgment is lost. The sender has no idea if the frame or the ackno!ledgment is lost, so after the time-out, it resends frame 4, !hich is ackno!ledged.
11.33
11.34
-#ample )).9
Assume that, in a &top-and-%ait A'3 system, the band!idth of the line is ) 6bps, and ) bit takes 24 ms to make a round trip. %hat is the band!idth-delay product7 +f the system data frames are )444 bits in length, !hat is the utili8ation percentage of the link7 Solution The bandwidth-delay product is
11.35
11.3"
-#ample )).<
%hat is the utili8ation percentage of the link in -#ample )).9 if !e have a protocol that can send up to )< frames before stopping and !orrying about the ackno!ledgments7 &olution 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.3#
ote
2n the 4o-Back-5 6rotocol% the se+uence nu&bers are &odulo 2m% here & is the si7e of the se+uence nu&ber field in bits.
11.3'
11.3(
ote
3he send indo is an abstract concept defining an i&aginary box of si7e 2 m 8 1 ith three !ariables9 ,f% ,n% and ,si7e.
11.4$
ote
3he send indo can slide one or &ore slots hen a !alid ackno ledg&ent arri!es.
11.41
11.42
ote
3he recei!e indo is an abstract concept defining an i&aginary box of si7e 1 ith one single !ariable 0 n. 3he indo slides hen a correct fra&e has arri!ed: sliding occurs one slot at a ti&e.
11.43
11.44
11.45
ote
2n 4o-Back-5 /01% the si7e of the send indo &ust be less than 2m: the si7e of the recei!er indo is al ays 1.
11.4"
(continued)
11.4#
(continued)
11.4'
11.4(
-#ample )).@
(igure )).)@ sho!s an e#ample of ?o-Back- . This is an e#ample of a case !here the for!ard channel is reliable, but the reverse is not. o data frames are lost, but some A"1s are delayed and one is lost. The e#ample also sho!s ho! cumulative ackno!ledgments can help if ackno!ledgments are delayed or lost. After initiali8ation, there are seven sender events. 'e,uest events are triggered by data from the net!ork layer; arrival events are triggered by ackno!ledgments from the physical layer. There is no time-out event here because all outstanding frames are ackno!ledged before the timer e#pires. ote that although A"1 2 is lost, A"1 5 serves as both A"1 2 and A"1 5.
11.5$
11.51
-#ample )).*
(igure )).)* sho!s !hat happens !hen a frame is lost. (rames 4, ), 2, and 5 are sent. :o!ever, frame ) is lost. The receiver receives frames 2 and 5, but they are discarded because they are received out of order. The sender receives no ackno!ledgment about frames ), 2, or 5. +ts timer finally e#pires. The sender sends all outstanding frames =), 2, and 5> because it does not kno! !hat is !rong. ote that the resending of frames ), 2, and 5 is the response to one single event. %hen the sender is responding to this event, it cannot accept the triggering of other events. This means that !hen A"1 2 arrives, the sender is still busy !ith sending frame 5.
11.52
11.53
11.54
ote
,top-and-.ait /01 is a special case of 4o-Back-5 /01 in hich the si7e of the send indo is 1.
11.55
11.5"
11.5#
11.5'
11.5(
ote
2n ,electi!e 0epeat /01% the si7e of the sender and recei!er indo &ust be at &ost one-half of 2&.
11."$
(continued)
11."1
(continued)
11."2
(continued)
(continued)
11."3
11."4
11."5
11.""
-#ample )).A
This e#ample is similar to -#ample )).5 in !hich frame ) is lost. %e sho! ho! &elective 'epeat behaves in this case. (igure )).25 sho!s the situation. One main difference is the number of timers. :ere, each frame sent or resent needs a timer, !hich means that the timers need to be numbered =4, ), 2, and 5>. The timer for frame 4 starts at the first re,uest, but stops !hen the A"1 for this frame arrives. The timer for frame ) starts at the second re,uest, restarts !hen a A1 arrives, and finally stops !hen the last A"1 arrives. The other t!o timers start !hen the corresponding frames are sent and stop at the last arrival event.
11."#
11."(
11.#$
11.#1
11.#2
11-6 HDLC
:igh-level .ata $ink "ontrol =:.$"> is a bit-oriented protocol for communication over point-to-point and multipoint links. +t implements the A'3 mechanisms !e discussed in this chapter.
Figure 11.25
11.#4
11.#5
11.#"
Figure 11.2' "ontrol field format for the different frame types
11.##
11.#'
-#ample )).0
(igure )).20 sho!s ho! B-frames can be used for connection establishment and connection release. ode A asks for a connection !ith a set asynchronous balanced mode =&AB6> frame; node B gives a positive response !ith an unnumbered ackno!ledgment =BA> frame. After these t!o e#changes, data can be transferred bet!een the t!o nodes =not sho!n in the figure>. After data transfer, node A sends a .+&" =disconnect> frame to release the connection; it is confirmed by node B responding !ith a BA =unnumbered ackno!ledgment>.
11.#(
11.'$
-#ample )).)4
(igure )).54 sho!s an e#change using piggybacking. ode A begins the e#change of information !ith an +-frame numbered 4 follo!ed by another +-frame numbered ). ode B piggybacks its ackno!ledgment of both frames onto an +-frame of its o!n. ode BCs first +-frame is also numbered 4 D =&> fieldE and contains a 2 in its ='> field, ackno!ledging the receipt of ACs frames ) and 4 and indicating that it e#pects frame 2 to arrive ne#t. ode B transmits its second and third +-frames =numbered ) and 2> before accepting further frames from node A.
11.'1
11.'2
11.'3
-#ample )).))
(igure )).5) sho!s an e#change in !hich a frame is lost. ode B sends three data frames =4, ), and 2>, but frame ) is lost. %hen node A receives frame 2, it discards it and sends a '-F frame for frame ). ote that the protocol being used is ?o-Back- !ith the special use of an '-F frame as a A1 frame. The A1 frame does t!o things here: +t confirms the receipt of frame 4 and declares that frame ) and any follo!ing frames must be resent. ode B, after receiving the '-F frame, resends frames ) and 2. ode A ackno!ledges the receipt by sending an '' frame =A"1> !ith ackno!ledgment number 5.
11.'4
11.'5
11.'#
ote
666 is a byte-oriented protocol using byte stuffing ith the escape byte $11111$1.
11.''
11.'(
11.($
11.(1
11.(2
11.(3
11.(4
11.(5
11.("
11.(#
11.('
11.((
-#ample )).)2
$et us go through the phases follo!ed by a net!ork layer packet as it is transmitted through a /// connection. (igure )).9) sho!s the steps. (or simplicity, !e assume unidirectional movement of data from the user site to the system site =such as sending an e-mail through an +&/>. The first t!o frames sho! link establishment. %e have chosen t!o options =not sho!n in the figure>: using /A/ for authentication and suppressing the address control fields. (rames 5 and 9 are for authentication. (rames < and @ establish the net!ork layer connection using +/"/.
11.1$$
11.1$2
11.1$3