Wireless sensor networks (WSN) have been investigated as a powerful distributed sensing application to enhance the efficiency of embedded systems and wireless networking capabilities. Although WSN has offered unique opportunities to set the foundation for using ubiquitous and pervasive computing, it suffered from several issues and challenges such as frequently changing network topology and congestion issue which affect not only network bandwidth usage but also performance. The main objective of this study is to introduce a congestion-aware clustering and routing (CCR) protocol to alleviate the congestion issue over the network. The CCR protocol is proposed to decrease end-to-end delay time and prolong the network lifetime through choosing the suitable primary cluster head (PCH) and the secondary cluster head (SCH). The experimental results demonstrate that the effectiveness of the CCR protocol to satisfy the quality of service (QoS) requirements in increasing the network lifetime and raising the number of packets sent alike. Moreover, the CCR outperforms other state-of-the-art techniques in decreasing the overflow of data, and thus the network bandwidth usage is reduced.INDEX TERMS Congestion control, clustering protocols, pervasive computing, quality of service (QoS), routing protocols, ubiquitous computing, wireless sensor network (WSN).