The paper reports on a detailed study of the BitTorrent content distribution system. We first present a measurement infrastructure designed to allow detailed, message-level capture and analysis of P2P traffic. An associated modeling methodology is presented as well. These tools have been used to measure and model the BitTorrent protocol, which is observed to exhibit exponential characteristics of session interarrival times. We also observe that session durations and sizes are modeled with a lognormal distribution.