NetherNet

NetherNet is a peer-to-peer networking transport used in Bedrock Edition, built on WebRTC. It uses WebRTC data channels to exchange game data between clients and servers. With HTTP signaling, the connection is negotiated through HTTP requests before game data is exchanged over the established WebRTC connection.[1]

HTTP Signaling


With HTTP signaling, the client uses two endpoints to check server support and negotiate a WebRTC connection. A successful capability check provides server information, after which the client exchanges SDP messages with the server through the signaling service.[1]

Capability Check

The client sends GET /v1/join. A successful response has a 2xx status, an application/json content type, and a JSON object with server information. A non-2xx response indicates that NetherNet is unavailable, and the client does not continue with connection setup.[1]

FieldTypeDescription
nameStringServer name.
protocolNumberBedrock protocol version supported by the server.
versionStringBedrock game version.
levelStringName of the loaded world.
playersNumberCurrent player count.
maxPlayersNumberMaximum player count.
gameTypeNumberDefault game mode: 0 for Survival, 1 for Creative, or 2 for Adventure.

SDP Exchange

The client sends one HTTP request per connection attempt:

DirectionMethod and pathContent typeBody
Client to serverPOST /v1/join/<nowiki>{networkId}</nowiki>application/sdpThe complete SDP offer, including ICE candidates.
Server to clientHTTP 2xx responseapplication/sdpThe complete SDP answer, including ICE candidates.

The {networkId} path value identifies the client to the signaling service. Its value is treated as an opaque string. A non-2xx response ends the attempt; the client does not retry automatically. NetherNet's HTTP signaling gathers all ICE candidates before the offer or answer is sent. The signaling service routes the offer to the host and returns its answer. It is not involved in the game-data connection after setup.[1]

Connection Sequence


  1. The client checks support with GET /v1/join.
  2. The client creates a WebRTC peer connection and the two data channels described below.
  3. The client gathers ICE candidates and sends its SDP offer to POST /v1/join/{networkId}.
  4. The signaling service forwards the offer to the host.
  5. The host creates an SDP answer, gathers its ICE candidates, and returns the answer through the signaling service.
  6. The client applies the answer. The client and host perform ICE connectivity checks, establish DTLS and SCTP, and open the data channels.
  7. Game data flows between the client and host over the WebRTC connection.[1]

The client configuration for HTTP signaling uses UDP ICE candidates, disables trickle ICE,[2] and bundles data channels over one transport. The offer and answer each carry all gathered ICE candidates.[1]

The client has no STUN or TURN servers configured and gathers only local candidates. The host's answer must include a candidate reachable by the client; a host behind NAT may need a publicly reachable candidate.[1]

Identity and Trust


The client's a=identity assertion identifies the authenticated player and is validated by the server.[3] An offer without an assertion may be accepted or rejected according to the server's authentication policy. The server's answer must contain an assertion for its operator identity; the client checks it before accepting the connection.[1]

The attribute contains a base64-encoded JSON object with an identity provider (idp) and an assertion string. The assertion contains a JWT and a detached JWS covering the WebRTC certificate fingerprints. The client's token is issued by the Minecraft authentication service, while the server's token is self-signed using its operator key.[1]

With HTTPS signaling, the client relies on TLS to authenticate the server. With plaintext HTTP signaling, the client uses TOFU: it prompts the player the first time it sees an operator key, then remembers that key for later connections. The a=identity attribute is required in the answer for both cases.[1]

Data Channels


The client opens two SCTP data channels. The host accepts both channels and can send and receive on them.[1]

ChannelDeliveryUse
ReliableDataChannelReliable and orderedData that must arrive in order. Supports fragmentation.
UnreliableDataChannelUnreliable and unorderedLatency-sensitive data that can tolerate loss. Does not support fragmentation.

The unreliable channel sets maxRetransmits to 0.[1]

Message Framing


Each data-channel message begins with a one-byte header. The receiver removes this byte before processing the payload.[1]

Header valueMeaning
0Complete message, or the final fragment of a fragmented message.
N where N &gt; 0Fragment with N more fragments to follow.

Unfragmented messages have a header value of 0. The maximum unfragmented payload is the negotiated SCTP message size limit minus one byte for the header. On ReliableDataChannel, oversized messages are split into fragments. Their header values count down to zero, and the receiver reassembles the payloads in order. On UnreliableDataChannel, the header is always zero; oversized messages are dropped rather than fragmented.[1]

Game Data


NetherNet transports Bedrock Edition game data through WebRTC data channels. It provides the transport and message framing mechanisms, while the game packets themselves follow the [[mcw:Bedrock Edition protocol]]. Individual packet structures are documented at [[mcw:Bedrock Edition protocol/Packets]].[1]

Use in Bedrock Edition


NetherNet became the default transport for [[mcw:Bedrock Dedicated Server]] in 26.50. In 26.60, RakNet was deprecated, and the dedicated server's warning for connections not using NetherNet was changed to an error.

References


  1. ↑1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 "NetherNet HTTP Signaling — Partner Onboarding Guide"
  2. ↑ "RFC 8838: Trickle ICE"
  3. ↑ "RFC 8827: WebRTC Security Architecture, section 5"