I collect here some potential SS encodings.
They must each support the notion that an SS is one or two paths and a path is a sequence of 4 bit turn ops.
These formats are cute and presumably very efficient for either hardware or software.
Designing them alerted me to some inadequacies of the prose specs.
They are tricky however and the code is obscure.
I want some bone simple form that manifests the logical properties of the SS; I will forego efficiency for now.
The slow formats
The dumb version of a path is a 2 byte aligned byte count and that many bytes, one turn op per byte.
A zero length byte count indicates no return path.
I suppose that a zero length destination path is legal and means “its for you”.
We must be clear whether this is legal and it is not yet clear.
This layout strongly suggests that the return path come first, followed by the destination path, and also that the return path be stored backwards.
The destination path shrinks as the return path grows.
We put both byte counts together at the front of SS and the two byte strings immediately following.
The fast formats
- Here is an SS format that would aid management of SS.
An initial octet indicating:
- whether there is a return path,
- whether the first octet holds one or two turn ops,
- whether the last octet holds one or two turn ops,
- length of SS in octets.
If there are an even number of turn ops, then ech link traversal changes the number of octets in the representation of SS.
This is some combination of awkward, slow and complex.
- And another format that is faster to process with a conventional CPU:
SS is always one or more words, full of turn ops except the last word with padding in the middle.
A ‘word’ here is 32 or 64 bits long (format parameter) and aligned.
There is an array of words, typically one long.
‘front word’ is the first word of the array.
SSC (SS control) has two alternatives:
- 16 bits: (numbered from left)
0: bool: has return path
1-3: 0
4-7: word count
8-11: count of return path turn ops in right of front word,
12-15: count of path turn ops in left of front word.
-
more abstractly: a return path bool, a word count, either ‘remaining ops in first word’ count, or ‘remaining ops in all words’.
The 2nd alternative presumes that all words are full and prevents infinite paths.
Bits 0-7 are unmodified as the packet travels thru the net.
The first word is shifted left at each node and the lost turn op steers to the next node and the vacated turn op gets the interface number on which the packet arrived.
0x0F is added to bits 8:15 of SSC which decrements the path turn op count and increments the return path count.
If the path turn op count goes to 0 the front word is put at the back of the array and all other words moved to a one lower index value.
This has the curious property that it describes an infinite path and expects the end user to recognize the packet as its own.
Packets with corrupted a SS will wander about the net until the encounter an inactive interface or run out of money.
Keynes would say that that is good for the economy.
This is not serious but does violate the (perhaps unnecessary) notion the paths are of some definite manifest length.
This proposal is in transition and somewhat muddled.
I leave it in place so as not to further damage what may be the old better design.
See below.
- An SS is:
- wc: A word count, constant during transmission,
- oc: (Remaining path op count in first word)−1, (There is always at least one.)
- wrds: An array of words, all full of turn ops as far as the net knows.
Any noise will serve to pad last word and the noise is delivered to the destination.
As a packet transits a node the first word is rotated and oc is decremented.
If oc mod (ops/word) = 0 then words are rotated.
To reflect an SS:- oc = ops/word − oc.
- reflect all words (swap ops in word end for end),
- swap words in array end for end, excluding first word if oc mod (ops/word) = 0.
This format does not limit the length of the path.
It counts on the recipient to recognize either its own turn op value, or the fact that it does not route.
As with the current internet, a recipient must not believe that the packet is benign or that it is from who it says it is from.
64 bit words are slightly more efficient but sometimes require more space.
16 hops in a total path is probably too small a limit; we need more than one word and 16 words is clearly enough.
This scheme is not modular in that SSC is 2 bytes long while the words should probably be word aligned.
SSC might go in packet header with the other crumbs.