Congestion control plays an essential role on the internet to manage overload, which affects data transmission performance. The random early detection (RED) algorithm belongs to active queue management (AQM), which is used to manage internet traffic. The RED is used to eliminate weakness in default control of the transport control protocol (TCP) drop-tail mechanism. The drawback of RED is parameter tuning, while adaptive RED (ARED) automatically adjusts these parameters. In this study, the suggested algorithm, the Markov decision process RED (MDPRED) uses the Markov decision process (MDP) to suitably adapt values for queue weight in the RED algorithm based on average queue length to enhance the performance of the traditional RED. This study is conducted based on fluctuations among the rate of service, the queuing weight, and the mean queue length by using open-source network simulator NS3. The study shows efficient results by fluctuating end-to-end packet throughput and fast response to the inception of congestion in the network. The modified algorithm achieves a low level of loss packets by evaluating the results with the default RED algorithm and ARED, which is done by increasing the algorithm’s response when the average queue size becomes close to the maximum queue length threshold.