Recently, vehicular ad hoc networks (VANETs) have generated a lot of attention to the researcher for intelligent transportation system (ITS). VANETs comprise vehicle to vehicle (V2V) and vehicle to infrastructure (V2I) communication. In this paper, an analytical model has been developed to investigate the effect of contention window size of the IEEE 802.11 distributed coordination function (DCF) for VANETs. The relationship between performance metrics and contention window size is derived from Markov chain model based analytical analysis. Moreover, simulation results are presented to analyze the performance of IEEE 802.11 DCF under different contention windows for VANETs.