An Adaptive K-random Walks Method for Peer-to-Peer Networks Mahdi Ghorbani Electrical, Computer and IT Engineering Dept., Qazvin Branch, Islamic Azad University Qazvin, Iran mahdigh13@yahoo.com Abstract Designing an intelligent search method in peer-to-peer networks will significantly affect efficiency of the network taking into account sending a search query to nodes which have more probably stored the desired object. Machine learning techniques such as learning automaton can be used as an appropriate tool for this purpose. This paper tries to present a search method based on the learning automaton for the peer-to-peer networks, in which each node is selected according to values stored in its memory for sending the search queries rather than being selected randomly. The probable values are stored in tables and they indicate history of the node in previous searches for finding the desired object. For evaluation, simulation is used to demonstrate that the proposed algorithm outperforms K-random walk method which randomly sends the search queries to the nodes. Keywords: Peer-to-peer, Search, K-random Walk, Learning Automata Theory. 1. Introduction The main characteristic of peer-to-peer networks is that the nodes can be connected to the network or leave it at any time. In other words, there is no central control on behavior of the nodes in the network, with all the nodes acting similarly in terms of performance level. One of the important issues in these networks is searching stored objects in the nodes. Finding an object will be exposed to some challenges with respect to how the nodes are located in the network. The peer-to-peer networks are divided into structured and unstructured regarding their structures. In the former, location of the nodes is predefined by distributed hash tables (DHT) so finding an object is done readily using hash functions. On the other hand, the latter, distribute their contents in a completely random fashion and the nodes have no information about the network status and location of the stored objects in other nodes [1- 3]. Therefore, it is not simple to find an object in this structure and search mechanisms must be utilized here. It is very important to design a search method for these networks and it can further affect efficient of the network considerably. Based on information of the nodes from the contents, the search techniques are classified as informed and blind [4- 5]. In informed methods, the nodes store a number of metadata from their neighborhood. By this kind of information, the nodes would be informed about the network status as well as the location of contents for the other nodes. In blind search methods, the nodes have no information about location of the objects, so they employ flooding algorithms to direct their search queries. One of these methods is random walk [7-8]. Once a search for finding an object is unsuccessful, random walk selects some of the neighbors randomly and sends the search queries to them through a flooding algorithm until the search time is terminated. Each of these two search methods (informed and blind) has its own advantages and disadvantages which can noticeably affect some network criteria such as search success, average response time, average number of objects found in the search process and network load. According to previous studies [6-9,13-18], using artificial intelligence methods such as reinforcement learning techniques [11-12], has improved search performance to a large extent. By these methods, each node in the networks learns to select which if the neighbor nodes for sending the search query. This paper proposes a search algorithm based on learning automaton [16], where the nodes select their neighbors intelligently and not randomly for sending the queries. Each node will store a number in its history table based on the feedback received from the neighbor nodes. During the next levels of search, the nodes which have assigned themselves a greater number in the current object search will probably contain that object. The suggested algorithm compares the search success, the number of discovered objects per each query and also the amount of overload due to messages generated for each search queries with those obtained from K-random walk [8-10]. Oversim [22] software has been used for the purpose of simulation and ACSIJ Advances in Computer Science: an International Journal, Vol. 2, Issue 2, No. , 2013 www.ACSIJ.org 3 May 7