prev. article next article

networkmanager

25 Oct 2009

#motivation network management on linux differs from distro to distro. trying various of these i liked what SuSE did over the year. they included a network manager like applet ‘knetwork’ with kde 3 which even included isdn (ppp) links.

gentoo has it’s own network configuration which is quite static using /etc/conf.d/net. i use this for static setups but i’ve written my own scripts for my laptop (aka desktop) machine. just one example:

wpa_supplicant_generic_dhcp_ath0

#!/bin/bash -v
echo "sh /root/config/wpa_supplicant_generic_dhcp_ath0" > /root/last-lan.sh
if [ -f /var/run/dhcpcd-ath0.pid ]; then
rm /var/run/dhcpcd-ath0.pid
fi
killall dhcpcd
killall wpa_supplicant
killall vpnc
ifconfig br0 down
ifconfig ath0 down
ifconfig eth0 down
brctl delif br0 ath0
brctl delif br0 eth0
brctl delbr br0

rmmod ath5k
modprobe ath5k
#iw reg set EU #does not work
sleep 1
ifconfig ath0 up
wpa_supplicant -B -dd -D wext -i ath0 -c /etc/wpa_supplicant.conf
route del default
#dhcpcd ath0
iptables -t nat -A POSTROUTING -o ath0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

ethtool -s eth0 speed 100
dhcpcd ath0
#dhclient ath0

cp /etc/resolv.conf /etc/resolv.conf.dnsmasq
echo "nameserver 127.0.0.1" > /etc/resolv.conf
ifconfig eth0 10.0.0.1/24 up
dhcpd eth0

although my scripts work very well (even when i restart my computer the last script is automatically run from /etc/init.d/local) this setup has it drawbacks in usability.

benefits:

drawbacks:

i considered NetworkManager (NM). i like most of it’s technology as for instance the DBUS interface it uses is probably the best way one could implement something like NM. i also like the integration into gentoo but this came pretty late (ubuntu was the first distro which had quite acceptable NM support).

but NM does a very bad job if things don’t work. there is no debugging possible. example:

this made me think about network and interface usage in general. i’m using many tools for years now as:

but these tools although relying on each other are monolithic and static software monsters. if one wants to understand what networks are all about it is one thing: dynamics in every aspect

the next graph shows a ‘network grammar’ which describes the possible dependencies or how one can stack various programs:

but on ‘run time’ you will end up in a ‘state graph’ with every application somehow connected to others in various ways. states are also triggered on timeouts (for example when the ‘dhcp serverwasn’t accessible by the local dhclient one is forced to take action). now let’s look how the grammar applies on ‘run time’:

the two previous graphics also demonstrate the stacking capabilities. looking at the grammar makes this obvious. (the grammar and the flow graph are far from complete but illustrate the basic concept).

this triggers the kernel in some way which then signals the change to every process using this interface.

maybe this idea inspires someone to rewrite NM with usability (in the sense of automation and debugging feedback) in mind. i think NM is on the right track already.

NM should: