| Traditional network applications usually use the client/server model, where the server is in the core position, and provides services and sources for the clients. This model worked well at the early stage of the networks, but with the scale of networks became large, the number of users increased, inherent vice also appeared. Servers cannot fit the desired computing ability and bandwidth. Peer-to-peer networks emerged just on such circumstance.In peer-to-peer networks all peers are equal in status and functions, clients and servers are not different anymore, peers are organized all by themselves. Peer-to-peer networks are expandable and fault tolerated, and suitable for large-scale networks. The related theory about the research of peer-to-peer networks is valuable.This paper introduces the background of peer-to-peer networks; summarizes the popular application modules of peer-to-peer network at present, analyzes the topological structure and search mechanism in unstructured peer-to-peer networks in detail; summarizes the basic conception and application module of ant colony algorithm, and the features of ant colony algorithm.This dissertation applies basic ant colony algorithm to search mechanism in unstructured peer-to-peer networks. In order to enhance the practicality of ant colony algorithm, in allusion to the difference between peer-to-peer networks and ant colony, using the theory of polymorphic ant colony algorithm for inference, it applies polymorphic ant colony algorithm to the search mechanism in unstructured peer-to-peer networks to improve efficiency. For the sake of decreasing the blindness of pack forwarding, in view of the new file search requirement after the search have started, it imports the conception of generated pheromone to decrease the blindness of pack forwarding in early searching stage.The paper analyses the necessity and significance of peer-to-peer network simulator, summarizes the common design principles of peer-to-peer network simulators. It designed a simple simulator module, and implemented it using C++ programming language and object oriented development method. Basing on this simulator framework, simulate the flooding, ant colony algorithm, ant colony algorithm with generated pheromone in unstructured peer-to-peer networks, and it analyzed the experiment data. The experiment results indicate that those algorithms are effective, and could enhance the performance of peer-to-peer networks. |