Presentation is loading. Please wait.

Presentation is loading. Please wait.

11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Similar presentations


Presentation on theme: "11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display."— Presentation transcript:

1 11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

2 11.2 Data Link Layer 하나의 링크를 통해 연결된 두 노드 (node) 사이에서 프레임의 전달을 목표로 한다. 프레임 (frame): data link layer 에서 전달하는 정보의 단위

3 11.3 Data Link Layer 에서 처리할 일 프레임의 시작과 끝을 어떻게 구분할 것인가 ? Framing 수신 노드는 어떻게 송신 노드가 보낸 프레임 그대로 받을 수 있도록 하는가 ? 에러 제어 흐름 제어 등등

4 11.4 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. Fixed-Size Framing Variable-Size Framing Topics discussed in this section:

5 11.5 Figure 11.1 A frame in a character-oriented protocol

6 11.6 Figure 11.2 Byte stuffing and unstuffing

7 11.7 Byte stuffing is the process of adding 1 extra byte whenever there is a flag or escape character in the text. Note

8 11.8 Figure 11.3 A frame in a bit-oriented protocol

9 11.9 Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s follow a 0 in the data, so that the receiver does not mistake the pattern 0111110 for a flag. Note

10 11.10 Figure 11.4 Bit stuffing and unstuffing

11 11.11 11-2 FLOW AND ERROR CONTROL The most important responsibilities of the data link layer are flow control and error control. Collectively, these functions are known as data link control. Flow Control Error Control Topics discussed in this section:

12 11.12 Flow Control 필요성 송신부의 전송속도가 수신부의 처리 속도보다 빠르면, 송신부는 수신부의 처리속도에 맞추어 전송속도를 조절해야 함 ! 기법들 Stop-and-wait Sliding window flow control 수신부 송신부에게 자신의 잔여 버퍼량을 알림 송신부 수신부가 수신할 수 있다고 알려준 양만큼 만 데이터를 전송하고 멈춤

13 11.13 Figure 11.9 Stop-and-wait

14 11.14 Sliding Window (a) 송신자의 관점 (b) 수신자의 관점 순서번호 전송된 마지막 프레임 프레임을 전송하면 Window 가 하나씩 닫힘 ACK 를 수신하면 window 가 열림 이미 전송된 프레임 전송될 수 있는 프레임 (sending window) 01230123 전송된 마지막 ACK 번호 프레임을 수신하면 Window 가 하나씩 닫힘 ACK 를 송신하면 window 가 열림 이미 수신된 프레임 수신될 수 있는 프레임 (receiving window) 01230123

15 11.15 Sliding Window Protocol 의 동작 01230123 01230123 01230123 Window Size = 3 I(1) I(2) 01230123 01230123 01230123 Window 가 닫힘 I(0) I(3) Window 가 닫힘 ACK(2,3,0) 01230123 Window 가 닫힘 01230123 01230123 01230123 ACK(0,1) 012012 302302 2

16 11.16 Error control Error detection ( 에러 검출 ) CRC Checksum Error correction ( 에러 정정 ) Automatic Repeat Request (ARQ): 재전송 Forward Error Correction (FEC)

17 11.17 Error control in the data link layer is based on automatic repeat request, which is the retransmission of data. Note

18 11.18 I(0) I(1) I(2) I(3) I(4) ACK 0 timeout 중복된 (duplicate) 프레임은 폐기. ACK 1 ACK 2 ACK 3 ACK 4 Stop-and-Wait ARQ 데이터 프레임에 에러 ACK 에 에러 데이터 프레임에 에러가 발생하였다고 간주하고 재전송 데이터 프레임에 에러가 발생하였다고 간주하고 재전송 정상 동작 : 전송된 데이터에 대한 ACK 가 도착해야만 다음 번 데이터 전송

19 11.19 Figure 11.11 Simple Stop-and-wait protocol

20 11.20 Assume that, 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 Example 11.4

21 11.21 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 the link utilization is only 1000/20,000, or 5 percent. For this reason, for a link with a high bandwidth or long delay, the use of Stop-and-Wait ARQ wastes the capacity of the link. Example 11.4 (continued)

22 11.22 재전송 방법 Simple stop-and-wait protocol 은 전송로의 활용효율이 너무 낮기 때문에 ack 를 받기 전에도 연속적으로 프레임을 전송하도록 해야 한다. 연속적으로 프레임을 보냈을 때 에러가 발생하면 이것을 어떻게 처리할 것인가 ? Go-Back-N Selective Repeat (Selective Request)

23 11.23 Selective Repeat & Go-back-N Selective repeat 송신부는 에러가 발생한 프레임만 재전송하고 나머지는 재전송하지 않음. 채널의 효율은 좋으나 수신부에서의 버퍼요구량이 큼. Go-back-N 송신부는 에러가 발생한 프레임부터 모두 재전송 채널의 효율은 좋지않으나 수신부에서의 버퍼요구량이 크지 않음.

24 11.24 Selective Repeat & Go-back-N I(0) I(1) I(2) I(3) I(4) I(5) I(6) I(4) I(5) I(6) I(7) I(0) I(1) I(7) I(0) I(1) I(2 3) I(4) timeout Retransmit all frames from I(4) Retransmit from I(7) Error on ACK(8) NAK(5) ACK(8) Error on I(4) ACK(1) I(0) I(1) I(2) I(3) I(4) I(5) I(6) I(4) I(7) I(0) I(1) I(2) I(3) I(4) I(1) I(5) I(6) I(7) ACK(1) timeout Retransmit only I(4) Retransmit only I(1) Error on ACK(2) NAK(4) ACK(2) Error on I(4) (a) Selective repeat(b) go-back-N............

25 11.25 In the Go-Back-N Protocol, the sequence numbers are modulo 2 m, where m is the size of the sequence number field in bits. Note

26 11.26 Figure 11.12 Send window for Go-Back-N ARQ

27 11.27 Figure 11.13 Receive window for Go-Back-N ARQ

28 11.28 Frame 전송과 window 의 변화 (1)

29 11.29 프레임 전송과 window 변화 (2)

30 11.30 Figure 11.15 Window size for Go-Back-N ARQ

31 11.31 In Go-Back-N ARQ, the size of the send window must be less than 2 m ; the size of the receiver window is always 1. Note

32 11.32 Figure 11.18 Send window for Selective Repeat ARQ

33 11.33 Figure 11.19 Receive window for Selective Repeat ARQ

34 11.34 Figure 11.21 Selective Repeat ARQ, window size

35 11.35 In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2 m. Note

36 11.36 11-6 HDLC High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-to-point and multipoint links. It implements the ARQ mechanisms we discussed in this chapter. HDLC is a ISO standard data link layer protocol. Configurations and Transfer Modes Frames Control Field Topics discussed in this section:

37 11.37 Figure 11.25 Normal response mode

38 11.38 Figure 11.26 Asynchronous balanced mode

39 11.39 Figure 11.27 HDLC frames

40 11.40 Flag 01111110

41 11.41 Figure 11.27 FCS: CRC error code CRC code

42 11.42 Figure 11.27 HDLC frames

43 11.43 Table 11.1 U-frame control command and response

44 11.44 Figure 11.29 shows how U-frames can be used for connection establishment and connection release. Node A asks for a connection with a set asynchronous balanced mode (SABM) frame; node B gives a positive response with an unnumbered acknowledgment (UA) frame. After these two exchanges, data can be transferred between the two nodes (not shown in the figure). 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

45 11.45 Figure 11.29 Example of connection and disconnection

46 11.46 Figure 11.30 shows an exchange using piggybacking. Node A begins the exchange of information with an I-frame numbered 0 followed by another I-frame numbered 1. Node B piggybacks its acknowledgment of both frames onto an I-frame of its own. Node B’s first I-frame is also numbered 0 [N(S) field] and contains a 2 in its N(R) field, acknowledging the receipt of A’s frames 1 and 0 and indicating that it expects frame 2 to arrive next. Node B transmits its second and third I-frames (numbered 1 and 2) before accepting further frames from node A. Example 11.10

47 11.47 Its N(R) information, therefore, has not changed: B frames 1 and 2 indicate that node B is still expecting A’s frame 2 to arrive next. Node A has sent all its data. Therefore, it cannot piggyback an acknowledgment onto an I-frame and sends an S-frame instead. The RR code indicates that A is still ready to receive. The number 3 in the N(R) field tells B that frames 0, 1, and 2 have all been accepted and that A is now expecting frame number 3. Example 11.10 (continued)

48 11.48 Figure 11.30 Example of piggybacking without error

49 11.49 Figure 11.31 shows an exchange in which a frame is lost. Node B sends three data frames (0, 1, and 2), but frame 1 is lost. When node A receives frame 2, it discards it and sends a REJ frame for frame 1. Note that the protocol being used is Go-Back-N with the special use of an REJ frame as a NAK frame. The NAK frame does two things here: It confirms the receipt of frame 0 and declares that frame 1 and any following frames must be resent. Node B, after receiving the REJ frame, resends frames 1 and 2. Node A acknowledges the receipt by sending an RR frame (ACK) with acknowledgment number 3. Example 11.11

50 11.50 Figure 11.31 Example of piggybacking with error


Download ppt "11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display."

Similar presentations


Ads by Google