Archive for November, 2008

Submarine Cable Map

Thursday, November 20th, 2008

I recently took Southern Cross Cables up on their offer of a totally free Submarine Cable Map.

I am now officially more nerdy because there’s a technical world map stuck on my wall.

The preview from Southern Cross Cables is:

Map

Map (clicking will not enlage)

I’ll post a nice picture of it stuck on my wall when I can be bothered charging my camera batteries.

November 24 Peak Day for Computer Virus Attacks

Tuesday, November 18th, 2008

According to this article, statistics show that last year, November 24 had the highest incidence of computer virus infections, probably caused by the higher likeliness that someone will enter their credit card number as it is approaching Chirstmas.

In other news, the word “meh” is now in the Collins English dictionary.

Validating the format of a GUID

Friday, November 14th, 2008

Following is a C/C++ utility function that validates if a Globally Unique IDentifier is in the correct hexadecimal format of 3F2504E0-4F89-11D3-9A0C-0305E82C3301.

BOOL	ValidateGUID(const char*	guid)
{
	for (unsigned char i = 0; i < 37; ++i)
	{
		if (i == 8 || i == 13 || i == 18 || i == 23)
			if (guid[i] != '-')
				return FALSE;
			else;
		else if (i == 36)
			if (guid[i] != 0)
				return FALSE;
			else;
		else if (guid[i] < '0' || guid[i] > 'f' ||
			(guid[i] > '9' && guid[i] < 'A') ||
			(guid[i] > 'F' && guid[i] < 'a'))
			return FALSE;
	}
	return TRUE;
}

IPv6 Part 2

Tuesday, November 11th, 2008

Go to http://tunnelbroker.net/ and follow the instructions.

IPv6 Part 1

Thursday, November 6th, 2008

First, a bit of background.

The current Internet Protocol (IP) you are using now is known as IPv4 (version 4). The addresses look a bit like:

203.105.67.89 (<- That was completely randomly typed. It seems to be owned by some Japanese company)

Now you might be thinking, that’s great! Why the hell do we need a new version of IP? This comic from xkcd will explain it in a simple, comical fashion:

It doesn’t take a genius to work out:

  1. There isn’t an awful lot of grass left
  2. The internet is still expanding at a rapid rate
  3. Expansion means the need for more IP addresses

On the other hand, maybe it does… Anyway, we have a problem. Part of the problem is that IPv4 addresses are too “short”. Remember when telephone numbers in Sydney were 7 digits? No? Neither do I, I wasn’t born then (I think). They had to add an extra digit (existing numbers got 9) because there weren’t enough numbers to go around. A telephone number with 7 digits means that there are one million (1000000) possible numbers (in reality it is less). IPv4 addresses have 4 sections each seperated by a dot (123.123.123.123) and each section is allowed to have a value between 0 and 255. Which means that there are 4 sections of 256 possible values, making a total of 4294967296 (256^4) possible IPv4 addresses. That may sound like a shitload, but it really isn’t, since there is currently estimated to be 6700000000 people in the world, which means there’s an average of less than 1 IPv4 address per person. Not quite enough.

But alas, along comes a solution going by the name of Network Address (and Port) Translation (NA(P)T). What it does is allow a whole heap of private IPv4 addresses to be “hidden” behind one public IPv4 address. Sounds great, but (like every other thing) along comes problems. First problem is that the number of simultaneous TCP connections and UDP “connections” will be highly limited. A NAPT device (usually a router) has to store information on each TCP/UDP connection going through it. What sort of information does the router have to store for each connection:

  • Router’s Private IP (32 bits)
  • Router’s Public IP (32 bits)
  • Local (computer inside the network (or “behind the NAT”)) IP (32 bits)
  • Remote (the computer out on the internet being accessed) IP (32 bits)
  • The IP Protocol Number (8 bits)
  • Private TCP/UDP Port (16 bits)
  • Public TCP/UDP Port (16 bits)
  • Remote TCP/UDP Port (16 bits)

That’s a total of ~184 bits or 23 bytes for each connection (and you probably don’t realise how much connections each computer uses). There’s also heaps of overheads and data that I missed, so lets round it to a nice 128 bytes. The amount of RAM in your router will limit the number of connections you can have. For example, on my pov ADSL2+ Router (Dynalink RTA1335), which has 6132 kbytes of RAM and 5528 kbytes of that is used for miscellaneous stuff on the router, like keeping the ADSL line up and the mini-http server, etc, leaving 604 kbytes left for NAPT entries, which is enough for 4832 NAT entries. Sure that’s enough for like 1 computer doing normal HTTP web browsing and email, but when multiple computers and Peer-2-Peer comes into the equation, ~4500 connections will become insufficient.

The second, and most noticable, problem is that someone on the internet cannot directly initiate a connection to a computer “behind the NAT”. This causes problems with running servers, hosting Warcraft III games and other games. Sure, Port Forwarding can be used to address that, but what happens when you want to have multiple computers hosting Warcraft III games in your network? Since the Warcraft III port is already “forwarded” to the first computer, no one will be able to join the game hosted on the second computer.

IPv6 has 3.4028236692093846346337460743177e+38 (2^128) addresses available. That’s plenty enough for everything/everyone, without the need for annoyances like NAPT.

Tomorrow’s post will be about how to set up IPv6 for yourself (the practical side).

DotALadder Progress

Wednesday, November 5th, 2008

DotALadder’s ranking and scoring system is chugging along slowly.

I’ve mostly determined the parameters for scoring replays, but still need a reliable method to “fingerprint” replays to ensure that multiple replays of the same game aren’t uploaded to “scab” EXP.

Please test it out the detection of scoring parameters by reading http://forum.dotaladder.com/viewtopic.php?f=10&t=9&p=10#p10 and following the instructions.

You may post the link to the result as a comment to this blog if you wish.