## 4 Application Design and Implementation
### System Overview and Challenges  
The X-NETAD system is a futuristic network architecture conceived for the distribution of valuable traffic alerts to mobile vehicles, taking advantage of both cellular and _ad hoc_ communications. A subset of nodes that form the system (namely, the PUs) should have the ability to simultaneously manage the cellular and the IEEE 802.11 interfaces (the latter being set in _ad hoc_ mode), while the remaining nodes (_i.e._, the SUs) will only use the IEEE 802.11 interface. The X-NETAD application has been designed to be general enough for various mobile OSs and has been implemented on Android mobile devices. Like other mobile OSs, Android is natively capable of connecting to IEEE 802.11 networks operating in the infrastructure mode, but it lacks any support for the _ad hoc_ operating mode. However, it is possible to overcome this limitation, since most wireless network adapters inside Android devices are compliant with the full IEEE 802.11 standard and, thus, support the _ad hoc_ mode. This functionality can be exploited running the OS as administrator with super-user rights, using a procedure called _rooting_ and properly configuring the wireless adapter to connect to _ad hoc_ networks using the classic _ifconfig_ Linux command. Furthermore, the access to network interfaces is natively exclusive, _i.e._, only one between the cellular and the IEEE 802.11 interfaces is active at a time. In X-NETAD, we have introduced suitable software routines that overcome this limitation by properly altering the routing table of the devices, making it a true multi-homed device. We designed the X-NETAD in order to process and transfer large information amounts. In this way, the information exchanged--at first, between the AS and the PUs and, subsequently, between any PUs and the surrounding SUs--could include multimedia data, such as audio, video and map files. For instance, in our proof-of-concept application, the information issued by the AS is a compressed archive that includes a real-time traffic map in _jpg_ format, an audio file in _mp3_ format and an XML-formatted document. (In the following, we will refer to the terms, _traffic update_, _archive_ and _information_, to the overall traffic information file created by the AS.) The XML document contains information about the traffic update: its date and time of creation, the map's longitude and latitude coordinates expressed in degrees and, eventually, the information about errors that may have occurred in the network. An example XML-formatted text file is shown in Figure 4. We intentionally decided to focus on \"complex\" information, rather than on simple text messages, in order to be able to present a rich content to X-NETAD users. In this way, it is possible to inform the driver without distracting his/her eyes from the road, by simply playing the received audio alert on his/her mobile device. Figure 4: A possible example of XML-formatted document created by the Application Server (AS). The transmission of this relatively large amount of data (the size of the archive could reach some MB) in the _ad hoc_ domain becomes challenging, due to the limited range of the wireless interfaces and the vehicles' mobility. In addition, classical phenomena, such as fading, shadowing and the contention-based channel access mechanism employed by the IEEE 802.11 standard, actively contribute to limit the theoretical maximum throughput of the system. In order to reduce the impact of the problems mentioned above, the compressed archive received by a PU through the cellular interface is not directly transmitted to SUs, but, instead, is split in many small pieces that are disseminated independently. On the basis of an analysis of a VANET's peculiar characteristics, such as high node mobility and limited transmission range, we adopted a broadcast (starting from a primary node) approach for our system. In X-NETAD, all vehicles act as independent routers and cooperate together, fostering the complete reception of the traffic update.