lsmeshd

Author:
Javier Cardona <javier@cozybit.com>

Introduction

lsmeshd is a network daemon that discovers neighbors in a mesh network. It has been designed for the One Laptop Per Child project (http://www.laptop.org).

Theory of Operation

When lsmeshd is started, it will attempt to discover immediate mesh neighbors by broadcasting messages with Mesh TTL set to 1. By definition these messages are not forwarded by the recipients. The following diagram describes the message exchange that happens in this first phase.
protocol.png

After a full sequence HELLO_ALL/HELLO_ACK sequence is exchanged between two nodes (e.g. mnode1 and mnode3) mnode1 will record mnode3 as immediate neighbor in their internal mesh tree table. In the next phase, mnode1 will request Neighbor Lists (NLs) from all the nodes in the mesh tree table. This is depicted in the diagram below.

protocol_2.png

Neighbor List Responses (NLREPs) will contain the list of direct neighbors of the queried node. The requesting node will process the NLREP and for each previously unknown node, a new NLREQ is issued.

State Machine

The following state diagram shows the internal states of lsmeshd.
states.png

Input/Output

The lsmeshd daemon communicates with the command line tool lsmesh

$ lsmesh msh0
<mtree>
<mnode>
        <ipv4_addr>192.168.2.80</ipv4_addr>
        <mnode>
                <ipv4_addr>192.168.2.81</ipv4_addr>
                <mnode>
                        <ipv4_addr>192.168.2.82</ipv4_addr>
                </mnode>
        </mnode>
        <mnode>
                <ipv4_addr>192.168.2.83</ipv4_addr>
        </mnode>
</mnode>
</mtree>

Generated on Fri Jan 19 14:02:35 2007 by  doxygen 1.4.7