## 3 QoE-Aware Geographic Routing Protocol for Video Streaming over VANETs
### Next Hop Selection in GeoQoE-Vanet  
The GeoQoE-Vanet protocol enhances the greedy forwarding to ensure better quality in each next-hop selection. Vehicles broadcast periodically a beacon message containing their information every \(\delta\) time units. The exchanged beacons allow each vehicle to build and maintain a table of its neighbours. The beacon message contains the vehicle information (\(Id\), _position_, _moving direction_, _speed_, \(MOS_{routing}\), _Sending time_). Before sending a beacon, each vehicle computes its QoE as given in Formula (8) then converts it to \(MOS_{routing}\) using Formula (9). To compute its QoE, a vehicle uses packet loss rate, jitter and delay. These metrics have a significant influence on QoE. There are many models to calculate or predict the QoE in wired networks [51; 52] or wireless and vehicular networks [7]. These models are generally used to calculate or predict end-user QoE. They are time consuming and need a lot of information. GeoQoE-Vanet uses Formula (8) proposed in [53]:  
\[QoE(u)=\ \frac{k_{1}}{(T_{delay}(u)+k_{2}*J(u))*e^{PL(u)}} \tag{8}\]  
where \(k_{1}\) and \(k_{2}\) are adjustment parameters for the weight of the other parameters. \(k_{1}\) unit is millisecond (letting be the QoE parameter dimensionless) and \(k_{2}\) gives higher importance to jitter against delay. \(T_{delay}(u)\), \(J(u)\) and \(PL(u)\) are the vehicle delay, jitter and packet loss rate. To obtain the mean opinion score \(MOS_{routing}(u)\) by conversion of its QoE, the vehicle \(u\) uses Formula (9) proposed in [53]:  
\[MOS_{routing}(u)=\left\{ \begin{array}{ll}5&QoE(u)\geq Q_{MAX}\\ e^{QoE(u)-Q_{MIN}}&Q_{MIN}<QoE(u)<Q_{MAX}\\ 1&QoE(u)\leq Q_{MIN}\end{array} \right. \tag{9}\]  
where \(Q_{MIN}\) and \(Q_{MAX}\) are the low and the high threshold values respectively. Upon receiving a beacon message, the table of neighbours is updated. Algorithm 1 shows the actions taken by the vehicle when sending a beacon message to its neighbours while Algorithm 2 presents undertaken actions when receiving a beacon message. ```
//Actions performed when sending a beacon message to its neighbours' vehicles \(getPosition(\&x,\&y)\); //Getting its own coordinates \(s\gets getVelocity()\); //Getting its own velocity \(d\gets getDirection()\); //Getting its own direction //Calculating its own \(QoE\) using Formula (8) \(QoE\gets k1/(getDelay()+k2*getJitter())e^{getPL()}\); //\(getDelay()\)//Getting its own delay //\(getJitter()\)//Getting its own jitter //\(getPL()\)//Getting its own packet loss rated //Calculating its own \(MOS_{routing}\) using Formula (9) if\(QoE\leq QMIN\)then \(MOS_{routing}\gets 1\); else if\((QoE>QMIN)\)and\((QoE\leq QMAX)\)then \(MOS_{routing}\gets e^{QoE-QMIN}\); else \(MOS_{routing}\gets 5\); endif endif \(t\gets now()\); //Getting current time \(id\gets getVehicleId()\); //Getting vehicle id \(sendBeacon(id,x,y,d,s,MOS_{routing},t)\); //Sending the beaacon
```  
**Algorithm 1** Actions performed when sending a beacon message  
When a vehicle decides to send a video to another vehicle, it first evaluates all its neighbours using the Formula (10), then selects one which has the greatest value and sends it the packet. The packet receiver uses the same process until reaching the destination. As presented in Figure 4, the next forwarding vehicles are selected from the source to the destination. Figure 5 shows a scenario for the selection of the last relay. \[p(i)=\ \alpha*MOS_{routing_{i}}+\beta*Dist_{i}+\gamma*LET_{i} \tag{10}\]  
where \(\alpha,\beta,\gamma\in[0,1]\) and \(\alpha+\beta+\gamma=1\). \(MOS_{routing_{i}}\) is the \(MOS_{routing}\) of the neighbour vehicle \(i\) obtained from the neighbours table. \(Dist_{i}\) is the distance between the vehicle \(i\) and the distinaition. \(LET_{i}\) is the link expiration time between the current vehicle and the neighbour vehicle \(i\).