Top Banner

of 38

Lecture Datalink

Apr 08, 2018

Download

Documents

Nancy Tapia
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/6/2019 Lecture Datalink

    1/38

    1

    Automatic Repeat Request

  • 8/6/2019 Lecture Datalink

    2/38

    2

    The Problem

    data in

    data out

    Tx

    -

    -

    -

    Rx

    Transmission of data requires series of PDUs to be sent

    PDU may be lost

    PDU may be corrupted

  • 8/6/2019 Lecture Datalink

    3/38

    3

    Automatic Repeat Request

    data in

    data out

    Tx

    -

    -

    -

    I

    N

    ACK

    N

    I

    N+1

    NAK

    N+1

    I

    N+1

    ACK

    N+1

    Rx

    automatic repeat request (ARQ)

    Data link layer (transport layer, application layer, . . . )

    Number PDUs, and add error checking

    Data in I-frames, Acknowledgement in ACK-frames

  • 8/6/2019 Lecture Datalink

    4/38

    4

    Two Approaches to ARQ

    idle RQ

    Tx waits after each I(N) until it receives ACK(N) or NAK(N) or times out

    also called stop-and-wait or synchronous

    continuous RQ

    Tx sends continuous stream of I-frames

    can send I(N+1) before receiving ACK(N)

    also called asynchronous

  • 8/6/2019 Lecture Datalink

    5/38

    5

    Idle RQ: Tx and Rx Actions

    Rx

    TxI

    N

    time

    R=N

    T=N =N+1

  • 8/6/2019 Lecture Datalink

    6/38

    6

    Idle RQ: Tx and Rx Actions

    Rx

    TxI

    N

    I

    NN

    time

    R=N =N+1

    T=N =N+1

  • 8/6/2019 Lecture Datalink

    7/38

    7

    Idle RQ: Tx and Rx Actions

    Rx

    TxI

    N

    I

    NACK

    NN

    time

    R=N =N+1

    T=N =N+1

  • 8/6/2019 Lecture Datalink

    8/38

    8

    Idle RQ: Tx and Rx Actions

    Rx

    TxI

    NACK

    N

    I

    NACK

    NN

    time

    R=N =N+1

    T=N =N+1

  • 8/6/2019 Lecture Datalink

    9/38

    9

    Idle RQ: Tx and Rx Actions

    Rx

    TxI

    NACK

    NI

    N+1

    I

    NACK

    NN

    time

    R=N =N+1

    T=N =N+1 =N+2

  • 8/6/2019 Lecture Datalink

    10/38

    10

    Idle RQ: Tx and Rx Actions

    Rx

    TxI

    NACK

    NI

    N+1ACK

    N+1I

    N+2

    I

    NACK

    NI

    N+1ACK

    N+1I

    N+2ACK

    N+2N

    N

    N

    time

    R=N =N+1 =N+2 =N+3

    T=N =N+1 =N+2 =N+3

  • 8/6/2019 Lecture Datalink

    11/38

    11

    Worksheet: Automatic Repeat Request

    Rx

    Tx?

    t

  • 8/6/2019 Lecture Datalink

    12/38

    12

    Idle RQ: Stop-and-wait efficiency

    Rx

    TxI

    NACK

    NI

    N+1ACK

    N+1I

    N+2

    I

    NACK

    NI

    N+1ACK

    N+1I

    N+2ACK

    N+2

    N

    N

    N

    time

    TR -

    TP

    -TI

    -TD

    -TA

    -TP

    -

    TR = TI + 2TP + TD + TA

    s =TI

    TI + 2TP + TD + TA

  • 8/6/2019 Lecture Datalink

    13/38

    13

    Idle RQ: Improving performance

    s =TI

    TI + 2TP + TD + TA

    Increase s?

    reduce TP by decreasing the distance between Tx and Rx

    usually not possible

    increase TI by decreasing the bit rate

    would not want to do this

    tells us Idle RQ more efficient on slower channels

    increase TI by increasing the number of bits per I-frame

    larger I-frames more likely to suffer errors

  • 8/6/2019 Lecture Datalink

    14/38

    14

    Idle RQ: Example Protocol Efficiency Calculation

    Compute the maximum data throughput of Idle RQ

    10Mbs1communications system

    I-frame size is 92 bits and the ACK-frame size is 8 bits

    via a satellite in orbit at 37,500km above the Earths surface

    propagation speed300 106

    ms1

    TI =92

    10106= 9.2 106s

    TA =8

    10106= 0.8 106s

    assume TD = 0

    TP = 237.5106300106

    = 0.25s

    s =9.2106

    9.2105+20.25+0.8106= 18.4 106

    throughput = sB = 18.4 106 10M bs1 = 184bs1

    5

  • 8/6/2019 Lecture Datalink

    15/38

    15

    Overall Efficiency of Idle RQ

    Three factors cause the raw bit-rate of a channel to be wasted (i=no I-frame bits,

    c=control bits in I-frame, a=no ACK-frame bits)

    Wastage due to stop-and-wait protocol

    s =TI

    TI + 2TP + TA + TD

    Wastage due to errors forcing retransmission

    e = (1 BER)i+a e

    1

    1 + p

    Wastage due to control information

    c =i c

    i + a

    Overall efficiency i = sec

    16

  • 8/6/2019 Lecture Datalink

    16/38

    16

    Worksheet: Overall Efficiency of Idle RQ

    I-frames of 10000 bits; hosts separated by 500km over a 1Mbs1 link. The

    I-frames consist of 1000 bits of header and 9000 bits of data. The signalpropagation speed is 200 106ms1, and the BER is 105

    1. Calculate the probability that an I-frame is lost due to an error.

    2. What is the error efficiency of the system e?

    3. What is the stop-and-wait efficiency of the system s?

    4. What is the control information efficiency of the system c?

    5. What is the overall efficiency of the Idle RQ protocol?

    17

  • 8/6/2019 Lecture Datalink

    17/38

    17

    Idle RQ Error Handling: Loss of I-frame

    Rx

    TxI

    NACK

    NI

    N+1I

    N+1

    I

    NACK

    NI

    N+1ACK

    N+1N

    N

    time

    TO -

    R=N =N+1 =N+2

    T=N =N+1 =N+2

    Timeout TO must be set at Tx

    TO > TR

    18

  • 8/6/2019 Lecture Datalink

    18/38

    18

    Idle RQ Error Handling: Corrupt I-frame

    Rx

    TxI

    NACK

    NI

    N+1I

    N+1

    I

    NACK

    NI

    N+1 (error)NAK

    N+1

    NAK

    N+1

    I

    N+1ACK

    N+1N

    N N

    time

    R=N =N+1 =N+2

    T=N =N+1 =N+2

    NAK-frame speeds up retransmission of I-frame

    Do not have to use NAK-frames

    19

  • 8/6/2019 Lecture Datalink

    19/38

    19

    Idle RQ Error Handling: Loss of ACK-frame

    Rx

    TxI

    NACK

    NI

    N+1I

    N+1

    I

    NACK

    NI

    N+1ACK

    N+1I

    N+1ACK

    N+1N

    N N

    time

    TO -

    R=N =N+1 =N+2

    T=N =N+1 =N+2

    Rx receives I(N+1) twice

    Really do have to number I-frames!

    20

  • 8/6/2019 Lecture Datalink

    20/38

    20

    Continuous RQ

    Rx

    TxI

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+5I

    N+6

    I

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+5

    ^ ^ ^ ^ ^ ^

    ACK

    N

    ACK

    N+1

    ACK

    N+2

    ACK

    N+3

    ACK

    N+4 time

    R=N

    T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+6

    =N+1 =N+2 =N+3 =N+4 =N+5 =N+6

    RetransmissionList

    I

    N

    I

    N+1I

    N

    I

    N+2I

    N+1

    I

    N+3I

    N+2

    I

    N+4I

    N+3

    I

    N+5I

    N+4

    21

  • 8/6/2019 Lecture Datalink

    21/38

    21

    Go-Back-N: Loss of I-frame

    Rx

    TxI

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+2I

    N+3

    I

    NI

    N+1

    I

    N+3 (ignore)I

    N+4 (ignore)I

    N+2

    ^ ^ ^ ^ ^

    ACK

    N

    ACK

    N+1

    NAK

    N+2 time

    R=N

    T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+5

    =N+1 =N+2 =N+2 =N+2 =N+2 =N+3

    RetransmissionList

    I

    N

    I

    N+1I

    N

    I

    N+2I

    N+1

    I

    N+3I

    N+2

    I

    N+4IN+3

    I

    N+2

    I

    N+4IN+3

    I

    N+2

    22

  • 8/6/2019 Lecture Datalink

    22/38

    22

    Go-Back-N: Loss of NAK-frame

    Rx

    TxI

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+5I

    N+2

    I

    NI

    N+1

    I

    N+3 (ignore)I

    N+4 (ignore)I

    N+5 (ignore)

    ^ ^ ^ ^ ^

    ACK

    N

    ACK

    N+1

    NAK

    N+2 time

    R=N

    T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+5

    =N+1 =N+2 =N+2 =N+2 =N+2 =N+2

    RetransmissionList

    I

    N

    I

    N+1I

    N

    I

    N+2I

    N+1

    I

    N+3I

    N+2

    I

    N+4IN+3

    I

    N+2

    I

    N+5I

    N+4IN+3

    I

    N+2

    23

  • 8/6/2019 Lecture Datalink

    23/38

    23

    Idle RQ: Rough Formula for Efficiency

    r = TRTI= number for frames sent in TR

    p= probability frame suffers error

    error efficiency:

    e 1

    1 + p

    protocol efficiency:

    s =1

    r

    combined efficiency:

    =1

    r + rp

    24

  • 8/6/2019 Lecture Datalink

    24/38

    24

    Go-back-N: Efficiency

    s = 1

    send r = TRTI I-frames for each erroneous I-frame

    e 1

    1 + pr

    c same as idle RQ

    25

  • 8/6/2019 Lecture Datalink

    25/38

    25

    Example: Continuous RQ Go-Back-N protocols

    If Continuous RQ Go-Back-N is being used, calculate the efficiency and through-

    put of a 10Mbs1 satellite communication system with BER of 106 , a satelliteheight of 37,500km, propogation speed 300 106ms1, I-frames 100 bits.

    p = 1 0.9999 = 104

    TI =100

    10106= 105s

    TP =237.5106

    300106= 0.25s

    assume TD = 0, TA = 0

    TR = 105 + 2 0.25 = 0.5s

    r = 0.5105 = 50 10

    3

    g =1

    1+10450103= 1

    6= 0.17

    throughput = 1.7 Mbs1

    26

  • 8/6/2019 Lecture Datalink

    26/38

    26

    Worksheet: Efficiency of Continuous RQ Go-Back-N

    Go-Back-N system uses I-frames of 10000 bits; hosts separated by 500km over a

    10Mbs1

    link. Signal propagation speed is 200 106

    ms1

    .

    1. If no errors occur, what is the throughput we can expect on the link?

    2. If the BER is 105, what is the probability of any one frame being lost?

    3. What is the throughput with this BER?

    4. What would have been the throughput if Idle RQ had been used?

    27

  • 8/6/2019 Lecture Datalink

    27/38

    27

    Go-Back-N: Efficiency

    0

    0.2

    0.4

    0.6

    0.8

    1

    0 0.02 0.04 0.06 0.08 0.1

    e

    p

    r = 1r = 10r = 100

    r = 1000

    28

  • 8/6/2019 Lecture Datalink

    28/38

    8

    Selective Repeat: Explicit Request

    Rx

    TxI

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+2I

    N+5

    I

    NI

    N+1I

    N+3I

    N+4I

    N+2

    ^ ^ ^ ^ ^

    ACKN

    ACKN+1

    NAKN+2

    ACKN+3

    ACKN+4 time

    R=N

    T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+5

    =N+1 =N+2 =N+2 =N+2 =N+2 =N+5

    RetransmissionList

    I

    N

    I

    N+1I

    N

    I

    N+2I

    N+1

    I

    N+3I

    N+2

    I

    N+4I

    N+3I

    N+2

    I

    N+4I

    N+2

    ReceiverBuffer

    I

    N+3I

    N+4I

    N+3

    29

  • 8/6/2019 Lecture Datalink

    29/38

    Selective Repeat: Implicit Retransmission

    Rx

    TxI

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+5I

    N+2

    I

    NI

    N+1I

    N+3I

    N+4I

    N+5

    ^ ^ ^ ^ ^

    ACKN

    ACKN+1

    ACKN+3

    ACKN+4 time

    R=N

    T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+6

    =N+1 =N+2 =N+2 =N+2 =N+2 =N+2

    RetransmissionList

    I

    N

    I

    N+1I

    N

    I

    N+2I

    N+1

    I

    N+3I

    N+2

    I

    N+4I

    N+3I

    N+2

    I

    N+5I

    N+4I

    N+2

    ReceiverBuffer

    I

    N+3I

    N+4I

    N+3

    30

  • 8/6/2019 Lecture Datalink

    30/38

    Selective Repeat: efficiency

    protocol efficieny s = 1

    error efficiency as idle request

    e 1

    1 + p

    c same as idle RQ

    31

  • 8/6/2019 Lecture Datalink

    31/38

    Example: Continuous RQ Selective-Repeat protocols

    If Continuous RQ selective repeat is being used, calculate the efficiency and

    throughput of a 10Mbs

    1 satellite communication system with BER of 10

    6, asatellite height of 37,500km, propogation speed 300 106ms1 , I-frames 100

    bits.

    p = 1 (1 106)100 = 104

    s =1

    1+104 = 0.9999throughput = 10.0 Mbs1

    32

  • 8/6/2019 Lecture Datalink

    32/38

    Comparison of ARQ Protocols

    protocol error combineds e se

    Idle RQ 1r

    1

    1+p1

    r+rp

    Go-Back-N 1 11+rp

    1

    1+rp

    Selective

    Repeat 1 11+p 11+p

    For all, control efficiency

    c =i c

    i + a

    33

  • 8/6/2019 Lecture Datalink

    33/38

    Overall Efficiency for Go-Back-N

    0

    0.2

    0.4

    0.6

    0.8

    1

    0 100 200 300 400 500

    ec

    number of data bits per frame

    r = 1r = 10

    r = 1 graph corresponds to that for Selective Repeat

    34

  • 8/6/2019 Lecture Datalink

    34/38

    Duplex Operation

    Rx

    Tx

    Rx

    TxI

    NI

    N+1ACK

    MI

    N+2ACK

    M+1

    IM

    IM+1

    ACKN

    IM+2

    ACKN+1

    I

    NI

    N+1ACK

    MI

    N+2ACK

    M+1

    I

    M

    I

    M+1

    ACK

    N

    I

    M+2

    ACK

    N+1

    ^ ^ ^

    time

    Can send ACK-frames for I-frame by piggybacking it to I-frame in opposite

    direction

    35

  • 8/6/2019 Lecture Datalink

    35/38

    Idle RQ: Window Size

    Rx

    TxI

    NACK

    NI

    N+1ACK

    N+1I

    N+2

    I

    NACK

    NI

    N+1ACK

    N+1I

    N+2ACK

    N+2N

    N

    N

    time

    R=N =N+1 =N+2 =N+3

    T=N =N+1 =N+2 =N+3

    Tx and Rx only need buffer one I-frame

    36

  • 8/6/2019 Lecture Datalink

    36/38

    Continuous RQ Go-Back-N: Window Size

    Rx

    TxI

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+5I

    N+6

    I

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+5

    ^ ^ ^ ^ ^ ^

    ACK

    N

    ACK

    N+1

    ACK

    N+2

    ACK

    N+3

    ACK

    N+4 time

    R=N

    T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+6

    =N+1 =N+2 =N+3 =N+4 =N+5 =N+6

    RetransmissionList

    I

    N

    I

    N+1I

    N

    I

    N+2I

    N+1

    I

    N+3I

    N+2

    I

    N+4I

    N+3

    I

    N+5I

    N+4

    Tx must buffer r I-frames

    37

  • 8/6/2019 Lecture Datalink

    37/38

    Continuous RQ Selective Repeat: Window Size

    Rx

    TxI

    NI

    N+1I

    N+2I

    N+3I

    N+4I

    N+2I

    N+5

    I

    NI

    N+1I

    N+3I

    N+4I

    N+2

    ^ ^ ^ ^ ^

    ACK

    N

    ACK

    N+1

    NAK

    N+2

    ACK

    N+3

    ACK

    N+4 time

    R=N

    T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+5

    =N+1 =N+2 =N+2 =N+2 =N+2 =N+5

    RetransmissionList

    I

    N

    I

    N+1I

    N

    I

    N+2I

    N+1

    I

    N+3I

    N+2

    I

    N+4I

    N+3I

    N+2

    I

    N+4I

    N+2

    ReceiverBuffer

    I

    N+3I

    N+4I

    N+3

    Tx and Rx must buffer r I-frames

    38

  • 8/6/2019 Lecture Datalink

    38/38

    Sliding Windows

    Error Send Receive S: Maximum sequence

    protocol window size window size number (counting from 1)

    Idle RQ 1 1 2

    Go-back-N r 1 r + 1

    Selective repeat r r 2r

    N does not need to be an infinite range

    Use modulo S