New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speaker Queue Protocol: Half duplex messaging as a base layer #8
Comments
Another options is to remove the 'nobody is talking state', then you only need a 'switch' signal.
|
I can use the Pauze messages that I already implemented in the Jackal, so send |
When node B is paused but has a reason to want to send node A a message, it queues the message but sends a Pauze message to signal they have their hand up. As soon as A finishes its current batch, if B has their hand up, A unpauses B. |
The Bilateral Speaker Queue Protocol aims to help two participants speak one at a time. Setting
Message typesThere are three message types:
Rules
|
Implemented this now in |
If we can create a layer that guarantees that probes and traces only ever cross inside a node and never in-flight in-between two nodes, that would help avoid quite a few unnecessary problems around undetected loops and possibly (in simpler node types) even message storms.
One option I came up with is a sort of randomize backoff or Rock-Scissors-Stone game that decides who is allowed to talk:
Version 1: Random backoff
Try to take the lock at any time, if there is a clash, wait for a random time before retrying.
Version 2: Random numbers game
Each player chooses a number between 0 and 99. If the difference between the two numbers is 50 or smaller, the smallest number wins. Otherwise the bigger number wins. If the two numbers are the same, the game is undecided. An improvement on this is to let one player add .5 to their number, so they can never be the same.
Version 3: Water/Hammer vs Fire/Glass.
Equivalent to version 2 with one player playing 0 or 1, and the other playing .5 or 1.5.
One player plays wither Water or Hammer, the other plays either Fire or Glass.
The verbs 'extinguish', 'burn', 'contain', and 'break' all mean 'WIN'.
For the Water/Hammer player, it's a 50/50 choice, and chances of winning depend entirely on what the Fire/Glass player plays:
For the Fire/Glass player, the dilemma is similar:
Version 4: Whackamole
A different way to describe what is essentially a same game of two booleans:
The 'mole', or 'difference' player tries to escape by putting their mole in a different location than the hammer.
The 'hammer', or 'equality' player tries to whack the mole by putting their hammer in the same location as the mole.
The text was updated successfully, but these errors were encountered: