Grinch Border Router - routing in LAN environments


Recently I’ve made some tests how to connect to 6LoWPAN nodes in home LAN environment, using ordinary PCs. I’ve been using Grinch Border Router described in previous entries. The main aim was to use no static routes to send traffic to wireless nodes - I’ve tried to use only Router Discovery.

In general, avoiding manual configuration of networks is a hot topic nowadays - not only in Wireless Sensor Networks. There are many problems to solve:

The problems above are also present for the home LANs. The basic RFC4861 Neighbor Discovery is quite limited and it’s hard to achieve a fully functional LAN with Internet connection using only that (without DHCP). However most new solutions are not supported by common everyday devices found in LANs (like PCs or smartphones). Grinch Border Router is no exception to that - it is a very basic device, and with 8kb of RAM it is not capable of any complicated techniques.

LAN physical setup

I’ve assembled a simple Home LAN as a testbed. Physical setup of the testbed is shown on a picture below - as you can see it is not very realistic (for a typical household) - as it includes a separate switch and wireless router - I’ll explain that below:

Router RIO Experiment Physical Setup

The testbed contains two PCs, D-Link 5-port switch, Grinch Border Router, Atmel Raven board and a D-Link DIR-600 wireless router. Test LAN is based entirely on the switch. The wireless router is used only for IPv6 tunnel. At the beginning I planned to use the router for my LAN instead of switch (it would be a more realistic setup). However I decided to add a separate switch because of two reasons:

LAN logical setup

Logical setup of the testbed is shown on a picture below - it is much more realistic than the physical one:

Router RIO Experiment Logical Setup

LAN contains one host (one of the laptops) and two routers - one connected to the IPv6 Internet and one connected to Wireless Sensor Network. On the WSN side there is a single node with HTTP webserver (Raven) and RPL is used for routing. For the IPv6 Internet connection Freenet6 GoGo Client is used - I have no public IP therefore normal tunnel won’t work. Through GoGo client /56 prefix is received. LAN uses the first /64 subnet in the prefix, WSN uses the second one.

Problem formulation

When aiming for a zero-configuration connection to WSN nodes in home LAN, one of the main problems is choosing the right router for outgoing transmissions. In LAN like above, a host gets Router Advertisements from both WSN and Internet routers, and saves their addresses in Default Router List. When IPv6-enabled host has more than one router in its Default Router List, it selects the router for outgoing traffic in round-robin fashion (RFC4861). In typical IPv6 operation it’s not a problem - if host chooses non-optimal router, the router sends a Redirect message to the host. Redirect tells the host to use other router for that particular destination. Host saves this information in its Destination Cache and next time it sends the traffic to the correct router. Routers need to know about each other and about accessible routes to send Redirects. Normally routers use some kind of dynamic routing protocol to inform each other about known routes (e.g., RIPng).

Contiki OS (used by Grinch border router) doesn’t support redirects, or any typical routing protocols. It’s not a big technical problem, as the simplest routing protocol - RIPng can be certainly operated by a router like Grinch (maybe with 16kb of RAM). However it’s not the only problem. Typical IPv4 home routers don’t support any kind of routing protocol - they are simple gateways which send traffic to a default route. There are no “typical IPv6 home routers” on the market yet - only “IPv6 enabled routers”, but existing guidelines for home routers don’t contain routing protocol support as a mandatory functionality (RFC6024). Windows operating system also doesn’t support any dynamic routing protocols in Home Edition. At the moment probably the only IPv6 home router solution with RIPng support are special OpenWRT and DD-WRT builds. It might in a couple of years lead to a situation where Internet of Things home deployment is hampered by lack of proper router functionality.

Partial solution - Route Information Options

I’ve decided to look for another solution and found a nice candidate. RFC4191 contains an extension of original Neighbor Discovery which allows adding Route Information Option to Router Advertisements. Router can use this option to inform hosts on a network about routes it knows about. However the router should not use Route Information Option to send its whole routing table to all hosts - it should only advertise specific, important routes. The WSN border router is exactly such case - it should include the route to the WSN in its RAs.



Route Information Options for Grinch

Adding RFC4191 support to Grinch was quite trivial - the router only has to send Router Advertisements with an additional bit flag, and Route Information Option. The implementation is compatible with multiple interfaces extension added to Grinch earlier. I’ve added another structure that holds all information necessary for RIOs (uip_ds6_route_info). Because of that the code is not very well optimized for RAM usage. It is possible to implement a more efficient approach, that would use pointers to prefixes held in Prefix Table or Routing Table, but Routing Table doesn’t contain lifetime necessary for the RIO, so still some kind of additional structure is necessary. Other solution is to change Contiki Routing Table to contain route lifetime - it’s used by RPL anyway.

Modified code is available in Git repository::

RIO tests

I’ve run some tests with RFC4191 enabled Grinch. The border router was set to send Router Advertisements with Prefix Information Option containing LAN prefix, and Route Information Option containing WSN prefix. The LAN prefix was also advertised by the laptop running freenet6 client (“Internet router”). Grinch was tested with four kinds of devices - results below:

Further tests with Windows 7

After playing with the network a bit more I’ve determined that two more details in Grinch software had to be changed:

With these changes the solution can be considered successful - I’ve tested it with my wife’s new Windows 7 laptop (with vanilla OS), and it connected to Raven without any problems. Connection to required manual DNS setup. Both changes are included in the Git code above.