Full text
FINAL MASTER PROJECT TITLE: Overlay network topological properties on dynamic P2P DEGREE: MASTEAM AUTHOR: Daniel Quintas Rodríguez DIRECTOR: Roc Meseguer DATE: 31 – October – 2014
TITLE: Overlay network topological properties on dynamic P2P AUTHOR: Daniel Quintas Rodríguez DIRECTOR: Roc Meseguer DATE: 31 – October – 2014 Overview Actually one of popular networks to share information are usually peer-to-peer networks where the overlay topology is continuously reshaped. That can affect important properties that affects the efficiency of the nodes, that are part of the network. So for P2P overlay, scale-free networks offer the possibility that as the network becomes very large it will control certain key properties for those type of networks. The objective is provide a tool for testing in a controlled environment, a known network that don't fulfill scale-free characteristics and apply modifications to the network elements to approach to a network that meets it. The result is an application for monitoring the properties and shape of a given overlay network while simple practical strategies is applied in order to modify it to meet certain properties of a scale-free network.
ÍNDEX INTRODUCTION ................................................................................................ 1 CHAPTER 1. CONCEPTS .............................................................................. 3 1.1 Networks ............................................................................................................................. 3 1.1.1 Directed Network .................................................................................................... 3 1.1.2 Undirected Network ................................................................................................ 3 1.2 Network parameters .......................................................................................................... 4 1.2.1 Node degree ........................................................................................................... 4 1.2.2 Neighborhood ......................................................................................................... 4 1.2.3 Diameter ................................................................................................................. 5 1.2.4 Average path length ............................................................................................... 5 1.2.5 Centrality ................................................................................................................. 5 1.2.6 Clustering coefficient .............................................................................................. 5 1.3 Power Law and Scale-free networks ............................................................................... 5 CHAPTER 2. REQUIREMENTS ..................................................................... 7 CHAPTER 3. ARCHITECTURE ...................................................................... 9 3.1 General architecture .......................................................................................................... 9 3.1.1 Gephi ...................................................................................................................... 9 3.1.2 Graph Manager .................................................................................................... 10 3.1.3 Data Model ........................................................................................................... 10 CHAPTER 4. DESIGN AND IMPLEMENTATION ......................................... 11 4.1 Import module .................................................................................................................. 11 4.1.1 GEXF .................................................................................................................... 12 4.1.2 GML ...................................................................................................................... 13 4.2 Statistics Module ............................................................................................................. 13 4.2.1 Centrality module .................................................................................................. 14 4.2.2 Graph module ....................................................................................................... 14 4.2.3 Clustering module ................................................................................................. 14 4.2.4 Strategies module ................................................................................................. 14 4.3 Power law module ........................................................................................................... 15 4.3.1 Strategy of decrease a degree ............................................................................. 15 4.3.2 Strategy of increase a degree .............................................................................. 17 4.3.3 Strategy of moving a node .................................................................................... 18 4.4 Export module .................................................................................................................. 19 4.4.1 Graph output ......................................................................................................... 19 4.4.2 Text output ............................................................................................................ 20 CHAPTER 5. RESULTS ANALYSIS ............................................................ 21
5.1 Mesh base graph, small network ................................................................................... 21 5.2 Cast core graph, big network ......................................................................................... 24 CHAPTER 6. CONCLUSIONS ...................................................................... 27 6.1 Future improvements ...................................................................................................... 27 REFERENCES ................................................................................................. 29
FIGURE INDEX Figure 1 Directed graph ...................................................................................... 3 Figure 2 Undirected graph .................................................................................. 3 Figure 3 Graphs ................................................................................................. 4 Figure 4 Simple example of Scale-free network representation ......................... 6 Figure 5 General architecture. ............................................................................ 9 Figure 6 Import module flow ............................................................................. 11 Figure 7 GEXF example ................................................................................... 12 Figure 8 GML example ..................................................................................... 13 Figure 9 Statistics modules .............................................................................. 13 Figure 10 Simple degree decreasing ................................................................ 15 Figure 11 Decrease degree flow ...................................................................... 16 Figure 12 Simple degree increasing ................................................................. 17 Figure 13 Increase degree flow ........................................................................ 17 Figure 14 Simple node entry ............................................................................ 18 Figure 15 Moving a node flow .......................................................................... 18 Figure 16 Output graph example ...................................................................... 20 Figure 17 Text output example ......................................................................... 20 Figure 18 Original mesh base graph ................................................................ 21 Figure 19 Evolution mesh core graph ............................................................... 22 Figure 20 Exponential representation of the degree distributio ........................ 23 Figure 21 Log-log degree distribution ............................................................... 23 Figure 22 Cast graph original overlay ............................................................... 24 Figure 23 Original Cast graph degree distribution ............................................ 24 Figure 24 Log-log degree distribution of Cast graph ........................................ 24 Figure 25 Evolution of Cast core graph ............................................................ 25 Figure 26 Degree distribution result ................................................................. 26 Figure 27 Log-log degree distribution result ..................................................... 26 TABLE INDEX Table 1 Undirected degree example .................................................................. 4 Table 2 Directed degree example ...................................................................... 4 Table 3 Mesh original properties ...................................................................... 21 Table 4 Degree distribution .............................................................................. 21 Table 5 Mesh properties at final stage ............................................................. 22 Table 6 Final Degree distribution ...................................................................... 23 Table 7 Cast original properties ........................................................................ 24 Table 8 Final network properties ...................................................................... 25
INTRODUCTION 1 INTRODUCTION Peer-to-peer or P2P theoretically is a decentralized network model with neither element is client or server, but each node of the network can act like both, although in practice this characteristic is not completely meet in some P2P networks. P2P systems can be use for distributed storage or media sharing. Since are decentralized networks and others functionalities and usually are formed in virtual overlays. The overlay of these networks are continuously reshaped by the entry or exit of users or nodes, connection problems in the physical network, important resources locations... and the network must maintain certain properties so his performance will remain the same. So P2P must be scalable and robust on changes on his topology. One way to try to achieve this is the named, scale-free networks, that allows a rapid growth with a mix of highly connected and poorly connected nodes and relative stable diameter of the network even with a great number of nodes. There are complex algorithms to generate these types of networks, but what happens if with some techniques, simple in a practical way, are applied in order to meet certain patterns distribution. The objective of the project is prove, in a controlled environment, if with simple and logical techniques is possible to obtain or modify a known network to make fulfill characteristics of a scale-free overlay at the same time information about his network properties and shape changes are being recorded. The report is organized in the following way, first some concepts will be briefly explained then the initial objectives of the project will be presented. Afterwards the general architecture of the application will be shown and the modules will be introduced as well. Next the modules will be explained in detail and later on some practical data will be shown. And finally the conclusions will be exposed.
CONCEPTS 3 CHAPTER 1. CONCEPTS In this chapter we introduce the concepts that will be discussed later in the report. It will start with a introduction about the networks the application is focused, the key parameters for this project and a brief discussion about power law in networks. 1.1 Networks The network is the overall element for the application. A networks can be seen as computing devices where pass data to each other along connections. The type of data or the elements forming the network is not important for this project, so these computing or physical devices will be called nodes as a general terminology. As well connections between these nodes will be referred as edges. Also depending on how the edges are connected between nodes a network or graph can be defined in different ways. For the application purpose will center the different types of networks in only two. 1.1.1 Directed Network In graph theory, a directed network is a graph with a set of nodes connected by edges, where the edges have a direction associated with them. The next figure represents a simple directed graph. Figure 1 Directed graph 1.1.2 Undirected Network An undirected graph the set of nodes are connected together, where all the edges are bidirectional. The next figure is a simple undirected graph. Figure 2 Undirected graph
Overlay network topological properties on dynamic P2P The use of that platform in the project mostly is for visualization of the output of the application and check how the graph evolves with each step. 3.1.2 Graph Manager Graph Manager involve all the application designed and developed in this project. Through a given graph it modify the different elements to the point that the degree distribution looks like as a power law distribution making use of the different strategies discussed above. To achieve that, it use a framework for java named Gephi-Toolkit. Basically allow you to use some features of the visualization platform, Gephi [9], through command line or in a java project. As it is important to track some metrics and statistics from the network is going to be treated, that framework provide a way to get those common data and keep the track of the graph in each change. This manager are split into several modules focused each one in one job, briefly: Import module, involve in get an existing standard file graph and parse it into a workable java object Statistics Module are in charge to deliver several metrics and statistics, discussed previously, of the current graph or a specific node. The power law module, manage the strategies to implement on networks and determine if the changes is an improvement into a power law distribution, and if it is not reverse the changes. For that purpose it use a small java library, named Data2Semantics, for the analysis of power law distributed data, useful for estimate parameters like the uncertainty of a given data set. Export Module will generate several standard graph file between the process. That will be useful for look the evolution of the graph through the changes 3.1.3 Data Model It talked about keeping track of network changes. The way this is done, is using a persistent object model through all the process. The model is composed of several levels. GraphModel level contains the complete graph structure and determines some properties for the network like which type of graph (directed, undirected...). Graph, inside the GraphModel level, acts like an accessor to read or modify the structure of the network, like applying filters to sort nodes, for example. It is possible have multiple Graphs in one GraphModel so it allow merge different networks. Within the Graph there are a list of Nodes and Edges which contains the data for each element in the network and his particular data.
DESIGN AND IMPLEMENTATION 11 CHAPTER 4. DESIGN AND IMPLEMENTATION This chapter present the design and implementation of the application developed identified in the previous chapter. It will be discussed each module and after, also it will be shown a normal flux of one change in a graph for different strategies. The flow of the whole application can vary, that means that which strategies are used or when, can be defined before run the application through code. 4.1 Import module As stated earlier, the project use the Gephi-Toolkit as a help to manage the files and elements of a graph. It works similar as if you where using Gephi program itself. At the import module, it creates a workspace where the graph model will be linked but this workspace needs a referenced project. The following figure represents the flow of that module: Figure 6 Import module flow A project can handle several workspaces, as the same way a Graph Model can have several graphs associated. In this case, it doesn't need more than one workspace or one graph to do all the process of the application. At the end the graph described at the file, will be imported and parsed to the data model described previously. Moreover the import module supports all the files than Gephi can. But in a practical way it will use those standard graph files:
Overlay network topological properties on dynamic P2P 4.1.1 GEXF It is a language for describe complex networks structures and is developed for the Gephi project. The following figure shows a piece of an actual gexf file: Figure 7 GEXF example So it is in a XML format, there are tags for each element of a graph. The first you see is the graph tag [line 2], where is set some of the attributes of it, like is an undirected graph. After that comes the nodes tag [line 7] where compress all the nodes with his respective data, like his id or label, And finally after the nodes tag is closed [line 284] there is the edges tag [line 285], where all the edges are defined, for example the edge with the id 4 [line 290] is the link between the nodes with the id "0015" and "0057".
DESIGN AND IMPLEMENTATION 13 4.1.2 GML Graph Modeling Language describe graphs in hierarchical ASCII-based way. Here is an example of how it looks: Figure 8 GML example 4.2 Statistics Module Here will perform calculations for metrics and statistics for the current graph, as well, apply filters to facilitate process to other modules. The module are spitted into two parts, one for calculations and manipulations involving a single node, and the other when involves several elements of the network ergo the topology. Each of one of this measures or filters, are separated also into modules. The next figure represents those modules: Figure 9 Statistics modules
Overlay network topological properties on dynamic P2P 4.2.1 Centrality module All involved with centrality measures. Those are the measurements made in this module: By Node: o Betweenness, for one or all nodes. o Closeness, for one or all nodes. o Eccentricity, for one or all nodes. By Topology: o Diameter. o Path length. o Betweenness mean. o Closeness mean. o Eccentricity mean. 4.2.2 Graph module This module is responsible for basics measurements and sort through elements to deliver a properly set of data for the processes that request it. By Node: o Node degree. o Node in-degree. o Node out-degree. o Node neighbors. o In coming edges for a node. o Out coming edges for a node. o Resolve if two nodes are connected between them. By Topology: o Nodes and edges recount o Average, maximum, minimum degree. o Deliver filtered lists by degrees, quantities of nodes according to degrees, nodes between a degree interval, nodes with zero degree... 4.2.3 Clustering module A module for clustering measurements: By Node: o Clustering, for one or all nodes. By Topology: o Average clustering coefficient. 4.2.4 Strategies module Some measurements necessary to carry out the strategies for approach a power law distribution By Topology: o Obtain the actual degree distribution o Deliver the error between the actual network and the expected power law distribution.
DESIGN AND IMPLEMENTATION 15 4.3 Power law module This module has the job to use the strategies like increase or decrease a node degree, explained in previous chapters, as well as control those changes are the correct ones to approach more and more to a power law distribution. First of all the distribution is calculated at the beginning, using the library named Data2Semantics, just need a data set, which is the number of nodes for each degree in the network. As result we got the distribution parameters of the best fit the library can obtain. With those parameters is possible predict the number of nodes at each degree we need to simulate the power distribution fit. Also it is possible to know the mean square error (MSE) between the actual network and the distribution fit obtained, so after a modification in a node degree is easy to determine if that change get the network close to that fit. In case the modification does not improve the distribution, it starts a revert process to the point before the modification was applied Now is possible to apply one of the strategies and modify at least the degree of one node. 4.3.1 Strategy of decrease a degree This strategy is applied in case of obtain a node with a degree that the actual number of nodes in that specific degree is higher than the number of expected nodes in the predicted degree distribution. Basically what is done is remove an edge of that node check if was an improvement for the degree distribution Figure 10 Simple degree decreasing
Overlay network topological properties on dynamic P2P The next figure show the flow for the strategy of decrease a degree in the application context: Figure 11 Decrease degree flow The first 3 steps, are the explained previously, it allow to calculate a theoretical distribution with the experimental data and be able to obtain how many nodes should have in each degree. After that the strategy for decrease the number of nodes for a degree starts. The modulo go over all the degrees of the network starting for the lowest one, checking each one if need to be decrease the number of nodes to get closer to the theoretical distribution. Next step is get a node of that degree, no matter which, and store his edges, and remove each one, calculating the degree distribution of the actual network, and the MSE has now. If the process of remove the edge leaves a node with zero degree the strategy of moving a node into the network would be applied for that one. If the MSE is better that before, the process is considered finish, and the application will stop the strategy. If not, the changes will be revert and will try with other edge, other node of the same degree or will skip to another degree and will do the flow again until it found improved change or there are no more nodes to try. Each edge or node introduced in the flow are store in a list of excluded nodes or edges with the purpose of tracing which were selected and not select it again.
DESIGN AND IMPLEMENTATION 17 4.3.2 Strategy of increase a degree When a node have a degree with the actual number of nodes in that specific degree is lower than the expected, this strategy is applied. An edge is added to that node connecting with a random node from the network. Figure 12 Simple degree increasing The next figure show the flow for the strategy of increase a degree in the application context: Figure 13 Increase degree flow As usual, the three first steps it allow to calculate a theoretical distribution with the experimental data and be able to obtain how many nodes should have in each degree. Once a degree has less nodes than expected, a node with that degree and a randomly node from the network with the same degree is selected. It checks if both nodes are connected between them, if is true, another node is randomly selected, if they are not connected it creates an edge between them. With the new edge the MSE is calculated again, in the case that improve, the process is finished. If not, the changes in the network are revert and another node with a degree with less nodes than expected is selected.
Overlay network topological properties on dynamic P2P Each node with the degree with less nodes than expected introduced in the flow are store in a list of excluded nodes with the purpose of tracing which were selected and not select it again. 4.3.3 Strategy of moving a node This strategy useful either entry a new node to the network or re-entry a node that due to the other strategies became isolated from the network. The idea is to connect this new node to other random nodes from the network until it have the average degree of the network. Figure 14 Simple node entry The next figure show the flow for the strategy of moving a node in the application context: Figure 15 Moving a node flow This flow is the one use to add those nodes that had zero degree due for some change made in the network. Also can be use like a normal one to approach the power law distribution.
DESIGN AND IMPLEMENTATION 19 It starts calculating the average degree in the network, to have some control on the modification in the degree distribution. After that, it choose 2 nodes in a randomly way, or just one and a zero node degree, check aren't connected, and create an edge between them. But those edges are not currently in the network yet. Once it have enough edges for the first or the zero node degree have an average degree, the actual edges for that node are removed from network and added the edges were created before. Finally, like others strategies, it checks if there are any new zero node degree, in case it find someone, the process repeats for that node or nodes. After that, the MSE is recalculated and evaluated, if improves, the change are permanent, if not, the changes are reverted, any case the process is finished. 4.4 Export module The export module handle the output of the application, from a representative graph in a PDF or GEXF format to a text file with metrics of the network. And this process can be done at start, end or in between changes either each one of the changes or by intervals. This is set by code before run the application, but by default the application will create each output every time the MSE is at least 10% lower than before the change. 4.4.1 Graph output This outputs is a representative picture of the network at one moment. The network is treated to apply some filters in order to improve the visualization: Color rank by degree, a paler color means less degree. Size rank by centrality, a bigger size means more centrality. By size means both node and the label of it. An algorithm from Gephi is applied in order the network is more visually appealing
Overlay network topological properties on dynamic P2P At the end of the process the xmin, is 5 and an exponent of 3.49, as before the degree distribution will be shown as a graphical representation Figure 26 Degree distribution result And the log-log of the degree distribution where should be like a straight line until the values start to stabilize. Figure 27 Log-log degree distribution result
CONCLUSIONS 27 CHAPTER 6. CONCLUSIONS At the beginning the objectives were exposed which all of them were achieved in his majority: The developed application is able to calculate a fit of a power law with the degree distribution of a given network Have been developed several strategies which together make possible the modification of a existing network in order to meet a power law in his degree distribution The application accepts the principal extensions of networks as his input. A text output with several properties of the current status of a network is created every step of the process Also a graphical output of the overlay network is generated every defined step The project have test that with simple techniques in a practical view is possible to make changes to a network and approach his degree distribution to a power law previously calculated. 6.1 Future improvements Is possible that the framework used to do the power law fit can be improve, as it have been exposed this fit apply an unwanted offset that can affect negatively some properties like the clustering coefficient of a network, so a future improve will be substitute the current power law framework with another way to calculate a proper fit. Also, exist the possibility in the process of the network changes that some group of nodes become isolated. This is solved for alone nodes but not for a group of nodes connected between them but not with the main network. So another future improve will be investigate a way to detect these situations a correct them, maybe identifying communities and check all of them are connected with each one, for example.
REFERENCES 29 REFERENCES Gephi:Oficial web of Gephi platform URL: http://gephi.github.io/ Gephi-Toolkit:Oficial wiki for Gephi Toolkit URL: https://wiki.gephi.org/index.php/Toolkit_portal Gephi-Toolkit's javadoc. URL:https://gephi.org/docs/toolkit/ Data2Semantics:Github of data2semantics URL: https://github.com/Data2Semantics/powerlaws Network's properties: Web pages with information about network properties, power law distribution and scale-free networks URL: http://mathinsight.org/ URL: http://www.richardclegg.org/previous/networks2/SpecialLecture_06.pdf URL: https://www.wikipedia.org/ URL: http://p2pfoundation.net/ URL: http://tuvalu.santafe.edu/~aaronc/powerlaws/