Networking – Learning about TCP/IP

So today I was asked a question about TCP/IP. Specifically, about how a TCP connection is established. Networking is something I definitely do not spend enough time on (and have I have never really gone into the nitty gritty as to how it works either). I understand all the basics and what I need to get around for my job, as well as some more advanced or bespoke bits that I have learnt / done on the fly as and when required, but think that I do need to learn more about how the underlying technology works.

As a start to this, I am writing this quick post to answer this question. (See first line of this post). I did know that some kind of handshake needed to be done to establish the initial connection (that part is obvious), but the specific answer is quoted below (source: Wikipedia).

Question: How is a TCP connection first established?

Connection establishment
To establish a connection, TCP uses a three-way handshake. Before a client attempts to connect with a server, the server must first bind to a port to open it up for connections: this is called a passive open. Once the passive open is established, a client may initiate an active open. To establish a connection, the three-way (or 3-step) handshake occurs:
The active open is performed by the client sending a SYN to the server. It sets the segment’s sequence number to a random value A.
In response, the server replies with a SYN-ACK. The acknowledgment number is set to one more than the received sequence number (A + 1), and the sequence number that the server chooses for the packet is another random number, B.
Finally, the client sends an ACK back to the server. The sequence number is set to the received acknowledgement value i.e. A + 1, and the acknowledgement number is set to one more than the received sequence number i.e. B + 1.
At this point, both the client and server have received an acknowledgment of the connection.

I have got a Cisco for beginners book sitting on the bookshelf here, so I think as soon as my current personal projects and VCP training are finished, I’ll get back to reading that! I also hope to post more on Networking in the future as I come to terms with the fundamentals.

Sneak peek: New game in development for iPhone / iPod Touch

So I thought I would do a post where I can post updates as I make progress on this new game I am developing. The platform is of course the iPhone / iPod touch. That is all versions from the first iPhones up to the new iPhone 4. I may even do an iPad version later. I have really been putting some effort into learning more about OpenGL and more specifically the cocos2d engine. By starting this game I have learnt tons about particle effects, sprites and game logic. I am even having to dust out the cobwebs in my brain when it comes to mathematics! The shooting and accelerometer movement algorithms in this game took some effort to get right! Note that all graphics and code are original and done myself (i.e. all game content is self-made!) My graphic design abilities have definitely helped with regard to the making of my ship, enemy, back drop and other game graphics. I’ll post further updates as I go along. The name is going to stay secret till its released though 🙂

This is a top-down, accelerometer controlled space shooter, with fluid 60fps animation and great effects. Anyway, here are a few screenshots of what I have so far. Note that any text you see is not final and just there for testing purposes for now. The enemy ship and player graphics are also going to be refined before I submit this.

Note the Battlestar reference in my last screenshot 😀 Anyway, if you have any ideas or questions, feel free to post them below.

Modify your NIC MTU size setting in Windows Registry

A quick and easy blog post today on how to modify your NIC MTU (Maximum Transmission Unit) size setting in the Windows Registry.

By default your MTU won’t be defined in registry. Microsoft state that (Link):

The MTU is usually determined by negotiating with the lower-level driver. However, this value may be overridden.

To change your MTU setting in Windows Server 2003 or 2008 use the following steps:

  • Open regedit as an administrator account on the server in question.
  • Navigate to HKLM\System\CurrentControlSet\services\Tcpip\Parameters\Interfaces\[Choose the interface in question] (Do this by checking the correct IP address is in the settings under this key for the adapter you are configuring)
  • Once you are in the correct key for your interface, right-click and select new DWORD value (32 bit).
  • Call it MTU
  • Give this a decimal value equal to the setting you would like your MTU to be (measured in bytes).

For more information about Maximum Transmission Unit sizes, have a look at the official Wikipedia article.

Here is a screenshot of an MTU setting I made on this server using 1400 bytes as an example. This would obviously be tuned to whatever amount you are wanting to use for your NIC and specific application settings.

Manage VMware Server 2.0 with Virtual Infrastructure Client instead of the Web UI

I personally find the Web UI a little slow for managing VMware Server 2.0 on my home lab and also prefer to use an interface more like the one I use at work when managing our vCenter and ESX hosts. So here is how to use the VMware Infrastructure Client to manage VMware Server 2.0. For this to work, ensure you use an older version of the Infrastructure Client. The one that comes with ESX 3.0 / 3.5 hosts seems to work well. The newer vSphere Client doesn’t work and gives you an error message when you try to login.

1. Grab a copy of the Virtual Infrastructure client and install it on the machine you are accessing your VMware Server Host from. I had trouble finding a download link, so I needed to pull it off an old ESX 3.5 host.

2. Install the client, then run it. At the login prompt enter the full web UI address of your VMware Server Host in the IP Address / Name section. So if you were trying locally on your host, you could enter https://localhost:8333 or from a remote machine use the IP address in the format https://x.x.x.x:8333

3. Enter your user name and password and hit “Login”. This should load up your VMware Server 2.0 server in the infrastructure client. Enjoy!

Benchmarking – Corsair Reactor R60 SSD vs conventional HDs

So the other day was my first venture into the world of Solid State Storage. I purchased a Corsair Reactor R60. Not the best of SSDs, in fact it is more on the budget side when it comes to SSD storage. It uses a JMicron JMF612 controller and support TRIM provided your OS such as Windows 7 does. The drive was however good value for money in terms of size and performance. Here is a rundown of some of the features straight from Corsair’s site.

  • Maximum sequential read speed 250MB/s
  • Maximum sequential write speed 170MB/s
  • Latest generation JMicron JMF612 controller and MLC NAND flash for fast performance.
  • 128MB DRAM cache for stutter-free performance
  • Internal SATA II connectivity
  • USB 2.0 connectivity for disk cloning or for use as external drive
  • TRIM support (O/S support required)
  • No moving parts for increased durability and reliability and quieter operations over standard hard disk drives
  • Decreased power usage for increased notebook or netbook battery life

I had a clean installation of Windows on my previous OS drive, so I decided it would be a good time to benchmark the SSD against this. I also got hold of some results using the exact same benchmark and scenario but using 8 x Velociraptor 300GB SATA Drives in RAID 60 on a dedicated Areca RAID card. Here are the results. I have used IOmeter for the benchmarking, using a Transfer Request size of 4KB. The results are taken from the Command Queue Depth of 4 results in each instance.

I must say that I am extremely impressed with this SSD. Even for budget / mid range drive, it is phenomenally fast when comparing it to conventional HD storage. Windows loads much quicker and so do the games that I have installed on it. Everything snaps open as the drive is able to access any area of storage almost instantly. File copying performance is also extremely impressive. Even when comparing to a high end RAID controller with multiple high speed Velociraptor drives spinning at 15000rpm in RAID, this drive pulls ahead in all benchmarks. As a dedicated OS / Application drive, I would definitely recommend one.

Next up, I think I am going to try this drive out as dedicated VM storage drive and see how VMDKs perform on it!