The Friday Picture will provide you with inspirational and (de)motiviational guidance to make the approaching weekend so much more appealing:
Monthly Archives: October 2008
NAS: Netgear ADSL statistics
In a previous post I explained the significance of SNR and attenuation for ADSL lines.
I have spent now a significant amount of time to write scripts to retrieve the ADSL-statistics for my Netgear DG834v4 ADSL router. The script will equally work on any Broadcom based modem-router which allows access to telnet and supports the command “adslctl”.
The solution is really simple and consists of one perl-script collating the information and a CGI-script which then produces the stats in real time from your webserver:

I have deployed the solution on my Synology DiskStation DS107+ (FW722) and had the solution running now for a day. If you want to run this on the Synology, you will need to install rrdtool via ipkg. If you want to run it on another Linux-based environment, ensure that you have access to the command-line version of rrdtool and rrdcgi (which comes bundled with rrdtool).
My current setup produces stats every 15 minutes and reports on the following stats:
- Ping statistics. Currently against my local ISP – saix.net, but scripts are easy to modify to include your own pings
- ADSL signal to noise ratio (up / down)
- ADSL attenuation (up / down)
- Power output (up / down)
- Maximum ADSL data rate (up / down)
- ADSL sync speed (up / down)
All stats are reported per hour, day, week and month. In the future I want to enhance the scripts to provide additional useful reports for the Netgear DG834.
By now you are probably asking “Where is the download-link?” — well here is the thing, my hosting and the popularity of this site is starting to cost me a bundle. So I am introducing donation-ware. It is up to you to decide if you want to donate USD 1,00 or a million (yeah baby) using PayPal via the donation-button below. The donation is absolutely save and you will receive the download-link automatically via email (link is valid for 24 hours). Further, I will email you any updates to the scripts and will look at implementing any recommendations you have.
I think this sounds like a fair deal, especially since it took me in access of 60 hours just getting those scripts done (don’t get a fright though – the scripts are simple – that’s the beauty of the solution).
If you want to use the scripts, donate below (you require a running version of Perl with Net::Telnet and Net::Ping, rrdtool — the scripts will run on the Synology out of the box).
NAS: Analyse your squid logs
In a previous post I described how to install Squid on the Synology. This small tutorial will now explain how to display your usage behaviour in Squid via Webalizer.
You need to have ipkg installed and need to have an understanding on how to include 3rd party apps (i.e. via phpsrc).
- Install webalizer: ipkg install webalizer
- Create a new config file: cp /opt/etc/webalizer.conf.sample /opt/etc/webalizer.conf
- Adjust your log-file entry and point it to your Squid-access log: LogFile /opt/var/squid/logs/access.log
- Adjust your output directory (this is the HTML-directory from which you want to display your stats): OutputDir /volume1/webapps/scripts/squid/usage
- Create a cronjob entry (remember that the crontab needs to have tabs instead of spaces): 5 0 * * * root /opt/bin/webalizer -F squid -A 100 -C 100 -R 100 -S 100 -U 100 -e 100 -E 100 -Q
The above will create usage statistics every day (5 minutes past midnight) and publish the stats to the output-directory.
Some more cool stuff:
- Use HideUrl to hide sites from the statistics. I typically hide access to all my local servers, since I am only interested in the outbound usage.
- Use GroupUrl and HideUrl together to group certain websites and make it one line-item in the stats. I access the PS3ZA-forum frequently, so I don’t want to have every URL show, since it fills up the stats. Using GroupUrl www.ps3za.co.za/forum and HideUrl www.ps3za.co.za/forum will create one line-item in the stats. You can do the same with your RSS-feeds and others.
- To avoid your logs filling up, you want to add a cronjob to rotate your squid access-logs (remember those TABS – this job will rotate the logs 30 minutes past midnight every month): 30 * 1 * * root /opt/sbin/squid -k rotate. Important: Webalizer don’t rotate the logs during the month – I was not able to get Webalizer to analyse those logs and you will lose your monthly stats.
ADSL: Significance of SNR and attenuation
As an ADSL n00b I wanted to understand how the technology works and how to get the most out of it. In essence if you want to improve speed and increase stability you need to familiarise yourself with SNR (signal to noise ratio) and attenuation. Many ADSL-routers will provide you with those stats.
SNR or Signal to Noise Ratio:
Describes the ratio of usable data-signals on your line. You can associate the “signal” with the data traveling across your ADSL-line and the “noise” as the unwanted interference affecting the signal. The higher the number the better for this measurement. In some instances interleaving can help raise the noise margin to an acceptable level.
6dB or below is bad and will experience no synch or intermittent synch problems
7dB-10dB is fair but does not leave much room for variances in conditions
11dB-20dB is good with little or no synch problems
20dB-28dB is excellent
29dB or above is outstanding
If your SNR is below 12dB you are pretty much screwed and will not get a consistent level of ADSL-service. You could try to convince Telkom to rewire the cabling – but this is unlikely to happen.
Attenuation:
Is the reduction in signal strength on your phone line. In ADSL this may be reported as “loop loss” and is the natural deterioration of the ADSL signal over distance from the exchange. Attenuation is normally directly linked to the length of your line. Copper is traditionally used in the local loop and the higher gauge of copper will give the best signal, however some lines may have some aluminium or aluminium joints on the line which will increase resistance… as will oxidisation of joints. The lower the dB the better for this measurement.
20dB and below is outstanding
20dB-30dB is excellent
30dB-40dB is very good
40dB-50dB is good
50dB-60dB is poor and may experience connectivity issues
60dB or above is bad and will experience connectivity issues
The standard signal attenuation spread for a given speed is somewhere in the region of 25-30dB for ADSL1 speeds (if we had ADSL2/2+ this would be).
The following guide (distance vs. attenuation vs speed) gives you an guestimate what you can achieve:
<1km should be 23-24Mbit (nice speed, but doesn’t it bug you that Telkom people walk through your bedroom?)
1.0km = 13.81dB = 23Mbit
1.5km = 20.7dB = 21Mbit
2.0km = 27.6dB = 18Mbit
2.5km = 34.5dB = 13Mbit
3.0km = 41.4dB = 8Mbit
3.5km = 48.3dB = 6Mbit
4.0km = 56dB = 4Mbit
4.5km = 62.1dB = 3Mbit
5.0km = 69dB = 2Mbit
>5.0km (you are pretty much poked — sorry for you)
You will not be able to fix attenuation (unless you relocate straight next to the exchange). You will however be able to influence Telkom or your ISPs – use tooling such as MRTG to measure your variances and log incidents against them. It is unlikely that they will move the exchange closer, but you could combat SNR (check your wiring, climb into the manhole and see if your underground wire is of the cheap kind etc).
Update – 2009/02/20: If you own a Netgear DG834XX ADSL router, you can try a custom firmware which allows you to lock in the SNR – check out the following post.
Bye Bye iBurst – whoop whoop Telkom
Finally my frustrations are over – although iBurst has tried the best the possibly could, it was too little too late. Amazingly, I ordered a 4MB ADSL line on 29th September and within two weeks line was installed and working. A BIG WOW to Telkom – superior service and this does not seem to be an isolated case either – many people mention the same turnaround times.
The ADSL line has perfect attenuation 17db (down) and 8.5db (up) and an excellent SNR – 28.4db (down) / 14db (up) — so it is no surprise that the line syncs perfectly all the time.
The download speeds are amazing: International ping to New York is 327ms (vs 2 seconds on iBurst), download speed is 1800kpbs (vs 285kbps on iBurst).
PS3: 2nd platinum trophy
It took me 32 hours since 29th September to finally get the Burnout Paradise Elite trophy. This translates into 44 owned cars, 4 bikes and 1300 miles travelled.

Most trophies are very easy and just take time. Amongst the more frustrating ones are the midnight challenges on the bike – although the light-conditions are realistic, it takes some serious practice to beat the challenges (you can’t see beyond 10-20 metres).
All online timed challenges are super frustrating. A timed challenge consists of two parts. The first part is that a number of players meet at a certain location and the 2nd part is the actual challenge. The frustrating part is that players joining the timed challenge either exit the game because they are incapable of completing the challenge or they just don’t join up for the challenge. In short a punch of pricks which ruin the experience. Once a player leaves the timed challenge, you have to start all over again – damn annoying if you are almost at completion of part 2.
It took in excess of 6 hours just to get 10 timed challenges done. Once I heard that familiar “bling” on the PS3 and got the last Burnout trophy I was super-satisfied – lol.





