SlideShare a Scribd company logo
1 of 2
Download to read offline
CS513/EE506 Intro to Local and Wide Area Networks                      WPI, Spring 2007
Craig E. Wills                                                 Sliding Window Protocols


Sliding Window Protocols
   • Frames are numbered.

   • Lost frames can be retransmitted.

   • Duplicate frames can be deleted.

   • Out of order frames can be reordered.

   The sender maintains two variables:

   • SL = the number of the “oldest” frame sent, but not ACK’ed.

   • SU = the number of the next frame to send that has not ever been sent.

   • SU − SL = the size of the sender’s window (the number of sending buffers needed)

   The receiver maintains two variables:

   • RL = lowest numbered frame the receiver is willing to accept

   • RU = one more than the highest numbered frame the receiver is willing to accept.

   • RU − RL = size of receiver’s window.


Algorithm
Rough algorithm of the sliding window protocols:

  1. Transmit all frames in the sender’s window (no more than from SL to SU −1 )

  2. Whenever the receiver gets a frame in its window:

      (a) it generates an ACK for the highest frame correctly received (same as the frame
          for protocol 5).
      (b) if the frame RL has been received it passes RL to the host and bumps RL and RU
          (advances the window).

  3. Whenever the receiver gets a damaged frame or a frame not within its window it
     generates a NAK for one less than the frame expected (RL − 1) (only for protocol 6).
4. Whenever the sender receives an ACK for a frame within its window, it marks that
     frame as having been correctly sent and received. If SL is ACKed then increment
     SL and SU (advance the sender’s window) and transmit SU −1 (last previously unsent
     frame).

  5. Whenever a timer goes off, retransmit the corresponding frame.


Relationships
Sequence numbers: 0..(2n − 1)
   SL < S U , R L < R U
   Steady state condition: RL ≤ SU
   Interval of active frames: [SL , RU )
   So RU − SL ≤ 2n and (RU − RL ) + (SU − SL ) ≤ 2n
   where n is the number of bits in the sequence number Two cases:

  1. Receiver window size of one (protocol 5):
        RU − R L = 1
        (SU − SL ) + 1 ≤ 2n
        (SU − SL ) ≤ 2n − 1

  2. Receiver and sender have equal window sizes (protocol 6):
        RU − R L = S U − S L = W
        2W ≤ 2n
        W ≤ 2n−1


Protocol 6 Example
Situation:

  1. Sender sends sequence numbers 0-3.

  2. Receiver has ACKed 0-3 (advancing window), but sender has not received the ACKs.

   SL                 SU



   RU                 RL

    0     1   2   3   4    5   6   7

More Related Content

What's hot

Sliding window and error control
Sliding window and error controlSliding window and error control
Sliding window and error controlAdil Mehmoood
 
Importance of sliding window protocol
Importance of sliding window protocolImportance of sliding window protocol
Importance of sliding window protocoleSAT Publishing House
 
Simplex stop and_wait_protocol
Simplex stop and_wait_protocolSimplex stop and_wait_protocol
Simplex stop and_wait_protocolMusfira Ameer
 
Advance Repeat reQuest (ARQ)
Advance Repeat reQuest (ARQ)Advance Repeat reQuest (ARQ)
Advance Repeat reQuest (ARQ)Muhammad Irtiza
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocolManusha Dilan
 
14 data link control
14 data link control14 data link control
14 data link controlarvindsarja
 
Cse3213 11 flow_errorcontrol_f2010
Cse3213 11 flow_errorcontrol_f2010Cse3213 11 flow_errorcontrol_f2010
Cse3213 11 flow_errorcontrol_f2010namokar
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Controltameemyousaf
 
Stop and Wait arq
Stop and Wait arqStop and Wait arq
Stop and Wait arqpramodmmrv
 
Chapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9eChapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9eadpeer
 
New framing-protocols
New framing-protocolsNew framing-protocols
New framing-protocolsNitesh Singh
 
Data Link Control Protocols
Data Link Control ProtocolsData Link Control Protocols
Data Link Control ProtocolsTechiNerd
 
Flow control &amp; error control
Flow control &amp; error controlFlow control &amp; error control
Flow control &amp; error controlManishTadhiyal
 

What's hot (20)

go back n protocol
go back n protocolgo back n protocol
go back n protocol
 
Sliding window and error control
Sliding window and error controlSliding window and error control
Sliding window and error control
 
Importance of sliding window protocol
Importance of sliding window protocolImportance of sliding window protocol
Importance of sliding window protocol
 
Simplex stop and_wait_protocol
Simplex stop and_wait_protocolSimplex stop and_wait_protocol
Simplex stop and_wait_protocol
 
Stop And Wait ARQ
Stop And Wait ARQStop And Wait ARQ
Stop And Wait ARQ
 
Advance Repeat reQuest (ARQ)
Advance Repeat reQuest (ARQ)Advance Repeat reQuest (ARQ)
Advance Repeat reQuest (ARQ)
 
Ch 11
Ch 11Ch 11
Ch 11
 
Selective repeat protocol
Selective repeat protocolSelective repeat protocol
Selective repeat protocol
 
14 data link control
14 data link control14 data link control
14 data link control
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Flow Control
Flow ControlFlow Control
Flow Control
 
Stop-and-Wait ARQ Protocol
Stop-and-Wait ARQ ProtocolStop-and-Wait ARQ Protocol
Stop-and-Wait ARQ Protocol
 
Cse3213 11 flow_errorcontrol_f2010
Cse3213 11 flow_errorcontrol_f2010Cse3213 11 flow_errorcontrol_f2010
Cse3213 11 flow_errorcontrol_f2010
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
 
Stop and Wait arq
Stop and Wait arqStop and Wait arq
Stop and Wait arq
 
Stop And Wait
Stop And WaitStop And Wait
Stop And Wait
 
Chapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9eChapter 7 - Data Link Control Protocols 9e
Chapter 7 - Data Link Control Protocols 9e
 
New framing-protocols
New framing-protocolsNew framing-protocols
New framing-protocols
 
Data Link Control Protocols
Data Link Control ProtocolsData Link Control Protocols
Data Link Control Protocols
 
Flow control &amp; error control
Flow control &amp; error controlFlow control &amp; error control
Flow control &amp; error control
 

Viewers also liked

Viewers also liked (20)

Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Sliding window
 Sliding window Sliding window
Sliding window
 
Chapter3
Chapter3Chapter3
Chapter3
 
Data link layer
Data link layer Data link layer
Data link layer
 
data link layer
data link layerdata link layer
data link layer
 
Go Back N ARQ
Go  Back N ARQGo  Back N ARQ
Go Back N ARQ
 
Issues in Data Link Layer
Issues in Data Link LayerIssues in Data Link Layer
Issues in Data Link Layer
 
Network layer - design Issues
Network layer - design IssuesNetwork layer - design Issues
Network layer - design Issues
 
Unrestricted Simplex Protocolx
Unrestricted Simplex ProtocolxUnrestricted Simplex Protocolx
Unrestricted Simplex Protocolx
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Datalinklayer tanenbaum
Datalinklayer tanenbaumDatalinklayer tanenbaum
Datalinklayer tanenbaum
 
DDL and Physical Layer
DDL and Physical LayerDDL and Physical Layer
DDL and Physical Layer
 
Fdm
FdmFdm
Fdm
 
Chap24
Chap24Chap24
Chap24
 
Data Link Layer
Data Link LayerData Link Layer
Data Link Layer
 
Nat presentation
Nat presentationNat presentation
Nat presentation
 
Fdm
FdmFdm
Fdm
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layer
 
Quality of Service
Quality of ServiceQuality of Service
Quality of Service
 
Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
 

Similar to Sliding window protocol

Similar to Sliding window protocol (20)

session -7 - Sliding Window Protocol 1- N oisy Channels.ppt
session -7 - Sliding Window Protocol 1- N oisy Channels.pptsession -7 - Sliding Window Protocol 1- N oisy Channels.ppt
session -7 - Sliding Window Protocol 1- N oisy Channels.ppt
 
Flow control main
Flow control mainFlow control main
Flow control main
 
PROTOCOL ICT.pptx
PROTOCOL ICT.pptxPROTOCOL ICT.pptx
PROTOCOL ICT.pptx
 
8th lec flow and error control
8th lec   flow and error control8th lec   flow and error control
8th lec flow and error control
 
Protocols
ProtocolsProtocols
Protocols
 
Computer network slides for easy prepration
Computer network slides for easy preprationComputer network slides for easy prepration
Computer network slides for easy prepration
 
Different protocols for data communication networks
Different protocols for data communication networks Different protocols for data communication networks
Different protocols for data communication networks
 
6 data linkcontrol
6  data linkcontrol6  data linkcontrol
6 data linkcontrol
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Chapter 11: Data Link Control
Chapter 11: Data Link ControlChapter 11: Data Link Control
Chapter 11: Data Link Control
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Solar Project C Test
Solar Project C TestSolar Project C Test
Solar Project C Test
 
a_presentation_on_hdlc_and_dlc_computer.ppt
a_presentation_on_hdlc_and_dlc_computer.ppta_presentation_on_hdlc_and_dlc_computer.ppt
a_presentation_on_hdlc_and_dlc_computer.ppt
 
Data Link Control.ppt
Data Link Control.pptData Link Control.ppt
Data Link Control.ppt
 
Arq protocol part 2
Arq protocol part 2Arq protocol part 2
Arq protocol part 2
 
Unit IV_Flow.pptx
Unit IV_Flow.pptxUnit IV_Flow.pptx
Unit IV_Flow.pptx
 
Micro project on ARQ
Micro project on ARQMicro project on ARQ
Micro project on ARQ
 
Flow Control (1).ppt
Flow Control (1).pptFlow Control (1).ppt
Flow Control (1).ppt
 
Go back.pptx
Go back.pptxGo back.pptx
Go back.pptx
 
Logic Gate
Logic GateLogic Gate
Logic Gate
 

Sliding window protocol

  • 1. CS513/EE506 Intro to Local and Wide Area Networks WPI, Spring 2007 Craig E. Wills Sliding Window Protocols Sliding Window Protocols • Frames are numbered. • Lost frames can be retransmitted. • Duplicate frames can be deleted. • Out of order frames can be reordered. The sender maintains two variables: • SL = the number of the “oldest” frame sent, but not ACK’ed. • SU = the number of the next frame to send that has not ever been sent. • SU − SL = the size of the sender’s window (the number of sending buffers needed) The receiver maintains two variables: • RL = lowest numbered frame the receiver is willing to accept • RU = one more than the highest numbered frame the receiver is willing to accept. • RU − RL = size of receiver’s window. Algorithm Rough algorithm of the sliding window protocols: 1. Transmit all frames in the sender’s window (no more than from SL to SU −1 ) 2. Whenever the receiver gets a frame in its window: (a) it generates an ACK for the highest frame correctly received (same as the frame for protocol 5). (b) if the frame RL has been received it passes RL to the host and bumps RL and RU (advances the window). 3. Whenever the receiver gets a damaged frame or a frame not within its window it generates a NAK for one less than the frame expected (RL − 1) (only for protocol 6).
  • 2. 4. Whenever the sender receives an ACK for a frame within its window, it marks that frame as having been correctly sent and received. If SL is ACKed then increment SL and SU (advance the sender’s window) and transmit SU −1 (last previously unsent frame). 5. Whenever a timer goes off, retransmit the corresponding frame. Relationships Sequence numbers: 0..(2n − 1) SL < S U , R L < R U Steady state condition: RL ≤ SU Interval of active frames: [SL , RU ) So RU − SL ≤ 2n and (RU − RL ) + (SU − SL ) ≤ 2n where n is the number of bits in the sequence number Two cases: 1. Receiver window size of one (protocol 5): RU − R L = 1 (SU − SL ) + 1 ≤ 2n (SU − SL ) ≤ 2n − 1 2. Receiver and sender have equal window sizes (protocol 6): RU − R L = S U − S L = W 2W ≤ 2n W ≤ 2n−1 Protocol 6 Example Situation: 1. Sender sends sequence numbers 0-3. 2. Receiver has ACKed 0-3 (advancing window), but sender has not received the ACKs. SL SU RU RL 0 1 2 3 4 5 6 7