In a heterogeneous peer-to-peer network, different peers provide different qualities of service. It will be very helpful if a peer can identify which peers can provide better services than others. In this paper, we design a novel reputation model which enables any peer to calculate a reputation value for any other peer that reflects the quality of service provided by that peer, so as to differentiate peers providing good quality of service from those peers providing poor service. Furthermore, to overcome the problem of malicious recommenda-tions, we propose an auxiliary trust mechanism which calculates a trust value for each peer. Experimental results show that our reputation model achieves a fast convergence speed, and it is also robust against a large portion of malicious peers that provide fraud recommendations.