Skip to content
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

Try to improve hidden service reachability during sleep #83

Closed
wants to merge 1 commit into from

Conversation

Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
@cheahjs
Copy link

@cheahjs cheahjs commented Aug 11, 2017

The issue at the moment is that while the device is sleeping for long periods of time, it is possible for the HS to become unreachable as a result of Tor detecting a clock jump of length greater than NUM_JUMPED_SECONDS_BEFORE_WARN (100 seconds) upon waking up, which then closes all circuits. Another issue is that if the device was woken up by incoming network traffic, the device only stays awake for about a second before going back to sleep, which isn't enough time for Tor to rebuild the intro circuits, and thus the HS is no longer reachable until Tor is able to rebuild the circuits.

I attempt to improve this situation in two ways:

  1. Increase NUM_JUMPED_SECONDS_BEFORE_WARN from 100 seconds to 600 seconds to avoid triggering the clock-jumped-close-all-circuits code every time the device wakes up from sleep.
  2. Add a new command (MARKCONNFORWAKELOCK) and event (WAKELOCK) to the control port to allow Tor to synchronously signal Orbot to hold wake lock on behalf of Tor (since it isn't possible to hold a wake lock from native code). A wake lock is acquired at the start of a event callback, then released when libevent returns from its event loop when there are no active events. This prevents the device from sleeping when Tor still has work to do.
Add support for MARKCONNFORWAKELOCK command and WAKELOCK event
@n8fr8
Copy link
Member

@n8fr8 n8fr8 commented Aug 21, 2017

Thanks, we are reviewing and discussing on the Tor project trac system here: https://trac.torproject.org/projects/tor/ticket/23289#ticket

@h-2
Copy link

@h-2 h-2 commented Sep 20, 2017

I tried to add to the ticket at torproject, but the registration CAPTCHA failed like 10 times so I gave up.

Increase NUM_JUMPED_SECONDS_BEFORE_WARN from 100 seconds to 600 seconds to avoid triggering the clock-jumped-close-all-circuits code every time the device wakes up from sleep

I suggest using 900 seconds as that is the renewal interval for web-socket connections and some other things (maybe 910 just to be sure). If I understand the proposed changes correctly you could piggy-back on the wake-ups by other services if they happen within the interval, right?

@mostafafeizi1352
Copy link

@mostafafeizi1352 mostafafeizi1352 commented Nov 7, 2018

can not inestall tor

@n8fr8 n8fr8 closed this May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment