# Relay allocating, binding, and joining

> Understand the three distinct steps for establishing a Relay connection between players.

An allocation is a request to the [Allocations service](./allocation-service.md) from the host player to reserve space on a [Relay server](../networking/relay-servers) for the host plus the number of players the host is expecting to join their game (indicated with the `max_players` field in the `/allocate request`). After a player joins the host player’s allocation, they receive a unique allocation ID, and Relay considers the player allocated.

[Allocating](#allocati), [binding](#binding), and [joining](#joining) are three distinct concepts in the Relay connection flow.

> **Note:**
>
> Binding, and other interactions done through a [Relay server](/relay/relay-servers.md.md), are handled using a networking solution such as [UTP](/relay/relay-and-utp.md.md) or [NGO](/relay/relay-and-ngo.md.md). NGO is higher level and uses UTP under the hood.

## Allocating##allocati

Allocating is when a host player tells the [Allocations service](./allocation-service.md) about their intent to connect to a [Relay server](../networking/relay-servers), and the Allocations service reserves slots on a Relay server. When the Allocations service reserves slots on a Relay server, it prepares the Relay server for players to bind (establish a network connection). The number of slots depends on the maximum number of connections specified in the allocation request.

Check out the following steps in the connection flow:

* [The host player requests an allocation](./connection-flow.md)
* [The Allocations service selects a Relay server](./connection-flow.md)
* [The Allocations service sends the connection data to the host player](./connection-flow.md)

## Binding

Binding is when the player establishes a connection with the Relay server that the Allocations service reserved for the player during the allocating process. After the player completes the binding process, the Relay server can discover the player’s IP address and exchange packets.

> **Note:**
>
> The host player and joining players must bind to the Relay server before connecting to each other.

A [`BIND`](./relay-message-protocol.md#bind) is a specific message sent via the [Relay protocol](./relay-message-protocol.md) from the game client to the Relay server to establish its connection to the Relay server.

> **Note:**
>
> You typically send `BIND` messages after calling the allocate and join APIs, which retrieve the Relay server’s destination address for use with the `BIND` message.

Check out the following steps in the connection flow:

* [The host player binds to the Relay server](./connection-flow.md#4)
* [The joining player binds to the Relay server](./connection-flow.md#10)

## Joining

Joining is when a joining player joins the host player’s allocation on a Relay server. After the joining player completes the joining process, they can exchange messages with the host player. Allocating and joining are similar processes. The primary difference is that the join API response has the host connection data.

> **Note:**
>
> A join is when a joining player (a non-host player) client joins the host client’s session. Under the hood, it’s another allocate call to the Relay service.

Check out the following steps in the connection flow:

* [The joining players use the join code](./connection-flow.md#8)
* [The Allocations service sends connection data to the joining player](./connection-flow.md#9)
* [The joining player sends connection request](./connection-flow.md#11)
