Third International Conference on Semantics, Knowledge and Grid
File Sharing Service over a Generic P2P Simulator M.V. Belmonte E.T.S.I. Informática Univ. de Málaga Málaga (SPAIN)
[email protected]
M. Díaz E.T.S.I. Informática Univ. de Málaga Málaga (SPAIN)
[email protected]
J.L. Pérez-de-la-Cruz E.T.S.I. Informática Univ. de Málaga Málaga (SPAIN)
[email protected]
Abstract
the model allow to define new P2P services, how these services are used by the peers and how they are implemented in the underlying software platform. The description of the service implementation can be made at different abstraction levels, allowing an incremental specification of the service and peer behaviors. In order to show how this approach fit into the design of new protocols and services, we provide an example where we analyze a new coalition based file sharing service [2]. This approach proposes a coalition formation algorithm as incentive mechanism for the file sharing service. We are interested in analyzing the service performance and the impact of the user behavior on this kind of service. The paper is structured as follows: in section two the simulation model will be introduced. In section three we will explain in depth the proposed file sharing service, in section four we present the current simulation tool. The last section will outline the conclusions and future work.
This work describes a generic peer to peer (P2P) simulator for service oriented networks. The tool has been designed to test different algorithms, the version presented here includes the implementation of a collaborative file sharing service, designed to simulate different user behaviours with the goal of analyzing the impact of malicious users on this kind of service. The file sharing service proposal includes a coalition formation algorithm and a reputation mechanism to ensure service equity, based on game theory.
1. Introduction Testing the performance of a system prior to its deployment is a common element in software applications development. However, due to the decentralized nature of the P2P systems and the fast growth of their networks, testing the performance of new algorithms or protocols simply deploying them on an existing P2P network may be prohibitively expensive or it may simply not be practical. For these reasons it is necessary to use simulators that allow the algorithms and protocols to be evaluated in a controlled environment. In general, researchers have tended to focus on designing special purpose P2P simulators, most of which do not allow users to determine the initial topology of the overlay network. In addition, they are limited in relation to the level of detail and the scalability of the supported protocols. For these reasons recent research has been directed to the development of generic P2P simulators that solve the problems of scalability, usage and the level of detail of the actual ones [1]. Our proposal is based on a service and grouporiented point of view of p2p networks. In this sense,
0-7695-3007-9/07 $25.00 © 2007 IEEE DOI 10.1109/SKG.2007.73
A. Reyna E.T.S.I. Informática Univ. de Málaga Málaga (SPAIN)
[email protected]
2. Simulation Model and Architecture We consider the P2P simulation network simply as a collection of peers that can send and receive messages and which are able to both publish and subscribe to services, thus we are simulating service oriented P2P networks. The basic structure that constitutes the network is the group. A group is a set of peers that can collaborate by using services and sharing resources. The peer that creates the group will become the group manager and by definition the entity in charge of managing the group services. However, the role of group manager is dynamic and can be assumed by other peers in the group during the group lifecycle. When a peer offers a service it needs to publish it to its group. This means that it has to inform the peer group manager about the service it offers in order to make it potentially
370
Authorized licensed use limited to: CINVESTAV IPN. Downloaded on February 13, 2009 at 15:13 from IEEE Xplore. Restrictions apply.
available to interested peers. Services are offered at the group level. To subscribe a service, peers must be joined to the group (figure 1).
simulator is designed to simulate group formation and services, as stated previously. Additionally notice that the management service is fixed for all simulations.
Figure 1. Simulation model: the peer pe can not run any service, because it is not a member of the group. The peer pb is working as the group manager, and the services offered by the group are the services offered by the peers belonging to the group.
Figure 2. Simulator Architecture
Peers are capable of sending, receiving and processing messages, running one or more services and also joining or leaving a group. They use an event list sorted by the arrival time to process messages or events within a cycle. A peer is basically defined by its bandwidth limits, its event list, the groups it belongs to, and the services it provides. Additionally, the peer behavior plays an important role in our model; we distinguish different behaviors for different services. Services provide functionality to our simulation. From our point of view each service is defined as a state machine, and it will process its own kind of messages. In order to manage the group and the services offered in it (peer connections and disconnections, message membership management,…), a management service is needed. In addition, the file sharing service has also been developed. These concepts of services and groups are familiar to well known frameworks for P2P such as JXTA [3]. Also service oriented architecture proposals for p2p networks can be found, for instance [4]. Additionally and in order to design a generic simulation tool, we also abstract the underlying middleware that peers use to communicate. This abstraction is achieved by using a Middleware Simulation abstract class that implements the service abstract model. The level of detail in the implementation of the middleware will depend on the aspects of the protocols that we want to analyze. This class is also used to model timing aspects related to messages, such as the time it takes for a message to arrive, depending on the protocol being simulated and the network topology. The current version has the basic implementation of the middleware simulation and the topology, but this design enables users to simulate more complex situations in future versions or even to test further middleware proposals. Figure 2 shows the architecture of the simulator. Dotted lines mark the generic components while solid lines are used for the fixed simulator components. Note that the
3. File Sharing Service As stated, our objective is to be able to study the impact of the user behavior on File Sharing Services and empirically prove that the algorithm proposed in [2] effectively alleviates the damaging effects of freeriding. Free-riding, peers that consume more resources that they contribute, has been widely studied and the solution to alleviate its harmful effects is to provide incentives and encourage cooperative behavior between the peers [5]. Our proposal uses the improvement of the quality of service as an incentive. This way the more reputation a peer earns the better the quality of service it will obtain. In the following subsections, we describe the proposed file sharing service. A coalition formation based incentive mechanism is proposed for the file sharing.
3.1. File Sharing Service Architecture In figure 3 we show the instantiation for the files sharing service of the generic components of the simulation model above shown. The proposed file sharing service can simultaneously run three different kinds of processes which can be viewed as sub-services: download, upload and leader processes. This means that a peer can concurrently download multiples files, upload to different coalitions and be the leader of more than one coalition. Upon receiving a message, the service determines the right instance of the right kind of service to which the message belongs. This service proposal also needs three additional components: the Authority, the data model and the coalition formation algorithm (is described in the next section). A peer in the simulation must play a special role, that of the Authority, to guarantee the trust of the reputation mechanism, as information on the reputation has to be
371
Authorized licensed use limited to: CINVESTAV IPN. Downloaded on February 13, 2009 at 15:13 from IEEE Xplore. Restrictions apply.
centralized. The data model represents the files that will be shared in the simulation.
download a file. pa forms a coalition with pl, pm, and ph to upload that file. Next, we describe the meaning of each of the states of figure 4: 1. pb connects to the network, joins the group and subscribes to the file sharing service. 2. pb sends a download_request_leader message to the Authority with the information of the file or file part to be downloaded, and the downloading bandwidth, bi-out, that it can use. This can also be performed using middleware discovery functions. 3. The Authority responds to the request sending information about a peer that shares the file that pb requested, for instance pa. 4. pb sends the download_request to pa. 5. pa starts the coalition formation, sending a candidates_request message to the Authority. 6. Authority answers pa with all peers sharing the file. 7. pa sends offers to each candidate with the information about the download (pl, pm and ph). 8. Each candidate responds to the offer indicating the upload bandwidth, bi-in, that it is able to offer to form the coalition, S. 9. pa performs the coalition formation and bandwidth (task) allocation algorithm. Depending on the bandwidth offered by the candidates and the task to perform (bytes to be transferred), different algorithms can be used in order to select the coalition members and to assign tasks to each candidate [2]. After bandwidth allocation, the file size is split among the addition of the uploading bandwidths of the coalition members S, and pa sends set_task messages to each participant with the block or task ti to transfer. 10. Participants will start to execute their task. 11. Every certain period of time pb sends acknowledgement information to pa. 12. When pa receives the acknowledgement information, it will first check if the download has been completed, in that case we go to step 13; otherwise it will run the coalition checking algorithm. If the difference between the bytes sent and the ones which should have been sent exceeds a predefined threshold, the coalition will be recalculated. In this way, the bandwidth allocation algorithm may adapt to the dynamic joining and leaving of peers and to possible network congestion, avoiding resource wastage. 13. pa runs the payment division algorithm. 14. pa sends the payments, xi to the Authority, and the Authority updates the Ir values.
Figure 3. File Sharing Service Architecture
Finally, and in order to supply the modelling of each user, the different kinds of behaviours in this service and the number of users that will follow each one of them, must be specified. A realistic simulation should include a number of users whose behaviour is harmful (free-rider), another group of users which always takes the best action in terms of the system performance (collaborative), and a third group of users that adapt to the evolution of the peer welfare (adaptive).
3.2. A Coalition Formation based Incentive Mechanism The proposed coalition formation based incentive mechanism presents a formal approach based on game theory. The central idea of the algorithm is based on sharing the task of downloading a file among the participants forming a coalition, providing a better quality of service to the peers participating in the coalitions. In order to do so, we define an internal reputation value, Iri, for every peer pi. This value reflects the peer's overall contribution to the system (i.e. how much work it has carried out for the other peers in the system). The value of Iri will be calculated as a heuristic function of its utility, xi (profit that the members of a coalition S can reach acting together). The payoff division is the process of dividing the utility or benefits of a coalition among its members. In our payoff division scheme, the utility of each agent, xi, will be given by the marginal profit according to the resource supplied by the agent. So, the value of Iri, which is based on a function of xi, will be reduced when pi acts as a downloading peer and does not contribute with its resources to other coalitions, and incremented when it provides files to the other peers, acting as an uploading peer. In addition, our proposal computes a fair payoff division in the sense of the core, (game theory provides this concept to guarantee the stability of coalitions. In [6] a formal and more detailed explanation can be found). With the goal of briefly introducing the proposed coalition formation algorithm, a state diagram process is shown in figure 4. In this scenario pb requests pa to
372
Authorized licensed use limited to: CINVESTAV IPN. Downloaded on February 13, 2009 at 15:13 from IEEE Xplore. Restrictions apply.
Figure 5. Simulator Interface
5. Conclusions and Future Works
Figure 4. State diagram
In this paper we have described the design and implementation of a generic p2p simulator which easily enables the analysis of different protocols. It is based on a service and group-oriented point of view of p2p networks. We have also provided an example where we have analyzed a new coalition based file sharing service. This proposes a coalition formation algorithm, based on game theory, as incentive mechanism for the file sharing service. A preliminary version of the simulator has been developed, although some aspects are currently being improved, such as a more detailed modeling of the user behavior. Our final goal is to study different patterns of behavior among peers in file sharing systems, and the impact of the coalition formation on the free-rider peers.
4. Simulation Tool The tool has been developed using Microsoft .NET framework 2.0. In the simulation tool interaction between the peers is performed through messages, more specifically through the simulation of message exchange between the peers. The simulation works in cycles. In every cycle, messages and events that occur within it are processed. If new messages are generated during the cycle they will be processed, in the case where they are within the time range, until there are no messages or events left to process. To simulate the time elapsed between when the message is sent, and its arrival we use the topology of the network and a middleware simulation. To achieve a real simulation, the bandwidth variations have also been simulated. The Box Muller Gaussian function has been used to simulate the effect of traffic or noise on the communication channel. In relation to the initialization, the files and the network information are loaded from a database and can be changed and saved for further execution. The initialization process also includes the configuration of the user behaviour for each network peer depending on the percentages established. In addition, the random events for node failure simulation are generated and multiple file copies are distributed among the peers in the network. In the simulator interface (figure 5) two panels are clearly separated. On the left side, a .net property grid control enables the configuration parameters to be set up easily, including the possibility of exploring the network peers, the files of the data model to be simulated and the percentage of users of each behavior. On the right side a tab control enables users to explore the progress of the simulation.
6. References [1] Schlosser, M. T., Condie, T. E., & Kamvar, S. D. “Simulating a File-Sharing P2P Network”. In Proceedings of the First Workshop on Semantics in P2P and Grid Computing, 2002 [2] Belmonte, M.V., Conejo R., Díaz, M. and Pérez-de-laCruz, J.L. “Coalition Formation in P2P File Sharing Systems”. LNAI 4177, CAEPIA-05, 2005, pp. 153-162. [3] JXTA. http://www.jxta.org [4] Gerke, J., Stiller, B. “A Service-Oriented Peer-to-Peer Middleware”. Journal of Pervasive and Mobile Computing, 4-1, 2005, pp. 449-469 [5] Ma, R., Lee, S., Liu, J., Yau, D. “Incentive and Service Differentiation in P2P Networks: A Game Theoretic Approach”. IEEE/ACM Transactions on Networking, 14-5, 2006, pp. 978-991 [6] Belmonte, M.V., Conejo, R., Perez-de-la-Cruz, J.L., Triguero, F. “Coalitions among Intelligent Agents: A Tractable Case”. Computational Intelligence. An International Journal, 22-1, 2006, pp. 52-68.
373
Authorized licensed use limited to: CINVESTAV IPN. Downloaded on February 13, 2009 at 15:13 from IEEE Xplore. Restrictions apply.