Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 44 additions & 16 deletions docs/manual/03_modules/01_engine/05_networking.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
# Networking

This guide explains how networking works in iR Engine and how **users, peers, ownership,** and **authority** interact in a networked environment. 

## Networks
Networks are a way of sharing topic specific data between certain peers.
There are two types of networks:
- **world** networks -> tied to location instances
- **media** networks -> tied to media instances

## Users & Peers
Users are unique accounts created in a particular iR Engine deployment.
Users can connect to multiple instances, and have multiple peers connected to each instance.
Only a single avatar will be loaded for a user, but this avatar can be controlled by any of that user's peers.

## Ownership and Authority
Ownership specifies that a networked entity belongs to a particular user.
Ownership cannot be transferred for an entity. The entity must be destroyed and recreated by a new user.

Authority specifies that a networked entity can be controlled by a particular peer.
Authority can be transferred between peers, and is done so by sending an authority request action to the owner peer, upon which the owner peer will send an authority transfer action back to the requesting peer.

Networks are channels used to share data between peers. iR Engine supports two primary network types:

- **World networks:**
- Tied to *location instances*.
- Handle information about the environment, user positions, and world interactions.
- **Media networks**
- Tied to *media instances*.
- Handle audio or video streams and other media-related data.

Each network serves a distinct purpose, ensuring that only relevant data is broadcast to connected peers.

## Users and peers

A **user** is a unique account on an iR Engine deployment. Users can join multiple instances, potentially having several **peers**—one peer per active connection or device.

- **Users**
- Represent the individual account or identity in the system.
- Own avatars and maintain consistent identity across different sessions or devices.
- **Peers**
- Represent active client connections (e.g., a user’s laptop, phone, or VR headset).
- A single user can have multiple peers connected to different or the same instances simultaneously.

:::hint{type="info"}
ℹ️ **Note**:

Only a single avatar is loaded per user, but it can be controlled by any one of that user's peers.
:::

## Ownership and authority

**Ownership** and **authority** define how networked entities are managed and controlled across peers:

- **Ownership**
- Indicates which user *owns* a particular entity (e.g., an avatar or object in the scene).
- Cannot be transferred. If ownership must change, destroy the entity and recreate it under the new user.
- **Authority**
- Indicates which peer can *actively control* the entity’s state (e.g., movement, interactions).
- Can be transferred between peers via an authority request and an authority transfer action.
- The owner peer decides whether to grant authority to another peer.

By separating ownership (long-term association) from authority (immediate control), iR Engine allows flexible handoffs of control without altering the underlying entity’s ownership.