Docsity

Sliding Window - Computer Networks - Lecture Slides, Slides of Computer Networks

Partial preview of the text

Download Sliding Window - Computer Networks - Lecture Slides and more Slides Computer Networks in PDF only on Docsity!

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

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

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

Sliding Window Protocol

-^

Outbound frame sequence number

-^

Range - 0 – 2

n^ -

-^

n bit field

-^

Stop & Wait is Sliding window with n = 1

-^

Sender – maintain sequence number of frames itis permitted to send^ – sending window

-^

Receiver – maintain sequence number of framesit is expected to accept – Receiver window

Receiver Sender Receiver

SWP -- Example

• Larger Sender Window Size

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.

Docsity.com

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.

Selective Repeat Protocol

• Variation SWP:

  • selective ack for frame – sender knows what to send – problem – complicated – can RWS > SWS?