DOOM over TCP/IP

I never played DOOM over the internet, as by the time I had a proper connection and fast enough machine, Quake was all the rage, and all I had was this crappy cable modem that used a dialup connection for the upstream.

If I wanted to play multiplayer I’d wind up dong a LAN party anyways.  We were living in the era of $20 NE2000 clones, and 56kb modems, with the occasional 1mbit down cable.

Anyways I recently saw The Internet DOOM Client/Server System v0.01, which was a simple TCP/IP DOOM matchmaking server that includes source the client and server.  This eventually grew up into iDOOM.  It looked simple enough and it does mention that it is based on the opensource IPX component of DOOM.  I’d never looked at it so taking a peek I saw this:

DOOMNET.C

// hook an interrupt vector
p= CheckParm (“-vector”);

if (p)
{
doomcom.intnum = sscanf (“0x%x”,_argv[p+1]);
}
else
{
for (doomcom.intnum = 0x60 ; doomcom.intnum <= 0x66 ; doomcom.intnum++)
{
vector = *(char far * far *)(doomcom.intnum*4);
if ( !vector || *vector == 0xcf )
break;
}
if (doomcom.intnum == 0x67)
{
printf (“Warning: no NULL or iret interrupt vectors were found in the 0x60 to 0x66\n”
“range. You can specify a vector with the -vector 0x<num> parameter.\n”);
doomcom.intnum = 0x66;
}
}
printf (“Communicating with interupt vector 0x%x\n”,doomcom.intnum);

olddoomvect = getvect (doomcom.intnum);
setvect (doomcom.intnum,NetISR);
vectorishooked = 1;

IPXSETUP.C

/*
=============
=
= NetISR
=
=============
*/

void interrupt NetISR (void)
{
if (doomcom.command == CMD_SEND)
{
localtime++;
SendPacket (doomcom.remotenode);
}
else if (doomcom.command == CMD_GET)
{
GetPacket ();
}
}

So for those who missed it, the IPX client just hooks in as a TSR, which doom calls down to, and then either sends or receives data.  Now I wish I’d looked earlier I didn’t realize that it was something so simple.

So I thought it’d be interesting to watch it in action.  Now it compiles on modern Linux, but it doesn’t work.  I don’t know why, I didn’t investigate much.  Instead I opted for a server from the era, UnixWare.  Oddly enough that works (and so does OS X).  I fired up GNS3, put the server on one network, and added two clients on separate TCP/IP networks.  I went ahead with DOOM v1.2.

doom tcpipThe clients are able to connect to the server, and once the both register, they drop out of the server, and pass all the command line arguments to TCPSETUP, and away they go.
doom tcpip 2Now it’s worth noting that back in these days people use registered addresses.  None of this will work with NAT as it expects 1:1 UDP port mappings.  The clients are all equal peers.

So could a newer driver be written to support a server, and work behind NAT? Yeah I don’t see why not.  Is there any point in doing so?

Probably not.

In 2004 it was hard enough trying to do a deathmatch online, but 2014?.. 20 years too late.

But it’s kind of interesting how convoluted the networking setup had to be for a 32bit protected mode program calling down to a real mode TCP/IP TSR, which in turn called the network driver.  It’s amazing it even works.

 

Leave a Reply