Abstract—BitTorrent has been the most popular P2P (Peer-toPeer) paradigm during recent years. Built upon great intuition, the piece-selection and neighbor-selection modules rooted in BitTorrent are critical for efficiency and scalability of many P2P systems, such as file-sharing and video-and-demand. Yet the theoretical underpin of these two modules remain largely undiscovered. In this paper we reverse-engineer BitTorrent protocol from a Markov approximation perspective. We show that together with the underlying rate control algorithm, the rarest first and choking algorithms in BitTorrent protocol implicitly solve a cooperative combinatorial network utility maximization problem by implementing a Markov chain in a distributed manner. This understanding allows us to access properties of BitTorrent from a fresh perspective, including performance optimality, convergence and impacts of design parameters. Our numerical evaluations validate the analytical results. The insights obtained b...