Wifi Mesh for HandHelds in Linux Nicola Corriero, Vittoria Cozza, Francesco Pistillo, Eustrat Zhupa Universit` a di Bari Dipartimento di Informatica Via Orabona, 4 -70125 Bari Italy Tel. +39-080-5442292 Fax. +39-080-5443196
[email protected],{n.corriero,v.cozza,eustrat}@di.uniba.it
Abstract This work shows how to use a Linux kernel for arm processors, including a specific aodv module to support Wi-Fi connection in ad hoc manner. Then an handheld equipped in this way can transmitt costless voice, text messages, data files over a mobile ad hoc network.
Keywords: handhelds, Linux, kernel, aodv module, sms.
1
Introduction
In this work we deal with mobile embedded systems with a wifi card based on 802.11b standard. Because this technology is licence free frequences, it’s possible to put in communications devices like that without the need of any access point. This chance encouraged the generation of new protocols able to create a decentralized network in which all nodes creat cooperatively the network itself. We are choosing to use the routing AODV (Ad hoc On demand Distance Vector) protocol, because it’s suited for route discovery and routes maintenance within ad hoc network. To this purpose a Linux kernel and a mini distribution have been compiled and analyzed in the case of an handhelds HTC blue-angel. Then it has been extended including the Manet support, specially compiling the aodv-uu, the AODV protocol implementation realized by the Uppsala University[9]. At this point we are ready to generate a mesh network. Etherogeneous nodes like handhelds, work station, notebook, mobile phone, router wi-fi, having wifi connectivity with Linux operating system and aodv-uu module installed, can contribute to the creation of a decentralized newtork, working in a mobile context. Since many nodes around 100 meters of distance from one 1
Figure 1: Handheld HTC Blueangel with Linux operating system running on it. other are a frequent scenario and since the collaborative characterization of the protocol (more devices, more efficienty), a wireless mesh can be easily created. The advantage of having such mesh is to use it as the sublevel network to route data and/or phone call. For example, to test our approach efficiency, the mesh network generated is used to route short messages, the textual application is a small C program based on socket.
2
Operating systems and smart phones
In this section we explain how to install Linux system in the case of devices belonging to the family of advanced RISC machine. ARM architecture is the best compromise between performance and power consumption and it appears to be the perfect architecture for every smartphone. The device we worked on is a pda2k gsm with Windows Mobile 2003, 65000 colors video, having bluetooth, infrared, 802.11b wireless card. Over this device a Linux operating system has been compiled, mounted, and extended to support the creation and manteinance of a wifi mobile network. To boot a kernel on mobile devices we are choosing a non-invasive approach: the idea is to install the kernel over a miniSD card. Obviously an host machine, in our case a workstation, and a card reader are needed. The workstation must recognize the device card reader that can be intern or extern1 . Once the card is detected, it will be formatted in two partitions, one with vfat file system, this partition is used to boot the kernel from window, then an ext3 partition for the root filesystem. To boot a Linux kernel from the handheld has been used Haret[4], a Linux 1 Please remind that to install a Linux driver, here we each time manually download the source code and recompile it.
2
bootloader which works from Window CE enviroment then it passes the control to the kernel, unfortunately this operation corresponds to a hard reset. The cross compilation, the process of preparing the compilation enviroment for etherogeneous devices, will allow to obtain binary code compatible with an architecture different from x86, that we will call target device. To do that a toolchain is required, we intend a set of libraries, compilator and linkers that allows to develop programmes for different architectures and operating systems. Linux actually is based on GNU C library[3] but these appear to be too large for embedded systems; some open source projects, as Uclib[8], aims to revisiting the GNU C library with the intention of make them more flexible, and faster taking ispiration of the original library used from the kernel called libc[3]. In this work we use a precompiled toolchain that contains gcc, bin utils, libc header and others needed libraries fot the compilation of program for the arm architecture. Anyway opensource projects with the intend of semplify a distribution embededded compilation and creation work exists, specially importance has Openembedded[5]. Openembedded offers all the instruments to support the creation of an embedded Linux distribution from scratch as compilators (bitbake), tools for packets managment (ipkg). A less relevant project is scratchbox [7], offering some scripts to semplify the work that we are going to describe in the following section.
3
Linux kernel for embedded systems
Our aim is to allow a smartphone to natively use mesh network, specially manet. This is done by compiling kernel and including aodv-uu module. The compilation kernel phase is quite tricky, one way is to compile the kernel with special configurations and optimized patches for the device we intend to use. The configuration file is used later from compiler and only by editing such file we can specify which components as to be included in the kernel and which compiled separatly as module. With kernel patch we intend a collection of added source files, modules for example developed to soddisfy the need of new specific drivers. The kernel version we use is 2.6.21.hh18 where hh stands for handhelds and it has been downloaded from the handheld svn, the source code was already patched with needed modules for htc blueangel family devices. The configuration file was found either on Internet and it’s named htcblueangel static defconfig. Problems related with modules creation are detailed in next section where relevance is given at the aodv module compilation. Compiled the kernel, the next step to create a minimal embedded distribution, is to create the root file system. For this purpose Busybox[1] have been
3
used, it is a minimal enviroment that can offer all binay file for a working mini distribution. Fluxbox well fits embedded systems requirement, it appears as a whole executable file that needs less then 1 MB, if you compile it respect to glibc, and less then 500KB in the case of uClibc. Once Busibox is inside the root filesystem, manually we must generate the minimum enviroment that is needed for the kernel execution so to create devices files and the init scrip. The way here showed then is a bottom up approach that starts from kernel compilation by adding later script, various features and libraries, a different approach could be to use a existing distribution, for example Familiar Angstrom[2] and Openmoko[6] both based on Openembedded.
4
Managing manet
Generally wireless devices are used for managed connession, in the sense that there is an access point to allow a node to connect to network services. In this work we deal with an ad hoc connection where in the opposite it’s possible to create a peer to peer communciation without the need of a server node and then it’s possible to create a mesh network infrastructure; depending of the kind of connection, the way how to configurate the wifi card changes. In our case where mobility plays an importat rule (smartphone), we consider a special case of Wifi Mesh network in mobility context linked in ad hoc manner: the manet. Routing protocols refering to manet keeps in consideration the high level of mobility of network nodes. Since mobile devices comunicating over wireless mesh could deal with many problems as overhead, latency, band wide, battery life, efficiency, mobility and all these parameters have influence over communication quality. At first soon hibrid protocols seems to be the best because inglobate both the feature of proactive and reactive protocols. Speaking of reactive we refer specially to l’AODV (Ad hoc On demand Distance Vector ) and DSR (Dynamic Source Routing), while proactive protocols are represented by l’OSRL (Optimized Link State Routing) and DSDV (Destination Sequenced Distance Vector ) algorithms. After a long analysis work [10][11][12], it has been showed that DSR works well in low mobility situation while AODV better fits the case of high mobility. Ad hoc On Demand Distance Vector (AODV) is a reactive protocol it generates a path between nodes only on a source node demand. AODV builds the route using a query cycle: route request / route reply. When a source node wishes to know the path to a destination for which it hasn’t already a path, it sends in broadcast a route request(RREQ) data packet over the network. Nodes, received a packet, updates their information refering to the source node and they set a pointer back to the source node inside their routing tables. With this approach is possible to implement a routing algorithm without the need of a static net-
4
work server. Each node infact acts as server to replicate data packet and generate paths among different nodes; at the same time each node acts as client when it tries to send data packet over the network without knowing in advance the whole path, but only the next hop on the network. The main advantage of AODV is to not generate traffic in the case of already established and functioning properly paths. Indeed, the same algorithm act just in the moment it’s not necessary to send a package to a node and the path it’s unknown. Anyway, distance vector routing based is simple from the computational point of view and not requires large amounts of memory. However, the Protocol requires longer time compared with other protocols to establish a connection between two nodes of a network. To simulate a wifi mesh between device mounting the Linux operating system with aodv routing protocol, then we choosed to include the aodvuu module. This module compilation requires, as listed in the README file: Linux OS (2.4.x, 2.6.x), then Kernel with Netfilter support (Most Red Hat/Fedora kernels have this support), finally Wireless LAN cards in ad-hoc mode (alternatively a wired setup can be used). You can notice that one requirement is the kernel supports Netfilter module, this is mandatory to allow aodv module to work, in fact aodv uses network protocols of TCP/IP sublevel. To do this we had to recompile the kernel and include netfilter module inside of it. To include the aodv-uu module too we had to download the source code from the Uppsala University website, then compile it. Next step was to create a demon program named aodvk opportuning modifying a makefile in the section related to kernel and compiler used. Obviously is mandatory to set the kernel headers inside the compiler. Finally the compilation of the module for exactly the arm architecture requires you to run the comand make arm that will generate the daemon, this procedure takes long and it is not error free.
4.1
A testing scenario
The testing phase refers to three host nodes, specially a workstation with Linux/debian and an extern usb wireless pen, a notebook with Linux/debian with integrated wireless card, a handhelds belonging to the family of htcblueangel devices. Once the kernel includes the modules to recognize the device wireless, the next step is the configuration of the ip address over local network (192.168.*.*), then the wireless network specifying network name, connection mode (ad hoc in our case), eventually newtork key and communication channel. Preparation steps are analogous in the case of the smartphone, in fact it must be included the aodv-uu modules and the node must be configured to joyn the network. At this point, it required to run the demon aodvd by a command such ./aodvd -l -r 3. Host behaviour is depicted in figure 2, for example to reach the host 192.168.5.3 from the host 192.168.5.1 we must 5
refer to the node *.*.*.2 as showed in row 11:
Figure 2: Aodv-uu module debug messages A ping message send from the workstation node to the smartphone, looks like that: root@workstation:/# ping -R 192.168.5.3 PING 192.168.5.3 (192.168.5.3) 56(124) bytes of data. 64 bytes from 192.168.5.3: icmp_seq=1 ttl=64 time=7.84 ms RR: 192.168.5.1 192.168.5.2 192.168.5.2 192.168.5.3 192.168.5.3 192.168.5.1 64 bytes from 192.168.5.3: icmp_seq=2 ttl=64 time=2.82 ms (same route) 64 bytes from 192.168.5.3: icmp_seq=3 ttl=64 time=2.81 ms (same route)
Please notice that -R option in the ping command allows to monitor the steps that data packets make to reach the HTC. From workstation (192.168.5.1) the data packet move to the intermediate node (192.168.5.2) and reach the destination (192.168.5.3).
5
SMSoS
SMSoS is a small application that aims to take advantages from the generated mobile ad hoc network to send for free short text messages to an other host known of the network. To manage the data transfer over the networ, sockets are used. It’s easy to create a connection client server like among from host of the net to one other to transfer data thanks socket but it’s only possible if we know in advance the list of nodes joying the network in any time, the last point is naturally addressed by the use of aodv protocol.
6
6
Conclusion
In this work how to make a distribution for handheld has been showed. The usage of small size library as the uClibc appears to be perfect for device with small memory, the usage of framework as Openembedded, the elimination of unused code from the sources, the elimination of debug messages for the kernel (printk command), the prelinking that allows to reduce the waste time in the usage of shared library, the use of compact commands (busybox), the power save consumption are just a part of the features that our embedded distribution can offer, some tips about how to optimize it are given. Finally how generate an ad hoc mobile network with aodv-uu protocol has been showed. Future works will deal with the implementation of application software to transfer voice and data files over the manet.
References [1] Busybox official website, 12/24/2007. www.busybox.net/. [2] The angstrom distribution official angstrom-distribution.org/.
website,
2007.
http://www.
[3] Gnu c library official website, 2007. www.gnu.org/software/libc/. [4] Haret reverse engineering tool, 2007. haret.
http://handhelds.org/~konnor/
[5] Openembedded official website, 2007. openembedded.org/. [6] Openmoko official website, 2007. http://www.openmoko.com/. [7] Scratchbox cross compilation toolkit project, 2007. www.scratchbox.org/. [8] Uclib official website, 2007. http://www.uclib.org/. [9] Uppsala university, coregroup.
2007.
http://www.it.uu.se/research/group/
[10] CS176C. Wireless routing: Reactive algorithms. CS176C Spring 2006, 2006. [11] Hannes Hartenstein Martin Mauve Christian Bettstetter. Ad-hoc networking. MoMuC, 2003. [12] Charles E Perkins. Ad hoc networking and aodv. Nokia Research Center, 2000.
7