For the security problems of the hierarchical P2P network (HPN), the paper presents a security clustering algorithm
based on reputation (CABR). In the algorithm, we take the reputation mechanism for ensuring the security of transaction
and use cluster for managing the reputation mechanism. In order to improve security, reduce cost of network brought by
management of reputation and enhance stability of cluster, we select reputation, the historical average online time, and
the network bandwidth as the basic factors of the comprehensive performance of node. Simulation results showed that
the proposed algorithm improved the security, reduced the network overhead, and enhanced stability of cluster.