User:JB Kraft/Servers
Intro
This is an attempt to document what happens currently at the other end of the viewer, in other words, answer the question, "Who is the viewer talking to and what is it talking about?" Much of this has been done already with various wiki pages but there are still details missing that can only be gleaned with packet analysis and staring at the LibSL, opensim and viewer code and this is an attempt to fill in some of those gaps.
Note: I do not work for Linden Labs nor am I privy to any inside info. These are notes from my own investigation and could very well be completely wrong or misleading. Caveat Emptor. If you do see any errors or misinformation I would very much appreciate your input and help. JB Kraft
Servers
There are three main servers, though in practice many other sub-systems and servers could be utilized, from the viewer perspective, there are three servers that it needs to talk to.
Login Server
The login is server is the first point of contact. It utilizes an XML-RPC style dialog to establish credentials and to locate the other two servers to talk to. This is the most documented part of the process so I am not going into it here. The following links will get you up to speed.
- Current_login_protocols -- how it works, pretty straight up
- LibSL Login -- LibSL take on it
CAPS Server
The Capabilities system allows viewers to request abilities and be temporarily granted those abilities through a unique URL. The transport format is LLSD XML, and clients can either post new events to CAPS URLs or wait for events to come from the server on the event queue connection the client holds open.
- Capabilities -- short blurb about what it is but no nitty gritty
- Message_System_and_Capabilities -- some more info but in slideshow format
Simulator Server
The simulator talks UDP. It handles the view or scene, physics issues, and a bunch of other stuff. Most of it in fact. It's the thing that makes things go bing. Although some of the packet formats are documented, there is little on how those packets actually go back and forth, book-keeping and the general query/response thing. I hooked up wireshark to a session to watch the conversation and am attempting to collate the info linked below with the the packet dump. Hopefully I can make some sense of things here.
So, for now, here is the first bit of the conversation with the beta grid from the 1.20.15 viewer. Note that order is the order the packets came in and left and is not the sequence number of the packet. The sequence number is shown in braces after the message name.
Order | From Viewer | From Server |
---|---|---|
1 | UseCircuitCode (0001) | PacketAck (0001) |
2 | AgentDataUpdate (0002) | AgentDataUpdate (0002) |
3 | CompleteAgentMovement (0002) | TestMessage (0003) |
4 | EconomyDataRequest (0003) | AgentMovementComplete (0004) |
5 | ViewerEffect (0004) | TestMessage (0005) |
6 | PacketAck (0005) | PacketAck (0006) |
7 | TestMessage (0006) | HealthMessage (0007) |
8 | TestMesssage (0007) | PacketAck (0008) |
9 | AgentHeightWidth (0008) | ViewerEffect (000A) |
10 | AgentUpdate (0009) | - |
11 | AgentAnimation (000A) | - |
Packet Data
These are some decoded packets from the viewer to the server.
Name | Type | Flags | Data |
---|---|---|---|
PacketAck | Fixed | 00 00 00 00 05 00 ff ff ff fb 01 02 00 00 00 | |
AgentDataUpdate | Low | R | C0 00 00 00 02 00 FF FF 01 83 1C 8A 77 67 E3 7B 42 2E AF B3 85 09 31 97 CA D1 03 4A 42 00 01 06 4B 72 61 66 74 00 01 01 00 1A |
ViewerEffect | Medium | Z | 80 00 00 00 04 00 FF 11 1C 8A 77 67 E3 7B 42 2E AF B3 85 09 31 97 CA D1 4B 6F FF 1F B5 67 41 FD 85 EF A1 98 3B F2 B5 77 01 43 FA 4F 0B DB D8 97 8D 7E E8 A2 E6 83 B0 D0 E2 1C 8A 77 67 E3 7B 42 2E AF B3 85 09 31 97 CA D1 09 00 03 3F FF FF FF FF 38 00 24 28 08 10 41 00 04 50 70 0F 41 00 06 24 40 |
AgentAnimation | High | R | 40 00 00 00 0A 00 05 1C 8A 77 67 E3 7B 42 2E AF B3 85 09 31 97 CA D1 4B 6F FF 1F B5 67 41 FD 85 EF A1 98 3B F2 B5 77 01 EF CF 67 0C 2D 18 81 28 97 3A 03 4E BC 80 6B 67 00 01 00 |
UDP Messages
- Message Layout -- Explanation of message format and the message template
- Packet Layout -- the layout of the UDP payload.
- Circuits -- Establishment and common operation of UDP circuits between two nodes
- Packet Accounting -- how the message system handles packet sequencing, reliability, suppression, throttling, etc.
- Common Messages -- messages that are handled by every Indra message system instance.
- Xfer Manager -- messages used by the
LLXFerManager
class. - Transfer Manager -- messages used by the
LLTransferManger
class. - All messages -- an alphabetical listing of all messages in the system
- LibSL Network Protocol -- LibSL docs
SLIR
I am working on a server system in my spare time. LibSL, opensim and Pyogp are great projects in which I participate in as much as I can but, for my own purposes and education, I am building this system in Ruby. At the moment I call it 'SLIR' which means absolutely nothing or possibly Second Life Interactive Ruby, or even So Little Interesting Real-Work, I don't know for sure. I had a python implementation of this as well but Pyogp kind of made that moot. I plan on releasing the SLIR code as soon as I can get the viewer to login and logout. So far it's still complaining when logging in.