Dât link control protocols

34 312 0
Dât link control protocols

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

ie CHAPTER Data LINK CONTROL PROTOCOLS 7.1 Flow Control Stop-and-Wait Flow Control Sliding-Window Flow Controt 7.2 Error Control Stop-and-Wait ARQ Go-Back-N ARQ Selective-Reject ARO 7.3 High-Level Data Link Control (HDLC) Basic Characteristics Frame Structure Operation 7.4 Recommended 7.5 Key Terms, Review Questions, and Problems Reading Key Terms Review Questions Problems Appendix 7A Performance Issues Stop-and-Wail Flow Control Errot-Free Sliding-Window Flow Control ARQ 208 CHAPTER / DATA LINK PROTOCOLS ONEROL KEY POINTS errors, and because the receiver * Because of the possibility of transmission data arrive, synchronization of data may need to regulate the rate at which It is necessary to themselves by insufficient and interfacing techniques are device that provides funcimpose a layer of control in each communicating and error control This layer of tions such as flow control, error detection, protocol contro! is known as a data link control sender to regulate the flow of data from a * Flow control enables a receiver overflow so that the receiver’s buffers not control is achieved by retransmission error « Ina data link control protocol, acknowledged or for which the other of damaged frames that have not been side requests a retransmission sion link For efd sending signals over a transmis Our discussion so far has concerne control and manage unications, much more is needed to fective digital data comm over a our emphasis to that of sending daia the exchange In this chapter, we shift added is logic of the necessary control, a layer data communications link To achieve data as to red refer is d in Chapter 6; this logic above the physical interfacing discusse is ocol prot ol contr col When a data link link contro} or a data link control proto link een systems is referred to as a data used, the transmission medium betw and objec ents irem requ list some of the To see the need for data link control, we mittingtrans d ecte conn n between two directly tives for effective data communicatio receiving stations: + Frame synchronization: The beginning Data are sent in blocks called frames ed this topic recognizable We briefly introduc and end of each frame must be frames (Figure 6.2) with the discussion of synchronous r than must not send frames at a rate faste + Flow control: The sending station them the receiving station can absorb em should be oduced by the transmission syst ¢ Error controk Bit errors intr corrected a local area network (LAN), the On a multipoint line, such as in a transmission must be specified identity of the two stations involved a physically It is usually not desirable to have « Control and data on same link: gly, the rdin Acco rmation « Addressing: contro! info separatc communications path for g ol information from the data bein contr h nguis receiver must be able to disti transmitted Link management: termination of a sustained The initiation, maintenance, and g of coordination and cooperation amon data exchange require a fair amount required management of this exchange are stations Procedures for the None of these requirements is see described in Chapter We shall r isfies these requirements is a rathe data of mechanisms that are part g techniques satisfied by the physical interfacin ocol that satprot link in this chapter that a data at two key ing look by complex affair We begin control error and ol link control: flow contr 71/ PLOW CONTROL 209 Following this background we look at the most important example of a data link control protocol: HDLC (high level data link control) This protocol is important for two reasons: First, it is a widely used standardized data link controt protocol Sec- ond, HDLC serves as a baseline from which virtually all other important data link control protocols are derived Finally, an appendix to this chapter addresses some performance issues relating to data link control Flow control is a technique for assuring that a transmitting entity does not over- whelm a buffer of must software receiving entity with data The receiving entity typically allocates a data some maximum length for a transfer When data are received, the receiver a certain amount of processing before passing the data to the higher-level In the absence of flow control, the receiver’s buffer may fill up and over- flow while it is processing old data To begin, we examine mechanisms for flow control in the absence of errors The model we will use is depicted in Figure 7.1a, which is a vertical-time sequence diagram It has the advantages of showing time dependencies and illustrating the correct send-receive relationship Each arrow represents a single frame transiting a data link between two stations The data are sent in a sequence of frames, with each Source Destination _ | Source same Frame Frame P| Frame Frame Frame Frame Frame | Frame e E aI Destination P| Frame ! + Frame Frame P| | J Frame P| Garbled frume Frame | Frame (a) Error-free Figure 7.1 q Frame Wransmission Model of Frame Transmission Frame (b) Transmission with losses and errors 210 L PROTOCOLS CHAPTER / ĐATA LINK CONTRO rmation ‘The time it the data and some control info frame containing a portion of um is the transmisthe bits of a frame onto the medi takes for a station to emit all of time is the length of the frame The propagation sion time; this is proportional to the For this ion inat the link between source and dest time it takes for a bit to traverse ; no ived rece ully essf es that are transmitted are succ same section, we assume that all fram the iu e arriv es e with errors Furthermore, fram frames are Jost and none arriv e suffers an arbitrary ver, each transmitted fram order in which they are sent Howe nt of delay before reception and variable amou Stop-and-Wait Flow Control rol, works as folknown as stop-and-wait flow cont The simplest form of flow control, ives the frame, rece ion entity s a frame After the destinat lows A source entity transmit nowledgment ack an pt another frame by sending back it indicates its willingness to acce nowledgment ack the source must wait until it receives simply by to the frame just received The data of flow The destination can thus stop the hardly be before sending the next frame can ed, inde This procedure works fine and, often the is it withholding acknowledgment r, eve How a few large frames in sent is age mess a n whe improved upon blocks and transmit large block of data into smaller case that a source will break up ons: is done for the following reas the data in many frames This eiver may be limited » The buffer size of the rec be an error, neces, the more likely that there will © The longer the transmission frames, errors are r entire frame With smalle sitating retransmission of the retransmitted be r amount of data needs to detected sooner, and a smalle e not to permit one as a LAN it is usually desirabl such , ium med red sha ¢ Ona causing long delays for an extended period, thus station to occupy the medium at the other sending stations stop-and-wait procemes for a single message, the With the use of multiple fra only one frame at a time essence of the problem is that The e uat deq ina be may e dur of a link as follows: we first define the bit length ain expl To sit tran in be can B=Rxe where: (7.1) present on the link this is the number of bits bits; in link the of B = length occupies the link when a stream of bits fully R bps = data rate of the link, in d= V , link in meters length, or distance, of the velocity of propagation, In m/s ble However, a data link js fixed rather than varia link, the amount of delay ched or ATM network, i swit uitcirc a as {On a direct point-to-point such connection, can be used over a network control protocol variable which case the delay may be „ -1 7.L/ ELOW CONTROL 211 fạ+1 tạ+a l: tytita ITj tạ+l+a = [RỶ B EY — = =nL LR [T] ty +44 2a (b)a1 Figure 7.2 ——> = = Stop-and-Wait Link Utilization (transmission time = 1; propagation time = a) In situations where the bit length of the link is greater than the frame length, serious inefficiencies result This is illustrated in Figure 7.2 In the figure, the trans- mission time (the time it takes for a station to transmit a frame) is normalized to one, and the propagation delay (the time it takes for a bit to travel from sender to receiver) is expressed as the variable a Thus, we can express @ as aa B (7.2) where L is the number of bits in the frame (length of the frame in bits) When a is less than 1, the propagation time is less than the transmission time In this case, the frame is sufficiently long that the first bits of the frame have arrived at the destination before the source has completed the transmission of the frame When a is greater than 1, the propagation time is greater than the transmission time In this case, the sender completes transmission of the entire frame before the leading bits of that frame arrive at the receiver Put another way, larger values of a are consistent with higher data rates and/or longer distances between stations Appendix 7A discusses a and data link performance Both parts of Figure 7.2 (a and b) consist of a sequence of snapshots of the transmission process over time In both cases, the first four snapshots show the process of transmitting a frame containing data, and the last snapshot shows the return of a small acknowledgment frame Note that for a > 1, the line is always 212 CHAPTER / ĐATA LINR CONTIROI PROLOCOLS utilized In essence, for underutilized and even for a < 1, the line is inefficiently and receiver, stop-andsender n very high data rates, for very long distances betwee tion wait flow control provides inefficient line utiliza ing at Gbps The velocExample 7.1 Consider a 200-m optical fiber link operat x 10° m/s Using Equaity of propagation of optical fiber is typically about octets, tion (7.1), B = (10° X200)/(2 %X 10%) = 1000 Assume a frame of 1000 a = (1000/8000) = 0.125 or 8000 bits, is transmitted Using Equation (7.2), starts at time t = After ps Using Figure 7.2b as a guide, assume transmission g edge (first bit) of the frame (a normalized time of 0.125 frame times), the leadin are spread out across the link: has reached R, and the first 1000 bits of the frame the frame has just been emitted At time ¢ = ps, the trailing edge (final bit) of spread out across the link At by T, and the final 1000 bits of the frame are at R R now sends back an’ ACK frame : t= Ops, the final bit of the frame arrives negligible (very small ACK frame) If we assume the frame transmission time is this at Tatr = 10 ps-At and that the ACK is sent immediately, the ACK arrives transmission time for the, actual T can begin transmitting a new frame The _ point, the first frame and receive and frame was ps, but the total time to transmit ¬ - ted wg : / 10s is K AC two ground stations that.communi-” co” Now consider a 1-Mbps link between, te has an altitude of roughly €ate viaa satellite relay A geosynchronous satelli i 240,000 Ỉ 36,000 = km, Then B = (10° x X:36,000,000)/(3x 10%) 7-2a as a guid Figure Using 30 = bits, a= (240000/8000) af 8000 takes,240 itse work through the same steps as before In this ca the entire frame t for ms onal additi an of the frame to arrive and leading edge 488 ms The actual transmission time~ | arrive The ACK arrives back at T at f = j time to transmit the first frame and refor'the first frame was ms, but the total “Geive'and ACK is 488:ms : Sliding-Window Flow Control be so far is that only one frame at a time can The essence of the problem described frame the than er great is length of the link in transit In situations where the bit Efficiency can be greatly improved by result cies icien ineff length (a > 1), serious at the same time allowing multiple frames to be in transit via a for two stations, A and B, connected Let us examine how this might work t W accep can B Thus, s frame W r space for full-duplex link Station B allocates buffe owledgframes, and A is allowed to send W frames without waiting for any ackn been acknowledged, each is labeled with ments To keep track of which frames have an acknowledgment that in- frame by sending a sequence number B acknowledges a also frame expected This acknowledgment cludes the sequence number of the next with g nnin receive the next W frames, begi implicitly announces that B is prepared to s be used to acknowledge multiple frame also the number specified This scheme can until nt dgme owle and 4, but withhold ackn For example, B could receive frames 2, 3, owledgment with sequence number 5, ackn an ning frame has arrived By then retur one time A maintains a list of sequence B acknowledges frames 2, 3, and at 7.1/FLOW CONTROL 213 numbers that it is allowed to send, and B maintains a list of sequence numbers that it is prepared to receive Each of these lists can be thought of as a window of frames The operation is referred to as sliding-window flow control Several additional comments need to be made Because the sequence number to be used occupies a field in the frame, it is clearly of bounded size For example, for a 3-bit field, the sequence number can range from to Accordingly, frames are numbered modulo 8; that is, after sequence number 7, the next number is In general, for a k-bit field the range of sequence numbers is through 2" ~ 1, and frames are numbered modulo 2* As wilt be shown subsequently, the maximum window size is 2* — Figure 7.3 is a useful way of depicting the sliding-window process It assumes the use of a 3-bit sequence number, so that frames are numbered sequentially from through 7, and then the same numbers are reused for subsequent frames The shaded rectangle indicates the frames that may be sent: in this figure, the sender may transmit five frames, beginning with frame Each time a frame is sent, the shaded window shrinks; each time an acknowledgment is received, the shaded window grows Frames between the vertical bar and the shaded window have been sent but not yet acknowledged As we shall see, the sender must buffer these frames in case they need to be retransmitted The window size need not be the maximum possible size for a given sequence number length For example, using a 3-bit sequence number, a window size of could be configured for the stations using the sliding-window flow control protocol Frames buffered until acknowledged Frames already transmitted seep OP LL 273; that may be transmitted tS Pot / Frame sequence number Lastframe acknowledged | Window of frames ⁄ Lastframe transmitted 7] O} by 2p spa] ——> Window shrinks from trailing edge as frames are sent 5] 6] fee —— Window expands from leading edge as ACKs are received (a) Sender's perspective Window of frames that may be accepted OF LG 2] Last frame acknowledged 6; wa eos] P= Frames already received / Lastframe Teceived 7/0 —= )71]2]3 }4)]5 6] [eee Window shrinks from ¿ fi ag edge ar mes are received (bị Receiver's perspective Figure 7.3) Sliding- Window Depiction m Window expands from leading edge as ACKs are sent CHAPTER / DATA LINK CONTROL PROTOCOLS Destination System B Source System A — —— [ðITIZI3T4I5I6|7I8TITZTa14i5Ts1zÏ — 1617] ISI 710] [2131415 I.IAIE stats Tia IIEIs76]I8IIIS -BIIEB —m — —— iERiznIizniistr 1smzBE— Cd ao 3]4]šI617I8ØIr[Z1314[5Isl] 4-PHTZISTATSTs|710[1T2T21415T617Ì RR3 : 244 - 617 | lt 23141511 7fo516 [ori [2 [34 BL tạ ts [SIEEI4EIEITISITEIZT4ISTe71 — me HHHEDIEILSEILTHE CHỦ RIEIEIOTURE —— [8IIIZISI4IsIE|7TðTTTZI2I+IsIsIr] Figure 7.4 Example of a Sliding-Window Protocol sequence An example is shown in Figure 7.4 The example assumes a 3-bit A and B have number field and a maximum window size of seven frames Initially, with frame (FO) windows indicating that A may transmit seven frames, beginning nt,A has shrunk After transmitting three frames (F0, F1, F2) without acknowledgme transmitted frames The its window to four frames and maintains a copy of the three with frame number window indicates that A may transmit four frames, beginning all frames B then transmits an RR (receive ready) 3, which means “I have received 3; in fact, lam up through frame number and am ready to receive frame number this , A is prepared to receive seven frames, beginning with frame number 3.” With 3; also A frame back up to permission to transmit seven frames, still beginning with A proceeds to may discard the buffered frames that have now been acknowledged and allows F3, edges transmit frames 3, 4, 5, and B returns RR 4, which acknowl reaches A, RR this time transmission of F4 through the next instance of F2 By the window its open only may it has already transmitted F4, FS, and F6, and therefore A to permit sending four frames beginning with F7 The mechanism so far described does indeed provide a form of flow control: one it has The receiver must only be able to accommodate seven frames beyond the of frames flow the off cut to station a last acknowledged Most protocols also allow from the other side by sending acknowledges former frames but means “I have received all frames more.” At some subsequent point, to reopen the window a Receive Not Ready (RNR) message, which forbids transfer of future frames Thus, RNR up through number but am unable to accept any the station must send a normal acknowledgment 7.2 / ERROR CONTROL 215 So far, we have discussed transmission in one direction only If two stations exchange data, each needs to maintain two windows, one for transmit and one for re- ceive, and each side needs to send the data and acknowledgments to the other To provide efficient support for this requirement, a feature known as piggybacking is typically provided Each data frame includes a field that holds the sequence number of that frame plus a field that holds the sequence number used for acknowledgment Thus, if a station has data to send and an acknowledgment to send, it sends both together in one frame, saving communication capacity Of course, if a station has an acknowledgment but no data to send, il sends a separate acknowledgment frame, such as RR or RNR If a station has data to send but no new acknowledgment to send, it must repeat the last acknowledgment sequence number that it sent This is because the data frame includes a field for the acknowledgment number, and some value must be put into that ficld When a station receives a duplicate acknowledg- ment, it simply ignores it Sliding-window flow control is potentially much more efficient than stop-andwait flow control The reason is that, with sliding-window flow control, the transmis- sion link is treated as a pipeline that may be filled with frames in transit In contrast, with stop-and-wait flow control, only one frame may be in the pipe at a time Ap- pendix 7A quantifies the improvement in efficiency Example 7.2 Let us consider the use of sliding-window flow control for the two configurations of Example 7.1 As was calculated in Example 7A, it takes 10 ps © - for an ACK to the first frame to be received It takes psto transmit one frame so the sender can transmit one frame and part of a second frame by the time th ACK to the first frame is received Thus, a window size of is adequate to enable “the sender to transmit frames continuously, or a rate of one frame every 8s With stop-and-wait, a rate of only one frame per LŨ ps is possible For the satellite frame to be received transmit 61 frames by ‘window size of bits “of one frame every : : configuration, it takes 488 ms for an ACK to the first It takes ms to transmit one frame, so the sender can the time the ACK to the first frame is received With a’ or more, the sender can transmit continuously, ora rate ms If the window size is 7, using a 3-bit window field, then the sender can only send frames and then must wait for an ACK before ~ sending more In this case, the sender can transmit at a rate of frames per 488 'ms, or about one frame evéry 70 ms With stop-and-wait, a rate of only one frame per 488 ms is possible 72 ERROR CONTROL Error control refers to mechanisms to detect and correct errors that occur in the transmission of frames The model that we will use, which covers the typical case, is illustrated in Figure 7.1b As before data are sent as a sequence of frames; frames ar- tive in the same order in which they are sent and each transmitted frame suffers an arbitrary and potentially variable amount of delay before reception In addition, we admit the possibility of two types of crrors: CUAPLER / DAEA © Lost frame: CONTROL LINK PROPOCUES A frame fails to arrive at the other side For example, a noise burst may damage a frame to the extent that the receiver is nol aware that a frame has been transmitted ¢ Damaged frame: A recognizable trame does arrive, but some of the bits are in error (have been altered during transmission) The most common techniques for error control are based on some or all of the following ingredients: ¢ Error detection: As discussed in Chapter * Positive acknowledgment: The destination returns a positive acknowledgment to successfully received, error-free frames * Retransmission after timeout: The source retransmits a frame that has not been acknowledged after a predetermined amount of time ¢ Negative acknowledgment and retransmission: The destination returns a negative acknowledgment to frames in which an error is detected The source retransmits such frames Collectively, these mechanisms are all referred to as automatic repeat request (ARQ); the effect of ARQ is to turn an unreliable data link into a reliable one Three versions of ARQ have been standardized: Stop-and-wait ARO Go-back-N ARQ Selective-reject ARQ All of these forms are based on the use of the flow control techniques discussed in Section 7.1 We examine each in turn Stop-and-Wait ARQ e outlined Stop-and-wait ARQ is based on the stop-and-wait flow control techniqu an acawait must then and frame single a transmits station source previously The knowledgment (ACK) No other data frames can be sent until the destination station’s reply arrives at the source station ion Two sorts of errors could occur First, the frame that arrives at the destinat e techniqu ection could be damaged The receiver detects this by using the error-det the y, possibilit this for referred to earlier and simply discards the frame To account stasource station is equipped with a timer After a frame is transmitted, the source time the by received is edgment tion waits for an acknowledgment If no acknowl that the timer expires, then the same frame is sent again Note that this method until an requires that the transmitter maintain a ‘copy of a transmitted frame acknowledgment is received for that frame followThe second sort of error is a damaged acknowledgment Consider the B, station by correctly received is frame The ing situation Station A sends a frame which responds with an acknowledgment (ACK) The ACK is damaged in transit the same and is not recognizable by A, which will therefore time out and resend accepted therefore has B B by accepted is and arrives frame frame This duplicate To avoid this problem, frames two copies of the same frame as if they were separate 226 CHAPTER / DATA LINK Initialization Initialization may CONTROL PROTOCOLS setbe requested by either side by issuing one of the six mode commands This command serves three purposes: ted It signals the other side that initialization is reques ARM) It specifies which of the three modes (NRM, ABM, is requested to be used It specifies whether 3- or 7-bit sequence numbers are module on that end If the other side accepts this request, then the HDLC the initiating side If to back transmits an unnumbered acknowledged (UA) frame sent is frame the request is rejected, then a disconnected mode (DM) Data Transfer accepted, then a logical conWhen the initialization has been requested and data in ]-frames, starting user send to begin nection is established Both sides may of the I-frame are sequence with sequence number The N(S) and N(R) fields An HDLC module sending a numbers that support flow control and error control modulo or 128, depending on sequence of I-frames will number them sequentially, and place the sequence number in whether 3- or 7-bit sequence numbers are used, ed; it enables the HDLC N(S) N(R) is the acknowledgment for I-frames receiv s to receive next module to indicate which number I-frame it expect error control The receive ready and l contro flow for S-frames are also used by indicating the next I-frame (RR) frame acknowledges the last I-frame received user data traffic (I-frames) to expected The RR is used when there is no reverse as e not ready (RNR) acknowledges an I-frame, carry an acknowledgment Receiv transmission of I-frames When the with RR, but also asks the peer entity to suspend go-back-N REJ initiates the entity that issued RNR is again ready, it sends an RR has been rejected and that retransARO It indicates that the last 1-frame received is required Selective reject mission of all I-frames beginning with number N(R) a single frame (SREJ) is used to request retransmission of just Disconnect either on its own initiative if Either HDLC module can initiate a disconnect, issues a its higher-layer user HDLC there is some sort of fault, or at the request of The remote entity must accept disconnect by sending a disconnect (DISC) frame its layer user that the connecthe disconnect by replying with a UA and informing be lost, nowledged I-frames may tion has been terminated Any outstanding unack and their recovery is the responsibility of higher layers Examples of Operation es are presented in FigTo better understand HDLC operation, several exampl a legend that specifies the ure 7.9 In the example diagrams, each arrow includes of N(R) appropriate, the values frame name, the setting of the P/F bit, and, where ation is present and if absent design the if is bit F or P the and N(S) The setting of setup and disconnect The Figure 7.9a shows the frames involved in link nd to the other side and HDLC protocol! entity for one side issues an SABM comma s a UA response and return upon receiving the SABM, starts a timer The other side, ... LINK CONTROL (HDLC) The most important data link control protocol is HDLC (ISO 3009, ISO 4335) Not only is HDLC widely used, but it is the basis for many other important data link * control protocols, ... all other important data link control protocols are derived Finally, an appendix to this chapter addresses some performance issues relating to data link control Flow control is a technique for... interfacin ocol that satprot link in this chapter that a data at two key ing look by complex affair We begin control error and ol link control: flow contr 71/ PLOW CONTROL 209 Following this background

Ngày đăng: 29/09/2013, 20:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan