1 Introduction

The ever-increasing demand of subscribers in a stack for their high demand of speed and efficiency as wireless communication technologies fail to supply services [1]. The demand for digital applications such as online video streaming, video conferencing, and cloud computing has fueled a boom in high-speed, low-latency wireless communication technology [2]. Researchers estimate that trillions of wireless gadgets will eventually connect billions of people, resulting in an overcrowded spectrum [3]. As a result, meeting these expectations will be a significant problem for the impending 5G technology with network slicing and aggregation [4]. D2D Communication is one of the most promising 5G technologies in cellular communication, which can improve spectral utilization in cellular networks [5]. D2D is also important for proximity services, a new trend in which devices connect with neighboring devices without the intervention of the serving network [6]. In a cellular network, D2D communication refers to direct communication between nearby devices/users without needing information to be relayed through the base station (BS) [7]. It is a key component of 5G communication which fulfills the demand for high data rates for local activities [8]. Along with the advantages of high data rates, and low delay, D2D communication has also become the most significant technology for public safety networks [9]. Not only for public safety networks, the D2D communication with a multicast feature is also useful for local file transfer on the commercial platform [10]. In D2D transmission, direct data communication reduces the data transfer delay and increases the spectral efficiency & system capacity. Due to the abovementioned advantages, D2D technology has recently gained immense popularity. However, the D2D technology was overlooked in the traditional 4G networks [11]. But nowadays, researchers and the various telecom sectors are projecting D2D communication as the most efficient technology for offloading mobile network operators (MNOs) in next-generation networks (NGNs) [12].

For direct communication, state-of-the-art wireless local area network (WLAN), wireless personal area network (WPAN), and other technologies are employed [13]. They do not, however, have a licensed band. Additionally, these may provide the benefit of low-cost, low-energy communication especially if we enable D2D communication in LTE-A [14]. However, this method of using an unlicensed spectrum is not desirable from the perspective of interference [15]. At the same time, this D2D connection is also direct communication with enhanced spectrum utilization of evolved node B (eNB of 4G)/next generation node B (gNB of 5G) licensed band [6]. D2D communication is an excellent choice for direct communication in 5G technology due to controlled interference, lower energy consumption, and greater spectrum utilization in licensed bands [16]. Even if the requisite infrastructure is not there, D2D supports data transmission between user devices directly over eNBs [17]. The goal of a D2D communication system is to increase spectral efficiency while reducing communication delay [18]. At this point, service quality is important, and it relies on data privacy. As a result, data security in D2D communication is a critical factor that cannot be overlooked.

In general, D2D communication nowadays refers to wireless communication, which includes device-to-device networks, since networks are an inescapable aspect of communication. D2D communication has merged ad-hoc and centralized communications together and provides opportunities of long-term developments to the researchers [19]. Devices engage directly in modern D2D communication in the absence of infrastructure or secure communication channels [20]. Figure 1 depicts a broad image of D2D communication, including a centralized gNB and a 5G small-cell. According to Fig. 1, the cloud radio access network (CRAN) enables the internet-of-health-things (IoHT), internet-of-vehicle-things (IoVT), and other internet-of-things (IoT) applications [21]. Different D2D pairings are directly transmitted between devices and relaying information to BS. Because of the heavier traffic and the larger service area, tiny cells are highly important in this situation. D2D communication enhances QoS by reducing backhaul network loads without requiring base stations [22].

Fig. 1
figure 1

A general D2D communication view

This paper gives a contemporary literature review on D2D communication from the perspective of security, and it highlights the gaps in previous research. As a point of clarification, D2D communication in this context refers to a wireless infrastructure that also includes device-to-device networks. This article outlines the principles from evolution to applications, as well as the development of the field. This paper also covers the open security challenges, potential threats, and future prospects. In a word, the purpose of this endeavor is to support relevant researchers in understanding D2D security and privacy problems.

The following is a breakdown of how the paper is structured. Section 2 presents a quick review of the evolution of D2D communication following the introduction. Section 3 examined the fundamentals of device-to-device communication, including the required fundamental architecture, distinct types of D2D communication, and so on. The work’s goal and motivation are discussed in Sect. 4. Section 5 discusses existing security aspects and current state-of-the-art remedies. Section 6 describes the D2D security architecture. In Sect. 7, the security requirements of D2D communication were discussed. Some well-known uses of secured D2D systems were highlighted in Sect. 8. The discussion on probable security threats is addressed in the Sect. 9. Section 10 outlines a number of open security challenges and prospective solutions. Section 11 represents the future direction of the detailed discussion. Finally, Sect. 12 concludes the survey work.

2 D2D communication evolution

Radio transmission rapidly gained popularity owing to its ability to transfer data over long distances at cheap cost and high quality while using very little power. We know that before the advent of digital communication, communication was purely analog. Therefore, it started with first-generation (1G) and is now moving toward 5G. The concept of 1G was born in the early 1980s, and it all began with 1G. The communication was analog and depended on the frequency division multiplexing (FDM) method. The maximum data rate was 2.8 Kbps, and there was circuit switching. The communication was quite insecure, and there was a lot of power consumption. There was no concept of direct communication [23].

The second-generation (2G) of communication started with the introduction of the global system for mobile communications (GSM) in the late 1990s. With a maximum data rate of 64 Kbps, the concept of digital communication was born. At that time, the concepts of code division multiple access (CDMA) and short message service (SMS) were invented. This generation was unable to send video files. Data rates reached 200 Kbps towards the end of this generation. The data rate for GSM-Evolution (EDGE) and general packet radio service (GPRS) are two sophisticated technologies that were introduced. This era is referred to as 2.5G, as it is halfway between 2 and 3G. Nevertheless, no direct link was created until the end of the 2.5G period [24].

With a maximum data rate of 2 Mbps and improved voice quality, 3G connectivity debuted in the late 2000s. It incorporates the universal mobile telecommunications system (UMTS), wideband code division multiple access (WCDMA), and code division multiple access (CDMA), among other technologies. WLAN and WPAN introduced direct communication at the end of 3G (also known as 3.5G) [25]. Bluetooth became widespread during this age, and it used an unlicensed band to communicate.

After the introduction of 3.5G technology in late 2010, the fourth generation (4G) was established with the launch of D2D communication using long-term evolution-advanced (LTE-A) technology [26]. Data rates increased much further in this generation, which began with internet protocol (IP) communication. This generation provides several benefits in terms of data rates, security, and a variety of advanced services [27].

D2D communication will be a key module in 5G communication, which is expected to arrive in 2023 with greater capacity, improved throughput, increased spectral efficiency, lower latency, and other features that will provide excellent QoS. The network-centric generations will shift to device/user-centric communication, in which the device/user will store, relay, compute and deliver content, as BS did previously [28]. D2D communication is identified as one of the significant aspects of 5G networks in the 3GPP LTE (The 3rd generation partnership project- long term evolution)–Release 12 proposal [29]. Table 1 summarizes comparisons of the major wireless technologies. It is important to note that privacy and security in D2D communication are significant factors that should always be maintained for data communication. The same topic is the theme of this work.

Table 1 Comparisons of different wireless technologies

2.1 Key benefits of D2D communication

Without getting into the nitty–gritty of D2D communication, here are a few of its advantages:

  • Due to the proximity of the connection and the potential for favourable propagation circumstances, users may anticipate fast data rates and low latency with reduced energy consumption.

  • Cellular coverage range and capacity may be extended without requiring additional infrastructure expenditures.

  • Although uplink/downlink transmission performance is low for users at the cell edge, they may still connect directly with nearby terminals or the BS by using mobile users as relays. The D2D communication establishes a dedicated connection between the cell edge user and the relay user which further helps to establish connection between relay and cellular infrastructure.

  • The D2D communication within traditional cellular communication system has increased the spectral efficiency and enabled parallel transmissions.

  • Short-distance communication may be controlled locally using D2D. It allows data offloading from BS, decreasing network traffic and the need for central node traffic control.

3 Fundamentals of D2D communication

D2D communication is a radio access technology that allows users to communicate directly with one other without having to navigate network traffic [30]. It will play a key role in the next 5G network as well as several IoT applications. The user equipment (UEs) communicates with the base station in traditional cellular communication [31]. The core network is also involved in proximity users, even though direct communication is allowed. As a result, network traffic increases, spectral efficiency decreases, energy efficiency and throughput decreases, delay increases, and so on [32, 33]. However, D2D communication can intelligently handle this circumstance without going through the core network. Network traffic is now reduced, improving spectral efficiency and energy efficiency, increasing throughput, and improving overall QoS [9]. D2D is similar to mobile ad-hoc networks (MANETs) and cognitive radio networks (CRNs) in that the operator controls it to improve spectral efficiency and overall performance via IoT [34]. One of the most challenging issues is managing the interference between D2D users and cellular network users because they share a licensed spectrum [35].

D2D, on the other hand, is a type of M2M communication; however, unlike D2D, M2M does not have the capability of increasing spectral efficiency [36]. We know that the user message is propagated across the intermediate devices in a two-tier cellular system. As a result, the confidentiality and privacy of the message must be assured for this type of system [37].

3.1 Network architecture

As illustrated in Fig. 2, a D2D network architecture is divided into device and gateway domain, core network domain, and applications domain.

Fig. 2
figure 2

D2D network architecture

Device and gateway domain D2D pairs may sometimes link directly to the main network or through the D2D area network. The D2D area network enables the communication between D2D pairs and the gateway. The D2D gateway acts as a proxy between D2D pairs and the core network.

Core network domain It consists of a network that is wired or wireless. This area encompasses aspects such as security and authentication. In order to gather and integrate data from D2D pairs, aggregators were developed since so many devices can communicate directly with one another.

Applications domain This is the component of D2D communication that enables IoTs, such as the internet of vehicle things, the internet of medical things, public safety, smart homes, and so on.

It is worth noting that some characteristics to be added to LTE-A technology in order to enable D2D communication, in reality, are already specified in 3GPP LTE-release 12 for 5G. Data privacy, secrecy, and trust management are additional responsibilities for secure D2D communication, and it is the topic of this article.

3.2 Classification

As depicted in Fig. 3, D2D communication can be characterized as inband-D2D communication or outband-D2D communication. Because inband-D2D communication uses a licensed cellular spectrum, it is under the authority of eNB/gNB. Underlay inband-D2D communication and overlay inband-D2D communication are two types of inband-D2D communication. Because D2D and cellular users share the same band, non-orthogonal resource sharing is employed to consider the inband. As a result, numerous challenges exist, such as traffic, interference, and so on. However, in the case of overlay inband, there is orthogonal resource sharing because a portion of the cellular band is dedicated to D2D communication, reducing the cellular band’s traffic load and the likelihood of interference. Unlicensed industrial, scientific, and medical (ISM) frequency channels are used in outband-D2D communication. There are no traffic concerns on the cellular network, and there is no danger of interference. It is classified into two categories: regulated and autonomous. The BS coordinates the controlled outband-D2D transmission, despite the fact that it is direct communication over an unlicensed band. The users themselves coordinate the autonomous outband-D2D communication [38]. In-coverage and out-coverage are two types of autonomous outband. The serving network is critical for in-coverage, but there is no cellular infrastructure for out-coverage. The D2D pairs can set up separate communication in both cases.

Fig. 3
figure 3

Types of D2D communication

4 Aim and motivation of the work

4.1 Aim

The purpose of this paper is to review the literature on D2D security communication from the beginning to the present (2009–2022). The authors discovered various methods that have previously been utilized to establish a secure D2D network, as well as its benefits and drawbacks. The basic aspects of D2D secure communications, as well as the primary hurdles to overcome, were investigated in this article. The report outlined current issues and potential solutions for D2D secure communication. In this context, D2D communication refers to wireless communication, which includes communication networks. The major purpose is to provide a concise overview of the security concerns of d2D communication to the related researchers.

4.2 Motivation

For forthcoming 5G wireless networks and IoT applications, D2D communication will play a crucial role in enhancing spectral efficiency and system capacity [39]. Furthermore, there are several benefits to D2D communication and networks, including reduced energy usage, less interference, and more [40]. If radio resources (frequency/time) given to D2D users are properly reused, there is an expectation of high gain from D2D underlying communication [41]. There are two possibilities: first, it may help to reduce high base station traffic if radio resources are correctly utilized; second, it may increase the risk of cellular user communication interference, which is a major difficulty in D2D communication [42]. According to research, D2D is the best option for increasing transmission rate and communication range [43]. In addition, D2D communication is appealing for modern generation communication because of some valuable and significant qualities of the channel [44]. Another most appealing and crucial advantage of D2D communication is direct contact between proximity devices without the interruption of BS [45]. However, the D2D communication scheme cannot be fully utilized without effective interference management. As a result, maintaining QoS through interference management is the primary and foremost task of D2D communication [46]. D2D communication takes on a new set of obligations if QoS through interference management is maintained [47]. But, simultaneously the interference management should also look after how the BS can allocate the shared resources (frequency/time) for D2D communication such that all the desired goals such as: increasing throughput, improving spectral efficiency, maintaining fairness, minimizing latency, maximizing data rate, increasing user capacity, and maximizing SINR are achieved in low mutual interference environment [48]. Data transmission security and power consumption issues must be addressed once the D2D connection has been established [49].

We are aware that D2D involves the transmission of data between nearby devices. Security is, therefore, more significant in D2D communication. D2D communications are efficient in terms of both time and money since they don’t need any infrastructure. However, this benefit turns into a risk since no outside entity is engaged in examining the devices’ reliability before exchanging actual information. However, there are just a few old survey papers on security for D2D communication in the literature. The survey on security architecture, requirements, and risks is covered in [50].

On the other hand, latest security threats and their probable security solutions as well as future research directions towards security & privacy are out of step. However, despite of giving less importance to latest security trends, a complete analysis of D2D architecture is undertaken in [51]. Similarly, the survey work in [52] does not address the most recent security requirements, which are critical for dealing with modern D2D communication security concerns. Therefore, none of the surveys have adequately addressed the security requirements, the most recent security concerns, solutions, and future directions. The prior discussed issues serve as the motivation for this work, leading to extensive research on the most recent security concerns and advancements in D2D communication.

4.3 Key contributions

To enhance the scope of this topic, we focus on the standalone D2D wireless network since it introduces several unique security challenges while functioning in a wireless infrastructure-less networking environment without any central base station.

The contributions are stated as follows:

  • A comprehensive review of the latest security issues, threats, and challenges in the D2D domain is presented.

  • An in-depth discussion on the state-of-the-art techniques which are entirely devoted to D2D security and privacy.

  • The open security challenges and possible best solutions to instigate future work on D2D security and privacy.

5 Review of existing works on D2D security

This section is the core of this article since it contains a comprehensive analysis of existing works on D2D security. As previously stated, in addition to the many benefits of D2D communication, there are significant challenges with its practical implementation. Among them, one of the most important concerns these days is security. In comparison to traditional D2D applications, the security threat for new D2D application is significantly more diverse and serious. The main reason for this is that in today’s D2D systems, end devices are usually connected to other end devices in their immediate vicinity. Compared to regular connections, this connection is more open and subject to attacks. The end devices are insufficient in terms of processing capability, mutual authentication, key agreement, serving network independency, and so on. As a result, any malevolent agent can intercept their transmissions. Several experts have dedicated their time and effort in finding the security solutions for D2D communication in order to address the aforementioned concerns. All existing security techniques from 2009 to 2022 have been discussed in this section and have also been compared in terms of advantages and shortcomings, as shown in Table 2.

Table 2 Comparisons of different existing D2D security algorithms

Nowadays, the security of sent data in D2D connections is a major problem. The paper [53] presented a ‘Secure and Trust’ D2D (SeT-D2D) protocol design to overcome the problem. The work aims to examine and assess the devices’ trustworthiness and secure the data from hostile agents. In [54] the novel D2D security and privacy system architecture for 5G networks is proposed. The authors first studied various security and privacy concerns and analyzed the security requirements within the 5G framework to construct the security architecture. In work [55], a safe and lightweight mutual authentication and key agreement system for D2D communication for ‘Wifi direct’ is proposed. The protocol is built on a commit/open pair with the Diffie Hellman key exchange algorithm. In a 5G framework for IoT applications, the article [56] introduces a social relationship and trust management-based distributive architecture between D2D. It highlighted that personal trust between gadgets could be developed to ensure that they are trustworthy, similar to human trust. Under the compromised situation of multiple attacks, the authors of [57] address safe routing issues in D2D communication for IoT applications. The work primarily focuses on physical layer security to address the challenge of secure routing to enhance secrecy and energy efficiency. The work [58] has utilized a friendly jammer as a D2D relay node to investigate the physical layer security issue with in-band underlay-based D2D communication. The authors proved that the relay node increases the security performance in D2D communication. The authors of [59] proposed a secure D2D group communication framework by introducing the dynamic group key agreement (DGKA) protocol. The goal of the work is to ensure secure and private group communication. To protect D2D communications, the authors of the article [60] have presented an anonymous authentication and key agreement mechanism (AAKA-D2D). The advantage of the scheme is that the user applications can easily communicate with each other using the AAKA-D2D method without revealing their identities. Furthermore, they negotiate a communication session key without disclosing communication data to the serving network.

According to work proposed in [61], employing a social trust matching algorithm to observe social trust-aided D2D communication has the advantage of increasing the secrecy rate by 63% and the disadvantage of treating uplink/downlink identically; however, the uplink spectrum usage is smaller in 5G. The work [62] has introduced a lightweight key distribution protocol to secure the infrastructure less D2D communication. The proposed scheme is divided into two phases: the extreme point extraction phase and the index matching phase. In this work, the secure keys are generated by consuming low computational resources and low energy consumption. The article [63] has proposed a lightweight and robust security aware (LRSA) protocol for D2D- assisted data communication to ensure message confidentiality, likability, privacy, mutual authentication, and unforgeability. The scheme is lightweight in terms of computational time and communication overhead. According to [64], investigating secure D2D communication in large-scale cognitive cellular networks employing wireless power transfer (WPT) regulations leads to the nearest power beacon (NPB), providing better secrecy with less complexity. The work in [65] argues that employing a secure data sharing protocol method to accomplish data security in D2D communication is an efficient and practical option, as long as the connection between the eNB and gateway is safe and the channel is not in a hostile environment. In [66], the novel game-theoretic scheme is used to secure network-assisted D2D communication by enabling the formation of a social-aware cluster. The objective of this scheme is to secure the data communication between the clusters. According to the article [67], adopting a merge and split-based coalition formation algorithm to improve system secrecy rate and social welfare has resulted in increased security. The physical layer security is addressed in [68] with the objective of achieving higher secrecy using a secure beamforming technique to prevent communication from eavesdroppers on relay-assisted D2D communication. The work [69] applies the Diffie-Hellman key agreement algorithm to establish secure connections between two mobile users. The scheme offers efficiency and usability with minimal computational overhead and low authentication overhead. The authors of the article [70] have proposed the Kuhn-munkres (KM) algorithm in order to improve the secrecy capacity of the system. The algorithm provides an optimal solution and protects the underlaid connections from the eavesdropper. In [71], the authors have utilized two algorithms, benchmark and auction algorithm, to introduce continuous interference against attackers to ensure complete protection of D2D communication and channel assignment rule, respectively. The algorithms offer the advantage of reduced time complexity. The study [72] suggested a modified elliptic curve cryptographic algorithm to build a viable and safe protocol for D2D communication. The suggested method has the advantage of being able to provide security on large-scale D2D networks with minimal communication overhead. In [73], the authors proposed authentication and key agreement mechanism to provide reliable security while reducing computation time and communication costs. The proposed system provides a lightweight security mechanism by minimizing computing complexity and communication costs. The article [74] suggested a public key algorithm for securing a system by choosing a key pair and exchanging secret keys. The suggested solution is simple and uses public key infrastructure to securely connect users to the system. Authentication and confidentiality are correctly addressed, but the authors do not address anonymity. The article [75] offers certificate-less authentication and group key distribution mechanisms. The major goal of the work is to provide the network with secret authentication, integrity, and anonymity. The authentication technique is based on certificateless cryptography for group authentication and user activity analysis. The work [76] suggests a lightweight public key technique for privacy protection device finding and authentication. The proposed approach can provide authentication, data secrecy, and integrity. Table 2 summarizes the benefits and shortcomings of the algorithm used in all of the previously stated works.

6 State-of-the-art security architecture of D2D communication

This section mainly focuses on a brief discussion on the state-of-the-art security architecture for D2D communication. Since the primary topic of this research is the security of D2D communication, it is necessary to understand the D2D network’s basic architecture shown in Fig. 4. The 3GPP committee [77] has established the following security domains:

  1. 1.

    Network domain security (NDS)

  2. 2.

    User domain security (UDS)

  3. 3.

    Application domain security (ADS)

  4. 4.

    Network access security (NAS)

  5. 5.

    Service-oriented architecture (SOA)

  6. 6.

    Operational domain security (ODS)

Fig. 4
figure 4

D2D communication security architecture

The network domain security (NDS) is a set of key security protocols that allow the serving network to transport data and communicate with the security of the home network (HN), mobile equipment (ME), and operating applications (OP-APP). Similarly, user domain security (UDS) contains security mechanisms such as NDS that allow user applications (User App) to access ME securely. Application domain security (ADS) is a set of security characteristics that enable secure communication between a User App and an OP-APP. Network access security (NAS) allows a User App to authenticate before accessing services via the serving network (SN). The User App is additionally protected from malicious agents by the NAS. Authorization, network discovery, and registration are all addressed by service-oriented architecture (SOA). The user is informed of the state of the User App’s security procedures via operational domain security (ODS).

7 D2D security requirements

The purpose of this section is to emphasise the various security requirements for D2D communication that emerged from the study of state-of-the-art literature covered in Sect. 5. It’s worth noting that all of the criteria described here are equally relevant when designing a security mechanism. The security requirements for developing a comprehensive security system for D2D communication are outlined below and depicted in Fig. 5 in order of importance.

Fig. 5
figure 5

Chronological order of D2D security requirements as per their importance

Confidentiality In D2D communication, maintaining data confidentiality is a big concern. The user’s identity and the data transferred during communication must be kept secret in order to prevent data tracking by eavesdroppers.

Authentication During communication, authentication refers to the verification of the sender’s identity.

Integrity The term ‘integrity’ refers to the accuracy with which data is transmitted between sender and receiver. That is, the content of the sender and receiver should be identical. Data tempering or data modification attacks can be detected with the use of integrity.

Privacy In order to maintain their privacy, users must conceal their personal information, current location, and so on from third parties.

Non-repudiation In the event of non-repudiation, neither the sender nor the receiver may contest the authorship of the messages transmitted or received. This makes it simple to identify the harmful agent. Non-repudiation should therefore be one of the security requirements.

Revocation If a user is found to be compromised or fraudulent, the person should be removed from the network. As a result, the rogue person no longer has the authority to disrupt communication.

Dependability This is comparable to the concept of availability. The system should not make the user feel unsafe. That means system reliability must be assured at all times until the system is turned on.

Access control It determines who has access to system resources. User authentication and authorization are used to ensure access control.

Availability D2D services should be active even after the attacker attacks the system.

Backward secrecy and forward secrecy The communication group key must be updated regularly to provide dynamic group key management. The new member cannot know the past information, and the departing member should not decrypt the present ciphertext.

Serving network independency All communication parameters are generated by UEs, and they do not rely on any other service network. This method ensures the parameters’ confidentiality and prevents the attacker from obtaining any information about them.

8 Application of secured-D2D system

It is necessary to comprehend the applications since this article covers the security of wireless-D2D communication/networks and aims to provide the reader with a broad overview. Secured D2D will become increasingly common as a means of securely offloading network traffic, resulting in greater capacity or spectral density. Secure file sharing, multicasting, video streaming, and online gaming are other applications that use low-distance direct communication. Secured D2D can also be used for IoT and M2M communication. Secure group communication and secure multi-hop relay communications are under the category of secured D2D applications. The secure D2D communication system will boost public safety, traffic safety, disaster management, and national security. Secure social networking, smart cities, location-aware services, smart grids, multiuser MIMO improvement, virtual MIMO, and other D2D communication use cases are just a few examples. Security in D2D with IoT, particularly secure vehicle-to-vehicle communication (IoVT) and secure internet of medical things (IoMT) or secure internet of health things (IoHT), are few rapidly growing areas.

9 Security threats in D2D communication

The radio nature of D2D communications introduces various security threats. Some popular threats are addressed as follows:

  • Surveillance attack an adversary secretly gathers critical information by listening on a radio channel-based user equipment devices used to communicate with one another. The guarantee of data secrecy provided by the cryptographic method may deter this danger.

  • Impersonate attack An attacker may imitate a valid user equipment device to get knowledge of the traffic data by using an impersonation attack. This danger may be neutralized by including authentication in the encryption process.

  • Forge attack an attacker may potentially forge the content and broadcast the forged data to the other user equipment s, which would be detrimental to the system. This danger may be neutralized by including data integrity in the cryptography technique.

  • Free-riding attack To minimize accessibility in D2D communications, an attacker may motivate the selfish behavior of some user equipment to conserve energy usage. As a result, that user equipment may not be willing to send content to others while simultaneously receiving its demanding data from their peers. This type of attack is known as a free-riding attack. Because of this vulnerability, the Quality of Experience might be negatively impacted, aggravating user experiences and slowing down the adoption of D2D communications. To repel an assault of this kind, it is essential to devise a system for promoting collaboration.

  • Active attack on control data An active assault on the control data occurs when the adversary attempts to alter the control data. This vulnerability may be neutralized by including identification, confidentiality, and integrity in the cryptography strategy.

  • Privacy violation Privacy invasion some secrecy data, such as identity and position, among other things, are more worried by the functions of D2D services; thus, these personal details must be disguised to parties who are not permitted to see them.

  • Denial-of-Service (DoS) attack An assault known as a denial-of-service, or DoS, happens when a service via device-to-device connections is unavailable. Many works have been demonstrated through several experimental investigations about the characteristics of DoS attacks on Android devices in a D2D underlaying network environment that malicious devices can stealthily impair or even completely block the connection of legitimate devices in the underlying network. This was accomplished through the use of the D2D underlaying network environment.

  • Replay attacks A replay attack is another kind of attack which creates a threat to D2D communication by replaying a message twice. In a replay attack, the malicious agent sends the message to the original receiver by capturing the traffic through unauthorized access.

  • Interleaving attack In this type of attack, the intruder injects an unwanted fraudulent message into a protocol to disrupt the message flow. In the D2D communication system, the intermediate device can be compromised by the interleaving attack and may change the message authentication before sending it to intended devices. Therefore, mutual authentication is disrupted due to an intermediate device that is compromised by an interleaving attack.

  • Sybil Attacks In sybil attack, the computing device creates multiple fake identities in front of the other devices within the network. The main objective of this attack is to gain access to the network by showing the majority influence within the network.

  • Side channel attacks It is a kind of security exploits that extracts secret information from a hardware chip or by analyzing several physical parameters. Some control information like time, the energy consumption of devices, etc., are used to fetch the information from the encrypted chip. It is worth mentioning that the side channel attack does not directly attack any program or code.

  • Location Disclosure Attack (LDA) This type of attack collects information about the device and the available data communication route by monitoring and analyzing the data traffic. Because of the openness of the D2D communication system, the LDA attack can easily get the real identities of the communicating devices and may hamper the entire communication.

10 The open security challenges and possible solutions

Several security challenges are still open in modern D2D communication, mainly related to data-centric security, privacy, trust management, authorization, and complexity of the security algorithm in terms of communication overhead and temporal complexity to meet the lightweight protocol criterion. Along with the various security challenges, the possible solutions to each security challenges are mentioned in Fig. 6.

Fig. 6
figure 6

Open security challenges of D2D communication and their possible solutions

11 Future research direction

It is worth mentioning that many security challenges in D2D communication remain unresolved. So, considering the available underlying security architecture, requirements, and the current potential challenges of D2D communication, we need to determine the future road map. Therefore, in this section, we dedicatedly discuss the potential future efforts as follows,

  • In D2D communication, proposing a lightweight and adaptive security protocol can be a suitable option. Because we know that the D2D network is resource constrained, researchers should try to reduce communication overhead, memory overhead, and the execution time of the security algorithms, such as a lightweight cryptographic method.

  • A future research work could be an intrusion detection and prevention mechanism. Because intrusion detection and prevention techniques jointly can secure the data communication in the D2D network.

  • A common security and privacy policy that meets all security standards in 5G compatible D2D communication might be considered cutting-edge research.

  • Future studies should focus on security solutions that can deal with internal and external threats. To address this objective, blockchain technology can be a viable option to secure D2D communication.

  • In order to achieve the optimal security solution, several optimization techniques such as nature-inspired strategies (genetic algorithm, particle swarm optimization, ant colony optimization, etc.) can be used in conjunction with traditional D2D communication security approaches.

  • We know that artificial intelligence has changed the world of technology through its remarkable contributions to automation. The effect of artificial intelligence in terms of machine learning is observed in security mechanisms also. Therefore, launching artificial intelligence-based security can be the latest trend in order to create intelligent and clever security solutions.

  • We can use the concept of quantum mechanics in security algorithms. This phenomenon is generally known as Quantum cryptography, one of the most current breakthroughs that can assist us in building correct D2D security solutions.

  • A significant and intriguing field of research would be the key distribution algorithms in conjunction with access control mechanisms.

12 Conclusion

Though incorporating D2D communication into the next 5G network would be difficult, it has the potential to increase spectral efficiency, system capacity, and the performance of the next generation IoT-based network. Direct D2D communication between users allows for increased energy consumption, network coverage at the edge, and other performance indicators, including end-to-end latency. However, there should be enough security when communication occurs, which is a critical concern and difficulty for D2D. Nevertheless, D2D security is not adequately highlighted or given enough attention in the literature. In addition, survey and review studies are scarce in the literature. This paper includes a comprehensive assessment of the security and privacy of D2D wireless communication networks, intended to address a comparable gap in the literature. This article examined all existing security algorithms from 2009 to 2022, highlighting the key benefits and drawbacks, emphasizing security architecture, requirements, open security challenges, and solutions for D2D communication. A brief overview of the publications studied for this work is shown in Figs. 7, 8, and 9. We have highlighted the future directions on security for D2D communication. D2D will be the leading technology in the 5G network through the internet of things. However, security and risks must always be a priority. Secured D2D has a lot of potentials. Better algorithms might be proposed to reduce the security difficulty as a potential future work. It is worth mentioning that this study focuses on D2D communication for wireless networks. The overarching purpose of this work is to provide associated researchers with a more holistic understanding of the risks associated with D2D communications in terms of both security and privacy.

Fig. 7
figure 7

Comparison of year-wise summary of articles investigated for this survey work

Fig. 8
figure 8

Comparison of year -wise number of national and international conferences, symposiums, workshops articles

Fig. 9
figure 9

Comparison of year -wise number of national and international journals, magazines, book chapter, and letters