Enhanced Integrated Satellite-Terrestrial NOMA with Cooperative Device-to-Device Communication

The currently deployed terrestrial wireless networks experience difficulties while coping with the massive connectivity demands of coexisting users and devices. The addition of satellite segments has been proposed as a viable way of providing improved coverage and capacity, leading to the formation of integrated satellite-terrestrial networks. In such topologies, non-orthogonal multiple access (NOMA) can further enhance the efficient use of wireless resources by simultaneously serving multiple users. In this paper, an integrated satellite-terrestrial NOMA network is studied where cooperation between ground users is allowed, following the device-to-device (D2D) paradigm. More specifically, the proposed satellite NOMA cooperative (SANOCO) D2D scheme optimally selects pairs of users, by considering the channel conditions of the satellite and the terrestrial D2D links. In SANOCO-D2D users are served through NOMA in the satellite link, and then, if the weak user fails to decode its signal, terrestrial D2D communication is activated to maintain the total sum rate of the system. Comparisons with conventional orthogonal multiple access (OMA) and an alternative NOMA optimal user pairing scheme show that significant sum rate and spectral efficiency gains can be harvested through SANOCO-D2D under varying channel conditions and terrestrial D2D bandwidth.


Introduction
Future wireless networks will be characterized by dense topologies and diverse services, ranging from high-throughput multimedia applications to ultra-reliable Internet of Things (IoT) communication. The coexistence of both users and devices results in unprecedented hurdles for the currently deployed terrestrial infrastructure. At the same time, aiming to alleviate the stress on terrestrial wireless networks, the integration of satellite and aerial segments has been proposed [1,2]. The efficient cooperation among the terrestrial and space segments enables integrated satellite-terrestrial networks to enjoy improved coverage for both urban and remote areas and increased capacity to serve beyond fifth generation (5G) services. At the same time, the addition of satellites acting as base stations (BSs) in space offers several key benefits to the wireless transmission. More specifically, users can experience improved diversity by connecting to either a terrestrial or satellite BS or both, opportunistically choosing the best possible point for transmission and reception [3].
Another dimension that has been investigated in recent years is the development of spectral efficient multiple access techniques to accommodate the massive connectivity requirements for both users and devices. In this field, non-orthogonal multiple access (NOMA) allows multiple users to share the same resources, thereby avoiding the orthogonal use of wireless channels and its inefficiencies. Since NOMA in the power domain relies on appropriate power allocation, both strong and weak users can be served, maintaining both system throughput and user fairness [4]. An important aspect for Furthermore, the integration of satellites to complement terrestrial communication provides an interesting trade-off of additional complexity in the architecture, production costs and round-trip delay versus the benefits of improved link quality and coverage. However, it has been shown that the negative aspects of adding a satellite segment are significantly mitigated in the case of LEO satellites. More specifically, the low orbit altitude of LEO satellites, compared to the medium Earth orbit (MEO) and geosynchronous Earth orbit (GEO) satellites, results in one-directional trip delay of less than 14 ms, and a round-trip delay of less than 50 ms being comparable to those of terrestrial links [3]. Furthermore, owing to the the small size of satellites and pipeline production, manufacturing costs of LEO satellites are significantly minimized [3,15]. At the same time, the interests of industrial stakeholders in deploying dense LEO constellations highlights the importance of adding more communication segments in the architecture of 5G and beyond networks [17,18]. It is important to note that satellite segments can act in collaboration with other novel propositions, such as spectrum sharing and cognitive radio in order to boost their performance [14].
In this work, we aim at improving the performance of integrated satellite-terrestrial NOMA networks comprising multiple ground users by enabling cooperative D2D communication among them. For this purpose, a pairing scheme for ground users is presented, considering each user's satellite channel, and the terrestrial channels between the users. The objective function of the pairing scheme aims to maximize the system's sum-rate, by evaluating both the satellite segment where NOMA is applied and the terrestrial D2D link between the users that assists the transmission. Specifically, the whole transmission is divided into two phases. In the first transmission phase, the satellite transmits through NOMA towards a pair of users, sharing the same sub-channel, and assigns them a suitable fraction of the total transmit power in order to guarantee that the achievable users' rates are at least equal to those of the conventional OMA. Then, in the second transmission phase, the strong user, i.e., the one with better satellite channel conditions, decodes the weak user signal, and if the D2D link between them provides a higher rate for the weak user than the achievable rate through satellite NOMA, D2D transmission takes place. The main goal of this study is to identify the pairs of users that can benefit from the terrestrial cooperation combined with NOMA in satellite segment, thereby maximizing the total sum rate of the system compared to standalone NOMA. Towards this end, user pairing is modeled as a maximum weighted perfect matching problem in graph theory, considering the achievable rates in the terrestrial and satellite segments. More specifically, in this work, the following contributions are provided: • A novel user pairing scheme is proposed, considering the satellite channels and the terrestrial D2D channels. In order to study this problem, graph theory is invoked-modeling it as a maximum weighted perfect matching problem.

•
Power allocation for NOMA in each transmission period considers the achieved rates through orthogonal multiple access (OMA). In this way, the proposed power allocation guarantees that user pairing will lead to a higher rate for each pair member and an overall rate increase for the network.

•
The impact of various system parameters inherent to satellite-based access and D2D networks have been evaluated, i.e., the elevation angle and the bandwidth allocation, respectively. As a result, guidelines are given in order to achieve improved satellite-terrestrial cooperation and spectral efficiency, compared to standalone NOMA and OMA deployments.
The structure of the paper is as follows. Section 2 presents the system model, while Section 3 provides the details of SANOCO-D2D scheme. Next, performance evaluation is conducted in Section 4. Finally, conclusions and future directions are given in Section 5.

Topology
A network consisting of a LEO satellite and N = 2K user equipment (UEs) located in a circle with radius R and within the LEO satellite coverage area is considered, as depicted in Figure 1. The UEs can communicate with the satellite and with each other via D2D links. The satellite is equipped with an antenna with transmitting gain G s t and total available transmit power P s . Additionally, the satellite downlink frequency operates at a frequency f s and the total available bandwidth is denoted as B s . Furthermore, each UE i has three antennas, one for the reception of the satellite signal with a reception gain denoted as G s r and two antennas for the transmission and the reception of the terrestrial signal to and from other devices that are located within the area of interest and with gains G d t and G d r , respectively. The operating frequency for the terrestrial D2D links is denoted as f d and the total available bandwidth as B d . Besides, each UE i has a maximum available transmit power P d and the receiver equipment for the satellite and the terrestrial D2D signals have noise temperatures denoted as T s and T d , respectively. UEs are served through a satellite-aided and cooperative D2D network where the satellite is mainly responsible for the communication, while the D2D scheme is employed between the devices to improve the total communication quality. The communication with the UEs is divided into two phases. During the first transmission phase, the satellite employs NOMA based on a user pairing policy in the power domain to transmit the data to pairs of UEs using superposition coding, as illustrated in Figure 1. Practically, the satellite takes into account the channel conditions of each UE i regarding the satellite link and the channel conditions of terrestrial D2D links between each UE i and UE j pair where i = j, and applies user pairing. Each pair of UEs will share the same sub-channel in the frequency/time domain and within this sub-channel, a power allocation scheme will take place to assign different power levels to each UE i . During the second phase, the UEs with favorable satellite channel conditions from each pair decode the received satellite signal and transmit the decoded signal via a D2D communication link to their pair. Thus, the UEs with weak channel conditions towards the satellite will have two copies of their own signal in the power domain and will select the best one in order to achieve the maximum rate. On the other hand, the UEs with strong channel conditions towards the satellite, perform successive interference cancellation (SIC) and get their own signals. Terrestrial communication between D2D pairs takes place over the time/frequency domain using OMA. Hence, each D2D pair communicates in a different sub-channel without interfering with D2D links of neighboring pairs, as illustrated in Figure 1.

Channel Model
The fading environment for the land mobile satellite (LMS) channel is modeled through the Loo's model distribution [19], where the power of the line of sight (LoS) component is log-normally distributed with parameters (M, Σ), while the power of the multipath component (MP) follows the Rayleigh distribution with the complex channel coefficients being represented by h s i for each UE i , assuming zero mean and variance: Furthermore, pathloss attenuation using the free space pathloss (FSL) model is considered, being denoted as L FS i for each UE i . In addition, a maximum Doppler shift of 40 kHz is assumed and modeled with the Jakes model [20].
Regarding the terrestrial D2D links, the multipath fading is modeled by the Rayleigh distribution with zero mean and unit variance ∼ N (0, 1). The complex channel coefficient is h d i,j for each D2D pair of UE i and UE j . Additionally, log-normal shadowing is considered with zero mean and variance σ 2 λ with ∼ N 0, σ 2 λ . Furthermore, pathloss attenuation of the D2D links, denoted as PL(d) i,j and expressed in dB for a pair of users being d km apart from each other, is modeled as in [21]: PL(d) i,j = 127 + 30 log 10 (d). ( Moreover, the LMS and terrestrial D2D links are degraded by additive white Gaussian noise (AWGN) ∼ N 0, σ 2 . The noise power is calculated as the product of the Boltzmann constant k, the receiver system noise temperature T g , (g = {s, d}) and the available bandwidth B s and B d . Thus, the noise power of the satellite and terrestrial receivers is equal to N s = kT s B s and N d = kT d B d , respectively. Consequently, the corresponding variances for each receiver type are equal to σ s = √ N s and σ d = √ N d .

Transmission Parameters and Achievable Rates
In case that the satellite applies the NOMA scheme based on user pairing, for each pair of users, the satellite transmits a superimposed signal as: where s i and s j are the signals for the users UE i and UE j , respectively, and a i and a j denote the fraction of the total satellite transmit power P s that is assigned to each user, with a i + a j = 1. Then, each UE l with l = {i, j} receives the satellite signal: where z s n is the AWGN noise in the satellite link. The channel gain Γ l for each UE l including additional gains, losses and the noise power of the satellite receiver N s is given as: Assume that UE i and UE j form a pair with Γ i ≤ Γ j . Thus, the UE j is the strong channel satellite user and UE i is the weak channel satellite user. According to the NOMA principle, the fraction of the total satellite transmit power assigned to UE j should be less than the fraction of the power assigned to UE i i.e., a j ≤ a i . As a result, UE j performs SIC and decodes their signal s j . At the same time, the weak channel satellite user UE i directly decodes the s i , and s j is treated as noise. Thus, the achievable rates for each UE i and UE j that form a pair in a satellite sub-channel are given from the following equations: where B NOMA c is the satellite channel bandwidth in the case of NOMA. In particular, when the satellite applies NOMA, user pairing allocates to each pair a sub-channel on the satellite and within this sub-channel different power allocation factors are assigned to each user of the pair. Therefore, the total number of sub-channels in this case is equal to N/2 and the total available satellite bandwidth is equally distributed to each sub-channel. Thus, the satellite channel bandwidth for NOMA is equal to B NOMA c = 2B s /N. On the contrary, for OMA, each user is allocated a separate channel. Thus, the available satellite bandwidth is equally assigned to each UE k . As a result, the channel bandwidth in this case is equal to the channel bandwidth in case of NOMA, multiplied by 1/2, i.e., B OMA c = B NOMA c /2, and the achievable rate for each UE k is given as: Regarding the terrestrial communication, the channel gain for the D2D link Λ i,j between UE i and UE j , including the channel coefficient |h d i,j | 2 , additional gains, losses and the noise power of the terrestrial receiver N d , is modeled as: where PL(d) i,j is equal to the antilogarithm of the result that is calculated via (2). The achievable rate for UE i through the D2D link with UE j it is equal to: where B D2D c is the channel bandwidth that is allocated to a pair of users forming a terrestrial D2D link. Since D2D communication between a pair of users takes place in a different sub-channel, we do not take into account interference between the satellite and the D2D links. The total bandwidth for D2D OMA communication is equally allocated to the total number of pairs and is equal to N/2. Thus, the channel bandwidth that allocated to a pair of users with regard to the corresponding D2D link is equal to B D2D c = 2B d /N. Also, it is noteworthy that the achievable rate for user UE j is equal to the achievable rate for user UE i in case of a D2D link R Finally, concerning the CSI reporting procedure, pilot symbols are sent from the satellite, prompting the UEs to estimate their satellite link CSI. Simultaneously, UEs transmit pilot symbols, enabling UEs within their coverage to estimate their D2D channel conditions. In the next step, the satellite receives the CSI of the satellite and D2D links, and while acting as a central node, executes SANOCO-D2D. It should be noted that the UEs are able to identify whether the D2D link is profitable compared to standalone optimal NOMA user pairing, by comparing the corresponding achievable rates. If a D2D link between a pair of users is not profitable, it is an outage, so UEs notify the satellite. After that, the satellite notifies the UEs about the formed pairs and whether or not the D2D link will be used. Moreover, retransmissions rely on an Acknowledgment/Negative-Acknowledgment (ACK/NACK) mechanism, where the UEs broadcast short-length error-free packets via a separate narrow-band link, informing the network on whether or not the packet transmission was successful.

Satellite-Aided NOMA with Cooperative D2D Communication
In this section, details on the proposed satellite-aided NOMA with cooperative D2D (SANOCO-D2D) scheme are given. Moreover, in order to better illustrate the SANOCO-D2D technique, a toy network is presented.

SANOCO-D2D Operation
At the start of each transmission phase, UE i reports its CSI to the satellite that estimates the channel coefficient |h s i | 2 and calculates the channel gain Γ i using (5). Moreover, the channel gain for the D2D link Λ i,j is calculated between each UE i , UE j pair, using the reported channel coefficient |h d i,j | 2 via (9). Next, the satellite applies NOMA based on user pairing and calculates the power allocation factors for each pair by solving the following maximization problem: Essentially, the solution to the maximization problem (11) is the optimal power allocation factor a j for the strong user UE j that maximizes the sum rate and guarantees that the achievable rate of users through NOMA will not be less than the achievable rate of OMA. Since Γ i ≤ Γ j , the optimal power allocation factor α j of the strong user UE j is given as in [6]: It is important to note that the achievable rate of the weak satellite user R under optimal power allocation is equal to the R OMA i . Thus, the power allocation factor for the weak satellite user should satisfy the rate constraint for this user, while allocating all the remaining power to the strong satellite user to maximize the achievable sum rate.
An important element of SANOCO-D2D is the possibility of D2D communication when the weak user is not able to decode its message through NOMA. In this case, the strong satellite user UE j is responsible for transmitting the received signal from the satellite to the weak satellite user UE i . Due to the use of NOMA at the satellite, UE j decodes the signal of weak user UE i and acts as a relay to forward it to its destination. Therefore, the weak satellite user UE i will have two copies of its own signal and selects the best one in order to maximize its achievable rate. For the strong user, the achievable rate of the weak user's signal is equal to: The achievable rate of UE i that will be served via D2D cooperation with UE j is given by: The total sum rate of the UE i and UE j pair is calculated as: is the rate that the weak user UE i is able to achieve using the proposed cooperative technique.

Remark 1.
It is noteworthy that in the worst case in which the D2D channel between the two users is not , the weak user will select to retrieve its data from the received satellite signal, maintaining the rate of each user and the total sum rate as in [6]. On the contrary, if R the weak user will retrieve its data from the received signal through the D2D link, achieving a higher rate than R OMA i , significantly benefiting the total sum rate compared to the result in [6].

Remark 2.
In cases where D2D communication is highly profitable, i.e., R user is able to achieve the maximum rate of R DECODED (i,j) i . As a result, the total sum rate will be equal as all quantities will be positive. Thus, in the proposed scheme, the total sum rate is bounded as R In conclusion, the maximum sum rate will be equal to the case where only the strong user is connected to the satellite, while the upper bound for the rate of the weak user UE i will be equal to R DECODED (i,j) i and the lower bound will be equal to R OMA i . So far, we have analyzed the proposed technique for an arbitrary UE pair. Since the network consists of N = 2K users, the main goal is to maximize the total sum rate of the system. Therefore, a matching scheme between terrestrial users must take place in order to identify those user pairs that maximize the total sum rate of the system. Towards this end, SANOCO-D2D considers both the channel between the satellite and each user of the system and the terrestrial D2D channel among the possible user pairs. For this purpose, it is necessary to define a binary matrix U that presents the pairing relationship between the users: The diagonal elements of the pairing matrix U are equal to zero because one user cannot pair itself. Furthermore, it can be easily observed that that u i,j = u j,i , because if user UE i forms a pair with UE j , then u i,j = 1, and of course, the pair of UE j is user UE i ; thus, u j,i = 1. The following maximization problem describes the proposed scheme for the whole network: Practically, the value of the objective function at the optimal solution of the maximization problem (17) is the maximum sum rate, denoted as R max , of the system. The first constraint of the maximization problem states that each user can pair with exactly one other user.
The maximization problem (17) is an integer programming problem which is hard to solve. In order to solve this problem efficiently, a weighted matching graph G = (V, E) is created, where the total number of vertices is equal to the total number of users |V| = N. Thus, each vertex v i ∈ V represents the corresponding user UE i . Moreover, each vertex v i with i = {1, . . . , N} is connected to all the other vertices that is not already connected v j ∈ V with i = j and j = {1, . . . , N}, forming the edge e i,j ∈ E with weight w i,j that represents a possible pairing of UE i and UE j . G is an undirected graph in which edge e i,j exists and there is no existence of the backward edge e j,i , so the total number of edges equals |E| = ( N 2 ) = N (N − 1) /2, which is the choice of two users by N total users. For each edge of the graph, the connection of the corresponding vertices are defined as: Regarding the proposed technique, the w i,j = R i,j , which is the total sum rate that pair of users UE i and UE j can achieve and is always positive. Thus, the maximization problem (17) is modified, as a maximum weighted matching problem in graph theory and specifically perfect, because each user will match with exactly one other user, which can be solved optimally by the Edmonds algorithm [22] in polynomial time. The Edmonds algorithm can be implemented in time O(|V| 3 ) [23,24], and faster implementation with time complexity O(|V||E| log |V|) was given in [25]. Algorithm 1 shows the procedure that is followed in order to create the maximum weighted matching graph.

Algorithm 1: Graph creation.
1 Input: Total number of UEs N; Connect vertices v i and v j with and edge e i,j in G; 9 Set initial weight of the edge e i,j to w i,j = 0; Regarding the operations that should be performed during the execution of Algorithm 1, at first, the total number of users N is given as an input and the vertices of the graph which represent the UEs in the system are created. Thus, for each UE i with (1 ≤ i ≤ N) a corresponding vertex v i is created and added to the graph G and to the set of vertices V. After that, each vertex of the graph should be connected with all the other vertices in the graph that is not already connected. For this reason, the algorithm visits the vertex v i with (1 ≤ i ≤ N) and connects this vertex with all the other vertices v j of the graph with (i < j ≤ N) via a properly labeled edge e i,j with initial weight w i,j = 0. Additionally, the new edge e i,j with weight w i,j should be added to the set of edges E of the graph. When the edge creation procedure terminates, Algorithm 1 gives as an output the graph structure that will be used for this specific number of UEs N in order to update the weights of each edge and solve the maximum weighted matching problem using the Algorithm 2 and the Edmonds algorithm. In this way, SANOCO-D2D can model all the possible pair of users that are able to be formed and served only from the satellite via NOMA or via NOMA and D2D, when the D2D link does not experience failures, and at the same time, it is characterized as profitable compared to standalone satellite NOMA. Note that Algorithm 1 is executed once at the beginning for a specific number of users and also it is possible to save the structure of the graph for different numbers of users and re-load it whenever the number of users in the system changes.
The steps of SANOCO-D2D for maximizing the sum rate of the system are given in detail in Algorithm 2.
Find which is the strong and the weak channel satellite user for each pair by comparing the corresponding channel gains Γ i and Γ j ;

5
Derive the power allocation factor α t for the strong channel satellite user through (12); 6 Calculate the achievable rate R NOMA (i,j) strong of the strong user using (6);

7
Calculate the achievable rate R OMA weak of the weak user using (8) which is achieved under the satellite NOMA optimal power allocation; 8 Calculate the rate R D2D (i,j) weak that the weak satellite user is able to achieve via the corresponding D2D link i − → j through (10); 9 Calculate the rate R DECODED (i,j) weak that the weak user is able to achieve in case that the strong user decode their signal using (13); 10 Calculate the achievable rate of the weak user regarding the D2D link, taking into account the rates R D2D (i,j) weak and R DECODED (i,j) weak from (14); 11 Derive the total sum rate R i,j that this possible pair of users are able to achieve through (15);

12
Set the weight w i,j of the edge e i,j ∈ E of the graph G to w i,j = R i,j ; 13 end 14 end 15 Output: Optimal user pairing policy u * i,j and the maximum sum rate R max Algorithm 2 presents the procedure SANOCO-D2D for maximizing the total sum rate of the system. The algorithm takes as an input the CSI of the satellite link of each user, and the CSI of each D2D link between the users. Next, it updates the weights of the edges of the graph G that has been created during the execution of Algorithm 1. Specifically, the algorithm visits each vertex v i with (1 ≤ i ≤ N) of the graph representing each UE i , and calculates and assigns an appropriate weight w i,j to each edge e i,j connecting this vertex with the vertex v j of the graph with (i < j ≤ N). Obviously, when the algorithm visits vertex v N , the procedure of updating the weights of the edges of the graph immediately terminates, because all the weights of the edges connecting vertex v N with all the other vertices of the graph G have been updated during the previous iterations.
With the proposed algorithm, in order to calculate the weight w i,j that should be assigned to the edge e i,j connecting vertices v i and v j with (i < j) and indicate a possible pair of users, the identification of the strong and the weak satellite users should be performed first, by comparing the corresponding channel gains Γ i and Γ j of UE i and UE j that are modeled as the vertices v i and v j of the graph G. Then, the calculation of the power allocation factor of the strong satellite user takes place using (12).
Subsequently, using (6) the achievable rate R NOMA (i,j) strong of the strong satellite user is calculated in the context of NOMA optimal user pairing scheme. Thereafter, via (8), the achievable rate R OMA weak of the weak satellite user under the satellite NOMA optimal power allocation scheme should be calculated.
Keep in mind that the achievable rate of the weak satellite user R NOMA (i,j) weak under optimal power allocation is equal to R OMA weak because the power allocation factor that is assigned to the weak satellite user should satisfy the rate constraint for this user, while all the remaining power is allocated to the strong satellite user in order to maximize the achievable system sum rate.
In the next step, the algorithm calculates the rate R D2D (i,j) weak that the weak satellite user is able to achieve via the corresponding D2D link if this pair is used, through (10), and the rate R DECODED (i,j) weak that the weak user is able to achieve in case that the strong user forwards the received signal from the satellite to the weak user using (13). Next, considering the rate R D2D (i,j) weak that the D2D link is able to offer to the weak user, and the rate R DECODED (i,j) weak that the weak user is able to achieve when the strong user forwards the weak user signal, the algorithm calculates the achievable rate of the weak user by calculating the minimum of these two rates through (14), and practically uses this information to identify whether or not the D2D link is preferable compared to the directly received coded satellite signal at the weak user. Here note that the algorithm must calculate the minimum of R D2D (i,j) weak and R DECODED (i,j) weak , because if the D2D rate surpasses the achieved rate of the weak user's signal at the strong user, then the strong user is able to send the weak user's signal through the D2D channel without errors. On the contrary, if the achievable rate regarding the D2D link is less than the rate of the weak users signal that received from the satellite at the strong user, then the D2D rate is a bottleneck that will result in reduced rate. In other words, the minimum of the two rates represents the total profit or loss of D2D cooperation.
As a final step, for the weight update procedure of e i,j , the algorithm calculates the total sum rate that this pair of users is able to achieve through (15). The first term on the right hand side of (15) represents the achievable rate of the strong satellite user using the NOMA optimal user pairing scheme, while the second term is the achievable rate of the weak user. The achievable rate of the weak satellite user is calculated by applying the maximum function between the achievable rate R OMA weak of the weak user using the NOMA optimal user pairing scheme at the satellite and the achievable rate of the weak user R NOMA−D2D (i,j) weak through the D2D link. In this way, it is ensured that if a D2D link failure occurs; then the weak channel satellite user will be served only through NOMA. Next, the weight w i,j of the edge e i,j is updated to the value that was calculated in the previous step through (15). The weight w i,j of the edge e i,j indicates the sum rate that this possible pair of users UE i and UE j is able to achieve and contributes to the total sum rate of the system. Finally, when the procedure of weight updating terminates, the Edmonds algorithm is executed, giving as an output the optimal user pairing policy u * i,j and the maximum sum rate R max of the system. The proposed scheme considers the possibility where in some cases, the D2D link between two users may not be feasible because of power or propagation issues, and thus the weak user is only served through the satellite. Thus, if no profitable D2D link exists, then the optimal user pairing policy and the maximum sum rate coincide with the optimal downlink user pairing NOMA scheme [6].

Toy Network
Following the operation of Algorithm 1, a network consisting of N = 4 UEs is assumed, and so, four vertices are created, where v 1 = UE 1 , v 2 = UE 2 , v 3 = UE 3 and v 4 = UE 4 , and added to the set of vertices V. Next, starting from UE 1 , the algorithm connects this vertex with all the other three vertices using appropriate edge labeling, by initially setting the weight of each edge to zero. Thus, through this step, the vertex UE 1 is connected with the vertex UE 2 via the edge e 1,2 , with the vertex UE 3 via the edge e 1,3 and with the vertex UE 4 via the edge e 1,4 . The weights w 1,2 = w 1,3 = w 1,4 = 0 of the corresponding edges are initially set to zero and all edges are added to the set of edges E of the graph G. Thereafter, the algorithm visits the next vertex, i.e., UE 2 and connects it with vertices UE 3 and UE 4 via the edges e 2,3 and e 2,4 , where again, the weights are set to zero w 2,3 = w 2,4 = 0. Obviously, the edge e 1,2 that connects the vertex UE 1 with the vertex UE 2 , indicating the formation of a possible pair of users, has been already created and added to the set of edges E during the previous step, and there is no need to create it again. After that, the algorithm visits the vertex UE 3 and connects this vertex with the vertex UE 4 via the edge e 3,4 and set the weight w 3,4 = 0 of this edge to zero. Finally, Algorithm 1 visits the last vertex UE 4 and terminates because this vertex has been already connected with all the other vertices of the graph G.
In Figure 2, the graph setup that is produced through the execution of Algorithm 1 with N = 4 UEs is illustrated. The total number of vertices is equal to the total number of users |V| = 4 and the total number of edges is equal to |E| = 6. Each edge e i,j has a weight w i,j with i < j, initially being equal to zero. Using (16) and (18), if the solution that gives the maximum sum rate through Algorithm 2 connects vertices v i and v j , UE i and UE j will form a pair and e i,j = 1. Otherwise, vertices v i and v j are not connected and e i,j = 0.
It should be noted that the full mesh network presented in Figure 2 is not the optimal user pairing policy that gives the maximum sum rate of the system, but the graph setup that is created once for this specific number of users (N = 4) through Algorithm 1, representing all the possible pairs of users with their corresponding achievable rates, indicated as a weight of the corresponding edge. Practically the graph illustrated in Figure 2 is an input for the maximum weighted perfect matching problem that is adopted by SANOCO-D2D, and the solution of this problem keeps only the edges from the optimal pair of users u * i,j ) that gives the maximum sum of weights (maximum sum rate R max ) with the constraint that each vertex must be connected with exactly one other vertex in the graph, thereby ensuring that each user will be paired with exactly one other user in the system in order to perform NOMA or NOMA-D2D transmission, i.e., SANOCO-D2D. Once the graph setup that is shown in Figure 2 is created or loaded for the case of N = 4 UEs, the execution of Algorithm 2 starts. Algorithm 2 receives as an input the CSI of each user regarding the channel condition with the satellite, and the D2D CSI between all users. The algorithm starts with the edge weight update procedure by visiting first the vertex UE 1 , while updating for each edge e 1,j , the weight w 1,j = R 1,j of the corresponding edge with j = {2, 3, 4}, following the steps of Algorithm 2. In this way, the weight w 1,j of each edge e 1,j indicates the pair rate that this pair of users UE 1 and UE j is able to achieve and contribute to the total system sum rate. Next, the algorithm visits the vertex UE 2 and by following exactly the same procedure, updates for each edge e 2,j the corresponding weight w 2,j = R 2,j using the calculated pair rate R 2,j for this pair of users, with j = {3, 4}. The edge weight update procedure terminates when the algorithm visits vertex UE 3 and updates the weight w 3,4 = R 3,4 of the edge e 3,4 to be equal with the calculated pair rate R 3,4 for this pair of users UE 3 and UE 4 . Now, through the weight update procedure, each edge of the graph G, representing a possible pair, has a positive weight value indicating the achievable sum rate for each possible pair.
As a final step, in order to identify the optimal user pairing policy u * i,j and the maximum system sum rate R max , graph G = (E, V) with the updated weight values is fed to the Edmonds algorithm which solves the maximum weighted perfect matching problem. As a result, the pair of users maximizing the system sum rate is derived. As a trivial example, consider that w 1,2 = 3, w 1,3 = 7, w 1,4 = 1, w 2,3 = 2, w 2,4 = 5 and w 3,4 = 4. In Table 1, the different possible pairs of users that can be formed with N = 4 UEs, and the achievable system sum rate of each possible formation in the system are presented. As it can easily be observed from Table 1, if UE 1 is paired with UE 3 , and at the same time, UE 2 is paired with UE 4 , the maximum system sum rate R max = w 1,3 + w 2,4 = 12 is achieved and those pairs constitute the optimal user pairing policy. This is the optimal formation of the pairs that the Edmonds algorithm gives as a solution to the maximum weighted matching problem, and the maximum sum rate. The graph with the formed pairs maximizing the sum rate for this toy network, is illustrated in Figure 3.
The possible formed pairs that are presented in Table 1 are unique, because it is not allowed for a vertex in the graph to be unconnected, and at the same time, it is not allowed for an edge to start and end to the same vertex. Furthermore, exactly one edge is allowed to be connected at each vertex of the graph. In other words, each user should form a pair with exactly one other user of the system and it is not allowed to pair itself or to remain unpaired.
Finally, it should be noted that during the weight update procedure of Algorithm 2, if D2D communication is not profitable or it is not feasible due to link failures, the result shown in Figure 3 concerning the optimal user pairing policy will be exactly the same as in the case of the downlink NOMA optimal user pairing technique [6]. In conclusion, it is possible that some pairs will cooperate via D2D links and some others will not, which is the philosophy behind SANOCO-D2D. As it will be discussed below, D2D cooperation can provide substantial gains for the sum rate of the system and the spectral efficiency.

Performance Evaluation
In this section, simulation results are presented in terms of sum rate and spectral efficiency for different system parameters and transmission techniques. The whole transmission takes place in an urban terrestrial environment. Towards this end, a custom made simulator was implemented in C++. Furthermore, the maximum weighted perfect matching problem was solved with the use of the LEMON graph library [26]. The average Loo model channel parameters (M, Σ, MP) were selected based on the Table XIII of [27] and are presented in Table 2 for an urban area, operating in the L-Band and handheld antennas. Regarding the satellite channel conditions with terrestrial users, it should be noted that in urban areas, users being a few meters away may experience different channel conditions because of trees, roads, moving vehicles and buildings with different heights acting as scatters and affecting LoS connectivity [27,28]. All users in our scenario have the same elevation angle and range from and to the satellite but experience different channel conditions (LoS), including intermediate and deep shadowing as presented in Table 2, thereby representing the complex nature of an urban environment. On the contrary, in suburban or rural areas the channel conditions of the users would not significantly differ. Moreover, Table 3 includes the different simulation parameters used for comparison purposes and the following scenarios. SANOCO-D2D is compared against standalone NOMA with optimal user pairing [6] and OMA scheme in the time domain without D2D communication capabilities between the UEs. In the NOMA satellite transmission, perfect SIC at the strong user is assumed. Furthermore, different operating frequencies for satellite and D2D links are considered. The strong user transmits the decoded signal of the weak user through the entire duration of the time-slot and the time for decoding and re-encoding of the weak user's signal is considered to be negligible.   We define the cases of weak channel (WC), medium channel (MC) and strong channel (SC) users regarding the satellite link. In WC, Loo fading is generated using the parameters presented in Table 2 for the deep shadow state based on the value of the elevation angle. Accordingly, for the SC and MC, UE fading is generated using the parameters of the LoS and intermediate shadow state, respectively and for different elevation angle values. Additionally, as presented in Table 2, based on the elevation angle value and independently of the UE channel state, an average range D in km between the satellite and each UE is considered.
In order to provide performance comparisons among the different schemes, two scenarios are considered. The first scenario focuses on a network within a circular region of interest with radius R = 500 m, consisting of a total number of users N = 32 uniformly distributed, having an elevation angle equal to 10 • , with 50% of users experiencing WC conditions, 37.5% SC and 12.5% MC and different values towards the available terrestrial bandwidth B d . Then, the second scenario consists of a network within a circular region of interest with R = 500 m, a total number of users N = 32 uniformly distributed in the region of interest, having an elevation angle equal to 10 • , with 50% of users experiencing WC conditions and 50% SC, for different values for the available terrestrial bandwidth B d .
In Figure 4, the spectral efficiency performance for scenario 1 is presented for different schemes. It can be observed that in the range of 0-26 dB regarding the satellite transmit SNR value, the proposed technique for B d = 0.4 MHz achieves better results than any other value of B d , and compared to the conventional OMA and NOMA. For SNR values greater than 26 dB, NOMA and SANOCO-D2D with B d = 0.1 MHz achieve slightly better results with almost identical performance. Specifically, for low to medium SNR values, SANOCO-D2D with B d = 0.4 MHz outperforms NOMA. Therefore, the value of 0.4 MHz for the terrestrial D2D link is near the optimal value in order to achieve high spectral efficiency. For terrestrial bandwidth values less than 0.4 MHz, the spectral efficiency of SANOCO-D2D is close to that of NOMA. On the other hand, for B d > 0.4 MHz, because there is no need for extra bandwidth, spectral efficiency starts to decrease, and this claim can be verified by (14) which states that the rate of the weak user is always limited by the decoding rate of its signal at the strong user. In addition, SANOCO-D2D with B d = 0.8 MHz and B d = 1.2 MHz behave similarly to the case of B d = 0.1 MHz. When the terrestrial bandwidth value is below B d = 0.4 MHz, spectral efficiency degradation is observed, since the weak user chooses to be served directly from the satellite, as the small bandwidth decreases the rate of the D2D channel; i.e., R In the case where the terrestrial bandwidth value is slightly above B d = 0.4 MHz, the use of extra bandwidth reduces the spectral efficiency performance, and in particular for high SNR, NOMA exhibits superior performance.  In Figure 5 the sum rate performance for scenario 1 is presented. It can be easily observed that independently of the terrestrial bandwidth value, SANOCO-D2D outperforms OMA and NOMA. In greater detail, for B d = 0.1 MHz, SANOCO-D2D behaves better for low to medium SNR values, while for high SNR, its sum rate is slightly better than that of NOMA. This can be attributed to the small terrestrial bandwidth at high SNR values, leading the weak user to prefer the satellite channel for receiving its signal. At low and medium SNR values, the sum rate of SANOCO-D2D is approximately the same for any value of B d > 0.4 MHz. This is justified by considering (14) which highlights the fact that there is no need to allocate additional bandwidth for D2D cooperation. For SNR values above 14 dB, SANOCO-D2D with B d = 0.4 MHz achieves a slightly smaller sum rate than the higher values of B d , as the decoding rate at the strong user is higher than the rate of the D2D link, and so, a small extra bandwidth is needed for optimal sum rate performance. For example, when B d = 0.6 MHz, at high SNR, the sum rate surpasses that of B d = 0.4 MHz. Thus, it is recommended to use a D2D bandwidth value within 0.4 < B d < 0.6, as the adoption of B d values above 0.6 MHz significantly wastes spectral resources.
Hence, from Figures 4 and 5 it is concluded that dynamic bandwidth allocation for the D2D out-band communication is necessary, in order to optimize both the sum rate and the spectral efficiency performance.
In Figure 6 the spectral efficiency for scenario 1, with B d = 0.4 MHz and different elevation angle values is illustrated for SANOCO-D2D and NOMA. It can be easily observed that for low and medium SNR values and for any value of the elevation angle, the spectral efficiency of SANOCO-D2D outperforms that of NOMA. Specifically, at low and medium SNR values and for E = 10 • and E = 20 • , SANOCO-D2D is superior to NOMA. At high SNR, SANOCO-D2D behaves marginally worse, compared to NOMA in terms of spectral efficiency. Similarly, at low SNR and E = 40 • and E = 60 • , SANOCO-D2D behaves better than NOMA. For medium and high SNR values, the difference in performance becomes negligible. An interesting point in this comparison is that for fairly low SNR values, the spectral efficiency of SANOCO-D2D with E = 40 • is slightly better than that of NOMA technique with E = 60 • .  In Figure 7, the sum rate performance for scenario 1, B d = 0.4 MHz and different elevation angle values is presented for SANOCO-D2D and NOMA. It can be seen that throughout the SNR range and independently of the elevation angle value, the sum rate of SANOCO-D2D is better than that of NOMA. In greater detail, for E = 10 • and E = 20 • , SANOCO-D2D outperforms NOMA, and in particular, at low SNR the sum rate of SANOCO-D2D with E = 10 • is closer to the sum rate of NOMA with E = 20 • . The interesting point here is that the sum rate of SANOCO-D2D with E = 40 • is better than that of NOMA with E = 60 • for SNR values until approximately 7 dB. For high SNR values and E = 40 • or E = 60 • , the sum rate performance of SANOCO-D2D and NOMA is almost identical.
Hence, from Figures 6 and 7, it can be concluded that SANOCO-D2D with appropriately selected terrestrial bandwidth surpasses the performance of NOMA, especially under unfavorable channel conditions, encountered in low and medium transmit SNR values and elevation angles. In Figure 8, the spectral efficiency performance for scenario 2 is depicted for different schemes. Firstly, it can be observed that the spectral efficiency of scenario 2 is higher that that of scenario 1. This is justified by considering the lack of users in intermediate channel conditions and the equal percentages of SC and WC users. Thus, depending on the terrestrial channel conditions, each SC user will be paired with a WC user, significantly benefiting the performance of NOMA in the satellite link. Again, SANOCO-D2D with B d = 0.4 MHz achieves better results than any other value of B d , compared to OMA and NOMA, for an SNR range of 0-26 dB. On the contrary, for SNR values above 26 dB, NOMA and SANOCO-D2D with B d = 0.1 MHz, achieve slightly better results. In general, we can see similar behavior to that of scenario 1, and more specifically, the spectral efficiency performance of SANOCO-D2D for B d > 0.4 MHz (i.e., B d = 0.6 MHz or B d = 0.8 MHz) is slightly improved, since more SC users exist, leading to higher rates from the satellite, thereby leading to an improved usage of the terrestrial bandwidth. This applies to the whole range of transmit SNR but can be perceived at medium and high SNR values. The same is true for the case of B d = 0.4 MHz for the whole range of different transmit SNR values. Furthermore, for B d < 0.4 MHz, e.g., B d = 0.1 MHz, results in an almost identical spectral efficiency to NOMA. This is attributed to the increased number of SC users who achieve higher rates and are able to better assist the weak users. However, usually, a B d = 0.1 limits the rate of the weak users while cooperating with the strong users.
Next, Figure 9 shows the sum rate performance for scenario 2. As it was the case in scenario 1, SANOCO-D2D outperforms OMA and NOMA for any B d value. Moreover, the sum rate in scenario 2 is higher than that of scenario 1, due to the number of SC users, being equal to that of WC users, thereby improving the performance of NOMA in the satellite. Regarding OMA, as the number of SC users is increased, its total sum rate of the system increases. Furthermore, SANOCO-D2D with B d ≥ 0.4 MHz offers better results than NOMA. For B d < 0.4 MHz, as it is the case of B d = 0.1 MHz this increase is significantly smaller, because the allocated D2D bandwidth limits the transmission rate of the strong user. It should be noted that compared to scenario 1, the sum rate in scenario 2 using SANOCO-D2D with B d > 0.4 MHz starts to increase at approximately 10 dB, faster than scenario 1. As illustrated in Figure 9, a significant increase in the value of B d cannot offer much higher sum rate, and causes a significant decrease in the spectral efficiency, as presented in Figure 8, because the strong user decoding rate is the upper bound for the weak user rate, of the D2D link's achievable rate. Thus, dynamic bandwidth allocation is needed, in order to achieve a balance between sum rate and spectral efficiency performance.  The final comparisons for scenario 2 are depicted in Figures 10 and 11. In greater detail, the spectral efficiency and sum rate performance, with B d = 0.4 MHz and different values of elevation angle is evaluated. Regarding the spectral efficiency, similarly to scenario 1, for low and medium transmit SNR values and any elevation angle, SANOCO-D2D exhibits better performance than NOMA. Then, for higher SNR and equal elevation angles, SANOCO-D2D behaves slightly worse than NOMA. Furthermore, at low SNR and E = 40 • or E = 60 • , SANOCO-D2D offers improved spectral efficiency, compared to NOMA. For medium and high SNR, differences for the two schemes are quite small. Next, the sum rate comparison outlines that for any SNR and elevation angle value, SANOCO-D2D performs better than NOMA. Moreover, the sum rate of SANOCO-D2D with E = 40 • is higher than that of NOMA with E = 60 • for SNR values approximately up to 8 dB, due to the increased number of SC users. Finally, for high SNR values with E = 40 • or E = 60 • , the sum rate results of SANOCO-D2D and NOMA are almost identical.  Overall, the sum rate results of SANOCO-D2D in both scenarios show that achievable rate of the weak user can be significantly improved. This gain stems from the fact that the strong users cooperate with the weak users in the system through out-band D2D communication. In this way, fairness in the system is ensured as a more homogeneous QoS is achieved throughout the satellite's coverage area. In addition, the simultaneous out-band satellite transmission and D2D cooperation reduce the delay inherent to two-hop transmissions and the increased sum rate allows more packets to be served, thereby benefiting further performance metrics, such as the average packet delay.
Finally, Table 4 summarizes the key characteristics of the proposed scheme and the scheme of [6]. It can be observed that the addition of D2D cooperation improves the overall performance of the wireless transmission at an affordable complexity. Table 4. Comparative table regarding the key characteristics of the SANOCO-D2D and the scheme of [6].

Complexity
Medium Low

Relaying Mode
Half Duplex N/A

CSI Overhead
Medium Low

Power Allocation
Optimal Optimal

Dynamic D2D Channel Bandwidth
Yes N/A

Spectral Efficiency
High Medium

Sum Rate
High Medium

Fairness
High Low

Conclusions
The integration of satellite segments to terrestrial wireless networks has been shown to facilitate the provision of massive connectivity to coexisting users and devices. At the same time, incorporating efficient non-orthogonal multiple access, in terms of wireless resource utilization can guarantee fairness and system capacity. In this context, SANOCO-D2D, a satellite-aided NOMA cooperative D2D scheme was presented for integrated terrestrial satellite networks. Through SANOCO-D2D, the sum rate of the system was improved for different channel conditions, and it was shown that under a properly selected value for the terrestrial bandwidth, enhanced spectral efficiency, compared to standalone NOMA and OMA can be achieved, especially for low and medium transmit SNR. SANOCO-D2D offers increased QoS homogeneity through proper power allocation depending on the channel asymmetry between the strong and weak users and the possibility for simultaneous out-band D2D cooperation, using the strong users as relays. As a result, the fairness in the system is improved and at the same time, leveraging the increased sum rate, more packets are served, leading to a reduction of the total delay.
Integrated satellite-terrestrial networks provide a fertile research field and there are several future directions that can expand this work. Given the various benefits of SANOCO-D2D, a distributed weighted matching algorithm could be adopted in order to further decrease the computational complexity and achieve workload sharing between the nodes of the network [29]. Recently, the adoption of artificial intelligence and machine learning has been a driving force towards fully autonomous zero-touch wireless networks [30,31]. SANOCO-D2D can adopt different learning techniques to reduce the complexity of user pairing and channel state information acquisition and processing. Another important technique that should be studied is full-duplex communication, either in-band or out-band where dynamic bandwidth allocation should be optimized in the device-to-device link. There have been several full-duplex cooperative transmission schemes that can be integrated in SANOCO-D2D, incorporating successive transmissions by the source and relay nodes [32,33] or full-duplex reception and transmission from a single node [34]. Finally, the issue of outdated CSI represents another important future direction for this work, since in practical systems, the acquired CSI of a link might be different from the actual one, due to delays generated by the feedback mechanism [35,36]. Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflict of interest.