The Peer-to-Peer (P2P) file sharing system is one of the most widely-used P2P applications. Its traffic represents about 60%similar to 80% of the whole Internet traffic. BitTorrent is a representative P2P file sharing system. In such systems, the schemes of choosing neighbors and selecting pieces are mainly based on the knowledge of overlay topologies, without considering the underlying Internet topology, which may lead to too much inter-ISP (Internet Service Provider) traffic and serious performance degrading of the whole systems. To overcome these problems, we design a new scheme to improve the performance of BitTorrent-like P2P file sharing systems, inspired by the idea of Application Level Traffic Optimization (ALTO). Firstly, we propose a novel approach to make BitTorrent node aware of the topology of underlying networks. Then we modify BitTorrent's original algorithms and replace them with three new localized algorithms based on autonomous system (AS) hops. Finally, we conduct comprehensive experiments to verify the correctness and effectiveness of our scheme based on the General Peer-to-Peer Simulator (GPS). The simulation result shows that, with our scheme, nodes in BitTorrent-like systems have better sense of the topology of their underlying networks, and can interact more efficiently. Besides, our scheme can help to decrease inter-AS or inter-ISP traffic, optimize traffic distribution across the whole networks, and improve the quality of experience of P2P users.