{"id":28365,"date":"2017-09-06T01:22:15","date_gmt":"2017-09-05T19:52:15","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=28365"},"modified":"2017-09-06T01:24:27","modified_gmt":"2017-09-05T19:54:27","slug":"stop-wait-arq","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/stop-wait-arq\/","title":{"rendered":"Stop and Wait ARQ"},"content":{"rendered":"<h3 id=\"characteristics\">Characteristics<\/h3>\n<ul>\n<li>Used in Connection-oriented communication.<\/li>\n<li>It offers error and flow control<\/li>\n<li>It is used in Data Link and Transport Layers<\/li>\n<li>Stop and Wait ARQ mainly implements Sliding Window Protocol concept with Window Size 1<\/li>\n<\/ul>\n<h3 id=\"useful-terms\">Useful Terms:<\/h3>\n<ul>\n<li><strong>Propagation Delay: <\/strong>Amount of time taken by a packet to make a physical journey from one router to another router.<\/li>\n<\/ul>\n<p>Propagation Delay = (Distance between routers) \/ (Velocity of propagation)<\/p>\n<ul>\n<li>RoundTripTime (<strong>RTT<\/strong>) = 2* Propagation Delay<\/li>\n<li>[ad type=&#8221;banner&#8221;]<\/li>\n<li>TimeOut (<strong>TO<\/strong>) =\u00a0 2* RTT<\/li>\n<li>Time To Live (<strong>TTL<\/strong>) = 2* TimeOut. (Maximum TTL is 180 seconds)<\/li>\n<\/ul>\n<h3 id=\"simple-stop-and-wait\"><u>Simple Stop and Wait<\/u><\/h3>\n<h4 id=\"sender\">Sender:<\/h4>\n<p>Rule 1) Send one data packet at a time.<br \/>\nRule 2) Send next packet only after receiving acknowledgement for previous.<\/p>\n<h4 id=\"receiver\">Receiver:<\/h4>\n<p>Rule 1) Send acknowledgement after receiving and consuming of data packet.<br \/>\nRule 2) After consuming packet acknowledgement need to be sent (Flow Control)<\/p>\n<h2 id=\"problems\"><u>Problems :<\/u><\/h2>\n<p><strong>1. Lost Data<\/strong><\/p>\n<p><strong>2. Lost Acknowledgement:<\/strong><\/p>\n<p><strong>3.\u00a0Delayed Acknowledgement\/Data:<\/strong> After timeout on sender side, a long delayed acknowledgement might be wrongly considered as acknowledgement of some other recent packet.<\/p>\n<ul>\n<li>[ad type=&#8221;banner&#8221;]<\/li>\n<\/ul>\n<h3 id=\"stop-and-wait-arq-automatic-repeat-request\"><u>Stop and Wait ARQ (Automatic Repeat Request)<\/u><\/h3>\n<p>Above 3 problems are resolved by Stop and Wait ARQ (Automatic Repeat Request) that does both error control and flow control.<\/p>\n<ul>\n<li>[ad type=&#8221;banner&#8221;]<\/li>\n<\/ul>\n<h2 id=\"\"><a href=\"http:\/\/www.geeksforgeeks.org\/wp-content\/uploads\/gq\/2015\/10\/cn5.png\" target=\"_blank\" rel=\"noopener\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-19711\" src=\"http:\/\/www.geeksforgeeks.org\/wp-content\/uploads\/gq\/2015\/10\/cn5.png\" alt=\"cn5\" width=\"604\" height=\"119\" \/><\/a><\/h2>\n<p><strong>1.\u00a0Time Out:<\/strong><\/p>\n<p><strong>2.\u00a0Sequence Number (Data)<\/strong><\/p>\n<p><strong>3.\u00a0Delayed Acknowledgement:<\/strong><br \/>\nThis is resolved by introducing sequence number for acknowledgement also.<\/p>\n<h3 id=\"working-of-stop-and-wait-arq\"><u>Working of Stop and Wait ARQ:<\/u><\/h3>\n<p>1) Sender A sends a data frame or packet with sequence number 0.<br \/>\n2) Receiver B, after receiving data frame, sends and acknowledgement with sequence number 1 (sequence number of next expected data frame or packet)<br \/>\nThere is only one bit sequence number that implies that both sender and receiver have buffer for one frame or packet only.<\/p>\n<p>Above image is taken from <a href=\"http:\/\/users.ecs.soton.ac.uk\/sqc\/EL336\/CNL-5.pdf\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<h4 id=\"characteristics-of-stop-and-wait-arq\">Characteristics of Stop and Wait ARQ:<\/h4>\n<ul>\n<li>It uses link between sender and receiver as half duplex link<\/li>\n<li>Throughput = 1 Data\u00a0packet\/frame per\u00a0 RTT.<\/li>\n<li>[ad type=&#8221;banner&#8221;]<\/li>\n<li><\/li>\n<li>If Bandwidth*Delay product is very high, then stop and wait protocol is not so useful. The sender has to keep waiting for acknowledgements before sending the processed next packet.<\/li>\n<li>It is an example for \u201c<strong>Closed Loop OR connection oriented <\/strong>\u201c protocols<\/li>\n<li>It is an special category of SWP where its window size is 1<\/li>\n<li>Irrespective of number of packets sender is having stop and wait protocol\u00a0 requires only\u00a0 2 sequence numbers 0 and 1<\/li>\n<\/ul>\n<p>The Stop and Wait ARQ solves main three problems, but may cause big performance issues as sender always waits for acknowledgement even if it has next packet ready to send. Consider a situation where you have a high bandwidth connection and propagation delay is also high (you are connected to some server in some other country though a high speed connection). To solve this problem, we can send more than one packet at a time with a larger sequence numbers. We will be discussing these protocols in next articles.<\/p>\n<ul>\n<li>[ad type=&#8221;banner&#8221;]<\/li>\n<\/ul>\n<p>So Stop and Wait ARQ may work fine where propagation delay is very less for example LAN connections, but performs badly for distant connections like satellite connection.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This protocols are used for proper transmission of data from sender to reciever and viceversa<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82277,71771],"tags":[82840,82837,82838,82839,82843,82842,82844,82841],"class_list":["post-28365","post","type-post","status-publish","format-standard","hentry","category-computer-networks","category-cs-subjects","tag-advantages-and-disadvantages-of-stop-and-wait-protocol","tag-selective-repeat-arq","tag-stop-and-wait-arq-pdf","tag-stop-and-wait-flow-control","tag-stop-and-wait-protocol-algorithm","tag-stop-and-wait-protocol-and-sliding-window-protocol","tag-stop-and-wait-protocol-pdf","tag-stop-and-wait-protocol-program-in-c"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/28365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=28365"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/28365\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=28365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=28365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=28365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}