Presentation is loading. Please wait.

Presentation is loading. Please wait.

THE DATA LINK LAYER Chapter 3 1. H YBRID M ODEL The hybrid reference model to be used in this book. 2.

Similar presentations


Presentation on theme: "THE DATA LINK LAYER Chapter 3 1. H YBRID M ODEL The hybrid reference model to be used in this book. 2."— Presentation transcript:

1 THE DATA LINK LAYER Chapter 3 1

2 H YBRID M ODEL The hybrid reference model to be used in this book. 2

3 F UNCTIONS OF THE D ATA L INK L AYER 3

4 S ERVICES P ROVIDED TO N ETWORK L AYER Unacknowledged connectionless service. No acknowledgement, no logical connection, used in very low error rate channel and real-time traffic. Acknowledged connectionless service. each frame acknowledged, used in unreliable channel Acknowledged connection-oriented service a connection established, frames are numbed.reliable transmission guaranteed. 4

5 For the data link layer, break the bit stream up into discrete frames and computer the checksum for each frame (error control). Four methods are used to break the bit stream. 1. Character count. (rarely used) 2. Flag bytes with byte stuffing 3. Starting and ending flags, with bit stuffing. 4. Physical layer coding violations. 5

6 F RAMING (3) Bit stuffing (a) The original data. (b) The data as they appear on the line. (c) The data as they are stored in receiver’s memory after destuffing. 6

7 7 zEnsuring the sending entity does not overwhelm the receiving entity yFeedback-based flow control Flow Control yRate-based flow control (network layer)

8 S TOP AND W AIT 8 Only one frame at a time can be in transit. 1.Source transmits frame 2.Destination receives frame and replies with acknowledgement (if it is correct, otherwise send NAK.) 3.Source waits for ACK before sending next frame 4.Destination can stop flow by not send ACK 5.Source can retransmit if got a NAK. 6.Works well for a few large frames 7.Inefficient line utilization for small frames

9 S LIDING W INDOW P ROTOCOLS 9 Allow multiple frames to be in transit Receiver has buffer W long Transmitter can send up to W frames without ACK Each frame is numbered ACK includes number of next frame expected Sequence number bounded by size of field (k) Frames are numbered modulo 2 k

10 E XAMPLE S LIDING W INDOW 10

11 S LIDING W INDOW P ROTOCOLS (2) Duplex communication: each station needs to maintain two windows Piggyback: num of frame and num of ack are included in one frame. Sliding-window flow control is more efficient than stop-and-wait flow control. 11

12 ERROR CONTROL Detection and correction of errors Lost frames: a frame failed to arrived to the other side. Damaged frames: some bits are in error. Automatic repeat request Error detection Positive acknowledgment Retransmission after timeout Negative acknowledgement 12

13 ERROR DETECTION AND ERROR CORRECTION Additional bits added by transmitter for error detection and/or error correction code Error detection is more often used in protocol with ARQ. High code rate, high reliability. c) Error correction is used in specific situation. (no reverse channel) d) Hybrid ARQ: combination of error detection and correction. 13

14 ERROR CONTROL SCHEME 14

15 STOP-AND –WAIT ARQ 15 1.Source transmits single frame 2.Wait for ACK 3.If received frame damaged, discard it 4.Transmitter has timeout 5.If no ACK within timeout, retransmit 6.If ACK damaged, transmitter will not recognise it, Transmitter will retransmit 7.Receive gets two copies of frame 8.Use ACK0 and ACK1 9.Simple but Inefficient

16 G O B ACK N Based on sliding window If no error, ACK as usual with next frame expected Use window to control number of outstanding frames If error, reply with rejection Discard that frame and all future frames until error frame received correctly Transmitter must go back and retransmit that frame and all subsequent frames 16

17 SELECTIVE REJECT (RETRANSMISSION) Only rejected frames are retransmitted Subsequent frames are accepted by the receiver and buffered Minimizes retransmission Receiver must maintain large enough buffer to reordering. More complex login in transmitter 17

18 E XAMPLE D ATA L INK P ROTOCOLS HDLC – High-Level Data Link Control The Data Link Layer in the Internet 18

19 H IGH -L EVEL D ATA L INK C ONTROL Frame format for bit-oriented protocols. 19

20 H IGH -L EVEL D ATA L INK C ONTROL (2) 20

21 21 FlagAddressControlInformationFCSFlag 8 bits 8 or more bits 8 or 16 bits Variable length, 0 or more bits 16 or 32 bits 8 bits The contents of an HDLC frame are shown in the following table:

22 T HE D ATA L INK L AYER IN THE I NTERNET PPP (Point-to-point protocol) handles error detection, supports multiple protocols, allows IP addresses to be negotiated at connection time. 22

23 PPP – P OINT TO P OINT P ROTOCOL The PPP full frame format for unnumbered mode operation. 23

24 24 Performance of ARQ Stop-and-Wait Flow Control The total time to send the data as T = n(2t prop + t frame ) The utilization, or efficiency, of the line is It is useful to define the parameter a = t prop /t frame. Then

25 25 Error-free sliding-window flow control where W is window size


Download ppt "THE DATA LINK LAYER Chapter 3 1. H YBRID M ODEL The hybrid reference model to be used in this book. 2."

Similar presentations


Ads by Google