Fair resource allocation is an effective strategy to provide optimal congestion control and scheduling in ad hoc wireless networks. We present distributed flow-based access schemes for slotted-time protocols, that guarantee proportional fairness in ad hoc wireless networks in the framework of nonlinear optimization. A proportionally fair medium access control algorithm maximizes the product over all flows of an appropriate flow-based performance function. We first present distributed, scalable flow-based medium access control algorithms that maximize the product of the end-to-end flow success probabilities. These algorithms are decentralized and converge to the globally optimal solutions using information on the floor access probabilities in the local neighborhood. The proposed algorithm is implemented using a random access slotted-time medium access control protocol (ST-MAC), and its properties are verified using NS2 simulations. We also present some modifications to the ST-MAC protocol to increase its efficiency. We then present a distributed flow-based access scheme for slotted-time protocols that provides proportional fairness with respect to flow-throughput under constraints on the buffer overflow probabilities at each node. We model the end-to-end flows in an ad hoc wireless network using a tandem of finite-size, discrete-time queues, located at the nodes along the routes used by the flows. The proposed scheme requires local information exchange at the link layer and end-to-end information exchange at the transport layer, and is cast in the framework of nonlinear optimization. A distributed dual-based algorithm is proposed to adjust the channel access probabilities to achieve proportional fairness under the above-mentioned constraints. A key contribution of this work lies in the construction of a distributed dual approach that comes with low computational overhead. We establish the convergence to the global optimum under the proposed scheme. MATLAB-based simulation results, along with NS2 simulations using ST-MAC as the MAC protocol, are presented to support our conclusions.