Networks and Protocols Data Link and Flow Control

  • Slides: 23
Download presentation
Networks and Protocols Data Link and Flow Control Prepared by: TGK First Prepared on:

Networks and Protocols Data Link and Flow Control Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute of Information Technology

Topic & Structure of the lesson Data Link and Flow Control n n Networks

Topic & Structure of the lesson Data Link and Flow Control n n Networks and Protocols Overview of Data Link Control and Flow Control Mechanisms Flow Control Techniques Error Detection Techniques Error Control Techniques Slide 2 of 27

Learning Outcomes Data Link and Flow Control At the end of this module, YOU

Learning Outcomes Data Link and Flow Control At the end of this module, YOU should be able to: • Discuss Asynchronous and Synchronous communications • Discuss Stop-and-Wait and Sliding Windows flow-control techniques • Discuss the Parity check and Cyclic Redundancy Check approaches for error detection • Discuss error control techniques of Automatic Repeat Request Stop-and-Wait, Sliding Window and Selective Reject Networks and Protocols Slide 3 of 27

Key Terms you must be able to use Data Link and Flow Control If

Key Terms you must be able to use Data Link and Flow Control If you have mastered this topic, you should be able to use the following terms correctly in your assignments and exams: • • • Flow Control Error Detection Error Control Networks and Protocols Slide 4 of 27

Main Teaching Points Data Link and Flow Control • • • SYNC characters START

Main Teaching Points Data Link and Flow Control • • • SYNC characters START and STOP Bits ACK status Sliding Windows ODD and EVEN parity Automatic Repeat Request Stop-and-Wait ARQ Sliding Window Selective Reject Networks and Protocols Slide 5 of 27

Overview of Data Link Control and Flow Control Mechanisms Data Link and Flow Control

Overview of Data Link Control and Flow Control Mechanisms Data Link and Flow Control • Synchronous Communications • Receiver clock operates in synchronism with the received signal • The clocking signal is embedded into the transmitted bit stream and subsequently extracted by the receiver (SYN characters) • Asynchronous Communications • The receiver’s clock runs asynchronously with respect to incoming signal • Networks and Protocols A Byte is framed by a START and STOP bit Slide 6 of 27

Overview of Data Link Control and Flow Control Mechanisms Data Link and Flow Control

Overview of Data Link Control and Flow Control Mechanisms Data Link and Flow Control • The START bit changes the signal to Non-Idle state, this warns receiver a byte is arriving • Eight (8) data bits follow • The STOP bit follows the data bits and returns the signal to the Idle state Networks and Protocols Slide 7 of 27

Flow Control Techniques Data Link and Flow Control • Stop-and-Wait • Source transmits frame

Flow Control Techniques Data Link and Flow Control • Stop-and-Wait • Source transmits frame • Destination receives frame and replies with acknowledgement • • Source waits for ACK before sending next frame • Destination can stop flow by not send ACK • Works well for a few large frames Sliding Windows Networks and Protocols • Allow multiple frames to be in transit • Receiver has buffer W long • Transmitter can send up to W frames without ACK Slide 8 of 27

Flow Control Techniques Data Link and Flow Control • Allow multiple frames to be

Flow Control Techniques Data Link and Flow Control • 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 • Following figure shows the sliding-windows technique operation: Networks and Protocols Slide 9 of 27

Flow Control Techniques Data Link and Flow Control Networks and Protocols Slide 10 of

Flow Control Techniques Data Link and Flow Control Networks and Protocols Slide 10 of 27

Flow Control Techniques Data Link and Flow Control • Sliding Windows Enhancements • Receiver

Flow Control Techniques Data Link and Flow Control • Sliding Windows Enhancements • Receiver can acknowledge frames without permitting further transmission (Receive Not Ready) • Must send a normal acknowledge to resume • If duplex, use piggybacking Networks and Protocols § If no data to send, use acknowledgement frame § If data but no acknowledgement to send, send last acknowledgement number again, or have ACK valid flag (TCP) Slide 11 of 27

Error Detection Techniques Data Link and Flow Control • Parity Check • Additional bits

Error Detection Techniques Data Link and Flow Control • Parity Check • Additional bits added by transmitter for error detection code • Parity • Value of parity bit is such that character has even (even parity) or odd (odd parity) number of ones • • Networks and Protocols Even number of bit errors goes undetected Example : Odd parity Check 1+ 11011 111011(data will be accepted) 1+ 11011 110011(reject because single bit error)

Error Detection Techniques Data Link and Flow Control • Disadvantage: • 1+11011 111000(data will

Error Detection Techniques Data Link and Flow Control • Disadvantage: • 1+11011 111000(data will be accepted) but the message has burst error • Cyclic Redundancy Check • For a block of k bits transmitter generates n bit sequence • Transmit k+n bits which is exactly divisible by some number • Receive divides frame by that number • Networks and Protocols If no remainder, assume no error Slide 13 of 27

Error Control Techniques Data Link and Flow Control • • Automatic Repeat Request •

Error Control Techniques Data Link and Flow Control • • Automatic Repeat Request • Detection and correction of errors • Lost frames • Damaged frames • Features: • Positive acknowledgment • Retransmission after timeout • Negative acknowledgement and retransmission Techniques adopted: Networks and Protocols • Stop and Wait ARQ • Sliding window • Selective reject (selective retransmission) Slide 14 of 27

Error Control Techniques Data Link and Flow Control • • Techniques adopted: • Stop

Error Control Techniques Data Link and Flow Control • • Techniques adopted: • Stop and wait ARQ • Sliding window • Selective reject (selective retransmission) Stop and Wait ARQ Networks and Protocols • Source transmits single frame • Wait for ACK • If received frame damaged, discard it • Transmitter has timeout • If no ACK within timeout, retransmit

Error Control Techniques Data Link and Flow Control • • If ACK damaged transmitter

Error Control Techniques Data Link and Flow Control • • If ACK damaged transmitter will not recognize it • Transmitter will retransmit • Receive gets two copies of frame • Use ACK 0 and ACK 1 Go-Back-N ARQ • 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 Networks and Protocols Slide 16 of 27

Error Control Techniques Data Link and Flow Control • Transmitter must go back and

Error Control Techniques Data Link and Flow Control • Transmitter must go back and retransmit that frame and all subsequent frames • • Go-Back-N ARQ - Damaged Frame • Receiver detects error in frame i • Receiver sends rejection-i • Transmitter gets rejection-i • Transmitter retransmits frame i and all subsequent Go-Back-N ARQ - Lost Frame Networks and Protocols • Frame i lost • Transmitter sends i+1 • Receiver gets frame i+1 out of sequence Slide 17 of 27

Error Control Techniques Data Link and Flow Control • • Receiver send reject i

Error Control Techniques Data Link and Flow Control • • Receiver send reject i • Transmitter goes back to frame i and retransmits Selective Reject ARQ • Also called selective retransmission • Only rejected frames are retransmitted • Subsequent frames are accepted by the receiver and buffered Networks and Protocols • Minimizes retransmission • Receiver must maintain large enough buffer • More complex logic in transmitter Slide 18 of 27

Quick Review Question Data Link and Flow Control Networks and Protocols Slide 19 of

Quick Review Question Data Link and Flow Control Networks and Protocols Slide 19 of 27

Follow Up Assignment Data Link and Flow Control Networks and Protocols Slide 20 of

Follow Up Assignment Data Link and Flow Control Networks and Protocols Slide 20 of 27

Summary of Main Teaching Points Data Link and Flow Control Networks and Protocols Slide

Summary of Main Teaching Points Data Link and Flow Control Networks and Protocols Slide 21 of 27

Question and Answer Session Data Link and Flow Control Q&A Networks and Protocols Slide

Question and Answer Session Data Link and Flow Control Q&A Networks and Protocols Slide 22 of 27

Next Session Data Link and Flow Control Topic and Structure of next session •

Next Session Data Link and Flow Control Topic and Structure of next session • Routing n n n Networks and Protocols Routing characteristics Routing strategies Routing algorithms Slide 23 of 27