Abstract. The performance of many envisioned applications in short- range wireless ad hoc networking will critically rely on the promptness of the ...
Device Discovery in Short-Range Wireless Ad Hoc Networks Petar Popovski
Tatiana Kozlova
Liljana Gavrilovska
Ramjee Prasad
Center for Personkommunikation, Aalborg University Fredrik Bajers Vej 7A5, DK-9220 Aalborg, Denmark {petarp, tatiana, liljanag, prasad}@cpk.auc.dk Abstract The performance of many envisioned applications in shortrange wireless ad hoc networking will critically rely on the promptness of the self-configuring network procedures. In that sense, a fundamental problem in ad hoc networks, is the device discovery and/or network initialization. In this paper we propose a randomized distributed algorithm for rapid device discovery during the deployment of ad hoc network. The algorithm uses the approach of the nonblocked stack algorithm to resolve the collisions, which ensures time-efficient execution when the number of devices in the network is large. The self-starting concepts used in this algorithm may be significant for inferring other self-configuring algorithms for ad hoc networks. Keywords Device discovery, network initialization, randomized distributed algorithms, collision resolution. INTRODUCTION The wireless networking evolves towards adaptive ad hoc structures, providing pervasive connections among users and resources. Wireless ad hoc network is a communication architecture formed without any central administration or infrastructure [1]. As foreseen in fourth generation (4G) wireless [2], the ad hoc networks will tend to provide seamless radio connectivity within a small physical distance. The short-range ad hoc networking received significant attention in relation with Personal Area Networking (PAN) [3] [4] and Bluetooth [5]. Some farreaching applications of short-range networking include autonomous networks, smart sensor “dust”, and amorphous computing. The ad hoc networks are rapidly deployed and maintained by the self-organizing actions of the participating devices. The overall performance of many envisioned applications in pervasive computing will heavily rely on the promptness of the self-configuring network procedures. For example, there will be applications that require fast connection establishment and exchange of relatively small data volume (e.g. to sensors, actuators etc.). In addition, the devices in ad hoc networks are battery-powered, which makes the energy a scarce resource; therefore, all self-configuring actions should be performed under a condition of minimized power consumption. By definition, ad hoc networks are started by the constituent devices as anonymous networks, such that when a node is
activated, it is not aware of the other active participants. Prior to any “useful” communication, the device should learn the identities (IDs) of the devices within its radio range i.e. its neighbors. Unique ID can be, for example, MAC address, assigned to the device in the manufacturing. The procedure, by which each node announces its presence to each neighbor and also detects the presence of all neighbors, is referred to as device discovery (DD). However, when the wireless devices are small, inexpensive, or bulk-produced, they may not possess unique MAC addresses. Thus a device announces its presence in a way that is indistinguishable from other devices, e.g. by sending predefined inquiry packet. In such case, the DD procedure should assign unique ad hoc ID to each participating device. This procedure is referred to as network initialization [6]. As a fundamental task in ad hoc networks, the network initialization has more general implications, since ad hoc IDs may be needed even if the devices possess unique MAC addresses. Namely, the ad hoc IDs can be used for further structured access to the communication medium, e.g. as broadcasting tokens. In the following text, the notions “device discovery” and “network initialization” will be used interchangeably. Compared to the topics in ad hoc networking that traditionally received most attention (e.g. routing, mobility), the investigation of the device discovery intensified recently, mainly in relation with the topology construction in Bluetooth. The proposed discovery procedures [7] [8] are created atop the Bluetooth random-access inquiry mechanisms, which consist of collision avoidance (CA) with fixed random backoff. Similar CA method has also been considered for wireless sensor networks [9]. The usage of CA with fixed random backoff does not adapt to the number of devices N, which is assumed to be a priori unknown in all cases considered here. If the fixed backoff window is large, then the delay introduced by DD protocol for small N is excessive; if it is short, the number of collisions for large N is excessive. In both cases the energy of the batteries is wasted due to the non-optimal activity of the devices related to the network control functions. Another approach to the random access problem, inherently adaptive to the number of participating devices, is the collision-resolution (CR) by stack algorithm (or splitting tree) [10]. Time-efficient network initialization that uses stack algorithm is reported in [6]. However, both in case with and without collision detection capability, the communication model used in [6] assumes that a device is always able to assess its own successful transmission
without subsequent acknowledgement. Such assumption is viable if the stack algorithm is used as MAC protocol [11] – in that case, it is always considered that, after a successful reception of the packet, the receiver sends short acknowledgement packet. This cannot be assumed for discovery problem, since a transmission of an undiscovered device does not have an intended recipient and the announcement of its presence (by transmission of its ID or inquiry packet) is broadcasted to all active devices. In this paper we introduce device discovery protocol based on stack algorithm that solves the problem of broadcast acknowledgements. Our proposed algorithm does not require the devices to start the protocol jointly, as considered in [6]. As soon as a device becomes active, it gathers information about the current status of the protocol. The arriving device joins the network initialization in a way that minimizes the number of collisions in which that device is involved. This self-starting property is an important contribution brought by the proposed algorithm, since it should be an essential ingredient of all protocols intended for ad hoc networks. PROBLEM STATEMENT, SYSTEM DESCRIPTION AND NOTATION Target applications and scenarios for the short-range wireless ad hoc networks in question include collaborative computing, multimedia classroom, fast initialization of large set of wireless sensors etc. Stated more generally, we consider scenarios where a set of N devices is activated within a small spatial range and in a short time interval. Hence, it is reasonable to assume a single-hop ad hoc network, such that each device is within a radio range of any other device [6] [7] [8]. A newly activated device is uncertain about the total number of devices in the network N as well as the activation instants of still inactive devices. The proposed device discovery algorithm is executed in a quasistatic environment, such that an activated device participates in the protocol until its termination. At the end of the protocol each device is assigned an ad hoc ID unique number from 1 to N. A device with assigned ad hoc ID will be referred as discovered or initialized. In single-hop networks all devices share the same channel and a device announces its presence broadcast on the channel. Due to the time-division duplex (TDD) operation of the devices in short-range wireless systems, a successful transmission should be acknowledged by the devices that were in receiving mode during that transmission. The proposed protocol is based on the election of a leader – the first discovered device, that takes ad hoc ID=1, is used to acknowledge the transmissions of non-discovered devices. The physical radio channel used for initialization is assumed slotted and all transmissions take place at the slot boundaries [6]. The synchrony can be obtained, e.g. by interfacing a GPS system. However, the requirement for synchrony is not restrictive, because the approach presented here can be extended to the non-slotted channel, as it will
be seen in the discussion further. The propagation delay in the short-range systems is negligible. The channel is assumed errorless and the errors in the received packets are always caused by the collision with other packet. Let t denote a time slot. Each packet used during the protocol has length of a single slot. The set of devices that transmit in slot t is denoted by T(t ) and the set of devices that listen the channel by R (t ) . S denotes the number of devices in the set S. Let c(t ) denote the state of the initialization channel at time slot t , as perceived by the devices in R (t ) . The TDD operation implies that the devices in T(t ) know nothing about c(t ) . There are two different packet classes that are transmitted during the discovery protocol: inQuiry packet (Q-packet) and Acknowledgement packet (A-packet). Q-packet is transmitted by undiscovered device, while A-packets are transmitted by an already elected leader. The value of Qpacket may depend on the specific device that sends it – e.g., it can contain its unique MAC address. For the purpose of this algorithm the value of Q-packet is irrelevant; it is only important that it can be differentiated from the Apackets. There are 7 different types of A-packets, denoted by A0, A1, …, A6, which are used by the leader as a feedback information to uninitialized devices. The leader uses A-packets to convey network-related information to the devices, such as assigned IDs. In total, there are 8 types of packets, such that only 3 bits are needed to discriminate the packet type1. A device in R (t ) can perceive c(t ) as follows:
•
Idle channel c(t ) = I
occurs when no device is
transmitting, i.e. T(t ) = 0 ; •
Successful reception occurs when T(t ) = 1 . In this case c(t ) may obtain values Q, A0, A1, …, A6;
•
Collision c(t ) = C occurs when T(t ) > 1 ;
The proposed protocol is a randomized distributed algorithm, since at certain instants the participating devices are using coin flipping to make decisions related to the protocol. It is assumed that each device has a capability of flipping fair coin independently. The outcomes of flipping are denoted 0 and 1. If a set of devices S is allowed to flip fair coin at the beginning of the same slot, then the devices from S are said to belong to the same collision group.
ALGORITHM DESCRIPTION As soon as a device is activated during the formation of the ad hoc network, it tries to announce its presence and to 1
Three bits can be robustly protected by redundancy (large Hamming distance) and inserted in the packet preamble. This justifies the assumption that if there is a single transmission on the channel, the packet type is recognized without error.
obtain ad hoc ID. In the scenarios considered it becomes highly probable that more than two devices will try to transmit Q-packet in the same slot, yielding collision on the channel. To cope with this situation, our initialization protocol applies the approach of the non-blocked stack algorithm [11]. The stack algorithm is only a part of the discovery protocol; the overall algorithm should solve the following problems: (1) (feedback problem) Since there is not a particular destination, how a successful Q-packet is acknowledged? (2) How a newly activated device learns which are the addresses of already initialized devices? (3) How the devices know when to end the protocol? All three problems are solved by electing the first initialized device (ad hoc ID=1) to be leader in the network. The leader sends feedback to the devices that attempt to broadcast their presence on the channel and assigns ad hoc ID to the ones that successfully transmit. It also keeps track of the discovered MAC addresses as well as the assigned ad hoc IDs. The termination of the protocol is handled by the leader by using timeout mechanism: after a device is initialized, if there is no sign of the presence of undiscovered devices for a certain predefined timeout interval, the leader sends special packet on the channel to announce the protocol termination. After that, the leader can broadcast all known MAC addresses on the channel, such that each discovered device discovers all other initialized devices. The modified stack algorithm is applied after the leader is elected. Therefore the overall initialization protocol should be designed in a way that allows a newly activated device to detect the current state of the protocol prior to joining to it. The “current state” refers to whether leader is elected and, if it is, what is the current phase of the stack algorithm. If the leader is not elected, then this newly activated device may be a candidate for leader; if the leader is already elected, the device should join to the ongoing stack algorithm to announce itself and to obtain ad hoc ID. Although the leader election precedes the stack algorithm, it is more convenient to describe the latter first.
Stack Algorithm with Elected Leader Assume that leader with ID=1 is elected. The leader keeps track how many devices are already initialized and which ad hoc ID should be assigned next. At the time slot t, the devices that are activated, but still not initialized, are grouped in collision groups S1(t), S2(t), … The groups are ordered in a distributed stack, such that Si(t) has the i-th position in the stack. Each activated device determines its collision group by maintaining a marker µ(t). All devices form the collision group Si(t) have µ(t)=i. To illustrate the stack algorithm, suppose that at the start of time slot t all undiscovered devices flip a fair coin in order to decide whether to transmit the Q-packet in t. Accordingly, all undiscovered devices belong to the same collision group S1(t), having µ (t ) = 1 . By flipping a fair coin, the devices start a trial. For the purpose of this explanation, the undiscovered devices know that leader is elected and they expect feedback from it. We assume that S1 (t ) ≠ 0 and the flipping outcome splits the set S1(t) into two subsets S10 (t ) and S11 (t ) . The devices from S10 (t ) transmit Q-packet in the slot t, such that
T(t ) = S10 (t ) and S11 (t ) ⊂ R (t ) . Note that the leader is listening the channel whenever it is not sending A-packets. If c(t ) = I , all devices from R(t) conclude that S10 (t ) = 0
and the splitting of S1(t) is considered unsuccessful. This fact is announced by the leader in the slot (t+1) with c(t + 1) = A0 and the trial ends after two slots. If c(t ) ≠ I ,
T(t + 1) = S11 (t ) and S10 (t ) ⊂ R (t + 1) . Now the leader sends A-packet in slot (t+2), which serves as a feedback to the devices from S10 (t ) and S11 (t ) . Based on the type of A packet received, the devices from S10 (t ) and S11 (t ) are either initialized or continue to participate in the stack protocol. If a device is initialized (single device in S10 (t ) or
S11 (t ) ), it takes the ad hoc ID (assigned to it via the A-
Table 1. Description of the possible trial outcomes
| S10 (t ) |
| S11 (t ) |
c(t)
c(t+1)
0
>0
I
A0
1
0
Q
I
A1
S10 (t ) is initialized. If µ (t ) > 1 , µ (t + 3) = µ (t ) − 1 .
1
1
Q
Q
A2
Both devices from S1(t) are initialized. If µ (t ) > 1 , µ (t + 3) = µ (t ) − 1 .
1
>1
Q
C
A3
S10 (t ) is initialized, S1 (t + 3) = S11 (t ) . If µ (t ) > 1 , µ (t + 3) = µ (t ) .
>1
0
C
I
A4
Unsuccessful trial, µ (t + 3) = µ (t ) for all devices in the stack.
>1
1
C
Q
A5
S11 (t ) is initialized, S1 (t + 3) = S10 (t ) . If µ (t ) > 1 , µ (t + 3) = µ (t ) .
>1
>1
C
C
A6
S1 (t + 3) = S10 (t ) , S 2 (t + 3) = S11 (t ) . If µ (t ) > 1 , µ (t + 3) = µ (t ) + 1 .
c(t+2)
The effect on the devices in the stack: initialization or change of marker
next trial ∀i, Si(t+2)= Si(t) – or, equivalently, µ (t + 2) = µ (t ) for all devices.
packet) and leaves the initialization protocol. Table 1 describes the possible outcomes of a trial. New group in the stack, S2(t+3), is created only after A6. The packets of A1, A3, and A5, contain a single ad hoc ID, assigned by the leader and the leader increments its ID counter by 1. The packet A2 contains 2 IDs and the leader’s ID counter is incremented by 2. It will be seen from the leader election that the stack algorithm always starts with nonempty group S1(t). Now assume that the stack consists of ordered collision groups S1(t), S2(t), …, SK(t) where S K (t ) > 0 and S i (t ) = 0 for
i > K . If the trial that starts in t ends with A1 or A2, the higher groups from the stack decrease the markers and S2(t) starts a trial in (t+3). Using table 1, it can be proved by induction that if S k (t ) > 0 , then S i (t ) > 0 for all i < k . This implies that the algorithm cannot enter into a deadlock – it cannot happen that S1 (t ) = 0 while S i (t ) > 0 for
i > 1 . If the stack is empty, the “unsuccessful trial” I, A0 will repeatedly occur on the channel until a new device arrives. Otherwise, the leader timeouts and decides to end the discovery protocol. Leader Election Procedure Here we describe the leader election procedure isolated from the whole discovery protocol. In the next section the election procedure and the stack algorithm will be merged.
Assume that election is started in t0 by a set of devices E(t0), where E(t0 ) > 1 . Each device from E(t0) is a candidate for leader. The device that will first succeed in transmitting Q-packet without collision on a channel will be elected a leader. At start of t0 devices flip a coin and split the set E(t0) into two sets E0(t0) and E1(t0). Analogously to the stack algorithm, this is a start of election trial. Devices from E0(t0) transmit in t0, i.e. T(t0) = E0(t0) while R(t0) = E1(t0). The following may occur: 1. c(t0)=I. Devices from E1(t0) conclude that | E0 (t0 ) |= 0 and they start a new election trial E(t0+1)=E1(t0); 2. c(t0)=Q. The single device from E0(t0) transmits in t0 and listens the channel in (t0+1). On the other hand, the device(s) from E1(t0), after hearing the Q-packet, they transmit their Q-packets in the slot (t0+1), to confirm the leadership to the device from E0(t0). The device from E0(t0) will elect itself a leader after hearing c(t0 + 1) ≠ I , since, by assumption, E1(t0) contains at least one device; 3. c(t0)=C. This implies | E0 (t0 ) |> 1 , such that the devices from E1(t0) (if such device exists) will stay silent in slot (t0+1). Having heard c(t0 + 1) = I , the devices from E1(t0)
conclude that | E0 (t0 ) |> 1 and start a new election trial in (t0+2) by setting E(t0+2)=E0(t0). Note that, it may happen that E1(t0) is empty, if all from E(t0) flip “0”. Conversely, if 1 | E1 (t0 ) |> 0 , the device(s) from E (t0) resign from the
election trial and join to the waiting set W until they hear the first A-packet, since in E0(t0) there are enough elements for electing and confirming the leader. The start of the stack algorithm is interleaved with the leader election. Suppose a leader is elected in a trial that started in t1. Then c(t1)=Q and the following may occur: •
c(t1+1)=Q. The leader sends A2 in slot (t1+2), initializing the device that confirmed its leadership. Then the devices from W set µ(t1+3)=1 and start a trial from the stack algorithm in (t1+3). c(t1+1)=C. The leader sends A3 in slot (t1+2). Then the devices from E1(t1) become the first collision group in the stack algorithm at (t1+3), i.e. S1(t1+3)= E1(t1). The devices from W set µ(t1+3)=2 become S2(t1+3).
•
Putting the Pieces Together From the description of the stack algorithm it follows that the A-packets appear as a beaconing on the channel. A newly arrived device listens the channel for at most 3 slots: if it does not hear A-packet, it concludes that a leader is not elected and joins to the leader election procedure. The device D activates and listens the channel for at least 1 and at most 3 slots in order to make decision how to join the protocol. Due to the lack of space, we omit the complete description of the possible channel states that D can detect as well as the proof of correctness for the algorithm. Nevertheless, we illustrate the mechanism with example. Let’s denote the activation slot of D by t2. Then, if both t2 and (t2+1) are idle slots, D starts a leader election process. Now suppose that D detects Q-packet in the slot t2. Having heard only c(t2)=Q, the device cannot determine the exact status of the protocol. Table 2 describes the actions of D after listening the slots (t2+1) and (t2+2). Table 2. Example rules for joining the initialization
c(t2)
c(t2+1)
Q Q Q Q Q Q Q Q
A2 A5 I I I I Q C
c(t2+2)
Action
Already Set µ(t2+2)=1 joined
I Q C A1 A2 A3
Set µ(t2+2)=2, since |S1(t2+2)|>1 Join E(t2+3) (leader candidate) Join E1(t2+2) (confirm in t2+3) Join W (waiting set) Set µ(t2+2)=1 Set µ(t2+2)=1 Set µ(t2+2)=2
RESULTS Fig. 1 depicts the simulation results for the proposed discovery protocol. The performance results are represented by the average duration of the discovery protocol, measured in time slots, as a function of the total number of devices in the network - N. The activation time of each device, measured relatively to the activation of the first device in
Average number of time slots
2000
synchronizer - when the leader is elected, the devices that confirm the leadership will synchronize their transmissions with the correctly received Q-packet. After that, newly arrived devices will be synchronized by the A-packets.
1800 1600 1400 1200 1000 800 600
τ=0 τ=50 τ=100
400 200 0 20
40
60
80 100 120 140 160 180 200 Number of devices N
Figure 1. Average duration of the discovery protocol as a function of the number of devices
the system, is exponentially distributed random variable [7] with mean value τ (in slots). The three curves represent three different values for τ ; when τ = 0 , all devices are activated in the same slot. The timeout value, Tout was experimentally chosen to be Tout = 5τ , but not less than 100 slots. Such choice achieves extremely low probability that the protocol will fail to initialize all devices. The results from Fig.1 show that, for low values of τ the average number of time slots needed to execute the discovery protocol depends linearly on the number of the devices. As τ grows, this linear function retains the slope for higher values of N. For τ = 100 , at low N the duration of the protocol exhibit slower changes; this is due to the fact that the activations and initializations occur more sparsely in time, such that it is highly probable that a newly activated device will encounter empty stack. CONCLUSIONS AND FUTURE WORK The device discovery (network initialization) is a fundamental task in ad hoc network. It deploys the network without any predefined infrastructure - a defining property of the ad hoc networks. In this paper we have proposed a self-starting discovery protocol. The protocol uses leader election in order to solve the problem of broadcast acknowledgement in anonymous networks. The collisions among the devices that occur on the shared initialization channel are resolved by modified stack algorithm. The stack algorithm is non-blocked, since the devices are allowed to activate in the network at arbitrary instant. The simulation results show that the proposed protocol initializes the network in a time that depends linearly on the number of devices in the network. Hence, the protocol fulfills its basic task: rapid deployment of the ad hoc network.
The algorithm presented in this paper is in a basic variant and many issues can be further elaborated. Here we sketch a solution for the algorithm if the assumption for slotted channel is removed. Then, the leader takes a role of
The device discovery issue poses challenging questions for further research, just to mention some of them: How the protocol should be modified to work with frequency hopping channels, like in Bluetooth? How to extend the protocol to the multihop radio networks, where all devices do not share the same channel? Will the introduction of channel errors make the protocol design very difficult? The approach used in this self-organizing protocol can be extended beyond the discovery problem to the problem of self-organization at MAC layer in general. That is, it is very important how this result can be used for other networkcontrol operations in ad hoc networks, such as hellomessaging, broadcasting etc. REFERENCES [1] Perkins, C. E. (Editor), Ad Hoc Networks, AddisonWesley, (2001). [2] Frodigh, M. et al, “Future-generation wireless networks”, IEEE Pers. Comm., Vol. 8, No.5, pp.10–17, (2001). [3] Prasad, R. and Gavrilovska, L., “Personal Area Networks”, EUROCON'2001 Intl. Conf. on Trends in Comm., Slovakia, July (2001). [4] Gavrilovska, L. and Prasad, R., “B-PAN – a New Network Paradigm”, Proc. WPMC’01, Vol. 2, pp. 1135-1140, Aalborg, Denmark, September, (2001). [5] Johansson, P. et al., “Bluetooth: An Enabler For Personal Area Networking”, IEEE Network, Vol. 15, No. 5, pp. 28-37, (2001). [6] Nakano, K. and Olariu, S., “Randomized Initialization Protocols for Ad-hoc Networks”, IEEE Trans. Parallel Distrib. Sys., Vol. 11, No. 7, pp. 749-759, (2000). [7] Salonidis, T. et. al., “Distributed Topology Construction of Bluetooth Personal Area Networks” Proc. INFOCOM , Vol. 3, pp. 1577–1586, (2001). [8] C. Law and K.-Y. Siu, “A Bluetooth Scatternet Formation Algorithm”, Proc. GLOBECOM ’01, Vol. 5, pp. 2864–2869, (2001). [9] Sohrabi K., et. al.,”Protocols for Self-Organization of a Wireless Sensor Network,” IEEE Pers. Comm., Vol. 7, No. 5, pp. 16-27, (2000). [10] Bertsekas, D. P. and Gallager, R. G, Data Networks, 2nd ed., Prentice-Hall, Inc., (1991). [11] Tsybakov, B., "Survey of USSR Contributions to Random Multiple-Access Communications", IEEE Trans. Inform. Th., Vol. IT-31, No. 2, pp. 143--165, (1985)