A multilayer social overlay for new generation DOSNs

Online Social Networking platforms (OSNs) have become part of the real life of people. This is the natural outcome of many centuries of "social media" development answering the deep-rooted need for communication among humans. Existing social media platforms give users the impression that they are in full control of their data. However, it is actually those companies providing those services that have sole authority over a person's information. The need of trusted environment and the privacy issues in OSNs have seen the rise of Decentralized Online Social Networks. However, all of these platforms are far from being useful in real life. Indeed, they fail to address the complexity of social structures, in which we change our roles fluently from one to another leading to different roles in several independent and interconnected contexts. The envision of a Next Generation Internet focused on people is the main topic of the new generation of Decentralized Online Social Networks, which takes into account the main characteristics of the previous generations. In this paper, we present a new idea to model a multilayer P2P Social Overlay which takes into account different actors and relationships to be included in smart environments. Moreover, it is organized in layers, where one layer represents a specific social context of the peer it models. We present a formal definition of the Heterogeneous Ego Network and we show how it works in a general scenario.


INTRODUCTION
In recent years we witnessed a significant evolution of the Internet thanks to the diffusion of mobile and IoT devices. An important and innovative step is the recently announced Next Generation Internet (NGI) initiative 1 , launched by the European commission during fall 2016, with the aim to rethink Internet as an interoperable platform ecosystem. Around the NGI, new paradigms have born, like the one of Internet of People (IoP) [7], an Internet data and knowledge management paradigm model which embeds the human behaviour in its algorithms. IoP have three leading principles: adopt a user centric approach, consider personal devices, and employ human behaviour models. In detail, users are put at the center and the service is built around them according to their needs, contrary to a traditional service centered approach. The paradigm considers that personal devices of users will become alter-egos of the respective owners over Internet, requiring them to take decisions according to the owners' preferences and needs. Finally, the paradigm foresees that human behaviour models will be incorporated into devices. This will help devices to make their choices so that decisions taken will match decision taken by human users.
Online Social Networks (OSNs) will be one of the focal points of this initiative as many aspects are encompassed within it.
An OSN is defined in [2] as an online platform that provides services for a user to build a public profile and to explicitly declare the connection between his/her profile and those of the other users. The currently popular OSNs are implemented using a centralized architecture, which means they are based on centralized servers storing all the information of the users. This centralized structure has several drawbacks including scalability, dependence on a provider, and privacy [9]. In particular, in recent years, the rise and quick development of social networks has led to two important phenomena: the user privacy disclosure and the rapid spread of information.
These problems have moved researchers to investigate alternative OSN architecture solutions with respect to the centralized one [15,20]. A Decentralized Online Social Network (DOSN) [9] is an Online Social Network implemented on a distributed information management platform, such as a network of trusted servers, P2P systems or an opportunistic network. During the last years, DOSNs have been argument of several works and projects from both academic researchers and open source communities. Even if the decentralization provides several advantages, decentralizing the existing functionalities of Online Social Networks requires finding ways for distributing storage of data, privacy preservation, defining an overlay topology and a protocol enabling searching and addressing, robustness against churn, etc., as explained in [14].
The purpose of this paper is to present the design of a new P2P Social Overlay, named Heterogeneous Social Graph, where social relationships of users are modeled by a Contextual Ego Network in which the daily life of a user is expressed by a set of contextual layers. This structure represents the main principal structure of a new generation of DOSNs, which fits the NGI initiative of putting the users at the center and building the service around them. Indeed our P2P Social overlay model the daily life of a user and the several social contexts in which a user lives everyday by taking into account the smart environment. The Contextual Ego Network is a stack of ego networks, represented by a pillar multi-network concept, where each ego network models a specific context of the user. Our Social Overlay is modeled by considering the IoP-like approach and apply the three defining NGI principles in many of its aspects.
The rest of the paper is organised as follows: Section 2 contains the state of the art. In Section 3 we present a general overview of HELIOS 2 , the new DOSN platform in which our social overlay structure is included. Section 4 contains a description of the multilayer social overlay we use to represent the social relationships, and the architecture structure of the service, with particular focus on how the model is handled. We put, in Section 5, a possible scenario where the HELIOS platform can be used, and we describe how the Contextual Ego Network is able to manage the real-life contexts of an ego. Finally, Section 6 concludes the paper drawing conclusions and pointing out future works, which are mainly focused on the implementation of the structure.

STATE OF THE ART
In this Section we provide an overview of the current generation of Decentralized Social Networks, by describing the state of art of DOSNs, and the technology of Mobile and opportunistic social networks (MOSNs). Moreover, we provide an overview of the current approaches of Blockchain-based Online Social Networks (BOSNs).

DOSNs
The main difference among the current DOSNs proposals concern the technologies and techniques used to store data. A possible classification taking into account this difference has been proposed in [14]. One of the first decentralized solution which have today more than 600,000 users is Diaspora 3 . Mastodon 4 is the current most used DOSNs. In [8], Safebook is proposed. Safebook proposes a three tiers architecture for DOSNs with the main focus on privacy, integrity and availability. Each user in SafeBook has a set of logical concentric structure called Matryoshka. Matryoshkas are concentric rings of nodes built around each peer which provide a trusted data storage and communication obfuscation through indirection. PeerSon [3,4] is a two-tier architecture in which one tier is implemented by a DHT and it serves as a look-up service. The second tier consists of peers and contains the user data, such as user profiles. Cachet [22] is an architecture that provides security and privacy by guaranteeing confidentiality, the integrity and the availability of the user content.
DiDuSoNet [13] is a two-tier system, where the lower level is implemented by Pastry [24] and it is used for the bootstrapping phase, for the look-up service, for searching other users, and to retrieve the replica nodes list. The upper level is implemented by a Dunbar-based Social Overlay. In the Social Overlay, nodes are connected to other nodes with whom the tie strength computed on the interaction between them is higher.The novelty of this system respect to the others described before is that it is completely based on trust between users. Social data are stored only on trusted nodes chosen respect to the Dunbar's number [11]. Each node can chooses two replicas to have a high level of availability.

Mobile and opportunistic social networks
With the advent of personal devices like smartphones, OSNs witnessed a dramatic change. In fact, smartphones can be considered as the online alter-ego of people, and are affected by the same mobility patterns of their owners. A Mobile Online Social Network (MOSN) is a platform that delivers an OSN functionalities combining techniques from social sciences with wireless communication for mobile networking [16]. At a high level, a MOSN architecture is shown in [1]. Introducing mobility, a new, orthogonal, dimension to the system, adds more problems but also gives more opportunities to solve them. Indeed, communication may happen over Internet with content providers, like in traditional centralised OSNs, with other devices, like in DOSNs, or over opportunistic connections with close devices. This adds more possibilities in building the socalled wisdom of the crowd. For instance, MobiClique [23] is a MOSN middleware which is bootstrapped with a profile available on existing OSNs (virtual world) and then enable opportunistic temporary connections based on physical proximity and social compatibility (physical world). The downside of this approach is the fact that it is unable to predict user contacts, which leads to using message flooding to implement content dissemination. AdSocial [25] is a MOSN which supports presence detection, games, chat, voice and video calls over an ad hoc network, specifically targeting small mobile devices, which have strict resource constraints. AdSocial uses MAND (Mobile Adhoc Network Directory), which is an ad hoc networks specific distributed directory service, to locate nearby users and to determine their address.

Blockchain Online Social Networks (BOSNs)
During the last three years, the decentralization of OSNs have seen the rise of Blockchain-based Online Social Networks (BOSNs). These platforms give more importance to the content by providing rewarding systems and they want face the problems of privacy and fake news with the blockchain technology. Steemit [5] has more than 1 million of users and it represents the the most well-known BOSNs. Steem is a social platform that grows communities and returns the value to the people who contribute the most. An important characteristic of Steemit is that, unlike most blockchains are too slow and expensive to be used for apps, it is fast, free, and scalable, as explained on the website 5 . Sapien 6 is a democratized social news platform built on the Ethereum blockchain. The Sapien Network consists of the Sapien platform, marketplace, API integrations, and third-party applications, all connected and powered by SPN, an Ethereum-based utility token. Sola 7 is a BOSN which has more than 700,000 users. The different between Sola and the other BOSNs is how the system spreads the information. Indeed, it uses a process similar to a viral disease to spread the information to the most interested users, applying AI algorithms combined with users reactions.

THE NEW GENERATION OF DOSNS: HELIOS
DOSNs have changed the way of how users can manage their data, however they are not change the reality, where OSNs were and are the most used platforms. This probably happens because DOSNs, and the new generation based on the blockchain technology, are too similar to the most famous OSNs. They try to offer the same services by guaranteeing a high level of control over private data. Usually they use encryption techniques to store data in a secure way [12], or they use the concept of trust by exploiting trust nodes [13] [6] where store data, or privacy policies [10]. Even though they have attracted several people, they can not be considered adversaries of Facebook, Twitter, etc.
The main idea of HELIOS [17] is a people-oriented platform, rather than service-oriented, which can be adapted to the user behaviour by exploiting the smart environment. HELIOS is a platform which follows a 'Trust by Design' paradigm by taking into account the main properties of DOSNs, MOSNs, and BOSNs.
HELIOS will include new key concepts for a DOSN, such as: human-centric computing, meaningful relationships, contextual networking, computational trust, privacy by design, and so on. We briefly overview the concepts which are important to define the Contextual Ego Network.
Human-centric computing. As suggested in section 1, many services have already begin their transition from a service-centric paradigm to a human/user-centric one. Services undergoing this transition are abandoning old system developments, where the services were built around the infrastructure and using design principles to minimize all the costs. This brought very cheap, in terms of time, money, and resources invested, services, and then, around these services, interfaces were built to let people access them. With a human-centric approach, instead, services should be designed putting the user at the center, considering his/her needs and preferences, and then building the service around the user itself. This should lead to more personalized services, tailored the the people's need, and enriching their experience over the service.
Meaningful relationships. As a direct consequence of the design of the service in a human-centered fashion, we can observe a shift from a service based on content engagement to a service enabling meaningful relationships. In current scenarios, relationships are built around content sharing and engagement, a method that is prone to create negative or fruitless interactions. This method is also susceptible to let only certain content to be available to the whole service. The aim is to achieve the opposite: identify meaningful relationships, through which valuable interactions happen, and let relevant content flow through these relationships.
Contextual networking. To empower organic meaningful relationships, we also have to take into account that human interactions are highly contextual. Contextuality of interactions comes from the fact that that humans tend to interact on certain topics only with a subset of their acquaintances. For instance, it is with colleagues that we share work related information, while it is with our family or our close friends that we share personal news about our relatives. Contextuality is not only just a matter of the people we interact with, but also the role we play in the interaction. For instance, two friends may be considered as peers when chatting, but one of them may be considered more important, if he is holding an important position, with respect to the other, who is an employee at the same business.
Computational trust. Current approach to DOSNs provide a high level of privacy and security due to it's distributed design. Therefore, it can be argued that users of DOSNs have a high level of trust towards the system. However, it is important to not only focus on trust towards the system, but also to ensure that DOSNs empower trustworthiness between the users. This shift towards interpersonal trust is currently under-researched in DOSNs. A interpersonal trust model in a DOSN can aim to solve challenges related to information diffusion, relationship building etc.

The Heterogeneous Social Network
The main scope of this paper is to present an innovative data structure to model a Decentralized Social Network, called Heterogeneous Social Network. In current DOSNs, the Social Network graph is usually modelled by a Social Overlay [21]. A Social Overlay is a logical overlay in which peers are connected to known peers. An edge between a pair of nodes indicates that a tie exists between two adjacent nodes. The Ego Network [19] is a well-known social network model used to model a Social Overlay. For sake of readiness, the Ego Network of a user represents a structure built around the user itself, also known as ego, which contains her/his direct friends, known as alters and may also include information about the direct connections between the alters.
In Figure 1 we can see the ego network of the red node, the ego, with the blue nodes, its alters, and the relations among them.
HELIOS provides a set of heterogeneous actors which can be humans or sensors, and the connections between actors have an intrinsic semantic which depends on the two actors involved. To model such a graph, we implement the Social Overlay with the an Heterogeneous Social Network Graph. The Heterogeneous Social Network Graph is the union of the local views of each node, and it is implemented with an enriched Ego Network model, as we explain in the next Section. Figure 2 shows the high level architecture of HELIOS. This explains the importance of the Heterogeneous Social Network Graph to model the social behaviour of each user by retrieving information from the HELIOS application.
In the next Section, we explain in detail the model we use to represent the local view of a user.

CONTEXTUAL EGO NETWORK
The envision of HELIOS introduces two important aspects which are reflected to the model used to implement the Social Overlay of the system. The first aspect is the various nature of an actor involved in the overlay, which could be a human or a sensor. The second one is the contextual networking which means that the real-life activity of a user has to model its local view as a virtual view of the daily life.
In this section we introduce the enriched structure called Contextual Ego Network. The Contextual Ego Network is one of the most important part of the HELIOS framework because it represents the people-center approach. Indeed, the structure manages all the features described in Section 3: human-centric computing, meaningful relationships, contextual networking, computational trust and all these characteristics are represented by the Contextual Ego Network.
A Contextual Ego Network is a complex model organized in layers, where each layer represents a real-life context of the ego. Each layer, in turn, can be implemented as a simple Ego Network, where actors are heterogeneous (human and/or sensors available in the smart environment), and links between two actors describe specific relationships in according to the nature of the actors and the context in which they are.
We decide to use the Multi-Layer Model (ML-model) presented in [18] to formalize the Contextual Ego Network because the MLmodel is able to model the behaviour of users in different online social contexts, such as different Social Network accounts. In our case, the model should take into account the decentralized scenario. Indeed, the ML-model is a formal model able to capture the different contexts in which users are involved during their everyday online activity. The definition of a multi-layer model, as described in [18], is a weighted graph (V , w) where V is a set of vertexes and w is a weight which can be used to represent the strength of a relationship. When we consider multiple layers we need to know which nodes are included in more than one layer. This can be done by using the Node Mapping. As defined in [18], a Node Mapping from a layer In detail, we model the Contextual Ego Network by exploiting an instance of the multi-layer model, called Pillar multi-Network. A Pillar multi-network is characterize by |C(u)| ∈ {0, 1} and it represents a user as a pillar traversing every layer.  shows an example of the Contextual Ego Network with three different contexts: the Facebook Online Social Network which has the complete information about the social contacts, the cinema context, and the Work context of an ego node, represented by the red node. In the Facebook layer there is the real Ego Network of the ego, which has three friends which are, at the same time, friends between them. As we can see in the other two contexts, the ego network changes because it contains the social contacts which are involved in that particular context. This is the main characteristic of the Contextual Ego Network. Indeed, in the cinema context, the ego node maintains information about two nodes. The same happens in the work context, which contains other two nodes with a different semantic relationship.

Design and Architecture
The Contextual Ego Network represents the local view of each user included in the Heterogeneous Social Network Graph. Figure 4 describes in detail the internal modules of the Social Overlay layer presented in Figure 2. In particular, Figure 4 shows how the Social Overlay is composed. Indeed, we have two different levels, where the first one is the Contextual Ego Network level, which is responsible to manage the whole structure, as we describe in the rest of the Section; and the Active Context Layer, which is responsible to manage the active layer extracted by the Contextual Ego network. At the connectivity layer, we consider three distinct network connections: wifi, bluetooth, and wifi direct. In detail, the discovery of similar users can be executed by using a bluetooth connection (by exploiting the proximity), and with the wifi connection to retrieve information about similar users which are collocated all over the world. In the following, we describe the novelty introduced in this paper, by highlighting the principal characteristics of both the two layers Contextual Ego Network and Active Context Layer.

Contextual Ego Network
Layer. The Contextual Ego Network contains the social relationships of an ego node obtained by exploiting the real life of the user, and by considering the different scenarios in which the ego is involved. In this paper, we assume that, when a user is suggested by the HELIOS application, it has to be added in an existing layer (existing context), and all the layers are just created and they compose the Contextual Ego Network which is stored in an external storage. For sake of readiness, each user is characterized by a profile which contains information about itself and its interests (the privacy issue is not considered in this paper). Nodes in the networks send information about their profiles, and similarity functions are applied to check the similarity score between two nodes. After that process, the similarity score and the context in which that two peers are similar are found. The Contextual Ego Network layer is responsible to manage the whole structure stored in an external storage. The structure is requested and retrieved when the ego user runs the application by sending a request to the external storage where is stored. However, to reduce the memory consumption due to the dimensions of the structure, only one context layer is active per time, which is in according to the real context the ego user has, and the other layers are maintained in an idle status. 4.1.2 Active Context Layer. When the Contextual Ego Network is retrieved, the ego node is able to request information about its social contact in the current context. The management of the active context is implemented in the Active Context Layer. In this layer we have three different models, as described in Figure 4: the Storage Handler, the Context Manager, and the Social Contact Status.
Storage Handler. The Storage Handler is a process which is activated when the Contextual Ego Network needs to be downloaded or uploaded by communicating with the external storage. In case of download, the Storage Handler requests the structure to the external Storage and stores it at the Contextual Ego Network layer. In case of upload, it retrieves the current structure at the Contextual Ego Network layer and sends it to the external storage.
Context Manager. The Context Manager is the process able to manage the current context of a user. It communicates with the HE-LIOS Application to obtain information about the current context, and it requests to the Contextual Ego Network Layer to retrieve the current context layer. A current layer is represented with a label which indicates the name of the context and a list of social contacts. The Context Manager sends a request to the P2P Network Management module (HELIOS Core) to retrieve information about the social contacts of the active context. Afterwards, it open logical connections with the social contacts in the current context, and it retrieves information about new contents. After this step, the newsfeed of the ego will contain only news obtained by all the social contacts of the active context, which should be useful to it.
Social Contact Status. There is a Social Contact manager process which analyses the status of each social contact in the Contextual Ego Network. As explained before, the HELIOS application is able to retrieve information about similar users which are added into the context in which the similarity is verified. This can raise problems both in the evolution of the structure and to maintain a high trust in the structure, in particular when social contacts are added to the structure but the ego has never interact with them. For this reason the permanence of a node in a context is managed by exploiting a trust model, and it depends on two specific parameters: the time and the number of interactions. The Social Contact Status process sends a request to the Trust Management process to retrieve the thresholds needed to check the status of social contacts.

THE CONTEXTUAL EGO NETWORK IN A GENERAL SCENARIO
In this paper, we describe the preliminary idea concerning the definition of the Contextual Ego Network. To better understand how the structure can be used in HELIOS, we provide a general scenario and we highlight how HELIOS manages the Contextual Ego Network and the smart environment.

Scenario
Ryuu Yamamura is a young recent graduate from the University of Mars who recently found a new job as graphic designer in a large enterprise. His workplace is highly technological and it is equipped with many smart sensors. For instance, the smoke detection sensors can detect fires inside the building and send notifications and instructions on how to reach the closest emergency exit to employers' smartphones. The company canteen is also equipped with smart chairs that can be booked depending on their availability, and so on. Within his workplace he is part of a small work group of five people who meet up each morning, but he also has the chance to meet people from other groups for possible collaborations. Thanks to these meetings with people from other groups, he joined a circle of friends that meet up each day for lunch. After his work, Ryuu likes to go to a tea house where he enjoys a cup of tea or coffee, and some chatting. Generally speaking Ryuu goes to the tea house alone and makes new acquaintances having some conversation with the other customers. Once in a while, his university friends call him for a reunion like the good old days. The HELIOS application can help Ryuu in two ways: maintaining the current relationships, and helping him establish new ones. Maintaining current relationships means not only understand that there may be different contexts within the same place at the same time, but also consider that, even though his university friends are rarely close to him, they still make up a very important context.
Suppose that Ryuu runs the application when he arrives at work, the HELIOS application retrieves information about the context, and the Storage Handler sends a request to the external storage to obtain the whole Contextual Ego Network. The Context Manager obtains a signal from the HELIOS application and it sends a request to the Contextual Ego Network Layer to obtain the current context, the Work Context. Furthermore, the Manager retrieves information about all social contacts in this context and it tries to open logical connections with them. During the lunch time, the HELIOS application knows that the context is changed and both the Storage Handler and the Context Manager are executed to update the state of the Contextual Ego Network. In detail, the Storage Handler stores the current layer to the external storage by overwriting the existing one. The Context Manager sends the current context to the Contextual Ego Network layer and retrieves the right one, the Lunch context by trying to open connections with all the social contact in the Lunch context. The same processes are executed when the context changes from Lunch to Tea House. As concerns the University context, Ryuu is not anymore a student however he meets his university friends, which are currently stored in the University context, in the Tea House. Therefore these nodes are added to the Tea House context. Periodically, the Social Contacts Status is executed to check the status of all social contacts. As concerns the University context, nodes in this layer will be removed with the passing of time, and in detail when the tie strength of these connections will be less than a given threshold, decided by the trust model.

CONCLUSIONS AND FUTURE WORK
In this paper, we described the preliminary idea to implement an innovative P2P Social Overlay which takes into account the real-life of a user. We proposed the Heterogeneous Social Overlay as the principal structure of HELIOS, a new generation of DOSN which permits to interact not only with humans but also with the smart environment. The knowledge of each user is modeled with the Contextual Ego Network where contexts are represented by layers. Each layer includes social contacts which are related to that context. As a future works, we will plan to implement the Contextual Ego Network in the HELIOS framework and we will plan to test it with real data. Moreover, we will study several trust model which can be applied to our structure, and finally we will plan to face the problem of privacy by exploiting the blockchain techology.

ACKNOWLEDGEMENT
This work is supported by the HELIOS project. HELIOS has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 825585.