Energy-Efﬁcient Device Discovery Mechanism for Device-to-Device Communications in 5G Networks †

The conventional direct device discovery scheme which uses the random access protocol and encounters contentions or collisions is highly energy and time-consuming. To reduce the energy consumption of user equipments (UEs), this work proposes a two-phase hybrid device discovery mechanism for device-to-device (D2D) communications. In the ﬁrst phase, the evolved packet core (EPC) or base station (BS) uses the location information of UEs to judge whether two UEs are able to establish a D2D link. In the second phase, UEs use Wi-Fi Direct to discover their target UEs. The BS directly assigns UEs’ states and allocates appropriate Wi-Fi channels to UEs. UEs no longer have to search or listen to all channels, thus reducing the discovery delay. The proposed mechanism saves cellular spectrum resources because it uses unlicensed bands for D2D discovery and communications. The performance of the proposed hybrid D2D discovery mechanism is also theoretically analyzed in this paper. Evaluation results show that the proposed D2D discovery mechanism has better performance in terms of energy consumption, discovery delay and discovery success rate, compared with the conventional direct D2D discovery scheme, especially in the network scenarios with smaller cells such as 5G networks. Additionally, the analytic results coincide with simulation results, demonstrating that our theoretic analysis is accurate.


Introduction
The high transmission rate of fifth generation (5G) [1] networks has been strongly promoting the realization of Internet of Things (IoTs) and smart cities, while the big data resulting from IoTs or smart cities may overload the 5G network because of the limited spectrum resources. To resolve this problem, device-to-device (D2D) communications have emerged as an attractive choice recently. D2D communications allow devices to directly communicate without using the base station (BS) for relaying. Hence, D2D communications yield many merits [2][3][4] such as improving the spectral efficiency and system capacity, reducing network latency and energy consumption of UEs, offloading the 5G network, and extending the network coverage.
The possible applications [3] of D2D consist of machine-to-machine (M2M), vehicleto-vehicle (V2V) [4], content distribution [5], location-aware services in smart cities [6], social networking [7], public safety services [8], proximity online gaming, and e-health caring. However, to fulfill D2D communications, many challenging issues such as the device discovery, resource allocation, power control, interference management, and network security, remain to be solved [3,[9][10][11]. Among these issues, the first challenge of D2D communications is the device discovery. Therefore, lots of papers [12][13][14][15][16][17][18][19][20][21] have studied and UEs using the network-assisted approach, in which the BS or EPC can use UEs' location information to judge whether two UEs are close enough to initiate D2D. If two UEs are too far away from each other, the BS or EPC notifies them of directly using cellular services for communications, thus avoiding unnecessary D2D discovery overhead and reducing collisions of D2D discovery messages and UEs' power consumption. Consequently, in [24] we designed a hybrid mechanism combining the network-assisted and direct D2D discovery approaches to find a specific target device in proximity and evaluated its performance using simulations. In this extended paper, we further modify our previous design [24] in several aspects to improve the performance of the proposed hybrid D2D discovery mechanism. More specifically, two additional novel algorithms, channel assignment algorithm and binary exponential backoff without frozen backoff time algorithm, are proposed in this paper to further reduce the discovery delay. Additionally, to objectively and scientifically evaluate the performance of the proposed mechanism, in this paper we theoretically analyze the energy consumption, discovery success rate, and discovery delay of the proposed mechanism. Finally, several examples are presented to show the superiority of the proposed mechanism over other existing discovery schemes and validate the accuracy of our theoretic analyses.
The rest of this paper is organized as follows. Section 2 addresses related works about D2D discovery schemes. Section 3 introduces the proposed hybrid D2D discovery mechanism that combines the network-assisted and direct discovery techniques. Section 4 analyzes the performance of the proposed D2D discovery mechanism. Section 5 presents evaluation results to demonstrate the superiority of the proposed hybrid D2D discovery mechanism. Finally, the concluding remarks are made in Section 6.

Related Works
In addition to the cellular network technology, other existing techniques [13] such as Infrared Data Association (IrDA), Wi-Fi Direct [21,22], and Bluetooth [23], are frequently used for D2D discovery. IrDA uses a slotted-ALOHA structure to resolve the multiple access problem in device discovery. Bluetooth uses 32 channels out of the available 79 Bluetooth channels for device discovery. A discovering device sends an inquiry signal on one of the 32 discovery channels for a half slot and switches to a new channel to send in the second half. The discovering device repeats the procedure by cycling through the 32 discovery channels until the discovery period expires. A device to be discovered periodically executes the discovery scan procedure by listening for the discovery signal on one of the 32 channels. Wi-Fi Direct defines two states, i.e., search and listen, in the find phase, and uses carrier sense multiple access with collision avoidance (CSMA/CA) to discover devices [21,22]. In the search state, a device sends probe request messages on one of the Wi-Fi channels (e.g., channels 1, 6, and 11) using the CSMA/CA and waits for the probe response until timeout, as shown in Figure 1. This searching process is repeated on each of the three channels 1, 6 and 11. A device in the listen state selects one of the channels to listen for probe request messages until the period of the listen state expires. In the find phase, the state of a device continuously alternates between search and listen until a device is discovered or timeout occurs. A brief comparison between Bluetooth 5.0 and Wi-Fi Direct is given in Table 1. However, these two protocols use asynchronous transmission technique and are not efficient in terms of discovery delay and discovery success rate. Thus, the FlashLinQ protocol [25] which adopts synchronous transmission was proposed to improve the discovery performance.  It is important to minimize the collision probability in contention-based D2D discovery mechanisms. To optimize the probability of successful transmissions of discovery signals, in [16] the transmission probability at each time slot is set to 1/N if there are N D2D pairs. To reduce the collision probability occurring in the device discovery phase, a random backoff algorithm was proposed for D2D discovery in [20]. Griffith et al. [26] proposed a theoretical model to calculate the optimal transmission probability based on a given set of parameters such as the number of UEs and resources. However, [26] assumes a priori knowledge of the number of UEs in the discovery group, which is usually not the case in reality. Additionally, it considers an ideal propagation model, disregarding fading and interference factors. To improve the discovery performance, the paper [27] proposed an adaptive algorithm which considers the available resources and the number of nearby UEs as they are being discovered, and adapts the transmission probability which is computed using the formula given by [26] and rounds to the nearest multiple of 0.25. To improve the discovery performance of contention-based schemes, Lim et al. proposed a nonorthogonal spectrum-sharing scheme, which is based on trellis tone modulation multipleaccess (TTMMA), for D2D discovery [28]. TTMMA allows several UEs to modulate and transmit their signals on the same resource segment. This design mitigates the need for strict collision avoidance and increases the discovery capacity. In [29], an overlapping community-aware neighbor discovery mechanism for D2D communications was proposed. By dynamically estimating the roles of overlapping community UEs, the beacon detection rates can be derived. Additionally, based on the connection status of other intra-community and inter-community UEs, the beacon detection rates can be dynamically adjusted to improve the energy efficiency and discovery rates.
Since Wi-Fi Direct operates in unlicensed frequency bands, it does not consume any spectrum resources of cellular networks, compared with the D2D underlaying cellular networks [16,30]. Additionally, since Wi-Fi Direct has a much higher transmission rate, compared with Bluetooth (Table 1), it is considered in our previously proposed device discovery mechanism and D2D communications [24]. However, in the find phase of Wi-Fi Direct protocol, a UE searches or listens to all three channels in a round-robin manner until the search channel hits the listen one. To reduce the discovery delay of Wi-Fi Direct protocol and thus improve the performance of our previous proposal [24], this paper proposes a modified mechanism that the BS directly assigns a specific search and listen channel to a D2D link. Moreover, the binary exponential backoff algorithm without frozen backoff time is implemented in the proposed D2D discovery mechanism. The IEEE 802.11 WLAN uses the binary exponential backoff algorithm to resolve the transmission collision or error problem [31]. Under the binary exponential backoff algorithm, when a frame transmission fails, the frame retransmission must be deferred for a backoff time which is randomly selected from the contention window [0, 2 m −1], where m is the stage parameter of the contention window. To effectively avoid successive transmission failures, the contention window is doubled after each transmission failure. However, the maximum contention window is [0, 2 10 −1] in order to avoid an unacceptable transmission delay. Additionally, in the IEEE standards the backoff countdown timer must be stopped or frozen when the channel becomes busy, leading to an extra delay. Thus, in this paper we adopt the binary exponential backoff algorithm without frozen backoff time to reduce the collision probability and discovery delay. Evaluation results in Section 5 will show the superiority of the hybrid D2D discovery mechanism proposed in this paper.

Proposed Hybrid D2D Discovery Mechanism
In this section, the designed hybrid D2D discovery mechanism for finding a specific target device in proximity is introduced. The proposed D2D discovery mechanism includes two phases. In the first phase, the BS or EPC has to judge whether a UE pair is able to establish a D2D link. If two UEs of a D2D pair are probably close enough (e.g., in the same cell) to initiate D2D communications, the BS notifies them of starting the Wi-Fi Direct [21,22] engine for D2D discovery and communication purposes. In the second phase, a source UE starts to discover its target UE to communicate with. The detailed procedures of the designed hybrid D2D discovery scheme in Phases 1 and 2 are shown in Figure 2 and described as follows.  (1a) When a UE initiates a request to communicate with a remote one, the request is sent to the BS or EPC. The request message must consist of the full, unique device identity, e.g., the 15-bit International Mobile Subscriber Identity (IMSI), and other related information such as GPS data. (1b) The BS or EPC judges whether two UEs of a D2D pair are close enough to initiate a D2D link according to the UEs' IPs, IDs, or location information. When two UEs are located in the same cell (e.g., the pair A-A in Figure 3) or adjacent cells (e.g., the pair B-B in Figure 3), then the BS or EPC informs these two UEs of launching the D2D discovery procedure in Phase 2; otherwise, these two UEs utilize the cellular service to communicate. It is well known that each UE must periodically register to the BS or EPC. Thus, each UE can report its location information to the BS or EPC at each registration instant. The BS or EPC can then use UEs' location information to judge whether two UEs are possible to use D2D. If two UEs are close enough, the BS or EPC notifies these two UEs of starting the D2D discovery procedure. Using the UE's location information from registration process, the EPC can know which BS a UE is connected to. Therefore, the EPC can notify a UE of starting the D2D discovery procedure via the UE's BS. Notably, in 5G networks small cells are used for increasing capacity and improving performance. Therefore, in 5G networks the probability that two UEs located in the same cell or adjacent cells can use D2D is highly increased, compared with obsolete cellular systems. In this paper, we use Wi-Fi Direct [21,22] to fulfill D2D discovery and communications. Let two UEs be denoted by A and A . UE A is the source which initiates the request while UE A is the target one to be discovered. According to the Wi-Fi Direct protocol, as shown in Figure 1, the find phase includes the search and listen states. In the search state, each device must send probe requests using a different nonoverlapped channel 1, 6, or 11. In the listen state, each device listens for probe requests from other devices on a fixed channel. Notably, only when UE A and UE A work on the same channel can they find each other. To reduce the discovery delay, in our design the BS directly assigns a proper working channel for UE A and UE A . UE A starts in the search state while UE A starts in the listen state. Thus, UE A no more needs to send probe requests on all nonoverlapped channels, yielding a decrease in the discovery delay. An optimal channel for a pair of UEs is selected by the BS according to the minimum channel interference criterion, as shown in the algorithm of Figure 4. Additionally, whether a UE would open its Wi-Fi Direct when it is nearby any other UEs depends on the applications and users' designs. For the one-to-one communication, as studied in this paper, it is suggested that a UE opens its Wi-Fi Direct only when it has the need of D2D communications in order to save the UE's power consumption. Subsequently, the D2D discovery procedure in Phase 2, which is described below, can proceed. to UE A and then D2D communications start; otherwise, switch to step (2c). (2c) Whenever the number of retransmissions reaches a pre-defined number R T , named the retry limit, the discovery process stops and these two UEs utilize the cellular service to communicate; otherwise, switch to step (2a) after a random time which is chosen using the binary exponential backoff algorithm without frozen backoff time. To summarize, the proposed hybrid D2D discovery mechanism consists of two phases. Phase 1 operates over the underlay cellular network to sift D2D candidates from all UEs, thus avoiding unnecessary contentions and collisions of D2D discovery and communication messages. Phase 2 operates over unlicensed bands to discover D2D devices using the Wi-Fi Direct protocol and binary exponential backoff algorithm, thus without consuming any spectrum resources of the cellular network. Notably, the binary exponential backoff algorithm without frozen backoff time is used in our design in order to further reduce the discovery delay. Additionally, after a successful discovery, the source UE A acts as a group owner (GO) and the target UE A acts as a client.

Performance Analysis of Proposed Hybrid D2D Discovery Mechanism
In this section, the energy consumption (in terms of the number of transmitted discovery beacons), discovery delay and discovery success rate of the proposed hybrid D2D discovery mechanism are analyzed. The system is assumed to have multiple homogeneously hexagonal cells and each cell has multiple D2D-enabled UEs. The cell radius is R and each BS is located at the cell center. In each cell, UEs are uniformly distributed over the cell. UEs' requests for communicating with their target UEs arrive at each cell according to the Poisson process with rate λ UE . The communication time of each D2D link conforms to an exponential distribution with parameter µ, i.e., with the mean time 1/µ. In each cell, the ratios of UEs whose target UEs are located in the same cell as themselves (case A in Figure 3) and in adjacent cells (case B in Figure 3) are denoted by r 1 and r 2 , respectively. We also assume that the transmissions of a discovery beacon/data packet and its response/acknowledgment (ACK) can be finished within the same time slot and the propagation delay is negligible. In Wi-Fi Direct protocol, only channels 1, 6, and 11 are used and the maximum probing distance of Wi-Fi signals is d. Additionally, the retry limit is assumed to be R T . Notably, to focus on the performance of D2D discovery mechanism and make the mathematical analysis tractable, we assume that the contentions only exist among D2D source UEs. For example, popular video streaming applications that video packets are always sent from source UEs to target UEs meet this assumption.
First, considering a given target UE A to be discovered, according to Figure 5 only those source UEs located within the circle of radius d can interfere with the discovery messages for the target UE A. Since the UE intensity of each hexagonal cell is λ UE /(3 √ 3R 2 /2), the average number σ (contention load) of D2D source UEs within a circle of radius d is expressed by where the constant h = 2π/(3 √ 3). The parameter r = r 1 + r 2 is the total ratio of UEs which need initiate Phase 2 D2D discovery procedure. P S is the probability that a UE successfully discovers its target UE, also named discovery success rate in this paper. The discovery success rate P S is defined as the ratio of the number of UEs which successfully discover their target UEs to the total number of UEs which initiate D2D discovery procedure. Notably, since all cells are assumed to be homogeneous, Equation (1) can also be applied to the case that the circle of radius d is located among adjacent cells, as shown in Figure 5. Next, since there are three channels able to be used, the effective load of each channel in a circle of radius d is σ/3. Then the probability P(X = n) that there are n D2D links contending the same Wi-Fi channel equals According to the results of [32], the probability p that a D2D UE (DUE) transmits a discovery beacon or data packet at each time slot is given by where W is the minimum contention window size and set equal to 1 in this paper. The maximum backoff stage is set equal to R T in this paper. Notably, Equation (3) is derived based on the full load assumption, i.e., every DUE always has discovery beacons or data packets for transmission. Note that the collision probability of a transmitted beacon or packet is 1 − (1 − p) n−1 when there are n DUEs in contending the wireless channel. Thus, the collision or contention probability p f in (3) is given by As in [32], only collisions are considered and bit errors are ignored here. Finally, using Equations (3) and (4) the transmission probability p can be solved using the numerical approach suggested by [32].
Subsequently, the probability p s that a discovery beacon can be successfully transmitted at any time slot is derived as follows.
According to the binary exponential backoff algorithm, after the j-th collision, the random backoff time is chosen among these integers {0, 1, · · · , 2 j −1}. It leads to the result that the average backoff time between the (j−1)-st and the j-th retransmissions equals (2 j −1)/2 slots. Then the average discovery delay can be expressed by ∑ i j=1 1+ 2 j−1 −1 2 when a discovery beacon is transmitted successfully at the i-th transmission (including i−1 retransmissions). Notably, a target UE can be discovered only when it is located within the probing range d of the source UE. Hence, the probability that a target UE can be successfully discovered at the i-th transmission equals (1−p s ) i−1 p s p c , where p c is the probability that two UEs of a D2D link are located within the probing range d of Wi-Fi signals and is derived in the Appendix A. Consequently, the average discovery delay D (in slots) is derived as follows.
Using a similar approach, the average number N of transmitted discovery beacons can be estimated as Finally, one can obtain the discovery success rate P S as follows.

Evaluation Results
In this section, the performance of the proposed hybrid D2D discovery mechanism is evaluated using both analyses and simulations. The simulation program is developed by ourselves using C++ Builder. In our simulation scenario, there are 19 homogeneously hexagonal cells, as shown in Figure 3. The cell radius R of each cell equals 200 m. The BS of the innermost cell in Figure 3 is located at the origin (0, 0). For the cell whose BS is located at the coordinates (x, y), the BSs of its six adjacent cells are located at (x, y+ √ 3R), (x, y− √ 3R), (x+ 3 2 R, y+ 2 R), respectively. UEs arrive at a cell according to the Poisson process with rate λ UE = 0.5 s −1 and are uniformly distributed over a cell, i.e., following a Poisson point process (PPP). The ratios of UEs whose target UEs are located in the same cell as themselves and in adjacent cells are denoted by r 1 and r 2 , respectively. In simulations, we assume that r 1 = 0.9r and r 2 = 0.1r, where r is defined in (1). In Wi-Fi Direct, the maximum propagation range of the transmitted signals is assumed to be d = 100 m and the retry limit R T is set to 5 if not specific mentioned. The length of a slot time in Wi-Fi Direct is set to 50 µs. Whenever a UE successfully discovers its target UE, D2D communications start. During D2D communications, the data flow is always from the source UE (GO) to the target UE (client) and the full load condition is assumed. That is, the source UE (GO) always has data packets for transmission. The sojourn time of each D2D link in the system is exponentially distributed with the mean time 1/µ = 300 s.
This section aims to evaluate and compare the energy consumption (in terms of the number of transmitted beacons), discovery delay, and discovery success rates of different D2D discovery mechanisms such as the direct D2D discovery scheme and the proposed one. In the direct D2D discovery scheme, all UEs entering the cell directly initiate D2D discovery procedure and the legacy Wi-Fi Direct is used. The length of the search state lasts 45 ms (i.e., 15 ms for each channel) and the length of the listen state is random and can be 100, 200, or 300 TUs (time units), where a TU equals 1.024 ms [21]. The total duration of a search state and its subsequent listen state is called a discovery cycle. Each UE executes at most two discovery cycles in the find phase. While in the proposed hybrid D2D discovery mechanism, after the stage of Phase 1 only the ratio r of UEs will trigger the D2D discovery procedures in Phase 2. Additionally, the optimal search and listen channel for a D2D link is assigned by the BS according to the minimum channel interference criterion given by the algorithm in Figure 4. In the direct D2D discovery scheme and the proposed one, when a source UE does not receive any response from its target UE within a slot time, the binary exponential backoff algorithm is executed to retransmit the discovery beacon. Notably, the binary exponential backoff algorithm without frozen backoff time is used in the proposed mechanism in order to shorten the discovery delay. On the other hand, to validate the performance of the binary exponential backoff algorithm, the inverse proportional transmission probability algorithm proposed in [16] is compared as well. The inverse proportional transmission probability scheme, which is the same as the proposed two-phase hybrid D2D discovery mechanism except that the binary exponential backoff algorithm is replaced by the inverse proportional transmission probability algorithm, is named "Inverse Proportional" scheme in the following.
In the first example, the performance of different D2D discovery mechanisms versus the ratio r is investigated. Each data point of simulation results is repeatedly simulated five times and the average and 95% confidence interval of the measured parameter are taken over all the runs. Figure 6 plots the UE's energy consumption performance under the proposed, inverse proportional, and direct D2D discovery mechanisms. The analytic results computed based on Equation (7) are also included in Figure 6 for comparison. According to Figure 6, the analytic results of the proposed scheme almost coincide with the simulation results, demonstrating the accuracy of our analysis. The energy consumption of the proposed and inverse proportional mechanisms is similar and it is much less than that of the direct D2D discovery scheme. For the proposed and inverse proportional mechanisms, the average number of transmitted beacons slightly increases with the ratio r because the collision probability grows with the number of D2D links, leading to an increase in the number of retransmissions. For the direct D2D discovery scheme, all UEs directly initiate D2D discovery procedures and thus the collision probability is irrelevant to the ratio r. Notably, the value r represents the ratio of UEs whose target UEs are located in the same cell as themselves or in adjacent cells. Therefore, when r is small, very few UEs can find their target UEs and the number of retransmissions at each UE almost reaches R T , leading to R T +1 = 6 beacons being transmitted over each channel. Since the discovery procedures must be executed in all three channels and there are two discovery cycles in the worst case, the worst number of transmitted beacons at each UE is about 36. When r increases, more target UEs are located within the discovery range to be discovered and thus the average number of transmitted beacons at each UE decreases. Accordingly, the average number of transmitted beacons of the direct D2D discovery scheme decreases with the ratio r.  Figure 7 shows the average discovery delay under the proposed, inverse proportional, and direct D2D discovery mechanisms. For the proposed and direct D2D discovery schemes, the discovery delay is almost irrelevant to r. However, the average discovery delay of the inverse proportional scheme significantly increases as the ratio r grows. This phenomenon indicates that the efficiency of resolving collisions of the inverse proportional transmission probability algorithm is worse than that of the binary exponential backoff algorithm. In Figure 7, the proposed hybrid D2D discovery mechanism significantly outperforms the inverse proportional and direct D2D discovery schemes in terms of discovery delay. Additionally, the analytic discovery delay of the proposed scheme is also accurate. As to the discovery success rate, it is investigated in Figure 8. According to the results in Figure 8, the proposed hybrid D2D discovery mechanism significantly outperforms the direct D2D discovery scheme. While the discovery success rate of the proposed hybrid D2D discovery mechanism is only slightly better than that of the inverse proportional scheme. The accuracy of the analytic results of the proposed scheme is also good. The minor difference between the analysis and simulation mainly results from the approximation that in Figure A1 we use a circular cell for analyzing p c rather than use a hexagonal cell. In the proposed and inverse proportional schemes, the discovery success rate slightly decreases with the ratio r because the collision probability increases with r. While in the direct D2D discovery scheme, the collision probability is irrelevant to r. However, when r increases, more target UEs are located within the discovery range and thus the discovery success rate grows with r in the direct D2D discovery scheme. Notably, in Figure 8 the discovery success rate cannot be greater than 25% because only those target UEs located within the probing range of source UEs can be discovered and the ratio of such target UEs is bounded by d 2 /R 2 = 0.25. Using the analytic result in Equation (8), the discovery success rate significantly grows with the ratio d 2 /R 2 , as shown in Figure 9, where all parameters are similar to Figure 8 except R. That is, the proposed discovery mechanism is more suitable to be implemented in the network scenarios with smaller cells such as 5G networks. Based on the results of Figures 6-8, the following conclusions are made. First, the proposed two-phase hybrid D2D discovery mechanism significantly improves the performance of the direct D2D discovery scheme, no matter in the energy consumption, discovery delay or discovery success rate. Second, the binary exponential backoff algorithm without frozen backoff time achieves better efficiency of resolving collisions and shorter discovery delay than the inverse proportional transmission probability algorithm does. Therefore, the proposed two-phase hybrid D2D discovery mechanism is an outstanding design. In the second example, the impact of retry limit R T on the performance of D2D discovery mechanisms is studied. Figures 10-12 depict the analytic results of the energy consumption, discovery delay, and discovery success rate of the proposed D2D discovery mechanism under various retry limits R T 's. In Figure 10, the average number of transmitted beacons of a UE increases almost linearly with the retry limit R T . While the discovery delay in Figure 11 is almost an exponential function of R T . Furthermore, there exists a tradeoff between the discovery success rate and discovery delay (or energy consumption) according to  However, using the analytic results, one can find a proper retry limit R T to maximize the discovery success rate under the constraint of energy consumption or discovery delay. For example, in Figure 12 the improvement in the discovery success rate becomes insignificant when R T is over 5. Hence, it is suggested that R T is set no more than 5 in order to preserve a better discovery delay and energy consumption performance.
In the third example, the impact of radio interference from Wi-Fi access points (APs) and their connected devices on the performance of the proposed D2D discovery mechanism is studied. There are six Wi-Fi APs uniformly distributed over each cell. Each channel (among channels 1, 6, and 11) is used by two APs. There are six fully loaded UEs connected to each Wi-Fi AP all the time. Other parameters not mentioned here are the same as those in the first example except R T = 3. The performance of the proposed D2D discovery mechanism with Wi-Fi AP interference is compared to that without Wi-Fi AP interference. Figures 13-15 show the energy consumption, discovery delay, and discovery success rate of the proposed D2D discovery mechanism under the scenario with or without Wi-Fi AP interference. In Figures 13-15, the performance of the proposed D2D discovery mechanism under the scenario with Wi-Fi AP interference slightly degrades, compared with that without Wi-Fi AP interference. This is because more contentions and collisions may occur in the scenario with Wi-Fi AP interference, thus leading to performance degradation. However, since the binary exponential backoff algorithm used in the proposed scheme can effectively resolve collisions, the performance degradation due to radio interference is alleviated.

Conclusions
This article proposes a two-phase hybrid D2D discovery mechanism which combines the network-assisted and direct discovery techniques. In Phase 1, the BS sifts D2D candidates from all UEs to enhance the D2D discovery performance. In Phase 2, the Wi-Fi Direct is used to discover the target UE. However, the search and listen channel for the UEs of a D2D link is assigned by the BS and the binary exponential backoff algorithm without frozen backoff time is used to resolve collisions. The energy consumption, discovery delay, and discovery success rate of the proposed D2D discovery mechanism are analyzed. Evaluation results demonstrate that the proposed two-phase hybrid D2D discovery mechanism significantly outperforms the conventional direct D2D discovery and inverse proportional transmission probability schemes. Additionally, evaluation results validate the accuracy of our theoretic analyses and show that the energy consumption is a linear function of retry limit R T and the discovery delay is an exponential function of R T . There exists a tradeoff between the discovery success rate and discovery delay (or energy consumption). However, using the analytic results the optimal retry limit R T for maximizing the discovery success rate, under the constraint of energy consumption or discovery delay, can be properly designed. In the near future, we aim to construct the eNB and EPC systems in our laboratory using the 5G software packages supported by the open air interface (OAI) software alliance [33], and test our proposed mechanism on this real testbed.
Author Contributions: M.L. designed the D2D discovery mechanism, analyzed the performance, and wrote the paper; H.-L.T. implemented the D2D discovery algorithms and wrote the simulation programs. All authors have read and agreed to the published version of the manuscript.
Since the angle Θ is a uniform distribution, the probability p c is irrelevant to Θ. Thus, one can derive p c under the case of θ = π/2, as shown in Figure A1, where the source UE is located at the center of the circle of radius d. The probability p c that two UEs of a D2D link are located within a circle of radius d is approximately expressed as follows where A i (u) and A o (u) represent the coverage areas of the circle of radius d inside and outside the considered cell, respectively. Since there are six cells adjacent to the considered cell, A o (u) is divided by 6πR 2 in (A1). When u≤R−d, A o (u) equals zero. When u>R−d, A o (u) can be approximated by d[(u+d)−R], the area of the triangle indicated in Figure A1. Subsequently, one can derive p c as follows A i (u) Figure A1. Coverage areas of probing signals in two adjacent cells.