Presentation is loading. Please wait.

Presentation is loading. Please wait.

McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols 1.

Similar presentations


Presentation on theme: "McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols 1."— Presentation transcript:

1 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols 1

2 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.1 Flow and Error Control Flow Control Error Control 2

3 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. Note: Error control in the data link layer is based on Automatic Repeat reQuest (ARQ), which is the retransmission of data. 3

4 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.4 Figure 11.5 Taxonomy of protocols discussed in this chapter

5 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.5 Figure 11.6 Design of Simplest Protocol with no flow or error control

6 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.6 Algorithm 11.1 Sender-site algorithm for the simplest protocol

7 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.7 Algorithm 11.2 Receiver-site algorithm for the simplest protocol

8 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.8 Figure 11.7 Flow diagram for Example 11.1

9 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.2 Stop-and-Wait ARQ Operation: send -> stop & wait Bidirectional Transmission 9 Automatic Repeat reQuest

10 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Normal Operation stop-and-wait Sender Sender Send frame with the number of current frame Frame number: 0 or 1 Used to prevent the case of duplicate frame Wait for acknowledgement (ACK) Check for the correct ACK number Receiver Wait for a frame Receive a frame Check for the correct frame number Send ACK with the number of expected frame to received next Numbered acknowledgments are needed Keep track of Delay ACK and the next frame is lost. 10

11 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.11 Stop-and-Wait AR Figure 11.10 Design of the Stop-and-Wait ARQ Protocol

12 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.1 Normal operation 12

13 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Errors in transmitting frame Frame error Lost frame Duplicate Frames Lost ACK Duplicate ACK Delay ACK 13

14 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Frame Error After error detection process If the frame contains errors, 1. Receiver sends NAK and sender retransmits the previous frame or 2. Receiver sends ACK with the number of error frame and sender retransmits the requested frame number or 3. Sender timeouts and automatic repeat current frame 14

15 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Lost Frame Receiver does not receive transmitted frame Sender timeouts Retransmit the current frame 15

16 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.2 Stop-and-Wait ARQ, lost frame 16

17 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Lost ACK Sender does not receive ACK frame Sender timeouts Retransmit the current frame Receiver receives duplicate frame Discard duplicate frame Send ACK with waiting frame number 17

18 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.3 Stop-and-Wait ARQ, lost ACK frame 18

19 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Delay ACK Similar to loss ACK Sender does not receive ACK frame in time Sender timeouts Retransmit the current frame Receiver receives duplicate frame Discard duplicate frame Send ACK with waiting frame number Sender receives delay ACK Transmit next frame (frame number in ACK) 19

20 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.4 Stop-and-Wait ARQ, delayed ACK and lost frame 20

21 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Sender site algorithm While (true) // repeat forever canSend = true // allow first frame to go waitForEvent(); // Sleep until an event occurs If (Event(RequestToSend)) and canSend) GetData(); MakeFrame(Sn); StoreFrame(Sn);// load into buffer SendFrame(Sn); StartTimer(); Sn = Sn+1; canSend = false; WaitForEvent(); If (Event (ArrivalNotification) ReceiveFrame(ackNo); If (no error and ackNo == Sn) StopTimer(); PurgeFrame(Sn-1); // delete frame successfully transmitted canSend=true; If (Event(TimeOut)) ResendFrame(Sn-1); StartTimer(); 21

22 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Receiver Site Algorithm Rn=0; // Frame 0 expected to arrive first While(true) waitForEvent(); If (Event(ArrivalNotification) ReceiveFrame(); If (corrupted(frame)); // frame error If (seqNo == Rn) ExtractData(); DeliverData(); Rn = Rn+1; SendFrameAck(Rn); 22

23 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Piggybacking: Append ACK at the end of frame when having data frame to send at the same time = Data frame + ACK 23

24 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.3 Go-Back-N ARQ Sending a sequence of frames > 1 frame Before waiting for ACK Managing data flow (flow control) Using sliding windows Need controls on variables and times More complicated than Stop-and-Wait But higher efficiency with lower delay 24

25 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Sliding Window 11.6 Sender Sliding Window: Go-back-N Sliding window is used to manage frame number to be transmit without waiting for ACK Sliding window moves after receiving ACK ACK 2 Frame 0,1: OK Frame number: 0 : (window size) 25

26 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.7 Receiver sliding window: Go-back-N Sliding window moves after receiving the correct waiting frame 26

27 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.8 Control variables 27

28 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.28 Figure 11.14 Design of Go-Back-N ARQ

29 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.9 Go-Back-N ARQ, Normal operation 29

30 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Frame Error After error detection process If the frame contains errors, 1. Receiver sends NAK with the number of error frame sender starts the window with frame number of NAK retransmits starting with the error frame as the first frame in the window or 2. Receiver do nothing no ACK from receiver sender timeouts and automatic repeat starting with the number of the error frame as the first frame in the window 30

31 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Lost Frame, Out-of-Order frames Receiver does not receive transmitted frame Sender still sends frame until complete all frames in the window or timeouts Receiver receives frames out of order Discard any unexpected frames sender timeouts, retransmit stating with the first frame in the window 31

32 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.10 Go-Back-N ARQ, lost frame 32

33 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Lost ACK 1. Sender still sends frame until complete all frames in the window 2. If sender does not receive any ACK until timeout Retransmit stating with the first frame in the window 3. If sender receive the next ACK before timeout Cannot recognize the problem Normal operation 33

34 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.11 Go-Back-N ARQ: sender window size 34

35 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 In Go-Back-N ARQ, the size of the sender window must be less than 2 m ; the size of the receiver window is always 1. Note: 35

36 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.36 Algorithm 11.7 Go-Back-N Sender algorithm (continued) หมดใน window แล้ว หยุดส่ง ยังไม่หมดใน window ส่งต่อได้ ขยับ Sn ไปรอต่ำแหน่ง ต่อไป ถ้าส่งเป็นเฟรมแรกใน window ให้ ตั้งนาฬิกา

37 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.37 Algorithm 11.7 Go-Back-N Sender algorithm (continued)

38 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.38 Algorithm 11.8 Go-Back-N Receiver algorithm

39 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.39 Figure 11.17 Flow diagram for Example 11.7

40 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.4 Selective-Repeat ARQ Similar to Go-back-N Sending a sequence of frames (> 1 frame) Before waiting for ACK Managing data flow (flow control) Using sliding windows Need more complicated controls on variables and times Select only error frames to be retransmit More complicated than Go-back-N Reduce the number of duplicated frames to be retransmitted But higher efficiency, lower traffic 40

41 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.12 Selective Repeat ARQ, Sender and Receiver windows 41

42 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.42 Figure 11.18 Send window for Selective Repeat ARQ

43 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.43 Figure 11.19 Receive window for Selective Repeat ARQ

44 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.44 Figure 11.20 Design of Selective Repeat ARQ

45 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Normal operation Send all frames in the window without waiting for ACK The number of Timers is equal to The window size Each timer is used to keep track of each frame 45

46 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Frame Error After error detection process If the frame contains errors, Receiver sends NAK with the number of error frame sender retransmits only error frame with the number of NAK frame 46

47 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Lost Frame, Out-of-Order frames Receiver does not receive waiting frame Receiver receives frames out of order Keep all unexpected frames in window Receiver sends NAK with the number of un-received frame Sender sends only frame with the number of NAK frame and Sender continues sending the remaining frames in the window If not done 47

48 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.13 Selective Repeat ARQ, lost frame 48

49 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Lost ACK 1. Sender still sends frame until complete all frames in the window 2. Sender timeouts Retransmit stating with the first frame in the window or Sender receive the next ACK Cannot recognize the problem Normal operation 49

50 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.50 Algorithm 11.9 Sender-site Selective Repeat algorithm (continued)

51 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.51 Algorithm 11.9 Sender-site Selective Repeat algorithm (continued)

52 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.52 Algorithm 11.9 Sender-site Selective Repeat algorithm (continued)

53 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.53 Algorithm 11.10 Receiver-site Selective Repeat algorithm

54 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.54 Algorithm 11.10 Receiver-site Selective Repeat algorithm

55 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2 m. Note: 55

56 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.14 Selective Repeat ARQ, sender window size 56

57 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.57 Figure 11.23 Flow diagram for Example 11.8

58 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 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. 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 1  10 6  20  10 -3 = 20,000 bits // round trip 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. Stop-and-wait: send 1 frame and wait (1 frame = 1000 bits) link utilization is only 1000/20,000, or 5%. not good for a link with high bandwidth or long delay, waste the capacity of the link. 58

59 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 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 bandwidth-delay product is still 20,000 Go-back-N ARQ:send up to 15 frames ( 15 * 1000 = 15,000 bits ) // a round trip. Link utilization is 15,000/20,000, or 75 percent. damaged frames utilization percentage is much less because frames have to be retransmitted. 59

60 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 L2 Protocol requirement Frame format Data frame Control frame Management frame etc. Flow and Error Control Protocol Stop-and-Wait ARQ Go-back-N ARQ Selective Repeat ARQ Media Access Protocol 60

61 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.5 HDLC: High-level Data Link Control Configurations and Transfer Modes Frames Frame Format Examples Data Transparency 61 HDLC : bit-oriented protocol for communication over point-to-point and multipoint links o HDLC implements ARQ mechanism Transfer Modes o Normal Response Mode (NRM) o Asynchronous Balanced Mode (ABM)

62 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.62 Normal Response Mode (NRM) Figure 11.25 Normal Response Mode (NRM) o Station configuration is unbalanced o Primary station : sending command o multiple Secondary station : only respond

63 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.63 Asynchronous Balanced Mode (ABM) Figure 11.26 Asynchronous Balanced Mode (ABM) ABM : configuration is Balanced o link is point to point o each station can function as primary and secondary o common mode today

64 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 NRM: Normal Response Mode Unbalanced (Master/ Slave) Primary – Secondary Asymmetric Primary control all communications among all secondary stations in network Command Poll-> Request data from secondary Select -> Select secondary to send data 64

65 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 ARM: Asynchronous Response Mode Unbalanced (Master/ Slave) Primary – Secondary Symmetric Primary or secondary Can start communications But secondary cannot directly communicate to another secondary Command Poll-> Request data from secondary Select -> Select secondary to send data 65

66 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.16 Transfer Mode: ABM (Asynchronous Balanced Mode) Balanced No Primary – Secondary Equal priority for all stations in network Any station can start communications 66

67 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.67 Figure 11.27 HDLC frames Information Frames : user data and control information relating To user data (Piggybacking) Supervisory Frames : control information Unnumbered Frames : system management Each type of frame serves as envelop for transmission of different type of messages FCS : Frame Check Sequence

68 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.17 HDLC frame: Frame format 01111110 Flag ( 8 bits): “01111110” 68

69 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Common fields in all frame types Flag ( 8 bits ) “ 01111110” Address (>= 1 byte) Receiving address Length 1 byte: last bit in address field = ‘1’ > 1 byte: last bit of each byte = ‘0’ except last bit of last address byte = ‘1’ FCS (Frame Check Sequence)( 2- or 4-byte) Error detection CRC ( CRC - ITU-T: 16 bits or CRC-32) Error detection for all fields Except Flag 69

70 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.18 HDLC frame types 8 bits 70 Used for Flow and Error Control

71 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Control Field Control Field : Specify Type of Frame I-frame : Information frame S-frame : Supervisory frame U-frame : Unnumbered frames 71

72 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 I-Frame Control field 1 st bit: ‘0’ : defined type of frame (I-Frame) N(S) (3 bits): Transmitting Frame number (0-7) Can extend to 7 bits N(R) (3 bits): ACK or NAK Frame number (0-7) : When piggybacking is used Can extend to 7 bits P/F bit P bit (Poll bit): Poll Frame from Primary ‘1’: Poll Frame from Primary ‘0’: otherwise F bit (Final bit): Frame from Secondary ‘1’: Last I-frame from Secondary ‘0’: otherwise I-frame 72

73 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 S-frame 73 Used for flow control or error control when piggybacking is either impossible or inappropriate o station either has no data of its own to send or o needs to send command or response other than ACK Code 00: RR (Receive Ready) N(R) = ACK no. 01: REJ (REJect) -> NAK for Go-back-N N(R) = NAK no. 10: RNR (Receive Not Ready) : receiver announces that receiver is busy and cannot receive more frame (acts as kind of congestion control mechanism by asking sender to slow down) N(R) = ACK no. 11: SREJ (Selective-REJect) -> NAK for Selective-reject ( N(R) = NAK no.) P/F bit Depend on the condition of Code field ACK or NAK no.

74 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Polling Asking for data Polling: Asking for data from secondary RR P=1 N(R) = 0 A C RRF=1 N(R) =0 C N(S)=0 F=0 N(R) =0 C N(S)=1 F=1 N(R) =0 C S-frame I-frame RR P=1B N(R) =2 S-frame Receiver Addr RR: Receive Ready/ Transmit Not Ready RNR: Receive Not Ready Transmit Ready Control code P/F bit N(R): Received frame number RR P=1B N(R) =0 74

75 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Select Asking to send data Select: Asking to send data to Secondary RNR P=1B N(R) =0 S-frame N(S)=0 F=0 N(R) =0 B N(S)=1 F=1 N(R) =0 B I-frame N(R) =0 RR F=1 C S-frame RR F=1N(R) =2C S-frame C 75

76 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 RR RR: Receive Ready Use of RR (“00”) ACK (Secondary) Positive response after receiving correct I-frame => (send back S-Frame) Expected frame number in N(R) RR code-> Ready to receive new data P/F bit (F bit condition) -> F = 1 ACK (Secondary: Response for Select command) ->(send back S-Frame) Positive response after receiving Select frame RR code-> Ready to receive data from Primary P/F bit (F bit condition) -> F = 1 NAK (Secondary) Negative response after receiving Poll frame(S-Frame)  send back S-Frame) RR-> ready to receive data / not ready to transmit P/F bit (F bit condition) -> F = 1 Poll frame (Primary: Poll command) => primary send S-Frame Polling command to request data from Secondary RR-> ready to receive data / request for data P/F bit (P bit condition)-> P = 1 76

77 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 RNR RNR: Receive Not Ready Use of RNR (“10”) ACK (Secondary) Positive response after receiving correct I-frame Expected frame number in N(R) RNR code-> Not ready to receive new data After ACK, busy, request to stop communication for a while Continue communication after receiving RR frame from Secondary again P/F bit (F bit condition) -> F = 1 NAK (Secondary) Negative response after receiving Select frame RNR-> Not ready to receive data P/F bit (F bit condition) -> F = 1 Select frame (Primary) Primary asking for sending data to Secondary Select command to request to transmit data to Secondary RNR-> Not ready to receive data / ready to transmit P/F bit (P bit condition)-> P = 0 77

78 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 REJ REJ: REJect Frame Use of REJ (“01”) NAK (Secondary: Go-back-N ARQ) Negative response after receiving error frame Retransmit all frames since error frame REJ-> Reject frame number in N(R) P/F bit (F bit condition) -> F = 1 SREJ: SREJ: Selective REJect Frame Use of SREJ (“11”) NAK (Secondary: Selective-Reject ARQ) Negative response after receiving error frame Retransmit only error frame SREJ-> Reject frame number in N(R) P/F bit (F bit condition) -> F = 1 78

79 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 U-frame 11.21 U-frame control field in HDLC 79 U-frame : exchange control information between connecting devices

80 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Table 11.1 U-frame control command and response Command/responseMeaning SNRMSet normal response mode SNRMESet normal response mode (extended) SABMSet asynchronous balanced mode SABMESet asynchronous balanced mode (extended) UPUnnumbered poll UIUnnumbered information UAUnnumbered acknowledgment RDRequest disconnect DISCDisconnect DMDisconnect mode RIMRequest information mode SIMSet initialization mode RSETReset XIDExchange ID FRMRFrame reject 80

81 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 3 Figure 11.22 shows an exchange using piggybacking where is no error. Station A begins the exchange of information with an I-frame numbered 0 followed by another I-frame numbered 1. Station B piggybacks its acknowledgment of both frames onto an I-frame ACK 2: N(R) // waiting for frame 2 & Station B’s first I-frame is also numbered 0 N(S) = 0 // sending frame 0 Station B transmits its second and third I-frames numbered 1 and 2 before ACK from station A Station A transmit S-frame (ACK) with no data ACK 3 (RR): N(R) = 3. 81 Go-back-N

82 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.22 Example 3: Go-back-N Frame 0, ACK 0 Frame 1, ACK 0 Frame 0, ACK 2 Frame 1, ACK 2 Frame 2, ACK 2 ACK 3 I-frame S-frame Frame Type N(S) N(R) (Full duplex) 0 1 20 0 2 3 00 1 2 3 0 1 20 1 2 2 2 2 3 02 82

83 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Example 4 In Example 3, suppose frame 1 sent from station B to station A has an error. Station A informs station B to resend frames 1 and 2 (the system is using the Go-Back- N mechanism). Station A sends a reject supervisory frame to announce the error in frame 1. Figure 11.23 shows the exchange. 83

84 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.23 Example 4: Go-back-N ARQ Frame 0, ACK 2 Frame 1, ACK 2 Frame 2, ACK 2 NAK 1 Frame 1, ACK 2 Frame 2, ACK 2 ACK 3 0 1 22 2 3 00 84

85 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.85 Figure 11.29 shows how U-frames can be used for connection establishment and connection release. o Node A asks for a connection with a set asynchronous balanced mode (SABM) frame; o node B gives a positive response with an unnumbered acknowledgment (UA) frame. o After these two exchanges, data can be transferred between the two nodes (not shown in the figure). o After data transfer, node A sends a DISC (disconnect) frame to release the connection; it is confirmed by node B responding with a UA (unnumbered acknowledgment). Example 11.9 U-frames are reserved for system management Information carried by U-frames if intended for managing the link itself.

86 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.86 connectiondisconnection Figure 11.29 Example of connection and disconnection

87 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Bit stuffing is the process of adding one extra 0 whenever there are five consecutive 1s in the data so that the receiver does not mistake the data for a flag. Note: 87

88 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 11.24 Bit stuffing and removal 88

89 McGraw-Hill©The McGraw-Hill Companies, Inc., 2004McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Bit stuffing 11.25 Special Pattern: Bit stuffing in HDLC = 15 > 15 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7th 8th 89 = 15 > 15


Download ppt "McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols 1."

Similar presentations


Ads by Google