# Cooperative Admission Control with Network Coding in 5G Underlying D2D-Satellite Communication
## Problem Formulation
### Multiple Access Network Coding (Lossless Second Stage)
#### 3.2.2 MANC Stream  
As compared to MANC-batch, the MANC-stream is developed so that the packets can be decoded immediately after receiving the innovative packet. The algorithm aims to achieve this goal in minimum possible packet completion time. The combination of the packets is made for the cellular communication supported by D2D-satellite links so that opportunistic network coding can be achieved from multiple interfaces. However, the exhaustive search method to look for all the possible combinations and then find the best possible combination is time-consuming and requires high computational complexity. So heuristic packet combination with linear complexity using a greedy algorithm is developed. The algorithm is divided into the following three main steps.  
* Scheme to create the linear combination of the packets for transmission.
* Grouping the packets into sets \(X_{c}\), \(X_{s}\), and \(X_{d}\) as per packets already available in the network.
* Determine the appropriate mode of access to transfer the packets between satellite and D2D links.  
The greedy algorithm is used for creating the packets sequentially. First, the missing packets are determined for each device. After that, the code is formed and then check with the previous codeword, if possible, combine them. The starting point will be an uncoded packet and then merged the latter to form the coded packets. If no merger can be made further, then the new uncoded packet is created and merged again, as shown in Algorithm 2.  
Grouping of Packets  
After creating the independent packets, they are sorted out in groups of \(X_{c}\), \(X_{s}\), and \(X_{d}\) based on the transmission from the source/satellite and D2D link. The packets of \(X_{c}\) are only transmitted from the source because they consist of packets not received by satellite and any D2D device during the transmission in first stage. The packets in \(X_{s}\) can be transmitted through satellite links and D2D links. However, the time required for completion for the D2D link is twice as compared to the satellite link. \(X_{c}\) is only packets that need to re-transmit from the base station. However, other then \(X_{c}\), the \(X_{s}\), and \(X_{d}\) offload the base station. Now in the case of the \(X_{s}\), if they are to be transmitted by D2D link, then the same vector is divided into two vectors, which results in two transmissions while the same requires one transmission from a satellite link. The time requirement is shown in Table 1.  
Selecting Medium of Transmission  
In each timeslot for transmission, two combinations of the packets are selected, such that \(X_{c}\cup X_{d}\cup X_{s}\). One is transmitted from the base station/satellite, and the other is transmitted from the D2D link. The main aim is to achieve the packet recovery in minimum time as much possible. Now the packets in \(X_{c}\) can only be transmitted by the base station, so 1 st the packets in \(X_{c}\) are transmitted. At the same time, the packets are transmitted from \(X_{d}\) and \(X_{s}\). The \(X_{s}\) packets are transmitted from the satellite, and it targets all the devices. The \(X_{d}\) targets devices are other than its self. For instant decodability, the packets are transmitted as per the sequence of the packets. Mostly, \(X_{c}\) is transmitted first and then followed by \(X_{d}/X_{s}\) or both.The upper bound of the MANC-stream is given by  
\[T\quad\leq\quad[min(max(\frac{X}{2},X_{c}),max(|X_{c}|,\frac{1}{3}(2 min_{neR} |D_{n}|)\ +\ |X_{d}|),\frac{1}{2}(min_{neR}|D_{n}|\ +\ |X_{d}|))]. \tag{18}\]  
The proof is provided in Appendix B.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Matrix** & **Cellular Link** & **D2D Link** & **Satellite Link** \\ \hline \(X_{c}\) & t & x & x \\ \(X_{s}\) & x & 2t & t \\ \(X_{d}\) & x & t & x \\ \hline \hline \end{tabular}
\end{table}
Table 1: Time required for packet completion.