300 likes | 437 Views
DATA COMMUNICATION (ELA…). DATA LINK CONTROL PROTOCOLS. Introduction. Synchronization and Interfacing are insufficient due to Probability of transmission errors Need of receiver to regulate arrival rate of data Layer of logic is added Data Link Control Key mechanisms. FLOW CONTROL.
E N D
DATA COMMUNICATION(ELA…) DATA LINK CONTROL PROTOCOLS
Introduction • Synchronization and Interfacing are insufficient due to • Probability of transmission errors • Need of receiver to regulate arrival rate of data • Layer of logic is added • Data Link Control • Key mechanisms
Flow Control Stop Begin No More data to Tx? Yes Rcv Data from Tx Clear Buffer Is there buffer capacity left? Stop Rcv’ng Data from Tx No Yes Process Data Transfer Data to next upper layer
Flow Control • Definitions • Transmission time • Time taken to emit all bits onto the medium • Proportional to length of frame • Propagation time • Time for a bit to traverse the link • Options • Stop-and-Wait • Sliding Window
Stop-and-Wait Flow Control • How does it work? • Source transmits frame • Destination receives frame and replies with acknowledgement • Source waits for ACK before sending next frame • Destination can stop flow by not sending ACK • Works well for a few large frames • Not good when fragmentation is used
d/V Rd a = = = L/R VL Propagation Time Transmission Time Performance Issues Where • d Link distance (m) • V Velocity of propagation (m/s) • L Length of frame in bits • R Data Rate (bps)
Stop-and-Wait – Link Utilization Tx Time = 1, Propagation time = a a < 1 a > 1
Sliding Window Flow Control • How does it work? • Allows multiple frames to be in transit • Receiver has buffer of length = W • 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
Sliding Window Enhancements • Receiver can acknowledge frames without permitting further transmission • RNR Receive Not Ready • Must send a normal ACK to resume • If duplex, use piggybacking • If no data to send, use ACK frame • If data but no ACK to send • Send last ACK number again, or have ACK valid flag (TCP)
Error Control • Detection and correction of errors • Lost frames • Damaged frames • Automatic Repeat Request • Error detection • Positive acknowledgment • Retransmission after timeout • Negative acknowledgement and retransmission
Automatic Repeat Request (ARQ) • These techniques are all based on either Stop-and-wait or Sliding Window flow control techniques • Stop-and-wait ARQ • Go-back-N ARQ • Selective reject ARQ • Selective retransmission
…. …. t<To t=To t=To t<To F(0) F(1) F(1) F(1) ACK(0) ACK(0) ACK(1) F(0) F(1) F(1) Duplicate detected/ discarded Stop-and-Wait ARQ • Basic Operation t T t R
Stop-and-Wait ARQ • Pros and Cons • Simple • Inefficient • Referred to as Idle RQ
Go-Back-N ARQ • Most common implementation of Sliding Window flow control • Uses window to control number of outstanding frames • If no error, ACK as usual with next frame expected • If error, reply with rejection (REJ) • Discard that frame and all future frames until error frame received correctly • Transmitter must go back and retransmit that frame and all subsequent frames
Selective Reject • Also called selective retransmission • Advantages • Only rejected frames are retransmitted • Subsequent frames are accepted by the receiver and buffered • Minimizes retransmission • Disadvantages • Receiver must maintain large enough buffer • More complex logic in transmitter
Performance Issues • Stop-and-Wait Flow Control (No Errors) • A sends a frame to B • After receiving frame, B sends and ACK to A • Process is repeatedntimes • Thus, total time to transmit n frames can be expressed as • Where • TF Time to send a frameand receive and ACK
Performance Issues Where • tprop Propagation time from A to B • tframe Time to transmit a frame • tproc Processing time at each station • tack Time to transmit and ACK
Performance Issues • Since a = tprop / tframe
Performance Issues • Sliding Window Flow Control (No Errors)
Performance Issues • Stop-and-Wait ARQ (With Errors) • Where Nr Expected # of transmissions of a frame
Performance Issues • Selective Reject ARQ (With Errors)
Performance Issues • Go-back-N ARQ (With Errors)