# Energy-Efficient Device Discovery Mechanism for Device-to-Device Communications in 5G Networks +
## 3 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. Phase 1:  
1. 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. 2. 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\({}^{\prime}\) in Figure 3) or adjacent cells (e.g., the pair B-B\({}^{\prime}\) in Figure 3), then the BS or EPC informs these two UEs of launching the D2D  
Figure 2: Proposed device-to-device (D2D) discovery algorithm. 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\({}^{\prime}\). UE A is the source which initiates the request while UE A\({}^{\prime}\) 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\({}^{\prime}\) 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\({}^{\prime}\). UE A starts in the search state while UE A\({}^{\prime}\) 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. Phase 2:  
1.