Improving throughput by tuning carrier sensing in 802.11 wireless networks
Carrier Sensing - Informationskodning€¦ · Carrier Sensing We assume that a node can hear...
Transcript of Carrier Sensing - Informationskodning€¦ · Carrier Sensing We assume that a node can hear...
Carrier Sensing
We assume that a node can hear whether other nodesare transmitting after some small propagation anddetection delay
We allow nodes to initiate transmission after detectingan idle period, no need to wait for slot boundary
This strategy is called Carrier Sense Multiple Access(CSMA), even though it doesn’t necessarily imply usinga carrier but only some possibility to detect idle periodsquickly
Information Networks – p.1/42
Carrier Sensing
Let β denote the propagation and detection delaymeasured in expected packet transmission time units,thus with τ this time in second, C the raw channel bitrate in bits/second and L the expected number of bits ina packet
β =τC
L
The performance of CSMA degrades with increasing β,thus with increasing channel rate and with decreasingpacket size
A simple model for CSMA is to model it as a slottedsystem where idle slots terminates after β time units,we thus no longer assume equal-duration time slots
Information Networks – p.2/42
CSMA, assumptions
Slotted system but not with equal-duration time slots
We no longer assume data packets of equal length butnormalize time so that expected packet transmission is1 time unit
(0, 1, e)-feedback with a maximum delay β
For simplicity we assume infinite set of nodes
Poisson arrivals with overall intensity λ
Information Networks – p.3/42
CSMA Slotted Aloha
Major difference to slotted Aloha is that idle slots haveduration β
Another difference is that newly arriving packets whenchannel is busy are regarded as backlogged and willtransmit with probability qr after each subsequent idleslot; packets arriving during an idle slot will betransmitted in next slot as usual
This is called nonpersistent CSMA to distinguish fromtwo slight variations
Information Networks – p.4/42
CSMA Slotted Aloha, variants
Persistent CSMA: arrivals during busy slot transmit atend of that slot, thus causing collision with relativelyhigh probability
P-persistent CSMA: collided packets and newly arrivedpackets waiting for the end of a busy period usedifferent probabilities for transmission in next slot
We will focus on nonpersistent CSMA
Information Networks – p.5/42
Nonpersistent CSMA Slotted Aloha
We again use Markov chain with number of backloggedpackets, n, as state and end of idle slots as statetransition times
Each busy slot (success or collision) must be followedby an idle slot (since this is nonpersistent CSMA)
For simplicity assume all data packets have unit length
Time between state transitions are either β (idle slot) or1 + β (busy slot followed by idle slot)
Information Networks – p.6/42
Nonpersistent CSMA Slotted Aloha
Probability of idle slot is probability of no arrivals inprevious idle slot and no retransmissions by backloggednodes, thus e−λβ(1 − qr)
n
Expected time between state transitions in state n isβ + (1 − e−λβ(1 − qr)
n)
Expected number of arrivals between state transitions isλ(β + 1 − e−λβ(1 − qr)
n)
Expected number of departures between statetransitions in state n is probability of successfultransmission
(
λβ +qrn
1 − qr
)
e−λβ(1 − qr)n
Information Networks – p.7/42
Nonpersistent CSMA Slotted Aloha
The drift in state n is as before the expected number ofarrivals less expected numbers of departures
Dn = λ(β+1−e−λβ(1−qr)n)−
(
λβ +qrn
1 − qr
)
e−λβ(1−qr)n
For small qr we make the approximation(1 − qr)
n−1 ≈ (1 − qr)n ≈ e−qrn and get
Dn ≈ λ(β + 1 − e−g(n)) − g(n)e−g(n)
where g(n) = λβ + qrn is expected number of attemptedtransmissions
Information Networks – p.8/42
Nonpersistent CSMA Slotted Aloha
The drift is negative if
λ <g(n)e−g(n)
β + 1 − e−g(n)
where the numerator is the expected number ofdepartures per state transition and the denominator isthe expected duration of a state transition, so it can beinterpreted as the departure rate in state n
We can plot departure rate as function of attemptedrate as before, for small β this function has a maximumof approximately 1/(1 +
√2β) for g =
√2β
Information Networks – p.9/42
Nonpersistent CSMA Slotted Aloha
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Information Networks – p.10/42
Nonpersistent CSMA Slotted Aloha
We have the same stability problem as in ordinaryslotted Aloha
For fixed qr, g(n) grows with n and when n becomes toolarge, departure rate is less than arrival rate, leading toyet larger backlogs
Expected idle time that a backlogged node must waitbefore attempting retransmission isβ(qr + 2qr(1 − qr) + 3qr(1 − qr)
2 + . . .) = β/qr, for small βand modest λ, qr can be quite small without causingappreciable delay, this means that backlog must be verylarge before instability sets in and the problem is lessserious than for ordinary Aloha
Information Networks – p.11/42
CSMA Slotted Aloha
P-persistent CSMA, in which packets are transmittedafter idle slots with probability p if they are new arrivalsand with some much smaller probability qr if they havehad collisions will give a little extra protection againstinstability
A more fundamental way to achieve stability is to do apseudo-Bayesian stabilization as for the ordinary slottedAloha
All packets are considered backlogged immediatelyafter entering the system
At end of each idle slot, each backlogged packet istransmitted with probability qr which will vary with theestimated channel backlog n̂
Information Networks – p.12/42
Pseudo-Bayesian stabilization
In state n, expected number of packets transmitted atend of idle slot is g(n) = nqr, packet departure rate ismaximized (for small β and qr) when g(n) =
√2β so we
choose
qr(n̂) = min
{√2β
n̂,√
2β
}
Backlog estimate is updated according to
n̂k+1 =
n̂k(1 − qr(n̂k)) + λβ, for idlen̂k(1 − qr(n̂k)) + λ(1 + β), for successn̂k + 2 + λ(1 + β), for collision
Information Networks – p.13/42
Pseudo-Bayesian stabilization
Again the update rule for this Pseudo-Bayesianstabilization can be motivated by showing that for an apriori Poisson distribution of nk with mean n̂k, the aposteriori distribution of nk is
Poisson with mean n̂k(1 − qr(n̂k)) given an idle slotPoisson with mean 1 + n̂k(1 − qr(n̂k)) given asuccessful transmissionapproximately Poisson with mean n̂k + 2 given acollision
Adding the expected arrivals in the three cases yieldsthe suggested update rule
Information Networks – p.14/42
Pseudo-Bayesian stabilization
When nk and n̂k are small then qr is relatively large andnew arrivals are scarcely delayed at all
When n̂k ≈ nk and nk is large, the departure rate isapproximately 1/(1 +
√2β), so for λ < 1/(1 +
√2β) the
backlog decreases on average
If |nk − n̂k| is large the expected change in backlog canbe positive, but the expected change in |nk − n̂k| isnegative so eventually n̂k will be close to nk andbacklog will decrease; similar to pseudo-Bayesianstabilization of ordinary slotted Aloha
Information Networks – p.15/42
Delay for Pseudo-Bayesian stabilization
We can do a similar analysis of the expected queueingdelay as for pseudo-Bayesian stabilization of ordinaryslotted Aloha
Let Wi be the delay from arrival of ith packet untilbeginning of ith successful transmission
Average of Wi over all i is the expected queueing delayW
Let ni be the number of backlogged packets at theinstant before packet i’s arrival, not counting any packetcurrently in successful transmission
Information Networks – p.16/42
Delay for Pseudo-Bayesian stabilization
Wi = Ri +
ni∑
j=1
tj + yi
where Ri is residual time until next state transition, tj isthe sequence of subsequent intervals until each of thenext ni successful transmissions are completed, and yi
is the remaining interval until the ith successfultransmission starts
The backlog is at least 1 in all of the state transitionintervals and we make the simplifying approximationthat the number of attempted transmissions in each ofthese intervals are Poisson with parameter g
Information Networks – p.17/42
Delay for Pseudo-Bayesian stabilization
The difference from analysis of ordinary slotted Aloha isthat there we assumed a successful transmissionalways occurred, this is motivated by our new qr is keptsmall
The expected value for each tj is given by
E[t] = e−g(β+E[t])+ge−g(1+β)+[1−(1+g)e−g ](1+β+E[t])
The first term corresponds to an idle transmission infirst state transmission interval, second term for asuccess, and third term for collision
Information Networks – p.18/42
Delay for Pseudo-Bayesian stabilization
Solving for E[t] gives
E[t] =1 + β − e−g
ge−g
This is the reciprocal of expected departure rate andthus is approximately minimized by g =
√2β
Averaging over i and using Little’s theorem we get
W (1 − λE[t]) = E[R] + E[y]
Information Networks – p.19/42
Delay for Pseudo-Bayesian stabilization
The expected residual time E[R] is approximated byobserving that the system spends a fraction λ(1 + β) ofthe time in successful state transition intervals, and theexpected residual time for arrivals in these intervals is(1 + β)/2
The fraction of time spend in collision intervals isnegligible (for small β) compared with that for success,and residual time for idle intervals is negligible too
Thus,
E[R] ≈ λ(1 + β)2
2
Information Networks – p.20/42
Delay for Pseudo-Bayesian stabilization
Finally E[y] is just E[t] less the time for a successfultransmission, E[y] = E[t] − (1 + β)
Putting all this together we get
W ≈ λ(1 + β)2 + 2(E[t] − (1 + β))
2(1 − λE[t])
This expression is minimized over g by minimizing E[t]
which is 1 +√
2β at g =√
2β (for small β), thus
W ≈ λ + 2√
2β
2(1 − λ(1 +√
2β))
Information Networks – p.21/42
Delay for Pseudo-Bayesian stabilization
The delay for stabilized CSMA Aloha
W ≈ λ + 2√
2β
2(1 − λ(1 +√
2β))
is similar to the M/D/1 queueing delay with service timeµ = 1 (we assumed time measured in average packettransmission time)
W =λ
2(1 − λ)
By stabilizing CSMA Aloha we modify qr with thebacklog to maintain a departure rate close to1/(1 +
√2β) whenever a backlog exists
Information Networks – p.22/42
Unslotted CSMA Aloha
In slotted CSMA Aloha we assumed that all nodes weresynchronized to start transmissions only at timemultiples of β in idle period, we now remove thatrestriction and assume that when a packet arrives itstransmission starts immediately if it senses the channelto be idle
If the channel is sensed to be busy, or if transmissionresults in a collision, the packet is regarded asbacklogged
Each backlogged packet repeatedly attempts toretransmit at randomly selected times separated byindependent exponentially distributed random waitingtimes τ with probability density xe−xτ
Information Networks – p.23/42
Unslotted CSMA Aloha
If the channel is idle at one of these times the packet istransmitted and this continues until the packet has beensuccessfully transmitted
We again assume propagation and detection delay of β,so if one transmission starts at time t, another one willnot detect channel as busy until time t + β thus causingthe possibility of collisions
For an idle period that starts with a backlog of n thetime until first transmission starts is exponentiallydistributed with rate G(n) = λ + nx
Note that G(n) is now attempt rate in packets per unittime, previously g(n) was packets per idle slot
Information Networks – p.24/42
Unslotted CSMA Aloha
After initiation of this first transmission, the backlog iseither n (if a new arrival started the transmission) orn − 1 (if a backlogged packet started)
The time from this first transmission until next newarrival or backlogged node is exponentially distributedwith rate G(n) or G(n− 1), this difference is small if βx issmall and we neglect it
Collision occurs if this time is less than β, thusprobability of collision is 1 − e−βG(n) and probability forsuccessful transmission is e−βG(n)
Information Networks – p.25/42
Unslotted CSMA Aloha
The expected time from beginning of one idle perioduntil next is 1/G(n) + (1 + β) where 1/G(n) is the timeuntil first transmission and (1 + β) is time until firsttransmission ends and the channel is detected as idleagain
If a collision occurs there is a slight additional time, lessthan β, until the packets causing the collision are nolonger detected, this time is however negligible sincealready β is negligible
The departure rate when backlog is n is then
e−βG(n)
1/G(n) + (1 + β)
Information Networks – p.26/42
Unslotted CSMA Aloha
For small β the maximum value of this departure rate isapproximately 1/(1 + 2
√β) occuring when G(n) ≈ 1/
√β
This maximum departure rate is slightly lower than forthe slotted case; the reason is the same as when CSMAis not used, the probability for collisions for an unslottedsystem is slightly higher for a given attempt rate
For CSMA, with small β, this difference is quite smalland further in a slotted system β has to be larger due tosynchronization inaccuracies and worst-casepropagation delay
Information Networks – p.27/42
Unslotted CSMA Aloha
Thus unslotted CSMA Aloha is a natural choice
Also unslotted CSMA Aloha has stability problems, andthese can be solved with a pseudo-Bayesianstabilization strategy similar to the slotted case
Information Networks – p.28/42
FCFS splitting algorithm for CSMA
Relatively little can be gained by using splittingalgorithms with CSMA
For FCFS splitting algorithm the maximum stablethroughput is approximately the same as for slottedAloha
This is not surprising when realizing that without CSMAthe major advantage of FCFS algorithm is its efficiencyin resolving collisions, and with CSMA collisions rarelyoccur
When collisions do occur they are resolved in bothstrategies by retransmission with small probability
Information Networks – p.29/42
Multiaccess reservations
It’s quite obvious that if packet lengths are large it’sinefficient to waste time on sending colliding packetsduring an entire slot time
It’s far more efficient to send very short packets in eithercontention mode or a TDM mode to reserve longernoncontending slots for the actual data
In this way the slots wasted by idles or collisions are allshort leading to a higher overall efficiency
Assume reservation packets require v time units whichis much less than the one time unit needed for datapackets
Information Networks – p.30/42
Multiaccess reservations
Let Sr be the maximum throughput for the reservationpackets of the algorithm used for reservation packets(i.e. 1/e for slotted Aloha, 0.478 for splitting, etc)
Over a large number of reservations the time requiredper reservation approaches v/Sr, and an additional unitof time for the data packet, thus the total time per datapacket approaches 1 + v/Sr and the maximumthroughput S in data packets per unit time is
S =1
1 + v/Sr
Information Networks – p.31/42
CSMA/CD
Ethernet is a widely used technique for local areanetworks, a number of nodes are all connected onto acommon cable so that when one node transmits apacket (and all others are silent), all the other nodeshear that packet
In addition, as in carrier sensing, a node can listen tothe cable before transmitting
Finally because of the physical properties of the cable,it is possible for a node to listen to the cable whiletransmitting
Thus, if two nodes start to transmit almostsimultaneously, they will shortly detect a collision inprocess and both cease transmitting
Information Networks – p.32/42
CSMA/CD
This technique is called CSMA/Collision Detection(CSMA/CD)
If one node starts transmitting and no other node startsbefore the first node’s signal has propagated throughoutthe cable, the first node is guaranteed to finish itspacket without collision
Thus, we can view the first portion of a packet asmaking a reservation for the rest
For analytic purposes it’s easiest to visualize Ethernetin terms of slots and minislots, the minislots are ofduration β which denotes the time for the signal topropagate throughout the cable and be detected
Information Networks – p.33/42
Slotted CSMA/CD
If the nodes are synchronized into minislots of durationβ, and if only one node transmits in a minislot, all theother nodes will detect the transmission and not usesubsequent minislots until the entire packet completed
If more than one node transmits in a minislot, eachtransmitting node will detect this and cease transmittingby the end of the minislot
Thus the minislots are used in contention mode, andwhen a successful transmission occurs in a minislot itreserves the channel for the completion of the packet
CSMA/CD can be analyzed with a Markov chain in thesame way as CSMA Aloha
Information Networks – p.34/42
Slotted CSMA/CD
We assume that each backlogged node transmits aftereach idle slot with probability qr, and that the number ofnodes transmitting after an idle slot is Poisson withparameter g(n) = λβ + nqr
If no transmission occurs the idle slot ends after time β,if one transmission occurs the next idle slots ends aftertime 1 + β
We can assume variable-length packets, but tocorrespond to the slotted assumption the packetdurations should be multiples of β, as before weassume expected packet duration is 1
If collision occurs, next idle slot ends after time 2β, thisis because nodes must hear an idle slot after thecollision to know that it’s safe to transmit
Information Networks – p.35/42
Slotted CSMA/CD
The expected length of the interval between statetransitions is then
E[interval] = β + g(n)e−g(n) + β(1 − (1 + g(n))e−g(n))
The expected number of arrivals between statetransmissions is λ times this interval, so the drift in staten is λE[interval] − Psucc, the probability of success isg(n)e−g(n), so we get that the drift is negative if
λ <g(n)e−g(n)
β + g(n)e−g(n) + β(1 − (1 + g(n))e−g(n))
The right-hand side of the inequality can be interpretedas the departure rate in state n
Information Networks – p.36/42
Slotted CSMA/CD
The departure rate is maximized over g(n) at g(n) = 0.77and the resulting maximum is 1/(1 + 3.31β)
CSMA/CD can be stabilized with e.g. thepseudo-Bayesian technique and then the maximum λfor which the system is stable is λ < 1/(1 + 3.31β)
The expected queueing delay can be calculated thesame way as for CSMA, the result for small β andmean-square packet duration X2 is
W ≈ λX2 + β(4.62 + 2λ)
2(1 − λ(1 + 3.31β))
Information Networks – p.37/42
Slotted CSMA/CD
The constant 3.31 is dependent on the detailedassumptions about the system, different values can beobtained by making different assumptions
If β is very small, as usual in Ethernet, this value is notvery important
However, unslotted CSMA/CD makes considerablymore sense than the slotted version, both because ofthe difficulty of synchronizing on short minislots and theadvantages of capitalizing on shorter than maximumpropagation delays when possible
Information Networks – p.38/42
Unslotted CSMA/CD
The exact analysis of unslotted CSMA/CD is somewhatmessy and complicated, e.g. nodes closer together onthe cable detect collisions faster than those morespread apart
A conservative bound on throughput can be obtained byfinding bounds on all relevant parameters from the endof one transmission to the end of next
Assume that each node initiates transmissionsaccording to independent Poisson processes wheneverit senses the channel idle, assume G is overall Poissonintensity
All nodes sense beginning of idle period at most β afterend of transmission, expected time to beginning of nexttransmission is an additional 1/G
Information Networks – p.39/42
Unslotted CSMA/CD
This next packet will collide with some later startingpacket with probability at most 1− e−βG and the collidingpackets will cease transmission after at most 2β
The packet will be successful with probability at leaste−βG and will occupy 1 time unit
Departure rate is success probability divided byexpected time of a success or collision; so
S >e−βG
β + 1/G + 2β(1 − e−βG) + e−βG
Information Networks – p.40/42
Unslotted CSMA/CD
This departure rate will be maximized at βG = 0.43 andthe maximum value is 1/(1 + 6.2β)
The analysis is very conservative, but if β is smallthroughput close to 1 can be achieved and thedifference compared to the result for slotted CSMA/CDis not large
Maximum stable throughput approaches 1 withdecreasing β as a constant times β for CSMA/CD,whereas the approach is as a constant times
√β for
CSMA, the reason is that collisions are not very costlywith CSMA/CD and thus a higher attempt rate can beused
Information Networks – p.41/42
Unslotted CSMA/CD
CSMA/CD (and CSMA) becomes increasinglyinefficient with increasing bus length, increasing datarate, and decreasing packet size
Recall that β is in units of data packet duration, thus if τis propagation delay and detection time in seconds, C israw data rate on the bus, and L is average packetlength, then β = τC/L
Neither CSMA nor CSMA/CD are reasonable systemchoices if β is more than a few tenths
Information Networks – p.42/42