Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:NetherNet: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: new page from Minecraft
 
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
Line 11: Line 11:
=== Capability check ===
=== Capability check ===


The client sends <code>GET /v1/join</code>. A successful response has a 2xx status, an <code>application/json</code> 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.
The client sends {{cd|GET /v1/join}}. A successful response has a 2xx status, an {{cd|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.


{| class="wikitable"
{| class="wikitable"
! Field !! Type !! Description
! Field !! Type !! Description
|-
|-
| <code>name</code> || String || Server name.
| {{cd|name}} || String || Server name.
|-
|-
| <code>protocol</code> || Number || Bedrock protocol version supported by the server.
| {{cd|protocol}} || Number || Bedrock protocol version supported by the server.
|-
|-
| <code>version</code> || String || Bedrock game version.
| {{cd|version}} || String || Bedrock game version.
|-
|-
| <code>level</code> || String || Name of the loaded world.
| {{cd|level}} || String || Name of the loaded world.
|-
|-
| <code>players</code> || Number || Current player count.
| {{cd|players}} || Number || Current player count.
|-
|-
| <code>maxPlayers</code> || Number || Maximum player count.
| {{cd|maxPlayers}} || Number || Maximum player count.
|-
|-
| <code>gameType</code> || Number || Default game mode: 0 for Survival, 1 for Creative, or 2 for Adventure.
| {{cd|gameType}} || Number || Default game mode: 0 for Survival, 1 for Creative, or 2 for Adventure.
|}
|}


Line 38: Line 38:
! Direction !! Method and path !! Content type !! Body
! Direction !! Method and path !! Content type !! Body
|-
|-
| Client to server || <code>POST /v1/join/{networkId}</code> || <code>application/sdp</code> || The complete SDP offer, including ICE candidates.
| Client to server || {{cd|POST /v1/join/{networkId}}} || {{cd|application/sdp}} || The complete SDP offer, including ICE candidates.
|-
|-
| Server to client || HTTP 2xx response || <code>application/sdp</code> || The complete SDP answer, including ICE candidates.
| Server to client || HTTP 2xx response || {{cd|application/sdp}} || The complete SDP answer, including ICE candidates.
|}
|}


The <code>{networkId}</code> path value identifies the client to the signaling service. Treat it as an opaque string. A non-2xx response ends the attempt; the client does not retry automatically. NetherNet uses full [[Minecraft:wikipedia:Interactive_Connectivity_Establishment|ICE]], so candidate gathering completes 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.<ref name="nethernet-guide" />
The {{cd|{networkId}}} path value identifies the client to the signaling service. Treat it as an opaque string. A non-2xx response ends the attempt; the client does not retry automatically. NetherNet uses full [[Minecraft:wikipedia:Interactive_Connectivity_Establishment|ICE]], so candidate gathering completes 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.<ref name="nethernet-guide" />


== Connection sequence ==
== Connection sequence ==


# The client checks support with <code>GET /v1/join</code>.
# The client checks support with {{cd|GET /v1/join}}.
# The client creates a [[Minecraft:wikipedia:WebRTC|WebRTC]] peer connection and the two data channels described below.
# The client creates a [[Minecraft:wikipedia:WebRTC|WebRTC]] peer connection and the two data channels described below.
# The client gathers ICE candidates and sends its SDP offer to <code>POST /v1/join/{networkId}</code>.
# The client gathers ICE candidates and sends its SDP offer to {{cd|POST /v1/join/{networkId}}}.
# The signaling service forwards the offer to the host.
# The signaling service forwards the offer to the host.
# The host creates an [[Minecraft:wikipedia:Session_Description_Protocol|SDP]] answer, gathers its [[Minecraft:wikipedia:Interactive_Connectivity_Establishment|ICE]] candidates, and returns the answer through the signaling service.
# The host creates an [[Minecraft:wikipedia:Session_Description_Protocol|SDP]] answer, gathers its [[Minecraft:wikipedia:Interactive_Connectivity_Establishment|ICE]] candidates, and returns the answer through the signaling service.
Line 59: Line 59:
== Identity and trust ==
== Identity and trust ==


Both the offer and answer include an <code>a=identity</code> attribute. The client's assertion identifies the authenticated player and is validated by the server. The server's answer must also contain an assertion for its operator identity; the client checks it before accepting the connection.<ref name="nethernet-guide" />
Both the offer and answer include an <code>a=identity</code><ref name="identity-rfc">[https://www.rfc-editor.org/info/rfc8827/#section-5| RFC 8827: SDP Identity Attribute]</ref> attribute. The client's assertion identifies the authenticated player and is validated by the server. The server's answer must also contain an assertion for its operator identity; the client checks it before accepting the connection.<ref name="nethernet-guide" />


The attribute contains a base64-encoded JSON object with an identity provider (<code>idp</code>) and an opaque <code>assertion</code>. The assertion carries a signed token and a signature for the WebRTC certificate fingerprints. The client and server provide different identity assertions for their respective roles.<ref name="nethernet-guide" />
The attribute contains a base64-encoded JSON object with an identity provider ({{cd|idp}}) and an opaque {{cd|assertion}}. The assertion carries a signed token and a signature for the WebRTC certificate fingerprints. The client and server provide different identity assertions for their respective roles.<ref name="nethernet-guide" />


With HTTPS signaling, the client relies on [[Minecraft:wikipedia:Transport_Layer_Security|TLS]] to authenticate the server. With plaintext HTTP signaling, the client uses [[Minecraft:wikipedia:Trust_on_first_use|TOFU]]: it prompts the player the first time it sees an operator key, then remembers that key for later connections. The <code>a=identity</code> attribute is required in the answer for both cases.<ref name="nethernet-guide" />
With HTTPS signaling, the client relies on [[Minecraft:wikipedia:Transport_Layer_Security|TLS]] to authenticate the server. With plaintext HTTP signaling, the client uses [[Minecraft:wikipedia:Trust_on_first_use|TOFU]]: it prompts the player the first time it sees an operator key, then remembers that key for later connections. The <code>a=identity</code><ref name="identity-rfc" /> attribute is required in the answer for both cases.<ref name="nethernet-guide" />


== Data channels ==
== Data channels ==
Line 72: Line 72:
! Channel !! Delivery !! Use
! Channel !! Delivery !! Use
|-
|-
| <code>ReliableDataChannel</code> || Reliable and ordered || Data that must arrive in order. Supports fragmentation.
| {{cd|ReliableDataChannel}} || Reliable and ordered || Data that must arrive in order. Supports fragmentation.
|-
|-
| <code>UnreliableDataChannel</code> || Unreliable and unordered || Latency-sensitive data that can tolerate loss. Does not support fragmentation.
| {{cd|UnreliableDataChannel}} || Unreliable and unordered || Latency-sensitive data that can tolerate loss. Does not support fragmentation.
|}
|}


Line 84: Line 84:
! Header value !! Meaning
! Header value !! Meaning
|-
|-
| <code>0</code> || Complete message, or the final fragment of a fragmented message.
| {{cd|0}} || Complete message, or the final fragment of a fragmented message.
|-
|-
| <code>N</code> where <code>N &gt; 0</code> || Fragment with <code>N</code> more fragments to follow.
| {{cd|N}} where {{cd|N &gt; 0}} || Fragment with {{cd|N}} more fragments to follow.
|}
|}


Unfragmented messages have a header value of <code>0</code>. On <code>ReliableDataChannel</code>, oversized messages are split into fragments. Their header values count down to zero, and the receiver reassembles the payloads in order. On <code>UnreliableDataChannel</code>, the header is always zero; messages too large for a single [[Minecraft:wikipedia:Stream_Control_Transmission_Protocol|SCTP]] message are dropped rather than fragmented.<ref name="nethernet-guide" />
Unfragmented messages have a header value of {{cd|0}}. On {{cd|ReliableDataChannel}}, oversized messages are split into fragments. Their header values count down to zero, and the receiver reassembles the payloads in order. On {{cd|UnreliableDataChannel}}, the header is always zero; messages too large for a single [[Minecraft:wikipedia:Stream_Control_Transmission_Protocol|SCTP]] message are dropped rather than fragmented.<ref name="nethernet-guide" />


== Game data ==
== Game data ==

Latest revision as of 11:15, 4 October 2026

Template:Exclusive Template:Work in progress

NetherNet is MinecraftTemplate:'s peer-to-peer networking transport, built on WebRTC. The client uses WebRTC data channels to exchange game data with a server. The connection is negotiated through HTTP signaling, then established directly between the client and server.<ref name="nethernet-guide">Template:Cite</ref>

HTTP signaling

The client uses two HTTP endpoints. A successful capability check tells the client that the server supports NetherNet and provides server details. The client then uses the SDP exchange endpoint to negotiate a WebRTC connection.<ref name="nethernet-guide" />

Capability check

The client sends Template:Cd. A successful response has a 2xx status, an Template:Cd 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.

Field Type Description
Template:Cd String Server name.
Template:Cd Number Bedrock protocol version supported by the server.
Template:Cd String Bedrock game version.
Template:Cd String Name of the loaded world.
Template:Cd Number Current player count.
Template:Cd Number Maximum player count.
Template:Cd Number Default game mode: 0 for Survival, 1 for Creative, or 2 for Adventure.

SDP exchange

The client sends one HTTP request per connection attempt:

Direction Method and path Content type Body
Client to server Template:Cd} Template:Cd The complete SDP offer, including ICE candidates.
Server to client HTTP 2xx response Template:Cd The complete SDP answer, including ICE candidates.

The Template:Cd} path value identifies the client to the signaling service. Treat it as an opaque string. A non-2xx response ends the attempt; the client does not retry automatically. NetherNet uses full ICE, so candidate gathering completes 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.<ref name="nethernet-guide" />

Connection sequence

  1. The client checks support with Template:Cd.
  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 Template:Cd}.
  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.<ref name="nethernet-guide" />

The client configuration described in Mojang's guide uses UDP ICE candidates, disables trickle ICE,<ref>RFC 8838: Trickle ICE</ref> and bundles data channels over one transport. The offer and answer each carry all gathered ICE candidates.<ref name="nethernet-guide" />

Identity and trust

Both the offer and answer include an a=identity<ref name="identity-rfc">RFC 8827: SDP Identity Attribute</ref> attribute. The client's assertion identifies the authenticated player and is validated by the server. The server's answer must also contain an assertion for its operator identity; the client checks it before accepting the connection.<ref name="nethernet-guide" />

The attribute contains a base64-encoded JSON object with an identity provider (Template:Cd) and an opaque Template:Cd. The assertion carries a signed token and a signature for the WebRTC certificate fingerprints. The client and server provide different identity assertions for their respective roles.<ref name="nethernet-guide" />

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<ref name="identity-rfc" /> attribute is required in the answer for both cases.<ref name="nethernet-guide" />

Data channels

The client opens two SCTP data channels. The host accepts both channels and can send and receive on them.<ref name="nethernet-guide" />

Channel Delivery Use
Template:Cd Reliable and ordered Data that must arrive in order. Supports fragmentation.
Template:Cd Unreliable and unordered Latency-sensitive data that can tolerate loss. Does not support fragmentation.

Message framing

Each data-channel message begins with a one-byte header. The receiver removes this byte before processing the payload.<ref name="nethernet-guide" />

Header value Meaning
Template:Cd Complete message, or the final fragment of a fragmented message.
Template:Cd where Template:Cd Fragment with Template:Cd more fragments to follow.

Unfragmented messages have a header value of Template:Cd. On Template:Cd, oversized messages are split into fragments. Their header values count down to zero, and the receiver reassembles the payloads in order. On Template:Cd, the header is always zero; messages too large for a single SCTP message are dropped rather than fragmented.<ref name="nethernet-guide" />

Game data

NetherNet carries Minecraft:Bedrock Edition game data in its data-channel messages. Game-packet formats are documented at Bedrock Edition protocol/Packets.<ref name="nethernet-guide" />

Use in Bedrock Edition

NetherNet became the default transport for Bedrock Dedicated Server in Minecraft:26.50. Minecraft:RakNet is deprecated in the Minecraft:26.60.22 Preview.<ref>Template:Cite</ref><ref>Template:Cite</ref>

References

Template:Reflist

Navigation

Template:Navbox Bedrock Edition