In order to degrade the selfish behavior and encourage more members to participate in anonymous communication, a reputation-based incentive mechanism is used in the structured peer-to-peer overlay networks. According to the initiator's reputation, the request is transmitted or retransmitted by the members in the system. The performance of the reputation-based anonymous communication system is analyzed. By using the reputation-based incentive mechanism, the members can be encouraged to participate in transmitting the packets and the degree of anonymity is increasing. Theoretical analysis and calculation results show that these systems with reputation mechanism can guarantee the performance of normal members, punish with selfish members by decreasing their anonymity degree and their efficiency, and decline the free-riding behaviors caused by selfish members.