Difference between revisions of "Packet Layout"

From Second Life Wiki
Jump to navigation Jump to search
m (libsecondlife wiki moved.)
Line 19: Line 19:
** LL_ACK_FLAG 0x10 -- This packet contains appended acks.
** LL_ACK_FLAG 0x10 -- This packet contains appended acks.
* Bytes 0, (4 least significant bits)  to byte 3: (for a total of 28 bit) Packet ID, assigned by circuit
* Bytes 0, (4 least significant bits)  to byte 3: (for a total of 28 bit) Packet ID, assigned by circuit
* Everything beyond this is potentially zerocoded for compression
* Everything up to ACKs is potentially zerocoded for compression
* Bytes n thru n+(frequency size)
* Bytes n thru n+(frequency size)
** 1/2/4 byte ID of the [[message]] the packet contains
** 1/2/4 byte ID of the [[message]] the packet contains

Revision as of 12:54, 9 January 2007

Packet Layout Visualization

 +-+-+-+-+-------+---------------+---------------+---------------+
 |Z|R|R|A|                                                       |
 |E|E|E|C|                   Packet ID (28 bits)                 |
 |R|L|S|K|                                                       |
 +-+-+-+-+-------+---------------+---------------+---------------+
 |                                                               |
 :                                                               :

Header

  • Byte 0, 4 most significant bits: Packet Information
    • LL_ZERO_CODE_FLAG 0x80 -- Packet data is run length encoded, such that series of 1 to 255 zero bytes are encoded to take 2 bytes.
    • LL_RELIABLE_FLAG 0x40 -- This packet was sent reliably (implies please ack this packet)
    • LL_RESENT_FLAG 0x20 -- This packet is a resend from the source.
    • LL_ACK_FLAG 0x10 -- This packet contains appended acks.
  • Bytes 0, (4 least significant bits) to byte 3: (for a total of 28 bit) Packet ID, assigned by circuit
  • Everything up to ACKs is potentially zerocoded for compression
  • Bytes n thru n+(frequency size)
    • 1/2/4 byte ID of the message the packet contains

For further explanation of the bits in the header, see Messages and Packet Accounting

Body

  • Bytes n thru n+(data length)
    • Body of packet

Appended Acks

  • Bytes n+(data length) thru acks
    • Rest of packet is filled with as many acks from previous reliable messages as will fit.


See also: libsecondlife documentation