1.3.6 Host Migration (Peer-to-Peer)

Host migration enables a set of peer-to-peer clients to elect a new host peer to replace an existing host peer that either drops from the game session, cannot be reached, or is otherwise unavailable. A host peer could become unavailable due to lost connectivity, game session disconnect, or termination.

Host migration is not performed in game sessions that are operating in client/server mode. Only peer-to-peer game sessions can perform host migration.

Host migration is initiated when one or more peer-to-peer clients detects a disconnect with the current host. When this occurs, the current name table is referenced to determine the oldest client (the peer that has been connected to the game session for the longest time determined by the name table version when the player was added to the game session) that is still connected to the game session. This client becomes the new host candidate. Note that there might be more than one host candidate if a game session splits and multiple connections are severed.

The host candidate (or candidates) sends a message to all connected peers. Each peer that receives the message responds to the candidate with a message to provide the client's name table version to the host candidate.

If the host candidate detects a peer with a name table that is newer than the candidate's, the candidate will send a message back to that peer instructing the peer to send the name table operations that are in the peer's name table and not in the candidate's name table.

The peer responds by sending a message back to the host candidate. The message contains the name table operations that are in the peer's name table but not in the host candidate's name table. The host candidate then begins execution against the name table operations that were returned, which in turn will resynchronize all of the players' name tables in the game session.

Once all name table operations have been executed, the host candidate then sends a message to all peers informing them that host migration is complete and that the host candidate is now the game session host.