Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stun: minimal working client/server (#545)
WIP branch (on top on ted/ping; will be merged there). Uses urbit/urbit#6836 for the %arvo side. - [x] Send/Receive STUN request/response, handled in %arvo by stopping the %ping app. - [x] Check DNS resolution -- currently we send STUNs in fakeship mode - (check changing hosts.txt) - [ ] refactor _stun_czar, _ames_czar, - make a generic _dns_czar(imp_y) that gets called every ~m5 for our sponsoring galaxy, and every time an %ames packet is sent to another galaxy - [x] refactor _ames_czar/stun_gone - [x] Use XOR-MAPPED-ADDRESS to send the sponsee's IP - [x] Better STUN (re)sends, regarding timers (e.g. number of tries per attempt... etc) - "send requests at times 0 ms, 500 ms, 1500 ms, 3500 ms, 7500 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. - [x] Callback error handling - if a response failes, ignore—sender will try again - if a request fails, resend it - if the DNS resolution fails, stop everyting and restart - if the response doesn't arrive in ~s39, inject %fail, stop everything and restart - [ ] DNS Error handling - [x] Failure to resolve DNS (first time) -- have a global ~s25 timer? - [x] Change in sponsor's IP -- resolve DNS on failure to hear a response? - [x] ~~exponentially backoff~~resolve DNS every 5 minutes - [x] Better STUN response check - [x] Add sponsee's IP to MAPPED-ADDRESS attribute field - [x] cache ip address - [x] (re)enable %ping app after failure to hear STUN response, if we eventually hear one - [ ] Test plan: see last point in urbit/urbit#6836 (comment)
- Loading branch information