-
Notifications
You must be signed in to change notification settings - Fork 39
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
stun: minimal working client/server #545
Conversation
note: will need to be refactored -- copied from _ames_czar
Current state machine for STUNing. (Note: doesn't include the %stun tasks sent to %ames: stateDiagram
state %ping {
state "STUN off" as off
state "STUN trying" as try
state "STUN keepalive" as keep
[*] --> off
off --> try: on %saxo
try --> keep: on RESPONSE
keep --> try: no response after ~s25
keep --> keep: response < ~s25
try --> try: after ~s1 (5x) // after ~s25 // on %saxo (escape)
#try --> try: after ~s2
#try --> try: after ~s3
#try --> try: after ~s4
#try --> try: after ~s5
#try --> try: after ~s25
#try --> try: on %saxo (escape)
keep --> try: on %saxo (escape)
}
|
note: loom: external fault after DNS timer is called again
e97f07f
to
3024882
Compare
...and if not, keep trying until we go over the whole buffer (Note: the parsde port is wrong)
@joemfb I implemented here 6f8e718 a way to go over the whole length of the buffer and try if the first found attribute looks "correct" (if it's either a fingerprint or an IP address), otherwise continue until the end. This is to account for "duplicate" attributes (e.g. two XOR-MAPPED-ADDRESS attributes where the first one has a malformed/incorrect IP address, but the second does not) in STUN response/requests. This seems to be a bit of an edge case but I added it to be on the safe side. LMKWYT. |
@joemfb it looks like the RFC:
So we might not need the loop to go over everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will do
As of this latest changes, everything seems to be working as expected. Next step is to start testing this as outlined here: urbit/urbit#6836 (comment) |
WIP branch (on top on ted/ping; will be merged there). Uses urbit/urbit#6836 for the %arvo side.
ms, 15500 ms, and 31500 ms. If the client has not received a
response after 39500 ms", stop, inject %fail, (re)resolve DNS, and restart STUN.
exponentially backoffresolve DNS every 5 minutes