In ad hoc networks, both contention and congestion can severely affect the performance of TCP. In our work, we first show that the over-injection of conventional TCP window mechanism results in severe contentions, and medium contentions cause network congestion. Furthermore, introducing two metrics, channel utilization (CU) and contention ratio (CR), we characterize the network status. Then, based on these two metrics, we propose a new TCP transmission rate control mechanism based on Channel utilization and Contention ratio (TCPCC). In this mechanism, each node collects the information about the network busy status and determines the CU and CR accordingly. The CU and CR values fed back through ACK are ultimately determined by the bottleneck node along the flow. The TCP sender controls its transmission rate based on the feedback information. Simulation results show that the proposed TCPCC mechanism significantly outperforms the conventional TCP mechanism and the TCP contention control mechanism in terms of throughput and end-to-end delay.