Vehicular Ad hoc NETworks (VANETs) aim at increasing safety on our road networks as well as bringing road users new applications and entertainment. Ad hoc networks with a linear topology appear frequently in VANETs stimulating increased interest in the study of linear ad hoc networks. Access in VANETs is usually governed by Carrier Sense Multiple Access (CSMA) techniques. Thus studying the performance of CSMA in linear ad hoc networks can be very beneficial to optimize the design of these new networks: VANETs. In this paper we analyze the performance of CSMA in linear networks. Using a simplified model for the carrier sense where only the nearest interferer is taken into account, we derive an exact model to compute the number of simultaneous transmissions in a linear VANET. We assume that the density of nodes is infinite and that all the nodes have a pending packet to transmit. We are able to extend this model to a great but finite density of nodes. For a more realistic model of CSMA where the whole interference is taken into account, we derive a lower bound for the average number of transmitters whereas the average number of transmitters with only the nearest interferer previously computed is an upper bound. We validate the results predicted by the analytical model with those obtained through simulations. We show that both approaches provide coherent results.