Sliding Window Protocol Describe briefy with the help o diagrams why the max window size in sliding window Protocol is one less than the sequence number. number. For For example, i the sequence is: ,!,",#,$,%,&,' the max max window size is: '
Introduction (liding window protocol also )nown as windowing is a data lin) layer protocol used to control fow o rames between two nodes. nodes. *t is used when reliability reliability in order to deli+ery o rames is required. *t is used by most the connection oriented networ) protocol li)e -P. *t is a ull duplex protocol which uses Data and c)nowledgement /he sequence number o last recei+ed rame that is correct0. correct0. Data is transmitted transmitted as rames where multiple rames rames can be sent by a transm transmitt itter er at a time time beor beore e gettin getting g an ac)now ac)nowled ledgme gment. nt. 1ultip 1ultiple le rames sent by a transmitter are ac)nowledged by the recei+er using a single -2 rame. he basic concept o sliding window protocol is that both ransmitter and recei+er recei+er maintain a window. window. he transmitter maintains the +alue o expected ac)nowledgment and the recei+er maintains the +alue o expected rame that is recei+ed. 3hen the transmitter gets an ac)nowledgment rom the recei+er, the window is ad+ances. 4n the other hand when the recei+er recei+es the expected rame, it ad+ances the window.
Figure 1: (liding window with window size '
Why the window size is one less than the sequence number? *n the sliding window protocol i we reser+e m bit or sequencing, then the wind window ow siz size is meas measur ured ed as 2m-1. s an examp xample le i we ta)e ta)e $ bit bit or or $ sequencing sequencing,, the window window size would be " 5! 6 !%. 7ach outgoing rame
contain a sequence number that ranges rom to !% /,!,",#,$,%,&,',8,9,!,!!,!",!#,!$,!%0. (o there would be total !& sequence numbers but the window size is !% which is one less than the sequence number. 3e will now try to gure out why the window size is one less than the sequence number.
;et us assume that we ha+e reser+e # bit or sequencing. (o there would be 8 sequence number and the window size would be ' which is one less than the sequence number.
Figure 2 3indow size is same as the sequence number. *n the abo+e Figure ", he rst $ rames ,!," and # were already transmitted and ac)nowledged. (o the ransmitter will send the window o rames $,%,&,',,!," and #. he window size is 8.
o o+ercome this problem we will now reduce the window size one less than the sequence number and obser+e what happened.
Figure ! 3indow size is one ;ess than the sequence number
"onclusion
(o rom the abo+e discussion we can conclude that the maximum window size in sliding window Protocol should be one less than the sequence number to a+oid duplication o rames.