dedis / prifi

PriFi, a low-latency, local-area anonymous communication network.

Home Page:https://prifi.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pervasive failed rounds on iOS

aledcuevas opened this issue · comments

Description: In certain situations (unknown still), the mobile client introduces several failed rounds after disconnecting on sleep and attempting to connect on wake. While this is not confirmed, it seems like the issue is related to the SOCKS connections between the client and the relay.

Steps to reproduce: (This procedure is a bit ad-hoc and not always guaranteed but seems like it often is able to introduce the behavior)
Note: This should be tested with iOS clients which have the sleep/wake feature enabled (i.e. PriFi iOS 0.3)

  1. Start the protocol (I only start the relay and 1 trustee for ease of observation)
  2. Open the app and connect to the relay
  3. Lock the iPhone to allow the phone to sleep (ensure that there are no background apps running that would prevent the phone from sleeping, such as music playback)
  4. Wait until it disconnects (since we are using just 1 trustee and 1 client, the protocol will stop)
  5. Wake the phone (you can remain in the lock screen)
  6. Repeat from 3) a few times (we want to do a few sleep/wakes before proceeding)
  7. I now try to open several connections at the client.
    Note: For this, I prefer to use the Twitch app (since it's a livestreaming app it's very sensitive to network errors), but other similar apps would probably work. In the case of Twitch, I open a stream for about 5 seconds (it opens about 10-15 connections), then close the app because otherwise it prevents the phone from sleeping.
  8. Lock the phone and wait for it to disconnect.
  9. Wake the phone. Sometimes you can already see several failed rounds at this stage, forcing the protocol to restart. Most of the time the client doesn't disconnect nor, consequently, reconnect successfully.
    Note: I have tested this with max_failed_rounds=3 and 15, and in each case the client failed rounds until the protocol was killed.
  10. If upon waking the client still works, I try to introduce more stress by using the Speedtest app by Ookla. This app, similar to Twitch, opens several connections.
  11. Lock and wait for the app to disconnect (sometimes you need to kill the Speedtest app or at least let it finish the test before the phone is able to enter sleep)
  12. Wake the phone. It often fails like it would in 10).
  13. If still the client is working up to now, open Wikipedia and click on some links.
  14. Repeat from 7) if necessary.

kill-protocol

In this screenshot you can see both the protocol reaching failure and subsequent failures by the trustee as described in #203