D-Link DGS-1005D “Green”

Previously I was using a NetGear JGS524 switch (24 Gigabit ethernet ports) which was doing a good job for my small home network but was a bit noisy.

So I went to my local store and bought a D-Link DGS-1005D “Green” (5 gigabit ethernet ports, fanless, said to be eco-friendly).

Eco-friendly?

First, the package. At the same time I bought this switch I also bought a D-Link modem, same size, not green. Both were provided in boxes with mostly the same content but the switch’s box was smaller, with less “materials”. So yes, the packaging is a bit greener.

The switch materials: no idea. I don’t know what kind of plastic was used but it looks similar to the modem one. No more clue on the electronic parts. The power adapter is smaller than the modem one. Anyway, electronic devices in general are very energy greedy to build.

The D-Link switch is able to reduce power consumption on a port if nothing is plugged in (or if the connected device is powered off), the switch is also able to adjust the power on a port depending on cable length (plugging a 1 meter ethernet cable should consume less than a 100 meters one).

My “old” NetGear was consuming about 13 W while doing nothing (no ports connected), on constructor’s website it says to consume up to 40 W (under full load I presume).

The D-Link DGS-1005D consume 1.1 W with a bit of traffic (0 W with nothing connected to it (my watt-meter is not really done to measure power below 1 W).

So yes, it consume much less than my previous switch, but I wonder how much other small switches like this one consume.

Functional?

The question here is mostly: is it working? Well… I’m not really sure. I usually listen music streamed from my server to my MacBook, it looks like that from time to time, since I’m using this switch, iTunes stops the music and displays a “buffering” message (before resuming when data are back). At some point I was not able to backup the MacBook with TimeMachine, it failed with a network error.

To be sure about that I plugged back my NetGear switch. Same problems, but less often… (I have changed to many things in my home network recently and it looks like I have things to fix).

Conclusion

The D-Link DGS-1005D “Green” switch seems to be quite efficient (working not so bad and not using too much power).

OpenBSD and PPPoE

I’m using a new ISP (since I moved in a different country) which does not provide a DSL modem as part of the subscription. So I bought the first ADSL2+ modem I found that was not also a router (since I have my own router).

I ended up with a D-Link DSL-320T. I was a bit disappointed to see that the modem DOES some routing… but quite poorly. I tried several configurations and my conclusion is that this modem is severely bugged. It’s based on an old BusyBox 0.60 (you can telnet the modem to see that and do some stuff manually (if you manage to…)). I went on D-Link website to find firmware updates… the firmware loaded in the modem is more recent that the ones I found on the website! Anyway, after some research, it looks like D-Link people have no clue about how to manage version numbers (it’s a complete mess), but it’s not a problem since the modem does not want to load any firmware (there is something in the interface to do that but it did nothing when I tried).

At some point I find out that the modem has a “bridged” mode, to it will does mostly nothing and I will have to do the authentication with the ISP on my OpenBSD 4.5 router.

PPPoE

Configuring PPPoE on OpenBSD is quite easy. The modem is connected to the rl0 interface, first we need to create a configuration file /etc/hostname.pppoe0 for the new PPPoE interface pppoe0:

inet 0.0.0.0 255.255.255.255 NONE pppoedev rl0 authproto pap authname LOGIN authkey PASSWORD up
dest 0.0.0.1
!/sbin/route add default 0.0.0.1

Replace LOGIN and PASSWORD with the credentials given by your ISP. The rl0 interface does not need any configuration except telling that the interface must be started. /etc/hostname.rl0 must contain only:

Restart network interfaces with the following command:

# sh /etc/netstart

ifconfig should now include pppoe0 configuration.

NAT and PF

I saw on some forums/mailing lists that since PF is started before the pppoe0 interface, PF might block the connection. I’m not having the problem right now, maybe for older versions of OpenBSD. Anyway, I had a different one. When PF starts, the pppoe0 interface does not have yet retrieve an IP, so PF is using “0.0.0.0”.

For instance in /etc/pf.conf, I had the following lines to create a NAT between pppoe0 and rl1 (rl1 is the interface on my local network):

ext_if="pppoe0"
int_if="rl1"
 
nat on $ext_if inet from $int_if:network to any -> $ext_if

In order to tell PF to monitor the external interface’s IP, it just needs to be put between brackets, so the NAT command becomes:

nat on $ext_if inet from $int_if:network to any -> ($ext_if)
Links

D-Link DWA-110 on OpenBSD 4.4

In order to reduce power consumption and simplify my home network, I wanted to remove my WIFI router and replace it by adding an USB WIFI dongle on my router (a fit-PC with OpenBSD on it).

Choosing a dongle

As WIFI hardware is mostly proprietary stuff with Windows only drivers, not all of them are able to run on OpenBSD (or Linux).

So my requirements are:

  • USB WIFI dongle (USB is the only kind of connectors I can use on my fit-PC)
  • recognized by OpenBSD
  • do not requires non free (as in free speech) binary firmware
  • can work as an access point

I already had an Acer WLAN-G-US1 dongle, it has a ZyDAS chipset, which is supported by the zyd driver, but it can’t act as an access point.

From the OpenBSD’s supported WIFI hardware page I randomly selected the rum driver (working with Ralink RT2501USB and RT2601USB chipsets) and went to a store with the list of dongle models supported.

So I bought a refurbished D-Link DWA-110.

Plugging the dongle

When plugging it in the fit-PC, I got the following message in /var/log/messages:

(…)
Nov  7 20:00:32 hal /bsd: ugen0 at uhub0
Nov  7 20:00:32 hal /bsd: port 1 "Ralink 802.11 bg WLAN" rev 2.00/0.01 addr 2
(…)

What did just happened? The dongle is not recognized and the generic USB driver is associated with it.

Digging a bit in the manuals I found that in rum manual on my OpenBSD do not have D-Link DWA-110 in the hardware list. In fact, the online manual is more up to date than the one in OpenBSD which is already at least two weeks old… So my dongle will be supported in next OpenBSD release.

So what? Can’t do anything to fix that?

Compiling the kernel

The problem here is just that OpenBSD do not know that D-Link DWA-110 works with the current rum driver.

It’s quite easy to change that, but it requires recompiling OpenBSD’s kernel and rebooting.

First, download kernel sources:

# cd /usr/src
# wget ftp://ftp.crans.org/pub/OpenBSD/4.4/sys.tar.gz
# tar zxvf sys.tar.gz

Then, add the relevant changes to the drivers source files and the USB devices list.

  • Add the following line in the file /usr/src/sys/dev/usb/if_rum.c in the vendors/products list:
{ USB_VENDOR_DLINK2,            USB_PRODUCT_DLINK2_DWA110 },
  • In /usr/src/sys/dev/usb/usbdevs in the D-Link products add:
product DLINK2 DWA110           0x3c07  DWA-110
  • In /usr/src/sys/dev/usb/usbdevs_data.h in the usb_known_products structure add:
{
    USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWA110,
    "DWA-110",
},
  • And in /usr/src/sys/dev/usb/usbdevs.h:
#define USB_PRODUCT_DLINK2_DWA110       0x3c07          /* DWA-110 */

Then compile the kernel and reboot (this can be a bit long, especially on a slow computer like my fit-PC, it was about half an hour):

# cd /usr/src/sys/arch/`arch -s`/conf
# config GENERIC
# cd ../compile/GENERIC/
# make depend
# make
# make install
# reboot

Now we can check the USB devices:

# usbdevs -dv
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, OHCI root hub(0x0000), AMD(0x1022), rev 1.00
  uhub0
 port 1 addr 2: full speed, power 300 mA, config 1, 802.11 bg WLAN(0x3c07), Ralink(0x07d1), rev 0.01
  rum0
 port 2 powered
 port 3 powered
 port 4 powered

The rum driver is associated with the D-Link dongle.

We can see that it uses around 300 mA on a 5 V USB power source, so I assume that the dongle is using 1.5 W. My actual WIFI router consumes 4 W.

The fit-PC was consuming 3.7 W, now with the dongle plugged in and running it consumes 5.5 W, that’s 1.8 W for the dongle, not so far from the theory.

Anyway, it seems that DWA-110 was already in “-current”, so it should have been in November’s release.

Useful links: