OLSR ARPROAMING PLUGIN |
Home | Download | Usage | Details | Contact
|
||||||||||
Problem given Using wireless networks in a dynamic way (see Roaming) without forcing users to change settings requires some technical effort. However, the major problem is reliably determining of new clients very quickly and also removing them if disconnected. For this purpose the plugin uses ARP requests/replies for both detecting new and already gone clients. Basic idea In regard to the OSI Reference Model layer 2 was designed to provide data link services. A quick capture of networking data using tcpdump introduces us into ARP:
Host '10.8.128.1' is asking for '10.8.128.2' on layer 2 using the broadcast mac ('ff:ff:ff:ff:ff:ff') or its previous stored mac address as a destination. Since the host was alive response returned to '10.8.128.1' quickly (about 4 μs) containing the mac address as well. Now using this lookup functionality connected clients could be easily verified once they were added to the client register. But how do they get in in the first place? If a new client connects to the network (using DHCP or static IP address) it will always perform ARP requests in order to get information e.g. about the default gateway (if an outgoing connection attempt was made by user). Doing so generates an entry in kernel's ARP table which can be easily obtained using the proc filesystem node '/proc/net/arp':
The marked flag '0x2' is an important indicator for alive status. There's a set of flags given in the include file '/usr/include/linux/neighbour.h' (location may differ on other systems):
Since reading '/proc/net/arp' as a file directly is bad coding style and depends on formatting issues the plugin uses the rtnetlink library to get relevant information and to send/receive ARP data also. Whenever some host reaches flag '0x2' (or at least '0x8' for faster roaming) it will be added to the client register (if not already there). Implementation / Workflow The plugin code is periodically called from OLSRd main thread using a callback function named 'arproaming_schedule_event()'. Basically two jobs have to be done: for one finding new clients and for the other update (or delete if timed out) existing clients:
Dependency graph The following chart generated by ncc shows how functions are relying on system calls (click to enlarge): |