Survey on Device to Device (D2D) Communication for 5GB/6G Networks: Concept, Applications, Challenges, and Future Directions

Device-to-device (D2D) communication is one of the most promising technologies in wireless cellular networks that can be employed to improve spectral and energy efficiency, increase data rates, and reduce links latency. This paper investigates fifth generation and beyond (5GB) networks, the basics of D2D communication, applications, and classification. Herein, D2D in in-band (IBD) and out-band (OBD) modes are discussed. This paper also presents the integration of D2D communication with other prominent technologies and demonstrates the importance of integration with possible solutions in improving network performance. We further investigate the challenges of D2D communication, opportunities, and future research directions of D2D in 5GB networks. In addition, D2D communication in 6G network challenges and open research areas are introduced.


I. INTRODUCTION
Mobile wireless communication demands for higher data rates, lower energy consumption, low latency, coverage area, as well as efficient spectrum sharing are rapidly increasing day by day. The number of connected devices is estimated to be over 50 billion in the year 2020 [1]- [3], in which mobile data traffic is projected to grow monthly from 13.8 in 2017 to 110 Exabytes (EB) till the end of 2023 at a compound annual growth rate (CAGR) of 42% based on the Ericsson report [4]. All these issues should be resolved to provide and support the demands of the upcoming fifth-generation (5G) The associate editor coordinating the review of this manuscript and approving it for publication was Stefano Scanzio . and beyond (5GB). 5G was expected to launch in 2020 with a very high data rate and quality of services (QoS), and it aims to offer a 1000-fold rise in the total throughput. Moreover, in order to achieve a ten-fold increase in individual link throughput over the previous fourth-generation (4G) wireless networks [5], [6], various technologies are suggested to be considered in order to fulfill 5GB requirements such as an ultra-dense network (UDN) with machineto-machine (M2M) in heterogeneous networks, in addition to millimeter-wave (mm-wave), massive MIMO, virtualization of wireless resources, visible light communication (VLC), energy harvesting, and cloud-based radio access network (C-RAN) [7]. A novel physical technology such as VLC has been suggested to deliver high data rates, where a and 6G networks is missing in the literature. TABLE 1 shows a summary of comparison for the existing surveys with this paper.
The main contributions in this paper include: • An investigation of D2D communication concepts in 5G networks, in which its classifications and various applications were discussed.
• A review of the capability of D2D communication and other recent technologies integration is provided, for the first time, to the best of our knowledge. These technologies include C-RAN, mm-Wave, IoT, VLC, UDNs, and UAVs. In addition, a discussion of the benefits of their integration to support 5GB networks are provided.
• Various D2D communication challenges and possible solutions review are provided, with future research trends suggestions.
• To the best of the author's knowledge, this is the first review of D2D communications in the context of 6G which presents critical requirements for its success and outlines expected research directions for 6G.
The rest of this paper is organized as follows: Section II shows the concept and classification of D2D communication. Section III presents the application of D2D communication technology. Then, integrations between D2D and other technologies in 5GB networks are discussed in Section IV. Section V illustrates the challenges and possible solutions for further development in the future. After that, Section VI describes the D2D in 6G and critical requirements for a successful 6G network. The lessons learned and key findings with suggestions for future research are demonstrated in Section VII and Section VIII, respectively. Lastly, conclusions are presented in Section IX.

II. D2D COMMUNICATION CONCEPT AND CLASSIFICATION
In the past decades, the transmission of information between devices could be performed by utilizing an electrical connec-tion to transfer information through physical cables and connectors. However, due to some challenges raised by multiple connectors, radio frequency (RF) technology was employed to overcome these challenges. Thus, information was transmitted without human intervention, where RF signals traveled from and to the mobile user in the transmitter's side to the base station (BS), and then BS relayed these signals to the other mobile user at the receiver's side, which is standard in any typical cellular network as illustrated in [41]- [43]. After that, due to spectrum limitations of RF technologies in the cellular network, D2D communications have been proposed to handle Internet and mobile calls data traffic without any additional load to the core network [3], [44], which means direct communication between devices would be established without relaying the signal through the BS or core of cellular network as demonstrated in Fig.2.
A direct connection between two devices (i.e., mobile, tablet, PC, etc.) underlaying cellular network represents a simple concept of the D2D communication mechanism, in which it could be classified based on spectrum utilization into in-band and out-band communication, as briefly demonstrated with different classification modes in Fig.3 [19], [45].

A. IN-BAND D2D COMMUNICATION
The motivation for selecting the in-band D2D (IBD) communication was its high ability to control a licensed spectrum; however, it suffers from interference between D2D users and cellular networks [45], [46]. Furthermore, it is also considered as one of the 5G technologies with spectrum efficiency that could be improved through reusing the frequency and time resources by the D2D users, in which resource sharing or allocation between D2D users could be performed in two ways, namely; underlay and overlay modes [43].

1) UNDERLAY MODE
In underlay mode, the D2D and cellular communications share the same wireless resources, as illustrated in Fig.4,  where it could improve cellular coverage, spectrum efficiency, and energy efficiency. This is accomplished by utilizing several techniques through the network that comprises of resource allocation, interference mitigation, and diversity techniques [43]. Therefore, direct D2D communication underlay mode could offer high spectral efficiency as well as low latency for an end-to-end connection and physical link proximity, thus making it a possible solution for achieving the requirements of 5G.

2) OVERLAY MODE
In overlay mode, D2D and cellular communications are given a dedicated portion of the wireless resources so that cellular links are not influenced by D2D links [47]. Nevertheless, interferences between D2D links remain present. The cellular band or spectrum potion of overlay is shown in Fig.4.

B. OUT-BAND D2D COMMUNICATION
The out-band D2D (OBD) communication is another exciting and attractive area for many researchers today since it uses an FIGURE 5. Cellular band and ISM band distribution for OBD [48]. unlicensed spectrum utilized in various industrial, scientific, and medical (ISM) applications. Besides, it is considered a 2.4G technology, making it difficult for interference to occur between cellular and D2D communications, as seen in Fig.5. However, the OBD suffers from an uncontrolled way of unlicensed spectrum [43], [49]. To employ the unlicensed spectrum band, an additional interface that performs Wi-Fi direct, Bluetooth, or Zig-Bee is a must. OBD communications are classified into two modes, based on other interface occurrences, namely controlled and autonomous modes, which are briefly illustrated as follows:

1) CONTROLLED MODE
In this mode of OBD communication, the cellular network or base station will be controlled by radio interfaces. In previous studies, cellular networks have employed advanced management techniques that can improve the reliability and efficiency of D2D communications [19], [43], and improve the system performance in terms of power efficiency and throughput. TABLE 2 shows IBD and OBD comparisons.

2) AUTONOMOUS MODE
Alternatively, this mode does not require any changes at cellular networks or base stations. It could be easily deployed, which means that autonomous D2D interfaces could be coordinated by users, resulting in cellular network overhead mitigation [19]. These autonomous D2D interfaces could be Bluetooth or Wi-Fi direct.

III. D2D COMMUNICATION APPLICATIONS
D2D communication can be employed in several short range applications, including video streaming, (M2M), data and voice, and emergency network, as illustrated in Fig.6. Furthermore, D2D can be used in online gaming, multicasting, local advertising, cognitive-communication, cooperative communication, and the Internet of things (IoT) [35], [50]- [52].

A. DATA SERVICE AND LOCAL VOICE
The transfer of data service between two devices within D2D coverage areas can be achieved via D2D communication. An increase in data rate and latency reduction could be acquired through D2D technology deployment [50], [53]. Additionally, voice chat services could be supported within narrow proximity coverage areas such as cubicles, big halls, or can deliver to nearby devices. Therefore, local voice transmission through D2D technology could improve network performance in terms of data rate, QoS, and latency in a manner that could overcome real-time voice transmission limitations [54]- [56].

B. VIDEO STREAMING
According to Cisco, video sharing through the Internet is projected to take up over 90% of internet traffic in the near future [57]. Video streaming involves transferring data or contents in a compressed form via the Internet in real-time, which results in watchable content without the need to wait for a completely downloaded video file [50]. However, Pointto-point (P2P) technology has the potential to allow all users to share their videos through direct communication, cellular network, and offloading, as illustrated in Fig.7 (step 4) [58]. It offers an alternative improved method of video streaming.
Alternatively, D2D technology is better than conventional cellular networks in sharing video streaming, video conferences, and video chat between devices within the same cellular or adjacent networks nearby. According to future network requirements for video streaming, the quality of experience (QoE) is strongly influenced by video quality adaptation. Therefore, a new quality adaptation technique was proposed for scalable video in D2D communication network [13]. In addition to an extensive survey, a discussion on video transmission and QoE was conducted in studies [59], [60], which handled challenges and proposed possible solutions to enhance the video quality and manage interferences between cellular links and D2D links.

C. MACHINE TO MACHINE
M2M communication is considered one of the promising technologies for M2M telemetry, which involves devices and objects with communication and computing capabilities without the need for human connection [50], [61], [62]. M2M is often utilized to monitor certain automatic transmissions of data collected from remote sensors to a central unit to be analyzed. This is achieved by software agents or human beings, as shown in Fig.8. M2M technology has many applications, including, but not limited to, car automation, smart houses, environment monitoring, industrial automation, military operations, etc. Furthermore, M2M machines are often positioned near each other in many applications to deploy D2D connections within a building [63], [59]. Implementing a direct D2D route in M2M technology will result in load distribution and delay reduction in deployed networks. Moreover, a cognitive M2M could be employed to maximize energy efficiency [64] by utilizing a recently developed joint optimization algorithm that features power control, peer discovery, channel selection, and time allocation problem.

D. EMERGENCY NETWORKS
The urbanization in both developing and developed worlds are increasing rapidly. Currently, more than 50% of the population is concentrated and lives in cities. Globally, this percentage is expected to grow rapidly in the upcoming decades. Therefore, flexible and reliable communication networks in dense urban areas must secure global cities from unfortunate terror attacks, such as the New York City 9/11 catastrophe and 7/7 metro bombings in London [65]. Furthermore, in the event of natural disasters and during search and rescue operations, base stations are often shut down or overloaded, and could only provide limited services for a specific limited number of users or equipment. Hence, in emergencies, D2D-  based-technology networks could provide temporary broadband services for emergency workers, doctors, and nurses to access patients' data, in addition to reporters and journalists to cover news and quickly disseminate government emergency announcements in a timely and orderly fashion [50], [66]. Moreover, unmanned aerial vehicles (UAV) were proposed as an emerging approach to deploy emergency networks in the case of damaged network infrastructure [67]. Fig.9 shows a large number of D2D devices that communicate with each other in a small network, in which this small network can relay the data to other remote devices through a UAV deployed emergency network.
Although public safety, traffic officers, national security, and disaster management are heavily flooded by D2D communications, it could be further extended to cover a wide range of applications such as smart parking in smart city scenarios, smart grids, social networking, and smart homes, etc. Alternatively, D2D and IoT technologies combination VOLUME 10, 2022 or hybridization is an emerging approach that could potentially be utilized in intelligent Internet of Vehicle Things (IoVT), Internet of Medical Things (IoMT), e-medicine, quick disaster relief action, cloud computing, and proximity services [11]. Fig.10 presents a general overview of the D2D communications system with IoVT, IoMT, traffic, and public safety.

IV. INTEGRATION OF D2D COMMUNICATION WITH RECENT TECHNIQUES
Rapid advancements, growth, and innovations in mobile communications technologies result in a higher number of heterogeneous cellular networks. Recent advancement in cellular networks is the introduction of very-high-speed 5G technology to the mobile market. Therefore, newly-introduced 5G networks and beyond would comprise all types of advanced technologies that offer remarkable services. D2D underlay cellular network is an advanced technology that could offer improved energy efficiency, increased capacity, and many other advantages due to its cellular network traffic offloading capabilities. However, it faces many challenges at the same time [68], [69]. To overcome all these challenges as well as enhance the network performance, we investigated the integration and combination of D2D communication with other advanced technologies such as the IoT, VLC, UDN, etc. Fig.11 illustrates the most prominent technologies that can be integrated with D2D communications to support 5GB networks. A brief introduction of these technologies is presented in the following section.

A. CLOUD RADIO ACCESS NETWORK
Cloud radio access network (C-RAN) is a promising access network technique that could be employed to address increased mobile traffic and optimize network performance [70], [71], in addition to scalability and heterogeneity management of upcoming wireless networks. C-RAN has a centralized object that aids in advanced joint mobility and radio resource management, which can reduce the interference and increase data rate as well [72]. The uplink and downlink scenarios for C-RAN were investigated [73], [74], where different frameworks and strategies were implemented to improve its capacity and optimal outage probability was obtained. Although C-RAN has many advantages, it also suffers from a few drawbacks, such as link delay, one of its major inherent issues. To avoid this issue, a new D2D-Communication-based combination paradigm was proposed in [75].
D2D and C-RAN technologies combination does not only play a significant role in solving the delay issue, but it could also fulfill most of 5G requirements in terms of cost, delay, capacity, mobility, and energy efficiency [75]. Both D2D and C-RAN have been investigated to optimize resource allocation and mode selection simultaneously in [76], [77], which resulted in higher throughput. D2D can be enabled in C-RAN to improve QoS as well as minimize transmitted power in [78]. Also, C-RAN-based-D2D could be employed to manage resource allocation for 5G heterogeneous networks [79], [80]. The performance evolution of D2D-C-RAN based network in 5G heterogeneous UDN has yet to be investigated. More studies are required to ascertain its fulfillment of the 5G requirements. Moreover, new algorithms for delay reduction in hybrid D2D-C-RAN network is needed to improve the performance in terms of interference, optimal outage probability, throughput, QoS, etc.

B. MILLIMETER-WAVE
The electromagnetic spectrum is becoming more and more congested; as a result, its resources have become sparse due to the massive applications demand, which occupies most of its remaining frequency bands. Therefore, moving to millimeterwave (mm-Wave) bands has become a necessity for the large unused bandwidths [81], [82]. The mm-wave spectrum is described by an extremely high-frequency band (EHF) and ranges from 30 to 300 GHz. These bands could support 5G networks with a possibility of obtaining 1000 folds the capacity compared to 4G solutions [76], [81]. Employing D2D communication in micro-wave bands suffers from high interference and insufficient bandwidth [83]. Therefore, enabling D2D in an mm-wave band is another possible solution to those problems.
Mm-wave provides low latency and high data rate; however, it suffers from inefficient power consumption and propagation shortcomings [84]. To overcome these challenges, power consumption could be improved by D2D communication integration with mm-wave technology as introduced in [85], which resulted in improved energy efficiency. This integration provided high data rates, low interference as well as improved power consumption [86]. In addition, the outage probability and data rates were investigated for a combination of both and based on various mm-wave parameters [86]. A new optimization problem formula has also been implemented to investigate resource and power allocation of D2D and mm-wave integration in [87]. Besides, An extensive survey about integrating both technologies has been done, which covered cooperative communication, caching, scheduling techniques, beamforming, and their possible solution approaches [88], [89].
Moreover, both technologies suffer challenges such as blockage modeling, heterogeneous networks, and densification. Despite all mentioned challenges, there are great chances for integrated D2D communication with mm-wave to become a promising solution form many issues relating to VOLUME 10, 2022  5G and beyond. The integration of both technologies opens areas for researchers in the academia and industry to realize and investigate D2D communication integration in the mmwave spectrum band.

C. INTERNET OF THINGS
Internet of things (IoT) is an emerging technology used to create an integrated ecosystem for various devices to communicate with each other via the Internet [2]. Therefore, similar to the method that humans utilize in the Internet, devices are the major users in the IoT ecosystem [90]. The fast growth of smartphones plays a significant role in supporting IoT technology and it has gained a strong interest by many due to its features that can support the creation and the development of various services and applications. Moreover, D2D and IoT technologies integration have the potential to satisfy upcoming 5G requirements, especially in terms of system capacity, latency, or delay, as well as spectral efficiency [51], [91]. Two interference management techniques termed as cooperative pairing (CooP) and fixed power margin (FPM) have been investigated to improve the outage probability and QoS requirement for the combined D2D and IoT ecosystem [92]. The role of D2D communication in the development of the IoT ecosystem was extensively discussed, where the past, current status, and expected future issues were also presented [93]. Fig.12 shows the integrated D2D communication with 5G IoT networks [94].

D. VISIBLE LIGHT COMMUNICATION
RF technology suffers from capacity crunch, interference, and other constraints, that affect the performance of the communication system. In order to avoid some of these constraints, a new technology named VLC was introduced [95]- [97]. VLC features a high bandwidth that could reach up to Terahertz (THz), in addition to low power, license-free deployment, and interference immunity [98], [99]. TABLE 3 provides a comparison between VLC and RF technologies [100], [101]. Similar to D2D communications, VLC system has limited coverage distance. Therefore, both technologies would be suitable for indoor applications; such scenarios can produce high capacity and high data rates.  The hierarchical game method was utilized to investigate resource allocation for a hybrid D2D and VLC in heterogeneous networks [96]. It was shown that hybrid RF-VLC in D2D communication network achieved improved performance in terms of capacity crunch in indoor environments [102]. Furthermore, an RF-VLC D2D system maximized the capacity of RF D2D communication and VLC D2D communication systems with rates of 4.1 and 1.5, respectively [103]. Fig.13 illustrates a hybrid VLC-RF link in a D2D communication system, where device user equipment (DUE) represents the device user equipment, T and R denote the transmitter and receiver, respectively.
The mobility management of combined D2D communication with hybrid RF/VLC bands has been investigated in [104], [105]. The combination of all these technologies could improve system capacity and overcome the overcrowded RF bands [10]. Therefore, new algorithms were developed for D2D communication to switch from RF to VLC and vice versa based on average energy efficiency, sum capacity, and outage ratio.

E. ULTRA-DENSE NETWORK
Currently, researchers are discussing and investigating the potential of combining ultra-dense networks (UDNs) with various technologies in order to fulfill the extraordinary capacity requirement of 5G [106], [107]. The distribution of ultra-dense small cells instead of conventional macrocells VOLUME 10, 2022 in the coverage area is known as UDN. However, UDN introduces new challenges that need to be solved, such as interference, degraded QoS, and high energy consumption. To overcome these challenges, UDN should be integrated with other technologies such as D2D communication. Fig.14 shows a simple combination of UDN and D2D communication, in which different cell sizes such as macrocell, femtocell, and picocell are distributed to enhance the rising number of devices or user equipment (UE) [108]. Moreover, the UE or devices located at cell edge that lacks connectivity, due to coverage limitations, require a relayer for incorporation and connection with the D2D communication cell.
Although UDN has interference challenges, QoS, and other constraints, it could improve the performance of the network and increase its capacity 100-fold [109]. Furthermore, D2D communication integration is a significant factor in saving energy consumption due to the massive cell distribution within UDN [108]. Besides, it can provide support for other solutions that could overcome the challenges to satisfy the requirements of 5G and beyond.

F. UNMANNED AERIAL VEHICLE
In remote, disaster-affected, and rural areas, it is often difficult to build wireless networks due to challenging terrain or lack of infrastructure. However, unmanned aerial vehicles (UAVs) could be immediately deployed to establish a D2D authorized wireless network with high QoS, which make them a promising technology for emergency scenarios [110]- [112]. Alternatively, D2D communication plays a significant role in improving the performance of UAV in terms of capacity and coverage expansion with proper communication in wireless cellular networks [113].
Potential challenges of integrating UAVs and D2D communication networks were investigated in [54], in which the employment of dynamic multi UAVs was explored. Moreover, a 3D resource sharing between D2D and UAVs was investigated to improve the spectral efficiency of cellular networks in [114]. Besides, in [115], the authors proposed and evaluated the performance of a couple of mode selection schemes for D2D-enabled UAV-based wireless networks, where they utilized received signal strength threshold and average distance threshold to improve signal quality and connectivity in the case of emergencies. Furthermore, D2D communication and caching technologies were employed to mitigate UAV-assisted cellular network traffic [116]. Besides that, trajectory optimization and analysis of cache-enabled UAV-assisted cellular networks based on D2D communication underlay were discussed, in which the dynamic and static UAV deployments were considered. Although both UAV and D2D technologies have various advantages and could be promising candidates for 5GB network fulfillment, their high mobility and dynamic topology, when combined, could hinder the performance of allocation algorithm in a conventional channel, in addition to interference, energy consumption, and a limited number of available orthogonal channels for resource allocation. The development of new algorithms and optimization solutions for these issues have yet to be resolved and remain an attractive problem to be researched in the future, along with the potential use of UAV as a portable energy source, due to its flexibility.

V. CHALLENGES AND POSSIBLE SOLUTIONS FOR D2D COMMUNICATION IN 5GB NETWORKS
As discussed previously, D2D communication presents a novel paradigm and standard that could be incorporated in contemporary mobile cellular networks, in which it can facilitate improved data exchange between proximate devices. Network performance improvements are continuously needed. Therefore, mobile operators are consistently developing technologies that support close-proximity services by advancing D2D communications technologies [28].
The taxonomy challenges for the D2D communication technique in 5GB are as demonstrated in Fig. 15. It includes the different parameters which categorize the available literature in D2D communication networks. The taxonomy includes six divisions, each of which displays various parameters, their sub-divisions, and the related literature. The parameters on which the category is done are resource allocation of the radio spectrum, interference management, compatibility between devices in heterogeneous networks, mode selection, security, and mobility.
Resource allocation for D2D communication in 5GB is either underlay or overlay, and both are categorized as centralized, distributed, and semi-distributed. It is also managed by various algorithms and optimization problems [117]- [119]. Interference is classified into interference cancellation, interference coordination, and interference avoidance [26], [120]. Furthermore, interference cancellation is divided into three types known as SIC, PIC, and IIC. Various mechanisms are employed for interference avoidance, which includes mode selection, joint power control, transmit power control, joint resource allocation, and MIMO techniques.
Heterogeneous network is categorized into access mode, cell type, and network model based on the past works [121]- [123], and each category involves sub-branches. Mode selection in D2D communication is classified based on transmission modes and control. Both of them are divided into sub-division as discussed in [124], [125].
Security is categorized into requirements, threats, and solutions. The requirements are discussed, which contain C\I, Au, FAC, Pr, Re, A\D, and NR [126], [127]. Besides that, vulnerability classifications include physical attacks, negotiated IDs, configuration attacks, protocol attacks, attacks on core networks, and user data and privacy attacks [28], [126], [128]. Four types of security solutions are classified, namely secure routing, access control, physical layer security, and authentication, and key management [126]. The mobility management contains joint handover, half handover, and sidelinkassisted handover [27], [104], [129]. All these challenges and possible solutions for D2D communications in the context of 5G networks and beyond are discussed in the following subsections. Also, some notable methods with the ability to solve D2D communication challenges were investigated, along with in-depth technical discussion that includes objectives, contributions, mechanisms, and results (see Table 4).

A. RESOURCE ALLOCATION
Radio resource allocation is an essential element in maintaining and creating direct connections between D2D pairs under cellular networks [32], [130]. The advantages of D2D radio resource allocations are flexibility, ubiquitous availability, low latency, and low cost [51]. Spectrum sharing between D2D users and cellular user equipment (CUE), mainly within in-band mode, can improve spectral and energy efficiency by managing co-channel interference [30], [131], [132]. Another novel technique is sparse code multiple access (SCMA), which was utilized in D2D communications for 5G networks paradigm to improve resource and power utilization in hybrid cellular networks [133]. However, security issues and fairness of communication have yet to be explored. Meanwhile, various resource allocation methods with different performance objectives were investigated in [51], [134]- [136]. For future directions, effective resource allocation techniques are needed to satisfy the requirements of 5G and beyond to achieve minimized signaling overload in the cellular network (base station), obtain acceptable user data rates, maximize network throughput, and meet QoS demands.

B. INTERFERENCE MANAGEMENT
Interference from cellular users (CUs) is one of the primary impairments influencing D2D communication. Reuse of cellular network resources and, therefore, the coexistence of CUs and D2D pairs will lead to elevated interference problems. D2D user experience often suffers from two types of interference; intracell and intercell interference. Both depend on operation modes of the D2D network and could occur in uplink or downlink scenarios [31]. They can obstruct successful transmissions through signal to noise ratio (SNR) reduction at the receiver end and result in decreased QoS as well. Transmitted power as a reduction technique is usually implemented to mitigate the effect of UEs interferences. However, it results in a QoS tradeoff at the receiver end.
Various interference management techniques have been discussed and proposed in previous studies, including interference coordination, interference avoidance, and interference cancellation. Moreover, transmissions scheduling, hybrid automatic repeat request (HARR), coding, and modulation techniques are also implemented to improve the robustness of the signal against noise and mitigate unwanted interference [32]. Research in the approaches mentioned above remains active.
The future direction of interference management of D2D in 5G networks concentrates on the power control and interference mitigation techniques, and both can lead to improved energy utilization, which is one of the essential aims of the future generation of wireless networks.

C. COMPATIBILITY BETWEEN DEVICES IN HETEROGENEOUS NETWORK
5G communication focuses on IoT and D2D technologies for various applications such as connected smart cars, active monitoring, smart houses, connected e-health, VOLUME 10, 2022    smart wearables, etc. Hence, in order to establish an efficient connection and acquire compatibility among all these different devices, a D2D heterogeneous network is needed to support multiple communication systems diversity [121], [122]. A new design of a heterogeneous wireless network between Bluetooth low energy (BLE) and Wi-Fi with a high data rate (HaLow) was studied in [160], which was achieved through a vertical handover scenario. Both BLE and HaLow technologies work on different frequency bands, and the coexistence of both diverse networks does not require an interference avoidance mechanism.
Future research will be focused on establishing a fully reliable communication link between different devices in diverse networks, which requires new transportation and translation protocols to develop a unified compatible global system, in which data sharing between various D2D users in the IoT ecosystem in UDN is facilitated.

D. MODE SELECTION
Mode selection (MS) is a critical issue in D2D communication and is an efficient method that improves energy efficiency, network throughput, and reduces interference [161], [162]. It determines whether D2D users could operate under a direct mode or cellular mode, and it could select static or dynamic time scale [163]. The selection of communication mode for DUEs is a flexible process when DUEs select the D2D mode; the latency can be reduced, and a higher spectrum resource utilization could be achieved [161]. Different DUEs model selection and algorithms have been investigated for D2D heterogeneous networks for various aims [125], [161], [164]. Three D2D communication modes can be allocated by the base station (BS) to every D2D pair, which comprises of direct D2D, local route, and relay D2D. A new optimal MS algorithm was proposed to maximize the capacity and cellular coverage in [165]. Also, the effect of MS on the adequate capacity of D2D communication has been investigated in [166]. The development of optimal MS algorithms is an area of interest for future research directions, which not only could obtain maximum capacity, but also improve spectral efficiency and reduce system interference.

E. SECURITY
Nowadays, D2D communication network security has attracted attention due to the nature of data distribution across communication networks. D2D pairs can distribute sensitive information and data related to identifying the users and additional personal details [31], [126]. This information should be secure and safe to prevent any impersonification, eavesdropping, IP spoofing, denial of service, and malware attack by hackers for illegal purposes [32]. Accordingly, network security protocols were developed in D2D networks, which enable users to avoid information leakages.
Dynamic readjustment of D2D users due to mobility is a significant issue in establishing secure D2D communication networks. New and old D2D users may join and leave the coalition, which requires an adaptive mechanism for D2D communication security [126]. Moreover, a novel technique that utilizes interference signals as an impediment for security was introduced in [167], [168]. This was done by obstructing the eavesdropping device. Different security models and algorithms were designed to measure the security workload on heterogeneous mobile devices [169]- [171]. Besides that, an in-depth survey on security design aims was introduced in [126], [157], [172]. The survey included authentication, secure routing, key management, physical layer, access control, and additional security issues. However, many security problems remain to be discussed, which may open up many research directions in the future, and great efforts must be met to ensure D2D security.

F. MOBILITY
The users are mobile in cellular networks, and communications are automatically activated and dropped based on the D2D user's relative position. However, most research related to D2D communication concentrated on static users [173], [174]. Smart mobility solutions were proposed to mitigate the network overhead due to signaling and enhance the D2D end-to-end (E2E) latency through maximizing the time when the DUE is controlled by the small cell itself [153]. More investigation is required to explain how D2D performance increases in dynamic scenarios, and what handover and interference in the treating mechanism are needed as D2D users move across and within cells. Also, the relay or multihop D2D communication poses many challenges.

VI. FUTURE OF D2D COMMUNICATION IN 6G NETWORK
The sixth-generation (6G) of mobile communication is expected to launch commercially in 2030, which will allow the Internet of Everything (IoE). This will revolutionize the lifestyle, intelligent mobile society, personal life, and communication and business systems. 5G and beyond will perhaps not be able to attain all IoE requirements [175]- [178], and this will push researchers towards looking for solutions that can meet higher demands in 6G. Many researchers in academia and industrial fields have already started visioning, planning, and aggregating requirements of 6G technologies. Also, many countries, such as China and Finland, have already begun research on 6G topics. TABLE 5 shows a comparison between 5G and the possible capabilities of future 6G.
The challenges and problems of 6G are mainly focused on energy and spectrum efficiency, capacity, and system coverage, besides movement speed and user data rate [181]. Therefore, to solve these challenges, some key technologies and novel approaches for 6G and beyond were presented, as shown in Fig.16 [176], including network slicing (NS), cognitive network (CN), mobile edge computing (MEC), Terahertz communication (THz). In addition to other technologies such as non-orthogonal multiple access (NOMA), intelligent reflecting surfaces (IRS), etc. [182].
Moreover, to fulfill the requirements of 6G, artificial intelligence (AI) will be one of the innovative techniques that can be employed to obtain maintenance, intelligent automated network processes, and management of future heterogeneous and complex 6G networks. Driven by AI techniques, D2D communication will become one of the most critical technologies in 6G networks and will play a significant role in reducing power consumption, delay, as well as improving spectrum utilization and data rate [177], [182]- [184].
Therefore, to create an efficient, intelligent D2D communication (ID2D) in the future 6G, several possible D2D communication solutions are illustrated in Fig.17. Incorporation of ID2D communication in complex 6G networks demands the potential integration of D2D with the advanced technologies mentioned above.
The efficient implementation of ID2D may require the development for at least the following techniques.

A. D2D BASED TERAHERTZ COMMUNICATION
Over the past few years, carrier frequencies that operate for wireless cellular communications have been growing to meet bandwidth requirements [185]. Researchers have proposed high frequencies, such as mm-Wave and optical wireless communication (OWC), to fulfil the exponential growth of data rate requests and to pave the route towards 5GB and 6G networks.
Terahertz (THz) frequencies (0.1-10 THz) are a promising prospect to support 5GB/6G with ultra-broadband, thus closing the gap between OWC and mmWave frequency ranges. It has been expected to provide high data rates reaching up to several Tbps, along with low latency [186], [187]. The THz can be applied in several applications, such as space communication networks, wireless mobile communication, 3D beamforming technology, wireless data centres, and automotive applications. The development of antennas using new materials and novel transceiver architectures can lead to the reality of THz communication.
A theoretical model was designed for D2D communication in THz band, which improved energy efficiency and data VOLUME 10, 2022  [176], [177], [179], [180]. rates [188]. A statistical 2D geometrical model was devised for short rage D2D communication in THz band. A subsequent simulation was executed to verify the measurement of the proposed setup in terms of power delay profile over excess delay [189]. Both D2D and THz have been used in indoor environments due to their restriction of transmission distances. Therefore, the integration of both technologies may cater to the upcoming 6G requirements. For future imple-FIGURE 16. Key technologies and novel approaches for 6G and beyond [176], [180]. mentation of D2D in THz band, some key challenges of THz should be weighed in for improvement purposes. These challenges include hardware circuits of THz RF equipment, THz antennas, and THz modulator.

B. D2D-ENABLED INTELLIGENT NETWORK SLICING
The 6G networks are expected to advance flexible multi-services with a range of specifications. The division of a physical network into various virtual networks is known as network slicing (NS) [190]. It can be deployed in vehicular applications that demand high reliability, low latency, and maximum network capacity. Besides, NS is expected to reduce operational and system capital expenses, as well as offloading the core network.
The NS is the most important technology to address the variety of D2D-based services, whereby these devices can communicate with multiple NSs or specific services simultaneously [38]. The integration of NS with D2D has been envisioned to improve the system performance in several huge numbers of connected devices in varied applications. Some challenges affect the integration of D2D with NS, thus degrading the performance of the system network including interference and resource management, as well as new slice creation techniques. These challenges are bound to open the way for researchers to develop new techniques and tools for further enhancement.

C. D2D BASED COGNITIVE NETWORKING
The AI is envisioned to obtain such cognition to wireless cellular networks. The spectrum access, capacity enhancement, and energy optimisation are the most significant factors that fulfil networks beyond 5G due to the daily demand for high data rate and the number of connected devices. A cognitive network (CN) refers to automatic network management that applied the available resources adaptively in a highly efficient manner [191]. These CNs have the potential to offer robust and adaptive communication systems through their capability to analyse and monitor the present state of the network, as well as high bandwidth. Most studies have looked into use of D2D in cellular networks with minimum interference, while research work that has incorporated D2D and CN to optimise spectrum utilisation and energy efficiency is in scarcity.
The integration of D2D with CN has been implemented for underlay cellular networks to improve spectrum efficiency and QoS [192], [193]. Besides, several models of cognitive D2D communication have been proposed to enhance energy harvesting. The incorporation of D2D with CN in 6G ecosystem is expected to offer better D2D performance, while concurrently supporting various kinds of services and applications.

D. D2D BASED INTELLIGENT REFLECTING SURFACES
In conventional wireless cellular systems, the transmitter delivers radio or electromagnetic signals to the receiver through an uncontrollable propagation atmosphere. For 5GB and 6G networks, there is fast-growing attention to develop real-time reconfigurable propagation atmospheres that enhance the communication between transmitter and receiver. This involves distributing special surfaces called intelligent reflecting surfaces (IRS) [194], [195]. The IRSs can change and control the direction of the transmitted signal using low-cost passive devices, such as phase shifters and printed dipoles [196]. The IRS is a promising candidate technology for 6G networks, mainly because it offers high energy and spectrum efficiencies, robust security, and optimum beamforming, apart from its usage in other novel 6G applications [197].
The integration of D2D with distributed IRS is detailed in [198] to improve the transmission rate of D2D pairs, whereby significant results were reported. The IRS facilitates D2D communication based on a two-timescale optimisation algorithm by minimising the co-channel interference between D2D devices and cellular users (CUs) [199]. The IRS-based D2D communication is bound to improve wireless networks performance in 6G by smartly reconfiguring both transmission direction and atmosphere.

E. ID2D-ENHANCED MOBILE EDGE COMPUTING
Since the past few years, cloud computing (CC) has transformed the topography of information technology and turned the long-term pledge of utility computing into a truth. However, CC has failed to meet the requirements of mobility support, location awareness, and low latency [200]. Mobile edge computing (MEC) is in proximity to end-users (BS), supports mobility, and has the ability to solve the aforementioned problems. The MEC allows billions of interconnected mobile devices to conduct real-time compute-intensive implementations instantly at network edges (i.e., BS). Besides, MEC offers CC capabilities and IT service environment, which can enhance security and save mobile energy [201], [202]. The integration of D2D with MEC technologies to minimise energy consumption has been addressed in [203], whereby low complexity algorithm was initiated to overcome latency constraints.
A novel ultra-dense D2D structure for 5G MEC was proposed to enhance energy efficiency. By jointly integrating and sharing communication resources and heterogeneous computation between mobile devices, ultra-dense D2D enables a wide range of services and novel applications that require hybrid types of resources [204]. An integrated framework of D2D and MEC using OFDMA has been designed for interference management and partial offloading. The latency minimisation problem has been discussed for the integrated scenario by considering the required partial offloading, energy consumption, and resource assignment constraints [205]. The MEC promises a surprising decrease in mobile energy consumption and latency, thus the ability to address the main challenges for emerging 5GB/6G visions.
On the other hand, a new promising technology beyond D2D communication termed UAVs to everything communications abbreviated by (U2X) was introduced. A UAV aircraft that does not require a human pilot uses different sensory data to collect information and data, and then transmits it over cellular links [206]. The communication requirements of UAVs are different from sensing applications and require a flexible communication framework. Furthermore, the Internet of UAV will be a novel paradigm in the wireless communication field, in which several sensing applications could be deployed in 6G [207], [208]. Fig 17 presents a general overview of D2D communication in 6G networks. It highlights D2D concepts that could be extended from indoor environments and smart homes to intra ship communication, building to building (B2B), manufacturing, and so on.

VII. LESSON LEARNED
This section outlines the major derived lessons learned from in-depth investigation and analyses on D2D communication at the forefront of the envisioned 5GB and 6G connectivity. The following lists the lessons captured:

A. LESSON ONE
In summary, D2D communication is a forefront candidate technology for short communications in future generations. Devices can communicate directly without relaying information signals via BS, as introduced in conventional wireless cellular networks. The D2D communication offers high power and spectral efficiencies, along with flexible infrastructure and low latency. It has been applied in many applications containing data services and local voice, online gaming, M2M, emergency networks, video streaming, and other novel applications in future generation networks.
The 5GB and 6G facilitate network connectivity among massive numbers of devices. The distribution of many small cells known as UDN can enhance D2D communication transmission delays and capacity. Some key challenges demand discussion and investigation to fulfil extraordinary capacity, data rate, and low latency for 5GB and 6G networks.

B. LESSON TWO
Rapid growth, innovations, and advancements in mobile communications technologies have led to a huge number of HetNets, which enable the connection of different devices and appliances. In order to facilitate the connection of D2D in HetNets, compatibility between devices is important to support the diversity of multiple communication systems.

C. LESSON THREE
Notably, over 70% of data traffic originates from indoor environments. The cutting-edge technologies have been reviewed to provide high speed data rates and QoS for mobile communication in 5GB and 6G networks. The integration of D2D with IoT, UDN, VLC, M2M, UAV, C-RAN, and mm-Wave could be featured and prominent to improve network performance. These integration efforts may also be the solutions to many D2D communication challenges, including resource allocation, security, interference management, model selection, and energy consumption.

E. LESSON FIVE
The envisioned ID2D implemented in future 6G network is bound to offer flexible multi-services with several specifications. The efficient implementation of ID2D requires the potential incorporation of D2D with state-of-the-art technologies, such as THz, NS, CN, MEC, and IRS. These incorporations demand modification in core and access networks to produce intelligent services in future innovative infrastructures.

VIII. KEY FINDINGS AND SUGGESTIONS FOR FUTURE RESEARCH A. REVIEW
This paper presents an in-depth review of contemporary D2D communication research work. The challenges of D2D communication in the context of 5GB and 6G are discussed with opportunities and potential possible solutions. In future, the implementation of D2D communication in realistic scenarios should be investigated to analyse its performance, while ensuring its advantages with the capability to employ D2D communication technology for novel applications in 5GB/6G networks.

B. TAXONOMY AND PAST WORK
This paper introduces D2D communication taxonomy with extensive analysis of several published work related to D2D performance in terms of interference management, resource allocation, mode selection, mobility, heterogeneous network, and security. Various techniques, methods, and algorithms have been proposed previously to improve spectrum and energy efficiencies, data rates, throughput, and QoS. Nonetheless, the data traffic, the number of connected devices, and the need for high capacity have been increasing on daily basis, along with the existence of limitations in bandwidth or resources. Hence, more investigations on D2D communication are required to meet future 5GB/6G networks requirements.

C. HETEROGENEOUS NETWORKS
HetNets platform enables several devices with different attributes and protocols to transmit and receive data over underlay or overlay cellular networks. The D2D communication in HetNets can effectively minimise network signalling pressure and relieve BS power consumption. Hence, future research endeavour should concentrate on establishing a completely reliable D2D communication link among varying devices in diverse networks that demands new transportation and translation protocols to develop a unified compatible global system; facilitating data sharing among various D2D users in the IoT ecosystem in UDN.

D. INTEGRATION
The integration of D2D communication with other advanced technologies is foreseeable to convert future network VOLUME 10, 2022 architectures. This integration places D2D technology at the forefront of the envisioned 5GB/6G connectivity roadmap. This paper initiates a discussion that revolves around the benefits of D2D integration with several technologies, including C-RAN, mm-Wave, IoT, VLC, UDNs, and UAVs, to support 5GB and 6G networks. Nevertheless, some of these advanced techniques face challenges as reported previously, which can deteriorate the D2D communication performance and affect the integration process. Hence, future research work should begin devising new techniques, approaches, algorithms, and tools to overcome these reported challenges for further enhancement.

E. SECURITY
Incorporating D2D communication into 5G HetNets and beyond is still in its infancy stage and faces multiple security threats. The 3GPP standardised AKA protocols are inappropriate for D2D due to dissimilarities in the communication scenario and architecture. Only aggregated signatures and cryptography have been investigated so far; signifying numerous untapped security issues that should be tackled in order to enhance security and minimise resource consumption.
In future, researchers should consider developing a novel AKA protocol for D2D pairs, besides building new security models to facilitate communication between devices in 5GB/6G HetNets.

F. AI
Artificial intelligence (AI) and machine learning (ML) are prominent technologies that have been expected to drive D2D communication in 6G networks. The implementation of efficient ID2D in 6G networks demands the incorporation with at least one of the key techniques of THz, NS, CN, IRS, and MEC. The ID2D in 6G may support the growth of novel ubiquitous intelligent applications with intelligent industries and life. Studies on ID2D in 6G networks is under discussion and more investigations are required from researchers in both academia and industries fields.

IX. CONCLUSION
D2D communication is an emerging and promising technology and is a crucial factor in fulfilling 5G generation requirements. This is due to its relatively valuable features and advantages, as mentioned earlier in the literature. In this paper, we have prepared a comprehensive survey on D2D communication and a review of contemporary research that has been done relating to D2D communication concepts, classification, and various application scenarios. Furthermore, D2D integration with other emerging technologies was thoroughly discussed as well, and suggestions for future trends were proposed. Various possible solutions for 5GB network performance improvements were presented as well. Furthermore, the main contributions of this paper are in presenting an in-depth review of problems concerning D2D communication in the context of 5GB networks and beyond. In addition, an analysis of various published approaches related to D2D performance in terms of interference management, resource allocation, mode selection, mobility, heterogeneous network, and security was presented. The vital role that D2D communication plays in the success of upcoming 6G networks was introduced and investigated. Lastly, a direction of open research challenges of D2D communication and their possible solutions for the future was proposed.