the data link layer

28
THE DATA LINK LAYER Chapter 3 1

Upload: desirae-wheeler

Post on 02-Jan-2016

35 views

Category:

Documents


1 download

DESCRIPTION

THE DATA LINK LAYER. Chapter 3. Hybrid Model. The hybrid reference model to be used in this book. Functions of the Data Link Layer. Data Link Layer Design Issues. Services Provided to the Network Layer Framing (Packetizing) Physical addressing Error Control Flow Control Access control. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: THE DATA LINK LAYER

THE DATA LINK LAYER

Chapter 3

1

Page 2: THE DATA LINK LAYER

HYBRID MODEL

The hybrid reference model to be used in this book.2

Page 3: THE DATA LINK LAYER

FUNCTIONS OF THE DATA LINK LAYER

3

Page 4: THE DATA LINK LAYER

DATA LINK LAYER DESIGN ISSUES

• Services Provided to the Network Layer

• Framing (Packetizing)• Physical addressing• Error Control• Flow Control• Access control.

4

Page 5: THE DATA LINK LAYER

SERVICES PROVIDED TO NETWORK LAYER

• 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 servicea connection established, frames are numbed.reliable transmission guaranteed.

5

Page 6: THE DATA LINK LAYER

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 stuffing3.Starting and ending flags, with bit stuffing.

4.Physical layer coding violations. 6

Page 7: THE DATA LINK LAYER

FRAMING (PACKETIZING)

7

Page 8: THE DATA LINK LAYER

FRAMING (2)

(a) A frame delimited by flag bytes.(b) Four examples of byte sequences before and after

stuffing.

8

Page 9: THE DATA LINK LAYER

FRAMING (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.9

Page 10: THE DATA LINK LAYER

10

Ensuring the sending entity does not overwhelm the receiving entity

Feedback-based flow control

Flow Control

Rate-based flow control (network layer)

Page 11: THE DATA LINK LAYER

STOP AND WAIT

11

Only one frame at a time can be in transit. 1.Source transmits frame2.Destination receives frame and replies with acknowledgement (if it is correct, otherwise send NAK.)3.Source waits for ACK before sending next frame4.Destination can stop flow by not send ACK5.Source can retransmit if got a NAK.6.Works well for a few large frames7.Inefficient line utilization for small frames

Page 12: THE DATA LINK LAYER

SLIDING WINDOW PROTOCOLS

12

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 2k

Page 13: THE DATA LINK LAYER

EXAMPLE SLIDING WINDOW

13

Page 14: THE DATA LINK LAYER

SLIDING WINDOW PROTOCOLS (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.

14

Page 15: THE DATA LINK LAYER

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 detectionPositive acknowledgmentRetransmission after timeoutNegative acknowledgement

15

Page 16: THE DATA LINK LAYER

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.

16

Page 17: THE DATA LINK LAYER

ERROR CONTROL SCHEME

17

Page 18: THE DATA LINK LAYER

STOP-AND –WAIT ARQ

18

1. Source transmits single frame

2. Wait for ACK3. If received frame

damaged, discard it4. Transmitter has timeout5. If no ACK within timeout,

retransmit6. If ACK damaged,

transmitter will not recognise it, Transmitter will retransmit

7. Receive gets two copies of frame

8. Use ACK0 and ACK19. Simple but Inefficient

Page 19: THE DATA LINK LAYER

GO BACK 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

19

Page 20: THE DATA LINK LAYER

SELECTIVE REJECT (RETRANSMISSION)

Only rejected frames are retransmittedSubsequent frames are accepted by the

receiver and bufferedMinimizes retransmissionReceiver must maintain large enough

buffer to reordering.More complex login in transmitter

20

Page 21: THE DATA LINK LAYER

EXAMPLE DATA LINK PROTOCOLS

• HDLC – High-Level Data Link Control

• The Data Link Layer in the Internet

21

Page 22: THE DATA LINK LAYER

HIGH-LEVEL DATA LINK CONTROL

Frame format for bit-oriented protocols.

22

Page 23: THE DATA LINK LAYER

HIGH-LEVEL DATA LINK CONTROL (2)

23

Page 24: THE DATA LINK LAYER

24

Flag AddressControl

Information FCS Flag

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:

Page 25: THE DATA LINK LAYER

THE DATA LINK LAYER IN THE INTERNET

PPP (Point-to-point protocol) handles error detection, supports multiple protocols, allows IP addresses to be negotiated at connection time.

25

Page 26: THE DATA LINK LAYER

PPP – POINT TO POINT PROTOCOL

The PPP full frame format for unnumbered mode operation.

26

Page 27: THE DATA LINK LAYER

27

Performance of ARQ

Stop-and-Wait Flow Control

The total time to send the data as T = n(2tprop + tframe)

The utilization, or efficiency, of the line is

)2( frameprop

frame

ttn

tnu

It is useful to define the parameter a = tprop/tframe .

Then

au

21

1

Page 28: THE DATA LINK LAYER

28

Error-free sliding-window flow control

2a1W 21

2a1W 1

a

Wu where W is window size