  Considering the comfortably establishing ad hoc networks, the use of this
type of network is increasing day to day. On the other side, it is predicted
that using multimedia applications will be more public in these network. As it
is known, in contrary to best-effort flows, the transmission of multimedia
flows in any network need support from QoS. However, the wireless ad hoc
networks are severely affected by bandwidth, and establishing a QoS in these
networks face problems. In this paper, we have proposed a thoroughly
distributed algorithm to support the QoS in ad hoc networks. This algorithm
guarantees the QoS of the real-time applications vis-a-vis each other and
best-effort flows as well. The algorithm suggested in this paper dynamically
regulates the Contention Window of the flows and serves the flows in terms of
their requests QoS choosing the smallest CW in every node. This algorithm also
uses the fixed and/or less stationary nodes for the transmission of real-time
flows by increasing the QoS of the multimedia flows. This algorithm is
preferred because it prioritizes the flows that are of the same class but have
not obtained favorite QoS compared to other flows of the same class in addition
to classifying the flows in the network and offering better services to the
classes of higher priority. All this occur without the controlled packets
forwarding and resource reserving and freeing method. We have proved the
correctness of this algorithm using Markov's mathematical model.
