J. Parallel Distrib. Comput. 66 (2006) 531 – 541 www.elsevier.com/locate/jpdc
Wireless ad hoc lattice computers (WAdL) Vishakha Guptaa,1 , Gaurav Mathurb,1 , Anil M. Shendec,∗ a Information Networking Institute, Carnegie Mellon University, Pittsburgh, PA 15213, USA b Department of Computer Science, University of Massachusetts, Amherst, MA 01003, USA c Roanoke College, Salem, VA 24153, USA
Received 20 December 2004; received in revised form 30 October 2005; accepted 19 November 2005 Available online 15 February 2006
Abstract We propose an architecture to harness the comparatively low computational power of geographically concentrated mobile devices (such as in a wireless ad hoc network, especially a sensor network) to build a wireless ad hoc lattice computer (WAdL). The primary contribution of the WAdL design is the ability to maintain, despite the mobility of the participating devices, a virtual lattice where the devices represent lattice points. WAdL is a cellular automaton-like architecture designed to carry out simulations of the unfolding of physical phenomena (e.g., fluid flow, system of moving, interacting objects, etc.) in the bounded region of Euclidean space represented by the underlying virtual lattice of WAdL. We present the design and algorithms of the WAdL architecture, and demonstrate its use with an example application (lift and drag on an airplane wing in flight) implemented on a simulated WAdL environment. We also discuss current issues and future directions of work on the WAdL architecture. © 2006 Elsevier Inc. All rights reserved. Keywords: Wireless networks; Ad hoc networks; Lattice computers; Scientific computing
1. Introduction Scientific computing largely deals with the prediction of attribute values of objects participating in physical phenomena. Usually the unfolding of these phenomena involves motion of the participating objects. There are no known analytical solutions for some physical phenomena, and the only apparent method of prediction is the analogical simulation of the unfolding of the phenomenon in a cellular automatonlike architecture—a lattice computer—representing the region of Euclidean space in which the phenomenon unfolds [11]. Lattice computers are massively parallel machines where the processing elements are arranged in the form of a regular grid, and where the computational demand on each individual processing element is quite low [12,3]. Each processing element ∗ Corresponding author. Fax: +1 540 375 2561.
E-mail addresses:
[email protected] (V. Gupta),
[email protected] (G. Mathur),
[email protected] (A.M. Shende). 1 Vishakha Gupta and Gaurav Mathur were undergraduate students at the Birla Institute of Technology and Science, Pilani, India, when this work was done. 0743-7315/$ - see front matter © 2006 Elsevier Inc. All rights reserved. doi:10.1016/j.jpdc.2005.11.005
represents a point/region of Euclidean space. In analogical simulations on a lattice computer, the motion of an object across Euclidean space is carried out as a sequence of steps, uniform in time, where in each step the representation of the object may move from one processing element to a neighbor, as defined by the underlying grid of the lattice computer [26]. Our work is based on the following premise: the proliferation of portable, wireless computing devices (e.g., cell phones, PDAs) promises the availability of a large number of computing devices in a relatively small geographic region. Much research has been focused on creating ad hoc networks using such mobile devices, and the applications for such networks are primarily for individual gain by end users (e.g., e-commerce for the owner of a device in the network). When such devices are equipped with sensors, the resulting wireless sensor networks are typically used for data acquisition; each sensor collects data from its surroundings and conveys that information to a central processing unit for analysis and for initiating some action. Such an ensemble of wireless devices (computing devices and/or sensors), despite their limited computational capacity, and limited range of communication, provides a rich infrastructure for creating a wireless ad hoc lattice computer (WAdL).
532
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
We propose the WAdL architecture as a wireless ad hoc distributed computing environment for harnessing the collective computing capabilities of the devices for the common cause of scientific computing. The rest of this paper is organized as follows: we discuss analogical simulations in more detail in Section 2. Section 3 has a summary of related work in the area of wireless ad hoc networks. Section 4 describes the architectural framework of WAdL, including the construction of the underlying logical lattice, and points out some usage scenarios for WAdL. Our simulation of a WAdL framework is described in Section 5. As a proof of concept, we present results of computing the lift and drag on a simple airplane wing in flight in our simulated WAdL framework; Section 5.1 describes this application, and the results of simulating this application on our WAdL simulator are discussed in Section 5.5. During our development of the WAdL framework, we identified several issues that will arise in a real-life scenario. We have not developed complete solutions, but present our preliminary work on these issues in Section 6. We conclude in Section 7 presenting some future directions for work on WAdL. 2. Analogical simulations A physical phenomenon is a development in a region of Euclidean space over a period of time. At each instant in time (in a given time period), the set of objects participating in the phenomenon, together with their attribute values (such as speed, spin, etc.) at that time, completely describes a snapshot in the unfolding of the phenomenon. Most problems in scientific computing are about phenomena whose unfolding involves the motion of participating objects in Euclidean space. Solutions to these phenomena usually involve determining (predicting) the attribute values of objects over time. Some phenomena can be solved analytically using closed form functions of time. On the other hand, there are phenomena where the only apparent method for predicting the attribute values of participating objects at any instant in time is to simulate the unfolding of the phenomenon up through that instant of time [11]. When carried out on a digital computer, such simulations, necessarily, develop in a discretized representation of a region of Euclidean space, and over discrete time units. Moreover, such simulations must use, at any given instant of simulation time, only information available locally, at a discrete point in the represented Euclidean space, to compute the attribute values of participating objects at the next instant of simulation time. Cellular automaton machines [12] and lattice computers [3] provide the necessary framework for a discretized representation of Euclidean space in which to carry out such simulations. Several physical phenomena, including spherical wavefront propagation and fluid flow [9,30], have been successfully simulated on such a framework where the simulation algorithms do not use the traditional analytical models for the phenomena. 3. Related work There has been intensive work done in the general areas of ad hoc mobile networks and ad hoc sensor networks. In such
networks, there is a need for routing algorithms to react quickly and adapt effectively, to highly dynamic network conditions. Most routing algorithms follow either the proactive [1,27] or ondemand (e.g., AODV [IETF RFC-3561], indirect proxy-based routing [5]) routing strategies. Another solution is offered by geometric/location/position-based routing algorithms such as— Face Routing [18], Adaptive Face Routing [18], Bounded Face Routing [18], Geocasting [16] and Greedy Parameter Stateless Routing [15]—all of which assume location awareness in the mobile device [4], for routing. Other solutions include energyaware routing [20] that allows a node to efficiently utilize its limited power resources. Effort has also gone into controlling the network topology so that existing low-level Media Access Control (MAC) and higher-level network protocols, e.g., TCP [IETF RFC-793] or UDP [IETF RFC-768] and routing protocols can be implemented. This has led to the development of local algorithms for topology control [14], to replace or supplement global algorithms. Other focus areas include developing efficient media access control protocols to optimize available bandwidth—such as using orthogonal arrays for scheduling [28]. Work has also gone into optimizing the performance of existing protocols such as TCP on mobile networks [13]. Improving end-to-end delays is another important concern and has led to the development of techniques such as role-based hierarchical self-organization [17]. There are some innovative approaches that are being developed to better utilize the computational capabilities of even low power and low computational capability devices. Swarm computing [10] is one such approach that involves developing methods for creating, understanding and validating properties of programs that execute on “swarms” of computing devices, analogous to cells in a biological system. Another approach is the integration of mobile devices into computational grids [21,23,8]. Both the approaches try to couple the distributed computing power of scattered devices for supporting computeintensive scientific and commercial applications using traditional solution techniques, i.e., analytical solutions. 4. The WAdL architecture The goal of the WAdL architecture is to use the participating mobile devices (henceforth referred to as nodes) in a geographic area to discretize a bounded region of Euclidean space, B, and then carry out analogical simulations of physical phenomena in this discretized representation of B using the methodology proposed in [3]. The model described in [3] uses a root lattice as the discretized representation of a bounded region of Euclidean space. There is a processor at each lattice point, and this processor, say at lattice point p, can communicate with only its neighbors in the lattice, i.e., those processors at lattice points q such that (q − p) is a minimal length vector in the lattice. Each of these processors is required to have minimal computational ability. Hence, in a WAdL, the participating nodes (mobile devices in the given geographical region) are logically organized so that
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
533
sensor-grid which could be made into a WAdL and exploited for simulations. 4.1. Lattice formation r b p a
q c L
(0,0) Fig. 1. Euclidean space B formed from lattice L by mapping nodes a, b and c to lattice points p, q and r, respectively.
each node is responsible for a point of a bounded piece of a root lattice L (Fig. 1); this piece of L represents B. 2 The logical organization of the nodes is such that each node, responsible for a lattice point p, is within communication range of all nodes responsible for any lattice point q where (q − p) is a minimal length vector in the lattice. We assume that each participating node has some minimal computational and storage facilities, is equipped with some form of location service, e.g., GPS, and has some communication capabilities, e.g., Bluetooth [bluetooth.org], Zigbee [zigbee.org] and IEEE standard 802.11. Each WAdL consists of a single immobile node or a basestation (denoted by I) designated as the manager, and a collection of mobile devices as the nodes in the lattice computer. I provides a lattice L with a fixed origin (in its region of influence) and then each lattice point p is assigned all mobile devices within the Voronoi cell 3 around p. For example, in Fig. 1 nodes are mapped to the nearest lattice point : a → p, b → p and c → q. There may be cases where several nodes are assigned to the same lattice point (e.g., p is assigned a and b in Fig. 1) and where no nodes are assigned to a lattice point (e.g., r in Fig. 1)—these are discussed in Section 6.4. Each node is then addressed (for communication) by the coordinates of the lattice point it is assigned to. (See Section 6 for a discussion of situations where some of the Voronoi cells may not contain any mobile device.) We envision the development of cheap computational grids from Mote like devices [6]. These devices would have limited computational capabilities and would communicate using the wireless medium. WAdL would enable these devices to selforganize into a computational grid which could execute CAbased, massively parallel computations. Alternately, a futuristic scenario like that presented in [29] could provide an always-on 2 A lattice, by definition, is an infinite object. Nonetheless, for expositional
convenience, henceforth in this paper, by lattice we will mean a finite piece. Thus, it is reasonable for a lattice to represent a bounded region of Euclidean space, to count the number of points in a lattice, etc. 3 The Voronoi cell around a lattice point p, by definition, is the set of points t in Euclidean space such that t is closer to p than to any other lattice point.
The nodes in a WAdL are first organized into a twodimensional lattice, and hence, we will refer to the square lattice (Z2 ) and the cellular lattice (A2 )—the root lattices that exist in two-dimensional Euclidean space. (Technically, Z2 is the square lattice with minimal distance √ 1, and A2 is the cellular lattice with minimal distance 2; for expositional convenience, by Z2 and A2 we simply mean lattices that are generated by equal, orthogonal basis vectors, and equal basis vectors at an angle of /3 to each other, respectively; we will denote the minimal distance in the particular lattice we use by (Z2 ) and (A2 ), respectively.) 4.1.1. Lattice resolution In order to map each mobile device to L, we need to determine the resolution of L, i.e., the minimal distance between points in L, denoted by (L). Each mobile device in the region will be assigned to a point, p, of L, such that the mobile device is in the Voronoi cell around p in L. Clearly, then, (L) must be chosen such that any two mobile devices that are assigned to adjacent points in L can communicate with each other. The following lemma establishes a reasonable upper bound on (L). Lemma 1. Suppose the underlying lattice for a WAdL is L. Suppose the range of the transmitter/receiver of all devices in the region is at least . Then, devices that are assigned to adjacent points in L can communicate with each other if ⎧ √ 2 ⎪ ⎪ ⎪ if L = Z2 , √ ⎪ ⎨2+ 2 (L) √ ⎪ ⎪ 3 ⎪ ⎪ ⎩ if L = A2 . √ 2+ 3 Proof. We will first establish an elementary fact regarding distances between points in two spheres. Claim 1. Suppose C1 and C2 are two closed circles, centered at c1 and c2 , and with radii r1 and r2 , respectively. Then, for any two points p in C1 and q in C2 , d(p, q)d(c1 , c2 ) + r1 + r2 . Proof (Claim 1). Using the triangle inequality, it follows that d(p, q) d(p, c2 ) + d(c2 , q) d(c1 , c2 ) + d(c1 , p) + d(c2 , q) d(c1 , c2 ) + r1 + r2 .
Voronoi cells around any lattice point are simply translates of the Voronoi cell around the origin of the lattice. Each face of the Voronoi cell around the origin perpendicularly bisects some vector in the lattice. These vectors are called relevant
534
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
vectors in the lattice. (See [3] for more on Voronoi cells in lattices.) Both Z2 and A2 , being root lattices, have the property that the set of minimal length vectors is the same as the set of relevant vectors, and hence, the Voronoi cells in these lattices are circumscribed by spheres [24]. It can be easily verified that in the case of Z2 , the radius of this circumscribing sphere is (√ Z2 ) , and in the case of A , it is (√A2 ) . 2
2
3
Clearly, every point in the Voronoi cell around a lattice point is in the sphere circumscribing the Voronoi cell. Let t be the distance between two devices assigned to adjacent lattice points. Then, using Claim 1, we have an upper bound on t: ⎧ (L) ⎪ ⎪ if L = Z2 , ⎨ (L) + 2 · √ 2 t (L) ⎪ ⎪ if L = A2 . ⎩ (L) + 2 · √ 3 The two devices will be able to communicate if the transmission range, , of the weakest device is more than this upper bound, i.e., ⎧ (L) ⎪ ⎪ if L = Z2 , ⎨ (L) + 2 · √ , 2 (L) ⎪ ⎪ if L = A2 . ⎩ (L) + 2 · √ , 3 Thus, solving for (L), we have the lemma.
4.1.2. Forming the lattice As noted in Section 4, we assume that all the devices participating in the WAdL are equipped with GPS. We will assume that the fixed device, the base-station for the WAdL, and the mobile devices use the Earth-Centered, Earth-Fixed (ECEF) coordinate system. (Euclidean coordinate system, where the center of the earth is the origin, the X-axis is defined by the intersection of the equator and the 0 longitude, and the Y -axis is defined by the intersection of the equator and the 90E longitude.) In a WAdL, the coordinates, I, of the base-station are the origin of the underlying lattice, L. The lattice L is completely specified by the origin and a basis for the lattice. Since we are concerned only with two-dimensional lattices, the basis for our lattice will have a size of two. In the following, for any two vectors u and v, (u, v) denotes the inner product of the vectors. Definition 1. A basis {b1 , b2 } for a two-dimensional lattice L is a regular basis iff 1. b1 = b2⎧ , and ⎨0 2. (b1 , b2 ) = b1 2 ⎩ 2
if L = Z , 2
if L = A2 .
In other words, if L is the square lattice, the basis vectors in a regular basis for L are equal in length and at an angle of /2 to each other; if L is the cellular lattice then the basis vectors in a regular lattice for L are equal in length and at an angle of /3 to each other. Note that the length of each of the basis vectors, in these cases, is also the length of a minimal length vector, (L), in the lattice.
Based on the weakest transmitting device at the time of first forming the WAdL, the base-station computes the resolution of L, and hence, the vectors b1 and b2 such that {b1 , b2 } is a regular basis for L. Each mobile device is sent I, these basis vectors, and the type of lattice (Z2 or A2 ) to be formed. We now discuss how each mobile device can then compute the lattice point in L that it is assigned to. In this paper, we assume that all the mobile devices are, indeed, in the plane of the lattice defined by b1 and b2 . This is a reasonable assumption to make in some scenarios, e.g., where the participating mobile devices are sensors placed in an open field. Dealing with the case where some of the mobile devices may not be in the same plane as the underlying lattice is an intriguing problem for further research. For the lattice L, let M(L) = {m1 , m2 , . . .} denote the set of minimal length vectors. The set of minimal length vectors for our two lattices are then given by M(Z2 ) = {b1 , b2 , −b1 , −b2 }, M(A2 ) = {b1 , b2 , −b1 , −b2 , b1 − b2 , b2 − b1 }. Definition 2. A positive representation for a point p in the lattice L is a four-tuple , , mi , mj such that: 1. , 0, 2. {mi , mj } ⊆ M(L), and 3. p = mi + mj . We will sometimes write the positive representation for a point p in L as mi + mj . Every point in the plane of the underlying lattice of a WAdL is either along the line defined by a minimal length vector, or is in the open cone bounded by the lines defined by two minimal length vectors that are orthogonal in the case of Z2 , or at an angle of /3 to each other in the case of A2 . Thus it is easy to verify that: Lemma 2. Suppose L ∈ {Z2 , A2 }. Then, every point, p, in the plane of L has a positive representation , , mi , mj such that {mi , mj } is a regular basis for L. Now, Lemma 3 follows from the fact that adjacent minimal length vectors are orthogonal in Z2 and are at an angle of /3 to each other in A2 . Lemma 3. Suppose D is a point in the plane of L and M(L) = {m1 , . . . , mk }. Then, (D,mi ) 1. D = mi , > 0 iff (D (L)) = 1 and 2. D = mi + mj , , > 0, and {mi , mj } is a regular basis for L if (D,mj ) (D,mi ) 2 (a) (D and (L)) > 0 and (D(L)) > 0 if L = Z
(b)
(D,mi ) (D(L))
>
1 2
and
(D,mj ) (D(L))
>
1 2
if L = A2 .
Since the number of minimal length vectors in each case is finite and computable, Lemma 3 effectively provides an algorithm for computing a positive representation for any point in
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
the following sense: given a point L, M(L), and D represented in some basis for L, if condition (1) is satisfied for any vector in M(L), compute ; otherwise, find the pair of vectors in M(L) so that condition (2) is satisfied and compute and . Similarly, Lemmas 4–6 provide algorithms for determining the lattice point p, such that a given point D is in the plane of the lattice in the Voronoi cell around p. Lemmas 4 and 5 are fairly straightforward; we provide a sketch of a proof for Lemma 6. For a real number x, let rnd(x) denote the integer obtained by rounding x, i.e., rnd(x) = (x + 0.5) . Lemma 4. Suppose the positive representation for a point D is mi . Then, D is in the Voronoi cell around the lattice point rnd()mi . Lemma 5. Suppose L = Z , and suppose the positive representation for a point D is mi + mj . Then, D is in the Voronoi cell around the lattice point rnd()mi + rnd()mj . 2
Lemma 6. Suppose L = A2 , and suppose the positive representation for a point D is mi + mj . Let P = mi + mj , Q = mi + mj , R = mi + mj , D1 = D − P and D2 = D − Q. (See Fig. 2.) Then, D is in the Voronoi cell around the lattice point
2. 3. 4. 5.
(D1 ,mi )
21 2 i) > 21 Q, if (D1,m 2 i) 21 R, if (D1,m 2 i) > 21 Q, if (D1,m 2 i) > 21 R, if (D1,m 2
1. P, if
(D1 ,mj )
21 , 2 (D ,m ) and 12 j 21 , (D ,m ) and 12 j > 21 , (D ,m ) and 12 j > 21 (D ,m ) and 12 j > 21 and
and and
(D2 ,mj −mi )
2 (D2 ,mj −mi ) 2
21 . > 21 .
Proof. The expressions above compute the projection of the point D − P on mi and mj . For example, Item (1) above computes the lengths of the projections on both mi and mj , and if the lengths of both the projections are no more than half the minimal length, then D is in the Voronoi cell around P. Similarly Items (3) and (2). Items (4) and (5) deal with the case where the projections of D − P on both mi and mj are more than half the minimal length. In that case, D is in the Voronoi cell around Q or R, and this decision is based on the projection of D − Q on mj − mi . (For example, the point D shown in Fig. 2 will satisfy the conditions in Item (5), and thus is in the Voronoi cell around R.) Now, suppose a participating mobile device is at coordinates C. It first computes its coordinates D = C − I , relative to the origin of the lattice. Then, using the algorithm provided by Lemma 3, it computes a positive representation for D. Finally,
535
R
mj
P
D
mi
Q
Fig. 2. Computing closest lattice point in A2 .
using one of the Lemmas 4–6, as appropriate, it computes the lattice point it is assigned to. Thus, based on the computations involved in the above lemmas, we have the following theorem: Theorem 1. Each participating mobile device in a WAdL can compute the lattice point it is responsible for in constant time. 5. Simulation of a WAdL application This section describes the developed prototype for our WAdL architecture. The top-most layer of our architecture is formed by the WAdL application. Section 5.1 describes the application and its implementation. Each participating WAdL node has a single instance of this application executing on it, which interacts with a local WAdL manager process (Section 5.2) that resides on the node. These manager processes form the middle tier of the architecture and are responsible for performing all tasks related to the working and maintenance of WAdL. Communication between the WAdL manager processes happens over the bottom-most tier of the architecture, the network itself. Our prototype implementation has a WAdL Simulator (Section 5.3) that has the capability of simulating the activities of multiple WAdL nodes, on a single computer. The bottom network layer is represented by a virtual communication network (Section 5.4) constructed using Network Simulator 2 (ns-2). In this setup, every (logical) WAdL node has a counterpart in ns-2 and data are communicated over the network formed by these ns-2 nodes. Though our current results assume an ideal network environment with no congestion or packet loss, the use of ns-2 permits us to formulate future experiments to account for problems posed by these phenomenon in a more realistic setting. 5.1. The WAdL application We demonstrate the capabilities of WAdL using a simple application that computes the lift and drag on an airplane wing as it flies in virtual Euclidean space. We assume that the graphs—coefficient of lift CL versus angle of attack (AOA), and coefficient of drag CD versus CL — are pre-computed and known for the wing whose flight we wish to simulate. Additionally, we know that the lift and drag generated by a wing is directly proportional to the wing area, fluid density and the square of the wing velocity. Using these
536
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
graphs and knowing the values of these variables, the lift and drag of the wing can be computed. The virtual wing is represented by a set of lattice points in virtual space. Thus, each of these lattice points effectively represents a segment of the wing. The sum of the lift and drag value computed at each of these points provides the net lift and drag experienced by the wing. The density of the air decreases with increase in altitude. To provide a realistic simulation, we provide the varying density as a parameter to the virtual lattice before start of simulation. We move the virtual wing through our generated Euclidean space with constant velocity. As the wing moves, it generates lift, increasing the altitude of the wing. With increase in altitude, the density of air reduces, and so should the observed lift on the virtual wing. The wing’s virtual “flight” should be visible by observing the state of the WAdL nodes at every simulation time instant. In our simulation, a message is received by the application process at a node, p, from a neighboring node, when a section of the aircraft wing “arrives” at p’s virtual lattice coordinates. The information provided in the arriving message is then used by the application process to calculate the speed, lift and drag generated by that section of the wing. It also computes the direction of motion of the virtual wing and the virtual coordinates, C, of the wing’s next destination. Accordingly, the application sends a message carrying the current values of the wing parameters to the destination WAdL node with virtual coordinates C. This message arrives at the destination node two simulation time units later, irrespective of the distance (in hops) of the destination node from the source node. The processing of this message then proceeds in a similar manner. 5.2. The WAdL manager process There is a single instance of the WAdL manager process executing on every WAdL node. The WAdL manager process is responsible for keeping the local clock synchronized, and for maintaining the clock skew (with respect to the global clock) within acceptable limits. It also maintains simulation time for the node. The WAdL manager process at each node maintains the node’s mapping to each of the two lattices—(a) the physical lattice and (b) the logical/virtual lattice (see Sections 4.1 and 6.2). As the virtual lattice is application-specific in nature, the manager process permits the application to define the algorithm for mapping the physical lattice to the virtual lattice. The current application (see Section 5.1) requires a uniform three-dimensional lattice of side s. We use a simple mapping algorithm that places every sth node from L in the same plane, thus creating a three-dimensional virtual lattice V of “height” s, as depicted in Fig. 3. The algorithms used in the implementation for calculating the physical and virtual lattice coordinates of a node provide a local method of mapping any given WAdL node to the virtual lattice V. Once a node becomes part of the virtual lattice, it can participate in the formation of WAdL. Periodic execution of these algorithms by each node ensures that the mapping of the node in L and V is accurate. The time period of execution is directly proportional to the rate of
(a)
(b)
L
V
(c) Fig. 3. Mapping a two-dimensional lattice to a three-dimensional lattice.
change of the node’s location, and can be determined locally by every node. Thus, to ensure consistency, a node in rapid motion would need to execute these algorithms more frequently than a slow-moving node. The manager process also handles the communication requirements of the application. It is responsible for ensuring that messages being sent from a node to one or more of its virtual neighbors reach all of them at the same simulation time instant, even though each virtual neighbor could be one or more hops away. 5.3. The WAdL simulator The WAdL simulator executes on a single machine, and is capable of simulating the behavior and activities of an arbitrary number of WAdL nodes. However, the WAdL simulator is artificially limited by the maximum number of virtual network nodes that ns-2 can simulate. The goal of the WAdL simulator is to allow the operation of multiple WAdL nodes to be simulated on a single machine, and ensure that the global state at the end of each virtual time instant is identical to the case if the nodes were executing in parallel on separate physical nodes in an ideal environment. In order to implement this, the WAdL simulator maintains incoming and outgoing message buffers for each of the nodes being simulated. The WAdL simulator serially executes the state of WAdL nodes one at a time, processing “incoming” packets for each node represented by packets in the incoming buffer, and “transmitting” packets, represented by placing of packets in the outgoing buffer. The simulator interfaces with the virtual network (Section 5) that provides the communication links between WAdL nodes. The purpose of this simulator is to prototype and demonstrate the design and uses of a WAdL, and hence, we assume a simplified and ideal model of WAdL. Distributed clock synchronization (which is currently not required as the simulator executes on a single machine) and fault tolerance strategies have not been implemented yet, though the design of the
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
simulator gives us the capability of extending it to support more complex WAdL models.
5.5. Simulation results Although the architecture we have described above could be used to model several different scenarios but we have presented the data and studied the results based on the ideal model. We executed the WAdL simulator on the virtual network formed by ns-2 with the following parameters: 1. A uniform three-dimensional lattice of side s that is computed from the available nodes in the given geographical area. We use a simple mapping algorithm that places every sth node in the same plane, thus creating a three-dimensional lattice of “height” s, as depicted in Fig. 3. 2. We set the WAdL node count to 1000 nodes, so that we could construct a regular three-dimensional virtual lattice with a side of 10 lattice points. 3. We set one simulation time unit equal to 2 s of physical time. This was done to ensure that the packets travel one hop closer to their intended destinations, with every passing simulation time unit. This also helps in the elimination of non-deterministic delays in packet delivery caused due to communication jitter and network congestion. 4. We provided the application with factual data, for use in calculating the lift and drag on the wing—(a) decreasing air density values for increasing altitude, and (b) coefficient of lift (CL ) and drag (CD ) values from graphs obtained from an actual wing [7]. 5. The ns-2 simulator was configured to provide TCP/IP based communication links between nodes, at a maximum bandwidth of 1 Mbps. The obtained simulation results are identical to the results obtained from the analytical model of the phenomenon (the
Altitude (in m)
We use ns-2 to create a virtual network of wireless nodes for the WAdL simulator. The network simulator creates the required number of WAdL nodes, according to the specified network topology. The current ns-2 implementation also supports limited node mobility, and we are currently working on extending this to support more complex mobility models. The movement of nodes is handled by ns-2, with ns-2 periodically communicating the new physical coordinates of the node to the WAdL simulator (see Section 5.3). The simulator then takes appropriate action to ensure that this change of location remains transparent to the application. The packet sent by the application is received first at the ns-2 layer where the packet is examined to determine the nodes in ns-2 that correspond to the packet’s source and destination. Based on this information, the packet is then ‘sent’ over the virtual ns-2 network. Once the packet is received by the destination ns-2 node, it forwards the packet to its corresponding WAdL manager process (see Section 5.2), which then decodes and processes the data.
Flight of the Virtual Wing in 10 x 10 x 10 Virtual Lattice
3500 3000 2500 2000 1500 1000 500 0
0
0.9 0.8 0.7 0.6 0.5 n m) 0.4 100 200 (i 0.3 th 300 400 ng 0.2 Displac e l 500 0.1 ement ng (in m) 600 700 800 0 Wi
Fig. 4. Flight of the virtual wing in the virtual, regular, three-dimensional lattice of side 10 lattice points. The size of the wing has been exaggerated to improve figure clarity, while data pertinent to the wing’s location in the lattice have been obtained from the simulation.
Virtual Wing in 10 x 10 x 10 Virtual Lattice
4000
Decrese in lift generated by the wing as its altitude increses Ideal path of the wing in the virtual lattice with no change in air density Actual path of the wing in the virtual lattice
3500 z co-ordinates in Virtual lattice
5.4. Simulating the network
537
3000 2500 2000 1500 1000 500 0
0
100
200
300 400 500 600 x co-ordinates in Virtual lattice
700
800
Fig. 5. Decrease in lift generated by the wing with increasing altitude.
application and its underlying theory are discussed in Section 5.1). Fig. 4 shows the virtual wing’s flight through the virtual lattice, and Fig. 5 shows the decrease in lift with the increasing altitude of the wing (in keeping with the constructed model, as described above). We find that the results obtained from WAdL precisely match the results obtained from the analytical model of the wing’s flight. The traces generated by the application are plotted in Fig. 6. As the graph depicts, the maximum bandwidth utilization for any active WAdL communication link is extremely low at 64 bytes (this is the size of each communication packet generated by the WAdL nodes), and is sporadic in nature as well. Additionally, the computation performed by each participating node is extremely simple and not resource intensive. Thus, we conclude that WAdL-related communication causes negligible disruption to ongoing communication and computation in the network.
538
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
Bandwidth Usage (in bytes)
Bandwidth Utilization
q
64.8 64.6 64.4 64.2 64 63.8 63.6 63.4 63.2
q
p
p
r s
(a) 1000
(b)
Fig. 7. (a) Obstruction and (b) unreachable nodes.
800 50000 100000 150000 200000 250000 Time sin 300000 ce simula 0 350000 tion start (in ms) 400000
600 ber num l a eri
400 200
de
No
s
Fig. 6. Bandwidth utilization of the WAdL simulator.
6. Preliminary work on unresolved issues In the preceding sections, we discussed the construction and application of WAdL in an ideal setting. Here, we discuss our preliminary work on addressing some issues that will undoubtedly arise in a real-life environment. 6.1. Communication in the presence of obstructions We propose a simple scheme here to route messages around physical obstructions in L; thus making the presence of any obstructions transparent to L and the application. We modify the lattice formation process as follows. Once a node p computes its physical coordinates it stays in a node discovery phase for a short while, attempting to discover communication routes to neighboring nodes. p pings all nodes in its antenna range—all nodes receiving this message are supposed to reply to this node with their own physical coordinates. If there is no obstruction and all the neighboring nodes are present, the coordinates of the responding nodes form an unbroken mesh on a graph. Breaks in the mesh structure are translated as missing coordinates and can be interpreted as one of the following cases. 1. Nodes are out of communication range of p. For most wireless devices, the responding nodes form a mesh that is approximately circular in shape, whereas the presence of obstructions cause sectors of this circle to be missing. Thus, when nodes start responding to p, it computes the distance between itself and the responding node Rp (based on coordinate geometry distance formula), and stores the maximum value max(Rp ) encountered so far. Once all responses have been obtained, the max(Rp ) computed is the effective antenna range of p (in physical lattice units). Approximately all nodes whose distance from p is greater than max(Rp ) can be deemed as out of range. 2. There are no devices at the missing coordinates. Thus, there are holes at these lattice coordinates. We do not consider how to fill these holes as this is a separate topic altogether. However, we do consider the detection of this case and its implications here. We compute an imaginary line between p
and the missing coordinates, and check if nodes are present at a distance greater than that of the missing node but less than or equal to max(Rp ). If a response had been received from any nodes meeting these criteria, then we can conclude that we have a missing node. However, if no response has been received from these nodes, we conclude that an obstruction is present—the next case. 3. There is an obstruction preventing communication of some nodes with p. This case is detected as described in the previous point. Both these cases are similar due to the presence of holes that needs to be filled. However, the difference is that in this case the obstruction causing the hole prevents other nodes from communicating with p, whereas in the previous case the hole did not prevent communication with p. Thus, in this particular case we need to route around the obstruction to reach nodes behind the obstruction. p lists the unreachable nodes and broadcasts this list to all nodes in its antenna range. Nodes that can reach one or more of the nodes in the list have to respond to p with the relevant information. We consider Fig. 7(a), where we have a node q within range of p that can reach nodes behind the obstruction (note that q would have discovered these nodes during its own discovery phase). In this case, other neighboring nodes will also respond, but will probably not be able to reach as many nodes as q. Thus, p will use q for routing messages to the nodes behind the obstruction. To save repetition, the obstructed nodes are also informed of the reverse route as they would also attempt to detect a route to p during their respective node discovery phases. Fig. 7(b) shows a case where p’s list of unreachable nodes contains r and s. It finds q as a router for messages to r and a few other nodes but not s. Now q also broadcasts the list of unreachable nodes and node r responds with a route to s. Thus, now p is able to use q and then r as routers for messages to s. This forwarding process can be limited to two to three hops using a field similar to the hop limit field in the IPv6 packet header. If a route to a node is not found within two to three hops, this case can be treated as being similar to the case where the device is absent from the coordinates. 6.2. Lattice structure Depending on the application, it may be necessary to perform the simulation in a virtual root lattice V whose dimension is higher than that of the two-dimensional lattice L formed from the devices in the region. In this case, the application provides
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
the mechanism for logically rearranging L to form V. An example of this is illustrated in Fig. 3. In the WAdL architecture, the application interacts only with its immediate neighbors in V called virtual neighbors, unaware of the existence of L. On the other hand, each node is capable of direct communication (one hop) only with adjacent nodes in L called physical neighbors. Depending on the algorithm used to map L to V, some of a node’s virtual neighbors may be more than one hop away. This difference in the distance to virtual neighbors should be transparent to the application. Algorithms presented in [26] help ensure that in a lattice computer, messages propagating from a node at a lattice point m to a node at lattice point n take time proportional to the Euclidean distance represented by the two lattice points. 4 Alternatively, messages to destinations more than one hop away can be routed to their destination using one of the wireless ad hoc message routing algorithms (see Section 3). 6.3. Lattice granularity Since the application we present in Section 5.1 requires the use of a logical lattice V, and the discussion on WAdLs with logical lattice subsumes the discussion on WAdLs without a logical lattice, we will assume for the rest of the paper that we are dealing with a WAdL using a logical lattice. We define the granularity of the underlying lattice (L and V ) as follows: 1. Fine granularity—this kind of lattice is formed when the minimal distance in L is small, allowing the number of points in L to be higher. The increase in the number of points of L similarly affects the number of points of V, thus providing a larger region of Euclidean space for the application. Such a lattice is well-suited to a scenario where we expect mobility to be low. Some problems associated with a fine granularity lattice are: (a) The motion of the nodes causes them to “hop” from one point to another within L, and hence within V. This motion is rapid (due to the minimal distance in L being small) and causes higher maintenance overheads for WAdL. (b) The level of fault tolerance is lower, since each lattice point can have only a few associated nodes (see Section 6.4). For fine-granularity lattices, the nodes have to be in close physical proximity for them to be mapped to the same point in the lattice(s). There is less probability of several nodes being in the Voronoi cell around a lattice point, if we assume a uniform distribution of nodes. 2. Coarse granularity – This kind of lattice is formed when the minimal distance in L is large. This causes the lattice size of L to be smaller in comparison to fine granularity 4 Work done since submitting this manuscript for review shows how the
timing of message propagation can be preserved despite some lattice points not being represented by any nodes [22].
539
lattices. Such a lattice is well-suited to a scenario where we expect mobility to be relatively high. Consequently, the size of V and the size of the region of Euclidean space are also smaller. (a) Unlike fine granularity lattices, the movement of nodes within L and V is slower, causing lesser management overheads for WAdL. (b) A higher level of fault tolerance is possible in such lattices. This is possible because the physical distance between two adjacent lattice points is greater. There is a higher probability of several nodes being in the Voronoi cell around a lattice point, assuming a uniform distribution of nodes over a given geographical area, and thus being mapped to the same lattice point (see Section 6.4). 6.4. Fault tolerance The first node that arrives at a lattice point m becomes the primary node for that point. When more nodes are mapped to m, these nodes join the backup pool maintained for m. One or more of the following fault tolerance strategies can be adopted for WAdL, depending upon the application requirements. 1. The nodes in the backup pool normally remain passive. Only when the primary node (a) fails or (b) moves and hence is mapped to another lattice point, one of the nodes is taken from the backup pool, to replace the primary node. This node becomes the new primary node for that lattice point. 2. The nodes in the backup pool are active. The primary node passes on all received and sent parameters to the nodes in the backup pool. Every node in the backup pool performs computations in parallel with (but independent of) the primary node of the lattice point. When the primary node (a) fails or (b) moves and hence is mapped to another lattice point, a node from the backup pool assumes the responsibilities of the primary node and resumes computation from where the previous primary node had stopped. 3. A check-pointing and rollback scheme is adopted. In this scheme, when a node fails, the application is stopped. When another node becomes available to take its place, the application state is rolled back to the last good checkpoint, from where the WAdL nodes resume computation. 4. A node’s neighbors are used for computation during node failure. In this scheme, when a node mapped to a lattice point m fails and no nodes are available in the backup pool for m to take its place, one of the neighbors takes up the responsibilities of the node. The neighbor thus ends up performing tasks for two nodes. When a node becomes available at m, the neighbor transfers the state to this new node. 6.5. Mobility scenarios 1. A node n1 is moving from lattice point m to lattice point n. A node n2 is available at m. In this case, n1 transfers its application state to n2 , and then gets mapped to n.
540
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
2. A node n1 exists at lattice point m and another node n2 gets mapped to m as well. n2 then joins the pool of backup devices for m. Any one of the fault tolerance strategies described in Section 6.4 can be adopted. 3. A node n1 is moving from the region of lattice point m to the region of lattice point n, and no node is present in the backup pool at m. A hole is created at m and an appropriate fault tolerance strategy can be used (see Section 6.4). 4. A hole exists at lattice point m and a node arrives to fill the hole. Depending on the fault tolerance strategy used (see Section 6.4), the system either performs a rollback to a checkpoint, or a neighboring node transfers the failed node’s state to the arriving node. 7. Conclusions and future directions We propose an architecture to utilize the geographical concentration of mobile devices in a wireless ad hoc network to construct a wireless ad hoc lattice computer (WAdL) that could be used to perform scientific analogical simulations. We present one of the scenarios where such a lattice computer could be used effectively. To show the feasibility of this architecture and its applications, we have implemented a WAdL simulator and a simple application that utilizes the architecture, to compute the lift and drag generated by an aircraft wing in flight. Our results show that the network utilization of WAdL is extremely low. This, coupled with the fact that WAdL computation is also infrequent and not computation intensive in nature, enables the WAdL architecture to be deployed in existing mobile ad hoc networks (including mobile sensor networks), without adversely affecting their performance. Besides the preliminary work on issues discussed in Section 6, there are several other directions for future work on WAdLs. In closing, we briefly discuss a few of them here: 1. Distributed clock synchronization—For exact simulations in practice, WAdL requires that the clocks on all the devices be synchronized. Several schemes have been proposed in the literature for achieving this [25,2,19]. We are currently exploring the possibility of using the network time protocol (NTP) [IETF RFC-1305] for this purpose. 2. Density of available mobile devices—If the density of mobile devices in WAdL falls below a certain threshold, or if the number of holes created in the lattice (see Section 6.5) goes above a certain threshold, it is infeasible to simulate the desired lattice, and so the application simulation has to be stopped. Further experimentation with the WAdL simulator will help us determine these thresholds. 3. Accuracy of the location service—Since devices are mapped to lattice points based on their geographic coordinates as determined by the location service, it is important for the location service to be accurate. Working out the tolerable drift in this accuracy and correcting for the drift are open problems. 4. Integrating multiple WAdLs—An extension of our proposed model is to link together multiple, geographically distant, WAdLs to form a single virtual WAdL. This will allow for
the simulation of a larger region of Euclidean space. Such an extension, in turn, raises all of the above issues in a different context, e.g., clock synchronization across WAdLs, handling the mobility of a device from one WAdL to another, etc. References [1] C.L. Barrett, S.J. Eidenbenz, L. Kroc, M. Marathe, J.P. Smith, Parametric probabilistic sensor network routing, in: Proceedings of the 2nd ACM International Conference on Wireless Sensor Networks and Applications, 2003, pp. 122–131. [2] P. Blum, L. Meier, L. Thiele, Improved interval-based clock synchronization in sensor networks, in: Proceedings of Information Processing in Sensor Networks, 2004. [3] J. Case, D.S. Rajan, A.M. Shende, Lattice computers for approximating Euclidean space, J. ACM 48 (1) (2001) 110–144. [4] L. Cheng, I. Marsic, Piecewise network awareness service for wireless/mobile pervasive computing, Mobile Networks Appl. 7 (4) (2002) 269–278. [5] W. Choi, S.K. Das, Design and performance analysis of a proxy-based indirect routing scheme in ad hoc wireless networks, Mobile Networks Appl. 8 (5) (2003) 499–515. [6] D. Estrin, D. Culler, K. Pister, G. Sukhatme, Connecting the physical world with pervasive networks, IEEE Pervasive Comput. 1 (1) (2002) 59–69. [7] Factual data on lift and drag on an aerofoil http://www.centennialofflight.gov. [8] I. Foster, C. Kesselman, S. Tuecke, The anatomy of the grid: enabling scalable virtual organizations, Internat. J. Supercomput. Appl. 15 (3) (2001). [9] U. Frisch, B. Hasslacher, Y. Pomeau, Lattice-gas automata for the Navier Stokes equation, Phys. Rev. Lett. 56 (14) (1986) 1505–1508. [10] S. George, D. Evans, S. Marchette, A biological programming model for self-healing, in: First ACM Workshop on Survivable and SelfRegenerative Systems, October 2003. [11] D. Greenspan, Deterministic computer physics, Internat. J. Theoret. Phys. 21 (6/7) (1982) 505–523. [12] W.D. Hillis, The connection machine: a computer architecture based on cellular automata, Physica D 10 (1984) 213–228. [13] G. Holland, N. Vaidya, Analysis of TCP performance over mobile ad hoc networks, Wireless Networks 8 (2/3) (2002) 275–288. [14] L. Jia, R. Rajaraman, C. Scheideler, On local algorithms for topology control and routing in ad hoc networks, in: Proceedings of the Fifteenth Annual ACM Symposium on Parallel Algorithms and Architectures, 2003, pp. 220–229. [15] B. Karp, H.T. Kung, GPSR: greedy perimeter stateless routing for wireless networks, in: Proceedings of the 6th annual international conference on Mobile computing and networking, 2000, pp. 243–254. [16] Y.-B. Ko, N.H. Vaidya, Geocasting in mobile ad hoc networks: locationbased multicast algorithms, in: 2nd Workshop on Mobile Computing Systems and Applications (WMCSA), 1999, pp. 101–110. [17] M. Kochhal, L. Schwiebert, S. Gupta, Role-based hierarchical self organization for wireless ad hoc sensor networks, in: Proceedings of the 2nd ACM International Conference on Wireless Sensor Networks and Applications, 2003, pp. 98–107. [18] F. Kuhn, R. Wattenhofer, A. Zollinger, Asymptotically optimal geometric mobile ad-hoc routing, in: Proceedings of the 6th International Workshop on Discrete Algorithms and Methods for Mobile Computing and Communications, 2002, pp. 24–33. [19] L. Meier, P. Blum, L. Thiele, Interval synchronization of drift-constraint clocks in ad-hoc sensor networks, in: Proceedings of the International Symposium on Mobile Ad Hoc Networking and Computing, 2004. [20] A. Michail, A. Ephremides, Energy-efficient routing for connectionoriented traffic in wireless ad-hoc networks, Mobile Networks Appl. 8 (5) (2003) 517–533. [21] M. Migliardi, M. Maheswaran, B. Maniymaran, P. Card, F. Azzedin, Mobile interfaces to computational, data, and service grid systems, SIGMOBILE Mobile Comput. Commun. Rev. 6 (4) (2002) 71–73.
V. Gupta et al. / J. Parallel Distrib. Comput. 66 (2006) 531 – 541
[22] P. Moore, A.M. Shende, Gaps in wireless adhoc lattice computers, in: Proceedings of the International Symposium on Wireless Communication Systems, September 2005. [23] T. Phan, L. Huang, C. Dulan, Challenge: integrating mobile wireless devices into the computational grid, in: Proceedings of the 8th Annual International Conference on Mobile Computing and Networking, 2002, pp. 271–278. [24] D.S. Rajan, A.M. Shende, A characterization of root lattices, Discrete Math. 161 (1996) 309–314. [25] K. Römer, Time synchronization in ad hoc networks, in: Proceedings of the 2nd ACM International Symposium on Mobile Ad hoc Networking and Computing, 2001, pp. 173–182. [26] A.M. Shende, Digital Analog Simulation of Uniform Motion in Representations of Physical N-Space by Lattice-Work MIMD Computer Architectures, Ph.D. Thesis, SUNY, Buffalo, 1991. [27] L.W. Su, S.-J. Lee, M. Gerla, Mobility prediction and routing in ad hoc wireless networks, Internat. J. Network Manage. 11 (1) (2001). [28] V.R. Syrotiuk, C.J. Colbourn, A.C.H. Ling, Topology-transparent scheduling for MANETs using orthogonal arrays, in: Proceedings of the 2003 Joint Workshop on Foundations of Mobile Computing, 2003, pp. 43–49.
541
[29] A. Wadaa, S. Olariu, L. Wilson, K. Jones, Q. Xu, On training a sensor network, in: Proceedings of the International Parallel and Distributed Processing Symposium, 2003, p. 220. [30] J. Yepez, Lattice-gas dynamics, volume I viscous fluids, Technical Report 1200, Phillips Laboratories, Environmental Research Papers, November 1995.
Vishakha Gupta obtained a B.E. (Hons.) in Computer Science from the Birla Institute of Technology & Science, Pilani, India. She is currently a graduate student in the Information Networking Institute at the Carnegie Mellon University, Pittsburgh, PA, USA. Gaurav Mathur obtained an M.Sc. (Tech.) from the Birla Institute of Technology & Science (BITS), Pilani, India. He is currently a graduate student in the Department of Computer Science at the University of Massachusetts, Amherst, MA, USA. Dr. Anil M. Shende is an Associate Professor of Computer Science at Roanoke College, Salem, VA, USA.