Developing lightweight computation at the DSG edge

Commit 1c3ef2a4 authored by Axel Neumann's avatar Axel Neumann
Browse files

initial IPv6 routing prototype to test ipv6 meshing with niit, olsr and bmx6

parent b4302c87
HOWTO:
BUILD:
mkdir -p 13f
cd 13f
svn co svn://svn.openwrt.org/openwrt/branches/backfire
git clone ssh://gitosis@qmp.cat:221/qmp.git
git clone ../
git clone git://gitorious.org/eigennet/packages.git eigennet/packages
cd backfire
rm -rf feeds/
ln -s ../../dl # wherever you already have some openwrt downloads...
ln -s ../qmp/files
ln -s ../qmp/feeds.conf
nano feeds.conf # adapt path to pj-13f/packages
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
* Target System (BCM947xxx, x86, atheros,...)
* Target Profile (WGT634u, wrap, alix, routerstation,...)
(* Global build-settings -> Compile teh kernel with profiling enabled )
(* Advanced configuration options for developers -> Toolchain options -> Build gdb )
* Base system ->
qmp-big-node # for 8Mbyte flash devices
qmp-small-node # for 4MByte flash devices STILL TO BIG due to ipv6calc!!! Dont TEST
(* LuCI -> Freifunk -> luci-mod-freifunk-community )
make kernel_menuconfig
(* General Setup -> Small Systems -> ELF Core dumps )
(* Networking -> options -> IPv6 -> routing-tables )
time make -j3 V=99
INSTALL:
for wgt634u:
scp bin/brcm47xx/openwrt-brcm47xx-squashfs.trx root@192.168.1.1:/tmp/
ssh root@192.168.1.1
mtd -r write /tmp/openwrt-brcm47xx-squashfs.trx linux # do not reboot for a while to let filesystem cleanup
POSTCONFIGURE:
ssh root@192.168.1.1
. /etc/qmp_functions.sh
qmp_configure
# or configure individually:
# qmp_configure_network
# qmp_configure_olsr6
# qmp_configure_bmx6
# qmp_configure_system
reboot
# or restart stuff manually:
# /etc/init.d/network restart
# /etc/init.d/olsrd restart
# /etc/init.d/bmx6 restart
src-link qmp_packages /usr/src/openWrt/build/13f/qmp/packages
src-link eigennet_packages /usr/src/openWrt/build/13f/eigennet/packages
src-svn packages svn://svn.openwrt.org/openwrt/packages
src-svn luci http://svn.luci.subsignal.org/luci/branches/luci-0.10/contrib/package
#src-svn xwrt http://x-wrt.googlecode.com/svn/branches/backfire_10.03/package
#src-svn phone svn://svn.openwrt.org/openwrt/feeds/phone
#src-svn efl svn://svn.openwrt.org/openwrt/feeds/efl
#src-svn desktop svn://svn.openwrt.org/openwrt/feeds/desktop
#src-svn xfce svn://svn.openwrt.org/openwrt/feeds/xfce
#src-link custom /usr/src/openwrt/custom-feed
#### VLAN configuration
config switch eth0
option enable 1
config switch_vlan eth0_0
option device "eth0"
option vlan 0
option ports "0 1 2 3 5"
config switch_vlan eth0_1
option device "eth0"
option vlan 1
option ports "4 5"
#### Loopback configuration
config interface loopback
option ifname "lo"
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
#### LAN configuration
config interface lan
option type bridge
option ifname "eth0.0"
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
#### WAN configuration
config interface wan
option ifname "eth0.1"
option proto dhcp
config qmp interfaces
option configure_switch 'eth0' # remove (comment line if not available)
option lan_devices 'eth0.1' # will be used as is! alix: eth0 wgt634u: eth0.1, ns5: eth0 or remove
option wan_device 'eth0.2' # will be used as is! alix: eth1, wgt634u: eth0.2, ns5: eth0 or remove
option mesh_devices 'eth0 ath0' # will be extended by vlan tag! alix: eth0 ath1 ath2, wgt634u: eth0 ath0, ns5: eth0 ath0
config qmp node
# if commented out then last byte of the MAC address is used (0x000-0x0FF):
# option community_node_id 901 # value between 0x0100 and 0xFFFF
config qmp networks
option niit_prefix96 '0:0:0:0:0:ffff' # omit trailing 32 ipv4 bits !
option mesh_protocol_vids 'olsr6:1 bmx6:2' # or "olsr6:1 bmx6:2 babel:3"
option mesh_vid_offset '10'
option olsr6_mesh_prefix48 'fd01:0:0'
option olsr6_ripe_prefix48 '2011:0:0'
option olsr6_ipv4_prefix24 '10.201'
# option olsr6_ipv4_address '10.201.9.01'
# option olsr6_ipv4_netmask '255.255.255.0'
# option olsr6_6to4_netmask '120'
option olsr6_niit_routing 'native' # native or prefix-based
option bmx6_mesh_prefix48 'fd02:0:0'
option bmx6_ripe_prefix48 '2012:0:0'
option bmx6_ipv4_prefix24 '10.202'
# option bmx6_ipv4_address '10.202.9.01'
# option bmx6_ipv4_netmask '255.255.255.0'
# option bmx6_6to4_netmask '120'
option bmx6_niit_routing 'prefix-based' # native or prefix-based
option babel_mesh_prefix48 'fd03:0:0'
config wifi-device wifi0
option type atheros
option channel 10
option diversity 0 # 0:off, 1:on
option txantenna 1 # 0:auto, 1:main, 2:aux
option rxantenna 1 # 0:auto, 1:main, 2:aux
option country 276
option outdoor 1
# option txpower 1
config wifi-iface
option device wifi0
# option network wlan
option mode adhoc
option ssid olsr.freifunk.net
option bssid 02:ca:ff:ee:ba:be
option encryption none
option protmode 0
option bgscan 0
option uapsd 0
option rssi11a 9
option rssi11b 9
option rssi11g 9
option bintval 1000
option sw_merge 1
config wifi-device wifi0
option type atheros
option channel auto
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 1
config wifi-iface
option device wifi0
option network lan
option mode ap
option ssid OpenWrt
option encryption none
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvbTSxpSlDBV7m+c0i1rUFpaasegLjRL+BZunrpKb1YFvJXwS2DD1WqnAypBk/AlgR9KQlXfHSpeRqxY0HbBnPWG79LQ2NlVlcvF7xokpw3eUeYKpJwx0ivNd/koKE3wvoFN158JseFhUBGcZdaFRGh6bFhrvvXYmAHjroHvaGgVR8YQI4DiKrBULQd75p/U3G2UjeZpMeTK+LaCkuWh0g+93LQPp21w6v8hOZtudJ2rhNHNYB0oFJF8Uf5q+uVjpbOzA/nPxs/qiF4zdg2oyj0eAi0Yfo+eSVI/zj3iyeC4rF5S8/s/cyet+XMXvLQ6X12XUYu7Qv/VEVwI5QkVqSw== neumann@smart
ssh-dss AAAAB3NzaC1kc3MAAACBAKwyGFclim/DluhLtwRRItH+AgmIi5oI4vNVoOFc5gklQqXfhXr5XlINl+6IE/cf8qCzX4iA3n+Sd13/KmD7ynSJAKUnIlV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AQQAmsEVi01K7Ak9gxp6wZdApjQAAAIAj2QxayHpX10UCzJBP5eHa71IhEZbVFoiFduogtB0DAF8kQ9h46RLKKKrawQolu6vsnUbaKMZaWa5rgW4gnE9ROyd9siZqX1mzAqY0XFsBju1YvYKsnqESXRFtl5ywwfQLSn2mxJuX0F+idN2a4sV+G8l/i8Uzg0Xh3JLkGHx+9QAAAIEAsgkZiPXne+1pdGf1Sbybm7q2UdPn0CU/3LEh2i0VXB8HyBLGKXaTwORuSckASR4Ueo4mv0zJcMcDhlLg/P7bQChdhd5t2k3ws+Z3ibiIlcOP03cZ7kd5FYnsbgny5AKV9vLfcupaWl5pZYYfTjjdNXD51tdDB+G7Pj3zIkkA2wk= sim6@graciasensefils.net
# Copyright (C) 2006 OpenWrt.org
include /lib/network
addif() {
# Ensure that ipv6 is loaded, autoloading happens later but ipv6 might be
# required now for interface setup.
[ -d /proc/sys/net/ipv6 ] || {
grep -q '^ipv6' /etc/modules.d/* && insmod ipv6
}
# PPP devices are configured by pppd, no need to run setup_interface here
case "$INTERFACE" in
ppp*|3g-*) return 0;;
# ath*) return 0;;
wlan*) return 0;;
esac
scan_interfaces
local cfg="$(find_config "$INTERFACE")"
# check the autoload setting
config_get auto "$cfg" auto
case "$auto" in
1|on|enabled) setup_interface "$INTERFACE";;
esac
# find all vlan configurations for this interface and set them up as well
for ifc in $interfaces; do
config_get iftype "$ifc" type
config_get ifs "$ifc" device
for dev in $ifs; do
[ "${dev%%\.*}" = "$INTERFACE" -a "$dev" != "$INTERFACE" ] && {
add_vlan "$dev"
}
done
done
}
delif() {
scan_interfaces
# find all vlan configurations for this interface and nuke 'em
for ifc in $interfaces; do
config_get iftype "$ifc" type
config_get ifs "$ifc" device
confdevs="$(uci_get network.$ifc.ifname)"
for dev in $ifs; do
[ "${dev%%\.*}" = "$INTERFACE" ] && {
list_contains confdevs "$dev" || list_remove ifs "$dev"
}
done
uci_set_state "network" "$ifc" device "$ifs"
done
}
case "$ACTION" in
add|register)
case "$PHYSDEVDRIVER" in
natsemi) sleep 1;;
esac
addif
;;
remove|unregister)
delif
;;
esac
root:$1$nErbSOdV$T1NhP7nu75Fw5x174hIRA1:0:0:root:/root:/bin/ash
nobody:*:65534:65534:nobody:/var:/bin/false
daemon:*:65534:65534:daemon:/var:/bin/false
This diff is collapsed.
#
# Copyright (C) 2010 bmx6.net
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=bmx6
#PKG_SOURCE_PROTO:=svn
#PKG_SOURCE_URL:=http://bmx6.net/svn/trunk/bmx
#PKG_REV:=1751
#PKG_SOURCE_PROTO:=svn
#PKG_SOURCE_URL:=http://dev.sid/svn/projects/bmx6/
#PKG_REV:=2490
#PKG_SOURCE_PROTO:=git
#PKG_SOURCE_URL:=git://git.bmx6.net/bmx6.git
#PKG_REV:=06b6723a1b1f1d5425d5fba64f4510c5e8a1118d
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=file:///usr/src/bmx6/bmx6-private.git
PKG_REV:=1bbc678e68d5d2ddf5858cff8c231beb2762215b
#PKG_VERSION:=r$(PKG_REV)
#better using an increasing date (e.g.:20110101) + day-version (01), otherwise lower git hashes may prevent upgrading
PKG_VERSION:=r2011030201
#PKG_RELEASE:=1
#PKG_INSTALL:=1 # this tries to install straight to /usr/sbin/bmx6
PKG_SOURCE_VERSION:=$(PKG_REV)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
include $(INCLUDE_DIR)/package.mk
#define Package/bmx6/Default
# URL:=https://www.bmx6.net/
#endef
TARGET_CFLAGS += $(FPIC)
#-DNO_TRAFFIC_DUMP -DNO_DYN_PLUGIN -DNO_DEBUG_DUMP -DNO_DEBUG_ALL -DNO_DEBUG_TRACK -DNO_DEBUG_SYS
MAKE_ARGS += \
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \
EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \
REVISION_VERSION="$(PKG_REV)" \
CC="$(TARGET_CC)" \
INSTALL_DIR="$(PKG_INSTALL_DIR)" \
STRIP="/bin/true" \
build_all
define Package/bmx6/template
SECTION:=net
CATEGORY:=Network
TITLE:=BMX6 layer 3 routing daemon www.bmx6.net
URL:=http://bmx6.net/
endef
define Package/bmx6/description
BMX6 layer 3 routing daemon
endef
define Package/bmx6
$(call Package/bmx6/template)
MENU:=1
# DEPENDS:=+kmod-tun
endef
define Package/bmx6-uci-config
$(call Package/bmx6/template)
DEPENDS:=bmx6 +libuci
TITLE:=configuration plugin based on uci
endef
#define Package/bmx6-http-info
# $(call Package/bmx6/template)
# DEPENDS:=bmx6
# TITLE:=simple http info plugin
#endef
#define Package/bmx6-gsf-map
# $(call Package/bmx6/template)
# DEPENDS:=bmx6
# TITLE:=GSF decentral map plugin
#endef
#define Package/bmx6-howto-plugin
# $(call Package/bmx6/template)
# DEPENDS:=bmx6
# TITLE:=simple plugin example
#endef
define Build/Configure
mkdir -p $(PKG_INSTALL_DIR)
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
endef
define Package/bmx6/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx6 $(1)/usr/sbin/bmx6
$(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d
endef
define Package/bmx6-uci-config/install
$(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so
# $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config
endef
#define Package/bmx6-http-info/install
# $(INSTALL_DIR) $(1)/usr/lib
# $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_http_info/bmx6_http_info.so.1 $(1)/usr/lib/bmx6_http_info.so
#endef
#define Package/bmx6-gsf-map/install
# $(INSTALL_DIR) $(1)/usr/lib
# $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_gsf_map/bmx6_gsf_map.so.1 $(1)/usr/lib/bmx6_gsf_map.so
#endef
#define Package/bmx6-howto-plugin/install
# $(INSTALL_DIR) $(1)/usr/lib
# $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_howto_plugin/bmx6_howto_plugin.so.1 $(1)/usr/lib/bmx6_howto_plugin.so
#endef
$(eval $(call BuildPackage,bmx6))
$(eval $(call BuildPackage,bmx6-uci-config))
#$(eval $(call BuildPackage,bmx6-http-info))
#$(eval $(call BuildPackage,bmx6-gsf-map))
#$(eval $(call BuildPackage,bmx6-howto-plugin))
config 'bmx6' 'general'
# option 'runtime_dir' '/var/run/bmx6'
# option 'base_port' '6240'
# option 'prio_rules_offset' '6240'
# option 'rt_table_offset' 62'
# optiom 'http_info_port' '6239'
# option 'http_info_global_access' '1'
# option 'gsf_map_longitude' 'ref:system.@system[0].longitude'
# option 'gsf_map_latitude' 'ref:system.@system[0].latitude'
# option 'gsf_map_name' 'ref:system.@system[0].hostname'
config 'plugin'
option 'plugin' 'bmx_config.so'
config 'dev'
option 'dev' 'ref:network.lan0_bmx6.ifname'
config 'dev'
option 'dev' 'ref:network.wlan0_bmx6.ifname'
# config 'dev'
# option 'dev' 'tap0:bmx6'
# in Berlin we strictly dont route any olsr data !
# config 'throw'
# option 'throw' 'olsr'
# option 'network' 'ref:network.lan0.ipaddr'
# option 'netmask' 'ref:network.lan0.netmask'
# if you have a vpn (e.g. openvpn) or other routed network where
# interface netmask does not match the routed netmask
# config 'throw'
# option 'throw' '192.168.100.0/24'
# unicast host-network announcements (HNAs) look like this:
# config 'unicast_hna'
# option 'unicast_hna' '106.1.2.4/32'
#!/bin/sh /etc/rc.common
START=91
BIN=/usr/sbin/bmx6
CONF=/etc/config/bmx6
PID=/var/run/bmx6/pid
start() {
# mv /root/core.old /root/core.old.old
# mv /root/core /root/core.old
# cd /root/
# ulimit -c 20000
$BIN -f $CONF -d0 > /dev/null &
#start-stop-daemon -b -x $BIN -S -- -f $CONF
}
stop() {
start-stop-daemon -p $PID -K
}
restart() {
stop; sleep 3; start
}
#
# Copyright (C) 2011 qmp.cat
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qmp-big-node
PKG_RELEASE:=1
PKG_SOURCE_URL:=@SF/qmp-big-node
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
define Package/qmp-big-node
SECTION:=net
CATEGORY:=Base system
TITLE:=Required addons for big qmp mesh nodes (8MByte flash or more)
URL:=http://qmp.cat
DEPENDS:= \
+qmp-small-node \
+openvpn \
+openssl-util \
+tcptraceroute6 \
+iperf +mtr +netcat +netperf +tcpdump \
+nmap +lsof \
+wget \
+bmon +bwm +ebtables \
endef
# for qmp-big-node-testing:
define CommentsAndOptions
DEPENDS_COMMENT:= \
+luci-mod-freifunk-community \
+olsrd +olsrd-mod-txtinfo +olsrd-mod-httpinfo +olsrd-mod-watchdog +olsrd-mod-arprefresh \
+olsrd-eigennet +olsrd-eigennet-mod-dyn-gw +olsrd-eigennet-mod-httpinfo +olsrd-eigennet-mdns +olsrd-eigennet-mod-arprefresh +olsrd-eigennet-mod-txtinfo +bmxe +bmx-uci-config +bmx-gsf-map \
+eigennet-autoconf \
+gsf-map-minimal \
+gsf-map-full \
+wpa-supplicant-mini \
+hostapd-mini \
endef
# +niit \
# +tcpdump \
# +bwm +wprobe-export \
# +small-mesh-node +gsf-map-full \
# +wget \
# +bwm +wprobe-export \
# +kmod-usb-core +kmod-usb-net +kmod-usb-ohci +kmod-usb2 +kmod-rt73-usb \
# +kmod-p54-usb +kmod-rt2500-usb +kmod-rt2800-usb \
# +kmod-zd1211rw \
# +kmod-rtl8187 \
# +kmod-ath +kmod-ath9k \
# +iw \
# +libopenssl \
# +openvpn \
#
# +luci-app-openvpn \
# +openssl-util \
# +libnl-tiny \
# +luci-app-openvpn \
# +wprobe-export \ # I guess this one causes the crc-ccitt compile ERROR
# +usbutils \
# +hostapd +hostapd-utils \ # causing recursive dependency
# KCONFIG:=CONFIG_KERNEL_KALLSYMS CONFIG_GDB
define Package/qmp-big-node/description
Addons for big qmp nodes (8MByte flash or more)
endef
$(eval $(call BuildPackage,qmp-big-node))
#
# Copyright (C) 2011 qmp.cat
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qmp-small-node
PKG_RELEASE:=1
PKG_SOURCE_URL:=@SF/qmp-small-node
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
define Package/qmp-small-node
SECTION:=net
CATEGORY:=Base system
TITLE:=Required addons for small qmp mesh nodes ( 4MByte )
URL:=http://qmp.cat
DEPENDS:= \
+luci-ssl \
+horst \
+iputils-arping +iputils-clockdiff +iputils-ping +iputils-tracepath \
+ahcpd \
+radvd \
+wide-dhcpv6-client +wide-dhcpv6-control +wide-dhcpv6-relay +wide-dhcpv6-server \
+ipv6calc \
+bmx6 +bmx6-uci-config \
+olsrd +olsrd-mod-txtinfo +olsrd-mod-httpinfo +olsrd-mod-watchdog +olsrd-mod-arprefresh \
+luci-i18n-catalan +luci-i18n-spanish +luci-i18n-french \
+babeld \
+ntpclient +ip \
+ndisc6 +rdisc6 +rdnssd \
+6in4 +6to4 \
+ip6tables +ip6tables-utils \
+kmod-niit \
+kmod-ipip \
+kmod-tun \
+kmod-madwifi \
endef