1 Introduction

For the establishment of device-to-device (D2D) communication in a 5G network, it is necessary for the network and the devices to discover the existence of neighbour devices which are qualified for D2D communication. There are two techniques for device discovery, Ad hoc network base, and network controlled base. In ad-hoc network base discovery, devices use the industrial scientific and medical (ISM) band, where interference between devices is uncontrollable. In network controlled base discovery, discovered devices operate in a licensed spectrum, and they are fully or partially controlled by the base transceiver system (BTS). In order to achieve an efficient device discovery, the neighbour devices, in time and space, should have a minimum energy and time consumption. If the two devices are adept and have too much information about each other, they just perform a random search which will result in low efficiency and low throughput. Normally neighbour discovery methods are affected due to the mobility decoration, where the devices have heterogeneous mobility. Therefore, accurate neighbour discovery is a big challenge.

There are many issues for establishing a D2D communication in cellular networks as 1. Modes of communication 2. Device discovery 3. Resources allocation, and 4. Interference management as depicted in Fig. 1. In terms of the modes of communication, there are cellular, dedicated and shared modes, where each of them has its own advantages and disadvantages [1]. But due to user capacity, shared mode is considered in this research. Moreover, three possible scenarios for D2D device discovery are available that are network assisted, direct device discovery and autonomous discovery. To avoidance of interference, network assisted discovery is considered.

Fig. 1
figure 1

Issues of establishing D2D network

For wireless synchronous network comprised of N devices that are homogeneously located on a predetermined plane, there is a problem of centralized network neighbour discovery where each device wants to discover maximum number of devices in its vicinity. Suppose there are K available radio resources and L allocated for device discovery purpose in the network. Each device can take one of the resources from L to send its device identity and can receive the identities of the remaining \(L - 1\) resources from other neighbour devices. All the devices broadcast their identity through coded transmission on a radio resource. In this scheme, a link level approach is adopted as \(N = c \times L\) to increase the average quantity of discovered devices where c is the degree of network density. In conventional, one device per resource would lead \(L - 1\) devices being discovered.

In this paper, a device discovery model is proposed for network assisted underlay D2D communication, where iterative decoding is proposed. Our proposed discovery method relies on multiple access scenarios, where numerous devices are jointly discovered resulting in overall device discovery performance. The suggested iterative decoding has many techniques such as successive interference cancellation (SIC), minimum mean square error (MMSE) and maximum likelihood (ML) with linear pre-processing. Pre-processor is an approach in which sub-optimal local optimisation algorithm is applied to the detection process in order to avoid the signalling overhead.

The rest of the paper is organised as follows: Sect. 2 presents, the device discovery modelling and related work. Section 3 offers, details of device discovery procedure for OFDMA system. Discovery model analysis and suppositions are presented in Sect. 4. Section 5 expresses the detail of iterative algorithms SIC and iterative detection and estimation. Section 6 offers the linear pre-processing for discovery and Sect. 7 presents the performance evaluation using the probability of misdetection and false alarm, while the paper is concluded in Sect. 8.

2 Device Discovery Modelling and Related Work

In general, communication model for device discovery is fully characterised and distinguished by two levels: 1. Device level discovery 2. Network level discovery. Joint device discovery can be implemented at a device and network level. Two main device discovery models of D2D communication in wireless networks are 1. Devices announce their presence simultaneously, 2. Devices searched by the BTS. In this research, the focus is on network level device discovery in which the BTS is involved, and the discovery model is illustrated in Fig. 2. The device discovery model is divided into two parts, D2D part, and BTS part. Discovery request is initiated by the device, if the required neighbour device is found directly by the device then a request is sent to the BTS for the direct D2D communication link. If a device is not directly discovered by the device, then it will report to the BTS for device discovery.

Fig. 2
figure 2

The role of device and BTS for device discovery

In general, discovery models are classified into two groups; probabilistic and deterministic [2,3,4,5]. The probabilistic approach as Birthday [3], improves the average discovery latency. The probabilistic approach can be applied on numerous application for its wonderful flexibility. While deterministic approach as Search Light [5] and Disco [4], do not perform well in term of discovery latency. This approach performs inadequately in average discovery latency and configuration flexibility is much poorer than a probabilistic algorithm. As for wireless sensor network in out-band communication worst cases, bound-ness is not necessary since nodes are substantially adjacent to each other, so they are not affected by discovery latency [6]. Furthermore, collision avoidance base multi-channel ALOHA with energy sensing (MCALOHA-ES) is proposed in [7]. This scheme is energy and time saving and resolve the contention. Some more device discovery procedures which are proposed by the researchers are compared in Table 1. A comparison is made in the table for different network and services types. In a cellular system, device discovery must have minimum discovery latency. Therefore, there is a need to focus on designing neighbour discovery with smaller discovery period, a higher discovery ratio and tractability in configuration as depicted in Fig. 3.

Table 1 Comparison of different proposed algorithm, used in which networks and service types
Fig. 3
figure 3

Local area network for D2D communication and its different scenarios

3 Device Discovery Procedure for OFDMA System

In this work, a scenario of an orthogonal frequency division multiple access (OFDMA) base LTE networks is assumed. The basic disparity between an OFDM and an OFDMA systems is that in the OFDM, the EU is apportioned on the time domain while in an OFDMA system the EU would be apportioned by both frequency and time [24]. This is valuable for LTE since it makes conceivable to exploit frequency reliance scheduling. In the OFDMA network based D2D communications, spatial radio resources are centrally assigned to an individual device by the BTS. In the radio resource sharing, the frequency is separated into sub-channels and time is separated into slots. The unit of resource allocation is radio resources, which involve one sub-channel per slot. That is why OFDMA makes grids of time and frequency for radio resources as shown in Fig. 4. In each discovery time, one round of discovery procedure is completed. \(T_{dis}\) is the regular discovery time and each time is indexed by numbers. At the beginning of every discovery time, there is a code swap period, and the complete length of the code swap is T. The code swap time is very small as compared to discovery time.

Fig. 4
figure 4

The radio resources for device discovery

During the code swap time, entire radio resources are shared by the devices. Every discovery code message contains shortcode which describes the coded application name of the device. Time slots (T S ) and frequency sub-channel (F S ) are used during the code swap period. So, total radio resources during the code swap time is \(T_{s} \times F_{s}\). During every code swap time, a device chooses a radio resource of a random from \(T_{s} \times F_{s}\), the available radio resources and transmit a discovery message. During the period in which a particular radio resource is comprised, the device is in a broadcasting mode. Therefore, this device cannot accept any discovery message from any other device in this particular period. On the other hand, devices can accept discovery messages from other neighbouring devices when they are in receiving mode. It is noted that if two or more devices transmit discovery messages using the same radio resource, the discoverer device will not be able to organize the messages and collision will occur [25].

After the code swap period, the device can make an announcement through an application knowledge message about the comprehensive knowledge of application in the device. Each application knowledge message has the information of one application which consists of the application name “social network” and additional useful knowledge “ID of the social network”. There are no common or shared radio resources for transmitting the application information signal. Instead, application message signal is multiplexed with usual data transmission. Therefore, every device needs to request a dedicated radio resource from the BTS.

4 Discovery Model Analysis and Suppositions

Consider discrete time wireless synchronous OFDMA system with single subcarrier, flat fading and memoryless channel characteristics. The choice of sub carries is very important as it is constraint between BTS power and user supported as shown in MATLABFootnote 1 simulation result Fig. 5. Results show that more subcarriers lead to more power constraint and capacity. In the case of multiple-input-multiple-output (MIMO) system, the output is

$${\text{y}} = {\mathbf{H}}{\text{s}} + {\text{n}}$$
(1)

where H is channel matrix of a flat fading MIMO system patterned by \(M_{R} \times M_{T}\).

$${\mathbf{H}} = \left[ {\begin{array}{*{20}c} {{\text{h}}_{1,1} } & {{\text{h}}_{1,2} } & \cdots & {{\text{h}}_{{1,M_{T} }} } \\ {{\text{h}}_{2,1} } & {{\text{h}}_{2,2} } & \ldots & {{\text{h}}_{{2,M_{T} }} } \\ \vdots & \vdots & \ddots & \vdots \\ {{\text{h}}_{{M_{R} ,1}} } & {{\text{h}}_{{M_{R} ,2}} } & \cdots & {{\text{h}}_{{M_{R} ,M_{T} }} } \\ \end{array} } \right]$$
(2)

Received vector is \({\text{y}}_{\text{i}} = \sum\nolimits_{{{\text{j}} = 1}}^{{{\text{M}}_{\text{T}} }} {{\text{h}}_{\text{ij}} *{\text{s}}_{\text{j}} + {\text{n}}_{\text{i}} , {\text{where }}\;{\text{i}} = 1,2 \ldots {\text{M}}_{\text{R}} }\) and \({\text{s}}_{\text{j}}\) transmitted vector \({\text{s}}_{\text{j}} = \left[ {{\text{s}}_{1} , {\text{s}}_{2} , \ldots ,{\text{s}}_{\text{j}} } \right]\). Channel state information (CSI) is available but, H is a random variable. The mutual information between input and output is \({\mathbf{I}}\left( {{\text{s}}:{\text{y}}} \right) = {\text{B log}}_{2} \left[ {{\mathbf{HR}}_{\text{s}} {\mathbf{H}}^{H} + {\mathbf{I}}_{{M_{R} }} } \right]\), where channel capacity depends upon the mutual information so, \(C = \mathop {max}\limits_{P\left( s \right)} \varvec{I}\left( {{\text{s}};{\text{y}}} \right) = \mathop {max}\limits_{P\left( s \right)} h\left( {\text{y}} \right) - h({\text{y}}|{\text{s}})\) and

Fig. 5
figure 5

Effect of subcarriers on transmission power and user supported

$$C = \mathop {max}\limits_{P\left( s \right)} B\;log_{2}\;{\text{det}}\left( {{\mathbf{HR}}_{s} {\mathbf{H}}^{H} + {\mathbf{I}}_{{M_{R} }} } \right)$$
(3)

5 Iterative Algorithms

5.1 Successive Interference Cancellation (SIC)

The device discovery performance can be enhanced by cancelling out the interference as

$${\hat{\text{s}}}_{k} = {\text{W}}_{\text{k}}^{\text{T}} {\text{y}}$$
(4)
$${\hat{\text{s}}}_{1} = {\text{W}}_{1}^{\text{T}} {\text{y}} = {\text{W}}_{1}^{T} \left( {{\mathbf{H}}{\text{s}} + {\text{n}}} \right)$$
(5)
$$= {\text{w}}_{1}^{T} {\mathbf{H}}{\text{s}} + {\text{w}}_{1}^{T} {\text{n}} = {\text{s}} + \underbrace {{{\text{w}}_{1}^{T} {\text{n}}}}_{noise}$$
(6)
$${\hat{\text{s}}}_{2} = {\text{W}}_{2}^{T} \left( {{\text{y}} - {\text{h}}_{1} {\hat{\text{s}}}_{1} } \right) = {\text{w}}_{2}^{T} \left( {{\mathbf{H}}{\text{s}} + {\text{n}}} \right) - {\text{w}}_{2}^{T} {\text{h}}_{1} {\hat{\text{s}}}_{1} )$$
(7)
$$= {\text{s}} + {\text{w}}_{2}^{T} {\text{n}} - {\text{w}}_{2}^{T} {\text{h}}_{1} {\hat{\text{s}}}_{1}$$
(8)

This subtraction procedure is repeated until all vectors have been discovered, and it is called Layer Peeling. Minimum mean square error with successive interference cancellation (MMSE-SIC) is used for iterative detection, but it has high computational complexity

$${\mathbf{R}}_{ss} = E\left[ {\left( {{\text{s}} - {\hat{\text{s}}}} \right)\left( {s - {\hat{\text{s}}}} \right)^{H} } \right] = \sigma_{n}^{2} {\mathbf{P}}$$
(9)

where \({\mathbf{P}} = \left( {{\mathbf{HH}}^{\text{T}} + \sigma_{n}^{2} {\mathbf{I}}} \right)^{ - 1}\).

5.2 Iterative Detection and Estimation

The most joint methodology to dealing with channel uncertainty is iterative detection and channel estimation. Channel uncertainty is overlooked altogether in the starting and the data is perceived with a receiver designed using the uncertain channel. Then, the channel is re-estimated using detected data in the first step. Then the estimated channel is reused to design a receiver to perceive the data. This method is called local optimisation algorithm. After a couple of iterations, this algorithm converges to a local solution. Mathematically, the received signal is represented as \(\underbrace {{\left[ {{\text{x}}\left[ 1 \right]\; \ldots \;{\text{x}}\left[ {\text{N}} \right]} \right]}}_{\text{x}} = {\mathbf{H}}\underbrace {{\left[ {{\text{s}}\left[ 1 \right]\; \ldots \;{\text{s}}\left[ {\text{N}} \right]} \right]}}_{\text{s}} + \underbrace {{\left[ {{\text{n}}\left[ 1 \right]\; \ldots \;{\text{n}}\left[ {\text{N}} \right]} \right]}}_{\text{N}}\). Estimation of the channel is a linear least squares problem and an estimate of H can be found using linear least squares method. The estimate uses the detected data \({\hat{\text{S}}}\).

$${\widehat{\mathbf{H}}} = {\text{X}}{\hat{\text{s}}}^{H} \left( {{{\hat{\text{s}}\hat{s}}}^{H}}\right)^{-1}$$
(10)

An equaliser designed per this channel estimate may then be used to form an estimate of the transmit signal for use in channel estimation in the next iteration. The received signal may be expressed as

$${\text{x}} = \underbrace {{{\bar{\mathbf{H}}}{\text{s}}}}_{\text{signal}} + \underbrace {{{\mathbf{PU}}{\text{s}}}}_{\text{interference}} +\, {\text{n}}$$
(11)

where P is a matrix that defines an ellipsoid that models the channel uncertainty. The ellipsoid is the iterative solution to find out the position of devices.

6 Linear Pre-processing

It is well-defined by (11) that the second term \(\left( {\underbrace {{{\mathbf{PU}}{\text{s}}}}_{\text{interference}} + {\text{n}}} \right)\) establishes interference to the device discovery process and thus poor discovery results, if the second term is not blocked. Therefore, linear pre-processing is used to overwhelm the second term. This methodology is a sub-optimal local optimisation algorithm since it evaluates to overwhelm a term that is data dependent and could support the data detection process. Consider the condition where \({\text{M}}_{\text{R}} \ge {\text{M}}_{\text{T}} + {\text{M}}_{\text{P}}\). Under this postulation, it is potential to take a matrix W, with rank equal to \(M_{T}\) and null space of P. Where \({\mathbf{WP}} = 0\), when this pre-processing is applied at the received signal, interference term completely disappears as

$${\mathbf{W}}{\text{y}} = \underbrace {{{\mathbf{W\bar{H}}}}}_{\text{G}}{\text{s}} + {\mathbf{W}}{\text{n}}$$
(12)

From (11), linear pre-processor is to eradicate the terms generated by the channel uncertainty. Then SD or ML is applied to calculate effective channel G in order to distinguish the transmitted data and make sure that interference term does not reduce the recognition of the transmitted signal. W s are weights of linear pre-processor and when they are applied at the received signal x, the cost function J is

$$J = E\left\{ {\left| {{\mathbf{w}}_{\text{K}}^{\text{H}} {\text{y}} - {\text{g}}_{\text{K}}^{\text{H}} {\text{s}}} \right|^{2} } \right\}$$
(13)

After minimising the cost function, weights will be represented as

$${\text{w}}_{\text{K}} = {\mathbf{R}}_{\text{yy}}^{ - 1} {\mathbf{R}}_{\text{ys}} {\text{g}}_{\text{K}}$$
(14)

where \({\mathbf{R}}_{\text{ys}} = E\left\{ {{\text{ys}}^{H} } \right\}\) and \({\mathbf{R}}_{\text{yy}} = E\left\{ {{\text{yy}}^{H} } \right\}\).

For wK, the cost function becomes

$$J = {\text{g}}_{\text{K}}^{\text{H}} \left( {{\mathbf{R}}_{\text{ss}} - {\mathbf{R}}_{\text{sy}} {\mathbf{R}}_{\text{yy}}^{ - 1} {\mathbf{R}}_{\text{ys}} } \right){\text{g}}_{\text{K}}$$
(15)

Iterative detection and channel estimation require a good initialization to perform well but it incorporates the uncertainty term into the detection process. Applying a linear pre-processor will suppress the interference term due to the channel uncertainty and provide a better estimate but does not incorporate the interference term into the detection process. As shown in Fig. 6, the smallest ellipse shows the maximum neighbour device which is qualified for D2D communication.

Fig. 6
figure 6

Ellipsoid model for device discovery. Smallest circle where maximum devices discovered

Perfect channel information is obligatory to accomplish efficient power allocation, interference management, and resource allocation. Cellular systems need information about the downlink channel from user terminals, while uplink channel information is readily calculated at the BTS. D2D communication involves channel gain information for D2D pairing, channel gain among D2D transmitter and cellular users, and the channel gain among cellular transmitter and D2D users. The simulated relation between power constraint and distance from BTS is shown in Fig. 7.

Fig. 7
figure 7

Transmitted power and maximum covered devices under the BTS

The conversation of such additional channel information can develop an insupportable overhead to the arrangement if the system desires instantaneous CSI feedback. Network based device discovery is prioritised by using the air interface instead of service level prioritising. Service level prioritising will be deliberated in future work for D2D communication. In the networks assisted D2D communication, one of the improvements for discovery is potential against the collisions and also discovery time can be efficiently controlled by the network. Furthermore, BTS has the information of all the devices centrally and resources allocation in an optimised way to save the resources for multi-hope and single hope D2D communication. Therefore, the discovery process can be fast-tracked through numerous methods.

Important parameters of device discovery signal must have the characteristics of power efficiency, interference tolerance, free from near and far effects, and minimal signalling overhead. How to implement this technique in multi-hope network device discovery is a vital study problem. Discovered devices must be efficiently coordinate frequency, time, power, space and device cooperate jointly with each other.

7 Performance Evaluation

Using probability of false alarm (P fa ) and misdetection (P md ), the performance of our proposed scheme is evaluated. Power consumption, number of users supported, and distance of the devices are also calculated in addition to calculating the SNR of each discovered device. Determination of coefficients k 1 and k 2 which are used to accomplish the target discovery along with d n can be achieved by detection theorem [26]. Discovery accuracy of neighbour terminal discovery in our proposed model using P fa and P md is shown in Fig. 8. Results show an improvement in comparison with the work achieved by

$$\begin{aligned} {\mathbf{P}}_{{{\mathbf{fa}}}} & = \frac{1}{{\sqrt {2\pi } }}\int_{{x = Q^{ - 1} \left( {k_{1} } \right)}}^{\infty } {\int_{{z = d_{n} }}^{{d_{max} }} {\left( {1 - Q\left( {\frac{{\left( {Q^{ - 1} \left( {Q\left( x \right) - k_{1} } \right) - x} \right)}}{\sigma \left( z \right)}} \right)} \right) \times \frac{2z}{{d_{max}^{2} - d_{n}^{2} }} \cdot e^{{ - x^{2} /2}} dz dx} } \\ & \quad + \frac{1}{{\sqrt {2\pi } }}\int_{x = - \infty }^{{Q^{ - 1} \left( {1 - k_{2} } \right)}} {\int_{{z = d_{n} }}^{{d_{max} }} {\left( {1 - Q \left( {\frac{{\left( {x - Q^{ - 1} \left( {Q\left( x \right) + k_{2} } \right)} \right)}}{\sigma \left( z \right)}} \right)} \right) \times \frac{2z}{{d_{max}^{2} - d_{n}^{2} }} \cdot e^{{ - x^{2} /2}} dz dx} } \\ \end{aligned}$$
(16)
$$\begin{aligned} {\mathbf{P}}_{{{\mathbf{md}}}} & = \frac{1}{{\sqrt {2\pi } }}\int_{{x = Q^{ - 1} \left( {k_{1} } \right)}}^{\infty } {\int_{z = 0}^{{d_{n} }} {Q \left( {\frac{{\left( {Q^{ - 1} \left( {Q\left( x \right) - k_{1} } \right) - x} \right)}}{\sigma \left( z \right)}} \right)\frac{2z}{{d_{n}^{2} }} \times e^{{ - x^{2} /2}} dz\;dx} } \\ & +\quad \frac{1}{{\sqrt {2\pi } }}\int_{x = - \infty }^{{Q^{ - 1} \left( {1 - k_{2} } \right)}} {\int_{z = 0}^{{d_{n} }} {Q \left( {\frac{{\left( {x - Q^{ - 1} \left( {Q\left( x \right) + k_{2} } \right)} \right)}}{\sigma \left( z \right)}} \right)\frac{2z}{{d_{n}^{2} }} \times e^{{ - x^{2} /2}} dz\;dx} } \\ \end{aligned}$$
(17)

Advantages of proposed model’s results are shown Figs. 9, 10, and 11. In our proposed model, an improvement can be seen in the number of accommodated users and system capacity. Figure 9 presents the number of supported users relative to BTS transmitted power and terminal distances from the BTS. With respect to base station power, the maximum distance between the devices and a maximum number of the devices which can be accommodated for D2D users and cellular users. Figure 10 shows the SNR of each discovered devices. Each discovered device SNR is calculated and based on calculated SNR, it is decided that which devices are qualified for D2D communication. One of the advantages of D2D communication is increasing the system capacity dramatically. Figure 11, shows the enhancement in a capacity that has been improved based on the utilisation of our proposed scheme.

Fig. 8
figure 8

Rate of accuracy in terms of P fa and P md

Fig. 9
figure 9

3D view of transmitted power, mobile devices distance and number of supported devices

Fig. 10
figure 10

Calculated SNR of each discovered device

Fig. 11
figure 11

3D plot of transmitted power, device’s distance, and system capacity

8 Conclusion

Neighbour device discovery in cellular networks is studied in this work, and results are found based on iterative detection with linear pre-processing that converge to an ellipsoid solution in OFDM single carrier sub-system, where linear pre-processing removes the interference term. The proposed solution has been verified in different scenarios such as system capacity, user supported at different subcarriers, maximum device distance, and SNR of each discovered device. Proposed solution correctness has been also verified by the probability of misdetection and false alarm. The cooperative iterative method helps to minimise the interference from the unwanted sources and channel uncertainty. Results show an improvement in system capacity and a large number of discovered devices in minimum time. It also shows the minimum misdetection ratio.