“Multiagent Systems for Resource Allocation in Peer-to-Peer Systems” 1
Sergio Camorlinga 1, Ken Barker 1 and 2, John Anderson1 Department of Computer Science, Univ. of Manitoba, Winnipeg, MB, R3T 2N2 Canada {scamorli, andersj}@cs.umanitoba.ca 2 Department of Computer Science, Univ. of Calgary, Calgary, AB, T2N 1N4, Canada {
[email protected]}
Abstract This paper introduces Multiagent Systems (MAS) storage resource allocation algorithms and methods on a Peer-to-Peer (P2P) system of computer storage resources. MAS Complex Adaptive Systems (CAS) based on squirrels behaviors are proposed and evaluated to produce emergent global behaviors that can solve the storage resource allocation problem in a distributed system of peers. Experimental results support the initial hypothesis that hoarding mechanisms found on squirrels behaviors efficiently allocate resources in distributed systems. 1. Introduction A P2P system is characterized as a distributed system where the entities at the network end are called peers, and a peer can share and exchange resources with other peers. Recent 2nd generation P2P look-up systems (e.g. Chord, Tapestry) have primarily focused on the use of a hash function to produce a key that will uniquely and globally identify a file within a system. Each peer in the P2P system is responsible for a range of the hash function’s keys; consequently this peer is responsible for allocating storage resources to keep the file, whose hash function value maps to the keys managed by the peer. This approach assigns storage across the P2P system and assumes an even allocation of keys by the hash function between the peers. This assumption introduces drawbacks in terms of resource allocation (latency, hot spots), inefficient use of peer capabilities, and loss of spatial locality and application dependencies. These drawbacks limit the efficiency of P2P computing model on Distributed File System (DFS) environments because the storage resource allocation is not balanced. Multiagent Systems (MAS) provide an interesting model of computing formed by a community of entities, independent of each other, working with no specific leadership, but with a global purpose that translates into corporate result(s). This brings a change in the way we see things, domain community goals are not results of special individuals but the comprehensive, emerging global results of the sum of each individual’s actions working almost independently. Due to the MAS computing model’s similarity to the P2P computing model in terms of common use of a distributed environment, MAS could be applied to a P2P DFS computing environment thereby providing more efficient use and allocation of storage resources to overcome some of the existing limitations of 2nd generation P2P systems. This research develops MAS algorithms and methods for a community of peers working independently to provide resource allocation, with an emphasis on storage resources. We begin with a community of independent peers that are initially interested in storing their own data, but consequently the community as a whole will balance storage allocation globally thereby making better use of resources in the P2P environment. 2. Related Work Researchers have previously used natural and economic models to design MAS algorithms to solve different kinds of resource allocation or optimization problems. A common natural
model used is that of ant behaviours [1,2]. Although each ant undertakes very simple activities, the global outcome of the collective accomplishes goals that are very difficult without the ants behaving as a team. Ant behaviors are an example of what is known as Complex Adaptive Systems (CAS) [3]. These systems have a large number of members with simple functions and limited communication among them. They exploit their synergy to solve complex problems and accomplish global behaviors. The swarm intelligence [4] that emerges from the global behaviors of simple members boasts autonomy and self-sufficiency, which allows them to adapt quickly to changing environmental conditions. Several insect and other animal societies have been studied [5] where emergent team or group behaviors exist. The interesting aspect of CAS is that they present team or group models that solve complex distributed problems, which would be difficult to solve using deterministic, centralized or distributed techniques. The CAS approach has been applied successfully to different problem domains. For example, Bonabeau et al. [4] describes how ant behaviors solve the classical traveling salesman problem effectively though not necessarily optimally. This highlights an important aspect about the paradigm: CAS does not guarantee the best possible outcome because of the randomness and unpredictable emergent behaviour. Clearly, this means that it is not suitable for all problem domains, but its strength lies in its ability to produce “acceptable” (though possibly sub optimal) solutions that are acceptable under certain circumstances (e.g. bounds on time and other resources). P2P distributed computing based on mobile agents is an area of active research, they use agents to design and implement different P2P services and functions that are distributed across the P2P environment. The Anthill project [3,6,7] applied the CAS framework to design, implement, and evaluate P2P applications. Anthill’s metaphor of ants foraging is applied to CPU load balancing [7]. Our research work uses the CAS framework to develop MAS algorithms for storage resource allocation on a P2P DFS. Contrary to previous work (e.g. Anthill-Messor project) ours uses a squirrels’ hoarding behaviors as a CAS metaphor. This hoarding approach reflects a better way to allocate resources than existing foraging approaches because it is a more natural reflection of this activity. Furthermore, we also provide a flexible architecture that is applicable to other resource allocation problems [8]. 3. Background Many ecological and environmental protection groups have studied the hundreds of squirrel species found worldwide [9,10]. Squirrels eat various nuts, acorns, and other small foodstuffs1 by caching acorns in small hoards over a large geographic area. When food becomes scarce they return to the caches. Their failure to recover a great percentage of the horded acorns facilitates the growth of new trees. Squirrels, in conjunction with Jays [9], are responsible for the vast oak extensions through North America after the glacial age 10,000 years ago. From a computational perspective, squirrels are allocating resources (land space) to storage demands (acorns) in such a way that resources are balanced. The global or corporate consequence emergent from the behaviour of these individuals is a populated forest of oak trees across a wide geographic area. The most interesting squirrel behaviour is hoarding, rather than foraging, as hoarding leads to a global outcome of which the individual squirrels cannot possibly be aware. We are 1
In this paper, we speak of these foodstuffs collectively using the exemplar “acorns” as we are interested in the consequence of the hording activities.
interested in the way squirrels spread out acorns, nuts and other small food pieces in an area to obtain a resource allocation balance. We are exploring how to exploit these techniques to design and implement a MAS storage resource allocation suitable for a P2P DFS. The squirrel hoarding behaviors can be summarized as: • Random gathering and burying of small acorn amounts in an area geographically close to its nest, • Investigation of various random locations (“sniffing” several places) before deciding where to put the acorn, • Possibly deciding not to hoard its food if there are other squirrels around, and • Possibly working in small teams with others with whom they are familiar, while avoiding places inhabited by unknown squirrels. Our basic hypothesis is that MAS algorithms based on squirrel behaviors as a CAS metaphor provide well-balanced resource allocation across a distributed system of resource providers. A P2P DFS storage resource allocation is the problem domain that substantiates the hypothesis. 4. Squirrel MAS Environment The Squirrel MAS system consists of a P2P environment of locations. Each location has one or more caches where squirrels hoard acorns. Squirrels live in these locations in small groups. When they have acorns, they go through the locations, “sniffing” to find a cache suitable for the acorn following one of the behaviors described in Section 3. Figure 1 illustrates such an environment.
Figure 1: Squirrel MAS Environment
Each location (peer) has different capabilities such as the number of caches and acorns to hoard in the system. If there are no more acorns to store in a location, the squirrels living there sleep until there are more to hoard. We assume that each cache stores the same amount of acorns and each location may have different storage capabilities, because each has a different number of caches. Each location requests a different amount of storage resources because they have different number of acorns to allocate. In other words, each location is a producer and consumer of storage resources. Translating the squirrel system architecture into a P2P DFS, each location becomes a peer within the P2P environment. Each acorn is a data block or file chunk that must be stored within the DFS. Each cache is a group of data blocks or chunks available that can be allocated. The goal is efficient allocation of storage resources by balancing resource allocation. For the purpose of
this research we claim that the allocation algorithm that evenly distributes the resources over the DFS is better than one that does not. Clearly, other metrics must be considered but we leave this discussion in the realm of future research. If we let x be the number of acorns allocated in a location’s cache, the variance of x will indicate how well the system is allocating acorns among location caches. That is, if deviation2 approaches cero, then we have a better storage resource allocation because each site has a more equal assignment of acorns allocated per cache. Thus, we can have locations with different numbers of caches provided a cache is the common unit of storage resource. Further, if we balance caches, then a well-balanced system is achieved across locations according to their capabilities (for example, processor capabilities can be considered in the metrics).
5. Squirrel MAS Algorithms This section briefly overviews the three algorithms that implement squirrel behaviors described above and implemented in this research. For a complete description and formal definition see [8]. Burying Algorithm (Beh 1) The algorithm has the squirrel gathers acorns from its home location and randomly searches for another location (that could be its own) to cache the acorn. If the selected location is full (i.e. no more space in any of the selected location’s caches), then the squirrel will pause and then jump to another location to test for available space. This cycle repeats until a suitable place is found or die looking for one. It dies to avoid living forever when there are no more resources available but there are still acorns to allocate. Sniffing and Burying Algorithm (Beh 2 with ‘x’ sniffing steps) This algorithm is similar to burying algorithm in that the squirrel will gather acorns from its home location and randomly look for another location (that could be its own) to cache the acorn. However, the squirrel will sniff several locations before deciding where to place the acorn. The selected location will be the best option for the squirrel based on a specific (set of) metrics. If all sniffed locations are full, then the squirrel pauses and jumps to another location. This cycle repeats until a suitable cache is found or the squirrel dies. Sniffing and Burying with No Strangers Algorithm (Beh 3 with ‘x’ sniffing steps) This algorithm is similar to the previous one in that the squirrel will gather acorns from its home location and randomly investigate several locations to find one (that could be its own) to cache the acorn. However, the squirrel will sniff only locations not being visited by other squirrels to determine the best location to place the acorns. Thus, the selected location is the best available that has not been visited by a stranger. If all sniffed locations are full or visited by strangers, then the squirrel will pause and move to another location. This cycle repeats until a suitable location is found or the squirrel dies. 6. Squirrel MAS Experiments and Results A software simulator is developed using Java under Linux. We have undertaken several sets of experiments to analyze the effectiveness of various squirrel behaviors on the storage resource allocation of a P2P DFS. The simulator implements the squirrel MAS class 2
Deviation is square root of variance
architecture defined formally in [8]. This paper shows some representative results; see [8] for more results. The resource allocation balance and converging time with different resource demands in the squirrels MAS behaviors was the main focus of the experiments. The resource allocation balance will be obtained by calculating the deviation of acorns allocated across the set of location’ caches available in the distributed system. The less deviation, the better resource allocation balance obtained. The number of steps the squirrels take to allocate the acorns required to be stored will obtain the converging time. The fewer steps taken, the faster the whole system is at obtaining the storage balance allocation. In figure results shown below “% acorns / total cache capacity” is the percentage of resources to be allocated in relation to the total capacity of all locations’ caches for the different algorithm implementations.
Figure 2: Resource Allocation and Steps to Converge with 25600 peers and 8 Squirrels/Peer.
Figures 2 show representative experimental results that are maintained across different P2P systems ranging from few peers (10-50) up to several thousand peers (25600) with 1 to 32 squirrels per peer. We observe that team size improves resource allocation balance up to a point where the gains are marginal and consequently bring less resource allocation improvement. This seems to occur experimentally at 4-8 squirrels/peer, suggesting that larger teams (> 8 squirrels/peer) do not improve much the resource allocation balance obtained. These results are maintained across all experiments carried on from 10 to 25600 peers with one cache per peer and 20 acorns per cache capacity. The results reliability also suggests that squirrel CAS based algorithms scale to larger P2P systems (> 25600 peers), presenting similar results as those obtained here.
Figure 3: Resource Allocation with Demand on 10% and with Variable Number of Caches/Peer
Figure 3 results show the impact of changing the percentage of demand sources on the P2P system. A demand on ‘x’ percentage means that ‘x’ percentage of peers, from the total number of peers within the P2P system; generate all requests (demands) for storage. For example in Figure 3 a demand on 10%, means that 10% of 3200 peers (320 peers) are
requesting the different ratios of storage demands indicated in the graph x-axis. The experiment validates the reliability and scalability of the squirrel CAS based algorithms across different demand percentage values. These values are ranged from 50% to 1%. Results indicates that beh 2 - x (Sniffing and Burying Algorithm) maintains a good resource allocation balance of less than 1 of deviation across different demand percentages. Figure 3 also shows the beh 2 algorithms with 3 sniffing steps deviation results when the number of caches per peer changes in a range from 1 to 16. 7. Conclusion We base our work on a new CAS metaphor, that of squirrels rather than the previously reported ant metaphor so it produces a truly novel result. Experimental results obtained corroborate our hypothesis that a well balanced storage resource allocation in a DFS across a P2P environment with different demand proportions among the peers can be achieved with a reduction in the number of steps required to converge as the number of agents available increases. Sniffing and Burying with Several Sniffing Steps algorithm deviation results less than 1 are obtained in a wide variety of P2P configurations ranging from few peers to several thousands. This is important because resource allocation balance is maintained even with unbalance resource demands in a reasonable number of steps. Even though distributed resource allocation occurs in multiple different domains (e.g. communications, manufacturing, job scheduling, computer resources) ideas and results presented in this paper are equally applicable. This is because the principles existing in the distributed allocation of resources, whatever they are, are in essence quite similar. CAS has proven to be a valuable model to be blended together with P2P computing model to produce interesting MAS algorithms. These MAS algorithms can then be leveraged for its use on distributed system applications (e.g. grid systems, distributed load balancing, etc). References [1] Bonabeau E, Dorigo M et al “Inspiration for Optimization from Social Insect Behaviour”, Nature 406, Macmillan Publishers Ltd, 2000 [2] Ward M, “There’s an Ant in my Phone”, New Scientist, 1998. Available at www.newscientist.com/hottopics/ai/antinmyphone.jsp [3] Montresor A, Meling H et al. “Toward Self-Organizing, Self-Repairing and Resilient Large-Scale Distributed Systems”, U of Bologna, Italy, TR UBLCS-2002-10, Sept 2002 [4] Bonabeau E and Theraulaz G. “Swarm Smarts”, Scientific American, March 2000 [5] Anderson C, Franks N. “Teams in Animal Societies”, Behavioral Ecology, Volume 12 No. 5, September 2000 [6] Montresor A, “Anthill: A Framework for the Design and Analysis of Peer-To-Peer Systems”, 4th Euro Seminar on Advances in Distributed Systems, Bertinoro, Italy, May 2001 [7] Montresor A, Meling H et al, “Messor: Load-Balancing through a Swarm of Autonomous Agents”, Proceedings 1st International Workshop on Agents and P2P Computing, Bologna, Italy, July 2002 [8] Camorlinga S, Barker K, “Multiagent Systems Storage Resource Allocation in a Peer-toPeer Distributed File System”, U of Manitoba TR 03/01, U of Calgary TR 2003-716-19, Jan 28th 2003. See document at http://pharos.cpsc.ucalgary.ca/ [9] Shulman A, Nelson E. “Foraging Behavior of Squirrels as a Function of Season Progression From Early Fall Towards Winter”, U of the South Ecology, see documents at http://www.sewanee.edu/biology/journal/ [10] Skwurls Squirrels Resources, see documents and links at http://skwurls.com