You are on page 1of 6

Efcient and scalable IEEE 802.

11 Ad-Hoc-Mode Timing Synchronization Function

Ten-Hwang Lai Dong Zhou Department of Computing and Information Science The Ohio State University

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 others transmission range. In an IBSS, it is important that all stations are synchronized to a common clock. Synchronization is needed for frequency hopping and power saving. The synchronization mechanism specied in the IEEE 802.11 standards has severe scalability problem. The probability that stations may get out of synchronization is pretty high in large IBSS. New synchronization algorithm has been proposed for large-scale ad hoc network. We propose a more efcient algorithm in this paper that synchronizes clock more accurately. We are able to synchronize the clock within 100 s when the number of stations is more than 300. This is a big improvement over the current best algorithm and the 802.11 specied protocol. To our best knowledge, the current best algorithm can synchronize the clock within 550 s for a 300-station network. The 802.11 standard protocol can have clock drift over 5000 s for the same network.


The IEEE 802.11 standards [3, 4] are widely used for wireless LAN (WLAN). They support two types of WLAN: one in infrastructure mode and the other in ad hoc mode. In the infrastructure mode, a station serves as the access point, and communications can only take place between the access point and the other members of the basic service set (BSS). When the infrastructure does not exist or does not work, the ad hoc mode is useful. In the IEEE 802.11 standards [3], an ad-hoc network is called an Independent Basic Service Set (IBSS), in which all stations are within one anothers transmission range. Originally with a bandwidth of 1 or 2 Mbps, an 802.11 BSSS was not expected to comprise more than a few nodes. Now with 802.11a, the bandwidth available for an IBSS can be as high as 54 Mbps. Thus, as far as bandwidth is concerned, an IEEE 802.11 IBSS can easily support a few hundred nodes. The question is, can 1

IEEE 802.11s protocols handle such a large IBSS? Envision that in a classroom or an auditorium, more than 100 students turn on their laptops to form an IBSS. Will the ad hoc network work properly? This question is not trivial. In this paper we will study the scalability of IEEE 802.11 ad hoc networks from the viewpoint of timing synchronization. In an IEEE 802.11 WLAN, each station maintains a clock or timer. (A clock is called a timer in [3]; therefore, we use timer and clock interchangeably in this paper.) Clock synchronization is needed for power management, synchronization of frequency hopping. In power management each station uses its clock to determine the beginning and the end of the ad hoc trafc indication (ATIM) window. In FHSS, each station determines when to hop to a new channel according to its timer. In order to synchronize the clocks, IEEE 802.11 species the timing synchronization function (TSF). In an IBSS, since there is no access point, timing synchronization is achieved in a fully distributed fashion. Basically, stations periodically exchange timing information by sending beacon frames. A station adopts the timing in a received beacon if the received time is larger (later) periodically than the stations own TSF timer. 802.11s MAC protocol has been extensively studied [1], [5], [6]. The 802.11s scalability problem was only studied recently in [2] from the viewpoint of clock synchronization. By analyzing the beacon generation procedure, it is shown that the stations may fail to successfully transmit beacon frames due to beacon contention. As a result, some stations in the IBSS may become so out of synchronization with others that power management or FHSS can not work properly. Reference [2] shows that when the number of stations in an IBSS is not very small, there is a non-negligible probability that stations may get out of synchronization. The more stations, the higher probability and the larger ratio of asynchronism. Thus, the current IEEE 802.11s synchronization mechanism does not scale well; it cannot support a large-scale ad hoc network, say, from 150 to 200 stations as in the classroom example mentioned earlier. Even when the network size is a moderate 30, the fastest clock in the

Proceedings of the17 th International Conference on Advanced Information Networking and Applications (AINA03) 0-7695-1906-7/03 $17.00 2003 IEEE

counting in increments of microseconds (s). Clock or timing synchronization is achieved by stations periodically exchanging timing information through beacon frames, which contains a timestamp among other parameters. Each station in an IBSS shall adopt the timing received from any beacon that has a TSF time value (the Table 1: Beacon generation window and slot time timestamp) later than its own TSF timer. All stations in the IBSS adopt a common value, aBeaconPeriod, that denes the length of beacon intervals or periods. This value, IBSS already suffers from asynchronism with a high prob- established by the station that initiates the IBSS, denes ability. a series of Target Beacon Transmission Times (TBTTs) exA distributed algorithm called adaptive timing synchro- actly aBeaconPeriod time units apart. Time zero is denization procedure (ATSP) was proposed in [2] to address ned to be a TBTT. Beacon generation in an IBSS is disthe scalability problem. ATSP works much better for large tributed; all stations in the IBSS participate in the process ad hoc networks than the IEEE 802.11 standard. But as follows. it suffers two problems: the maximum clock difference between the fastest station and the slowest station may Beacon Generation and Clock Synchronization: shoot up to a few hundred s for some occasions even 1. At each TBTT each station calculates a random delay when the hosts are stationary, the clock may be out of uniformly distributed in the range between zero and synchronization when the fastest station leaves the IBSS. 2aCWminaSlotTime. (The aCWmin and aSlotTime We will analyze why ATSP suffer from these problems parameters are specied in Table 1.) and a new algorithm called tiered adaptive timing synchronization procedure (TATSP) will be proposed to over2. The station waits for the period of the random delay. come the problems of ATSP The new algorithm can con. trol the maximum clock drift within 100 s even when 3. If a beacon arrives before the random delay timer the fastest stations leaving the IBSS at the same time. has expired, the station cancels the pending beacon We are able to achieve better performance through sevtransmission and the remaining random delay. eral techniques: quick estimation of fast stations, priority treatment of fast stations and binary adaptation for 4. When the random delay timer expires, the station avoiding consecutive idle or collision beacons. transmits a beacon with a timestamp equal to the The rest of the paper is organized as follows. The value of the stations TSF timer1 . next section reviews the clock synchronization protocol 5. Upon receiving a beacon, a station sets its TSF timer as specied in the IEEE 802.11 standards. Section 3 exto the timestamp of the beacon if the value of the plains the ATSP algorithm. An tiered adaptive timing syntimestamp is later than the stations TSF timer2 . (It chronization procedure is proposed in Section 4 as an is important to note that clocks only move forward enhancement over the ATSP A simulation study is per. and never backward.) formed in section 5 to compare the performance between these algorithms. Section 6 concludes the paper. Thus, as illustrated in Fig 1, at the beginning of each beacon interval, there is a beacon generation window con2 Clock Synchronization sisting of w + 1 slots each of length aSlotTime, where w = 2aCWmin. Each station is scheduled to transmit a This section reviews the Timing Synchronization Func- beacon at the beginning of one of the slots. The physical tion (TSF) as specied in the IEEE 802.11 specications layer of the beacon must be transmitted using 1Mbps, the [3], and comments on a few related clock synchroniza- MAC layer of the beacon is transmitted using the agreed tion algorithms. rate, the beacon length varies for different transmission speeds. The beacon lengths are shown on Table 1. aCWmin aSlotTime (s) Speed (Mbps) beacon length

FHSS 15 50 1 2 13 8

DSSS 31 20 5.5 11 14 12

OFDM 15 9 24 54 5 4


The TSF of IEEE 802.11

MAC management plays an important role in IEEE 802.11 ad hoc networks. Synchronization functions and power management functions are implemented in this sublayer. According to the IEEE 802.11 specications [3], each station maintains a TSF timer (clock) with modulus 264 2

1 More precisely, the timestamp is equal to the value of the TSF timer at the time the rst bit of the timestamp is transmitted to the physical layer plus the transmitting stations delay through its physical layer from the MAC-PHY interface to its interface with the wireless medium. This detail is not important for our analysis. 2 Actually, the receiving station will adjust the timestamp by adding an amount equal to the delay through the physical layer, and the adjusted value of the timestamp is used for synchronization. This detail is not important for our analysis.

Proceedings of the17 th International Conference on Advanced Information Networking and Applications (AINA03) 0-7695-1906-7/03 $17.00 2003 IEEE

Beacon Interval

1. Initially, for each station i, let I(i) be a random number between 1 and Imax and let C(i) := 1. 2. In each beacon interval, station i participates in beacon contention iff C(i) mod I(i) = 0. 3. Whenever station i receives a beacon with a timing value later than its own, the station sets its timer to this value, increases I(i) by 1 if I(i) < Imax , and sets C(i) := 0. 4. If station i does not receive any beacon frame with a timing value later than its own for Imax consecutive beacon intervals, it decrements I(i) by 1 if I(i) 2, and sets C(i) := 0. 5. At the end of a beacon interval, each station increases its C(i) by 1.

Beacon Generation Window (W+1 slots)

Figure 1: Beacon generation window


Causes of Asynchronism

If the faster stations repeatedly lose beacon contentions, the clock drift between the fast stations and other stations will continue to increase. How can stations repeatedly lose beacon contentions? There are several reasons due to 802.11s design of the TSF.

Unidirectional clocks: The 802.11 ad-hoc-mode TSF With ATSP once the clocks have been synchronized, the , let clocks move only forward and never backward. fastest station will not receive a timing value greater than A station adjusts its clock only if the clocks time is behind (smaller than) the timestamp on an arriving its own; its I-value will gradually decrease to 1 and stay there. The other stations will gradually increase their Ibeacon. values until they reach Imax . Dene a stable state to be Equal opportunity: All stations have the same oppor- one in which the fastest stations I-value has reached 1 and the other stations have reached Imax . Once the IBSS tunity for submitting a beacon. reaches a stable state, the fastest station has a very high Single beacon per interval: Once a beacon is re- probability of successfully sending a beacon and thereby ceived by a station, the station cancels its beacon synchronizing all the other stations. contention timer (if it is still running). So, normally there is at most one successful beacon per beacon interval. (It is possible, though not often, that more 4 Tiered Adaptive Time Synchrothan one beacon is successfully transmitted in an innization Procedure terval.) Now lets see how the ATSP resolves these problems. ATSP is very simple and it achieves great improvement over the 802.11 TSF solution. The problem is that the maximum drift of clocks (dened as the difference between the fastest clock and slowest clock within the IBSS) can be quite large when the number of nodes equals to a few hundreds. We observed from the simulation that ATSP stabilizes slowly if a large Imax is picked while the possibility of collision increases with a smaller Imax . Even though, the I(j) is 1 (j is the index of fastest station), it is still likely that j can not send out beacon successfully during a long period of time due to the collision. The max drift can be quite large (more than 500s when d = 0.01%) no matter how to pick the Imax . The new solution would like to achieve the following goals: quickly identify a small set of fast stations give the fast stations more chances to send out beacons re-stabilize quickly when one or multiple stations from the fast station set leave the IBSS 3
Proceedings of the17 th International Conference on Advanced Information Networking and Applications (AINA03) 0-7695-1906-7/03 $17.00 2003 IEEE

Adaptive Time Synchronization Procedure

IEEE 802.11 TSF, the stations can only set their timers Forward. If the faster stations are given a higher priority to send beacon frames, the clocks would be synchronized better. Each station i is assigned an integer I(i) that determines how often each station shall participate in beacon contention. That is, station i contends for beacon transmission once every I(i) beacon periods. Therefore, smaller the value of I(i), higher the stations chance of beacon transmission. Let the maximum possible value of I be Imax . Let C(i) be a counter at station i that counts beacon periods. The proposed clock synchronization algorithm is described in the following. ATSP: Adaptive Timing Synchronization Procedure

The basic idea of this new scheme is to partition the stations into a small set of fastest station through quick estimation. The set is revised gradually. Each station has its own Imax value. We use I(i) to denote the Imax of station i. There are two Imax values are picked in advanced, Imax1 is a very small and Imax2 is very large. The Imax1 is assigned to I(i) if i is believed to have a fast clock. I(i) takes value Imax2 for slower clock. For station i, it has the chance to send a beacon every I(i) beacon periods. We call this solution tiered adaptive timing synchronization procedure (TATSP) TATSP estimates the clock speed by listening to the beacon transmission. If a station i hears more than f different stations with faster time during obs beacon periods, the station is considered a slow station by assigning Imax2 to I(i), otherwise I(i) takes value Imax1 . In order to achieve precise synchronization, we want the fast stations to send out beacon quite often to sync up the slow stations, but no too also to result in beacon collisions. We want to avoid an idle beacon period and collision beacon period by deploying binary back off. The I value is reduced by half if no beacon is sent or double if beacon collides. Denition 1 A station i is said to participate in beacon contention if it is currently in the IBSS and its contention ag is true. The contention ag is set to true every I(i) beacon periods by a random function. TATSP: Tiered Adaptive Timing Synchronization Procedure 1. Station i maintains an integer variable I(i) that indicates how often the station will participate in beacon contention (basically, once every I(i) intervals). A counter C(i) counts the number of intervals that have elapsed since the stations last participation. Whenever C(i) I(i), the station participates in beacon contention. 2. A variable, est rank(i), which indicates an estimate of rank(i), is updated at the end of each observation period as: est rank(i) := 1 + the number of (different) stations with faster beacons received by i. (For instance, if i received a total of six faster beacons in the observation from stations a, b, a, b, a, c, respectively, then est rank(i) = 4, because it received faster beacons from three different stations.) 3. Variables I(i) and C(i) are initialized and updated as follows. 4

Parameter Beacon window size (W ) Beacon length (b) Propagation delay Packet Transmission error rate (e) aBeaconPeriod Clock accuracy (d) Table 2: Simulation Setup

Value 30 4 1s 1% 0.1s 0.01%

500 ASTP Imax = 10 n= 300 450 400 350 max clock drift(us) 300 250 200 150 100 50 0 0 500 1000 1500 2000 2500 Number of BP 3000 3500 4000 4500 5000

Figure 2: Maximum clock drift for ATSP

Initially, when station i joins the IBSS, let I(i) := Imax1 ; C(i) = random(0..Imax1 ). At the end of each observation period, do the following. if est rank(i) THD then I(i) := Imax1 ; C(i) = random(0..Imax1 ) else I(i) := Imax2 ; C(i) = random(0..Imax2 ). At the end of each beacon contention window, do the following. if the medium was idle then I(i) := min{Imax3 , I(i)/2 } C(i) := random(0..I(i)) elseif i received no beacon successfully then I(i) := I(i) 2 C(i) := C(i) 2 + random(0..1). At the end of each beacon interval, increment C(i) by 1.

Proceedings of the17 th International Conference on Advanced Information Networking and Applications (AINA03) 0-7695-1906-7/03 $17.00 2003 IEEE

600 ASTP Imax = 100 n= 300


400 max clock drift(us)


n 100 200 300 400 500 800

max drift 77.257 72.031982 80.7620 77.569001 88.655001 85.96500

avaerage max drift 27.027496 30.225103 32.932842 34.628371 35.513896 38.129688


Table 3: Maximum clock drift of TATSP clock leaves. Ether way , we can not keep the maximum drift under 100s.


0 0 500 1000 1500 2000 2500 Number of BP 3000 3500 4000 4500 5000

Figure 3: Maximum clock drift for ATSP

Simulation on TATSP

To verify the performance of TATSP we set up our simu, lation as follows: We start the IBSS with one station, 5 stations joint the IBSS every 10 beacon periods. We run the simulation for 10000 beacon periods. We run the simulation for OFDM system: w = 30, b = 4. We set d = 0.01%, Imax1 := 10, Imax2 := 2048, Imax3 := 64, abs := 10 and THD := 5. We set the packet error rate to be 0.01%. We set the clock to within 5s of the reported clock time when receiving a perceived faster timestamp. We let 5% of the fastest stations leave at beacon period 1000, 2000, 3000, 4000. They return after 500 beacon periods. We measure the performance by the largest clock drift between the fastest clock and slowest clock in the IBSS during the whole simulation period. The average of the maximum drift is also calculated to get a better picture of how accurate the synchronization procedure can achieve. Fig. 4 shows the maximum clock drift for each beacon period during the whole simulation when n = 400. We can see the maximum clock drift increases to a small peak around beacon period 1000, 2000, 3000,4000. It stabilizes quickly after that. That is the impact of fast station leaving at the same time. Due to the binary back scheme, the impact is very minor. Fig. 5 shows the maximum clock drift for 802.11 TSF when n = 100. We can see the maximum is already more than 1000s even when n = 100. We can see in the beginning the maximum drift is still under control. That is due to the small of stations in the IBSS as we are still going through the process of joining the IBSS. The above two gures shows the maximum clock drift when the clock accuracy is 0.01%. That accuracy is pretty bad. We shows that TATSP performs very well even the 5


Simulation Study
Simulation Setup

To study the maximum clock drift of the IEEE 802.11 TSF procedure, ATSP and TATSP we developed simula, tion programs in C. The simulator closely follows the protocol details of beacon generation and contention. The parameters are specied in Tables 2. Transmission errors are assumed to occur independently at destinations with an error rate of 1%. Thus, a beacon may be received with errors by some stations but without errors by others. The value of aBeaconPeriod (the length of a beacon interval) is set to 0.1s as recommended by the IEEE 802.11 specications.


Simulation on ATSP

We focus the study on the effect of the fastest node leaving the IBSS. We let the ATSP run to a stable condition and then start observing after the fastest node leaving. We record the maximum drift for the next 5000 beacon periods. Fig. 2 shows the maximum clock drift when Imax = 10. We can see the small Imax can not stabilize the clocks. Even though the fastest clock contents every beacon period and other stations content every 10 beacon periods, the possibility of collision is still high that leads to higher maximum clock drift between the fastest clock and the slowest clock. Fig. 3 shows the maximum clock drift when Imax = 100. We can see the stations stabilize slowly, but after they stabilize, the clock drift is much more controlled. Small Imax is not stable but the fastest station can reach the leader position quickly, large Imax can keep the clock synchronized but converges slowly after the fastest

Proceedings of the17 th International Conference on Advanced Information Networking and Applications (AINA03) 0-7695-1906-7/03 $17.00 2003 IEEE

80 TATSP n= 400 70

450 TATSF d=0.001% 802.11 TSF d=0.001% 400



300 max clock drift(us) max clock drift(us) 0 2000 4000 Number of BP 6000 8000 10000 50





150 20




0 0 50 100 Number of Stations 150 200

Figure 4: Maximum clock drift for TATSP

Figure 6: Maximum clock drift comparison between 802.11 TSP and TATSP We are able to achieve much better performance through three major ways: quick estimation to classify the fast stations from slow stations, priority treatment for fast stations, binary backoff and jack up to avoid both the idle beacon transmission and repeated beacon collision. We are able to control the maximum clock drift under 100s for inaccurate clock (d = 0.01%) and it also performs very well for accurate clock.

1200 802.11 TSP n= 100


800 max clock drift(us)




0 0 2000 4000 6000 Number of BPs 8000 10000

[1] G. Bianchi. Performance analysis of the IEEE 802.11 distributed coordination function. IEEE Journal on Selected Areas in Communications, 18(3):535547, 2000. [2] Lifei Huang, Ten-Hwang Lai. On the Scalability of IEEE 802.11 Ad Hoc Networks In Proceedings of MobiHoc 2002. [3] IEEE Std 802.11. Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) specication, 1999 edition. [4] IEEE Std 802.11a. Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) specication, 1999 edition. [5] J. Li, C. Blake, D. S. J. D. Couto, H. I. Lee, and R. Morris. Capacity of ad hoc wireless networks. In Proc. 7th ACM International Conference on Mobile Computing and Networking, 2001. [6] Y. C. Tay and K. C. Chua. A capacity analysis for the IEEE 802.11 MAC protocol. ACM/Baltzer Wireless Networks, 7(2):159171, 2001.

Figure 5: Maximum clock drift for 802.11 TSF clock is not accurate at all. Now we will compare the maximum drift with a much accurate clock (d = 0.001%). Fig. 6 shows that the maximum drift can spin out of control when n > 100 even with a accurate clock. While our TATSP is very stable regardless the number of stations in the IBSS. To compare with ATSP the max drift is around 500 s , when n = 300. We can see TATSP can synchronize clocks much better for large IBSS.

Concluding Remarks

Clock synchronization is an important requirement due to the Frequency hopping and power management. We propose an efcient and scalable algorithm to solve the clock asynchronism problem faced by a large-scale IBSS. This algorithm can achieve much better clock accuracy compared with ATSP It performs very well under packet . error and mobility of stations. 6

Proceedings of the17 th International Conference on Advanced Information Networking and Applications (AINA03) 0-7695-1906-7/03 $17.00 2003 IEEE