Loading...

The blog is being migrated and merged with multiple Imphenzia blogs so the format and content will be inconsistent for a while.

Full cone NAT UDP holepunching or just a hole in the head?

So far I've wasted about 8 hours of my time trying to get the masterserver communication to work in Unity3D. I'm currently troubleshooting Network Address Translation (NAT) issues that prevent my test game from acting as a server.

So far, I've tried to get it to work through my existing firewall/router which is a virtual machine running pfSense. Despite configuring uPnP and outbound NAT according to this pfSense forum post to emulate what's referred to as Full Cone NAT it's been a no-go. Unity's networking test function still claims it is Port Restricted NAT which then means I can't really host any games.

Ok - what about my Cisco LinkSys WRT320N router - I've got that one set up as well with it's own public IP address. I changed my default gateway to this device instead, and behold, it didn't work. That device also has a poor implementation of uPnP and NAT traversal so that does not work either. I found this list of devices that describes which NAT-type each device supports and whether or not it supports UDP-Hole Punching. It turns out that the vast majority of routers don't support this very well which explains why the world of multiplayer gaming seems to spend more time speculating and trying to get a game to work than actually playing it.

Hole in the head - and in the firewall


To be fair, uPnP is an idiotic invention anyway. The idea is that any application can tell the firewall to open itself up. But wait a minute... what if I have a trojan (like Skype =) can that just politely say "Open Sesame" and let all the baddies in? Yep. That's right.
So then, we have uPnP (which stands for Universal Plug and Play) a desperate attempt to solve communication in the world of NAT... and we have most devices implementing uPnP poorly to make it even worse.

Hole in the head.

Is there any light at the end of the funnel?


NAT is used for a number of reasons, one being that there are not enough IPv4 addresses available (only 4.3 billion) to allow all the computers in the world to have a unique address. This means that internal networks usually have addresses in the private ranges such as 10.0.0.0/16, 172.16.0.0/12, and 192.168.0.0/16 which are then translated between the private network and the Internet. There are also security benefits with NAT, for example, by default (more or less) an internal host must initiate traffic to an external host before the external host can communicate back to the client host.

My hope is that IPv6 will solve the NAT-mess in the future. IPv6 has such a large address space (340 undecillion) that in theory NAT wouldn't be needed. How many IPv6 addresses are there I hear you wonder? Well, someone with enough time on their hands calculated that every square millimeter on earth's surface could each be allocated 170,000,000,000,000,000  IPv6 addresses.

But wait... IPv6 is currently being implemented and we can't just switch from IPv4 to IPv6 as nothing would work. How to we solve the transition then? Let's go with our buddy NAT again... now with the selection of more implementations - how about 4in6, 6in4, 6over4, DS-Lite, 6rd, 6to4, ISATAP, IVI, NAT64 / DNS64, Teredo, TSP, TRT, SIIT, Drafts, 4rd, AYIYA, dIVI, NAT-PT, NAPT-PT.... Have fun troubleshooting why network multiplayer gaming isn't working during this transition period =)

Do I sound negative? I wish we could just format the world and start over with stuff that just works instead.

Imphenzia Soundtrack Launched

I have launched a new section of Imphenzia called 'Imphenzia Soundtrack'. Creators of games, movies, videos, multimedia projects, films, commercials - or whatever(!) - will be able to find music for their projects here. There is both exclusive and non-exclusive tracks available for both commercial and free projects.

Have a look at the new section at http://soundtrack.imphenzia.com - it features the new '2008' look of the Imphenzia sites. Hope you liket it.

Olympic Games - what a joy =)

I'm going to put music making, game making and web site developing aside here and write about something else today.

I've been looking forward to the olympic games this year, I am not an huge fan or anything - I just enjoy the competitive atmosphere and want to watch it for an hour or so every evening.

I have a Samsung PS42S5H plasma TV that I bought 28th July 2005. During the olympic ceremony, the TV goes KLICK and red pixels spread across the TV = properly broken. In sweden we are covered by law against manufacturer faults that occur within 3 years of purchasing hardware, such as a TV, despite the fact you may only have a one year manufacturer warranty. It was 3 years and a week or so when my TV broke, just my luck =) But it turns out as the first TV that got delivered to me in 2005 it was defect on delivery, so I had it replaced... so with some hope I will still get it repaird/replaced for free, fingers crossed... This, however, does not help me watch the olymic games as getting the TV repaired/replaced will take a month or more.

The solution? I'll use my 24" BenQ G2400W monitor with HDMI input until I get the TV replaced (or buy a new one)... My digital box from CanalDigital is only analogue outputs so I figure this is a great time to order their HD-package with the new recordable digital box that allows you to pause live broadcasts and record anything to the harddisk... Great. I place the order and 5 days after - still no delivery. I call CanalDigital and ask them where my new HD-box is and they say - hey, there's something wrong with your account so we switched your channels off a few days ago, didn't you notice? I say NO I haven't as my TV is broken, what about my HD-box order, where is it? Turns out there was an error in the billig system and the order could not be placed, so they fixed the issue with the billing and placed a new order for the HD-box and switched my channels back on that I still couldn't watch...

Yesterday (2 weeks into the olympic games) my new High Definition digital box arrives I plug it into my BenQ screen and watch the olympics in 720p for a good hour before I go to bed... a happy bunny. Today, I come home to watch a few more summaries after work and there is an error code blinking on the HD-box. I couldn't resolve the issue myself and no metion of the error code in the manual so I call CanalDigital and explain the issue... Turns out the damn HD-box is trying to install a software update it downloaded from the satellite. The version downloaded is the SAME as the one already installed in the box... You would think this would not be any sort of a problem, but oh yes, it is a problem... So big that it can't be fixed apparently and they have to send me a NEW box with a delivery time of 5 working days. It's a weekend coming up now so it looks like I'll have the box maybe wednesday next week. By then the olympic games are over.

Oh - the joy of technology. I'm sure the next box I receive and the TV will get repaired, just in time to break for the next olympic games.

=) I like to complain sometimes, is that apparent?