Peer-to-peer networks are one of the trends in the field of internetworking. Mobile agent-based technology is a newly proposed technology that can be used in peer-to-peer networks. Mobile agents are small software entity that can migrate freely from node to node in heterogeneous networks and has attracted considerable interest in both academia and industry in recent years. In this paper, we focus on the problem of using mobile agents executing in peer-to-peer networks. In our proposed mobile agent-based execution model, mobile agents are classified into three kinds: inner agents, outer agents, and worker agents. Inner agents roam inside peer groups, outer agents routing among peer groups, and outer agents execute users’ tasks on behalf of the users. During agents routing process, the network traffic is considered. For each step, mobile agents select their targets based on a probability distribution. We mathematically modeled the search process of mobile agents and provide some the...