한국어English日本語简体中文繁體中文DeutschไทยTiếng ViệtРусскийPortuguês (Brasil)EspañolBahasa Indonesia

Game Lag White Paper › Problems only some players hit

Fixed UDP port collision Two clients bound to the same local UDP port

Cause ID pt-port-collision · Primary owner Game team (Client development) · Also Game team (Server development)

Open the interactive card with figures and simulations →

If the client is built to use a fixed local port, a second client on the same PC either can’t get the port or ends up splitting packets with the first.

Why Two clients try to open the same local UDP port (forcing a share with a reuse option) → Effect The OS delivers incoming packets to only one socket, or doesn’t guarantee which one gets them. The router and server also see both clients as the same address → On screen One client misses world packets, so NPCs and other players are invisible, or it disconnects

Symptoms
Invisible / ghost entities, Disconnect, Can’t connect / infinite loading
Factors
Packet loss
Who’s affected
One client on the same PC
When
Right after login or maintenance, Always
Owner
Primary owner Game team (Client development) · Also Game team (Server development)
Game team action items
Client: let the OS pick the local port automatically (bind to port 0). Server: tell connections apart by a session token issued per connection.
On the graph
Outliers only · Packets received per client
Where to look
On the player’s PC with both clients running, netstat -ano -p udp in a command prompt to see the local UDP ports each game process (PID) has open. On the server side, whether the two sessions come in from the same public IP and the same port
Confirmed if
Both game processes are bound to the same local port, or the server sees both sessions as the same IP and port. Fine with only one running
Ruled out if
The two clients use different local ports but one still misbehaves: sessions keyed by IP or device, or a multi-client restriction
Check with
The player’s own environment

Sources

  1. Using SO_REUSEADDR and SO_EXCLUSIVEADDRUSE Microsoft
    A second bind to the same port with SO_REUSEADDR hijacks the port, and which socket receives packets is undefined
  2. bind function (winsock.h) Microsoft
    Binding to port 0 assigns a unique port from the dynamic port range (49152–65535)
  3. netstat Microsoft
    -a shows TCP and UDP ports, -n numeric addresses, -o the process ID (PID), and -p udp UDP only

See also

Same layer: Problems only some players hit

Same symptom (Invisible / ghost entities), other layers

View the interactive card with figures and simulations