# Cooperative Admission Control with Network Coding in 5G Underlying D2D-Satellite Communication
## Problem Formulation
### Multiple Access Network Coding (Lossy Second Stage)
The upper bound for packet completion time for the MANC-batch for lossy second stage channel is given as:  
\[T\leq[\max(\frac{|Xc|}{1-\prod\limits_{n\in R}\vartheta_{n}}),Ti]. \tag{19}\]  
such that\[\text{Ti}=\left\langle\frac{\max(T_{x},T_{r}),if\frac{|D_{r}-|D_{x}|}{1-\theta_{n}- \tau_{n}+\theta_{x}}\leq\frac{|D_{x}|}{1-\theta_{x}}}{\sqrt{2-\theta_{r}-\tau_{ n}}}\right\rangle \tag{20}\] \[\text{Tx}=\frac{|Dr|(1-2\theta_{r}-\tau_{x,r}+2\theta_{x})+|Dx|(1- \tau_{x,r})}{(1-\theta_{r}-\tau_{x,r}+\theta_{x})(3-2\theta_{r}-\tau_{x,r})}\] (21) \[\text{Tr}=\frac{|Dr|(1-2\theta_{r}-\tau_{x,r}+2\theta_{x})+|Dx|(1- \tau_{x,r})}{(1-\theta_{r}-\tau_{x,r}+\theta_{x})(3-2\theta_{r}-\tau_{x,r})}\] (22) \[\text{x}=\text{arg}\ max_{neR}|A_{n}|=\text{arg}\ min_{neR}|D_{n}|\] (23) \[\text{r}=\text{arg}\ max_{ne(\frac{\pi n}{\pi})}\frac{|D_{n}|}{2- \theta_{r}-\tau_{n}}. \tag{24}\]  
The proof is provided in Appendix C.  
MANC-Stream (Second Stage Lossy)  
We will now develop the MANC stream algorithm to cater to the lossy second stage as the lossless algorithm is not feasible. According to Algorithm 2, the packets are created independent and then grouped in the sets of \(X_{c}\), \(X_{d}\), and \(X_{s}\) when there is no loss in second stage transmission. This approach is not suitable for the lossy channel as the sets fixed in the lossless channel, but some packets lost due to noise, and the sets' fixed approach cannot be used effectively. Particularly in the case of \(X_{d}\), the sets need to be changed by each reception because not all devices receive the source's innovative packet. Second, the priority of the packets to be sent in the next timeslot in the second stage changes due to the loss of innovative packets in this stage. The main aim is to prioritize the packets, which can be received by many devices to deliver more information in lesser time. Analysis of these two reasons, it compulsory to update the Algorithm 2 for MANC- stream. The new Algorithm 4 defines the MANC-stream from the perspective of the lossy channel. ```
1. Grouping of the packets based on the \(|D_{n}|\) into a set of the \(X_{c}\), \(X_{d}\), and \(X_{s}\) using the algorithm II. 2. if (\(\sim\) isempty \((X_{c})\)). 3. (\(X_{c}\)) first element is elected and transmitted from the source. 4. elseif (\(\sim\)isempty \((X_{d})\))
5. The device with a higher number of average receivers (based on probability loss) is selected, and then \(X_{d}\) packets transmitted. The transmitted packet is equal to \(argmax_{peX_{d}}\sum_{n(W_{l}|n)\
eq 0}(1-\theta_{n})\). 6. elseif (\(\sim\)isempty \((X_{s})\))
7. \(X_{s}\) first element is elected and transmitted from the satellite or source based on higher average receivers. 8. **Independent packet via D2D:**

8. Consider p packet within \(W_{l}\) vector in \(X_{s}\) set. Any device can transmit the partial of packet p by linear network coding in the vector \(\frac{W_{l}}{W_{l}|x|}\). The average successful receivers is given by \(argmax_{peX_{d}}\sum_{n(W_{l}|n)\
eq 0}1-\tau_{n}\). Find all the receiver with the corresponding packets and average successful receivers. 9. After finding all the average of the successful receivers, now send the packet from the transmitter having the maximum average successful receivers via D2D link. ```  
**Algorithm 4**MANC Stream (Lossy second stage)  
In Algorithm 4, first determines the sets of the \(X_{c}\), \(X_{d}\), and \(X_{s}\) by using the algorithm proposed for the lossless stage. Then two sets of a linear combination of the packets are transmitted, one from source or satellite (depending on availability of the packets) and other from local devices via D2D link. This way, more information is delivered in a one-time slot of transmission.