0% found this document useful (0 votes)
2K views

DataLink Part2

The primary maintains a separate logical link with each secondary station on the line. The three data transfer modes are Normal response mode (NRM), asynchronous balanced mode (ABM), and asynchronous response mode (ARM) a single frame format suffices for all types of data and control exchanges.

Uploaded by

Faizy Ahsan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

DataLink Part2

The primary maintains a separate logical link with each secondary station on the line. The three data transfer modes are Normal response mode (NRM), asynchronous balanced mode (ABM), and asynchronous response mode (ARM) a single frame format suffices for all types of data and control exchanges.

Uploaded by

Faizy Ahsan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20
6.4 / HIGH-LEVEL DATA LINK CONTROL (HDLC) 177 issued by a secondary are called responses. The primary maintains a separate logical link with each secondary station on the line. * Combined station. Combines the features of primary and secondary. A com- bined station may issue both commands and responses. The two link configurations are © Unbalanced configuration, Consists of one primary and one or more sec- ondary stations and supports both full-duplex and half-duplex transmission. « Balanced configuration, Consists of two combined stations and supports both full-duplex and half-duplex transmission. The three data transfer modes are + Normal response mode (NRM). Used with an unbalanced configuration. The primary may initiate data transfer to a secondary, but a secondary may only transmit data in response to a command from the primary. * Asynchronous balanced mode (ABM). Used with a balanced configuration. Either combined station may initiate transmission without receiving permis- sion from the other combined station * Asynchronous response mode (ARM). Used with an unbalanced configura- tion. The secondary may initiate transmission without explicit permission of the primary. The primary still retains responsibility for the line, including ini- tialization, error recovery, and logical disconnection. NRM is used on mulitdrop lines, in which a number of terminals are con- nected to a host computer. The computer polls each terminal for input. NRM is also sometimes used on point-to-point links, particularly if the link connects a terminal or other peripheral to a computer. ABM is the most widely used of the three modes; it makes more efficient use of a full-duplex point-to-point link as there is no polling overhead. ARM is rarely used; it is applicable to some special situations in which a secondary may need to initiate transmission. Frame Structure HDLC uses synchronous transmission. All transmissions are in the form of frames, and a single frame format suffices for all types of data and control exchanges. Figure 6.10a depicts the structure of the HDLC frame. The flag, address, and control fields that precede the information field are known as a header. The FCS and flag fields following the data field are referred to as a trailer. Flag Fields Flag fields delimit the frame at both ends with the unique pattern 01111110. A sin- gle flag may be used as the closing flag for one frame and the opening flag for the next. On both sides of the user-network interface, receivers are continuously hunt- ing for the flag sequence to synchronize on the start of a frame. While receiving a 178 CHAPTER 6 / DATA LINK CONTROL Flag | Address| Control Information FCS Flag 8 88 oF 16 — variable > 16 oF 32 8 bits extendable (a) Frame format 123456789 WuNRBUI516 80 0 0 oof (b) Extended address field = Receive sequence number Le A oo eo Etnformation Fo] Ne) [pm] NeR) Leoexo 5 N(S) = Send sequence number S:Supervisory [1 [oO] so [pal -NiR) Ks) aus = eceive sequence number Supervisory function bits U:Unnumberead [7 4] Mer] OM Tanumbered function bits Pollifnal bit (©) 8-bit control field format 1203 4 5s 6 7 8 9 0 M2 BM 15 6 Information | 0 NG). PIE NR) Supervisory f2fo] s | o[o}o}olpr NR) (d) 16-bit control field format FIGURE 6.10 HDLC frame structure. frame, a station continues to hunt for that sequence to determine the end of the frame. However, it is possible that the pattern 01111110 will appear somewhere inside the frame, thus destroying frame-level synchronization. To avoid this, a pro- cedure known as bit stuffing is used. Between the transmission of the starting and ending flags, the transmitter will always insert an extra 0 bit after each occurrence of five Is in the frame. After detecting a starting flag, the receiver monitors the bit stream. When a pattern of five 1s appears, the sixth bit is examined. If this bit is 0, it is deleted. If the sixth bit is a 1 and the seventh bit is a 0, the combination is accepted as a flag. If the sixth and seventh bits are both 1, the sender is indicating an abort condition. With the use of bit stuffing, arbitrary bit patterns can be inserted into the data field of the frame. This property is known as data transparency. Figure 6.11a shows an example of bit stuffing. Note that in the first two cases, the extra 0 is not strictly necessary for avoiding a flag pattern, but is necessary for the operation of the algorithm. The pitfalls of bit stuffing are also illustrated in this 6.4 / HIGH-LEVEL DATA LINK CONTROL (HDLC) 179 Original pattern VALI ELLOLIITLLOLLLL110 After bit-stuffing 1111101111191101111191011111910 (@) Example Flag Flag ] Transmitted Frame fe Bitinvented Flag. Flag Fiag | Received Frame (b) An inverted bit splits a frame in two Flag Fla [— Bitinverteo Flag. [Flag | Received Frame [Flag | Transmitted Frame (©) An inverted bit merges two frames FIGURE 6.11 _ Bit stuffing, figure. When a flag is used as both an ending and a starting flag, a 1-bit error merges two frames into one; conversely, a 1-bit error inside the frame could split it in two. Address Field The address field identifies the secondary station that transmitted or is to receive the frame. This field is not needed for point-to-point links, but is always included for the sake of uniformity. The address field is usually eight bits long but, by prior agreement, an extended format may be used in which the actual address length is a multiple of seven bits (Figure 6.10b). The least significant bit of each octet is 1 or 0, depending on whether it is or is not the last octet of the address field. The remain- ing seven bits of each octet form part of the address. The single-octet address of LILII1LL is interpreted as the all-stations address in both basic and extended formats. It is used to allow the primary to broadcast a frame for reception by all secondaries. Control Field HDLC defines three types of frames, each with a different control field format. Information frames (I-frames) carry the data to be transmitted for the user (the logic above HDLC that is using HDLC). Additionally, flow- and error-control data, 180 CHAPTER 6 / DATA LINK CONTROL using the ARQ mechanism, are piggybacked on an information frame. Supervisory frames (S-frames) provide the ARQ mechanism when piggybacking is not used. Unnumbered frames (U-frames) provide supplemental link control functions. The first one or two bits of the control field serves to identify the frame type. The remaining bit positions are organized into subfields as indicated in Figure 6.10c and d. Their use is explained below in the discussion of HDLC operation. Note that the basic contro! field for $- and I-frames uses 3-bit sequence num- bers. With the appropriate set-mode command, an extended control field can be used for S- and [-frames that employs 7-bit sequence numbers. U-frames always contain an 8-bit control field. Information Field The information field is present only in I-frames and some U-frames. The field can contain any sequence of bits but must consist of an integral number of octets. The length of the information field is variable up to some system-defined maximum. Frame Check Sequence Field The frame check sequence (FCS) is an error-detecting code calculated from the remaining bits of the frame, exclusive of flags. The normal code is the 16-bit CRC- CCITT defined in Section 6.2. An optional 32-bit FCS, using CRC-32, may be employed if the frame length or the line reliability dictates this choice. Operation HDLC operation consists of the exchange of I-frames, S-frames, and U-frames between two stations. The various commands and responses defined for these frame types are listed in Table 6.1. In describing HDLC operation, we will discuss these three types of frames. The operation of HDLC involves three phases. First, one side or another ini- tializes the data link so that frames may be exchanged in an orderly fashion, During this phase, the options that are to be used are agreed upon. After initialization, the two sides exchange user data and the control information to exercise flow and error control. Finally, one of the two sides signals the termination of the operation. Init ‘ion Initialization may be requested by either side by issuing one of the six set-mode commands. This command serves three purposes: 1. It signals the other side that initialization is requested. 2. It specifies which of the three modes (NRM, ABM, ARM) is requested. 3. It specifies whether 3- or 7-bit sequence numbers are to be used. If the other side accepts this request, then the HDLC module on that end transmits an unnumbered acknowledged (UA) frame back to the initiating side. If the request is rejected, then a disconnected mode (DM) frame is sent. 6.4 / HIGH-LEVEL DATA LINK CONTROL (HDLC) 181 TABLE 6.1 HDLC Commands and responses. ‘Command! Name response Description Information (1) CR Exchange user data Supervisory (S) Receive ready (RR) oR Positive acknowledgment; ready to receive Lframe Receive not ready (RNR) oR Positive acknowledgment; not ready to receive Reject (RES) cR Negative acknowledgment; go back N Selective reject (SREJ) cR Negative acknowledgment; selective reject Unnumbered (U) Set normal response/extended c Set mode; extended = 7-bit sequence ‘mode (SNRM/SNRME) numbers Set asynchronous c Set mode; extended = 7-bit sequence response/extended mode numbers (SARM/SARME) Set asynchronous c Set mode; extended = 7-bit sequence balanced/extended mode numbers (SABM, SABME) Set initialization mode (SIM) c Initialize Link control functions in addressed station Disconnect (DISC) c ‘Terminate logical link connection Unnumbered acknowledgment R Acknowledge acceptance of one of the set Wa) mode commands Disconnected mode (DM) c ‘Terminate logical link connection Request disconnect (RD) R Request for DISC command Request initialization mode R Initialization needed; request for SIM (RIM) command Unnumbered information (UI) oR Used to exchange control information ‘Unnumbered poll (UP) c Used to solicit control information Reset (RSET) c Used for recovery; resets N(R), N(S) Exchange identification (XID) oR Used to request/report status Test (TEST) CR Exchange identical information fields for testing Frame reject (FRMR) R Reports receipt of unacceptable frame Data Transfer When the initialization has been requested and accepted, then a logical connection is established. Both sides may begin to send user data in I-frames, starting with sequence number 0. The N(S) and N(R) fields of the I-frame are sequence numbers that support flow control and error control. An HDLC module sending a sequence of I-frames will number them sequentially, modulo 8 or 128, depending on whether 3- or 7-bit sequence numbers are used, and place the sequence number in N(S). N(R) is the acknowledgment for I-frames received; it enables the HDLC module to. 182 CHAPTER 6 / DATA LINK CONTROL indicate which number I-frame it expects to receive next. S-frames are also used for flow control and error control. The receive-ready (RR) frame is used to acknowledge the last I-frame received by indicating the next I-frame expected. The RR is used when there is no reverse-user data traffic (I- frames) to carry an acknowledgment. Receive-not-ready (RNR) acknowledges an I-frame, as with RR, but also asks the peer entity to suspend transmission of I- frames, When the entity that issued RNR is again ready, it sends an RR. REY initi- ates the go-back-N ARQ. It indicates that the last I-frame received has been rejected and that retransmission of all I-frames beginning with number N(R) is required, Selective reject (SREJ) is used to request retransmission of just a single frame. Disconnect Either HDLC module can initiate a disconnect, either on its own initiative if there is some sort of fault, or at the request of its higher-layer user. HDLC issues a dis- connect by sending a disconnect (DISC) frame. The other side must accept the dis- connect by replying with a UA. Examples of Operation In order to better understand HDLC operation, several examples are presented in Figure 6.12. In the example diagrams, each arrow includes a legend that specifies the frame name, the setting of the P/F bit, and, where appropriate, the values of N(R) and N(S). The setting of the P or F bit is 1 if the designation is present and 0 if absent. Figure 6.12a shows the frames involved in link setup and disconnect. The HDLC protocol entity for one side issues an SABM command to the other side and starts a timer. The other side, upon receiving the SABM, returns a UA response and sets local variables and counters to their initial values. The initiating entity receives the UA response, sets its variables and counters, and stops the timer. The logical connection is now active, and both sides may begin transmitting frames. Should the timer expire without a response, the originator will repeat the SABM, as illustrated. This would be repeated until a UA or DM is received or until, after a given number of tries, the entity attempting initiation gives up and reports failure to a management entity. In such a case, higher-layer intervention is necessary. The same figure (Figure 6.12a) shows the disconnect procedure. One side issues a DISC command, and the other responds with a UA response. Figure 6.12b illustrates the full-duplex exchange of I-frames. When an entity sends a number of I-frames in a row with no incoming data, then the receive sequence number is simply repeated (c.g, I, 1, 1; I, 2, 1 in the A-to-B direction), When an entity receives a number of I-frames in a row with no outgoing frames, then the receive sequence number in the next outgoing frame must reflect the cumulative activity (e.g., I, 1, 3 in the B-to-A direction). Note that, in addition to L-frames, data exchange may involve supervisory frames. Figure 6.12c shows an operation involving a busy condition. Such a condition may arise because an HDLC entity is not able to process I-frames as fast as they are 64 / HIGH-LEVEL DATA LINK CONTROL (HDLC) 183 N(S} N(R) ae — Timeout ie (a) Link setup and disconnect (b) Two-way data exchange _(c) Busy condition A B A B L3o 12.0 - Lao 3 zy (d) Reject recovery (e) Timeout recovery FIGURE 6.12 Examples of HDLC operation. arriving, or the intended user is not able to accept data as fast as they arrive in I- frames. In either case, the entity’s receive buffer fills up and it must halt the incom- ing flow of I-frames, using an RNR command. In this example, A issues an RNR, which requires B to halt transmission of I-frames. The station receiving the RNR will usually poll the busy station at some periodic interval by sending an RR with the P-bit set; this requires the other side to respond with either an RR or an RNR. When the busy condition has cleared, A returns an RR, and I-frame transmission from B can resume. An example of error recovery using the REJ command is shown in Figure 6.12d. In this example, A transmits I-frames numbered 3, 4, and 5. Number 4 suffers an error and is lost. When B receives I-frame number 5, it discards this frame 184 CHAPTER 6 / DATA LINK CONTROL Flag ‘Addeess | Control Information | __FCS Flag 8 an Sorl6 Variable‘ 160r32 8 (@) HDLC, LAPB Flag ‘Address | Contwol_| Information | _FCS Flag 8 16 16 Variable 16 8 (LAD ~ | pest. | source Mac} mac | MAc | psap | ssap | LEC, ltnformation| FCs address | address Variable 16048 1608 8 8 16 Variable 32 (@LLomac Flag ‘Address | Control | Information | __FCS Flag 8 160r32 16 Variable 160732 8 (@ LAPF (control) Flag ‘Address | _Information FCS Flag 8 161032 Variable 16 8 (©) LAPF (core) : Virtual General flow } Virtual path : Header error neral flow | Vistual path | channel | Controt bits | M°84°t 10° | aformation identifier 4 8 16 4 8 384 (a™ + = 16-bit control field (7 bit sequence numbers) for I- and S-frames; § bit for U-trames. FIGURE 6.13 Data link control frame formats. because it is out of order and sends an REJ with an N(R) of 4. This causes A to ini- tiate retransmission of all I-frames sent, beginning with frame 4. It may continue to send additional frames after the retransmitted frames. ‘An example of error recovery using a timeout is shown in Figure 6.12e. In this example, A transmits Lframe number 3 as the last in a sequence of I-frames. The frame suffers an error. B detects the error and discards it. However, B cannot send an REJ; this is because there is no way to know if this was an I-frame. If an error is detected in a frame, all of the bits of that frame are suspect, and the receiver has no way to act upon it. A, however, Would have started a timer as the frame was trans- mitted. This timer has a duration long enough to span the expected response time. When the timer expires, A initiates recovery action; this is usually done by polling the other side with an RR command with the P bit set, to determine the status of the other side, Because the poll demands a response, the entity will receive a frame containing an N(R) field and be able to proceed. In this case, the response indicates

You might also like