550 likes | 797 Views
Stop and Wait Automatic Repeat Request. This is a simple data link layer protocol. It is implemented using acknowledgement for error free frame and retransmission on timeout. it is further optimized using sequence numbers in frames and acknowledgements. Course Name: Communication Networks.
E N D
Stop and WaitAutomatic Repeat Request This is a simple data link layer protocol. It is implemented using acknowledgement for error free frame and retransmission on timeout. it is further optimized using sequence numbers in frames and acknowledgements. Course Name: Communication Networks Authors Amita Shinde Mentor Prof. Sarvanan
Learning Objectives • After interacting with this Learning Object, the learner will be able to; • Describe simple Automatic Repeat Request Stop and Wait Protocol • Identify various problems occurring during transmission while implementing Stop and Wait ARQ and mechanisms to solve them. • Estimating timeout period for optimum transmission.
Theory button content :Transmitter Flowchart Start N=0 Transmit Nth Frame + Seq. No. N Start Timer Received Ack.? No No Yes Error Free ACK? Timeout? Yes No Yes Is ACK Seq. No. = N+1 No Yes N= N+1 End of Frames? No Note for animator: Colours/ positions/design etc. are suggestive and will be finalized by designer Yes Stop
Theory button content :Receiver Flowchart Start Next Frame Expected No. = N Received Frame.? No Yes Is Frame Error Free ? No Yes Reject Frame Is Frame Seq. No. =N? No Yes Accept Frame ‘N’ Transmit Acknowledgement + Seq. No. N+1 N = N+1 Note for animator: Colours/ positions/design etc. are suggestive and will be finalized by designer
Master Layout 1 1 1 ACK ACK C R C C R C 0 C R C C R C 0 Source Destination C1 C2 Frame path Error Check Frame channel C3 C4 Ack channel Error Check Ack path Transmitter Receiver Time 01 Time-line
H 1 ACK ACK C R C C R C C R C C R C C R C C R C C R C C R C C R C C R C 3 0 1 0 0 0 0 2 Elements of Master Layout 1 Transmitter time line Arrow a1 Arrow a3 Arrow a2 Arrow a4 Timeline 4 Timeline 1 Timeline 2 Timeline 3 Arrow f2 Arrow f1 Arrow f3 Arrow f 0 Receiver time line C R C H Frame Frame 0 Packet Frame 1 H Header Ack with sequence no. Frame 2 C R C CRC 1 Ack Sequence No. Frame 3 Ack 0 Frame Sequence no. ACK Ack Packet Frame with sequence no. C R C 0 Note for animator: Colours/ positions/design etc. are suggestive and will be finalized by designer
Elements of Master Layout 1 P2 P1 Image i/p Image o/p P4 P3 Instructions to illustrator: Image i/p & o/p should be same size. P1,p2,p3,p4 are parts of i/p image…all of equal size & 1/4th of i/p image i/p image & p1,p2,p3,p4 are same for all screens. Only, o/p image may vary as shown. P1,p2,p3,p4 make o/p image Note for animator: Colours/ positions/design etc. are suggestive and will be finalized by designer
Master Layout 2 1 1 ACK ACK C R C C R C 0 C R C C R C 0 Source Destination Duplicate frame Duplicate ack status message : indicates duplicate ackin ack error, frame & ack seq. no. early timeout status message : indicates duplicate frames in ack error, early timeout etc. Noise image ( like lightening) In frame error, ack error , early timeout & next frame error C1 0 Next Frame Expected C2 Frame path Error Check 1 Expected Ack. No Frame channel C3 C4 Ack channel Error Check Ack path Transmitter Receiver Time 01 Time-line Timeout status message : indicates timeout event In frame error onwards Note for animator: Colours/ positions/design etc. are suggestive and will be finalized by designer
Elements of master layout 2 in addition to the master layout 1 Noise Duplicate frame Duplicate ack or Timeout Noise image ( like lightening) In frame error, ack error , early timeout & next frame error status message : indicates duplicate ackin ack error, frame & ack seq. no. early timeout status message : indicates duplicate frames in ack error, early timeout etc. status message : indicates timeout event In frame error onwards Transparent color used to show that frame is passing ‘through’. A rectangle or hollow cube can be show. Compare Consecutive Error Check No. indicating next frame expected. Start with 0 increment by 1 up to 3 as every frame passes through it. The number digit in frame should coincide with this digit while passing. No. indicating next ack expected. Start with 1. increment as every ack passes through it up to 3 The number digit in frame should coincide with this digit while passing. 0 Next Frame Expected 1 Expected Ack. No Note for animator: Colours/ positions/design etc. are suggestive and will be finalized by designer. Refer to these elements from step 4 onwards. All elements are not used at every step. Elements are added at every step as shown in the step itself.
List of animations: Step 3 Ideal Case Step 4 Frame Error Acknowledgement Error Step 5 Step 6 Early Timeout Step 8 Comparison of consecutive content! Step 9 Frame Sequence Number Step 10 Frame Sequence Number: Acknowledgement Error Step 11 Frame Sequence Number: Early Timeout Frame Sequence Number: Early Timeout & Next Frame Error Step 12 Step 13 Frame & Acknowledgement Sequence Number Frame & Acknowledgement Sequence Number: Early Timeout & Next Frame Error Step 14 Step 15 1 bit sequence number Note for animator: This is for animator’s reference. Can be used in drop-down menu.
Step 1 Introduction The basic principle behind automatic repeat request (ARQ) is to initiate frame retransmissions when errors are detected in the received frame. Retransmissions are initiated using a combination of timeouts and acknowledgements. Stop-and-wait ARQ (SW ARQ) is the simplest ARQ protocol. When a source node sends a frame, it starts a timer and waits for an acknowledgement (ACK) from the destination. If the destination node receives a frame in which no errors are detected, it sends an ACK frame back to the sender informing it of error-free frame reception. Once an ACK for a frame arrives at the source, the next frame is transmitted. If errors are detected in the frame, then the destination does nothing. If the timer at the source exceeds a predetermined threshold, a timeout event is declared and the frame is resent. This simple process further imposes some problems, you can learn about these problems and the mechanisms used to solve them, step by step. Instructions to animator: This will be the very first introduction screen as the user opens this animation.
Step 2 The image is to be accurately transmitted from source to destination using Stop and Wait ARQ. The image is divided in four parts & transmitted as four consecutive frames. Observe how Stop and Wait ARQ protocol achieves accurate transmission of this image to the destination. Error Check Error Check Transmitter Receiver Transmitter Receiver
ACK ACK ACK ACK C R C C R C C R C C R C H H H H C R C C R C C R C C R C Step 3 Ideal Case Error Check C R C H C R C C R C C R C H H H Error Check Transmitter Receiver Transmitter Receiver
Step 3 Ideal Case
Step 3 Ideal case
C C ACK ACK ACK ACK C C Step 4 Frame Error Don’t stack the Frames. Make them disappear after reaching here and make p1 through p4 appear ACKs don’t exist here from beginning. They appear 1 by 1 & move C Don’t stack the ACK. Make them disappear after reaching here C C C C Noise Error Check Error Check Receiver Transmitter Timeout
Step 4 Frame Error
Don’t stack the Frames. Make them disappear after reaching here C C ACK ACK ACK ACK ACK C C Step 5 Acknowledgement Error Duplicate frame C C C Don’t stack the ACK. Make them disappear after reaching here C C C Error Check Error Check Noise Receiver Transmitter Timeout Find Solution
Step 5 Acknowledgement Error
C C ACK C C C Step 6 Early Timeout Duplicate frame C C C Error Check Error Check Receiver Transmitter Timeout Find Solution
Step 6 Early Timeout
Step 7 Can you suggest a solution to solve this problem? Compare content of consecutive frames at receiver & discard if it is same. Add a sequence no. to each frame & verify the same at the receiver..
H H H H ACK ACK ACK ACK C C C C H H H H C R C C R C C R C C R C Step 8 Comparison Receiver Transmitter Buffer Duplicate Error Check Error Check
Step 8 Comparison
Step 9 ACK C R C 0 C R C Frames with Seq. No. Receiver Transmitter Expected Fame No. =0 Expected Fame No. =1 Error Check C R C 0 Error Check
Step 9 Frames with Seq. No.
C 3 C 2 ACK ACK ACK ACK ACK C 1 C 0 Step 10 Frame Sequence No. : Acknowledgement Error No match C C 3 C 2 C 1 C 1 Next Frame Expected 0 C 0 1 2 3 Error Check Error Check Noise Receiver Timeout Frame with Sequence no. 2 received Frame sequence no. not matched Acknowledgement received successfully! Image reached destination successfully! Frame sequence number ‘1’ received successfully! Acknowledgement corrupted , hence rejected! Frame sequence number ‘0’ received successfully! Acknowledgement received successfully! Frame with sequence no. 1 retransmitted
Step 10 Frame Sequence No. : Acknowledgement Error
C 2 ACK ACK ACK ACK ACK C 1 C 0 Step 11 Frames with Sequence No.: Early Timeout No Match C 3 C 2 C 1 0 1 3 Next Frame Expected 2 C 0 c 0 Error Check Error Check Receiver Timeout Timer
Step 11 Frame Sequence No. Early Timeout
C 3 C 2 ACK ACK C 1 C 0 Step 12 Frames with Sequence No.: Early Timeout, Next Frame Error No Match No Match c 3 C 2 C 2 c 1 1 0 Next Frame Expected 0 C c 0 Error Check Error Check Receiver Transmitter Timeout Timeout Timer
Step 12 Frames with Sequence No.: Early Timeout, Next Frame Error
C 3 C 2 2 4 3 1 ACK ACK ACK ACK C 1 C 0 Step 13 Frames and Acknowledgements with Sequence No. C 3 C 2 C 1 0 2 1 3 4 4 Next Frame Expected 3 1 Next Ack Expected 2 C 0 Error Check Error Check Transmitter Receiver
Step 13 Frames and Acknowledgements with Sequence No
Step 14 C 3 C 2 1 1 ACK ACK C 0 Frames and Acknowledgements with Sequence No. : Early Timeout, NFE No Match No Match 3 C 1 C 1 C 0 1 Next Frame Expected 1 2 Next ACK Expected 0 C 0 C Error Check Error Check Receiver Timeout Timeout Timeout
Step 14 Frames and Acknowledgements with Sequence No. : Early Timeout, NFE
C 1 C 0 0 1 1 0 ACK ACK ACK ACK C 1 C 0 Step 15 Frames and Acknowledgements with 1 bit Sequence No. C 1 c 0 C 1 1 0 Next Frame Expected 0 1 Next Ack Expected C 0 Error Check Error Check Transmitter Receiver
Step 15 Frames and Acknowledgements with 1 bit Sequence No
Interactivity Step 1 H ACK C R C H C R C .Observe the detailed timing diagram of frame transmission. Tf+Tp+2τ Error Check t=0 Tp Ta Tf τ τ Frame Ack Error Check Ta+Tf+Tp+2τ Tf+τ C R C C R C H Tf+Tp+τ τ Receiver Ta+Tf+Tp+τ Transmitter RTT = 2τ + Tf + Ta +Tp Glossary
Interactivity Step 2 When this image is transmitted using simple stop and wait ARQ, an error is detected in the 2nd frame. The round trip time (RTT) for each frame is 100. Three options of timeout duration (80,100,120) are available. Observe the transmission using all 3 values one by one. Does this value affect the image reaching destination? According to you, which value gives maximum throughput with accurate transmission? Timeout duration 80 100 120 Error Check Error Check Transmitter Receiver Transmitter Receiver
Glossary button content (Propagation Delay): Time taken by a single bit to reach from one node to the other, say from source to destination τ Tf (Transmit Duration of the frame): Time required to put all frame bits on the channel. Ta (Transmit duration of the ACK): Time required to put all ACK bits on the channel. Tp(Processing delay): Delay between the reception of the frame at the destination and the start of the ACK transmission. RTT (Round Trip Time): Time taken to transmit a frame and receive an acknowledgement when no errors are introduced by the channel. Round-trip time (RTT)= Propagation delays + Transmit duration + Processing delays RTT = 2τ + Tf + Ta +Tp
Questionnaire Q 1 A timer is started at the beginning of frame transmission. What should be the duration for timeout? Timeout duration > Round Trip Time (RTT) Timeout duration < Round Trip Time (RTT) Instructions to animator: 1st answer (in green) is correct. Show positive feedback if correct answer is selected. Give negative feedback for wrong answer selected. Use same interactivity for all questions ( either the suggested animation or radio button etc.)
Questionnaire Q 2 Observe the images. The source image is transmitted in 4 consecutive packets without sequence numbers. However, the image generated at destination is shown here. It doesn’t match with the source image exactly. Which sequence of events would have caused this? Destination image 4 packets transmitted Source image Error detected in ACK and next frame Early timeout and error detected in retransmitted frame Error detected in ACK Early timeout and error detected in next frame Instructions to animator: 4th is correct answer. Show positive feedback if correct answer is selected. Give negative feedback for wrong answer selected.
Questionnaire Q 3 When frames and acknowledgements are sent on a noiseless channel with sequence numbers and timeout duration is less than half of RTT; Every frame will be transmitted only once. Every frame will be transmitted at least thrice. 1st frame will be transmitted twice. 1st frame will be transmitted at least thrice and next frames only once.. Instructions to animator: 2nd answer (in green) is correct. Show positive feedback if correct answer is selected. Give negative feedback for wrong answer selected. Use same interactivity for all questions ( either the suggested animation or radio button etc.)
Questionnaire Q 4 The following image is transmitted in four parts as shown; using a mechanism for comparing consecutive frame content. How would received image look? a b d c Instructions to animator: ‘d’ is correct answer. Show positive feedback if correct answer is selected. Give negative feedback for wrong answer selected. Use same interactivity for all questions ( either the suggested animation in Q1 or radio button etc.)
Questionnaire Q 5 Match the problem with appropriate mechanism used to solve the problem. A. Frame sequence number 1. Frame received with error B. Retransmit frame 2. A frame duplicated and next frame lost 3. Duplicate frames received C. Frame and ACK sequence number 1-A, 2-B, 3-C Instructions to animator: ‘3rd option (in green) is correct answer. Show positive feedback if correct answer is selected. Give negative feedback for wrong answer selected. Use same interactivity for all questions ( either the suggested animation in Q1 or radio button etc.) 1-C, 2-B, 3-A 1-B, 2-C, 3-A 1-B, 2-A, 3-C
References Alberto Leon-Garcia, Indra Widjaja, Communication Networks: Fundamental Concepts and Key architectures, Tata McGraw-Hill, 2nd edition, 2004. Andrew S. Tanenbaum, Computer networks, Pearson Prentice Hall, 4th edition,2003.