Tag Archives: synology

Working with Synology hardware – /dev/synobios and /dev/ttyS1

It was interesting to me what is inside DS207 box, how it works and controlled. Because root access is allowed it was not very hard to do my investigation. Hardware itself is based on standard 8245 PPC CPU with 64Mb of memory. It starts booting from internal flash (/dev/mtdX) using PPCBoot 2.0.0. boot loader. After loading kernel from flash its trying to run OS from system partition and if it is not possible – waiting for commands from synology tools. If DSM is already installed then it will boot OS from the hard drive and will start the web interface and other services. Network and sata controllers are standard hardware with corresponding device drivers in kernel.  They are working in a standard way, as on any other hardware. Non-standard parts in the NAS hardware are: Buttons, FAN control/sensors, and temperature sensor. We will talk how to manage them in this article.

Continue reading

Tagged , , , ,

Improving network speed on Synology DS207 NAS

I have relatively old DS207 NAS with a Gigabit Ethernet port. Device CPU is mpc8241 PPC running @ 266MHz, so i never expected very fast transfer speed. NAS firmware is DSM3.2 with PowerPC 2.6.24 linux kernel. Performance was reasonable but less then i expected. After some experiments i found that bottleneck is network card (HDD works faster). What i really like in Synology DSM that there is no any needs for the device hacking – all you need to get the root is to enable “Terminal” option in the web interface.

Using “dmesg” command i found that Ethernet card is Yukon Gigabit Ethernet 10/100/1000Base-T Adapter. I decided to test it speed with iperf tool (using ipkg), wget and smbclient from my Linux box. I found that network speed PC -> NAS is about 230Mbit/sec and NAS -> PC ~120Mbit/sec. Kernel drvier for this card is sk98lin so i decided to see if there are any settings affecting performance to play with.

In Documentation i found 2 such settings Moderation and IntsPerSec. I decided to play with them.

To do this i modified /etc/rc boot script. I decided to add my “ismode” line before vendor one, to make sure that if there are any error in the options – device will continue to boot. Because my line is before one from vendor – system will use my settings (vendor module will be silently ignored with “File exists” message). Vendor modules are loaded on SYNOLoadModule ${NET_MODULES} line, so i just added insmod /lib/modules/sk98lin.ko Moderation=Dynamic before and restarted device. After restart driver settings could be shown using “cat /proc/net/sk98lin/eth0” command. I did 4 tests: without any changes (moderation disabled), Dynamic Moderation, Static Moderation (2000 ints/sec) and Static Moderation (1000 ints/sec). On every mode i did 3 tests:

  1. iperf bidirectional test with “iperf -c diskstation -t 15 --format KBytes -x CMS -r” on client and “iperf -s” on NAS
  2. Downloading of 1 GB from nginx HTTP server installed on NAS  with command “wget  http://diskstation:2080/1000mb.bin  -O /dev/null -o /dev/stdout|grep saved
  3. Downloading file from nas using SMB (CIFS) protocol with smbclient tool: “smbclient -c 'get 1000mb.bin /dev/null' -U admin //diskstation/music password"

Every test was running 3 times, without any other activity on this device. Raw data is available from my server. Below is a summary with average values for every test:

Moderation type iperf DL iperf UP HTTP (nginx) SMB (samba)
Disabled (default) 120.8 MBit/sec 230.6 MBit/sec 118.7 MBit/sec 118.2 MBit/sec
dynamic (2000 ints/sec) 140.7 MBit/sec 235.3 MBit/sec 148.5 MBit/sec 128.0 MBit/sec
static (2000 ints/sec) 141.4 MBit/sec 240.8 MBit/sec 165.1 MBit/sec 148.5 MBit/sec
static (1000 ints/sec) 155.9 MBit/sec 241.0 MBit/sec 185.1 MBit/sec 163.2 MBit/sec

As you could see there is a real improvement on all services. It is especially noticeable with nginx, probably because it using senfile() and epoll() kernel functionality. On HTTP i got 36% improvement, on SMB ~28%. I found no regression from this step, so will leave it as is.

Tagged , , ,

Enabling IPv6 on Synology DS207 NAS device

In my home network i have IPv6 connectivity kindly provided by Hurricane Electric. 6to4 tunnel is running on my OpenWRT router and then local addresses are assigned with radvd. This way my Linux/FreeBSD/Winsows boxes are getting IPv6 connectivity.

Also i have a relatively old NAS, Synology DS207 which is running on Linux with latest DSM 3.2 firmware. I found that it is not getting IPv6 address for some reason. To fix this you will need to enable SSH using “Control Panel -> Terminal” applet in web GUI. After logging in to the NAS i found that there is IPv6 module in kernel but it IPv6 is disabled on interfaces using sysctl`s net.ipv6.conf.eth0.disable_ipv6 and net.ipv6.conf.lo.disable_ipv6. After grepping in /etc i found that this was done in a boot time, by /etc/rc.network.

I found that it checks /etc.defaults/synoinfo.conf file for ipv4only key value. And it was “yes” for some reason. I assume that it is because of some administrative reason. So i just changed in /etc.defaults/synoinfo.conf ipv4only to "no" using vi and restarted NAS. After restart it got IPv6 address automatically and also some IPv6 related settings in the web interface are available now, so firmware is 100% IPv6 compatible. I had no time to check if firewall is v6 ready because i am using one on OpenWRT.

Utilities ping6 and traceroute6 are available, so it is easy to check if IPv6 is working:

DiskStation> ping6 ipv6.google.com
PING ipv6.google.com (2a00:1450:4016:801::1014): 56 data bytes
64 bytes from 2a00:1450:4016:801::1014: seq=0 ttl=55 time=23.128 ms
64 bytes from 2a00:1450:4016:801::1014: seq=1 ttl=55 time=16.509 ms
64 bytes from 2a00:1450:4016:801::1014: seq=2 ttl=55 time=16.035 ms

Tagged , , , ,