# An Improved Routing Approach for Enhancing QoS Performance for D2D Communication in B5G Networks
## 1 Introduction  
The demand for the internet is growing exponentially as the world is moving towards the digitalization era. Billions of physical devices around the world are connected to the internet, collecting and sharing data information. This is known as the Internet of Things (IoT) [1; 2], which facilitates smart homes, smart cities, smart grid, and industrial automation, as well as healthcare, environmental, and transportation monitoring. IoT transfers enormous data information over a network independent of human action. Future 5G networks will handle these data and information by providing greater connectivity, higher data rate, ultra-low latency, greater energy efficiency, and greater spectral efficiency [3; 4]. However, 5G networks utilize the mmWave radio frequency range for data transmission, and, thereby, the signal transmission range is limited to only a few hundred meters [5; 6]. In this case, D2D communication is a prevalent emerging technology that extends network coverage and provides seamless connectivity for peer-to-peer users in 5G networks [7; 8]. This technology provides opportunistic spectrum utilization, enhanced spectral efficiency, high data rate, and reduced network congestion [9; 10]. In D2D communication, users in close proximity establish the network infrastructure partially with or without the involvement of cellular base stations. The source device uses the relay devices to forward data packets to the destination device in D2D communication. Meanwhile, in an orthodox mobile network, all device users are directly connected to the base station through a wireless radio medium [11; 12]. Consequently, the performance of D2D technology may become worse if the relay devices are not selected via a proper mechanism. Therefore, data packetrouting is a significant task in D2D communication over IoT-based 5G networks [13; 14]. The application of a D2D communication scenario over IoT-based 5G networks is depicted in Figure 1.  
Researchers around the globe have proposed various routing mechanisms to provide better QoS performance for D2D communication [15; 16; 17; 18]. Mobility, battery, link quality status, and contention window size of relay devices are the main challenges that occur during the optimal route selection. First, the network topology is changing in an unpredictable manner due to the devices moving in the network from one place to another. It adversely affects the network stability, leading to the packets being dropped in the network. Second, all of the devices operate with limited battery capacity; the system is dead once the battery is down. Moreover, the link quality status of the established routes conversely affects the device movement within the network. Third, data packet traffic congestion occurs in the relay devices, owing to the simultaneous data packets being sent from the source to the same channel. All of the challenges mentioned above should be considered during the optimal route selection in order to enhance the QoS performance of D2D communication technology. Figure 2 illustrates six relay devices (2, 3, 4, 5, 6, and 7) between the source (1) and destination (8). Each relay device has different mobility, battery, link quality status, and contention window size status. Thus, selecting the best relay devices in terms of robustness and optimal route reliability is crucial.