## 3 MSVPC Design and Implementation
### Adaptive Video Streaming
\[Reduced\mathrm{f_{i}(\mathrm{C_{i}})}=\ \sum\psi(\mathrm{E_{T}},\ \mathrm{T}) \tag{12}\]  
When videos are transmitted through different channels \(\mathrm{C_{T}}\), it is calculated as follows. Here \(S_{T}\) is the video travelling speed and \(\mathrm{E_{TM}}\) is the maximum video error rate. \[\mathrm{C_{T}}=\sum\psi(\mathrm{E_{T}},\ \mathrm{T})\ +\ \sum\mathrm{C_{R}(T-T_{D})}+\sum \mathrm{S_{T}(\mathrm{E_{T}}-\mathrm{E_{TM}})} \tag{13}\]  
The delay for all channels and the error rate of the arrival packets \(\mathrm{D_{E}}\) are calculated as below. The delay variations and its performance given in Tables 3 and 4. \[\mathrm{D_{E}}= T\sum\mathrm{T_{R}}+\ \mathrm{E_{T}}\sum\mathrm{S_{T}} \tag{14}\]  
Tables 3 and 4 shows the delay performance according to the protocol based on speed variations. Thus, we can detect the video that is being streamed \(\mathrm{S_{V}}\) in a very short time. \[\mathrm{S_{V}}=\mathrm{minimum}((\mathrm{f_{i}(\mathrm{C_{i}})+\ D_{E}})-\sum \mathrm{T_{R}T_{D}}-\sum\mathrm{S_{T}\ E_{TM}} \tag{15}\] \begin{table}
\begin{tabular}{c c c} \hline \hline \multicolumn{1}{c}{**Delay**} & \multicolumn{1}{c}{**Quality**} \\ \hline \(\leq\)0.1 & Excellent \\ \hline \(<\)0.3 & Respectable \\ \hline \(<\)0.6 & Acceptable \\ \hline \(<\)1 & Risk \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Delay performance. \begin{table}
\begin{tabular}{c c} \hline \hline
**Packet Loss (\%)** & **Quality** \\ \hline \(0\%\) & Excellent \\ \hline \(1\%\) & Respectable \\ \hline \(2\%\) & Acceptable \\ \hline \(3\%\) & Risk \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance of the packet loss. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multicolumn{1}{c}{**Packet Loss (\%)**} & **Quality** \\ \hline \(0\%\) & \(\mathrm{Excellent}\) \\ \hline \(1\%\) & Respectable \\ \hline \(2\%\) & Acceptable \\ \hline \(3\%\) & Risk \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance of the packet loss. According to this, we can find the perfect video streaming frequency \(\mathrm{S_{VF}}\) is as below:  
\[\mathrm{S_{VF}}=\mathrm{P_{R}}(1-\mathrm{minimum}(\mathrm{\,D_{E}+\,T_{D}})) \tag{16}\]  
By achieving minimum packet transmission delay and reduced packet error difference the video transmission gains higher video streaming frequency (Algorithm 1). Then, we form the global fitness \(\mathrm{G_{B}}\) path to transfer the video packets. \[\mathrm{G_{B}}=\mathrm{\,T_{D}-\,T_{D-1}} \tag{17}\]  
```
1. Created 5G Multicast routing network
2. Deploy SDN enabled devices
3. Compute the Storage device size \(\mathrm{M_{SD}}\) and cached Video size \(\mathrm{C_{VS}}\)
```  
```
1. \(\mathrm{C_{VS}}=\mathrm{\,\Sigma V_{S}\leq\mathrm{\,\frac{C_{s}}{t}}}\)
2. \(\mathrm{\,\Sigma C_{VS}\leq\mathrm{M_{SD}}}\)
3. Initiate particle swarm with Nnodes
4. Update swarm random locations \(\mathrm{\,L}\), Speed 5 of particles, at time \(\mathrm{t}\)
5. Compute resting location \(\mathrm{\,R_{L}}\) of swarm
6. \(\mathrm{R_{L}}=\mathrm{S_{t}\alpha+S_{VA}(\mathrm{LR_{L}-R_{L}})+\,S_{Vb}( \mathrm{L_{B}-R_{L}})}\)
7. Repeat the process \(\mathrm{R_{L}}\) till end of the communication
8. For \(\mathrm{i=i_{1}\ldots n_{n}}\)
9. Update \(\mathrm{R_{L}}\) variations of \(\mathrm{R_{L}=R_{L(t)}+S_{t+1}}\)
10. Compute data transmission error \(\mathrm{E_{T}}\) and traveling delay \(\mathrm{\,T_{D}}\)
11. \(\mathrm{T_{D}}=(\mathrm{B_{D}+P_{D}})\)
12. \(\mathrm{E_{D}}=\mathrm{\,T_{PL}-\,T_{P}}\)
13. Combination of delay and arrival packet error difference computed using
14. \(\mathrm{D_{E}}=\mathrm{\,T_{D}-\,T_{D-1}}\)
15. ```  
**Algorithm 1** Optimal Video Streaming Steps  
During transmission the network initiates the group formation on the primary server. If the internet server cannot be accessed directly, users will join the multicast group; information about the group ID will be given to all users in the group; later, according to the calculation, the node acts as a head in that local group, and is extended up to the destination by selecting the global best nodes throughout the path.