Design and Implementation of Peer-to-Peer Service Routing Algorithm ()
1. Introduction
Peer-to-Peer (P2P) service routing is an important area of the P2P network. Currently, the P2P routing is divided into the categories of unstructured and structured routing algorithms. Unstructured P2P network is not fixed logical topology of the P2P network. Joining and leaving Nodes affect only the direct neighbors. The message overhead is relatively small. Typical unstructured P2P network routing includes Gnutella, Freenet, APPN, NeuroGrid [1] and so on. Unstructured P2P network routing has been used, but faces low routing efficiency, in particular lack of quality of service guarantees. Structured P2P network routing table (referred to as DHT) is constructed in accordance with Direct Hash Table. Each node has a unique identifier. According to the identifier of the message destination, the node can route messages to the node closest to the node identifier and message identifier. The typical structure of P2P networks includes Chord [2] , CAN [3] , Pastry [4] and Tapestry [5] - [7] . P2P has been applied in other fields of business, finance and tourism. The P2P services a wide range of applications and further development in these areas is limited due to lack of quality of service guarantee. Most of the current P2P lacks consideration of the quality of service. This paper studies the P2P routing algorithm from perspective of quality of service. The proposed algorithm is able to provide guaranteed quality of service routing and promote the development and wide application of the P2P network.
2. P2P Service Routing Problem
For the P2P service routing in this paper, factors affecting the service routing can be considered from the following aspects: the connection bandwidth between network nodes; the maximum bandwidth of node; The session time between nodes. P2P service network routing goal is to establish a service path that meet the above requirements from source node to the destination node, and get the maximum throughput of P2P services along the selected path.
2.1. Define P2P Services Routing Problem
P2P services routing problem can be defined as:, V show nodes set in P2P, E is the corresponding edge between nodes. Every node can join and leave network random, bibj is available bandwidth between i and j, then, , cij show the minimum available bandwidth between i and j, a service quality assurance of the P2P services routing goal is to find a path to make P2P services network throughput maximization, and satisfy the following requirements. Select the Maximum bandwidth utilization rate; the effective bandwidth between the nodes is between connection bandwidth and acceptable bandwidth.
2.2. Formalization P2P Services Routing Problems
In a undirected graph, Bij is bandwidth between the node I and the node j, Fij show traffic between node I and node j, then defined as follows:
(1)
Assume source s and destination d, , , there are multiple paths between a given source and destination, a collection of all these paths is, Pi is one of path in., Bij is bandwidth between the node i and the node j, xij is binary variables. xij = 1, is connected, else is not connected. bij is available bandwidth between node I and node j, cij is the minimum accepted bandwidth between node i and j.
In summary, the problem can be described as the following:
In this model, the objective function is: the set of multiple paths between a given source and destination, find one of these paths which has maximum utilization of the bandwidth of the path of service.
(2)
3. P2P Service Routing Implementation Process of the Ant Colony Algorithm
Nodes in the P2P service network play an important role in routing. The bandwidth of the node is related to the performance of the entire network, so attributes of high capacity nodes are considered. In this paper, the available bandwidth of nodes is considered and guarantees the available bandwidth of nodes so as to ensure that each service can be achieved availability. First, the P2P service routing model is built, then ant colony algorithm to solve the service routing problems is design.
Ant colony or swarm intelligence algorithm [8] - [10] is an optimization algorithm inspired by the patterns of behavior by the ants to find food, the ant colony algorithm as a heuristic algorithm is to provide a very good network quality of service algorithms, ant colony algorithm has the potential ability in applying to solve the routing problem, artificial ants are probe packets, they will leave artificial pheromone on the path, the transition probability of ants on each route can calculate through the pheromone in the statistics on the path and inspire factor [11] - [13] , after several iterations, the highest pheromone routing is to answer.
The selection probability of ants on each route (i, j) can be described as follows:
As,
(3)
In Equation (3):
shows the k ant the next selection set of paths; show the k ant probability through path (i, j) from i to j, show the pheromone in the path (i, j) at the t time; Fij show traffic through path (i, j); Bij is the bandwidth through path (i, j). and show weight in controlling the pheromone and path respectively.
Now show the pheromone in the path (i, j) at the t time, while an t finish one cycle, then the pheromone become as follow:
(4)
In this Equation (4), is constant coefficient between o and 1, show pheromone evaporation between time t and time t plus 1.
(5)
In this equation, is the pheromone variable through path (i, j) between time t and time t plus 1. It can be defined:
(6)
In Equation (6), Q is a constant. It is the pheromone after ant finish one complete path search. Lk is the total path bandwidth utilization of the k ant. It is equal to the sum of the k-th segment of the passed path of the ants bandwidth utilization. If the total bandwidth utilization of the path of the ants is higher, concentration of pheromone is higher by released per unit path. Obviously, the ants will not release pheromone on the path which has never experienced.
Dynamic Ant Colony Algorithm for solving problem as follows:
Global search ability and search speed of the application of ant colony algorithm used to solve the P2P service network routing problem [14] [15] , Specific of ant colony algorithm realization as follows:
Begin
Initialization, the m ants on the starting node s, , k = 1, ∙∙∙, n
(c is a constant)
Loop
For k = 1 to m do
Ant k to determine if the current node i connecting the node has gone through.
Calculate the probability of all nodes are not traversed, and selecting randomly the next node j according to the probability applying for Equation (2), (3); Update the pheromone concentration in the path between nodes m i and j applying for Equation (4), (5) and (6),
If node j is object node t then
Determine the path bandwidth utilization is the largest, if it is the largest path then record the point
The starting node s and destination node t are interchangeable and empty node traversed records
End
If approximate bandwidth utilization is greater than the sum given the current bandwidth utilization
then exit Loop
Else go to Loop
End.
4. Experimental Analysis
Environment of the experiment to build 16 units of the Red Hat Linux operating system on 16 PCs, using Java to design and realization [16] [17] . Waxman topology generation algorithm based on
will generate the network topology. In order to verify the effectiveness of service-based P2P service routing algorithm, randomly selected 16 as an ordinary node. The data communication between nodes used the Java RMI mechanism, synchronization cycle simulation. In each round a loop, each node is read from its input queue, and then processed according to the specified routing rules.
P2P service routing algorithm, assume, , , , ants number, ,. All nodes every two seconds sending service advertising messages in the two systems generate network congestion, because the experimental derivation of the LAN environment, the transmission time between two nodes is very short, not enough to reflect the real Internet environment, so each times send an additional 10 seconds of delay between each two nodes.
From Figure 1, we can see that service P2P service network routing ant colony algorithm is less than Dijkstra algorithm caused by the bottleneck at any one time interval. Therefore in the same network conditions, Ant algorithm has less router price, has better performance than the Dijkstra algorithm.
The convergence rate in different network scale under the conditions of two kinds of algorithms, it can be seen from Figure 2, with the increase of network nodes, Ant algorithm has faster convergence speed, this is because with the increasing scale of the network, the algorithm of feasible solution space increased, if the evolutionary algorithm cannot effectively reduce the solution space, will not improve the convergence rate of the algorithm. The Ant algorithm uses the idea of simulated annealing, so as to ensure the convergence of feasible solution, and ultimately accelerate the iteration to find the optimal solution (or approximate optimal solution) speed. Dijkstra algorithm is able to find the shortest path from a node to another node of the graph, after Dijkstra algorithm once, we can get the shortest path from start to within its searching all nodes, and its time complexity
Figure 1. The comparison of router price of the two algorithms.
Figure 2. The iterative time with the network nodes vary.
is (n is nodes in graph). The main concern is the shortest path between two specific nodes rather than the point of origin to other points in the calculation of network routing. The characteristic of the Ant colony algorithm is an enhanced learning system, distributed computing features and has a strong robustness. Ant colony algorithm is very suitable for solving complex combinatorial optimization problems, the P2P service network routing problem is a combinatorial optimization problem, so the Ant colony algorithm to solve the P2P service network routing problems. Using the ant colony algorithm and Dijkstra algorithm respectively solve P2P service network routing problems. The experimental results show that the Ant colony algorithm is relatively fast to find the approximate route, and the system copies the information less, the reason is that the Ant colony algorithm is a simulation of evolutionary algorithms, ant colony algorithm with groups of co-operation, positive feedback and distributed computing features and many main Agent (referred to here the main body of the ant) can be better to complete the task of optimizing collaboration between groups of cooperation; positive feedback makes the algorithm quickly find better solutions; it is easy to achieve parallelism for distributed computing algorithm.
Acknowledgements
This work was financially supported by the Hebei province science and technology research project (No. Z2014038). The work was supported by the Fundamental Research Funds for the Central Universities (3142014125, 3142015022, 3142013098, and 3142013070).
Gaoxiao Yan, associate professor, Dr., majors in communication and information system. Research directions include the computer network and the network security. She was a visiting scholar at Queen’s University in Canada.