Skip to content

Local Network Discovery

Roy de Jong edited this page Apr 1, 2025 · 19 revisions

Introduction

Server Browser (v1.5+) will perform local network discovery on the LAN via UDP broadcast, enabling clients to find running servers and connect to them. This may be particularly useful for LAN parties or, for example, in VR arcade settings.

Protocol / integration

Custom multiplayer servers can support Local Discovery by listening for broadcasts.

Constants

  • 👉 UDP broadcast port: 47777
  • 👉 Protocol version described here: 1

Network protocol

The discovery protocol is stateless, unencrypted, and client-initiated. Packets are formatted using the same format that Beat Saber multiplayer itself uses (LiteNetLib NetDataReader / NetDataWriter style).

Server Browser client

While the in-game Server Browser is open, it will periodically send a UDP broadcast packet (query packet) from a randomized port, to the broadcast port. If a server sends a valid response packet with details, it will be listed as an option in the server browser.

Local servers are always shown first in the sort order. The server browser automatically refreshes regularly.

Connecting

When connecting to servers discovered on the local network, the Server Browser will utilize a direct connection. This means the master server is bypassed entirely and an internet connection may not be needed.

An implementing game server must support unencrypted direct connections. The first packet received from such a connection will be a plain IgnCon-prefixed connection request from the game (references: see IgnoranceConnectionManager and GameLiftClientConnectionRequestHandler).

The server browser will always connect to the IP address that sent the discovery response packet, to the UDP port provided in the response packet.

Query packet

The discovery query packet is sent by the client as broadcast. The query packet is structured as follows:

Reference name Type Description
Prefix String Fixed prefix: BssbDiscovery
ProtocolVersion Int Discovery protocol version (1)
GameVersion String Beat Saber version (e.g. "1.40.4") - without underscore suffix

A receiving server MUST NOT respond to a query packet from an incompatible game version.

Response packet

A receiving server can respond to the client by sending a packet back to the origin IP / port. The response packet should be structured as follows:

Reference name Type Description
Prefix String Fixed prefix: BssbDiscovery
ProtocolVersion Int Discovery protocol version (1)
Port Int UDP port for this game server / lobby instance
ServerName String Lobby name (usually user-defined)
ServerUserId String Game session ID / User ID of the server player
GameModeName String Game mode description
ServerTypeName String Server type for detail view (e.g. "BeatTogether")
PlayerCount Int Current player count
LobbyState Int MultiplayerLobbyState as integer
BeatmapLevelSelectionMask BeatmapLevelSelectionMask Controls which difficulties, modifiers and song packs can be selected
GameplayServerConfiguration GameplayServerConfiguration Controls player limit and gameplay settings

Implementation notes

  • All response fields are required and must be written for the packet to be read correctly.