SlideShare a Scribd company logo
Computer Networks                                    Prof. Hema A Murthy




                      Sliding Window Protocol
         • Sliding window protocol:
         • Stop & Wait: inefficient if a is large.
         • Data: - stream of bulk data
         •       - data can be pipelined
         •       - transmit window of date
         •       - donot worry about getting ack
           immediately

Indian Institute of Technology Madras
Computer Networks                                          Prof. Hema A Murthy




                      Sliding Window Protocol
         • What should be the size of pipeline?
         • How do we handle errors:
                – Sender and receiver maintain – buffer space
                – Receiver window = 1,
                – Sender window = n




Indian Institute of Technology Madras
Computer Networks                                                       Prof. Hema A Murthy




                Timing Diagram: Go back-N

                                        Timeout

            S        1         2        3   4       5       3   4   5




                                                E   D   E
             R
Indian Institute of Technology Madras
Computer Networks                                                Prof. Hema A Murthy




                                        Go-Back N
         • Discard if correct frame not received
         • Use same circuit for both directions
                – Intermix data frames from both S   R with ack frames
                  from R S
         • Use kind field in header:
                –    decide whether data or ack
                –    piggy back ack on outgoing frame for R S
                –   Ack field in frame
                –   If frame not available for piggybacking Timeout

Indian Institute of Technology Madras
Computer Networks                                        Prof. Hema A Murthy




                      Sliding Window Protocol
         •    Outbound frame sequence number
         •    Range - 0 – 2n-1
         •     n bit field
         •     Stop & Wait is Sliding window with n = 1
         •     Sender – maintain sequence number of frames it
              is permitted to send
                – sending window
         •      Receiver – maintain sequence number of frames
              it is expected to accept
                – Receiver window


Indian Institute of Technology Madras
Computer Networks                                        Prof. Hema A Murthy




Sliding Window Protocol –
An example (Tanenbaum)

    Example: SWP: sequence number: Sender 0 - 7
             seqno – 3 bit

    Sender
        7              0                    7   0
     6                       1          6           1

                                2                    2
     5                                  5
              4         3                   4   3

Indian Institute of Technology Madras
Computer Networks                                                                         Prof. Hema A Murthy

    Receiver
                           7            0                    7        0
                     6                       1       6                        1

                                                 2                             2
                    5                                5
     Sender                 4            3                    4       3
                           7            0                        7        0
                     6                       1           6                        1

                                                 2                                 2
                    5                                    5
                            4           3                         4       3
      Receiver
                          7             0                         7       0
                    6                        1            6                       1

                                              2                                       2
                    5                                    5
                           4
Indian Institute of Technology Madras   3                         4        3
Computer Networks                                        Prof. Hema A Murthy




                                    SWP -- Example
         • Larger Sender Window Size

                                            7   0
                                        6           1

                                                     2
                                        5
                                            4   3




Indian Institute of Technology Madras
Computer Networks                                                Prof. Hema A Murthy




   Different Window Sizes:
   Receiver, Sender (Peterson et al.)
If Sender Window is n
 How large can the Receiver Window be?



                               LAR                  LFS

                            Sender window size
              Last Acked Frame                 Last Frame Sent
                                   Number of unacked frames
                                 LFS – LAR ≤ SWS
Indian Institute of Technology Madras
Computer Networks                                        Prof. Hema A Murthy




                Receive Window Size (RWS)
          • number of out order frames receiver is
            willing accept
                – LAF – Last acceptable frame (sequence
                  number)
                             ≤
                – LFR – Last frame received
≤               – LAF – LFR      RWS
                – When SeqNumber frame arrives:
                – If SeqNumber       LFR or Sequence Number              ≤
                  > LAF – discard
                – If LFR < Sequence Number       LAF – accept
                  frame.
Indian Institute of Technology Madras
Computer Networks                                         Prof. Hema A Murthy




                           Example: Larger RWS
         • Example: LFS = 5, RWS = 4, LAF = 9
         • If frame 7 & 8 arrive
                – buffered
                – but ack not sent since 6 not arrived.
                – 7 & 8 out of order.
         • If frame 6 delayed –
                – Retransmitted, received later
         • - Notice no NAK for 6.
         •    primarily timeout on 6 – retransmit 6.

Indian Institute of Technology Madras
Computer Networks                              Prof. Hema A Murthy




             SWP – Go back-N – a variation
         • largest Sequence Number not yet acked.
         • receiver only acks SequenceNumberAck
           even if higher numbered frames are
           received.
         • set LFR = SequenceNumberToAck
         • LAF = LFR + RWS



Indian Institute of Technology Madras
Computer Networks                                 Prof. Hema A Murthy




                      Selective Repeat Protocol
         • Variation SWP:
                –   selective ack for frame
                –   sender knows what to send
                –   problem – complicated
                –   can RWS > SWS ?




Indian Institute of Technology Madras

More Related Content

What's hot

Leaky bucket algorithm
Leaky bucket algorithmLeaky bucket algorithm
Leaky bucket algorithm
Umesh Gupta
 
Security
SecuritySecurity
Security
Rupesh Mishra
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
tameemyousaf
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
Alagappa Govt Arts College, Karaikudi
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
JUW Jinnah University for Women
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
Prajakta Rane
 
Grid protocol architecture
Grid protocol architectureGrid protocol architecture
Grid protocol architecture
Pooja Dixit
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
DHIVYADEVAKI
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
Naiyan Noor
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
Prakhar Maurya
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols
BE Smârt
 
Token ring
Token ringToken ring
Token ring
selvakumar_b1985
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
Deepak John
 
Ipv6
Ipv6Ipv6
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
SHIKHA GAUTAM
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
Nitish Gulati
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
Acad
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
Bipul Chandra Kar
 
Web services security
Web services securityWeb services security
Web services security
nurmeen1
 

What's hot (20)

Leaky bucket algorithm
Leaky bucket algorithmLeaky bucket algorithm
Leaky bucket algorithm
 
Security
SecuritySecurity
Security
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
 
Grid protocol architecture
Grid protocol architectureGrid protocol architecture
Grid protocol architecture
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
data-link layer protocols
data-link layer protocols  data-link layer protocols
data-link layer protocols
 
Token ring
Token ringToken ring
Token ring
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Ipv6
Ipv6Ipv6
Ipv6
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
Web services security
Web services securityWeb services security
Web services security
 

Viewers also liked

Chapter 6 - Networking
Chapter 6 - NetworkingChapter 6 - Networking
Chapter 6 - Networking
Rosie Jane Enomar
 
Unit 3 computer system presention
Unit 3 computer system presentionUnit 3 computer system presention
Unit 3 computer system presention
Mat_J
 
1. Introduction to Association Rule 2. Frequent Item Set Mining 3. Market Bas...
1. Introduction to Association Rule2. Frequent Item Set Mining3. Market Bas...1. Introduction to Association Rule2. Frequent Item Set Mining3. Market Bas...
1. Introduction to Association Rule 2. Frequent Item Set Mining 3. Market Bas...
Surabhi Gosavi
 
Computer networks unit iii
Computer networks    unit iiiComputer networks    unit iii
Computer networks unit iii
JAIGANESH SEKAR
 
Threads in Java
Threads in JavaThreads in Java
Threads in Java
Gaurav Aggarwal
 
Networking interview questions and answers
Networking interview questions and answersNetworking interview questions and answers
Networking interview questions and answers
Amit Tiwari
 
Protocol & Type of Networks
Protocol & Type of NetworksProtocol & Type of Networks
Protocol & Type of Networks
Normarni Mohd Ariffin
 
Unit 1 introduction to computer networks
Unit 1  introduction to computer networksUnit 1  introduction to computer networks
Unit 1 introduction to computer networks
pavan kumar Thatikonda
 
Types of Networks,Network Design Issues,Design Tools
Types of Networks,Network Design Issues,Design ToolsTypes of Networks,Network Design Issues,Design Tools
Types of Networks,Network Design Issues,Design Tools
Surabhi Gosavi
 
Unit 5
Unit 5Unit 5
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
Haresh Jaiswal
 
Pointers, virtual function and polymorphism
Pointers, virtual function and polymorphismPointers, virtual function and polymorphism
Pointers, virtual function and polymorphism
lalithambiga kamaraj
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
Vasavi College of Engg
 
Network Topology
Network TopologyNetwork Topology
Network Topology
Norhisham Mohamad Nordin
 
Ppt of types of-network
Ppt of types of-network Ppt of types of-network
Ppt of types of-network
Darshit narechania
 

Viewers also liked (15)

Chapter 6 - Networking
Chapter 6 - NetworkingChapter 6 - Networking
Chapter 6 - Networking
 
Unit 3 computer system presention
Unit 3 computer system presentionUnit 3 computer system presention
Unit 3 computer system presention
 
1. Introduction to Association Rule 2. Frequent Item Set Mining 3. Market Bas...
1. Introduction to Association Rule2. Frequent Item Set Mining3. Market Bas...1. Introduction to Association Rule2. Frequent Item Set Mining3. Market Bas...
1. Introduction to Association Rule 2. Frequent Item Set Mining 3. Market Bas...
 
Computer networks unit iii
Computer networks    unit iiiComputer networks    unit iii
Computer networks unit iii
 
Threads in Java
Threads in JavaThreads in Java
Threads in Java
 
Networking interview questions and answers
Networking interview questions and answersNetworking interview questions and answers
Networking interview questions and answers
 
Protocol & Type of Networks
Protocol & Type of NetworksProtocol & Type of Networks
Protocol & Type of Networks
 
Unit 1 introduction to computer networks
Unit 1  introduction to computer networksUnit 1  introduction to computer networks
Unit 1 introduction to computer networks
 
Types of Networks,Network Design Issues,Design Tools
Types of Networks,Network Design Issues,Design ToolsTypes of Networks,Network Design Issues,Design Tools
Types of Networks,Network Design Issues,Design Tools
 
Unit 5
Unit 5Unit 5
Unit 5
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
 
Pointers, virtual function and polymorphism
Pointers, virtual function and polymorphismPointers, virtual function and polymorphism
Pointers, virtual function and polymorphism
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
 
Network Topology
Network TopologyNetwork Topology
Network Topology
 
Ppt of types of-network
Ppt of types of-network Ppt of types of-network
Ppt of types of-network
 

Similar to Sliding window

IEC 60870-5 101 Protocol Server Simulator User manual
IEC 60870-5 101 Protocol Server Simulator User manualIEC 60870-5 101 Protocol Server Simulator User manual
IEC 60870-5 101 Protocol Server Simulator User manual
FreyrSCADA Embedded Solution
 
Huawei Advanced Data Science With Spark Streaming
Huawei Advanced Data Science With Spark StreamingHuawei Advanced Data Science With Spark Streaming
Huawei Advanced Data Science With Spark Streaming
Jen Aman
 
token bus
 token bus token bus
token bus
iamvisakh
 
Network layer
Network layerNetwork layer
Network layer
Shiva Prakasam S
 
PinTrace Advanced AWS meetup
PinTrace Advanced AWS meetup PinTrace Advanced AWS meetup
PinTrace Advanced AWS meetup
Suman Karumuri
 
Graphlab Ted Dunning Clustering
Graphlab Ted Dunning  ClusteringGraphlab Ted Dunning  Clustering
Graphlab Ted Dunning Clustering
MapR Technologies
 
New directions for mahout
New directions for mahoutNew directions for mahout
New directions for mahout
MapR Technologies
 
2014-04-easteros
2014-04-easteros2014-04-easteros
2014-04-easteros
Jack Wang
 
Practical Wireless Mesh Networks and Their Applications
Practical Wireless Mesh Networks and Their ApplicationsPractical Wireless Mesh Networks and Their Applications
Practical Wireless Mesh Networks and Their Applications
Raluca Musaloiu-E.
 
Graphlab dunning-clustering
Graphlab dunning-clusteringGraphlab dunning-clustering
Graphlab dunning-clustering
Ted Dunning
 
From Python Scikit-learn to Scala Apache Spark—The Road to Uncovering Botnets...
From Python Scikit-learn to Scala Apache Spark—The Road to Uncovering Botnets...From Python Scikit-learn to Scala Apache Spark—The Road to Uncovering Botnets...
From Python Scikit-learn to Scala Apache Spark—The Road to Uncovering Botnets...
Databricks
 
BIRTE-13-Kawashima
BIRTE-13-KawashimaBIRTE-13-Kawashima
BIRTE-13-Kawashima
Hideyuki Kawashima
 
Linux_and_Xenomai
Linux_and_XenomaiLinux_and_Xenomai
Linux_and_Xenomai
Sree Nikhilendra Prasad
 
Tsinghua University: Two Exemplary Applications in China
Tsinghua University: Two Exemplary Applications in ChinaTsinghua University: Two Exemplary Applications in China
Tsinghua University: Two Exemplary Applications in China
DataStax Academy
 
Vxworks
VxworksVxworks
KSpeculative aspects of high-speed processor design
KSpeculative aspects of high-speed processor designKSpeculative aspects of high-speed processor design
KSpeculative aspects of high-speed processor design
ssuser7dcef0
 
New Directions for Mahout
New Directions for MahoutNew Directions for Mahout
New Directions for Mahout
Ted Dunning
 
Preparing OpenSHMEM for Exascale
Preparing OpenSHMEM for ExascalePreparing OpenSHMEM for Exascale
Preparing OpenSHMEM for Exascale
inside-BigData.com
 
Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005
dflexer
 
PMIx Updated Overview
PMIx Updated OverviewPMIx Updated Overview
PMIx Updated Overview
Ralph Castain
 

Similar to Sliding window (20)

IEC 60870-5 101 Protocol Server Simulator User manual
IEC 60870-5 101 Protocol Server Simulator User manualIEC 60870-5 101 Protocol Server Simulator User manual
IEC 60870-5 101 Protocol Server Simulator User manual
 
Huawei Advanced Data Science With Spark Streaming
Huawei Advanced Data Science With Spark StreamingHuawei Advanced Data Science With Spark Streaming
Huawei Advanced Data Science With Spark Streaming
 
token bus
 token bus token bus
token bus
 
Network layer
Network layerNetwork layer
Network layer
 
PinTrace Advanced AWS meetup
PinTrace Advanced AWS meetup PinTrace Advanced AWS meetup
PinTrace Advanced AWS meetup
 
Graphlab Ted Dunning Clustering
Graphlab Ted Dunning  ClusteringGraphlab Ted Dunning  Clustering
Graphlab Ted Dunning Clustering
 
New directions for mahout
New directions for mahoutNew directions for mahout
New directions for mahout
 
2014-04-easteros
2014-04-easteros2014-04-easteros
2014-04-easteros
 
Practical Wireless Mesh Networks and Their Applications
Practical Wireless Mesh Networks and Their ApplicationsPractical Wireless Mesh Networks and Their Applications
Practical Wireless Mesh Networks and Their Applications
 
Graphlab dunning-clustering
Graphlab dunning-clusteringGraphlab dunning-clustering
Graphlab dunning-clustering
 
From Python Scikit-learn to Scala Apache Spark—The Road to Uncovering Botnets...
From Python Scikit-learn to Scala Apache Spark—The Road to Uncovering Botnets...From Python Scikit-learn to Scala Apache Spark—The Road to Uncovering Botnets...
From Python Scikit-learn to Scala Apache Spark—The Road to Uncovering Botnets...
 
BIRTE-13-Kawashima
BIRTE-13-KawashimaBIRTE-13-Kawashima
BIRTE-13-Kawashima
 
Linux_and_Xenomai
Linux_and_XenomaiLinux_and_Xenomai
Linux_and_Xenomai
 
Tsinghua University: Two Exemplary Applications in China
Tsinghua University: Two Exemplary Applications in ChinaTsinghua University: Two Exemplary Applications in China
Tsinghua University: Two Exemplary Applications in China
 
Vxworks
VxworksVxworks
Vxworks
 
KSpeculative aspects of high-speed processor design
KSpeculative aspects of high-speed processor designKSpeculative aspects of high-speed processor design
KSpeculative aspects of high-speed processor design
 
New Directions for Mahout
New Directions for MahoutNew Directions for Mahout
New Directions for Mahout
 
Preparing OpenSHMEM for Exascale
Preparing OpenSHMEM for ExascalePreparing OpenSHMEM for Exascale
Preparing OpenSHMEM for Exascale
 
Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005Tuning parallelcodeonsolaris005
Tuning parallelcodeonsolaris005
 
PMIx Updated Overview
PMIx Updated OverviewPMIx Updated Overview
PMIx Updated Overview
 

Sliding window

  • 1. Computer Networks Prof. Hema A Murthy Sliding Window Protocol • Sliding window protocol: • Stop & Wait: inefficient if a is large. • Data: - stream of bulk data • - data can be pipelined • - transmit window of date • - donot worry about getting ack immediately Indian Institute of Technology Madras
  • 2. Computer Networks Prof. Hema A Murthy Sliding Window Protocol • What should be the size of pipeline? • How do we handle errors: – Sender and receiver maintain – buffer space – Receiver window = 1, – Sender window = n Indian Institute of Technology Madras
  • 3. Computer Networks Prof. Hema A Murthy Timing Diagram: Go back-N Timeout S 1 2 3 4 5 3 4 5 E D E R Indian Institute of Technology Madras
  • 4. Computer Networks Prof. Hema A Murthy Go-Back N • Discard if correct frame not received • Use same circuit for both directions – Intermix data frames from both S R with ack frames from R S • Use kind field in header: – decide whether data or ack – piggy back ack on outgoing frame for R S – Ack field in frame – If frame not available for piggybacking Timeout Indian Institute of Technology Madras
  • 5. Computer Networks Prof. Hema A Murthy Sliding Window Protocol • Outbound frame sequence number • Range - 0 – 2n-1 • n bit field • Stop & Wait is Sliding window with n = 1 • Sender – maintain sequence number of frames it is permitted to send – sending window • Receiver – maintain sequence number of frames it is expected to accept – Receiver window Indian Institute of Technology Madras
  • 6. Computer Networks Prof. Hema A Murthy Sliding Window Protocol – An example (Tanenbaum) Example: SWP: sequence number: Sender 0 - 7 seqno – 3 bit Sender 7 0 7 0 6 1 6 1 2 2 5 5 4 3 4 3 Indian Institute of Technology Madras
  • 7. Computer Networks Prof. Hema A Murthy Receiver 7 0 7 0 6 1 6 1 2 2 5 5 Sender 4 3 4 3 7 0 7 0 6 1 6 1 2 2 5 5 4 3 4 3 Receiver 7 0 7 0 6 1 6 1 2 2 5 5 4 Indian Institute of Technology Madras 3 4 3
  • 8. Computer Networks Prof. Hema A Murthy SWP -- Example • Larger Sender Window Size 7 0 6 1 2 5 4 3 Indian Institute of Technology Madras
  • 9. Computer Networks Prof. Hema A Murthy Different Window Sizes: Receiver, Sender (Peterson et al.) If Sender Window is n How large can the Receiver Window be? LAR LFS Sender window size Last Acked Frame Last Frame Sent Number of unacked frames LFS – LAR ≤ SWS Indian Institute of Technology Madras
  • 10. Computer Networks Prof. Hema A Murthy Receive Window Size (RWS) • number of out order frames receiver is willing accept – LAF – Last acceptable frame (sequence number) ≤ – LFR – Last frame received ≤ – LAF – LFR RWS – When SeqNumber frame arrives: – If SeqNumber LFR or Sequence Number ≤ > LAF – discard – If LFR < Sequence Number LAF – accept frame. Indian Institute of Technology Madras
  • 11. Computer Networks Prof. Hema A Murthy Example: Larger RWS • Example: LFS = 5, RWS = 4, LAF = 9 • If frame 7 & 8 arrive – buffered – but ack not sent since 6 not arrived. – 7 & 8 out of order. • If frame 6 delayed – – Retransmitted, received later • - Notice no NAK for 6. • primarily timeout on 6 – retransmit 6. Indian Institute of Technology Madras
  • 12. Computer Networks Prof. Hema A Murthy SWP – Go back-N – a variation • largest Sequence Number not yet acked. • receiver only acks SequenceNumberAck even if higher numbered frames are received. • set LFR = SequenceNumberToAck • LAF = LFR + RWS Indian Institute of Technology Madras
  • 13. Computer Networks Prof. Hema A Murthy Selective Repeat Protocol • Variation SWP: – selective ack for frame – sender knows what to send – problem – complicated – can RWS > SWS ? Indian Institute of Technology Madras