Presentation is loading. Please wait.

Presentation is loading. Please wait.

William Stallings Data and Computer Communications Chapter 7 Data Link Control.

Similar presentations


Presentation on theme: "William Stallings Data and Computer Communications Chapter 7 Data Link Control."— Presentation transcript:

1 William Stallings Data and Computer Communications Chapter 7 Data Link Control

2 Flow Control zEnsuring the sending entity does not overwhelm the receiving entity yPreventing buffer overflow zTransmission time yTime taken to emit all bits into medium zPropagation time yTime for a bit to traverse the link

3 Model of Frame Transmission

4 Stop and Wait zSource transmits frame zDestination receives frame and replies with acknowledgement zSource waits for ACK before sending next frame zDestination can stop flow by not send ACK zWorks well for a few large frames

5 Fragmentation zLarge block of data may be split into small frames yLimited buffer size yErrors detected sooner (when whole frame received) yOn error, retransmission of smaller frames is needed yPrevents one station occupying medium for long periods zStop and wait becomes inadequate

6 Stop and Wait Link Utilization

7 Sliding Windows Flow Control zAllow multiple frames to be in transit zReceiver has buffer W long zTransmitter can send up to W frames without ACK zEach frame is numbered zACK includes number of next frame expected zSequence number bounded by size of field (k) yFrames are numbered modulo 2 k

8 Sliding Window Diagram

9 Example Sliding Window

10 Sliding Window Enhancements zReceiver can acknowledge frames without permitting further transmission (Receive Not Ready) zMust send a normal acknowledge to resume zIf duplex, use piggybacking yIf no data to send, use acknowledgement frame yIf data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag (TCP)

11 Error Detection zAdditional bits added by transmitter for error detection code zParity yValue of parity bit is such that character has even (even parity) or odd (odd parity) number of ones yEven number of bit errors goes undetected

12 Cyclic Redundancy Check zFor a block of k bits transmitter generates n bit sequence zTransmit k+n bits which is exactly divisible by some number zReceive divides frame by that number yIf no remainder, assume no error yFor math, see Stallings chapter 7

13 Error Control zDetection and correction of errors zLost frames zDamaged frames zAutomatic repeat request yError detection yPositive acknowledgment yRetransmission after timeout yNegative acknowledgement and retransmission

14 Automatic Repeat Request (ARQ) zStop and wait zGo back N zSelective reject (selective retransmission)

15 Stop and Wait zSource transmits single frame zWait for ACK zIf received frame damaged, discard it yTransmitter has timeout yIf no ACK within timeout, retransmit zIf ACK damaged,transmitter will not recognize it yTransmitter will retransmit yReceive gets two copies of frame yUse ACK0 and ACK1

16 Stop and Wait - Diagram

17 Stop and Wait - Pros and Cons zSimple zInefficient

18 Go Back N (1) zBased on sliding window zIf no error, ACK as usual with next frame expected zUse window to control number of outstanding frames zIf error, reply with rejection yDiscard that frame and all future frames until error frame received correctly yTransmitter must go back and retransmit that frame and all subsequent frames

19 Go Back N - Damaged Frame zReceiver detects error in frame i zReceiver sends rejection-i zTransmitter gets rejection-i zTransmitter retransmits frame i and all subsequent

20 Go Back N - Lost Frame (1) zFrame i lost zTransmitter sends i+1 zReceiver gets frame i+1 out of sequence zReceiver send reject i zTransmitter goes back to frame i and retransmits

21 Go Back N - Lost Frame (2) zFrame i lost and no additional frame sent zReceiver gets nothing and returns neither acknowledgement nor rejection zTransmitter times out and sends acknowledgement frame with P bit set to 1 zReceiver interprets this as command which it acknowledges with the number of the next frame it expects (frame i ) zTransmitter then retransmits frame i

22 Go Back N - Damaged Acknowledgement zReceiver gets frame i and send acknowledgement (i+1) which is lost zAcknowledgements are cumulative, so next acknowledgement (i+n) may arrive before transmitter times out on frame i zIf transmitter times out, it sends acknowledgement with P bit set as before zThis can be repeated a number of times before a reset procedure is initiated

23 Go Back N - Damaged Rejection zAs for lost frame (2)

24 Go Back N - Diagram

25 Selective Reject zAlso called selective retransmission zOnly rejected frames are retransmitted zSubsequent frames are accepted by the receiver and buffered zMinimizes retransmission zReceiver must maintain large enough buffer zMore complex login in transmitter

26 Selective Reject - Diagram

27 High Level Data Link Control zHDLC zISO 33009, ISO 4335

28 Frame Structure zSynchronous transmission zAll transmissions in frames zSingle frame format for all data and control exchanges

29 Frame Structure Diagram

30 Flag Fields zDelimit frame at both ends z01111110 zMay close one frame and open another zReceiver hunts for flag sequence to synchronize zBit stuffing used to avoid confusion with data containing 01111110 y0 inserted after every sequence of five 1s yIf receiver detects five 1s it checks next bit yIf 0, it is deleted yIf 1 and seventh bit is 0, accept as flag yIf sixth and seventh bits 1, sender is indicating abort

31 Bit Stuffing zExample with possible errors

32 Required Reading zStallings chapter 7 zWeb sites on HDLC, frame relay, Ethernet and ATM


Download ppt "William Stallings Data and Computer Communications Chapter 7 Data Link Control."

Similar presentations


Ads by Google