160 likes | 185 Views
Communication Networks. Recitation 8 ARQ Protocols & Performance. Error Control. Automatic Repeat Request (ARQ) Error detection Acknowledgement (ACK) Retransmission after timeout Negative acknowledgement (NACK). t tran. DATA. t prop. ACK. DATA. NACK. Pipelining.
E N D
Communication Networks Recitation 8 ARQ Protocols & Performance Comnet 2006
Error Control Automatic Repeat Request (ARQ) • Error detection • Acknowledgement (ACK) • Retransmission after timeout • Negative acknowledgement (NACK) ttran DATA tprop ACK DATA NACK Comnet 2006
Pipelining Acknowldegementarrives every msec Networkperformance 100% Packet arrives every msec Comnet 2006
Sliding Window Flow Control • Allow multiple frames to be in transit • Receiver may have a buffer W long • Transmitter can send up to W frames without ACK • Each frame is numbered • ACK includes number of frame • Sequence number bounded by k bits • frames are numbered modulo 2k Comnet 2006
Sender Perspective Window of frames that may be transmitted Frames already acknowledged …. …. 1 0 3 3 0 6 6 4 4 1 1 7 4 5 1 2 7 4 5 2 2 6 6 0 2 5 5 3 3 0 Frame sequence numbers Last frame acknowledged Window shrinks from trailing edge as frames are acknowledged Window expands from leading edge as ACKs received Window of frames that may be transmitted Window expands from leading edge as ACKs are sent Window shrinks from trailing edge as frames are received Last frame acknowledged Sliding Window …. …. Receiver Perspective Frames already received Comnet 2006
F1 F0 F6 F5 F4 F3 F2 0 4 1 1 4 6 0 3 3 0 6 3 0 4 3 4 6 6 6 1 1 6 3 4 4 1 3 0 0 0 6 1 4 4 6 1 1 1 0 4 6 3 3 0 3 1 5 1 5 7 7 1 2 4 4 2 2 2 1 7 2 5 7 5 4 4 1 5 7 1 2 4 5 1 4 7 1 1 4 5 7 7 2 4 7 4 2 2 5 5 0 0 6 2 3 3 5 5 5 3 6 0 0 2 3 2 0 5 5 6 2 6 2 5 6 2 6 6 2 0 0 2 5 0 3 6 5 3 2 0 5 3 3 3 6 ACK 2 …. …. …. …. …. …. …. …. …. …. …. …. …. …. …. …. …. …. ACK 3 Sliding Window: Example Comnet 2006
Go Back N • Based on sliding window • If no error, ACK as usual with frame sequence number • 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 Comnet 2006
Timeout Interval 0 5 3 3 8 1 4 9 4 6 2 7 10 5 5 6 7 8 2 3 4 ACK 0 ACK 1 ACK 2 ACK 3 ACK 4 ACK 5 ACK 6 ACK 7 0 1 E D D D D D D 2 6 7 8 Frames discarded by data link layer Error Go-Back-N: Example Time Comnet 2006
Selective Repeat • Only rejected frames are retransmitted • Subsequent frames are accepted by the receiver and buffered • Minimizes retransmission • Receiver must maintain large enough buffer • More complex login in sender Comnet 2006
Selective Repeat Example Transmitter (Primary) 0 1 2 3 4 5 2 6 0 ACK 1 ACK 0 ACK 3 ACK 4 ACK 5 ACK 2 Receiver (Secondary) 0 1 E 3 4 5 2 6 Frames 2-5 released Error Buffered by receiver Comnet 2006
Selective Repeat: Window Size Sequence Number space >= 2 Window Size 0 1 2 3 4 5 TIMEOUT 6 7 ACK 0 Comnet 2006
Performance: Notation • TRANS = Frame transmission time • PROP = Link propagation delay • a = PROP/TRANS • Probability of Frame error in Sender-Receiver direction is P<<1 • Probability of Frame error in Receiver-Sender direction is 0 • W = Number of frames per window • Nr: average number of transmissions of an original frame Comnet 2006
Performance: Notation • TRANS = Frame transmission time • PROP = Link propagation delay • a = PROP/TRANS • Probability of Frame error in Sender-Receiver direction is P<<1 • Probability of Frame error in Receiver-Sender direction is 0 • Number of frames per window = W. • Simplifying assumption: Use NACKs Comnet 2006
Performance: No Errors • Frames transmitted = 2a + 1 if W > 2a + 1 = W otherwise • W >= 2a + 1 • Link is always utilized (U = 1) • W < 2a + 1 • U = W/(2a + 1) Comnet 2006
Performance: Unreliable LinkSelective Repeat • Number of retransmissions: Nr= i Pi-1(1-P)=1/(1-P) U = (1 – P) if (W > 1 +2a) W (1 – P) / (1 + 2a) if (W <= 1 +2a) Comnet 2006
Performance: Unreliable LinkG-Back-N • Number of frames retransmitted: 1+2a If (W > 1 +2a) W if (W <= 1 +2a) U = (1 – P)/(1 + 2aP) if (W > 1 +2a) W (1 – P) / [(1 + 2a) (1-P+WP)] if (W <= 1 +2a) Comnet 2006