## 5 Game-Theoretical Routing Scheme for Video-Streaming in MANETs
### Design of the Utility Function  
The utility function \(U_{i}\) designed for our game-theoretical routing protocol aims at achieving two goals: Minimizing the rate of (I+P) frames lost and minimizing the delay jitter, since these two parameters are most significant in video-streaming services. An initial short delay can be easily bearable by the user. Part of that delay would be produced after gathering frames in the reception buffer to reorder frames before the decoding process. The proposed utility function for player \(i\) is the following:  
\[U_{i}=\underbrace{\left(\frac{n_{rb,i}-n_{sb,i}}{n_{sb,i}}\right)\cdot\phi_{b, i}\cdot\frac{p_{i}^{2}}{J_{b,i}}}_{\text{Best path}}+\underbrace{\left(\frac{n_{rm,i}-n_{sm,i}}{n_{sm,i}} \right)\cdot\phi_{m,i}\cdot\frac{(1-p_{i})^{2}}{J_{m,i}}}_{\text{Medium path}} \tag{14}\]  
All variables presented in Equation (14) are defined in Table 1. \begin{table}
\begin{tabular}{c l} \hline \hline
**Variable** & **Definition** \\ \hline \(i\) = \(1,2,3...,N\) & is a generic player, being \(N\) the number of players \\ \(p_{i}\) & Player’s \(i\) probability of sending the (I+P) frames through his/her best path \\ \(\phi_{b,i}\) & Player’s \(i\) benefit for the best path \\ \(\phi_{m,i}\) & player’s \(i\) benefit for the medium-quality path \\ \(n_{sb,i}\) & Number of (I+P) frames sent by player \(i\) through the best path \\ \(n_{rb,i}\) & Number of (I+P) frames received from player \(i\) through the best path \\ \(n_{sm,i}\) & Number of (I+P) frames sent by player \(i\) through the medium-quality path \\ \(n_{rm,i}\) & Number of (I+P) frames received from player \(i\) through the medium-quality path \\ \(J_{b,i}\) & Delay jitter of player \(i\) through the best path \\ \(J_{m,i}\) & Delay jitter of player \(i\) through the medium-quality path \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Definitions of the variables presented in Equation (14). Now let us relate \(n_{sb,i}\) and \(n_{sm,i}\) with \(n_{s,i}\):  
\[n_{sb,i}=p_{i}\cdot n_{s,i} \tag{15}\]  
\[n_{sm,i}=(1-p_{i})\cdot n_{s,i} \tag{16}\]  
where \(n_{s,i}=n_{sb,i}+n_{sm,i}\). Substituting Equations (15) and (16) in Equation (14) we get the following:  
\[U_{i}=\underbrace{\left(\frac{n_{rb,i}-p_{i}\cdot n_{s,i}}{p_{i}\cdot n_{s,i} }\right)\cdot\phi_{b,i}\cdot\frac{p_{i}^{2}}{J_{b,i}}}_{\text{Best path}}+\underbrace{\left(\frac{n_{rm,i}-(1-p_{i})\cdot n_{s,i} }{(1-p_{i})\cdot n_{s,i}}\right)\cdot\phi_{m,i}\cdot\frac{(1-p_{i})^{2}}{J_{m, i}}}_{\text{Medium path}} \tag{17}\]  
Notice that each player makes his/her own path classification, _i.e._, each player might have different best and medium-quality paths. In Equation (14), we have made our utility function \(U_{i}\) to be proportional to the negative of the I+P frames losses. This way, the utility increases as the losses decrease, for both the best and the medium-quality paths. Besides, \(U_{i}\) is a concave function so that we ensure to have a \(p\) value that produces the maximum utility. In Equation (14), \(\left(\frac{n_{rb,i}-n_{sb,i}}{n_{sb,i}}\right)\) is the negative of the I+P frame losses through the best path and \(\left(\frac{n_{rm,i}-n_{sm,i}}{n_{sm,i}}\right)\) is the negative of the I+P frame losses through the medium-quality path. Besides, \(U_{i}\) is proportional to the benefit of the path (\(\beta_{k}\), expressed in Equation (12)), that equals \(\phi_{b}\) and \(\phi_{m}\) for the best and the medium-quality path, respectively. Finally, \(U_{i}\) is inversely proportional to the jitter delay, so that the utility increases as the jitter delay decreases. This is reflected as (\(\frac{1}{J_{b,i}}\)) and (\(\frac{1}{J_{m,i}}\)), for the best and the medium-quality paths, respectively. We can see a numerical example of the utility function in Section (7.2.3). Depending upon the values of the utilities, pure strategies may not exist, but in that case there are always mixed strategies [33,34]. The mixed strategy \(\alpha_{i}^{*}\) is a (NE) if the utilities \(U_{i}(i=1,...,N)\), satisfy Equation (11).