In this paper, we develop an analytical model for IEEE 802.11 MAC protocol with arbitrary buffer size in unsaturated conditions. The model comprises of a generalized Markov chain model and an M/G/1/K queuing model. We give the thorough and accurate queuing analysis of IEEE 802.11 MAC layer. It's shown that for practical 802.11 WLAN (i.e., buffer size larger than one and number of stations comparatively large) under the optimal offered load, the total throughput is maximized, the packet blocking probability (due to limited buffer size) and the average queuing delay tends to zero, the average MAC service delay as well as its standard deviation is much lower than that in saturated conditions. The simulations show the analytical model is highly accurate.