high Technology Program of China (No. 2004AA104340 and ..... Zhao, B. Y., Kubiatowicz, J. D. and Joseph, A. D.: Tapestry: An Infrastructure for Fault-. Resilient ...
Routing Algorithm Using SkipNet and Small-World for Peer-to-Peer System* Xiaoqin Huang, Lin Chen, Linpeng Huang, and Minglu Li Department of Computer Science and Engineering, Shanghai Jiao Tong University, No.1954, HuaShan Road, Shanghai, 200030 {huangxq, chenlin}@sjtu.edu.cn
Abstract. In this paper, we design a new routing algorithm using SkipNet and Small-World for peer-to-peer system. The algorithm divides the routing space into two layers, SkipNet layer and Small-World layer. In the SkipNet layer, the routing method using numeric ID is discussed. In the Small-World layer, the routing method using small-world theoretical results is discussed. We also consider the dynamic circumstance-the node's join and departure. The comparison of our algorithm with other algorithms is presented. Our algorithm supports content and path locality, it is very important for security consideration. In our algorithm, a few shortcuts to distant peers are inserted with some probabilities and the average path length is reduced. The preliminary simulation results show that our algorithm is efficient.
1 Introduction Scalable overlay networks, such as Chord [1], CAN [2], Pastry [3], and Tapestry [4], have become the hotspot for study. They emerged as flexible infrastructure for building large peer-to-peer systems. These networks use a distributed hash table (DHT), which allows data to be uniformly diffused over all the participants in the peer-to-peer system [5]. Although DHTs provide nice load balancing properties, they have at least two disadvantages: Data may be stored far from its users and it may be stored outside the administrative domain to which it belongs [5]. Papers [5] [6] introduce SkipNet or Skip Graphs, a distributed generalization of Skip Lists [7], to meet the goals of peerto-peer systems. The scheme supports content locality and path locality, which can provide a number of advantages for data retrieval, performance, manageability and security. Content locality can improve security by allowing one to control the administrative domain in which data resides [5]. A social network exhibits the small-world phenomenon [8]. Recent work has suggested that the phenomenon is pervasive in networks, especially in the structural evolution of the World Wide Web [9]. In this paper, we propose an algorithm which combines the SkipNet and SmallWorld Scheme. So our algorithm has the content and path locality properties by adopting SkipNet scheme, and the average routing length is reduced by adopting the Small-World scheme, it can perform a well-ordered search from a global view. *
This paper is supported by SEC E-Institute: Shanghai High Institutions Grid project, the 863 high Technology Program of China (No. 2004AA104340 and No. 2004AA104280).Natural Science Foundation of China (No. 60433040 and No. 60473092).
H. Zhuge and G.C. Fox (Eds.): GCC 2005, LNCS 3795, pp. 984 – 989, 2005. © Springer-Verlag Berlin Heidelberg 2005
Routing Algorithm Using SkipNet and Small-World for Peer-to-Peer System
985
The rest of this paper is organized as follows: Section 2 describes related work. Section 3 describes routing algorithm. Section 4 presents simulation experimental evaluation. Section 5 gives the comparisons and Section 6 concludes the paper.
2 Related Work Skip List Data Structure. A skip list [7] is a randomized balanced tree data structure organized as a tower of increasingly sparse linked lists. Level 0 of a skip list is a linked list of all nodes in increasing order by key. In a doubly linked skip list, each node stores a predecessor pointer and a successor pointer for each list in which it appears. The lists at higher level act as “express lanes” that allow the sequence of nodes to be traversed quickly. Searching for a node with a particular key involves searching first in the highest level, and repeatedly dropping down a level whenever it becomes clear that the node is not in the current level [6]. The SkipNet Structure. First of all, we define the concept of a skip graph. As in a skip list, each node in a skip graph is a member of multiple linked lists. The level 0 list consists of all nodes in sequence. Where a skip graph is distinguished from a skip list is that there is may be many lists at level i [6]. We transform the concept of a Skip List to a distributed system setting by replacing data records with computer nodes, using the string name IDs of the nodes as the data record keys, and forming a ring instead of a list. The ring must be doubly linked to enable path locality [5]. A skip graph supports search, insert, and delete operations analogous to the corresponding operations for skip lists. For node 6 (in Fig.1), the routing table may be as in Fig.2.
6
3
2
4 5
1 3
1
2
3
6
4
5
6
9
7
8
Fig.1. A Skip List
9
Level
10 11
2
12
12
1
9
3
0
7
5
6
12 7
11 10
9
8
Fig.2. SkipNet nodes and routing tables of node 6
Small-World Phenomenon and Model. Duncan J. Watts and Steven H. Strogatz present a usual Small-Word model [9] [11]: N nodes are distributed in a ring, initially; each node has K links and links to the nearest K nodes. Then each node’s link is adjusted in turn, the linked terminal is changed randomly in probability P , but don’t link to itself. D (i, j ) is the shortest distance between nodes i and j , the average path distance L =
n , the network is in 1 D(i, j) , When p ≈ 0 , L ~ ∑ 2k n(n −1) / 2 1≤i j≤n
986
X. Huang et al.
regular state. When 0 .001 < p < 0 .01, L ~ ln n , the node is not only connected to ln k neighbor nodes but also to remote nodes. These shortcuts shorten the L the entire network is of small-world characteristic. Kleinberg [8] modeled social networks by taking a two dimensional grid and connecting each node u to q edges when edge
(u , v) exists with probability proportional to || u − v || −2 . For simplicity, we remove the parameter q and assume that each edge (u , v ) is connected with probability d
|| u − v || −2 . For any dimension d > 1 , the small world graph of dimension d has n nodes associated with the points of a d dimensional mesh, where edge (u , v ) is occupied with probability || u − v || − d [10].
3 Routing Algorithm Key Composing. In our algorithm, we consider the question of how to transfer a message from explorer.sjtu.edu.cn to receiver.sjtu.edu.cn, just in the range of *.sjtu.edu.cn, not passing intruder.tsinghua.edu.cn. So we can guarantee the message path locality and the message security. We employ two separate, but related address spaces: a string name ID space and a numeric ID space. Node names and content identifier strings are mapped directly into the name ID space. Each node’s random choice of ring memberships can be encoded as a unique binary number, which we refer to as the node’s numeric ID. We don't use the hash method as in Chord, CAN, Gnutella and Pastry et al. For example, the node explorer.sjtu.edu.cn can be mapped to its numeric ID 011.101.1001. The first three bits of the numeric ID represents the country, the second three bits represents the school and the third four bits represents the school’s various users. Routing Table Structure. Each node has to maintain a routing table of length K . A routing table can composed of two parts: SkipNet table (SNT) and Small-World table (SWT). SNT records the node’s neighbor node in level 0, 1, 2 as in Fig.2. The SWT table records query and the destination node ID, the query and destination node ID is represented by the numeric ID. If the length of SkipNet table is L , then the length of the Small-World table is then K − L . The routing table of our algorithm is as in Table 1. Routing Table Renewal Strategy. SWT renewal strategy is similar to paper [11]. We define the shortest distance between nodes a , b as D ( a, b) .
D(a, b) = min{| a − b |, | M − a − b |} , Where M is the total amount of nodes in the ring. The SWT renewal of node u is as follows: (1) Select the nearest nodes adding to node
u ’s SWT until the SWT is full.
Routing Algorithm Using SkipNet and Small-World for Peer-to-Peer System
v ’s deletion probability
(2) Calculating each record’s deletion probability, the key
P (v ) =
987
−1
D (u, v) ,where w is the random key in the SWT table [11]. ∑ D(u, w) −1 w
key Del . and key Ins as in [11].
Randomly select a key as the deletion record, denoted as (3) Recalculating the deletion probabilities of
key Del
The deletion object is determined by the deletion probability, so the SWT table can be adjusted. Because the renewal algorithm renew the SWT table by the probability, the SWT table can introduce a little of shortcuts. Table 1. Routing table of algorithm N o d e
6 K e y
N o d e
0 1 1 .1 0 1 .1 0 0 1
ID
0 1 1 .1 0 1 .1 0 1 0 ...
S W T L E V E L
S N T
2
1 2
1 2
1
9
3
0
7
5
Routing by Numeric ID. If we want to route messages to a given numeric ID for example 011.101.1010 from node A, we first route the message to the node in the level 0 whose numeric ID matches the destination numeric ID in the first digit. At this point the routing operation jumps up to this node’s level 1 ring, which also contains the destination node. The routing operation then examines nodes in this level 1 ring until a node is found whose numeric ID matches the destination numeric ID in the second digit [5]. The routing operation proceeds in this way to satisfy the first six bits. These operations are conducted in the SNT table. Then we route the message in SWT table. In our algorithm, the query is the key. Because we adopt the probability algorithm in the SWT table, there are some shortcuts to the remote nodes. So the key searching length can be reduced efficiently. Node Join and Departure. Node join and departure process is similar to paper [5]. To join a SkipNet, a newcomer must first find the top-level ring that corresponds to the newcomer’s numeric ID. The newcomer then finds its neighbors in this top-level ring, using a search by name ID within this ring only. Starting from one of these neighbors, the newcomer searches for its name ID at the next lower level and thus finds its neighbors at this lower level. This process is repeated for each level until the newcomer reaches the root ring.
4 Simulation Experiment To evaluate the routing algorithm, we do some simulation experiment. We consider the average path length as the main evaluation values [12]. Because the average path length determines the message’s waiting time. We run simulations in which we com-
988
X. Huang et al.
pared the performance of our algorithm in two circumstances: The performance of the NoN Small-World algorithm (just using SkipNet scheme) and the performance of SkipNet and Small-World algorithm. For each graph size we run 10 executions. The routing table capacity is 100, SNT is 30 and SWT is 70. We randomly select the starting node. The experimental result is as follows: We use the ratio of average path length in SkipNet and NoN Small-World and SkipNet with Small-World. When node number is 103, the ratio is 1.4. The node number is 104, the ratio is 2.1. The node number is 105, the ratio is 3.5. In the initial experimental result, we can see the SmallWorld phenomenon effect is obvious with the node number increasing. In the future work, we will give more performance analysis, For example, the routing success rate, the relationship of the routing success rate with the routing table’s capacity et al.
5 Comparisons Our routing algorithm use the SkipNet and Small-Word scheme, so our routing algorithm has a fundamental philosophical difference from existing overlay networks, such as Chord and Pastry whose goal is to implement a DHT. The basic philosophy of systems like Chord and Pastry is to diffuse content randomly throughout an overlay in order to obtain uniform, load-balanced, peer-to-peer behavior. The basic philosophy of SkipNet is to enable systems to preserve useful content and path locality [5]. Path locality allows SkipNet to guarantee that messages between two nodes within a single administrative domain will never leave the domain. So it can prevent attacks from other administrative domain. Our algorithm also used the Small-World scheme; there are some shortcuts to the remote nodes. The shortcuts can play the role of reducing the path length. So our algorithm can reduce the average path length. In previous peer-to-peer overlay designs [1] [2] [3] [4], node placement in the overlay topology is determined by a randomly chosen numeric ID. Nodes within a single organization are placed uniformly throughout the address space of the overlay. When a single organization fails together, it can affect the entire network. Since SkipNet name IDs tend to encode organizational membership, and nodes with common name ID prefixes are contiguous in the overlay, failures along organization boundaries do not completely fragment the overlay, but instead result in ring segment partitions [5]. When the message is routing in the organization disconnected from the Internet network, the message also can reach the destination. So our algorithm has good fault tolerance. In our routing algorithm, we put routing table on each node instead of a distributed hash table. Most unstructured peer-to-peer systems with a distributed hash table run a blind and not global search. There is a lack of the global properties. In our scheme, it can perform a well-ordered search from a global view. The disadvantage of our algorithm is that each node has to preserve some cache space and some computation capacity.
6 Conclusion In this paper, we design a peer-to-peer routing algorithm using SkipNet and SmallWorld scheme. In our routing algorithm, we put routing table on each node instead of
Routing Algorithm Using SkipNet and Small-World for Peer-to-Peer System
989
a distributed hash table. It can perform a well-ordered search from a global view, Furthermore, our algorithm supports content and path locality and has good fault tolerance, it is very important for security consideration. Shortcuts to remote peers are inserted with some probabilities and the average path length is reduced. The performance of our algorithm is discussed. The preliminary simulation results show that our algorithm is efficient. In the future, we will give more performance analysis, for example, the routing success rate, the relationship of the routing success rate with the routing table’s capacity et al.
References 1. Stoica, I., Morris, R., Karger D.et al.: Chord: A Scalable Peer-to-Peer Lookup Service for Internet Applications. In Proceedings of ACM SIGCOMM, Aug. (2001). 2. Ratnasamy, S., Francis, P., Handley, M. et al.: A Scalable Content-Addressable Network. In Proceedings of ACM SIGCOMM, Aug. (2001). 3. Rowstron, A. and Druschel, P.: Pastry: Scalable, distributed object location and routing for large-scale peer-to-peer systems. In International Conference on Distributed Systems Platforms (Middleware), Heidelberg, Germany, Nov. (2001) 329-350. 4. Zhao, B. Y., Kubiatowicz, J. D. and Joseph, A. D.: Tapestry: An Infrastructure for FaultResilient Wide-area Location and Routing. Technical Report UCB//CSD-01-1141, UC Berkeley, April (2001). 5. Nicholas J.A. Harvey, Michael B. Jones, Stefan Saroiu et al.: SkipNet: A Scalable Overlay Network with Practical Locality Properties. Fourth USENIX Symposium on Internet Technologies and Systems (USIT’03), Seattle, WA, March (2003). 6. J. Aspnes and G. Shah. Skip graphs. In fourteenth ACM SIAM Symposium on Discrete Algorithms (SODA), (2003) 384-393. 7. Pugh, W.: Skip Lists: A probabilistic Alternative to Balanced Trees. In Workshop on Algorithms and Data Structures, (1989). 8. Kleinberg, J.: The small-world phenomenon: an algorithmic perspective. Cornell Computer Science Technical Report, (2000) 99-1776. 9. Watts, D. and Strogatz, S.: “Collective dynamics of small-world networks”. Nature 393, 440 (1998). 10. Moni Naor, Udi Wieder.: Know thy Neighbor’s Neighbor: Better Routing for Skip-Graphs and Small Worlds. IPTPS 04, (2004). 11. Zhou, J., Lu H. and Li, Y. D.: Using Small-World to Devise Routing Algorithm for Unstructured Peer-to-Peer System. Journal of Software. Vol.15, No.6, (2004). 12. Yang, B., Garcia-Molina H.: Improving search in peer-to-peer networks. Proceedings of the Int’l Conference on Distributed Computing Systems. IEEE Computer Society, (2002). 5-14.