data link layer 2 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Data link layer (2) PowerPoint Presentation
Download Presentation
Data link layer (2)

Loading in 2 Seconds...

play fullscreen
1 / 22

Data link layer (2) - PowerPoint PPT Presentation


  • 151 Views
  • Uploaded on

Data link layer (2). Review. Framing. ESC. What happens if ESC ESC FLAG ESC ESC real FLAG How to tell whether a received frame is good or not? Three protocols. The last one deals with slow receiver and noisy channel. Solution is ack (expc) plus sequence number. Stop and Wait (Protocol 3).

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Data link layer (2)' - bernad


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
review
Review
  • Framing. ESC. What happens if
    • ESC ESC
    • FLAG ESC
    • ESC real FLAG
  • How to tell whether a received frame is good or not?
  • Three protocols. The last one deals with slow receiver and noisy channel. Solution is ack (expc) plus sequence number.
stop and wait protocol 3
Stop and Wait (Protocol 3)
  • Sender.
    • Grab data from the network layer.
    • Send to physical layer with the current sequence number and start timer.
    • Wait for ack(Expc). If got ack for the frame sent before time out, increment the sequence number, repeat 1. Else, timeout, repeat 2.
  • Receiver
    • Get data from the physical layer
    • If it is with the expected sequence number, give it to the network layer, increment the sequence number.
    • send ack (Expc). Goto 1.
review1
Review
  • How it deals with
    • Lost packet
    • Lost ACK
    • Premature timeout
correctness part is done
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)
optimization
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.
solution
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
question
Question
  • Given link speed and link delay, how large should the window be to achieve 100% efficiency?
sender window
Sender window
  • The sender has a window from m+1 to m+n means that
    • the sender has received ack from the receiver for frame up to m,
    • the sender is allowed to send m+1, m+2, …, m+n. 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
receiver window
Receiver window
  • The receiver also has a window. He has window from x+1, x+2, …, x+y means that
    • He has correctly received frames up to x
    • And he only accepts frames from x+1, x+2, …, x+y, any other frames will be discarded.
  • Receiver window is constrained by the buffer size.
go back n
Go-Back-N
  • Let’s first consider the receiver’s window size is only 1.
  • This is called Go-Back-N.
go back n protocol 4
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 current sequence number. Start timer. Update sequence number.

If got ack for frame m, if m is outside the window, don’t do anything. If m is inside the window, consider all frames in the window with seq. number less than m acked. Forward window.

If timeout for frame m, resend all frames in the window with sequence number greater than m.

}

Receiver

while (1)

{

Get data from the physical layer

If it is with the expected sequence number, give it to the network layer, increment the sequence number.

send ack (Expc).

}

go back n1
Go-Back-N
  • Two new things.
    • Cumulative ACK
    • Resend every frame after the timeout frame
go back n3
Go-Back-N
  • What if ACK is lost?
go back n4
Go-Back-N
  • Works fine is error is rare. Achieves full capacity.
  • Else wastes bandwidth.
selective repeat protocol 5
Selective Repeat (Protocol 5)
  • Further optimization. The only difference is at the receiver’s side.
  • Receiver has a window greater than 1.
  • Don’t discard frames simply because some earlier frames was damaged.
selective repeat
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 sequence number. Start timer. Update sequence number.

If got ack for frame m, if m is outside the window, don’t do anything. If m is inside the window, consider all frames in the window with seq. number less than m acked. Forward window.

If timeout for frame m, resend all frames in the window with sequence number greater than m.

}

Receiver

while (1)

{

Get frame from the physical layer. If it is within the receiver window and hasn’t been received before, fill in the slot.

Forward the beginning of the receiver window.

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 new receiver window).

}

piggybacking
Piggybacking
  • Considered only one direction. Bidirection.
  • Piggybacking
    • Combining ACK with data
    • When no data?
      • Wait some time and ACK anyway.
  • Internet. PPP.
number of bits in sequence number
Number of bits in sequence number
  • Go-Back-N. If the sequence number is x bits. How large can the window be?
  • x=2 and window size is 4.
  • Case 1.
    • Sender sends 0,1,2,3.
    • Sender got ACK for 3. Send another 0,1,2,3.
  • Case 2.
    • Sender sends 0,1,2,3.
    • Sender didn’t get any ACK. Time out. Resend the first 0,1,2,3.
slide22

Selective repeat:Dilemma

  • Example:
  • seq #’s: 0, 1, 2, 3
  • window size=3
  • receiver sees no difference in two scenarios!
  • incorrectly passes duplicate data as new in (a)
  • Q: what relationship between seq # size and window size?
  • window size = (MAXSEQNO + 1)/2