Key Assignment 1

download Key Assignment 1

of 14

Transcript of Key Assignment 1

  • 8/10/2019 Key Assignment 1

    1/14

    Consider an CSMA/CA 802.11 WLAN with three stations: A, B, and C. Node B is the

    access point and is in full wireless contact with both A and C. The following are the

    appropriate parameter values for this WLAN (note: artificial values are used for the

    WLAN parameters to simplify your calculations)

    Time slot = 1, DIFS = 3, SIFS = 1

    Length of RTS, CTS, or ACK = 1

    Initial backoff range for a frame is [0,7]

    At time t= 0, the application layer of station A generated data to be transmitted as aframe of length 10 destined to B. At that same time (t=0), the application layer of

    station C generated data to be transmitted as a frame of length 10 destined to B. Before

    transmitting a frame, both node A and node C must wait for DIFS, followed by a

    random backoff period. The hidden node problem does not exist in this WLAN.

    Note: Clearly indicate the backoff random counter selected by each node and give timecharts supporting your answer. Consider all possible scenarios that give the correct

    solution.

    Problem 1

  • 8/10/2019 Key Assignment 1

    2/14

    a) Assume the RTS/CTS mechanism is not used in this WLAN. What is the

    maximum time T at which both data frames are successfully received and

    acknowledged by node B without any collision? What is the probability thatthis maximum time occurs?

    b) Assume the RTS/CTS mechanism is used in this WLAN. What is the earliest

    time T at which both data frames are successfully received and acknowledged

    by node B after exactly one collision? What is the probability that this earliest

    time is achieved? Assume that after collision, the DIFS idle period overlaps

    with SIFS.

    Problem 1 (continued)

  • 8/10/2019 Key Assignment 1

    3/14

    Problem 1 Part a - Solution

    3 9 19 21 25 35 37 time

    Maximum time is achieved by choosing the largest backoff value for ra (or for

    rc). There are 14 scenarios:

    Scenarios 1-7 rc =7 and ra = 6, 5, 4, 3, 2 ,1, 0

    Scenarios 8-14 ra =7 and rc = 6, 5, 4, 3, 2 ,1, 0

    t=21

    rc= 1t=3

    ra = 6

    rc = 7

    DIFS + 6 DIFS +1

    ACKACK

    t=25

    rc = 0

    SIFS

    Scenario 1

    rc=7, ra= 6

    Maximum finish time = 37

    Probability {Time = 37} = 14 (1/8) (1/8)

    = 14/64

    = 7/32 = 0.2187

    3 13 15 25 35 37 time

    t=15

    rc= 7

    t=3

    ra = 0

    rc = 7

    DIFS DIFS +7

    ACKACK

    t=25

    rc = 0

    SIFS

    Scenario 7

    rc=7, ra=0

  • 8/10/2019 Key Assignment 1

    4/14

    Problem 1 Part b-Solution

    3 7 9 11 21 23 27 29 31 41 43 time

    t=3

    ra = 0

    rc = 0

    DIFS DIFS +1

    ACKACK

    t=23

    rc = 1

    DIFS

    CTS RTS CTS

    Finish Time = 43Probability {Scenario 1} = Prob {ra=0 & rc=0 then ra=1 & rc=0 }

    = (1/8) (1/8) (1/16) (1/16) = 1/2^14

    Probability {Scenario 2 } = 1/2^14

    Probability {Time =43 with one collision} = 2 /2^14 = 1/8192 = 0.00012

    RTS RTS

    t=7

    ra = 0

    rc = 1

    SIFS

    t=27

    rc = 0

    b) Earliest time is achieved by choosing the fastest time for the collision (i.e.,

    ra=rc=0) then choosing the smallest values of ra and rc after collision such

    that ra rc. There are two scenarios:

    Scenario 1: ra =0, rc=0 to get collision then ra=0, rc=1

    Scenario 2: ra =0, rc=0 to get collision then ra=1, rc=0

    Scenario 1: ra =0, rc=0 then ra =0, rc=1

  • 8/10/2019 Key Assignment 1

    5/14

    Consider a Home LAN router equipped with a shared medium Ethernet hub and a

    WiFi access point. Assume the following approximate parameter values

    WiFi slot time = 1, DIFS = 3, SIFS = WiFi ACK= 1, CWmin = 7Ethernet slot time = 5, Ethernet IFG = 1

    Ethernet collision detection period plus jam signal = 1

    // Note: the collision detection period is the length of the partially aborted frame.

    Two laptops A and B are served by the WiFi LAN and two workstations C and D areserved by the Ethernet LAN. At time t=0, the application layer of each of laptop A,

    workstation C and workstation D generated data to be transmitted as a single frame of

    length 5, 6, 20, respectively. Note that a node in WiFi must wait for DIFS idle period

    from t=0 to t=3 while a node in Ethernet must wait for IFG idle period from t=0 to t=1.

    At time t = 4, the application layer of laptop B generated data to be transmitted as aframe of length 10.

    Problem 2

  • 8/10/2019 Key Assignment 1

    6/14

    Denote the finish time of the four frames by Ta , Tb, Tc , Td , where the laptop finish

    time Ta or Tb is the time when the corresponding WiFi frame is successfully

    acknowledged by the access point and the workstation finish time Tc or Td is the time

    when the corresponding Ethernet frame is completely transmitted without collision.Define the overall finish time Tfin to be Tfin = Max { Ta , Tb, Tc , Td }.

    a) What is the earliest overall finish time, i.e., the smallest value of Tfin?

    b) What is the probability that the earliest overall finish time computed in part a is

    actually achieved?

    Note: the lengths of the two WiFi frames are 5 and 10 units of time and the lengths of

    the two Ethernet frames are 6 and 20 of the same units of time. Do not multiply the

    length of Ethernet frames by 5.

    Problem 2 (continued)

  • 8/10/2019 Key Assignment 1

    7/14

    Problem 2 - Solution

    0 1 2 3 9 10 30 time

    The minimum finish time has one collision and is achieved in two scenarios as shownabove.

    Prob{Time=30} = Prob{rc=0 & rd=1 OR rc=1 & rd=0}

    = 0.50.5 + 0.50.5 = 1/2 = 0.5 = 50%

    rc=0

    rd=1Col+jam

    Scenario 1

    Minimum time = 30

    The Ethernet LAN and WiFi LAN are independent. The minimum finish time

    Tfin will belong to Ethernet because of its long frames.

    Tfin= 30

    For the WiFi LAN, we need to find the scenarios in which the finish time is less

    than or equal to 30.

    IFGIFG IFG

    Ethernet Frames

    0 1 2 3 23 24 30 time

    rc=0

    rd=1Col+jam

    Scenario 2

    IFGIFG IFG

  • 8/10/2019 Key Assignment 1

    8/14

    Problem 2 - Solution

    3 8 9 13 23 25 time

    ra=0 and rb = 0, 1, 2, 3, 4, or 5. :

    Note: the two scenarios ra=0 and rb=6 or 7 give finish time > 30.

    rb=0ra=0

    DIFS DIFS

    ACKACK

    SIFS

    Scenario : ra=0, rb=0

    Finish time =25

    Six Scenarios with ra=0

    There are many WiFi scenarios in which the finish time is less than or equal to 30. Thesolution is based on the assumption that laptop B will start measuring its DIFS idle time

    at time t=4 and therefore cannot start transmission until time t=6 (when rb=0).

    4 9 10 14 24 26 time

    ra=1 and rb = 0, 1, 2, 3, or 4. :

    Note: the three scenarios ra=1 and rb=5, 6 or 7 give finish time > 30.

    rb=0ra=1

    DIFS + 1 DIFS

    ACKACK

    SIFS

    Scenario : ra=1, rb=0

    Finish time =26

    Five Scenarios with ra=1

  • 8/10/2019 Key Assignment 1

    9/14

    Problem 2 - Solution

    5 10 11 15 25 27 time

    ra=2 and rb = 0, 1, 2, or 3. :

    Note: the scenarios ra=2 and rb > 3 give finish time > 30.

    rb=0ra=2

    DIFS + 2 DIFS

    ACKACK

    SIFS

    Example Scenario

    ra=2, rb=0

    Finish time =27

    Four Scenarios with ra=2

    6 11 12 17 27 29 time

    ra=3 and rb = 0, 1 or 2. :Note: the scenarios ra=3 and rb > 2 give finish time > 30.

    rb=1ra=3

    DIFS + 3 DIFS+1

    ACKACK

    SIFS

    Example Scenario

    ra=3, rb=1Finish time =29

    Three Scenarios with ra=3

  • 8/10/2019 Key Assignment 1

    10/14

    Problem 2 - Solution

    7 12 13 18 28 30 time

    ra=4 and rb = 1. :

    Note: the scenario ra= 4 and rb=0 causes collision and the scenarios ra=4 and rb > 1

    give finish time > 30.

    rb=1ra=4

    DIFS + 4 DIFS+1

    ACKACK

    SIFS

    Single Scenariora=4, rb=1

    Finish time =30

    One Scenarios with ra=4 and rb =2

    rb=1

    7 17 18 23 28 30 time

    ra=5 and rb = 0. :Note: the scenario ra= 5 and rb=0 give finish time > 30.

    ra=1ra=5

    DIFS + 4 DIFS+1

    ACKACK

    SIFS

    Single Scenariora=5, rb=0

    Finish time =30rb=0

    One Scenarios with ra=5 and rb =0

  • 8/10/2019 Key Assignment 1

    11/14

    Problem 2 - Solution

    Earliest finish time Tfin =30

    Ethernet LANThere are only two Ethernet Scenarios with Tfin = 30. All other scenarios have

    larger finish time.Probability{Ethernet finish time = 30} = 0.5

    WiFi LANThere are 20 scenarios with finish time less than or equal 30.

    Probability{WiFi finish time 30} = 20 * (1/8)*(1/8) = 20/64 = 0.3125

    The two LANs are independent.

    Probability {minimum finish time Tfin = 30}

    = 0.5 Ethernet * 0.1325 WiFi= 0.156 = 15.6%

  • 8/10/2019 Key Assignment 1

    12/14

    Consider a shared-medium Ethernet hub (repeater) with two active nodes, A

    and B. At time t= 0, the application layer of station A generated data to be

    transmitted as two frames. At the same time (t=0), the application layer of

    station B generated data to be transmitted as three frames. The length of eachof the five frames is 3 units of time (a unit of time is one Ethernet slot time).

    The network managed to transmit all five frames by time Tfin, i.e., Tfin is the

    time when the last bit of the last frame was successfully transmitted. For

    simplicity, ignore the length of the inter-frame gap and assume that eachcollision wastes a total of one unit of time (including the collision detection

    period, the jam signal, and the inter-frame gap before and after collision).

    a) What is the minimum possible value of Tfin? What is the probability that

    this minimum value is achieved? Show the details of your work.b) Repeat part (a) assuming that the length of each frame is 1 unit of time.

    Problem 3

  • 8/10/2019 Key Assignment 1

    13/14

    Problem 3 Part a - Solution

    0 1 4 5 8 11 14 17 time

    The minimum number of collisions is two and is achieved in one situation: the two frames

    from A are transmitted first.

    Frame Fa1 is transmitted first after colliding with frame Fb1. In the second collision forframe Fb1 at t=4, the new frame Fa2 selects ra2 =0 and frame Fb1 selects rb1= 1 or 2, or

    3.

    Prob{Time=17} = Prob{ra1=0 & rb1=1 AND ra2=0 & rb1=1, 2, 3 }

    = 0.50.5 0.5 (3/4) = 3/32 = 0.0937

    = 9.37%

    ra1=0rb1=1

    Collision

    ra2=0rb1=1 or 2 or 3

    Collision

    Minimum time = 17

    Note: any other scenario will produce at least three collisions.

  • 8/10/2019 Key Assignment 1

    14/14

    Problem 3 Part b - Solution

    0 1 2 3 4 5 6 7 time

    The minimum number of collisions is two and is achieved in two scenarios: the two frames

    from A are transmitted first or the three frames from B are transmitted first.Scenario 1: Frame Fa1 is transmitted first after colliding with frame Fb1. In the second

    collision for frame Fb1 at t=2, the new frame Fa2 selects ra2 =0 and frame Fb1 selects

    rb1= 1 but not 2 or 3 to minimize the finish time.

    Scenario 2: Frame Fb1 is transmitted first after colliding with frame Fa1. In the second

    collision for frame Fa1 at t=2, the new frame Fb2 selects rb2 =0 and frame Fa1 selectsra1= 2 to wake up at time t= 5 immediately after the transmission of frame Fb3.

    Prob{Time= 7} = Prob{ra1=0 & rb1=1 AND ra2=0 & rb1=1 // scenario 1 }

    + Prob{ra1=1 & rb1=0 AND ra1=2 & rb2= 0 // scenario 2 }

    = 0.50.5 0.5 (1/4) + 0.50.5 0.5 (1/4) = 2/32 = 0.0625 = 6.25%

    ra1=0rb1=1

    Collision

    ra2=0rb1=1

    Collision

    Scenario 1

    Minimum time = 7

    0 1 2 3 4 5 6 7 time

    ra1=1rb1=0

    Collision

    ra1=2rb2=0

    Collision

    Scenario 2