Jun 28 2008

Network Topology

Tag: Apple, Computers, Gadgets and LifeAlex @ 5:18 pm

Last Thursday afternoon, a close friend of mine gave me a call to ask whether a discounted price he had seen for an iPod Touch was a good deal or not. He was pretty keen on getting an iPod Touch even though the iPhone 2.0 is released in a couple of weeks but he seemed pretty set and doesn’t have a need for another cellphone as his work supplies one for his use.

They don’t currently have a wireless network at their house and seeing as the iPod Touch has wi-fi capability we ended up discussing that I was interesting in selling my current Airport Express Wireless G base-station to upgrade my infrastructure to Wireless-N.

The main reason I wanted to upgrade was actually to have an Airport Extreme Base Station which would allow me to share both printers and also a couple of hard-drives over the wireless. The Airport Express only supports one printer and no hard-drives so I have had to switch USB cables around to print to the other printer in the past.

So, knowing that he was keen for that deal, I went out and purchased a new Airport Extreme Base Stations with Wireless-N and Gigabit ethernet. I also picked up a new Wireless-N capable Airport Express so that I could once again stream music to our downstairs speakers.

My next mission was obviously to map out how I wanted to set up the network and the devices. I love setting up network infrastructure, I don’t purport to say I’m any good at it at all but I find it a hell of a lot of fun.

I plan to sprinkle this blog post with diagrams of the old set-up and the new set-up but my laptop is currently at the shop getting its iSight looked at and I’m using a user-account on Aimee’s laptop which doesn’t have anything that I can easily draw diagrams in. For now I’ll add a textual description.

My network consisted of:

  • An ADSL Modem/Router for internet connectivity
  • A LinkSys VOIP to POTS adapter, for use with our Xnet Fusion VOIP account
  • An Apple Mac Mini, connected in the lounge for entertainment purposes
  • Two Apple MacBook Pro Laptops
  • An Apple Airport Express, currently in use only as a base station since we moved to our new house

Then I added:

  • An Apple Airport Extreme Base Station
  • A new Apple Airport Express

And I’ve packed up the old Airport Express.

I wanted to add to the network

There are a couple of restrictions this placed on the network. For internal network QoS, the Linksys VOIP Adapter needs to be placed between the router and the network so that voice traffic gets injected right at the router. This also means that our cordless phone and corded phone need to be connected within a few meters of that adapter.

The RAID enclosure isn’t network capable so it needs to be connected  with a meter or so of the Airport Extreme Base Station. As do the printers.

Also, the only two locations in the entire house with a phone plug are the kitchen/dining area and the master bedroom.

So I went ahead and picked out a possible solution. It all works pretty well.

I went the whole hog and set up my Wireless-N network on the 5GHz frequency using wide-channels to get maximum possible throughput. We don’t have any 802.11b or g devices in the house (or so I thought) and I doubt anyone in our close proximity has a 5GHz network set up so all was well.

I have the router in the master bedroom and an ethernet cable running from that into our work room. In there is the Base Station, the hard-drives, the printers and the VOIP adapter attached to the cordless phone base.

Downstairs I have the Airport Express and the Mac Mini. As I eluded to above, it turns out that the Mac Mini isn’t Wireless-N capable as I thought it was, it only supports 802.11b and 802.11g so it ended up being connected via gigabit to the new Airport Express as they’re right next to each other anyway. The Express is currently connected to the Base Station using WDS.

I had a fun time setting up the printers. I decided to stretch USB to the limits and see how far away I could keep the printers from the base station. It turns out it is 7 meters keeping to the skirting board to the first printer and another 3 meters to the second where they are placed quite conveniently now. There is a maximum length of 5 meters between devices  so I pulled out an old USB Active Extension cable, then plugged in a  2 meters of USB extension, followed by a USB hub and then plugged the first printer in using a short cable and used a 3 meter cable to reach to the other printer.

I thought I had all my numbers worked out but for some reason, the base stations wasn’t recognising either of the printers! I played around a little and found that the base station didn’t like the active extension cable plugged into it, but it didn’t mind having a hub first and then the active extension so I went down that road. Turns out I would have had to add that initial hub anyway to plug in the hard drives next to the base station so all is well.

I wasn’t particularly pleased with the file transfer throughput so I ended up playing around with WDS, wide-channels, different frequencies and even forcing the base station down to wireless-g to see if I could find out what was happening.

I’m just finishing up testing the network performance using the various settings which I’ll post about at a later stage.


Jun 22 2008

Hosting Woes

Tag: Computers and Web DesignAlex @ 8:22 pm

Tom and I have had a hosting account with Startlogic for a few years now, it was very competitively priced and we wanted a cheap VPS. We haven’t had too many problems up until now, the uptime is good and the problems faced so far have only been with slow response times to online tickets and email.

This post gets into technical details of the DNS system and what went wrong so unless you’re interested in reading technical details, you may want to skip down to the end of this post. [skip]

In terms of DNS, our server runs named (BIND) so it can be a nameserver for any domains we host. This really isn’t a very good option for so many reasons. Two of these reasons are:

  1. You should use two separate name servers which are geographically dispersed.

    Using a single server for a nameserver means there is a single point of failure.

  2. Downtime on the VPS account will mean that after a while, the DNS records cease to exist on the internet.

    One effect this has is that if the VPS account goes down or needs to be rebuilt and it is down for longer than the Expiry time on our domains, mail sent to those domains will be bounced and not be resent automatically.

There are plenty of references for this information on the internet.

StartLogic set us up by putting our primary domain name’s DNS record on their geographically dispersed name servers meaning it would be quite resilient to network failures.

They then told us that if we wanted additional domains pointed, we could just email them. This is what we did for about 2 years.

Tom actually forgot this and has a few of our client’s domains pointing to ns1 and ns2.yigg.net (as Startlogic suggest now).

Anyway, at some stage, they accidently signed us up for an additional account, a standard hosting account, under our primary domain name. This hadn’t caused any problems at the time because they didn’t touch the DNS records.

What happened was that they recently upgraded all standard hosting accounts to a new platform. This meant the erroneous account was moved onto a new server. Last week they completed the migration and changed the DNS record.

Suddenly, I couldn’t get to our control panel*. Yigg.net was resolving to a completely different IP. So I figure there as been a problem and phone through to them.

Now I must mention here that earlier this year we received an email from a representative at IPowerWeb, the parent company (?) for StartLogic saying that he was our point of contact if we needed anything, we could call him.

So, I rang through and discussed somethings and then got put through to a technician. After a while he figured out what had gone wrong after I explained the situation and he found out VPS account and said he’d get those DNS records corrected and pointed back to our VPS account. He said he would also delete the erroneous standard hosting account.

Only the latter got done, probably a mistake, the guy I spoke to seemed really helpful and the extra hosting account got deleted quick smart. The account switched to a holding page instead of the “VDeck Default” page it was showing before. So I waited to see if their servers would update and start announcing the correct IP again.

You need to wait up to 48 hours for a DNS change to reach everyone in the world (worst-case) but there is a trick to finding out if the change has started propagating. On Mac OS (and most *nix machines) you can query a DNS server directly for what it thinks the IP address is for a domain. Because I knew the name of the authoritative server with the record on it, I could ask it directly and see whether it was announcing a the correct IP.


# dig yigg.net @ns1.startlogic.com

; < <>> DiG 9.4.1-P1 < <>> yigg.net @ns1.startlogic.com
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER< <- opcode: QUERY, status: NOERROR, id: 53630
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;yigg.net.			IN	A

;; ANSWER SECTION:
yigg.net.		3600	IN	A	66.96.134.55

;; Query time: 291 msec
;; SERVER: 66.96.142.100#53(66.96.142.100)
;; WHEN: Sat Jun 21 23:35:01 2008
;; MSG SIZE  rcvd: 42

It wasn’t.

I actually forgot about it until lunch time the next day when I Tom got an email from a client saying his email was no longer coming through. Turns out, his name servers were set to ns1. and ns2.yigg.net which now resolved to Startlogic’s standard hosting account, not to BIND running on our VPS account.

So I wrote a support ticket explaining the situation and then phoned America to get them to sort it out as soon as practically possible. The support representative said a technician was looking at it right then. So I hang up and waited… and waited. No change.

The next day I updated the ticket again trying to clarify what needed to be done, point yigg.net back to our VPS’s IP address and away from the IP it was incorrectly set to previously.

Today, later I rang them again to see what was going on. The representative then proceeded to tell me that what I wanted wasn’t possible any more and that I needed to set up name servers myself. I got quite confused as to what she was asking me to do because she said that I wouldn’t need to sign up with a DNS provider, I could do it all through the registrars control panel.

The main problem with that, is that I didn’t know where that was, as we registered the domain with StartLogic, they had taken care of registering it, setting up the contact information and adding their name servers to the records. I realised when she told me the URL to go to that I had been there before, to update my contact details when I was told I had to. She couldn’t tell me the username and password so I had to figure that out myself, which I did without too much trouble.

What I couldn’t figure out was what she was asking me to do. She said I needed to “create a name server” for my domain name. Now, in normal domain name management talk, that means setting up a box running BIND and telling the registrar to hold a glue record pointing to this box. It turns out that she was simply asking me to add glue records at the registry level for our VPS (which is running BIND already).

There is a difference between creating a name server and simply pointing A records at a registry level at it.

If anyone from Startlogic reads this blog post. Please reconsider this policy, the way it worked for the last two years was much more reliable and didn’t require a user to go into that unbranded OpenSRS management console to try and decipher fairly non-standard terms.

In terms of customer service, they get a low score. I got it resolved in the end, if it hadn’t I would have called my contact at IPowerWeb and got put through to someone who may’ve been more helpful, I’m not sure though.


* I could still get to our control panel as I just needed to access the correct at our IP, it doesn’t require a hostname to get into the control panel but I think I was only one who knew that (don’t know if Tom did and I knew James didn’t).

** If anyone has a problem with this post (including StartLogic), I will take it down and replace it with one about not using a single domain name server in a VPS situation, which is still relevant but applies to a few more hosting providers.


Jun 18 2008

Firefox 3

Tag: Computers and Web DesignAlex @ 12:09 pm

Firefox 3 was launched this morning (5am NZ time). Mozilla Foundation have made a huge marketing effort to the point of setting a world record for the most downloaded software in 24 hours. Now, you’d expect, with a market share just shy of 20% of the global web browser market share and that kind of marketing, you would need some serious distribution technology.

Mozilla.com web traffic is pushing well over 2 Gigabits a second of just pure HTTP traffic. That is in addition to the 13 Gigabits a second or so of download traffic. We are still at around 14,000 download/minute and mozilla.com is responding well! Go Mozilla community and IT team! schrep – June 17th, 2008

Considering the numerous reports of the Mozilla.com website being down for at least the first hour of the record attempt, lloks like something in the middle couldn’t quite handle the load. At 15Gb/s that is close enough to 2GB/s, that is fairly large.

The official counter at SpreadFirefox.com shows 2,135,640 as at midday here, only 7 hours in. Either their counter is off or things have calmed considerably. If they were still blasting data out at 2GB/s the counter would be closer to 7 million by now.

I’m not going to go in to the features of Firefox 3 too much but for Mac Firefox junkies, it is a massive update. The interface is now using native widgets and is much faster. It also brings Firefox back into the running with Safari and Opera again in terms of standards support.

If you download it today, from http://getfirefox.com you’ll help Mozilla set a world record, the servers seem to be coping now so it downloads quite quickly however the Mac version weighs in just over 17MB which is on the steep side.


Jun 10 2008

deleteCell may have side-effects

Tag: Computers and Web DesignAlex @ 12:13 am
UPDATE:

I have created an interactive test case and an automated test case.

Turns out the behaviour is reproducible. Now, is this a bug or am I just missing something about the way that method should work?

I was debugging a client-side heavy application today in IE7 and ran up against a very weird bug. Anyway, even with the Microsoft Script debugger, it took me a couple of hours to trace down the cause of this one bug.

The system has a page which works similarly to Apple Mac OS X’s Finder windows in Column View. In IE7, I was having a problem where all the children of a node inside a table cell where being removed from the DOM when I removed the table cell itself. If you think this sounds normal, let me explain.

In Javascript, DOM Elements exist as Javascript objects and can be attached into a document at any point, they do not have to be a document, they can exist solely as fragments. The normal DOM ‘removeChild’ method does exactly this; it detaches the child from the parentNode but if there are any references to the DOM element in javascript-land, it does not get deleted (or garbage collected to be more precise). This means you can reattach the node somewhere else after some processing.

Safari, Firefox and Opera appear to do this with the deleteCell method of a ‘table’ as well but Internet Explorer appears to do something different. There is a little bit of speculation here as I haven’t created a minimal test case of this bug yet but it appear that IE detaches all the DOM Nodes recursively beneath the cell it deleted. This doesn’t appear in the MSDN documentation so I’m not sure quite what is happening, am I experiencing a bug caused by something else maybe.

How would that be useful!? I can’t see a purpose for it but whatever.

My fix was to remove all the child nodes of the ‘td’ element using removeChild first, then delete the cell. That meant the elements that were in the cell before hand still existed if there were any references to them, which there were.


Apr 22 2008

Windows Vista

Tag: Apple, Computers and ResourcesAlex @ 4:59 pm

I has been an awfully long time since I last posted here. Many things I could’ve written about, maybe I will in the next few weeks.

Anyway, this post is about Windows Vista. More specifically, installing Windows Vista Business (64bit) onto a Macbook Pro (Santa Rosa).

The Apple Bootcamp drivers that came with my laptop don’t support Windows Vista 64bit so I had to do some digging around to find the drivers that worked and get everything running smoothly.

This information is out there on the web but I found some of the instructions on exactly which driver to choose a little had to understand. Below is a list of the drivers I used to get Vista Business 64bit working on this Macbook Pro.

Video

Hardware: nVIDIA 8600M GT with 256MB RAM
Drivers: nVIDIA ForceWare X 167.62

Audio

Drivers: RealTek R190

Keyboard/Fan

Drivers: Input Remapper 1.0.04
NB: Screen backlight control is not supported on the nVIDIA card yet

Wireless

Drivers: Atheros v7.6.0.83

Ethernet

Drivers: Marvel Yukon v10.57.3.3

This information is mainly from two sources:
http://rumblingsfromdeveloper.blogspot.com/2007/12/macbook-pro-and-vista-64bit-x64-issues.html
http://forum.notebookreview.com/showthread.php?t=149395

My Macbook Pro’s Windows Experience IndexWith these drivers I got a Windows Experience Index of 4.9
Processor: 5.2
RAM: 4.9
Desktop Graphics: 5.9
Gaming Graphics: 5.5
Primary Hard Disk: 4.9


Feb 08 2007

Thoughts On Music

Tag: Apple, Computers, Gadgets and MusicAlex @ 7:37 am

Steve Jobs has issued a Hot News article detailing Apple’s stance on DRM and it’s future. I’m going to go so far as to say he has laid down a challenge in full public view to the big 4 Music Distribution Companies. However I can see that his account serves only to appease the public’s wrath due to Apple not licensing it’s FairPlay DRM technology to other companies, I can’t see the big wigs in the music world even reading the article, let alone uttering more than a chuckle.

http://www.apple.com/hotnews/thoughtsonmusic/


Feb 01 2007

Internet Explorer 6 Performance

Tag: Computers and Web DesignAlex @ 5:18 pm

I spent a huge part of today trying to determine the cause of a major Internet Explorer performance and rendering regression in a Web Application I'm developing. The reason it was such a bitch to find was because so much code had changed since the last time I had done a proper test in IE6. This was in code which I didn't expect to cause rendering issues, performance issues maybe, but those could have been dealt with.

So, I went through carefully ripping apart the project, disabling stylesheets, removing images, removing individual styles to figure out what was going on. About a hour later I hadn't got very far. I had determined that every1 browser was fine except IE6.

In frustration, I turned to Google. Trying to find pages describing huge black areas rendering over the page while using Scriptaculous Sortables got my nowhere so I tried searching for causes of huge black rendering artefacts in IE in general... nothing.

I turn back to trying to make a minimal test case. I ended up removing an image that was inside each Sortable item and suddenly the rendering problem went away and the performance jumped up significantly. Anyway, some dilly-dallying around and it turns out it was the javascript I'd written causing problems at all. It was the IE6 CSS Alpha PNG hack which was causing all the problems (which was working fine without performance issues the last time I tested this site in IE6).

It is indeed common knowledge among web developers that IE6 does not support transparency on 24-bit+Alpha PNG images. The alpha channel is rendered [usually] in a baby blue colour instead of being see-through.

To remedy this I was using the fastest hack around the issue that I have found and it involves pasting 5 lines in the CSS file for a site and bingo. I didn't make this hack but here's how it works. It uses the proprietary filter CSS attribute combined with the DirectX ActiveX control to draw the PNG, to target only PNGs and the also proprietary CSS extension 'expression' which uses JScript to compute values. I haven't had a problem with this hack yet, it doesn't handle CSS background images but I haven't needed it to yet.

CSS:
  1. img {
  2.     height:expression((this.complete&&(String(this.src).substr(String(this.src).length-4,4)==".png"))?"1px":"");
  3.     width:expression((this.complete&&(String(this.src).substr(String(this.src).length-4,4)==".png"))?"1px":"");
  4.     filter:expression((this.complete&&(String(this.src).substr(String(this.src).length-4,4)==".png"))?("progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.src+")"):"")
  5. }

This combined with the addition of a PNG on each individual Sortable Item caused the poor DirectX Transform to basically crap itself and render parts of the window black. Very black.

Blah.

What a waste of many hours of my day.

Honestly though, this rendering bug caused a few 'wow' moments from people in my office when they saw what IE was displaying on the screen and how it took roughly 20 seconds and 100% CPU to drag one single item between two lists. I'll have a screen-shot of this up in the next few days.


#1 every means "Safari, Firefox 1.5, Firefox 2.0, IE7, WebKit nightlies and Opera 9"


Jan 10 2007

OMFG Kernel Panic!

Tag: Apple, Computers and LifeAlex @ 9:21 pm

I rocked around to Tom's place this evening to find his flatmate Jo's iMac G5 Kernel Panicing on boot. So, putting on the tech hat we tried Target Disk mode (successful at accessing the drive) and resetting the NVRAM didn't do anything so we tried to figure out what was causing it all, anyway, so we ended up in Single User Mode, force fsck'd the hard-drive which was showing tons of journal problems. Fixed a ton of those, it wasn't able to fix everything though, booted and bingo.

Long story short it was possibly the combination of transferring 40GB of files to the harddrive over Samba filling the HDD to 1GB free and then playing a movie over said Samba connection. These are the dying words in one of the coolest Crash Logs from the Kernel I've seen:

Jan 10 20:29:31 localhost kernel: netsmb_dev: loaded
Jan 10 20:42:16 localhost kernel: smb_iod_sendrq: TRAN_SEND returned fatal error 57
Jan 10 20:43:06 localhost crashdump: Unable to determine CPSProcessSerNum pid: 413 name: mplayer
Jan 10 20:43:06 localhost crashdump: Started writing crash report to: /Users/Jo/Library/Logs/CrashReporter/mplayer.crash.log
Jan 10 20:43:06 localhost crashdump: Finished writing crash report to: /Users/Jo/Library/Logs/CrashReporter/mplayer.crash.log
Jan 10 20:44:39 localhost diskarbitrationd[85]: disk1s2    hfs      651C7F29-1350-3F82-A747-FFEE52A28818 MPlayer                 [not mounted]
Jan 10 20:44:39 localhost diskarbitrationd[85]: disk1s2    hfs      651C7F29-1350-3F82-A747-FFEE52A28818 MPlayer                 /Volumes/MPlayer
Jan 10 20:44:43 localhost diskarbitrationd[85]: disk2s2    hfs      C5BA4CED-7491-32B0-A79A-5C8D9F4FC679 MPlayerOSX_8r5          [not mounted]
Jan 10 20:44:44 localhost diskarbitrationd[85]: disk2s2    hfs      C5BA4CED-7491-32B0-A79A-5C8D9F4FC679 MPlayerOSX_8r5          /Volumes/MPlayerOSX_8r5
Jan 10 20:44:53 localhost kernel: jnl: flushing fs disk buffer returned 0xd
Jan 10 20:44:53 localhost kernel: disk1s2: device is write locked.
Jan 10 20:44:53 localhost kernel: jnl: do_jnl_io: strategy err 0xd
Jan 10 20:44:53 localhost kernel: jnl: write_journal_header: error writing the journal header!
Jan 10 20:46:27 localhost kernel: hfs: WARNING - blocks on volume Macintosh HD not allocated!