We get specific enough to write some cartoon code. By ‘cartoon’ I mean real enough to run in some sort of test environment while interacting with various sorts of DSR code.

I will assume links with enough software to make them authentic and secret enough. Network logic requires integrity but no secrecy. Nodes and link providers may choose to provide and advertise secrecy for a premium. I assume that the links stay up for days at a time, but that some code here must deal with links coming and going.

The plan is to attribute meaning to control messages and provide that meaning in informal English. This is an alternative to trying to describe the behavior of a recipient to such messages. Indeed the whole point of DSR is to provide for the evolution of such meanings even as the network runs. This is in stark contrast to the meaning of computer instructions which must be rigorously fixed over long time spans. Perhaps an Axelrod type tournament could explore antisocial opportunities in the DSR world! Here we plan for dumb nodes to go broke and smart ones to prosper, in an overall ecology such that nodes must contribute to the commonweal to prosper.

Steering Logic

Packet Format

We do not include here the data that supports secrecy and integrity. We assume ‘network byte order’ where the most significant byte of a binary integer is delivered first. I will assume here hardware that deposits an incoming stream so that 2 and 4 byte integers are in their native order. This means that on a little endian machine bytes are deposited in memory in descending addresses. The same goes for sending the data stream over a link. A consequence of this is that ascii text is stored backwards, but the code we imagine here does not process text.
Size in bitsValuesignificance
32vvalue field
16spayload size in bytes
8tccount of 4 bit turn ops
4*tcturn opshow to get there
(tc&1)*4padpayload starts on byte.
8*spayloadto be delivered to eventual recipient
Packets begin with a 32 bit value field, v. A packet is individually routed and v is followed by a string of 4 bit turn ops. Most packets are forwarded at each node according to the first turn op which is removed from the packet. A four bit field is appended to the end of turn ops which would serve to steer a return packet should the need arise. A turn op of 0 means that the node routing by that field is the recipient.

For simplicity I ignore here questions of QoS and ‘circuits’.