There is a vast literature on the throughput analysis of the IEEE 802.11 MAC protocol. However, very little has been done on investigating the interplay between the collision avoidance mechanisms of the 802.11 MAC protocol and the dynamics of upper-layer transport protocols. In this paper we tackle this issue from an analytical, simulative and experimental perspective. Specifically, we develop Markov chain models to compute the distribution of the number of active stations in an 802.11 WLAN when long-lived TCP connections compete with finite load UDP flows. By embedding these distributions in the MAC protocol modelling, we derive approximate but accurate expressions of the TCP and UDP throughput. We validate the model accuracy through performance tests carried out in a real WLAN for a wide range of configurations. Our analytical model and the supporting experimental outcomes show that: i) the total TCP throughput is basically independent of the number of open TCP connections, and the aggregate TCP traffic can be equivalently modelled as two saturated flows; and ii) in the saturated regime n UDP flows obtain about n-times the aggregate throughput achieved by the TCP flows, independently of the overall number of persistent TCP connections.