In peer-to-peer (P2P) systems, a receiver needs to be matched with multiple senders, because peers have limited capacity and reliability. Efficient peer matching can reduce the cost on Internet Service Providers (ISPs) for carrying the P2P traffic. We study the following peer-matching problem: given a set of potential senders, find the best subset of them that will minimize the transit cost on ISPs. This problem is fairly general and the proposed algorithms for solving it can be used in many P2P systems. We propose two ISP-friendly algorithms for solving this problem: ISPF and ISPF-Lite. These two matching algorithms leverage public available information, such as BGP tables, to infer the network topology, and to minimize the cost on ISPs. The inference algorithms, however, are fairly complex, and we propose optimization techniques to reduce the inference time and to lower the memory requirement. We use trace-driven simulations to show that the proposed algorithms outperform other popu...