Data link layer 2 - PowerPoint PPT Presentation

About This Presentation
Title:

Data link layer 2

Description:

So, increase the window size from 1 to n. Would want to have a large window size whenever the bandwidth delay product is large. ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 18
Provided by: zhen6
Learn more at: http://www.cs.fsu.edu
Category:
Tags: data | layer | link

less

Transcript and Presenter's Notes

Title: Data link layer 2


1
Data link layer (2)
2
Review
  • How Protocol 3 deals with
  • Lost packet
  • Lost ACK
  • Premature timeout

3
Correctness Part is Done!
  • Protocol 3 will work without causing errors,
    meaning that the data link layer will deliver the
    packets from the network layer to the other side
    in order.
  • ARQ. (automatic repeat request)

4
Optimization
  • So the next step is the optimization.
  • At the end of last lecture, considered an example
    of
  • 500ms delay. 50kbps. Each frame is 1000 bits.
  • Very low link efficiency.

5
Solution
  • So, increase the window size from 1 to n.
  • Would want to have a large window size whenever
    the bandwidth delay product is large.
  • If bandwidth is large, sending is fast
  • If delay is large, even a moderate bandwidth will
    cause a poor efficiency

6
Question
  • Given link speed and link delay, how large should
    the window be to achieve 100 efficiency?

7
Sender window
  • The sender has a window from m1 to mn means
    that
  • the sender has received ack from the receiver for
    frame up to m,
  • the sender is allowed to send m1, m2, , mn.
    These packets can be outstanding without ack.
  • Sender has to maintain the sender window
    (buffering all outstanding frames), maintain
    timeout for all outstanding frames.
  • The size of the sender window is determined by
    the bandwidth and link delay

8
Go-Back-N
  • Lets first consider the receivers window size
    is only 1.
  • This is called Go-Back-N.

9
Go-Back-N (Protocol 4)
  • Sender.
  • while (1)
  • If network layer got data, if current
    window not full yet, read data, send to physical
    layer with the 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 all
    frames in the window with frame ID greater than
    m.
  • Receiver
  • while (1)
  • Get data from the physical layer. If
    it is with the expected frame ID, give it to the
    network layer, increment the frame ID by 0ne.
    Send ACK.
  • Note assuming the sequence number is the frame
    ID.

10
Go-Back-N
  • Two new things.
  • Cumulative ACK
  • Resend every frame after the timeout frame

11
Go-Back-N
12
Go-Back-N
  • What if ACK is lost?

13
Go-Back-N
  • Works fine is error is rare. Achieves full
    capacity.
  • Else wastes bandwidth.

14
Sequence Number
  • If the sequence number field is large enough,
    just use frame ID as sequence number.
  • Else, how many bits do we need?

15
Sequence number
  • Using the sequence number is to make sure that
    the receiver can be sure that a received frame is
    not a duplicate of some other frames.
  • Using finite number of bits means that some
    frames will have the same sequence number.
  • So, should make sure that the receiver is sure
    that when a frame with seqm is received, the
    sender has got ACK for all previous frames with
    the same seq.

16
Sequence Number
  • Say the sequence number field is 2 bits.
  • Will this be true if the window size is 4?
  • No, because the sender may send 0,1,2,3. Then the
    receiver sends ACK1,2,3,4. If one of the ACK got
    through, the sender will send frame 4 with seq0.
    If none of the ACK got through, the sender will
    send frame 0 with seq0.

17
Sequence number
  • Solution?
  • Use window size less than 4. Say, 3.
  • Now, if the receiver gets frame 0,1,2, it sends
    ACK1,2,3. Then, if it receives a frame with seq0
    again, will it be able to tell whether it is a
    new frame or a retransmission?
  • Yes, because the receiver will accept frame with
    seq3 first. It knows that if the sender sends
    seq3, it must have got ack for frame 0.
Write a Comment
User Comments (0)
About PowerShow.com