Featureless Linux Library Specification

FSS-000F (Simple Packet)

The version date of this specification is 2023/11/14.

This is a network packet format that contains fss-000e (Payload) within it.

The Simple Packet structure is described in blocks, of which are structured in bytes.

There are only three blocks in this format:

  1. Control Block.
  2. Size Block.
  3. Payload Block.

The Control Block is the first block in the packet and is considered endianless. There exists only a single byte within the Control Block (8-bits). Regardless of the endianness of the packet, leftmost bit is always the endianness bit. The second bit following that endianness bit represents the string or binary bit.

Control Block Structure:

[ Endianness Bit ] [ String / Binary Bit ] [ Remaining 6 Bits (unused) ]
[ size: 1 bit    ] [ size: 1 bit         ] [ size: 6 bits              ]

The endianness bit designates whether or not the packet is in big endian or little endian format. A bit value of 0 designates that this packet is in little endian and a value of 1 designates that this packet is in big endian format. All binary data within this packet, following the Control Block, must respect this endianness bit (including the Size Block).

The string or binary bit, a value of 0 designates that the packet is in string format and a value of 1 designates that the packet is in binary format. While the packet might be considered to be in string format, it is technically always in binary format due to the Control Block and Size Block. This means that the binary bit designating the packet as either a string packet or a binary packet is referring to whether or not the Payload Block is in string or binary format. The Payload Block itself can contain binary data even when in string format as per FSS-000e (Payload).

The remaining bits are not defined by this standard and are expected to be 0. Non-formal or local uses may utilize these remaining 6 bits as desired. However, there may be additional standards that expand upon this and utilize these remaining Control bits. Anything that utilizes these unused Control bits may add or remove additional Blocks after the Control Block as they see fit. One possible use of the remaining bits is to designate a different variation of this Simple Packet standard.

Size Block Structure:

[ Size Block    ]
[ size: 32 bits ]

The Size Block is an unsigned 32-bit integer representing the size of the entire packet in bytes, including the Control Block and Size Block. This size must exactly match the packet to be a valid packet. The size represents number of bytes in the file. The Control Block is 1 byte long and the Size Block is 4 bytes long, therefore the maximum available size of the entire Simple Packet structure is (2^32)-6.

Payload Block Structure:

[ Payload Block        ]
[ size: (2^32)-6 bytes ]

The Payload Block is not defined by this standard other than that it exists and should be in FSS-000e (Payload) format. The FSS-000e (Payload) may be represented in either string format or binary format. The FSS-000e (Payload) may contain multiple header(s) but may only contain a single payload. With this in mind, it is recommended that only a single header be supported in the Payload Block. The payload Content may be in either a binary or string format regardless of the binary bit in the Simple Packet Header Block.

See the fss-000e (Payload) specification file for details on the syntax rules for the Payload Block.

Example Packet Structure:

[ Control Block ] [ Size Block                                  ] [ Payload Block         ]
[ 0b10000000    ] [ 0b00000000 0b00000000 0b00000100 0b11010010 ] [ size: 1229 (1234 - 5) ]