{'fraction_non_alphanumeric': 0.0300404934551276, 'fraction_numerical': 0.004896882945663434, 'mean_word_length': 4.674325407427197, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Scale-Free Opportunistic Networks: is it Possible?

The coupling of scale-free networks with mobile unstructured networks is certainly unusual. In mobile networks, connections active at a given instant are constrained by the geographical distribution of mobile nodes, and by the limited signal strength of the wireless technology employed to build the ad-hoc overlay. This is in contrast with the presence of hubs, typical of scale-free nets. However, opportunistic (mobile) networks possess the distinctive feature to be delay tolerant; mobile nodes implement a store, carry and forward strategy that permits to disseminate data based on a multi-hop route, which is built in time, when nodes encounter other ones while moving. In this paper, we consider opportunistic networks as evolving graphs where links represent contacts among nodes arising during a (non-instantaneous) time interval. We discuss a strategy to control the way nodes manage contacts and build"opportunistic overlays". Based on such an approach, interesting overlays can be obtained, shaped following given desired topologies, such as scale-free ones.


I. INTRODUCTION
Opportunistic networks are very dynamical systems, characterized by intermittent contacts among mobile nodes and frequent partitions [1], [3]. The model of interaction differs from classic communication paradigms, usually based on a prolonged end-to-end connectivity [7]. At a given instant, a complete path from a source to a destination might not exist [8]. Rather, nodes communicate as soon as they have the opportunity to do it. These occasional contacts are employed to share and disseminate information, route messages towards some destination, etc. Delay tolerance is thus a main characteristics of these networks, and in general the temporary contacts among nodes must be exploited to disseminate contents, due to the uncertainty of future communications.
An open research topic is concerned with the topology of an opportunistic network. Due to its evolving nature, several works simply define the topology of opportunistic networks as unpredictable, others approximate them as small worlds, others argue that temporal connection models are better suited than spatial mobility models [1], [3], [13]. As a matter of fact, at a given instant an opportunistic network appears as a classic mobile ad-hoc network (MANET), composed of a set of links which are constrained by the geographical location of mobile users and the limitations imposed by the signal strength of the employed wireless technology [6]. However, while MANETs consider links as connections active at a given instant, opportunistic networks have a coarse grained time model. Hence, the concept of link in an opportunistic network should reflect the fact that temporal constraints are relaxed. This suggests to model opportunistic networks as evolving graphs where links characterize the interactions of a node during a (non-instantaneous) time interval ∆. Thus, the set of links of a node at time t is not simply composed of the contacts active at the instant t, but rather, it represents the aggregate of the contacts arose during [t − ∆, t]. Then, different specific types of "link" are possible. For instance, one might consider a link between two nodes as a single contact occurred during ∆, or when a quasi-continuous communication is guaranteed between the two nodes (during ∆).
A clear consequence of such a scenario is that links among nodes would not depend only on spatial constraints, but also on the mobility of the node and on the length of ∆. In fact, certain mobile users may be more active than others; hence, while at a given instant the number of contacts of a highlymobile node may be similar to those of other nodes, during the interval ∆ such node will collect more contacts, resulting in a higher number of links.
In this scenario, it might be interesting to understand whether the network can be shaped to achieve a desired topology, based on some link management scheme, locally executed by mobile nodes. The goal is clear: knowing the network topology corresponds to identifying its statistical characteristics. Based on these properties, it is possible to define local strategies (e.g. which and how many links to maintain) to optimize the opportunistic dissemination [7].
With the aim of identifying a strategy to shape opportunistic networks based on a given desired topology, we define a method to control the number of links at nodes. In our tests we focus on a scale-free topology. The reasons for this choice are the following ones. First, it has been recognized that a scale-free network has several interesting characteristics for unstructured networks (e.g. peer-to-peer), such as low diameter and high resilience to faults. Second, this topology is quite different to that typical of a network with spatial constraints, such as a MANET; the achievement of such a desired topology entails that several other opportunities are possible.
A simulation environment was built to test the model and the local algorithm to be executed at mobile nodes. Experiments are based on real traces taken from [16], which report the typical everyday behavior of more than 20000 students of the University of Singapore, equipped with a mobile terminal. These traces represent a perfect case study for an opportunistic network. Results on these traces demonstrate that, by tuning the length of the time interval ∆, we can shape the opportunis-tic network based on some desired topology, e.g. scale-free.
The main contributions of this work are the following ones. We characterize opportunistic networks as evolving graphs where links correspond to active contacts during a time interval. We present a simple scheme to shape the network based on some desired topology. We specifically cope with scale-free topologies, but the approach can be easily generalized to other network topologies. Finally, we experiment with real datatraces, which record the typical behavior of a large number of users during their everyday life [16].
The remainder of the paper is organized as follows. Section II presents the general approach. Section III outlines the experimental scenario, while results are reported in Section IV. Finally, Section V provides some concluding remarks.

II. CHARACTERIZATION OF OPPORTUNISTIC NETWORKS
We consider an opportunistic network as an evolving graph where links among nodes correspond to the aggregate of contacts that nodes have during a given time interval ∆. Thus, at a given instant a node is in direct contact with a subset of those nodes linked to it during the ∆ time window. We then present a simple scheme that lets nodes to maintain a predefined number of neighbours. This enables to set a "desired topology". We employ this mechanism in the attempt to give to the network a scale-free desired topology.

A. Towards a Model for Opportunistic Networks
Opportunistic networks are characterized by nodes that frequently move and with intermittent contacts [8]. An opportunistic network may assume different forms and it may be employed as the underlying structure for several mobile application scenarios. Applications built on top of opportunistic networks are different to those to be executed in classic (wireless) networks. Examples may be found in literature, ranging from communication approaches based on ad-hoc networks to be deployed on rural and developing regions, tracking systems for wild animals, to those (delay tolerant) applications built over highly dynamic nets in urban areas (e.g. mobile and vehicular ad-hoc networks) [4], [8], [10], [14]. In general, no simultaneous multi-hop path can be guaranteed [4]. Communication protocols allow nodes to manage intermittent and unstable contacts, cache and relay messages as soon as there is the opportunity to do it. From an implementation point of view, there is a "bundle"-layer, in between the classic transport and the application layers, that implements such store, carry and forward strategy.
A critical point is the definition of "link" between nodes. This must certainly be based on contacts between two nodes and might depend on the type of interactions required by the applications run on top of the network itself [10]. For instance, a single contact is sufficient to exchange some content of common interest between two users, e.g. variations on lecture schedules among students, news on train/airport tables, and in general, content distribution through some mobile publishsubscribe like service. In this case, we may state that a link exists between two nodes during a time interval ∆, if a contact arises between the two nodes within that time interval.
We hence consider the network as an evolving graph whose links of a node i at time t are the aggregate of active contacts of i during the time interval [t − ∆, t] [12]. We assume that only messages received in a ∆ time window can be relayed to a neighbour though an active link. This constraint reflects the fact that there is a limit on the temporal validity of messages and also to consider the limited computational capabilities of mobile nodes which cannot hold messages forever.
The implementation of a link, as thought in this context, may be realized at the bundle and application layers, rather than as an open communication flow between two nodes (as usually thought in MANETs or P2P architectures). In practice, a link from a node i to another node j means that i stores on its memory the information related to j, such as j's id and its profile, together with the contents j is trying to disseminate, or the type of contents j is trying to retrieve (depending on the service running on top of the opportunistic network). This approach of modeling a link reflects the fact that some content disseminated from i to j may be delivered afterwards to another node k, if j has the opportunity to interact with it in a time interval ∆. Due to constraints of mobile devices, each node would maintain a limited number of nodes as neighbours, and a node might decide to replace a neighbour with another. Hence, it may happen that as the network evolves, a node i has an entry for j in its "neighbour table", while j does not have any entry for i, i.e. links are directed.

B. Shaping Opportunistic Networks
We define the desired topology of an opportunistic network by specifying the probability distribution of the degree (i.e. number of links) that a node may have. Through this choice, it is possible to give a statistical characterization of the network, which permits to automatically estimate important metrics, such as the net diameter (i.e. the max of the shortest paths among nodes in a net), the average number of neighbours at a given distance from a specific node, and so on [7].
The algorithm for the link management is very simple and it is as follows. At the beginning of its interactions, each node randomly selects a desired degree, locally computed through the degree probability distribution associated to the desired topology. Note that in order to randomly selecting a degree, the node might need an estimation of the network size. Schemes exist that do it [9], [11]. Moreover, when the network size is very large, just an approximate value is sufficient; it is required that, in case of a significant variation, nodes can detect it, and in this case they might change their desired degree. During the evolution of the network, based on the active contacts a node has, the node stores entries related to the nodes it encounters (i.e. it creates links), till reaching its desired degree.
In general, we assume that links can be established only when the number of active contacts (within a time interval ∆) surpasses a predefined threshold c min . This parameter can be tuned depending on the type of service to be executed on top of the opportunistic network. For instance, a single contact (c min = 1) may be employed for simple dissemination services where contents must be broadcast through the net. Higher values might be set for more sophisticated services, e.g. queries to be distributed that need answers. In this case, the communication would require multiple contacts.
The link holds for a limited time, and it is removed after a time ∆ of no contacts. When a novel contact arises with a non-neighbour node (say j), and if the node has already reached its desired degree, then the novel node may become a neighbour with a certain probability ω. In this case, a random entry (e.g. one among those with the lowest number of active contacts during the ∆ time window) is replaced with j.

C. A Study with Scale-free Nets
In the next section we evaluate whether an opportunistic network, modeled as described above, can assume a scale-free topology. A scale-free network possesses the distinctive feature of having nodes with a degree distribution that can be well approximated by a power law function. Hence, the majority of nodes have a relatively low number of neighbors, while a nonnegligible percentage of nodes ("hubs") exists with higher degrees [5]. The peculiarity of these networks is that they possess a very small diameter, thus allowing to propagate information in a low number of hops. They are quite robust to node faults (departures), something usual in a wireless network. On the other hand, the presence of hubs might represent a drawback in the context of opportunistic networking, since it corresponds to an unbalanced load distribution.
Coupling scale-free and (opportunistic) mobile networks is unusual, due to the issue mentioned above and to the fact that in a MANET nodes connect to those which are directly reachable through the networking technology in use. Therefore, the instantaneous topology strongly depends on the geographical distribution of the nodes. However, in this work links are considered as the aggregate of active contacts arising during a time interval ∆. Hence, the role of hubs might be played by those nodes that have in time a number of contacts higher than others. An example of a possible hub, in a real opportunistic network, might be a ticket inspector in some public transportation system (equipped with a mobile terminal), a postman, or even a dedicated totem (i.e. "information sprinkler") placed to relay contents to mobile nodes in a square or in a mall [2], [15]. The idea of having dedicated nodes in points of interest, which act as hubs able to relay contents, would solve also the issue of the unfair load at hubs.
In any case, while we evaluate whether a scale-free overlay can be built over an opportunistic network, the same machinery can be employed also for other topologies. It suffices to change the distribution to compute the desired degree.

III. EXPERIMENTAL EVALUATION
A discrete event simulator was built to mimic the algorithm executed at mobile nodes. Nodes' movements and contacts were obtained from real data traces [16]. In what follows, we describe these traces and explain the metrics of interest, together with the methodology to collect the results, which are provided in the next section.

A. Data Traces
We employed real data traces available from [16]. These are the patterns among 22341 students, inferred from their behavior during class schedules for the Spring semester of 2006 in National University of Singapore. The National University of Singapore is composed of colleges and departments. As reported in the description of the traces, all lessons were conducted on the main campus, spanning an area of 146 hectares [16]. In essence, these traces represent a wide, real scenario of typical students' everyday life. It is hence an ideal use case to test algorithms on urban opportunistic networks.
User contacts were traced in time intervals. For instance, students meeting during a lecture where considered to be in contact during a single time interval, regardless of its duration (which is abundantly longer than time usually needed to exchange information between two mobile nodes). Hence, the time interval ∆ exploited to manage links in the network is expressed as a multiple of these intervals.

B. Metrics and Methodology
The desired topology was generated through a probability distribution for nodes' desired degree d, following a power law function ∼ d λ , with λ ∈ [−3, −2]. We considered a minimum and a maximum value of the desired degrees that a node might want to have, d min , d max , respectively. We varied these parameters. Figure 1 shows an example of the distribution of the desired degree of network nodes, generated during our tests. The log-log chart shows a linear curve, hence confirming that such distribution follows a power law distribution.
During our tests we varied the time interval size ∆. We varied also the minimum number of active contacts c min required so that to two nodes may become neighbours, and the value of ω that controls the probability that a node replaces a link with another, once its degree is equal to its desired degree.

IV. RESULTS
For the sake of conciseness, we present only results related to a setting with λ = −2. {100, 300, 500, 1000}. Similar outcomes were obtained for other values of these parameters (not shown in this paper). It goes without saying that, depending on the service to be executed on top of the opportunistic network, and most of all, on the contents to be disseminated, a degree value such as that of d max ∼ 1000 might be too high for a mobile node. Other scenarios are probably more realistic. It is however worth mentioning that: i) the number of such hubs would be very low and in certain application scenarios such a role might be played by those "information sprinklers"; ii) this setting is a test to see whether such a threshold might be reached using a real trace such as that employed in these tests. Figure 2 reports the results when d min = 5, d max = 100, varying the duration of ∆, (i.e. ∆ = 1, 5 trace intervals). Each chart refers to a particular value of ∆, and reports the distribution of nodes' degree obtained when the proposed algorithm is executed. The probability that a node has a certain degree is reported in a log-log scale. In this case, a linear trend may be appreciated, meaning that the distribution follows a power law function. This confirms that the approach is able to configure the topology as a scale-free. Moreover, an higher ∆ (rightmost chart) guarantees a higher probability that nodes reach their desired degree. Only some few non-zero probabilities are obtained for some degree values lower than d min . This means that there are certain nodes that have a few number of contacts with other nodes, whatever the duration of ∆. A similar result is reported in Figure 3, where d min = 10 and ∆ = 1, 10 trace intervals. Figure 4 reports the degree probability obtained when ∆ = 5 trace intervals, d min = 5, while varying d max .
Again, it is confirmed that a scale free topology inside an opportunistic network is obtained in all cases, since there is a linear distribution of degree probabilities (in log-log scale). When d max = 1000, the probability that a node has a high degree is very low. This is however due to the fact that only few nodes might have the opportunity to meet a number of ∼ 1000 nodes during a ∆ time window. Moreover, such values are inappropriate as number of links a mobile node might have in a real opportunistic network; such simulation setting serves only to demonstrate that the framework scales up to those numbers. The reader may also notice the presence of non-zero degree probabilities lower than d min , which remain, despite the settings of the algorithm executed (i.e. value of ∆). The presence of these values comes from the fact that the data traces exploited to do the simulations were the same in all the considered scenarios.

V. CONCLUSIONS
In this work we have presented a discussion on how opportunistic networks might be modeled. Due to the evolving nature of the network and its delay tolerance, links among nodes should not be considered as contacts which are active simultaneously. Rather, the aggregate of contacts arising during a time interval should be preferred. To create a link, the duration of the contact might be sufficient for a data exchange. Such amount of time might depend on the application to be run on top of the network. In particular, a link in the evolving graph represents the fact that a node maintains on its "neighbour table" some application-related contents on the behalf of its neighbour, so that such contents can be relayed as soon as there is the opportunity to do it. We have presented a simple algorithm that allows each node to set and manage its own degree, in order to shape the net based on a desired topology. This influences the way contents can be disseminated through the network. The scheme has been employed on real data traces, and outcomes confirm that a desired topology (in this case a scale-free) can be obtained.
To the best of our knowledge, this is the first attempt to model opportunistic networks taking into consideration contacts active in a given time interval, instead of instantaneous contacts. In future works, the scheme will be employed on other data traces and with different desired topologies.