Teleports
From OpenSimulator
(→Same simulator, Out-of-sight) |
(→Same simulator, Out-of-sight) |
||
Line 60: | Line 60: | ||
* Once the source receives the ReleaseAgent message, it cleans up the old presence by removing the avatar and its attachments from the source scene. The agent is downgraded from a root agent to a child agent. | * Once the source receives the ReleaseAgent message, it cleans up the old presence by removing the avatar and its attachments from the source scene. The agent is downgraded from a root agent to a child agent. | ||
* S->V, Since the source region is no longer in sight, this child agent is closed completely. This triggers a DisableSimulator Event Queue message from the source simulator to the viewer for the old connection. | * S->V, Since the source region is no longer in sight, this child agent is closed completely. This triggers a DisableSimulator Event Queue message from the source simulator to the viewer for the old connection. | ||
+ | |||
+ | ==Example log== | ||
For reference, these are the relevant log entries taken from a successful teleport of Justin Clark-Casey from a region called "test one" to a region called "test two". This was taken with | For reference, these are the relevant log entries taken from a successful teleport of Justin Clark-Casey from a region called "test one" to a region called "test two". This was taken with |
Revision as of 15:57, 15 October 2012
Languages: |
English Français |
Contents |
Introduction
Work in progress
Teleports in OpenSimulator involve a complex exchange of messages between the simulator hosting the source region, the simulator hosting the destination region (which may be the same simulator that is hosting the source region) and the viewer. This page documents that message exchange.
In terms of basic grid teleports (where all simulators are hosted on the same grid), there are five different scenarios.
- Teleport within the same region (intra-region).
- Teleport to an out-of-sight region hosted on the same simulator (same simulator, out-of-sight).
- Teleport to an in-sight region hosted on the same simulator (same simulator, in-sight).
- Teleport to an out-of-sight region hosted on a different simulator (different simulator, out-of-sight).
- Teleport to an in-sight region hosted on a different simulators (different simulator, in-sight).
These are listed in terms of complexity and hence reliability. Intra-region teleport is the simplest at all since the avatar just needs to be moved within the region - connections do not need to be torn down and established.
Same simulator, out-of-sight teleport is the next simplest. Though the avatar needs to be removed from one scene and placed in another, a second simulator is not involved. As the regions are out of sight of one another for the client's draw distance, no management of root and child agents is required (see Glossary for more information on agents).
Same simulator, in-sight teleport is similar to out-of-sight teleport except that some management of agents (e.g. downgrade root agent to child on the source region) needs to be done.
Different simulator, out-of-sight teleport is similar to same simulator, out-of-sight teleport except that the need to communicate between different simulator processes increases the complexity of the teleport and often introduces a network dependency (unless the simulators are hosted on the same machine).
Different simulator, in-sight teleport is the more complex normal grid teleport, since not only is there an interaction between source simulator, destination simulator and viewer, but upgrade and downgrades between child and root agents need to be managed as well.
Same simulator, Out-of-sight
This is a detailed description of the steps performed for a same simulator, out-of-sight region teleport.
Key: V = viewer, S = source region, D = destination region, SCh = source region with child agent, DCh = destination region which should have child agent, G = grid service.
Steps:
- V->S, Viewer sends TeleportLocationRequest UDP packet to its current simulator. This holds the desired destination region co-ordinates.
- Source simulator checks the user is allowed to teleport in principle.
- V->G, Source tries to retrieve information about the destination region from the grid service.
- Source checks destination is within max teleport distance. This is because most Second Life compatible viewers cannot teleport further than 4096 regions due to implementation and possibly protocol limitations.
- S->D, Source contacts the destination simulator to check whether the agent is allowed to teleport to the destination region. Failure may occur here because the destination simulator is unavailable, the region is not letting any users in, etc.
- S->V, If everything is okay, the viewer is sent a TeleportStart UDP packet. This is a very simple packet that just tells the viewer that the teleport is in progress. At this point on the viewer, the 3D scene will be replaced by a teleport progress screen (classically black with a progress bar in the middle).
- Source calculates whether the destination region is in-sight. In this case, it is out-of-sight.
- S->D, Therefore, source asks destination to create an agent in anticipation of a connection from the viewer. The agent starts as a child agent - it will be upgraded to a root agent on a successful connection. The session circuit code is passed on so that the destination simulator can recognise a new connection from the viewer.
- S->SCh*, If create agent request is successful, source requests closure of existing child agents which were allowing the user to see events in neighbouring and other in-sight regions at the source location.
- These close requests go from the source simulator to in-sight regions which may be on the same simulator or different simulators.
- SCh*->V, Each close requests triggers a client connection close. This tears down the client circuit, removes the scene presence (the primary code representation of the agent in the scene) and sends the client a DisableSimulator event via the Event Queue HTTP capability.
- S->V, Source simulator sends an EnableSimulator Event Queue message for the destination region to the viewer.
- V-D, This triggers the viewer to send the initial UseCircuitCode UDP packet to the destination simulator to establish a new connection.
- S->V, Very shortly afterwards, the source simulator sends an EstablishAgentCommunication Event Queue message to the viewer. This contains the destination simulators HTTP capability root URL.
- V->D This triggers the viewer to send a SEED capability request to the destination simulator. The destination replies with all the capabilities that are available on that simulator.
- S->D, Source sends the destination simulator is sent more information about the incoming connection via the UpdateAgent inter-region communication message. If the regions are running on the same simulator then the UpdateAgent call waits for the viewer to establish a child connection. The timeout is 20 seconds. If the regions are on different simulators then the source simulator is not delayed.
- S->V, The source sends the viewer a TeleportProgress UDP packet. This is just a status update and advances the viewer's waiting bar for the teleport.
- S->V, The source sends the viewer a TeleportFinish Event Queue message.
- The source now waits 20 seconds for a ReleaseAgent inter-region message from the destination simulator that the new connection is operational.
- V->D, The TeleportFinish message sent to the viewer triggers it to send a CompleteAgentMovement UDP packet to the destination simulator on the newly established UDP connection.
- This triggers the destination simulator to upgrade the previously established child agent to a full root agent.
- D->S, The destination simulator calls back the source simulator with a ReleaseAgent inter-region message to tell it that the new connection was successfully established.
- D->DCh*, The destination simulator asks neighbouring regions to initiate child agent connections if appropriate.
- DCh*->V, Each new child agent requests triggers an EnableSimulator EQ message from the destination child agent region to the viewer.
- V->Dch*, This triggers the viewer to establish a separate connection to each region with an initial UseCircuitCode UDP message.
- Once the source receives the ReleaseAgent message, it cleans up the old presence by removing the avatar and its attachments from the source scene. The agent is downgraded from a root agent to a child agent.
- S->V, Since the source region is no longer in sight, this child agent is closed completely. This triggers a DisableSimulator Event Queue message from the source simulator to the viewer for the old connection.
Example log
For reference, these are the relevant log entries taken from a successful teleport of Justin Clark-Casey from a region called "test one" to a region called "test two". This was taken with
- Packets logged (via the "debug packet 1" command on the console)
- Inbound and outbound non-poll events logged (via the "debug http all 6" console command).
- Event queue messages logged (via the "debug eq 1" command on the console.
The OpenSimulator commit was 3ac6a423 (post 0.7.4). The exact messages displayed will almost certainly change in the future.
00:50:41 - [CLIENT]: PACKET IN from Justin Clark-Casey (root ) in test one - TeleportLocationRequest 00:50:41 - [ENTITY TRANSFER MODULE]: Teleporting Justin Clark-Casey e4f3924a-5a7c-4e1a-bee7-aa96580f2515 from test one to http://192.168.1.2:9000/ (http://192.168.1.2:9000/) test two/<127.6335, 140.0397, 25.1643> 00:50:41 - [ENTITY TRANSFER MODULE]: Destination is running version SIMULATION/0.1 00:50:41 - [CLIENT]: PACKET OUT to Justin Clark-Casey (root ) in test one - TeleportStart 00:50:41 - [SCENE]: Region test two told of incoming child agent Justin Clark-Casey e4f3924a-5a7c-4e1a-bee7-aa96580f2515 (circuit code 1017396278, IP 192.168.1.2, viewer Second Life Release 3.3.4.262321, teleportflags (ViaLocation), position <127.6335, 140.0397, 25.1643>) 00:50:41 - [WEB UTIL]: HTTP OUT 30 SynchronousRestForms POST http://localhost:8003/presence 00:50:41 - [WEB UTIL]: HTTP OUT 30 took 3ms, 1ms writing 00:50:41 - [SCENE]: Region test two authenticated and authorized incoming child agent Justin Clark-Casey e4f3924a-5a7c-4e1a-bee7-aa96580f2515 (circuit code 1017396278) 00:50:41 - [CAPS]: Registered seed capability /CAPS/a358dd6d-5d39-407e-a29a-7b8b59d763010000/ for e4f3924a-5a7c-4e1a-bee7-aa96580f2515 00:50:41 - [SCENE PRESENCE]: Closing child agents. Checking 1 regions in test one 00:50:41 - POLLED FOR EQ MESSAGES BY e4f3924a-5a7c-4e1a-bee7-aa96580f2515 in test one 00:50:41 - Eq OUT EnableSimulator to Justin Clark-Casey test one 00:50:41 - [LLUDPSERVER]: Handling UseCircuitCode request for circuit 1017396278 to test two from IP 192.168.1.2:55326 00:50:41 - [SCENE]: Adding new child scene presence Justin Clark-Casey e4f3924a-5a7c-4e1a-bee7-aa96580f2515 to scene test two at pos <127.6335, 140.0397, 25.1643> 00:50:41 - [ENTITY TRANSFER MODULE]: Set release callback URL to http://192.168.1.2:9000/agent/e4f3924a-5a7c-4e1a-bee7-aa96580f2515/11111111-bf88-45ac-aace-35bd76426c81/release/ in test one 00:50:41 - [SCENE]: Incoming child agent update for e4f3924a-5a7c-4e1a-bee7-aa96580f2515 in test two 00:50:41 - [CLIENT]: PACKET OUT to Justin Clark-Casey (root ) in test one - TeleportProgress 00:50:41 - [ENTITY TRANSFER MODULE]: Sending new CAPS seed url http://192.168.1.2:9000/CAPS/a358dd6d-5d39-407e-a29a-7b8b59d763010000/ from test one to Justin Clark-Casey 00:50:42 - POLLED FOR EQ MESSAGES BY e4f3924a-5a7c-4e1a-bee7-aa96580f2515 in test one 00:50:42 - Eq OUT EstablishAgentCommunication to Justin Clark-Casey test one 00:50:42 - Eq OUT TeleportFinish to Justin Clark-Casey test one 00:50:42 - [LLUDPSERVER]: Handling UseCircuitCode request for circuit 1017396278 to test two from IP 192.168.1.2:55326 00:50:42 - [SCENE PRESENCE]: Completing movement of Justin Clark-Casey into region test two in position <127.6335, 140.0397, 25.1643> 00:50:42 - [SCENE]: Upgrading child to root agent for Justin Clark-Casey in test two 00:50:42 - [WEB UTIL]: HTTP OUT 31 SynchronousRestForms POST http://localhost:8003/friends 00:50:42 - [WEB UTIL]: HTTP OUT 31 took 2ms, 0ms writing 00:50:42 - [WEB UTIL]: HTTP OUT 32 SynchronousRestForms POST http://localhost:8003/presence 00:50:42 - [BASE HTTP SERVER]: HTTP IN 27 :9000 stream handler POST /CAPS/a358dd6d-5d39-407e-a29a-7b8b59d763010000/ SEED from 192.168.1.2:47107 00:50:42 - [BASE HTTP SERVER]: <llsd><array><string>AttachmentResources</string><string>AvatarPickerSearch</string><string>ChatSessionRequest</string><string>CopyInventoryFromNotecard</string><string>CreateInventoryCategory</string><string>DispatchRegionInfo</string><string>EstateChangeInfo</string><string>EventQueueGet</string><string>EnvironmentSettings</string><string>ObjectMedia</string><string>ObjectMediaNavigate</string><string>FetchLib2</string><string>FetchLibDescendents2</string><string>FetchInventory2</string><string>FetchInventoryDescendents2</string><string>GetDisplayNames</string><string>GetTexture</string><string>GetMesh</string><string>GetObjectCost</string><string>GetObjectPhysicsData</string><string>GroupProposalBallot</string><string>HomeLocation</string><string>LandResources</string><string>MapLayer</string><string>MapLayerGod</string><string>MeshUploadFlag</string><string>NewFileAgentInventory</string><string>ParcelPropertiesUpdate</string><string>ParcelMediaURLFilterList</string><string>ParcelNavigateMedia</string><string>ParcelVoiceInfoRequest</string><string>ProductInfoRequest</string><string>ProvisionVoiceAccountRequest</string><string>RemoteParcelRequest</string><string>RequestTextureDownload</string><string>ResourceCostSelected</string><string>SearchStatRequest</string><string>SearchStatTracking</string><string>SendPostcard</string><string>SendUserReport</string><string>SendUserReportWithScreenshot</string><string>ServerReleaseNotes</string><string>SimConsole</string><string>SimulatorFeatures</string><string>SetDisplayName</string><string>SimConsoleAsync</string><string>StartGroupProposal</string><string>TextureStats</string><string>UntrustedSimulatorMessage</string><string>UpdateAgentInformation</string><string>UpdateAgentLanguage</string><string>UpdateGestureAgentInventory</string><string>UpdateNotecardAgentInventory</string><string>UpdateScriptAgent</string><string>UpdateGestureTaskInventory</string><string>UpdateNotecardTaskInventory</string><string>UpdateScriptTask</string><string>UploadBakedTexture</string><string>ViewerMetrics</string><string>ViewerStartAuction</string><string>ViewerStats</string></array></llsd>\n... 00:50:42 - [CAPS]: Received SEED caps request in test two for agent e4f3924a-5a7c-4e1a-bee7-aa96580f2515 00:50:42 - [BASE HTTP SERVER]: HTTP IN 27 :9000 took 7ms 00:50:42 - [BASE HTTP SERVER]: HTTP IN 29 :9000 stream handler GET /CAPS/583eb413-3130-418c-b344-38e618bd22d7 SimulatorFeatures e4f3924a-5a7c-4e1a-bee7-aa96580f2515 from 192.168.1.2:47110 00:50:42 - [BASE HTTP SERVER]: ... 00:50:42 - [BASE HTTP SERVER]: HTTP IN 29 :9000 took 0ms 00:50:42 - [WEB UTIL]: HTTP OUT 32 took 134ms, 2ms writing 00:50:42 - [WEB UTIL]: HTTP OUT 33 SynchronousRestForms POST http://localhost:8003/griduser 00:50:42 - [WEB UTIL]: HTTP OUT 33 took 88ms, 2ms writing 00:50:42 - [SCENE PRESENCE]: Releasing Justin Clark-Casey e4f3924a-5a7c-4e1a-bee7-aa96580f2515 with callback to http://192.168.1.2:9000/agent/e4f3924a-5a7c-4e1a-bee7-aa96580f2515/11111111-bf88-45ac-aace-35bd76426c81/release/ 00:50:42 - POLLED FOR EQ MESSAGES BY e4f3924a-5a7c-4e1a-bee7-aa96580f2515 in test two 00:50:42 - Eq OUT AgentGroupDataUpdate to Justin Clark-Casey test two 00:50:42 - Eq OUT AgentGroupDataUpdate to Justin Clark-Casey test two 00:50:42 - Eq OUT AvatarGroupsReply to Justin Clark-Casey test two 00:50:42 - Eq OUT ParcelProperties to Justin Clark-Casey test two 00:50:42 - [SCENE PRESENCE]: baked textures are in the cache for Justin Clark-Casey 00:50:42 - [WEB UTIL]: HTTP OUT 34 SynchronousRestForms POST http://localhost:8003/grid 00:50:42 - [WEB UTIL]: HTTP OUT 34 took 8ms, 1ms writing 00:50:42 - [BASE HTTP SERVER]: HTTP IN 30 :9000 stream handler GET /CAPS/0020/9b7f736f-dfd1-42f3-b200-8bd0e8dbfd2d EnvironmentSettings e4f3924a-5a7c-4e1a-bee7-aa96580f2515 from 192.168.1.2:47114 00:50:42 - [BASE HTTP SERVER]: ... 00:50:42 - [BASE HTTP SERVER]: HTTP IN 30 :9000 took 3ms 00:50:42 - [CLIENT]: PACKET OUT to Justin Clark-Casey (child) in test one - KillObject 00:50:42 - [SCENE PRESENCE]: Making Justin Clark-Casey a child agent in test one 00:50:44 - [CLIENT]: Close has been called for Justin Clark-Casey attached to scene test one 00:50:44 - [SCENE]: Removing child agent Justin Clark-Casey e4f3924a-5a7c-4e1a-bee7-aa96580f2515 from test one 00:50:45 - POLLED FOR EQ MESSAGES BY e4f3924a-5a7c-4e1a-bee7-aa96580f2515 in test one 00:50:45 - Eq OUT DisableSimulator to Justin Clark-Casey test one 00:50:45 - [ENTITY TRANSFER STATE MACHINE]: Agent e4f3924a-5a7c-4e1a-bee7-aa96580f2515 cleared from transit in test one
Legacy documentation
This documentation is legacy because in part it refers to components and mechanisms that have since been changed. Chiefly, grid services are now discrete services hosted by a standalone or in one or more ROBUST instances - the discrete user, inventory, etc. servers no longer exist. Also inventory is no longer fully loaded onto a simulator when a root agent arrives there - instead it is pulled from the grid inventory service on-demand.
Grid Teleport Procedure
Hypergrid Teleport Procedure
Open Grid Protocol Teleport Procedure
Related
Teleports in OpenSimulator as of 2009-02-06
Teleport Study (2009-03-05)
The following four pictures compare the current agent transfer scheme with 3 possible agent transfer schemes. The different schemes have slightly different requirements with respect to authentication.