Selective Repeat - PowerPoint PPT Presentation

About This Presentation
Title:

Selective Repeat

Description:

Receiver has a window greater than 1. ... If network layer got data, if current window not full yet, read data, send to ... outside the window, don't do ... – PowerPoint PPT presentation

Number of Views:183
Avg rating:3.0/5.0
Slides: 12
Provided by: zhen6
Learn more at: http://www.cs.fsu.edu
Category:

less

Transcript and Presenter's Notes

Title: Selective Repeat


1
Selective Repeat
2
Selective Repeat (Protocol 5)
  • Further optimization.
  • Receiver has a window greater than 1.
  • Dont discard frames simply because some earlier
    frames was damaged.

3
Selective Repeat
  • Sender.
  • while (1)
  • If network layer got data, if current
    window not full yet, read data, send to physical
    layer with the current frame ID. Start timer.
    Increment frame ID by one.
  • If got ACKm, if m is outside the
    window, dont do anything. If m is inside the
    window, consider all frames in the window with
    frame ID less than the m acked. Forward window to
    m.
  • If timeout for frame m, resend m.
  • Receiver
  • while (1)
  • Get frame from the physical layer. If
    it is within the receiver window and hasnt been
    received before, fill in the slot, and forward
    the beginning of the receiver window if
    necessary. Deliver to the network layer all
    frames between the beginning of the old receiver
    window and the new receiver window 1,
    inclusive. Send ACK (Expc the beginning of the
    current receiver window).
  • Note assuming the sequence number is the frame
    ID.

4
The Timer
  • Each packet in the senders window should have a
    timer.
  • If the window contains F0,F1,F2,F3. Could it
    happen that the when the timer for F0 expires,
    the timer for F1 has not expired yet? Yes, if you
    do not send the frames one-by-one.
  • Could it happen that the timer for F1 expires but
    the timer for F0 has not? Yes, if F0 has been
    retransmitted before.

5
Sequence Number
  • If the sequence number field is 3 bits, how large
    should the sender/receiver window be?
  • Should the receiver has a different window size
    than the sender? No, larger --- makes no sense,
    the sender is not going to send that many
    outstanding frames, smaller --- wrong, because
    the receiver will discard such packets.
  • Window size should be 4.

6
Sequence Number
  • For 0 to be in my window again, I must have
    forwarded to 5. When I forwarded to 5, I must
    have got 4. I got 4 because the sender sent 4.
    The sender sent 4 only if it got ACK for 0.

7
Sequence Number
  • A proof.
  • Let the sequence number be log_2N bits. Let the
    window size be W, where W lt N/2.
  • Suppose the receiver gets a frame with sequence
    number m. He thinks it is for frame x. Could he
    actually receive frame x-N (with the same seq)?
  • No. Because when x is in his window, the window
    has forwarded to x-W1, at least. So he has got
    x-W. The sender has sent x-W. The sender will do
    so only if it has got ACK for x-2W1. If W ltN/2,
    the sender must have got ACK for x-N.

8
Selective Repeat
9
Piggybacking
  • Considered only one direction. Bidirection.
  • Piggybacking
  • Combining ACK with data
  • When no data?
  • Wait some time and ACK anyway.
  • Internet. PPP.

10
Framing
  • How does the receiver know where is the start and
    where is the end of a frame?
  • Counter. Tell the receiver how many bytes there
    are in this frame. Problems?
  • The counter part could be corrupted and you are
    done.

11
Flag Bytes
  • Add special bytes to the beginning and the end of
    the frame.
  • Problems?
  • What if the data contains the flag bytes?
  • Add ESC byte to each flag or ESC in the data.
    Stuffing.
Write a Comment
User Comments (0)
About PowerShow.com