Modeling Large-scale Peer-to-Peer Networks and a Case Study of Gnutella