Key Assignment 1
Key Assignment 1
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 a
frame 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 time
charts supporting your answer. Consider all possible scenarios that give the correct
solution.
Problem 1 (continued)
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 that
this 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.
t=21
rc= 1
t=3
ra = 6
rc = 7
ACK
ACK
Frame C
Frame A
3
19SIFS 21
DIFS + 6
t=3
ra = 0
rc = 7
t=15
rc= 7
25
35
DIFS +1
t=25
rc = 0
ACK
ACK
Frame C
Frame A
DIFS
37
13SIFS 15
DIFS +7
25
35
37
Scenario 1
rc=7, ra= 6
time
Scenario 7
rc=7, ra=0
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
Maximum finish time = 37
Probability {Time = 37}
= 14 (1/8) (1/8)
= 14/64
= 7/32 = 0.2187
t=7
ra = 0
rc = 1
RTS
RTS
DIFS
DIFS
t=23
rc = 1
ACK
CTS
Frame A
SIFS
11
t=27
rc = 0
RTS
ACK
CTS
Frame C
DIFS +1
21
23
27
29
31
41
43
time
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
Finish Time = 43
Probability {Scenario 1}
Problem 2
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 = 7
Ethernet 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 are
served 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 a
frame of length 10.
Problem 2 (continued)
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 - Solution
Ethernet Frames
rc=0
rd=1
Col+jam
IFG
IFG
0 1
Fc=6
9
Scenario 1
Fd=20
IFG
10
30
rc=0
rd=1
time
Minimum time = 30
Col+jam
IFG
IFG
0 1
Fd=20
IFG
23
Scenario 2
Fc=6
24
30
time
The minimum finish time has one collision and is achieved in two scenarios as shown
above.
Prob{Time=30} = Prob{rc=0 & rd=1 OR rc=1 & rd=0}
= 0.50.5 + 0.50.5 = 1/2 = 0.5 = 50%
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.
Problem 2 - Solution
There are many WiFi scenarios in which the finish time is less than or equal to 30. The
solution 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).
Six Scenarios with ra=0
rb=0
ra=0
ACK
Fa=5
DIFS
Fb=10
DIFS
SIFS
ACK
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.
Five Scenarios with ra=1
ra=1
rb=0
ACK
Fa=5
DIFS + 1
SIFS
10
ACK
Fb=10
DIFS
14
24
26
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.
time
Problem 2 - Solution
Four Scenarios with ra=2
ra=2
rb=0
ACK
Fa=5
DIFS + 2
ACK
10
Fb=10
DIFS
SIFS
11
Example Scenario
ra=2, rb=0
Finish time =27
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.
Example Scenario
ra=3, rb=1
Finish time =29
rb=1
ACK
Fa=5
DIFS + 3
SIFS
11
12
ACK
Fb=10
DIFS+1
17
ra=3 and rb = 0, 1 or 2.
:
Note: the scenarios ra=3 and rb > 2 give finish time > 30.
27
29
time
Problem 2 - Solution
Single Scenario
ra=4, rb=1
Finish time =30
rb=1
ACK
Fa=5
DIFS + 4
SIFS
ACK
Fb=10
DIFS+1
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.
Single Scenario
ra=5, rb=0
Finish time =30
rb=0
ra=1
ACK
Fb=10
DIFS + 4
SIFS
17
18
ACK
Fa=5
DIFS+1
23
ra=5 and rb = 0.
:
Note: the scenario ra= 5 and rb=0 give finish time > 30.
28
30
time
Problem 2 - Solution
Earliest finish time Tfin =30
Ethernet LAN
There are only two Ethernet Scenarios with Tfin = 30. All other scenarios have
larger finish time.
Probability{Ethernet finish time = 30} = 0.5
WiFi LAN
There 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
WiFi
Problem 3
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 each
of 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 each
collision 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.
ra2=0
rb1=1 or 2 or 3
Collision
Collision
Fa1
0 1
Fa2
4
Fb1
8
Fb2
11
Fb3
14
17
time
Minimum time = 17
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 for
frame 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%
ra2=0
rb1=1
Collision
Collision
Fa1
0
Fa2
2
ra1=1
rb1=0
ra1=2
rb2=0
Collision
Collision
Fb2
2
Fb2
5
Scenario 1
Fb3
6
time
Minimum time = 7
Fb1
0
Fb1
Fb3
4
Fa1
5
Scenario 2
Fa2
6
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 selects
ra1= 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%