51  Networking: Overview

This tour explores how DOOM implements multiplayer networking: the shared protocol in the core engine, the Unix UDP backend, and the DOS IPX and serial transport layers.


51.0.1 Shared Engine Interface

File: linuxdoom-1.10/d_net.h

  • Declares:
    • doomcom_t communication buffer (lines 79–127)
    • Functions: NetUpdate(), D_QuitNetGame(), and TryRunTics()

51.0.2 Engine Logic

File: linuxdoom-1.10/d_net.c

  • Implements:
    • Building tic commands
    • Sending/receiving packets: HSendPacket, HGetPacket
    • Processing incoming data: GetPackets
    • Tick broadcast: NetUpdate
    • Tick execution control: TryRunTics
    • Startup arbitration: D_ArbitrateNetStart
    • Game exit: D_QuitNetGame

51.0.3 Unix Networking Backend

File: linuxdoom-1.10/i_net.h

  • Declares:
    • I_InitNetwork() for startup
    • I_NetCmd() for send/receive

File: linuxdoom-1.10/i_net.c

  • UDP socket implementation:
    • Parses -net args
    • Opens nonblocking sockets
    • Serializes doomdata_t for PacketSend()/PacketGet()
    • Dispatches doomcom->command via I_NetCmd()

51.0.4 DOS IPX Transport

File: ipx/README

  • Describes IPX driver integration for DOOM multiplayer.

File: ipx/DOOMNET.C

  • LaunchDOOM():
    • Initializes doomcom.id
    • Hooks interrupt
    • Spawns DOOM executable

File: ipx/IPXNET.C

  • IPX backend:
    • Interrupt 0x2f interface
    • InitNetwork(), SendPacket(dest), GetPacket()
    • ECB-based async receive

File: ipx/IPXSETUP.C

  • Broadcast-based peer discovery
  • Assigns player numbers
  • Calls LaunchDOOM()

51.0.5 DOS Serial Transport

File: sersrc/README.TXT

  • Describes serial networking fallback

File: sersrc/DOOMNET.C

  • Similar to IPX launcher
  • Hooks interrupt, appends -net, spawns DOOM

File: sersrc/PORT.C

  • UART setup:
    • Detects I/O address and IRQ
    • Hooks interrupt
    • APIs: read_byte() / write_byte()

File: sersrc/SERSETUP.C

  • Packet framing, modem config (via modem.cfg)
  • Connect() handshake
  • Starts game with LaunchDOOM()

51.0.6 Summary

This concludes the overview of DOOM’s networking architecture: - Shared protocol: d_net.* - Unix: i_net.* - DOS IPX: ipx/ - DOS Serial: sersrc/