Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11...

9
Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 Ad Hoc Networks Dong Zhou Ten-Hwang Lai Department of Computing and Information Science The Ohio State University {zhoudo, lai}@cis.ohio-state.edu Abstract This paper studies a fundamental problem, clock synchronization, in IEEE 802.11 ad hoc networks. Clock synchronization is important for frequent hopping spread spectrum (FHSS) to ensure that all stations “hop” at the same time; it is also necessary for FHSS, direct sequence spread spec- trum (DSSS) and Orthogonal Frequency-Division Multiplexing (OFDM) to perform power manage- ment. The synchronization mechanism specified in the IEEE 802.11 standards has severe scalability problem. Remedies have been proposed to solve the scalability problem, but these solutions either can not handle mobility very well or the protocol is too experimental without solid analysis. In this paper, we analyze the root cause of the scalability problem and propose two protocols with analytical guidance for implementation. The new solutions are distributed, scalable and very adaptive to sta- tion mobility. The maximum clock drift is improved from over 4000 μs to under 125μs and 50μs respec- tively for our new protocols. Keywords: IEEE 802.11, ad hoc networks, scal- ability, clock synchronization 1 Introduction The IEEE 802.11 standards support the peer-to- peer mode Independent Basic Service Set (IBSS), which is an ad hoc network with all its stations within each other’s transmission range. An ad hoc network can be constructed quickly without much planning and any infrastructure support. Clock synchronization is important for frequent hopping and power management. IEEE 802.11 standards [1, 2, 3, 4] specify a Timing Synchroniza- tion Function (TSF) for the ad hoc mode in the MAC layer. 802.11’s MAC protocol has been extensively stud- ied [5, 6, 7]. 802.11 TSF scalability problems and solutions have been presented only recently [8],[9]. The 802.11 TSF works well if there are only a cou- ple of stations in an IBSS. With the availability of 802.11a and 802.11g, an IEEE 802.11 IBSS can eas- ily support a few hundred nodes as far as band- width is concerned (54 Mbps). Huang and Lai [8] show that 802.11 TSF can be out of synchroniza- tion frequently when the number of stations is not very small. The problem is more severe the larger the size of an IBSS. A distributed algorithm called adaptive timing synchronization procedure (ATSP) was proposed in [8] to address the scalability prob- lem. It scales very well compared with 802.11 TSF. But the protocol is slow to be stabilized. It could be out of synchronization before the protocol is sta- bilized and it is also slow to be re-stabilized af- ter the fastest station leaves the IBSS. Station mo- bility handling is another drawback for ATSP. An improved time synchronization procedure was pro- posed in [9] to better handle station mobility. How- ever, it is too experimental and does not give guid- ance on how to set the values of various parameters. In this paper, we will analyze the root cause of the scalability problem in detail and propose two new protocols with analytical guidance for imple- mentation. The new solutions are fully distributed, scalable and very adaptive to station mobility. The maximum clock drift can be controlled within 50 to 125 μs. It is a huge improvement compared with over 4000 μs for 802.11 TSF and over 500 μs for ATSP. The rest of the paper is organized as follows. Sec- tion 2 reviews 802.11 TSF and ATSP. Root causes 255 0-7803-8815-1/04/$20.00 '2004 IEEE

Transcript of Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11...

Page 1: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

Analysis and Implementation of Scalable Clock Synchronization

Protocols in IEEE 802.11 Ad Hoc Networks

Dong Zhou Ten-Hwang LaiDepartment of Computing and Information Science

The Ohio State University{zhoudo, lai}@cis.ohio-state.edu

Abstract

This paper studies a fundamental problem, clocksynchronization, in IEEE 802.11 ad hoc networks.Clock synchronization is important for frequenthopping spread spectrum (FHSS) to ensure thatall stations “hop” at the same time; it is alsonecessary for FHSS, direct sequence spread spec-trum (DSSS) and Orthogonal Frequency-DivisionMultiplexing (OFDM) to perform power manage-ment. The synchronization mechanism specified inthe IEEE 802.11 standards has severe scalabilityproblem. Remedies have been proposed to solvethe scalability problem, but these solutions eithercan not handle mobility very well or the protocolis too experimental without solid analysis. In thispaper, we analyze the root cause of the scalabilityproblem and propose two protocols with analyticalguidance for implementation. The new solutionsare distributed, scalable and very adaptive to sta-tion mobility. The maximum clock drift is improvedfrom over 4000 µs to under 125µs and 50µs respec-tively for our new protocols.Keywords: IEEE 802.11, ad hoc networks, scal-ability, clock synchronization

1 Introduction

The IEEE 802.11 standards support the peer-to-peer mode Independent Basic Service Set (IBSS),which is an ad hoc network with all its stationswithin each other’s transmission range. An ad hocnetwork can be constructed quickly without muchplanning and any infrastructure support.

Clock synchronization is important for frequenthopping and power management. IEEE 802.11standards [1, 2, 3, 4] specify a Timing Synchroniza-

tion Function (TSF) for the ad hoc mode in theMAC layer.

802.11’s MAC protocol has been extensively stud-ied [5, 6, 7]. 802.11 TSF scalability problems andsolutions have been presented only recently [8],[9].The 802.11 TSF works well if there are only a cou-ple of stations in an IBSS. With the availability of802.11a and 802.11g, an IEEE 802.11 IBSS can eas-ily support a few hundred nodes as far as band-width is concerned (54 Mbps). Huang and Lai [8]show that 802.11 TSF can be out of synchroniza-tion frequently when the number of stations is notvery small. The problem is more severe the largerthe size of an IBSS. A distributed algorithm calledadaptive timing synchronization procedure (ATSP)was proposed in [8] to address the scalability prob-lem. It scales very well compared with 802.11 TSF.But the protocol is slow to be stabilized. It couldbe out of synchronization before the protocol is sta-bilized and it is also slow to be re-stabilized af-ter the fastest station leaves the IBSS. Station mo-bility handling is another drawback for ATSP. Animproved time synchronization procedure was pro-posed in [9] to better handle station mobility. How-ever, it is too experimental and does not give guid-ance on how to set the values of various parameters.

In this paper, we will analyze the root cause ofthe scalability problem in detail and propose twonew protocols with analytical guidance for imple-mentation. The new solutions are fully distributed,scalable and very adaptive to station mobility. Themaximum clock drift can be controlled within 50 to125 µs. It is a huge improvement compared withover 4000 µs for 802.11 TSF and over 500 µs forATSP.

The rest of the paper is organized as follows. Sec-tion 2 reviews 802.11 TSF and ATSP. Root causes

2550-7803-8815-1/04/$20.00 '2004 IEEE

Page 2: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

of the scalability problem are analyzed. Section 3proposed two solutions to solve the problem. Sim-ulation results are discussed in section 4. Section 5concludes the paper.

2 Overview

This section reviews the 802.11 TSF and ATSP. Theroot cause of the scalability problem is also ana-lyzed. The analysis results of the severity of theasynchronism are summarized here to help the anal-ysis of our new protocols in the next section.

2.1 IEEE 802.11 TSF and ATSP

In 802.11 TSF, clock synchronization is achieved bystations periodically exchanging timing informationthrough beacon frames, which contains a timestampamong other parameters.

All stations in the IBSS competes for beacontransmission every aBeaconPeriod second. The typ-ical value is 0.1s. This time period is called a bea-con period (BP). At the beginning of each beaconperiod, there is a beacon generation window consist-ing of w + 1 slots each of length aSlotTime, wherew = 2·aCWmin. The value of aCWmin is 15 forFHSS and OFDM, while the value of aCWmin is31 for DSSS. Each station calculates a random de-lay uniformly distributed in [0, w] and is scheduledto transmit a beacon when the delay timer expires.If a beacon arrives before the random delay timerhas expired, the station cancels the pending bea-con transmission and the remaining random delay.Upon receiving a beacon, a station sets its TSFtimer to the timestamp of the beacon if the value ofthe timestamp is later than the station’s TSF timer.(It is important to note that clocks only move for-ward and never backward)

The number of slots needed to send a beacon iscalled beacon length. It differs from 4 to 34 forvarious 802.11 standards and bit-rates.

ATSP was proposed in [8] to solve the scalabilityproblem. The basic idea is to let the fastest stationto compete for beacon transmission every beaconperiod and let other stations to compete only occa-sionally.

Each station i keeps a variable I(i), which meanshow many BPs it waits before competing for beaconcontension. It is initialized to a random numberbetween 1 and Imax. Whenever station i receives

a beacon with a timing value later than its own,the station sets its timer to this value, increasesI(i) by 1. If station i does not receive any beaconframe with a timing value later than its own forImax consecutive BPs, it decrements I(i) by 1

In ATSP, the fastest station will not receive atiming value greater than its own; its I-value willgradually decrease to 1 and stay there. The otherstations will gradually increase their I-values untilthey reach Imax. So the fastest station will competeevery beacon period while other stations competesevery Imax beacon periods.

2.2 Metrics for asynchronism

Before we start the root cause analysis on the 802.11TSF scalability problem, let’s define the metrics ofasynchronism. If the clocks of two stations differ somuch that either power management or frequencyhopping can not work properly, the two stations aresaid to be out of synchronization.

Let ∆ be the maximum clock difference tolerableby power management and FHSS.

Assume that the clocks in an IBSS are all differ-ent in speed (or accuracy), which is typically thecase in real systems. Thus, there is a unique fasteststation, whose clock is fastest in the system. We areparticularly interested in three situations:

• Fastest-station asynchronism — This refers toa situation where the fastest station’s clock isahead of all other stations’ clocks by more than∆.

• Global asynchronism — Given a value k be-tween 1 and 100, k percent global asynchro-nism (or simply k percent asynchronism) refersto the situation that at least k percent of then(n− 1)/2 pairs of stations are out of synchro-nization.

• Simple asynchronism – This refers to a situa-tion where the fastest station’s clock is aheadof the slowest station’s clock by more than ∆.The difference of the fastest and slowest clockis called maximum clock drift.

2.3 Root Causes of Asynchronismand Some Possible Remedies

All three types of Asynchronism are due to the factthat the fastest or all the faster stations repeatedly

256

Page 3: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

lose beacon contentions. How can stations repeat-edly lose beacon contentions? There are several rea-sons due to 802.11’s design of the TSF.

• Beacon collision: Stations contend with one an-other for beacon generation.

• Equal opportunity: All stations are equal intheir opportunity to win a beacon contention.

• There is at most one successful beacon trans-mission in each beacon period.

• Unidirectional clocks: The 802.11 ad-hoc-modeTSF let clocks move only forward and neverbackward. A station adjusts its clock only ifthe clock’s time is behind (smaller than) thetimestamp on an arriving beacon.

In order to fix the 802.11 TSF’s scalability prob-lem, we need to remove one or more of its causes.There may be various ways to get around each ofthe above causes, but, unfortunately, not all of themwork well. Before describing our proposed solu-tion, we wish to outline several unsatisfactory “so-lutions”, which would help the reader understandwhy we have designed the proposed protocols asthey are.

• Reducing the beacon contention rate. Insteadof contending every BP, a random delay is in-troduced. It only contends for beacon trans-mission when the delay timer is up. Thisscheme does not work well because the fasteststation may delay its contention for long timeand cause the fastest clock to drift further awayfrom the pack.

• Let the fastest clock to contend every BPand other stations contend not frequently (i.e.ATSP). It takes long time for ATSP to figureout who is the fastest station, which may re-sult in large maximum clock drift. This schemedoes not react well when the fastest stationleaves the IBSS. It will take IBSS quite a whileto recognize the departure of the fastest stationand select the next fastest station.

• Allowing multiple beacon transmission in thesame BP. This can help in the situation that aslow station sends the beacon first and blocks apotential fast station from sending out beacon.But this solution alone can not solve the beaconcollision problem when the number of stationsis large.

• Allow stations to set their timers forward orbackward as appropriate; i.e., no matter whichstation wins the beacon contention, let all otherstations synchronize their timers with the bea-con’s timing. This approach is undesirable fortwo reasons. First, the collisions still hap-pen quite often with large number of stations.We will show in simulation that the improve-ment is limited. It still suffers the scalabilityproblem. Second, it is incompatible with thecurrent 802.11 TSF. To see this, suppose thefastest station in the IBSS happen to imple-ment the current 802.11 TSF, while the restof the IBSS happen to implement the modi-fied TSF. Also, suppose the fastest station andthe slowest station are currently out of syn-chronization, and the slowest station happensto win the beacon contention, then the fasteststation’s timer will stay intact, while the othersall synchronize with the slowest station. Thiswould result in more out-of-sync links.

2.4 Analysis of Beacon Contention

We will only summarize the results of the analysisdue to the space limitation. Please refer to [10] fordetail.

Suppose there are n stations, and denote the bea-con generation window by [0, w], which consists ofw + 1 slots numbered 0 through w. Let b be thebeacon length.

Let p(n, w) be the probability of the event E thatat least one of the n stations succeeds in beacontransmission in window [0, w].

p(n, W ) =(

W

W + 1

)n

p(n, W − 1)

+ n

(1

W + 1

) (W

W + 1

)n−1

+n∑

i=2

n−i∑j=0

{Cn

i Cn−ij

(1

W + 1

)i (b− 1W + 1

)j

(W − b + 1

W + 1

)n−i−j

p(n− i− j,W − b)

}(1)

The boundary condition for p(n, w) is p(0, w) =p(n, 0) = 0, provided n > 1.

Let p′(n, w) be the probability that a particularstation, say A, successfully sends a beacon in a givenBP.

257

Page 4: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

p′(n, w) =1

w + 1

w∑k=0

p′(n, w, k) (2)

π(i, x, y) = C n−1x C n−1−x

y(1

w + 1

)x (b− 1w + 1

)y (w − i− b + 1

w + 1

)n−1−x−y

(3)

For n ≥ 3 and k ≥ b, the function p′(n, w, k)satisfies the following recurrence:

p′(n, w, k) =(

w − k

w + 1

)n−1

+k−b∑i=0

n−1∑x=2

n−1−x∑y=0

{π(i, x, y) · p′(n− x− y, w − i− b, k − i− b)} (4)

The boundary condition for p′(n, w, k) isp′(0, w, k) = 0 and p′(n, 0, k) = 0.

Let E(L′) be the expected length of time betweentwo consecutive incidents of fastest-node asynchro-nism. d is the difference in clock accuracy be-tween the fastest station and the second fasteststation. T is the length of each beacon period.τ = d∆/(d · T )e.

E(L′) =1

p′(n, w)(1− p′(n, w))τ− 1

p′(n, w)(5)

3 Our Solutions

3.1 Adaptive bi-directional TSF

If we do not need to consider the compatibility issueand design the TSF from scratch, the bi-directionalTSF can become a very good scheme with minorchanges. We call the new protocol ABTSF.

From our simulation, we can see collision is themajor reason for the clock drift. We need to re-duce the collision by controlling the frequency ofbeacon contention. Each station competes for bea-con transmission every Imax BPs. If Imax is largeenough, the possibility of collision is very slim. Buta large Imax increase the chances of idle when nostation is competing for beacon transmission. Sowe introduce the concept of token. The token is as-signed to the initiator of the IBSS first and the tokenis rotated among the stations periodically. The to-ken holder will compete for beacon transmission ev-ery beacon period and other stations competes forbeacon transmission every Imax BPs. The token

Time Stamp Beacon Interval ..........

~ 550 bits

Token Bits

2 bits

802.11a Beacon Frame Extension

Figure 1: Beacon Frame Format for ABTSF

token bits role00 none token holder10 token holder11 token holder releasing token01 starting token contention

Table 1: Token bits explanation

holder consumes more power due to its frequencyof beacon contention, rotation of token holder willdistribute the power consumption.

Each station maintains a list of station IDs of theIBSS. These IDs are collected by deriving the sourceaddress of the beacon. When the token holder wantsto release the token to another station, it randomlypicks one station from the list and announces thenew token holder. To implement the token, we ex-tend the beacon frame format, adding two tokenbits. Fig. 1 shows the frame format. The tokenholder will set the token-bit to “10” and other sta-tions set the token-bit to “00”. The token holderwill set it to “11” when it starts the token rotationand the ID of the new token holder is also addedin the beacon frame. When the old token holdersees a new beacon with token-bit “10”, it resets thetoken-bit back to “00”.

When a station sees an idle beacon period, it im-plies the beacon holder leaves the IBSS or crashes,each station sets its token-bit to “01” and contendsto be the beacon holder. The station of the firstsuccessful beacon transmission with token-bit “01”will become the new beacon holder. Other stationswill reset their token-bit to “00” after receiving abeacon with token-bit “01”.

There is only one parameter to pick for ABTSF,Imax. Eq. 6 is used to select Imax.

p(m,w) ≥ 0.95,m = 1 + dn/Imaxe (6)

Eq. 1 can be used to calculate the value ofp(m,w), combing Eq. 6, the value of Imax can be

258

Page 5: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 20 40 60 80 100 120 140

p(n,

W)

Number of Stations

Analysis w=30 b=4Analysis w=30 b=13

Figure 2: p(n, w)

determined.This solution is very scalable and adaptive to sta-

tion mobility. The overhead is only 2-bit plus thenew token ID at rotation time. The 2-bit addi-tion can be considered free since this addition doesnot increase beacon length. The rotation happensonce in a while. The overhead is also minor. Wewill show later in the simulation that the maximumclock drift can be controlled to be less than 50µsfor number of stations from 100 to 600. The move-ment of token holder has very slim impact since thenew token holder can be selected very fast. WithATSP, it may take up to I2

max BPs before the newleader is selected. For ABTSF, the first successfulbeacon transmission with token bit “10” marks theend of leader election. The average BPs to elect anew initiator is:

E(leader) = 1/p(n− 1, w) (7)

From Fig. 2 we can see, E(leader) < 2 if 2 ≤ n ≤70 for 802.11b (w = 30, b = 4) and E(leader) <2 if 2 ≤ n ≤ 115 for 802.11a (w = 30, b = 13).Remember that there is no need to elect a leaderunless the token holder crashes. Even when thetoken holder does crash, it only takes a few beaconperiods to elect a new leader.

3.2 Tiered Adaptive Timing Syn-chronization Function

Now, suppose we must keep the IEEE 802.11TSF’s provision of moving forward only. Sincefaster stations can synchronize slower stations butnot the other way around, why not give fasterstations a higher priority in the process of beacon

generation? We now propose a three-tier protocolcalled TATSF 1 to utilize this capability and handlestation mobility more gracefully.

TATSF: Tiered Adaptive Timing Synchro-nization Function

1. At the beginning of each BP, if C(i) ≥ I(i) thenresets C(i) to zero and let station i participatein beacon contention.

2. [Initialization] If station i initiates a new IBSS,let I(i) := 1; otherwise, when it joins the (ex-isting) IBSS, let I(i) := Imax2. In any case, letC(i) := random(0..I(i)).

3. Each station keeps an observation counter, itsinitial value is 0 when it joins the IBSS. Thecounter is incremented by one for each BP.When the counter reaches a pre-set value, thestation is at the end of observation period andthe counter is reset to 0.

4. At the end of each observation period, updateI(i) as follows.

I(i) :=

1 if est rank(i) = 1Imax2 if 1 < est rank(i) ≤ THDImax4 if est rank(i) > THD

If there is an actual change in the value of I(i),let C(i) := random(0..I(i)).

5. At the end of each beacon contention window,update I(i) as follows:

I(i) :=

Imax4

if est rank(i) > THDI(i) ∗ 2

if there are collisionsmin{Imax3, dI(i)/2e}

if the medium was idle

In any case, let C(i) := random(0..I(i)).

6. At the end of each BP, increment C(i) by 1.

In order to classify the stations into different tiers,envision that the stations are ranked according totheir frequencies, with the fastest station ranked

1The time synchronization procedure proposed in [9] is atwo-tier protocol, mobility handling is more refined by addinga tier.

259

Page 6: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

number 1, the second fastest station ranked number2, and so on. With such ranks, we can put thosestations with rank 1 in S1, and those with ranks be-tween 1 and some threshold in S2, and put the restin S3. Unfortunately, precise ranks are not easy toobtain, and so we satisfy ourselves with an estimate.Each station divides the time line into observationperiods — each consisting of OBS BPs, where OBSis a pre-specified integer. In each observation pe-riod, each station counts the number of stations —different stations — from which it has received atleast one beacon with a timing later than its owntimer, and uses this number as an estimate of itsrank. More precisely, at the end of each contentionwindow, station i estimates/updates its rank as:

est rank(i) = 1 + the number of differentstations with faster beaconsreceived by i (8)

I(i) is an integer that indicates how often stationi will participate in beacon contention. Its valuesis increased if collision happens or decreased if themedium is idle.

Analysis of TATSF

There are 5 prameters in the TATSF pro-tocol: THD, OBS, Imax2, Imax3, Imax4. Theprotocol’s performance hinges on the values ofthese parameters. Should THD = OBS , Imax2 = 1,Imax3 = 1, and Imax4 = 1, the protocol degeneratesto the current 802.11 TSF. This section discusseshow to set these parameters.

Lemma 1 The fastest station is always in S1 ex-cept possibly for the first several BPs after it joinsor initiates the IBSS.

Proof. Let f be the fastest station in the IBSS.When f joined the IBSS, it synchronized with somestation, from which it heard a beacon. At that mo-ment, f ’s timer might or might not be the largest(latest). Let δ be the difference between f ’s timerand the largest (latest) timer in the IBSS, and letd be the difference in accuracy between f ’s timerand the second fastest timer in the IBSS. Then, atmost a number δ/(d · T ) of BPs after f joined theIBSS, f ’s timer would be the latest and est rank(f)would always be 1. Thus, As long as f stays in theIBSS, it will stay in S1 until a new fastest stationjoins the IBSS. The case where f initiated the IBSSis similar.

In normal situation, tier 1 stations contend forbeacon generation in every BP, and on average thereare |S2|/Imax2 tier 2 stations participating in eachcontention. The number of beacon contenders fromtier 3 can be ignored if Imax4 is set large enough. Onaverage, there are m = |S1|+ |S2|/Imax2 contendingstations in each BP. From Eq. 1, the probabilitythat at least one of the m stations wins the con-tention is more than 0.95 if m ≤ 20. Whenever astation wins the contention, its beacon synchronizesall timers with a smaller timing value.

Let ∆ be the desired accuracy of timing synchro-nization for the IBSS and L′′ be the time intervalbetween two consecutive events of simple asynchro-nism. Then E(L′′), the expected length of L′′ (interms of the number of BPs), can be approximatedusing Eq. 5,

E(L′′) ≈ 1p′(m,w)(1− p′(m,w))τ

− 1p′(m,w)

(9)

where τ = d∆/(d · T )e and d is the difference in ac-curacy between the fastest and the slowest stationsin S1 ∪ S2. Note that E(L′′) approaches infinityas p′ approaches 1. In order to have a sufficientlylarge E(L′′), it’s important that p′ be as large aspossible. For instance, if ∆ = 100µs, w = 30, andd = 0.01%, then E(L′′) ≈ 352 years, 141 days, 3days, for p′ = 0.9, 0.8, 0.7, respectively.

The p′(m,w) in the above formula is the fasteststation’s probability of winning a contention wherem = |S1| + |S2|/Imax2, and w is the size of thebeacon generation window. From Eq. 2, in orderto obtain a value as large as 0.7 for p′(m,w), mmust be less than 2. That is, |S1|+ |S2|/Imax2 < 2,which implies |S2|/Imax2 < 1 (since |S1| ≥ 1 byLemma 1). On the other hand, it is desired that|S2|/Imax2 6= 0. To see this, suppose |S2|/Imax2 = 0.Then, |S2| = 0 or Imax2 = ∞. If Imax2 = ∞, thenS3 = ∅; should all stations in S1 leave the IBSS,all stations in S2 (i.e., all stations in the IBSS) willenter beacon contention and force many collisions.If |S2| = 0, then should all stations in S1 leave theIBSS, all stations in S3 will enter beacon contention,which is too slow. Thus, we wish S2 and Imax2 tostatisfy

0 < |S2|/Imax2 < 1.

Imax2 should be small enough so that I(i) willreduce to 1 quickly in case the medium was idle.Desirably, log Imax2 ≤ 4.

Imax3 should be bigger than Imax2 but smallenough so that I(i) will reduce to 1 quickly in case

260

Page 7: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

the all the stations in S1 and S2 leave the IBSS.Desirably, log Imax3 ≤ 5.

If all stations in S1 leave the IBSS, we want toquickly identify the new members of S1. In theworst case this process may take OBS BPs. Thus,OBS should not be too large, enen though the largerthe value of OBS, the more accurate is est rank(i).

Tha value of Imax4 is more flexible than the otherparameters as long as it is sufficiently large. Idealy,Imax4 > 2n.

We intended to let the fastest station to win thecontention with a probability no less than 0.7. Withsuch an odd for the fastest station, the stations inS2 would win no more than 0.3 ∗ OBS contentionsin an observation period. Therefore, THD shouldbe no more than 0.3 ∗OBS.

4 Simulation Study on Maxi-mum Clock Drift of 802.11TSF, bi-directional TSF andTATSF

In the simulation, we let the clock speed uniformlydistributed in the range of [−d, d]. We pick d =0.01%. This is a very inaccurate clock. It is theworst clock accuracy allowed by the 802.11 stan-dard. Due to the low cost nature of 802.11 devices,inaccurate clock with d = 0.01% is often used inthese devices. We also study the impact of packettransmission error and mobility of stations.

We run the simulation for OFDM system: w =30, b = 4. The desired accuracy of timing syn-chronization (∆) is 100µs. We use the result ofour analysis as the guideline to pick the parame-ters of TATSF: THD = 3, OBS = 10, Imax2 = 16,Imax3 = 32 and Imax4 = 2048. For ABTSF, we setImax = 16 when n ≤ 200; 32 otherwise according toEq. 6.

We set up our simulation as follows:

• We run the simulation for 10000 beacon peri-ods.

• We set the packet error rate to be 0.01%.

• The accuracy of receive timestamp is to within±5µs of the reported clock time. The localclock is updated only when receiving a fastertimestamp that is more than 5µs .

binum max drift average max drift0 4408 µs 1770 µs10 4335 µs 1470 µs50 5227 µs 2047 µs100 5221 µs 2053 µs200 1564 µs 226 µs

Table 2: Maximum clock drift of bi-directional TSFfor n = 200

• We let 5% of the fastest stations leave at bea-con period k∗2000 ( k > 1 ). They return after500 beacon periods.

We measure the performance by the largest clockdrift between the fastest clock and slowest clockin the IBSS during the whole simulation period.The performance metric we use is simple asynchro-nism. The reason is that fastest-station asynchro-nism and global asynchronism rarely happen forall the proposed protocols except 802.11 TSF, onlysimple asynchronism can distinguish the best pro-tocols among the improved schemes.

802.11 TSF/ bi-directional TSF

Fig. 4 shows the maximum clock drift for 802.11TSF when n = 200. We can see the maximum ismore than 4000µs.

For ATSP, it is difficult to pick the value of Imax.If Imax is small, then it is not scalable. If the Imax islarge, it takes long time to find the fastest station.Either way, the maximum clock drift can be over500 µs. Due to space limitation, please refer to [9]for simulation details.

Bi-directional TSF is the same as 802.11 TSF ex-cept that the clock will reset its value whenever abeacon is received regardless which clock is faster.We compare the maximum clock drift in a IBSSwhere some stations run 802.11 TSF and some runbi-directional TSF.

Let binum be the number stations running thebi-directional TSF. When binum = 0, it becomes802.11 TSF. When binum = n, then all the sta-tions run bi-directional TSF. It is a mixed modewhen binum takes other value. Table 2 shows themaximum and average clock drift for bi-directionalTSF when n = 200. The maximum drift is still over1500µs when running in complete bi-directionalmode. It is a good improvement from the 802.11TSF where the maximum drift is over 4000µs , butstill not good enough. When n = 300, the max-

261

Page 8: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

0

10

20

30

40

50

60

70

80

90

0 2000 4000 6000 8000 10000

max

clo

ck d

rift(

us)

Number of BP

TATSF n= 600

Figure 3: Maximum clock drift for TATSF

imum drift will be over 20000µs. In mixed mode,the performance is more or less at the level of 802.11TSF. The scalability issue is still not resolved.

TATSF/ ABTSF

Table 3 shows the maximum clock drift forTATSF and ABTSF with n ranging from 100 to600. Fig. 3 shows the maximum clock drift duringeach beacon period for TATSF when n = 600.

The improvement over 802.11 TSF is quite largefor both TATSF and ABTSF. We can see the max-imum drift does not increase with the number ofstations. It is very scalable.

To our surprise, the maximum drift cross the100µs mark. When we rerun the same simulationwith Imax2 = 4, the maximum drift drop to 82 for100 stations and 99 for 400 stations. It seems notconsistent with the analysis. According to the anal-ysis, |S1| should be close to 1 with a larger Imax2.The fastest station is in contention every beacon pe-riod, the clock should be very synchronized. Thatis true when the timestamp can be trusted at facevalue and the air interface is error-free. In the sim-ulation, when a station receives a timestamp that isfaster than its local clock but less than 5µs faster,the receiving station will not increase est rank. Soit is possible, there are multiple stations in S1. Theaverage size of |S1| is 6.2 and the average size of S2

is 19.7. When all the stations in S1 leave the IBSS,the stations in S2 can quickly become member of S1

with a small Imax2. We can avoid multiple roundsof idle under these situation.

n TATSF max drift ABTSF max drift100 102 µs 39 µs200 93 µs 41 µs300 84 µs 41 µs400 123 µs 42 µs500 88 µs 41 µs600 81 µs 41 µs

Table 3: Maximum clock drift of TATSF andABTSF

Packet errors and movement of satiations havebad impact in term of maximum clock drift. Theimpact is much limited due to the adaptive nature ofTATSF. For example, the maximum drift for 400,600 stations can be reduce to 72,74 µs with sta-tionary IBSS and error-free radio channels. Ourassumptions are very conservative. In the real life,maybe only one station in S1 leaves during one bea-con period. We let all the stations leave at the samebeacon period and the impact is still very limited.

5 Conclusion

In this paper, we analyze the root cause of the scal-ability problem and propose new protocols with an-alytical guidance for implementation. The maxi-mum clock drift can be higher than 4000 µs for802.11 TSF. ATSP can reduce the maximum clockdrift to around 500 µs but it does not handle mo-bility well. For the two protocols we proposed inthis paper, TATSF is compatible with the 802.11TSF and can control the maximum clock drift un-der 125µs. ABTSF is deigned from scratch and itcan achieve even better synchronization (the maxi-mum clock drift is under 50µs). The new solutionsare fully distributed, scalable and very adaptive tostation mobility.

References

[1] IEEE Std 802.11. Wireless LAN Medium Ac-cess Control (MAC) and Physical Layer (PHY)specification, 1999 edition.

[2] IEEE Std 802.11a. Wireless LAN Medium Ac-cess Control (MAC) and Physical Layer (PHY)specification, 1999 edition.

262

Page 9: Analysis and Implementation of Scalable Clock Synchronization Protocols in IEEE 802.11 ...cdmc/mass/mass2004/35232.pdf · 2004-10-28 · Analysis and Implementation of Scalable Clock

0

500

1000

1500

2000

2500

3000

3500

4000

4500

0 2000 4000 6000 8000 10000

max

clo

ck d

rift(

us)

Number of BPs

802.11 TSP n= 200

Figure 4: Maximum clock drift for 802.11 TSP

[3] IEEE Std 802.11b. Higher-Speed PhysicalLayer Extension in the 2.4 GHz Band, 1999edition.

[4] IEEE Std 802.11g. Amendment 4: FurtherHigher Data Rate Extension in the 2.4 GHzBand, 2003 edition.

[5] G. Bianchi, L. Fratta, and M. Oliveri. Per-formance evaluation and enhancement of theCSNA/CA MAC protocol for 802.11 wirelessLANs. In Proc. PIMRC 1996, pp. 392–396.

[6] G. Bianchi. Performance analysis of theIEEE 802.11 distributed coordination function.IEEE Journal on Selected Areas in Communi-cations, 18(3):535–547, 2000.

[7] Y. C. Tay and K. C. Chua. A capacityanalysis for the IEEE 802.11 MAC protocol.ACM/Baltzer Wireless Networks, 7(2):159–171, 2001.

[8] Lifei Huang, Ten-Hwang Lai. On the Scalabilityof IEEE 802.11 Ad Hoc Networks In Proceed-ings of MobiHoc 2002, pp. 173-182.

[9] Ten-Hwang Lai, Dong Zhou, Efficient and scal-able IEEE 802.11 ad-hoc-mode timing synchro-nization function, 17th International Confer-ence on Advanced Information Networking andApplications, 2003, pp. 318-323.

[10] Ten-Hwang Lai, Dong Zhou, L. Huang On theScalability of IEEE 802.11 Ad-Hoc-Mode Tim-

ing Synchronization Function. In preparationfor journal submission.

263