2009-08-26:

D-Link DI-524 and 2v2 in StarCraft

hardware:router:starcraft
Today's post will be about something totally different. Mainly, I have a new SOHO router for a half of year or so at my place - yep, the D-Link DI-524 (rev.B), which replaced my old DI-604 (which I liked very much due to working correctly for a change ;p). And for the last half of year or so I couldn't play StarCraft 2v2 sitting with my ally on the same side of the router (LAN side that is). Until a few days ago...

The problem was in the NAT and the so called 'virtual server' array (aka WAN->LAN redirection). Let's say I would want other people at WAN side to have access to my local HTTP server placed on my local PC - in that case I just add ext. port 80 to the table, and ask the router to redirect every call to that port to my local PC port 1234 (where my HTTP server is listening). Now, if anyone connects to my ext. IP port 80, the router silently forwards the packets to my local PC, and the replies back to that external someone. And this works OK.

However, the problem starts if a LAN person wants to connect to MyExternalIP:80. My old DI-604 router would forward the packet to the LocalPC:1234, setting the IP source as the router WAN IP (it's a kind of LAN->WAN->LAN connection), and that was great, since I could check from within my LAN if the redirections work. And guess what.. my new DI-524 did not handle it this way. In fact it didn't seem to handle it at all, it just dropped the packets (how rude ;<).

What does this have to do with StarCraft? Well, StarCraft is a p2p type of a game - everybody connects with everybody, and the Battle.net server just serves the players a set of IP:Ports (UDP ports) that the player should connect to. Of course, in case of two guys sitting in the same LAN the server will ask them to connect with themselves using the external IP's (how should the battle.net server know they are in a LAN? well, it could know, but it was coded 10 years ago). A normal procedure is to change the "Game Data Port" to differ for each player in the LAN, and make proper redirections on the router. And this always works... if the router supports a LAN->WAN->LAN packet forwarding. My new router didn't, and thats why I couldn't play StarCraft 2v2 with my ally ;<

Must I say that I tried many different tricks to make the DI-524 behave like DI-604? Without any results... Until a few days ago when (in an act of desperation) I tried to change (downgrade) the firmware to any version I could find on the web. So I've downloaded a few firmware versions, including some old ones from way back 2006, I've made the downgrade and... it worked!. The firmware I've tried is 2.04 from 18 April 2006.

Of course the downgrade to older firmware removes some bug-patches. In the case of DI-524 and 2.04->2.07 one could find the following entries in the change log:

Firmware: V2.07
1. Fix the problem: DI-524 has crashed problem after upgrading firmware.
2. Modify the time from 2008 to 2020.
3. Fixed the wireless client re-associates one hour later.
4. Add antenna transmit power
5. Fix "Cannot use remote application of MSN"


Firmware: V2.04Patch05
1. Daylight saving does not work for southern hemisphere(Australia)

Firmware: V2.04B02
1.WPA/WPA2 Enterprise fixed.


Most of the fixes are related to WiFi (which I do not use in that router; there is a separate Access Point at my place), time stuff and MSN, so they don't worry me at all.

And thats it! See you later, I'm going to play an earned game of StarCraft 2v2 ;>

Comments:

2009-09-01 14:11:38 = Ron
{
So, why's it work?

The way starcraft works, as you said, is it listens on port 6112 and sends on port 6112. When your packet goes through the router, the session is saved and incoming udp/6112 will go to your ip. When the other person sends a packet, the same thing happens, pointing to their system.

As such, only 50% of packets, on average, will reach either of you. Since Battle.net implements a system of re-sending lost packets, you'll eventually get them all, but you're going to end up with a much slower connection than usual.

Have you noticed a lot of lag? Or did the router somehow manage to route things properly?
}
2009-09-01 17:06:11 = Gynvael Coldwind
{
@Ron
Well first of all, I use 6112 ports up, while my ally uses 6212 ports and up (the Game Data Port in the registry is responsible for setting the game port), so we don't collide with each other.
However the problem was not exchanging the packets with battle.net or other players, rather then that we has trouble exchanging the packet between ourselves using WAN IP address (since the router didn't re-route them back to LAN).

Looks like the older firmware does not have a problem with this NAT re-routing ;>
And there is no lag of course.

In the case with the bugged firmware we couldn't join a game that the other player has joined, since we couldn't sync with each other.


}

Add a comment:

Nick:
URL (optional):
Math captcha: 4 ∗ 4 + 1 =