# A Distributed Token Passing Protocol for Time Constrained Data Gathering in VANETs
## 3 Proposed Approach  
### System Model  
This paper deals with a distributed message passing-and-processing protocol to support intelligent traffic management systems. In particular, according to the 5G vision, we adopted the V2X communication mode properly mapped to the existing IEEE 802.11p air interface. In this way, vehicles are allowed to directly communicate with each other, without involving the eNodeB scheduling. In addition, we refer to a particular communication pattern, i.e., one-to-many-to-one scheme, according to which mobile devices (i.e., OBUs) process and collect information in a _cooperative_ way, once they have been triggered by one RSU. It can be noticed that the RSU can act as a gateway sending the collected information to its own eNodeB, which in turn can transfer it to a Big Data Cloud for data analytics and a decision-making process. Following the approach proposed in [14], we rely on a message passing scheme among VANET devices, namely TT, where the message is denoted as _token_. The typical use case we referred to, depicted in Figure 1, consists of a _group_ of vehicles in the proximity of a traffic light. As soon as they stop, for instance when the _red_ light turns _on_, the procedure of data collecting is started, involving the cars being temporarily queued, until the red light turns _off_. The first step is carried out by the RSU associated with the traffic light that discovers the surrounding cars that selects the best one and passes the token to it, waiting for its return within a time _deadline_ (typically the red light period). Then, the token is iteratively passed among devices, where each one stores and possibly refines the carried information in order to improve their _collective_ context awareness. Finally, the token has to be sent to the initial RSU, before the timeout (i.e., closing the _virtual_ ring); otherwise, it is considered lost and no information is eventually gathered. The proposed scenario can be generalised in order to take into account a limited mobility pattern which models a road segment affected by traffic congestion or a large and saturated roundabout, where information gathering is even more important. Denoting with \(\mathbf{P}_{i,j}\) the set of all the possible communications paths connecting the \(i\)-th and \(j\)-th generic couple of devices in the VANET, and with \(e_{k}\) the local information available at the \(k\)-th vehicles, we can formulate the objective of collecting the largest information in a limited amount of time through the following constrained optimization problem:  
\[\text{(OPT)} \max_{\pi\in\mathbf{F}_{\pi,k}}\mathcal{F}\left(\mathbf{e}_{\pi} \right),\] (1) subject to: \[\left|\tau\left(\pi\right)-\tau^{*}\right|=0,\]  
where \(\alpha\) conventionally represents the first RSU initiating the protocol, \(\mathbf{e}_{\mathcal{J}}\) is the set of information associated with the vehicles belonging to the path \(\pi\), \(\mathcal{F}()\) is function modelling the join information processing and distribution, \(\tau\left(\pi\right)\) is the cumulative latency associated with the path \(\mathcal{J}\) and \(\tau^{*}\) the considered time deadline. The constraint means that the delay \(\tau(\mathcal{J})\) associated with the path \(\mathcal{J}\) needs to match the time deadline (\(\tau^{*}\)) _exactly_ (This constraint could be further relaxed, assuming that the difference is lower than a small time value \(\epsilon>0\).). For the sake of model simplicity, we assumed that the distributed information processing consists of a data gathering, i.e.,  
\[\mathcal{F}\left(\mathbf{e}_{\pi}\right)\doteq\sum_{i\in\pi}e_{i}, \tag{2}\]  
this meaning that every involved device (except the initial RSU) sums its local information to the received one, as explained in Section 3.5. In addition, it is worth noting that, if the \(j\)-th device is visited more than one time (e.g., in the presence of a loop), the provided information is _null_.