# Traffic Congestion Detection System through Connected Vehicles and Big Data
## 3 Proposal Architecture
### Design of the Packet Structure
#### 3.5.1 Types of Packet Payload Content  
The following tables provide the different packet structures within payload, depending on their types. A brief explanation of each field is also shown. Table 2 shows the structure of a HELLO packet used to discover new neighbors and to create or change clusters according to the cluster forming mechanism shown in Figure 9.  
The fields for the HELLO packet include:  
* **Packet type:** a code corresponding to the packet type. * **Node type:** a code corresponding to the node type (cluster head, member, gateway). * **Latitude:** the 12-byte latitude given by the GPS. * **Longitude:** the 12-byte longitude given by the GPS. * **Speed:** the vehicle speed. Table 3 shows the structure of a LREQ packet used when the origin of a DATA packet is transmitted to a destination that is not included in its routing table, or when the route has expired. The identification field of an LREQ packet allows it to determine whether or not an LREQ packet has been seen previously. If an LREQ packet has been previously seen, subsequent LREQ packets will be discarded. The fields for the LREQ package include:  
* **Packet type:** a code corresponding to the packet type. * **Identification field:** the field that records if a packet has been previously seen. * **Node type:** a code corresponding to the node type (Cluster Head, Member, Gateway)
* **Applicant address:** the address of the node that initiates the search. * **Address to search:** the node address to be discovered. * **Latitude:** the 12-byte latitude given by the GPS. * **Longitude:** the 12-byte longitude given by the GPS. * **Speed:** the vehicle speed. Table 4 shows the structure of a LREP packet used by the cluster head to respond to the source node if the destination node is a member of the cluster. It is sent using a unicast transmission method. \begin{table}
\begin{tabular}{c c c c c c c} \hline
**Packet Type** & **Node Type** & **Applicant Address** & **Address to Search** & **Latitude** & **Longitude** & **Speed** \\ \hline
78 & 01 & 4 Bytes & 4 Bytes & 12 Bytes & 12 Bytes & 1F \\ \hline \end{tabular}
\end{table} 
Table 4: LORA-CBF LREP packet structure. \begin{table}
\begin{tabular}{c c c c c} \hline
**Packet Type** & **Node Type** & **Latitude** & **Longitude** & **Speed** \\ \hline
48 & 01 & 12 Bytes & 12 Bytes & 1F \\ \hline \end{tabular}
\end{table} 
Table 2: LORA-CBF HELLO Packet Structure. \begin{table}
\begin{tabular}{c c c c c c c} \hline
**Packet Type** & **Node Type** & **Applicant Address** & **Address to Search** & **Latitude** & **Longitude** & **Speed** \\ \hline
68 & 01 & 01 & 4 Bytes & 4 Bytes & 12 Bytes & 12 Bytes & 1F \\ \hline \end{tabular}
\end{table} 
Table 3: LORA-CBF LREQ packet structure. The fields for the LREP package include:  
* **Packet type:** a code corresponding to the packet type. * **Node type:** a code corresponding to the node type (Cluster Head, Member, Gateway). * **Applicant address:** the address of the node initiating the search. * **Address to search:** the node address to be searched. * **Latitude:** the 12-byte latitude given by the GPS. * **Longitude:** the 12-byte longitude given by the GPS. * **Speed:** the vehicle speed. DATA, DATA REQUEST and DATA RESPONSE packets contain all the information obtained from the different devices within the network. Table 5 shows the structure of a DATA packet used to transmit any information to the vehicular network and the server. Table 6 shows a REQUEST packet used to send a petition to the server. This type of packet waits for a response from the server. Table 7 shows the structure of a DATA RESPONSE packet used to respond to the network device that requests data from the server through the Gateway. The fields for the DATA, DATA REQUEST and DATA RESPONSE packages are explained below:  
* **Packet type:** a code corresponding to the type of DATA. * **Initial source address:** the origin address of the maintained data. * **Final destination address:** the destination direction of the maintained data.