Mesh forwarding table

From OLPC
Revision as of 18:22, 25 September 2007 by Yani (talk | contribs)
Jump to navigation Jump to search
  This page is monitored by the OLPC team.

Introduction

The Mesh is a dynamic configuration through which two laptops can communicate with each other through a dynamically updated path. This path can be direct(single hop) if the two laptops are close to each other. However, when this is not the case, it includes several hops. When a new laptop enters the Mesh it configures itself in the network using a routing protocol. Eventually it builds up a forwarding table, which determines the path to each individual laptop in the Mesh.

In order to forward a packet to a specific destination, the laptop checks the forwarding table and sends the packet through the correct direction. In fact the complete routing is transparent to the interface. The table only includes the next hop to the path. For example if the path from xoA to xoB is

xoA---------xo1----------xo2-----------xo3----------xoB

the forwarding table of xoA will only link xoB to xo1. Each possible xoA's destination(like xoB or xo3) is paired with its corresponding first hop of the path. The first hop must always be a neighbor to xoA. In the next hop the packets check the new forwarding table and send the packet accordingly. The routing protocol belongs to the Layer 2 interface, and therefore includes the MAC addresses of the laptops.

Accessing the Forwarding Tables

The Marvell WLAN Linux Driver used in the laptops provides several ioctl calls to examine the Mesh configuration. The most useful command is iwpriv which focuses on the forwarding table. By applying iwpriv eth0 or iwpriv msh0 we have access to several commands, the most interesting of which are

iwpriv msh0 fwt_list n          # gives the n-th entry of the forwarding table 
iwpriv msh0 fwt_list_neigh n    # gives the n-th entry of the neighbor table
iwpriv msh0 fwt_reset           # resets both tables

The parameters eth0 and msh0 indicate the interface you need to examine. Note that one can examine the interfaces through ifconfig/iwconfig. In both cases you have the same MAC address and iwpriv gives the same tables, so one may use either. It is unfortunate that using the above commands you only have access to a single entry defined by parameter n. To examine the whole table one must execute the fwt_list[_neigh] commands for all desired values of n. Each single entry is displayed as

iwpriv msh0 fwt_list n

     output is a string of the following form:

          da ra valid metric dir rate ssn dsn hopcount ttl expiration sleepmode snr precursor

     where the different fields are:

          da		-- DA MAC address (in the form "00:11:22:33:44:55")
          ra		-- RA MAC address (in the form "00:11:22:33:44:55")
          valid		-- whether the route is valid (0 if not valid)
          metric		-- route metric (cost: smaller-metric routes are preferred)
          dir		-- direction (1 for direct, 0 for reverse)
          rate		-- data rate used for transmission to the RA
          ssn		-- Source Sequence Number (time at the RA for reverse routes)
          dsn		-- Destination Sequence Number (time at the DA for direct routes)
          hopcount	-- hop count (currently unused)
          ttl		-- TTL (only used in reverse entries)
          expiration	-- entry expiration 
          sleepmode	-- RA's sleep mode (currently unused)
          snr		-- SNR in the link to RA (currently unused)
          precursor	-- predecessor in direct routes
iwpriv ethX msh0 list_neigh n

     output is a string of the following form:

          ra sleepmode snr references

     where the different fields are:-
          ra		-- RA MAC address (in the form "00:11:22:33:44:55")
          sleepmode	-- RA's sleep mode (currently unused)
          snr		-- SNR in the link to RA (currently unused)
          references	-- RA's reference counter

If the entry number requested is beyond the length of the table then you receive a null error message

Forwarding Table Characteristics

The forwarding table updates by adding additional lines not by replacing previous ones. An entry however can be removed when it expires. The starting expiration time may be checked though

iwpriv msh0 fwt_time            # in ms(or chip ticks)

When a new path for a specific destination becomes available it is updated in the forwarding list, and this is usually long before the previous entry for the same destination has expired. Subsequently, most entries are not up to date.

The neighbor table is similar to the forwarding table, but only includes a list of the neighbors, which also represent the first hops for all other destinations. These neighbors are also included in the forwarding table but of course destination and first hop are the same.

How to get viewable results

In order to view the complete forwarding table or neighbor a linux script is available check for all entries one by one.


Translate MAC address to XO name