## 3 Architecture of the Platform and Related Software and Hardware Aspects
### Core Facilities for Nodal Interactions and Ad Hoc Networking
#### 3.1.3 The Routing Protocol and Associated Message Handling Mechanisms  
Each node maintains aso-called \"routing message table\" (see Figure 2), which contains the messages that are currently held at the node and must be forwarded to a different destinationnode. This table is checked periodically (with a frequency that can be tailored), and the next-hop candidate evaluation process is individually exercised for each entry found therein. To this end, the beacon table is consulted to retrieve the current status of the neighborhood, and the value of the routing metric is calculated for each neighbor node in the table. The routing metric takes, as input, the location and velocity of the current node (from the localization module), the location and velocity of the neighbor node being evaluated (from the data in the respective entry of the beacon table), and the location of the message's destination node (from the data in the routing message table). This input, possibly in conjunction with other relevant data (e.g., the local network density, which can  
Figure 3: Format of the Beacon Message.  
be calculated using the number of entries included in the beacon table and the magnitude of the communication range), determines the suitability of the considered neighbor as a next hop for the message.  
When this evaluation process indicates that there exist neighbor nodes more suitable than the current node, the latter forwards the message to the most suitable next hop. According to a special rule, in particular, if the message's destination node is included among the neighbors, it always scores highest and receives the message. On the other hand, if all neighbor nodes score lower than the current node, this node keeps the message until the next iteration of the evaluation process.  
Next-hop forwarding materializes through a routing message sent from the current node to the next-hop node determined by the aforementioned process. As it can be seen from Figure 4, the structure of the routing message includes fields for the sender and receiver addresses and fields for relaying the information in the corresponding entry of the message routing table (i.e., the message's origin and destination addresses, the location of the destination node, the message ID, and fields useful for calculating end-to-end performance metrics, discussed further in Section 3.1.4). The last field contains the payload of the message (Given the performance evaluation focus of the experiments reported in Section 5, all the messages exchanged in the course of these experiments contained dummy payloads). When the next-hop node receives the routing message, it logs a new entry for the message in its own routing message table and returns an acknowledgment (ACK) message (whose structure is depicted in Figure 5) to the previous message holder. Upon receiving the ACK message, the previous message holder updates its routing message table by removing the entry indicated by the message ID in the ACK message. This acknowledgment process adds robustness to the message forwarding and eliminates the possibility of duplicate or lost messages in the network.  
The platform makes it easy to implement different routing protocols simply by changing the code for the routing metric. The current implementation already provides support for several alternative routing protocols, briefly described in Section 3.2.4. Moreover, it is noted that the platform is capable of supporting experiments with more than one routing protocol in parallel. To this end, each entry of the routing message table contains an additional field (see third field from the right in Figure 4) that specifies the routing protocol to be used for the routing of the corresponding message. When candidate next-hop nodes are considered for this message, the appropriate routing metric is invoked. The routing protocol specific propagates from hop to hop through the corresponding field in the routing message, so all hops from source to destination are governed by the same protocol.