# An Optimization Framework for Data Collection in Software Defined Vehicular Networks
## 3 Materials and Methods
### Proposed Data Collection Optimization Model
#### 3.3.2 Common Facts about Optimization of Data Collection  
The process of status data, metadata, and optimization solution transferring in each data-gathering cycle is graphically shown in Figure 1.  
* Before the data collection is optimized for the very first time, all nodes should broadcast their timestamp and node ID (**broadcasting metadata**), as shown in Figure 1. This step is done to identify all one-hop neighbors' metadata, such as the total number of neighbors (\(\mathcal{N}_{i}\)), node ID set of one-hop neighbors (\(\mathcal{S}_{i}\)) for the very first time which is required to solve the optimization problem. Once the data collection is optimized (after an optimization solution is found), using the broadcasting neighbors around a given node, a part of this metadata can be collected using the timestamp and node ID information which are already included in the data as shown in block B1 in Figure 1. However, there can be neighbors of an agent node who do not broadcast data to that agent node (when the neighbor node is another agent). Therefore, once the data collection is optimized, metadata must only be broadcast from the agent nodes, since metadata can be extracted using the data broadcasting nodes (\(z_{i}=1\)). In such nodes (\(z_{i}=1\)), we embed \(\mathcal{S}_{i}\) along with the status data in the broadcasting data packet as shown in block B2 in Figure 1. Metadata broadcasting of the agents should occur at a frequency of \(f\), where \(f\) is the data collection frequency. There is another parameter called the nominal optimization frequency (\(f^{\prime}\)) where the \(f\) and \(f^{\prime}\) are synced by the relationship given in Equation (12). In Equation (12), \(k\) is a positive integer such that the data collection frequency (\(f\)) should be a multiple of nominal optimization frequency (\(f^{\prime}\)). We call this the nominal optimization frequency since the decision to optimize or not is decided based on the entropy change of the network. At each step of nominal optimization frequency (\(f^{\prime}\)), entropy change will be inspected and the decision to optimize or not will be made, except for the first data-gathering cycle, which optimization solution must necessarily be found regardless of network entropy;  
Figure 1: The process of status data, metadata, and optimization solution transferring in each data gathering cycle. \[f=\ kf^{\prime} \tag{12}\]
* Before the data collection is optimized for the very first time, all nodes should unicast the node ID set of all one-hop neighbors (\(\mathcal{S}_{i}\)) along with the sender's node ID, and timestamp values to the controller as shown in Figure 1. We can call it **unicasting uplink metadata** for easy reference. Using these data, \(\mathcal{B}_{i}\) for each node can be computed at the controller. However, once a solution to the optimization problem is found, using the uplink data transmitted from the agents, a set of optimization parameters for all nodes can be computed. Therefore, the separate unicasting of metadata for the nodes is not required except for the first data-gathering cycle. Furthermore, unicasting the metadata \(\mathcal{S}_{i}\) of a given node that has not changed compared to the previous time step, can be omitted from having to be sent to the controller to reduce the metadata sent to the controller. For instance, if the topology around the neighborhood of a given node has not changed, then \(\mathcal{N}_{i},\mathcal{S}_{i}\) values will be constants. However, if the topology has been changed around a neighborhood of a given node, only such nodes \(\mathcal{S}_{i}\) should be embedded with the data and sent to the controller. Thus, at a given instant of time, agent nodes will unicast collected status data from the neighbors with its own data along with a set of \(\mathcal{S}_{i}\), which the topology around their neighborhood has changed, thus reducing the communication burden, as shown in block U1 in Figure 1;
* The optimization problem for data collection is solved by the controller (control plane).