Abstract:Query routing among peers to locate resources is a main issue discussed in Peer-to-Peer (P2P) networks, especially in unstructured P2P networks. This issue becomes even worse when frequent join and departure or failure of client peers happen in the networks. This paper proposes a new churn-resilient protocol to assure alternating routing path to balance query among peers under network churn. The proposed protocol uses two strategies to make queries balancing among inter-and intra-group peers. First a resource grouping and rewiring strategy is provided to periodically cluster peers having same set of resources. This grouping strategy makes locating resources more efficient in the inter-group peers, for it makes the network overlay topology evolve from a random network to a clustered network. The rewiring strategy also alleviates loads among over-loaded peers. Meanwhile, load balancing routing among the intragroup peers is achieved by collaborative Q-learning among peers. The collaborative Q-learning method not only learns from such parameters as processing capacity, number of connections and number of resources in peers, but also learns their state of congestion. Using this technique, queries are guided to avoid forwarding to those congested peers. Thus, query routing forwarding is balanced among intra-group peers. Simulation results show that the desired resources are located more quickly and queries in the whole network are balanced. The results also show that queries by the proposed method exhibit more robustness and adaptability under network attacking, high query workloads, and high network churns than queries by random walk method.