In this paper, we address an important problem in mobile ad hoc networks, namely, the intrinsic inefficiency of the standard transmission control protocol (TCP), which has not been designed to work in these types of networks. After an initial training phase, we predict the mobility status of the network through a probabilistic approach, and we propose a series of ad hoc strategies to counteract the TCP inefficiency based on this prediction. Via simulation, we show the performance improvements in various wireless scenarios, in terms of increased average throughput and decreased length of the outage intervals. The significant performance improvements shown here will be verified in a future work by implementing our approach in a real testbed