Difference between revisions of "Circuit"
Cube Linden (talk | contribs) |
Cube Linden (talk | contribs) |
||
Line 25: | Line 25: | ||
**Further covered in [[Packet_Accounting]] | **Further covered in [[Packet_Accounting]] | ||
*Pings | *Pings | ||
**Pings are sent back and forth over the circuit using [[Common_Messages:StartPingCheck]] and [[Common_Messages:CompletePingCheck]] messages. | **Pings are sent back and forth over the circuit using [[Protocol:Common_Messages:StartPingCheck]] and [[Protocol:Common_Messages:CompletePingCheck]] messages. |
Revision as of 14:32, 17 November 2006
Circuit Definitions
A circuit is a two-way UDP connection between two nodes, be they the viewer and the simulator, two simulators, or the simulator and a utility server. Circuits are built with no custom session management, so endpoint processes can and do sometimes disappear and restart. Due to this fact, it cannot be accurately predicted if one node trusts another since it may have restarted since it was last contacted.
Two kinds of circuits exist, trusted and untrusted.
Untrusted Circuits
All circuits begin as untrusted circuits, and all viewer to simulator connections are made through untrusted circuits. In the message template, messages are flagged as either trusted or untrusted. Any trusted packet going over an untrusted circuit will be discarded by the receiving node.
Trusted Circuits
Trusted circuits only exist between simulators themselves and/or utility servers (The Userserver, Dataserver, or Spaceserver). These circuits are established in response to the DenyTrustedCircuit message, using the CreateTrustedCircuit message.
Circuit Establishment
As all circuits are handled by the Message System, a circuit is established by calling LLMessageSystem::enableCircuit. If a circuit has not already been established, this function is in charge of creating one. While establishment of trust is also a parameter in circuit creation function, a trusted circuit will not be created unless the CreateTrustedCircuit message is sent using the correct handshake protocol.
Circuit Lifetime
Circuits are established at multiple points during a viewer session lifetime, including login, creation of child agents, and transfers between simulators (teleports or region crosses). Each of these circuits has multiple "pulse" methods to make sure the connection is alive, as well as that it is sending/receiving correct data, including:
- Packet ID Checking
- Each packet has a 32-bit packet ID number that is incremented each time either node sends a message. The circuit is in charge of making sure this number is correct, as it aids in establishing reliable packets over UDP
- Further covered in Packet_Accounting
- Pings
- Pings are sent back and forth over the circuit using Protocol:Common_Messages:StartPingCheck and Protocol:Common_Messages:CompletePingCheck messages.