Difference between revisions of "Packet Layout"

From Second Life Wiki
Jump to navigation Jump to search
(+{{OSWikiLearnBox|parent=Protocol}})
Line 1: Line 1:
==Packet Layout Visualization==
{{OSWikiLearnBox|parent=Protocol}}
{{OSWikiLearnBox|parent=Protocol}}


Line 9: Line 12:
  :                                                              :
  :                                                              :


Header:
==Header==
* Byte 0, 4 most significant bits: Packet Information
* 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_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.
Line 20: Line 23:
** 1/2/4 byte ID of the message the packet contains
** 1/2/4 byte ID of the message the packet contains


Body:
==Body==
* Bytes n thru n+(data length)
* Bytes n thru n+(data length)
** Body of packet, possibly zero coded.
** Body of packet, possibly zero coded.
===Zero Coding===


Appended Acks:
==Appended Acks==
* Bytes n+(data length) thru acks
* Bytes n+(data length) thru acks
** Rest of packet is fill with as many acks as will fit from reliable messages
** Rest of packet is fill with as many acks as will fit from reliable messages




See also: libsecondlife documentation
See also: [[libsecondlife documentation http://www.libsecondlife.org/protocol/index.php/Protocol_%28network%29]]

Revision as of 14:01, 17 November 2006

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 beyond this is potentially zerocoded for compression
  • Bytes n thru n+(frequency size)
    • 1/2/4 byte ID of the message the packet contains

Body

  • Bytes n thru n+(data length)
    • Body of packet, possibly zero coded.

Zero Coding

Appended Acks

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


See also: libsecondlife documentation http://www.libsecondlife.org/protocol/index.php/Protocol_(network)