# Connect players through a relay

> Learn how to connect players securely using the Relay service without dedicated game servers.

The Multiplayer Services SDK exposes a way for game developers to securely offer increased connectivity between players by using a join code style workflow without needing to invest in a third-party solution, maintain dedicated game servers (DGS) infrastructure, or worry about the network complexities of a peer-to-peer game. Instead of using a dedicated game server, the MPS SDK provides connectivity through a universal relay server acting as a proxy.

Refer to the following diagram to understand how the Multiplayer Services SDK interacts with the contained Relay SDK.

```mermaid
  sequenceDiagram
      participant Game Code
      participant Session SDK
      participant Lobby SDK
      participant Relay SDK
      participant Game Netcode
      
      Game Code->>Session SDK: Create session
      Session SDK->>Lobby SDK: Create lobby
      Session SDK->>Lobby SDK: Subscribe to lobby events
      loop Heartbeat
          Session SDK->>Lobby SDK: Heartbeat
      end
      Note over Session SDK,Lobby SDK: "Continue to heartbeat until the host<br/>leaves, deletes the lobby or the host changes."
      
      Session SDK->>Relay SDK: Create relay allocation
      Session SDK->>Lobby SDK: Setup lobby/relay integration for host
      Session SDK->>Lobby SDK: Update lobby with relay connection data

      Session SDK->>Game Netcode: Setup netcode with relay data
      Session SDK->>Game Netcode: Start host
      Session SDK-->>Game Code: Return session
```

| Page                                                   | Description                                                                                                                |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| [Relay servers](./networking/relay-servers.md)         | Understand how Relay servers facilitate message delivery between players without exposing their addresses.                 |
| [Players](/mps-sdk/players.md)                         | Learn the roles and responsibilities of host and joining players in Relay sessions.                                        |
| [Relay integration](./networking/relay-integration.md) | Integrate Unity Relay with Lobby to enable synchronized disconnects and secure peer-to-peer communication between players. |
| [Fair usage](./networking/fair-usage.md)               | Understand which use cases are appropriate for the Relay service.                                                          |
| [Limitations](./relay-limitations.md)                  | Understand the constraints and boundaries of the Relay service.                                                            |
