BRN:Gateway

From
Jump to navigation Jump to search

Abstract

This is about getting a mesh node to act as a internet gateway. There are different procedures for user- and kernel space. I mainly refer to the kernel one. For running click in userspace, you will need to look at the element "KernelTun".

Introduction

To get internet connectivity is a main goal in wireless networks. Our seldom challenge is the integrating into click, since we use the Linux kernel's NAT abilities. Further we assume that the mesh node has already an internet connection and proper routes are set. These problems (creating devices, doing NAT, ...) can be discussed separately. Especially we need a mechanism to detect, if we have internet connectivity.

To manually do this, just execute the iptables shell script on the node. This sets up the masquerading. Since our nodes are connected via LAN, they have already connection.

Gateways in BRN

Again, this is about the "kernel" way. You can download the current click configuration file for kclick from the svn.

Within this script we create with "gateway :: FromHost(int, 10.9.1.1/16)" a device named 'int' with the given IP '10.9.1.1' and net mask '255.255.0.0' (16). The FromHost element will push all packets for the given IP handed from the Linux kernel. As "composite" element the "ToHost(int)" is used. This will push all packets to the Linux kernel pretending they arrived through our "pseudo"-device named int and the kernel will forward the packet according to the packet's desination IP. Beware that the source IP is a problem, since your destination may not know the ethernet address of source IP and the Kernel won't do arp for your source IP. Therefore you should do masquerading (NAT) on the devices the packet may be sent.