• Non ci sono risultati.

Agent-based model of a P2P OSN

to provide the service and each of them gives access to the whole system to a subset of the total users. On the other hand, in a P2P system, every par-ticipant is both a user and a system provider at the same time. However, purely P2P system can have issues with data availability, i.e., post from very badly connected users can be difficult to obtain. Consequently P2P system may introduce “super-nodes” with a role akin to that of a federated provider.

We developed a novel P2P micro-blogging platform that we called Blo-gracy [72]. We built BloBlo-gracy upon the Bittorrent file-sharing protocol [38], and rely on the built-in Bittorrent Distributed Hash Table (DHT) to locate information. As such, Blogracy is entirely distributed and does not require any centralized infrastructure.

However, it is possible that it suffers of the same data availability issues that some P2P systems experience. In order to understand whether Blogracy can provide a satisfactory user experience, without considering the unlikely eventuality of a large scale deployment, we resort to modeling and simulation by taking advantage of the modeling framework that we created as part of our research and that we described in Chapter 6. In Section 7.1 we describe the models and in Section 7.2 we discuss some metrics we propose to assess whether the system could be successful. In Section 7.3 the results of the simulation are presented and some conclusions are drawn.

7.1. Agent-based model of a P2P OSN 105

peers that previously downloaded them are active. The availability of popular resources is usually good, because if several users own the resource, some of them is likely to be sharing it. On the other hand, rare resources may be difficult to obtain.

In order to improve availability, several mechanisms are created to encour-age users to keep sharing the resources they obtained [203]. The most popular P2P systems, Bittorrent and eMule, have reputation-based strategies that re-ward users for letting their peers download resources that they have previously downloaded. As a consequence, users tend to cooperate and re-share [7].

If a P2P OSN is based on existing P2P systems, as is the case of Blo-gracy [72], such mechanisms are already in place. It is also reasonable to assume that users reshare recently generated resources obtained from their friends, especially considering that such behavior is necessary also to speed-up their own networking experience.

Another strategy that may improve the availability of the resources in P2P OSNs is the introduction of “supernodes” that are always active, so that these nodes can act as buffers for otherwise not very popular resources, improving the overall system performance. Considering that most resources in an OSN are text or relatively small images, the effort required for providing such su-pernodes is relatively mild. Moreover, it is possible to reward users engaging in such behavior, without externally providing the service.

Nonetheless, it is an interesting question whether P2P OSN could be suc-cessful in practice, i.e., whether the various resources that OSN users generate are actually obtainable by their friends. Therefore, we propose several models to asses the feasibility of our approach in building a P2P OSN.

In order to better understand the system behavior, we started creating a very simple model. The users of the OSN are modeled as nodes in a graph where there is a link from node x to node y if x is interested in the messages created by y. This is essentially a “follows” relation. The network is not as-sumed to vary, because we simulate only relatively brief timespan, so that the effects of the network variations are negligible.

At each step ti of the simulation:

1. Each node writes a new message with probability pw; if a node writes, it is added to the set of nodes that are active at step ti (Act ptiq).

2. Each node reads posts from its neighbors with probability pr. The read-ing nodes are also added to the list of nodes active at step ti.

3. Each active node:

a) requires the list of unread messages from each of its active neigh-bors,

b) marks which neighbors it has seen during step ti; this fact is used to retrieve only messages that have not been read yet.

Moreover, we account for a fraction r of “supernodes” that are always active. The supernodes do not necessarily create posts at each step: the writing behavior is governed by the same probability pw of every other node. We consider two strategies to attribute the supernode status: (i) according to a uniform distribution, (ii) proportionally to the node degree, that hereafter will be termed as “ran” and “pa”, respectively.

In this simple model, the only nodes that are able to provide a resource (a message) to those requesting it are the message creators. We call this model

“read-and-forget” (RAF), because we are essentially assuming that the follow-ers immediately delete the content they retrieved after reading it.

On the other hand, in a P2P system, once a peer downloads a resource, it reshares it. In our case, this would potentially make the resource available even in steps when the resource creator is not active.

In order to model this second scenario, which we call “read-and-share”

(RAS), we add to the model a fourth step:

4. Each active node

a) compiles a list of neighbors that are not active at step ti;

b) it queries its active neighbors for messages from the non active neighbors.

In this model, each node saves all the messages it received. This assump-tion is not unrealistic considering that we model only relatively brief periods