From 55a9cf095cf4f245bfadf60985dda9e7e35fe919 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 5 Jun 2024 20:12:16 -0500 Subject: [PATCH] Feature: Add "Magic Bit" to the FSS-000F (Simple Packet) format. Make the FSS-000F (Simple Packet) format more generalized and flexible by allowing other payload formats than only formally supporting FSS-000E (Payload). This adds a new optional "Magic Block" that is designated via the "Magic Bit", which is the third bit from the left. This should make it easy to store the Simple Packet as a local file. This should make it easier for routing to optimize processing of the packet by quickly identifying the packet. The "Control Block" and the "Size Block" have static sizes and positions, which should make it easy to identify the "Magic Block". The third bit should be checked and then the "Magic Block" should be checked when trying to quickly identify the packet type via the "Magic Block". --- fll/specifications/fss/fss-000f.html | 57 +++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/fll/specifications/fss/fss-000f.html b/fll/specifications/fss/fss-000f.html index 647161b..0d97648 100644 --- a/fll/specifications/fss/fss-000f.html +++ b/fll/specifications/fss/fss-000f.html @@ -81,20 +81,30 @@

- The version date of this specification is 2023/11/14. + The version date of this specification is 2024/06/05.

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

+

+ The Magic Block when containing FSS-000e (Payload) in the Payload Block is: 11010010100111101111010000111110. +

+

+ The Magic Block when containing unspecified plain text in the Payload Block is: 00101110000001001101110001000010. +

+

+ The Magic Block when containing unspecified binary data in the Payload Block is: 00010101101001001111000000001000.

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

- There are only three blocks in this format: + There are three or four blocks in this format:

  1. Control Block.
  2. Size Block.
  3. +
  4. Magic Block.
  5. Payload Block.

@@ -102,12 +112,13 @@ 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. + The third bit following the endiannes bit represents the magic bit.

Control Block Structure:

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

The endianness bit designates whether or not the packet is in big endian or little endian format. @@ -115,8 +126,12 @@ All binary data within this packet, following the Control Block, must respect this endianness bit (including the Size Block).

+ The magic bit designates whether or not the packet contains the optional Magic Block. + When the magic bit is not set, then there is no Magic 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. + While the packet might be considered to be in string format, it is technically always in binary format due to the Control Block, the optional Magic 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).

@@ -138,18 +153,34 @@ 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. + The Magic Block is 4 bytes long, therefore when the magic bit is set, then the maximum available size of the entire Simple Packet structure is (2^32)-9.

- + Magic Block Structure: +

+[ Magic Block   ]
+[ size: 32 bits ]
+
+

+ The Magic Block is an unsigned 32-bit digit used to uniquely identify the packet. + The 32-bits are treated as endianless such that the left to right order of the bits is always the same for both big and little endian systems. + The Magic Block is required when the magic bit is set and it must not exist when the magic bit is not set. +

+

+ This offers optimization in identifying the packet and its structure. + This is particularly useful for quick identification on the network such as via routers. + This is particularly useful for storing the packet as a file. + This is particularly unhelpful for security and privacy given that it helps quickly identify the packet.

Payload Block Structure:

-[ Payload Block        ]
-[ size: (2^32)-6 bytes ]
+[ Payload Block                                                ]
+[ size: (2^32)-5 bytes (or (2^32)-9 bytes if magic bit is set) ]
 

- The Payload Block is not defined by this standard other than that it exists and should be in FSS-000e (Payload) format. + The Payload Block is not defined by this standard other than that it exists and is suggested to be in FSS-000e (Payload) format. + If the Magic Block is present and set to 11010010100111101111010000111110, then this is expected to 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. @@ -164,6 +195,12 @@ [ Control Block ] [ Size Block ] [ Payload Block ] [ 0b10000000 ] [ 0b00000000 0b00000000 0b00000100 0b11010010 ] [ size: 1229 (1234 - 5) ] +

+ Example Packet Structure with Magic Bit: +

+[ Control Block ] [ Size Block                                  ] [ Magic Block                                 ] [ Payload Block         ]
+[ 0b10100000    ] [ 0b00000000 0b00000000 0b00000100 0b11010010 ] [ 0b11010010 0b10011110 0b11110100 0b00111110 ] [ size: 1225 (1234 - 9) ]
+
-- 1.8.3.1