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

WIP: Use "D-Bus over TCP/IP over Ethernet over BLE" for communicating with the watch #216

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

I-asked
Copy link

@I-asked I-asked commented May 2, 2024

Hi @FlorentRevest!
What a coincidence indeed…
(We came up with the same idea within the span of two weeks 😳)


Sooo this is my attempt at replacing ATT-based comms with something more streamlined (D-Bus). ✌️

The session bus is exported over TCP to the companion for seamless event transfer between the two devices.

A simplified version of asteroid-tap2ble forwards packets from a TAP interface over BLE. (since the link is relatively slow [26 kbps avg.], we should stick to lightweight protocols, so D-Bus-over-TCP, 9p, etc.; SSH is sadly way too bulky for this connection.)

The packets should then be handled on the companion in an appropriate manner.

To achieve this on Android, I am using libslirp, which allows me to create a virtual network adapter that translates Ethernet packets into unprivileged calls.

To do

  • Link works
  • Security: Ensure the BLE transfer is encrypted (I am not sure if it is by default?)
  • Additional 9p link for remotely accessing the watch's FS (possible to use diod on the watch)
  • Port the rest of the services to D-Bus (most services) and 9p (services that transfer files, such as ScreenshotService)
    • MediaService
    • NotificationService (also made it bi-directional 😉; now it's just missing action buttons 😶‍🌫️)
    • ScreenshotService
    • TimeService (could be scrapped in favor of NTP)
    • WeatherService (could be scrapped in favor of the community daemon)

@I-asked
Copy link
Author

I-asked commented May 3, 2024

Currently working on the MediaService (MPRIS), also updated dbus-java locally.

app/build.gradle.kts Outdated Show resolved Hide resolved
@I-asked I-asked force-pushed the libslirp branch 2 times, most recently from acffbbd to 5c85a4c Compare May 3, 2024 14:24
@I-asked
Copy link
Author

I-asked commented May 3, 2024

I believe the 14-bytes Ethernet frame can be shaved down to 1 byte for point-to-point (a pair of nibbles for source + destination MAC)

import java.util.Objects

class NotificationService(private val mCtx: Context, private val connectionProvider: IDBusConnectionProvider) : INotificationHandler, DBusSigHandler<NotificationClosed?> {
private val mapping: BiMap<String, UInt32> = HashBiMap.create()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mapping should probably be persisted in case the application is closed…

Copy link
Member

@FlorentRevest FlorentRevest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very promising overall! Thanks a lot for everything, I'm quite excited! :D

# build script scope).
project("sync")

add_subdirectory(libslirp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ship libslirp as a git submodule so we don't have to copy paste files across repositories and we benefit from libslirp's commit log etc...

JNIEXPORT void JNICALL Java_org_asteroidos_sync_connectivity_SlirpService_finalizeNative
(JNIEnv* env, jobject thisObject) {

auto mySlirp = GET_MYSLIRP(env, thisObject);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the my prefix? :p

@@ -142,7 +162,7 @@ public final boolean isRequiredServiceSupported(@NonNull final BluetoothGatt gat
@Override
protected final void initialize() {
beginAtomicRequestQueue()
.add(requestMtu(256) // Remember, GATT needs 3 bytes extra. This will allow packet size of 244 bytes.
.add(requestMtu(517)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason for that MTU ? :)

@@ -58,4 +58,9 @@ public class AsteroidUUIDS {
public static final UUID NOTIFICATION_SERVICE_UUID = UUID.fromString("00009071-0000-0000-0000-00A57E401D05");
public static final UUID NOTIFICATION_UPDATE_CHAR = UUID.fromString("00009001-0000-0000-0000-00A57E401D05");
public static final UUID NOTIFICATION_FEEDBACK_CHAR = UUID.fromString("00009002-0000-0000-0000-00A57E401D05");

// SlirpService
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't call the BLE standard "slirp service" because technically it's agnostic to the existence of slirp. Slirp is an implementation detail of the Android companion where we do not have the privileges to inject raw frames.


// SlirpService
public static final UUID SLIRP_SERVICE_UUID = UUID.fromString("0000A071-0000-0000-0000-00A57E401D05");
public static final UUID SLIRP_OUTGOING_CHAR = UUID.fromString("0000A001-0000-0000-0000-00A57E401D05");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the naming of characteristics consistent with tap2ble so they are easier to map. Outgoing and Incoming are similarly confusing as RX and TX, let's just stick to one

import java.util.Map;
import java.util.Objects;

public class DBusNotificationService implements INotificationHandler, DBusSigHandler<Notifications.NotificationClosed> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, to keep this code maintainable there should only be one NotificationService and it should choose between using DBus or the legacy BLE profile based on what is supported. It will make it easier to share code and to evolve this over time

if (notificationOption == NotificationPreferences.NotificationOption.NO_NOTIFICATIONS)
return;

int id = intent.getIntExtra("id", 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this should be key now. One more reason to share code between the two implementations

versionCode = 29
versionName = "0.29"
ndk.abiFilters.clear()
ndk.abiFilters.add("arm64-v8a")
ndk.abiFilters.add("armeabi-v7a")
ndk.abiFilters.add("x86")
ndk.abiFilters.add("x86_64")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, now these are re-added and cgi is deleted. That's a lot of back and forths to review. I realize the PR is marked as draft, it would be nice to clean up this backlog. I'll stop reviewing here until then ;)

@@ -39,7 +42,7 @@ android {
srcDir("src/main/lib/powerampapi/poweramp_api_lib/res/")
}
jniLibs {
srcDir("/work/android-root/lib")
srcDir("/tmp/android-root/lib")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, this is supposed to be the outcome of the bash script now. Maybe it doesn't hurt to add a comment above to describe where this is coming from

@@ -107,7 +137,7 @@ public SlirpService(Context ctx, IAsteroidDevice device) {
long read = vdeRecv(rx, 0, mtu - 3);
assert read <= (mtu - 3);
if (read > 0) {
Log.d("SlirpService", "Received " + read + " bytes");
// Log.d("SlirpService", "Received " + read + " bytes");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No commented code, let's just drop it

@MagneFire
Copy link
Member

@I-asked I've been testing your PRs, great work! But I'm wondering what kind of performance we can expect? Currently pinging seems to take some time:

# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=99 ttl=255 time=188805.175 ms
64 bytes from 1.1.1.1: seq=100 ttl=255 time=187948.871 ms
64 bytes from 1.1.1.1: seq=101 ttl=255 time=187224.688 ms
64 bytes from 1.1.1.1: seq=102 ttl=255 time=186367.484 ms
64 bytes from 1.1.1.1: seq=103 ttl=255 time=185504.062 ms
64 bytes from 1.1.1.1: seq=104 ttl=255 time=184644.709 ms
64 bytes from 1.1.1.1: seq=105 ttl=255 time=183783.534 ms
64 bytes from 1.1.1.1: seq=106 ttl=255 time=182925.377 ms
64 bytes from 1.1.1.1: seq=107 ttl=255 time=182064.671 ms
64 bytes from 1.1.1.1: seq=108 ttl=255 time=181202.581 ms
64 bytes from 1.1.1.1: seq=109 ttl=255 time=180341.358 ms
64 bytes from 1.1.1.1: seq=110 ttl=255 time=179483.193 ms
64 bytes from 1.1.1.1: seq=111 ttl=255 time=178620.772 ms
64 bytes from 1.1.1.1: seq=112 ttl=255 time=177762.640 ms
64 bytes from 1.1.1.1: seq=113 ttl=255 time=176899.436 ms
64 bytes from 1.1.1.1: seq=114 ttl=255 time=176042.034 ms
64 bytes from 1.1.1.1: seq=115 ttl=255 time=175178.675 ms
64 bytes from 1.1.1.1: seq=116 ttl=255 time=174319.242 ms
64 bytes from 1.1.1.1: seq=117 ttl=255 time=173457.937 ms
64 bytes from 1.1.1.1: seq=118 ttl=255 time=172597.405 ms
64 bytes from 1.1.1.1: seq=119 ttl=255 time=171740.272 ms
64 bytes from 1.1.1.1: seq=120 ttl=255 time=170878.897 ms
64 bytes from 1.1.1.1: seq=121 ttl=255 time=170017.614 ms
64 bytes from 1.1.1.1: seq=122 ttl=255 time=169157.162 ms
64 bytes from 1.1.1.1: seq=123 ttl=255 time=168295.214 ms
64 bytes from 1.1.1.1: seq=124 ttl=255 time=167437.646 ms
64 bytes from 1.1.1.1: seq=125 ttl=255 time=166571.517 ms
64 bytes from 1.1.1.1: seq=126 ttl=255 time=165715.434 ms
64 bytes from 1.1.1.1: seq=127 ttl=255 time=164850.061 ms
64 bytes from 1.1.1.1: seq=128 ttl=255 time=163989.448 ms
64 bytes from 1.1.1.1: seq=129 ttl=255 time=163132.940 ms
64 bytes from 1.1.1.1: seq=130 ttl=255 time=162268.721 ms
64 bytes from 1.1.1.1: seq=131 ttl=255 time=161409.818 ms
64 bytes from 1.1.1.1: seq=132 ttl=255 time=160550.705 ms
64 bytes from 1.1.1.1: seq=133 ttl=255 time=159687.290 ms
64 bytes from 1.1.1.1: seq=134 ttl=255 time=158826.802 ms
64 bytes from 1.1.1.1: seq=135 ttl=255 time=157966.914 ms
64 bytes from 1.1.1.1: seq=136 ttl=255 time=157109.391 ms
64 bytes from 1.1.1.1: seq=137 ttl=255 time=156248.113 ms
64 bytes from 1.1.1.1: seq=138 ttl=255 time=155386.425 ms
64 bytes from 1.1.1.1: seq=139 ttl=255 time=154526.799 ms
64 bytes from 1.1.1.1: seq=140 ttl=255 time=153666.778 ms
64 bytes from 1.1.1.1: seq=141 ttl=255 time=152804.089 ms
64 bytes from 1.1.1.1: seq=142 ttl=255 time=151942.933 ms
64 bytes from 1.1.1.1: seq=143 ttl=255 time=151084.241 ms
64 bytes from 1.1.1.1: seq=144 ttl=255 time=150224.787 ms
64 bytes from 1.1.1.1: seq=145 ttl=255 time=149364.806 ms
64 bytes from 1.1.1.1: seq=146 ttl=255 time=148505.286 ms
64 bytes from 1.1.1.1: seq=147 ttl=255 time=147641.848 ms
64 bytes from 1.1.1.1: seq=148 ttl=255 time=146781.578 ms
64 bytes from 1.1.1.1: seq=149 ttl=255 time=145923.483 ms
64 bytes from 1.1.1.1: seq=150 ttl=255 time=145060.536 ms
64 bytes from 1.1.1.1: seq=151 ttl=255 time=144203.806 ms
64 bytes from 1.1.1.1: seq=152 ttl=255 time=143342.543 ms
64 bytes from 1.1.1.1: seq=153 ttl=255 time=142482.023 ms
64 bytes from 1.1.1.1: seq=154 ttl=255 time=141618.118 ms
64 bytes from 1.1.1.1: seq=155 ttl=255 time=140757.069 ms
64 bytes from 1.1.1.1: seq=156 ttl=255 time=139901.244 ms
64 bytes from 1.1.1.1: seq=157 ttl=255 time=139036.518 ms
64 bytes from 1.1.1.1: seq=158 ttl=255 time=138179.396 ms
64 bytes from 1.1.1.1: seq=159 ttl=255 time=137318.933 ms
64 bytes from 1.1.1.1: seq=160 ttl=255 time=136455.065 ms
64 bytes from 1.1.1.1: seq=161 ttl=255 time=135597.834 ms
64 bytes from 1.1.1.1: seq=162 ttl=255 time=134734.172 ms
64 bytes from 1.1.1.1: seq=163 ttl=255 time=133874.764 ms
64 bytes from 1.1.1.1: seq=164 ttl=255 time=133014.167 ms
64 bytes from 1.1.1.1: seq=165 ttl=255 time=132293.203 ms
64 bytes from 1.1.1.1: seq=166 ttl=255 time=131432.634 ms
64 bytes from 1.1.1.1: seq=167 ttl=255 time=130575.128 ms
64 bytes from 1.1.1.1: seq=168 ttl=255 time=129711.740 ms
64 bytes from 1.1.1.1: seq=169 ttl=255 time=128854.663 ms
64 bytes from 1.1.1.1: seq=170 ttl=255 time=127993.459 ms
64 bytes from 1.1.1.1: seq=171 ttl=255 time=127132.200 ms
64 bytes from 1.1.1.1: seq=172 ttl=255 time=126270.555 ms
64 bytes from 1.1.1.1: seq=173 ttl=255 time=125410.323 ms
64 bytes from 1.1.1.1: seq=174 ttl=255 time=124551.808 ms
64 bytes from 1.1.1.1: seq=175 ttl=255 time=123691.455 ms
64 bytes from 1.1.1.1: seq=176 ttl=255 time=122832.185 ms
64 bytes from 1.1.1.1: seq=177 ttl=255 time=121971.919 ms
64 bytes from 1.1.1.1: seq=178 ttl=255 time=121111.333 ms
64 bytes from 1.1.1.1: seq=179 ttl=255 time=120251.129 ms
64 bytes from 1.1.1.1: seq=180 ttl=255 time=119389.873 ms
64 bytes from 1.1.1.1: seq=181 ttl=255 time=118526.502 ms
64 bytes from 1.1.1.1: seq=182 ttl=255 time=117669.644 ms
64 bytes from 1.1.1.1: seq=183 ttl=255 time=116805.400 ms
64 bytes from 1.1.1.1: seq=184 ttl=255 time=115947.994 ms
64 bytes from 1.1.1.1: seq=185 ttl=255 time=115088.160 ms
64 bytes from 1.1.1.1: seq=186 ttl=255 time=114224.866 ms
64 bytes from 1.1.1.1: seq=187 ttl=255 time=113363.582 ms
64 bytes from 1.1.1.1: seq=188 ttl=255 time=112503.397 ms
64 bytes from 1.1.1.1: seq=189 ttl=255 time=111645.410 ms
64 bytes from 1.1.1.1: seq=190 ttl=255 time=110784.811 ms
64 bytes from 1.1.1.1: seq=191 ttl=255 time=109924.576 ms
64 bytes from 1.1.1.1: seq=192 ttl=255 time=109064.758 ms
64 bytes from 1.1.1.1: seq=193 ttl=255 time=108200.506 ms
64 bytes from 1.1.1.1: seq=194 ttl=255 time=107343.300 ms
64 bytes from 1.1.1.1: seq=195 ttl=255 time=106480.522 ms
64 bytes from 1.1.1.1: seq=196 ttl=255 time=105619.641 ms
64 bytes from 1.1.1.1: seq=197 ttl=255 time=104761.399 ms
64 bytes from 1.1.1.1: seq=198 ttl=255 time=103969.579 ms
64 bytes from 1.1.1.1: seq=199 ttl=255 time=103111.232 ms
64 bytes from 1.1.1.1: seq=200 ttl=255 time=102246.894 ms
64 bytes from 1.1.1.1: seq=201 ttl=255 time=101389.902 ms
64 bytes from 1.1.1.1: seq=202 ttl=255 time=100526.468 ms
64 bytes from 1.1.1.1: seq=203 ttl=255 time=99668.868 ms
64 bytes from 1.1.1.1: seq=204 ttl=255 time=98806.105 ms
64 bytes from 1.1.1.1: seq=205 ttl=255 time=97944.330 ms
64 bytes from 1.1.1.1: seq=206 ttl=255 time=97087.624 ms
64 bytes from 1.1.1.1: seq=207 ttl=255 time=96223.053 ms
64 bytes from 1.1.1.1: seq=208 ttl=255 time=95365.559 ms
64 bytes from 1.1.1.1: seq=209 ttl=255 time=94505.304 ms
64 bytes from 1.1.1.1: seq=210 ttl=255 time=93642.694 ms
64 bytes from 1.1.1.1: seq=211 ttl=255 time=92784.797 ms
64 bytes from 1.1.1.1: seq=212 ttl=255 time=91921.391 ms
64 bytes from 1.1.1.1: seq=213 ttl=255 time=91062.480 ms
64 bytes from 1.1.1.1: seq=214 ttl=255 time=90200.766 ms
64 bytes from 1.1.1.1: seq=215 ttl=255 time=89412.301 ms
64 bytes from 1.1.1.1: seq=216 ttl=255 time=88550.975 ms
64 bytes from 1.1.1.1: seq=217 ttl=255 time=87692.942 ms
64 bytes from 1.1.1.1: seq=218 ttl=255 time=86832.202 ms
64 bytes from 1.1.1.1: seq=219 ttl=255 time=85968.589 ms
64 bytes from 1.1.1.1: seq=220 ttl=255 time=85112.144 ms
64 bytes from 1.1.1.1: seq=221 ttl=255 time=84247.779 ms
64 bytes from 1.1.1.1: seq=222 ttl=255 time=83390.314 ms
64 bytes from 1.1.1.1: seq=223 ttl=255 time=82806.827 ms
64 bytes from 1.1.1.1: seq=224 ttl=255 time=82088.299 ms
64 bytes from 1.1.1.1: seq=225 ttl=255 time=81368.823 ms
64 bytes from 1.1.1.1: seq=226 ttl=255 time=80788.159 ms
64 bytes from 1.1.1.1: seq=227 ttl=255 time=79925.690 ms
64 bytes from 1.1.1.1: seq=228 ttl=255 time=79207.165 ms
64 bytes from 1.1.1.1: seq=229 ttl=255 time=78347.362 ms
64 bytes from 1.1.1.1: seq=230 ttl=255 time=77623.402 ms
64 bytes from 1.1.1.1: seq=231 ttl=255 time=76764.931 ms
64 bytes from 1.1.1.1: seq=232 ttl=255 time=90325.709 ms
64 bytes from 1.1.1.1: seq=233 ttl=255 time=90165.373 ms
64 bytes from 1.1.1.1: seq=234 ttl=255 time=99175.571 ms
64 bytes from 1.1.1.1: seq=235 ttl=255 time=99155.438 ms
64 bytes from 1.1.1.1: seq=236 ttl=255 time=99134.542 ms
64 bytes from 1.1.1.1: seq=237 ttl=255 time=102120.961 ms
64 bytes from 1.1.1.1: seq=238 ttl=255 time=104134.035 ms
64 bytes from 1.1.1.1: seq=239 ttl=255 time=115171.447 ms
64 bytes from 1.1.1.1: seq=240 ttl=255 time=116133.420 ms
64 bytes from 1.1.1.1: seq=241 ttl=255 time=116179.866 ms
64 bytes from 1.1.1.1: seq=242 ttl=255 time=118191.911 ms
64 bytes from 1.1.1.1: seq=243 ttl=255 time=118172.226 ms
64 bytes from 1.1.1.1: seq=244 ttl=255 time=118151.148 ms
64 bytes from 1.1.1.1: seq=245 ttl=255 time=118201.221 ms
64 bytes from 1.1.1.1: seq=246 ttl=255 time=118180.112 ms
64 bytes from 1.1.1.1: seq=247 ttl=255 time=118159.576 ms
64 bytes from 1.1.1.1: seq=248 ttl=255 time=118138.773 ms
64 bytes from 1.1.1.1: seq=249 ttl=255 time=118185.635 ms
64 bytes from 1.1.1.1: seq=250 ttl=255 time=120195.343 ms
64 bytes from 1.1.1.1: seq=251 ttl=255 time=121157.762 ms
64 bytes from 1.1.1.1: seq=252 ttl=255 time=122187.400 ms
64 bytes from 1.1.1.1: seq=253 ttl=255 time=122168.372 ms
64 bytes from 1.1.1.1: seq=254 ttl=255 time=123196.818 ms
64 bytes from 1.1.1.1: seq=255 ttl=255 time=123172.538 ms
64 bytes from 1.1.1.1: seq=256 ttl=255 time=123153.181 ms
64 bytes from 1.1.1.1: seq=257 ttl=255 time=123201.942 ms
64 bytes from 1.1.1.1: seq=258 ttl=255 time=123181.665 ms
64 bytes from 1.1.1.1: seq=259 ttl=255 time=123162.299 ms
64 bytes from 1.1.1.1: seq=260 ttl=255 time=128183.902 ms
64 bytes from 1.1.1.1: seq=261 ttl=255 time=128163.238 ms
64 bytes from 1.1.1.1: seq=262 ttl=255 time=128141.204 ms
64 bytes from 1.1.1.1: seq=263 ttl=255 time=128189.806 ms
64 bytes from 1.1.1.1: seq=264 ttl=255 time=128169.727 ms
64 bytes from 1.1.1.1: seq=265 ttl=255 time=128149.188 ms
64 bytes from 1.1.1.1: seq=267 ttl=255 time=127198.048 ms
64 bytes from 1.1.1.1: seq=268 ttl=255 time=128157.349 ms
64 bytes from 1.1.1.1: seq=269 ttl=255 time=128208.249 ms
64 bytes from 1.1.1.1: seq=270 ttl=255 time=130148.205 ms
64 bytes from 1.1.1.1: seq=271 ttl=255 time=131177.226 ms
64 bytes from 1.1.1.1: seq=272 ttl=255 time=131158.283 ms
64 bytes from 1.1.1.1: seq=273 ttl=255 time=141149.229 ms
64 bytes from 1.1.1.1: seq=274 ttl=255 time=141198.959 ms
64 bytes from 1.1.1.1: seq=275 ttl=255 time=142156.598 ms
64 bytes from 1.1.1.1: seq=276 ttl=255 time=142204.986 ms
64 bytes from 1.1.1.1: seq=277 ttl=255 time=152197.204 ms
64 bytes from 1.1.1.1: seq=278 ttl=255 time=153154.130 ms
64 bytes from 1.1.1.1: seq=279 ttl=255 time=153204.573 ms
64 bytes from 1.1.1.1: seq=280 ttl=255 time=153183.180 ms
64 bytes from 1.1.1.1: seq=281 ttl=255 time=153162.962 ms
64 bytes from 1.1.1.1: seq=282 ttl=255 time=153214.471 ms
64 bytes from 1.1.1.1: seq=283 ttl=255 time=153192.247 ms
64 bytes from 1.1.1.1: seq=284 ttl=255 time=153175.152 ms
64 bytes from 1.1.1.1: seq=285 ttl=255 time=154204.691 ms
64 bytes from 1.1.1.1: seq=286 ttl=255 time=154181.609 ms
64 bytes from 1.1.1.1: seq=287 ttl=255 time=154160.863 ms
64 bytes from 1.1.1.1: seq=288 ttl=255 time=154212.726 ms
64 bytes from 1.1.1.1: seq=289 ttl=255 time=154188.385 ms
64 bytes from 1.1.1.1: seq=290 ttl=255 time=154168.711 ms
64 bytes from 1.1.1.1: seq=291 ttl=255 time=154217.619 ms
64 bytes from 1.1.1.1: seq=292 ttl=255 time=155179.417 ms
64 bytes from 1.1.1.1: seq=293 ttl=255 time=155227.907 ms
64 bytes from 1.1.1.1: seq=294 ttl=255 time=155209.354 ms
64 bytes from 1.1.1.1: seq=295 ttl=255 time=155189.392 ms
64 bytes from 1.1.1.1: seq=296 ttl=255 time=159158.870 ms
64 bytes from 1.1.1.1: seq=297 ttl=255 time=159208.869 ms
64 bytes from 1.1.1.1: seq=298 ttl=255 time=159186.837 ms
64 bytes from 1.1.1.1: seq=299 ttl=255 time=159165.503 ms
64 bytes from 1.1.1.1: seq=300 ttl=255 time=161175.966 ms
64 bytes from 1.1.1.1: seq=301 ttl=255 time=161227.173 ms
64 bytes from 1.1.1.1: seq=302 ttl=255 time=161203.910 ms
64 bytes from 1.1.1.1: seq=303 ttl=255 time=161186.309 ms
64 bytes from 1.1.1.1: seq=304 ttl=255 time=161164.602 ms
64 bytes from 1.1.1.1: seq=305 ttl=255 time=161215.886 ms
64 bytes from 1.1.1.1: seq=306 ttl=255 time=161193.471 ms
64 bytes from 1.1.1.1: seq=307 ttl=255 time=161172.955 ms
64 bytes from 1.1.1.1: seq=308 ttl=255 time=161224.986 ms
64 bytes from 1.1.1.1: seq=309 ttl=255 time=161202.462 ms
64 bytes from 1.1.1.1: seq=310 ttl=255 time=166224.560 ms
64 bytes from 1.1.1.1: seq=311 ttl=255 time=170194.436 ms
64 bytes from 1.1.1.1: seq=312 ttl=255 time=170170.655 ms
64 bytes from 1.1.1.1: seq=313 ttl=255 time=173230.698 ms
64 bytes from 1.1.1.1: seq=314 ttl=255 time=174192.909 ms
64 bytes from 1.1.1.1: seq=315 ttl=255 time=174238.925 ms
64 bytes from 1.1.1.1: seq=316 ttl=255 time=174221.349 ms
64 bytes from 1.1.1.1: seq=317 ttl=255 time=174201.048 ms
64 bytes from 1.1.1.1: seq=318 ttl=255 time=176210.741 ms
64 bytes from 1.1.1.1: seq=319 ttl=255 time=178216.730 ms
64 bytes from 1.1.1.1: seq=320 ttl=255 time=178197.136 ms
64 bytes from 1.1.1.1: seq=321 ttl=255 time=195256.657 ms
64 bytes from 1.1.1.1: seq=322 ttl=255 time=203216.083 ms
64 bytes from 1.1.1.1: seq=323 ttl=255 time=211248.427 ms
64 bytes from 1.1.1.1: seq=324 ttl=255 time=212208.381 ms

I've tested this with sturgeon and sparrow. Since you mentioned dbus spam I also tried an older version (97694fe) but that seems to perform similarly.e

@I-asked
Copy link
Author

I-asked commented Aug 16, 2024

@I-asked I've been testing your PRs, great work! But I'm wondering what kind of performance we can expect? Currently pinging seems to take some time:

# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=99 ttl=255 time=188805.175 ms
64 bytes from 1.1.1.1: seq=100 ttl=255 time=187948.871 ms
64 bytes from 1.1.1.1: seq=101 ttl=255 time=187224.688 ms
64 bytes from 1.1.1.1: seq=102 ttl=255 time=186367.484 ms
64 bytes from 1.1.1.1: seq=103 ttl=255 time=185504.062 ms
64 bytes from 1.1.1.1: seq=104 ttl=255 time=184644.709 ms
64 bytes from 1.1.1.1: seq=105 ttl=255 time=183783.534 ms
64 bytes from 1.1.1.1: seq=106 ttl=255 time=182925.377 ms
64 bytes from 1.1.1.1: seq=107 ttl=255 time=182064.671 ms
64 bytes from 1.1.1.1: seq=108 ttl=255 time=181202.581 ms
64 bytes from 1.1.1.1: seq=109 ttl=255 time=180341.358 ms
64 bytes from 1.1.1.1: seq=110 ttl=255 time=179483.193 ms
64 bytes from 1.1.1.1: seq=111 ttl=255 time=178620.772 ms
64 bytes from 1.1.1.1: seq=112 ttl=255 time=177762.640 ms
64 bytes from 1.1.1.1: seq=113 ttl=255 time=176899.436 ms
64 bytes from 1.1.1.1: seq=114 ttl=255 time=176042.034 ms
64 bytes from 1.1.1.1: seq=115 ttl=255 time=175178.675 ms
64 bytes from 1.1.1.1: seq=116 ttl=255 time=174319.242 ms
64 bytes from 1.1.1.1: seq=117 ttl=255 time=173457.937 ms
64 bytes from 1.1.1.1: seq=118 ttl=255 time=172597.405 ms
64 bytes from 1.1.1.1: seq=119 ttl=255 time=171740.272 ms
64 bytes from 1.1.1.1: seq=120 ttl=255 time=170878.897 ms
64 bytes from 1.1.1.1: seq=121 ttl=255 time=170017.614 ms
64 bytes from 1.1.1.1: seq=122 ttl=255 time=169157.162 ms
64 bytes from 1.1.1.1: seq=123 ttl=255 time=168295.214 ms
64 bytes from 1.1.1.1: seq=124 ttl=255 time=167437.646 ms
64 bytes from 1.1.1.1: seq=125 ttl=255 time=166571.517 ms
64 bytes from 1.1.1.1: seq=126 ttl=255 time=165715.434 ms
64 bytes from 1.1.1.1: seq=127 ttl=255 time=164850.061 ms
64 bytes from 1.1.1.1: seq=128 ttl=255 time=163989.448 ms
64 bytes from 1.1.1.1: seq=129 ttl=255 time=163132.940 ms
64 bytes from 1.1.1.1: seq=130 ttl=255 time=162268.721 ms
64 bytes from 1.1.1.1: seq=131 ttl=255 time=161409.818 ms
64 bytes from 1.1.1.1: seq=132 ttl=255 time=160550.705 ms
64 bytes from 1.1.1.1: seq=133 ttl=255 time=159687.290 ms
64 bytes from 1.1.1.1: seq=134 ttl=255 time=158826.802 ms
64 bytes from 1.1.1.1: seq=135 ttl=255 time=157966.914 ms
64 bytes from 1.1.1.1: seq=136 ttl=255 time=157109.391 ms
64 bytes from 1.1.1.1: seq=137 ttl=255 time=156248.113 ms
64 bytes from 1.1.1.1: seq=138 ttl=255 time=155386.425 ms
64 bytes from 1.1.1.1: seq=139 ttl=255 time=154526.799 ms
64 bytes from 1.1.1.1: seq=140 ttl=255 time=153666.778 ms
64 bytes from 1.1.1.1: seq=141 ttl=255 time=152804.089 ms
64 bytes from 1.1.1.1: seq=142 ttl=255 time=151942.933 ms
64 bytes from 1.1.1.1: seq=143 ttl=255 time=151084.241 ms
64 bytes from 1.1.1.1: seq=144 ttl=255 time=150224.787 ms
64 bytes from 1.1.1.1: seq=145 ttl=255 time=149364.806 ms
64 bytes from 1.1.1.1: seq=146 ttl=255 time=148505.286 ms
64 bytes from 1.1.1.1: seq=147 ttl=255 time=147641.848 ms
64 bytes from 1.1.1.1: seq=148 ttl=255 time=146781.578 ms
64 bytes from 1.1.1.1: seq=149 ttl=255 time=145923.483 ms
64 bytes from 1.1.1.1: seq=150 ttl=255 time=145060.536 ms
64 bytes from 1.1.1.1: seq=151 ttl=255 time=144203.806 ms
64 bytes from 1.1.1.1: seq=152 ttl=255 time=143342.543 ms
64 bytes from 1.1.1.1: seq=153 ttl=255 time=142482.023 ms
64 bytes from 1.1.1.1: seq=154 ttl=255 time=141618.118 ms
64 bytes from 1.1.1.1: seq=155 ttl=255 time=140757.069 ms
64 bytes from 1.1.1.1: seq=156 ttl=255 time=139901.244 ms
64 bytes from 1.1.1.1: seq=157 ttl=255 time=139036.518 ms
64 bytes from 1.1.1.1: seq=158 ttl=255 time=138179.396 ms
64 bytes from 1.1.1.1: seq=159 ttl=255 time=137318.933 ms
64 bytes from 1.1.1.1: seq=160 ttl=255 time=136455.065 ms
64 bytes from 1.1.1.1: seq=161 ttl=255 time=135597.834 ms
64 bytes from 1.1.1.1: seq=162 ttl=255 time=134734.172 ms
64 bytes from 1.1.1.1: seq=163 ttl=255 time=133874.764 ms
64 bytes from 1.1.1.1: seq=164 ttl=255 time=133014.167 ms
64 bytes from 1.1.1.1: seq=165 ttl=255 time=132293.203 ms
64 bytes from 1.1.1.1: seq=166 ttl=255 time=131432.634 ms
64 bytes from 1.1.1.1: seq=167 ttl=255 time=130575.128 ms
64 bytes from 1.1.1.1: seq=168 ttl=255 time=129711.740 ms
64 bytes from 1.1.1.1: seq=169 ttl=255 time=128854.663 ms
64 bytes from 1.1.1.1: seq=170 ttl=255 time=127993.459 ms
64 bytes from 1.1.1.1: seq=171 ttl=255 time=127132.200 ms
64 bytes from 1.1.1.1: seq=172 ttl=255 time=126270.555 ms
64 bytes from 1.1.1.1: seq=173 ttl=255 time=125410.323 ms
64 bytes from 1.1.1.1: seq=174 ttl=255 time=124551.808 ms
64 bytes from 1.1.1.1: seq=175 ttl=255 time=123691.455 ms
64 bytes from 1.1.1.1: seq=176 ttl=255 time=122832.185 ms
64 bytes from 1.1.1.1: seq=177 ttl=255 time=121971.919 ms
64 bytes from 1.1.1.1: seq=178 ttl=255 time=121111.333 ms
64 bytes from 1.1.1.1: seq=179 ttl=255 time=120251.129 ms
64 bytes from 1.1.1.1: seq=180 ttl=255 time=119389.873 ms
64 bytes from 1.1.1.1: seq=181 ttl=255 time=118526.502 ms
64 bytes from 1.1.1.1: seq=182 ttl=255 time=117669.644 ms
64 bytes from 1.1.1.1: seq=183 ttl=255 time=116805.400 ms
64 bytes from 1.1.1.1: seq=184 ttl=255 time=115947.994 ms
64 bytes from 1.1.1.1: seq=185 ttl=255 time=115088.160 ms
64 bytes from 1.1.1.1: seq=186 ttl=255 time=114224.866 ms
64 bytes from 1.1.1.1: seq=187 ttl=255 time=113363.582 ms
64 bytes from 1.1.1.1: seq=188 ttl=255 time=112503.397 ms
64 bytes from 1.1.1.1: seq=189 ttl=255 time=111645.410 ms
64 bytes from 1.1.1.1: seq=190 ttl=255 time=110784.811 ms
64 bytes from 1.1.1.1: seq=191 ttl=255 time=109924.576 ms
64 bytes from 1.1.1.1: seq=192 ttl=255 time=109064.758 ms
64 bytes from 1.1.1.1: seq=193 ttl=255 time=108200.506 ms
64 bytes from 1.1.1.1: seq=194 ttl=255 time=107343.300 ms
64 bytes from 1.1.1.1: seq=195 ttl=255 time=106480.522 ms
64 bytes from 1.1.1.1: seq=196 ttl=255 time=105619.641 ms
64 bytes from 1.1.1.1: seq=197 ttl=255 time=104761.399 ms
64 bytes from 1.1.1.1: seq=198 ttl=255 time=103969.579 ms
64 bytes from 1.1.1.1: seq=199 ttl=255 time=103111.232 ms
64 bytes from 1.1.1.1: seq=200 ttl=255 time=102246.894 ms
64 bytes from 1.1.1.1: seq=201 ttl=255 time=101389.902 ms
64 bytes from 1.1.1.1: seq=202 ttl=255 time=100526.468 ms
64 bytes from 1.1.1.1: seq=203 ttl=255 time=99668.868 ms
64 bytes from 1.1.1.1: seq=204 ttl=255 time=98806.105 ms
64 bytes from 1.1.1.1: seq=205 ttl=255 time=97944.330 ms
64 bytes from 1.1.1.1: seq=206 ttl=255 time=97087.624 ms
64 bytes from 1.1.1.1: seq=207 ttl=255 time=96223.053 ms
64 bytes from 1.1.1.1: seq=208 ttl=255 time=95365.559 ms
64 bytes from 1.1.1.1: seq=209 ttl=255 time=94505.304 ms
64 bytes from 1.1.1.1: seq=210 ttl=255 time=93642.694 ms
64 bytes from 1.1.1.1: seq=211 ttl=255 time=92784.797 ms
64 bytes from 1.1.1.1: seq=212 ttl=255 time=91921.391 ms
64 bytes from 1.1.1.1: seq=213 ttl=255 time=91062.480 ms
64 bytes from 1.1.1.1: seq=214 ttl=255 time=90200.766 ms
64 bytes from 1.1.1.1: seq=215 ttl=255 time=89412.301 ms
64 bytes from 1.1.1.1: seq=216 ttl=255 time=88550.975 ms
64 bytes from 1.1.1.1: seq=217 ttl=255 time=87692.942 ms
64 bytes from 1.1.1.1: seq=218 ttl=255 time=86832.202 ms
64 bytes from 1.1.1.1: seq=219 ttl=255 time=85968.589 ms
64 bytes from 1.1.1.1: seq=220 ttl=255 time=85112.144 ms
64 bytes from 1.1.1.1: seq=221 ttl=255 time=84247.779 ms
64 bytes from 1.1.1.1: seq=222 ttl=255 time=83390.314 ms
64 bytes from 1.1.1.1: seq=223 ttl=255 time=82806.827 ms
64 bytes from 1.1.1.1: seq=224 ttl=255 time=82088.299 ms
64 bytes from 1.1.1.1: seq=225 ttl=255 time=81368.823 ms
64 bytes from 1.1.1.1: seq=226 ttl=255 time=80788.159 ms
64 bytes from 1.1.1.1: seq=227 ttl=255 time=79925.690 ms
64 bytes from 1.1.1.1: seq=228 ttl=255 time=79207.165 ms
64 bytes from 1.1.1.1: seq=229 ttl=255 time=78347.362 ms
64 bytes from 1.1.1.1: seq=230 ttl=255 time=77623.402 ms
64 bytes from 1.1.1.1: seq=231 ttl=255 time=76764.931 ms
64 bytes from 1.1.1.1: seq=232 ttl=255 time=90325.709 ms
64 bytes from 1.1.1.1: seq=233 ttl=255 time=90165.373 ms
64 bytes from 1.1.1.1: seq=234 ttl=255 time=99175.571 ms
64 bytes from 1.1.1.1: seq=235 ttl=255 time=99155.438 ms
64 bytes from 1.1.1.1: seq=236 ttl=255 time=99134.542 ms
64 bytes from 1.1.1.1: seq=237 ttl=255 time=102120.961 ms
64 bytes from 1.1.1.1: seq=238 ttl=255 time=104134.035 ms
64 bytes from 1.1.1.1: seq=239 ttl=255 time=115171.447 ms
64 bytes from 1.1.1.1: seq=240 ttl=255 time=116133.420 ms
64 bytes from 1.1.1.1: seq=241 ttl=255 time=116179.866 ms
64 bytes from 1.1.1.1: seq=242 ttl=255 time=118191.911 ms
64 bytes from 1.1.1.1: seq=243 ttl=255 time=118172.226 ms
64 bytes from 1.1.1.1: seq=244 ttl=255 time=118151.148 ms
64 bytes from 1.1.1.1: seq=245 ttl=255 time=118201.221 ms
64 bytes from 1.1.1.1: seq=246 ttl=255 time=118180.112 ms
64 bytes from 1.1.1.1: seq=247 ttl=255 time=118159.576 ms
64 bytes from 1.1.1.1: seq=248 ttl=255 time=118138.773 ms
64 bytes from 1.1.1.1: seq=249 ttl=255 time=118185.635 ms
64 bytes from 1.1.1.1: seq=250 ttl=255 time=120195.343 ms
64 bytes from 1.1.1.1: seq=251 ttl=255 time=121157.762 ms
64 bytes from 1.1.1.1: seq=252 ttl=255 time=122187.400 ms
64 bytes from 1.1.1.1: seq=253 ttl=255 time=122168.372 ms
64 bytes from 1.1.1.1: seq=254 ttl=255 time=123196.818 ms
64 bytes from 1.1.1.1: seq=255 ttl=255 time=123172.538 ms
64 bytes from 1.1.1.1: seq=256 ttl=255 time=123153.181 ms
64 bytes from 1.1.1.1: seq=257 ttl=255 time=123201.942 ms
64 bytes from 1.1.1.1: seq=258 ttl=255 time=123181.665 ms
64 bytes from 1.1.1.1: seq=259 ttl=255 time=123162.299 ms
64 bytes from 1.1.1.1: seq=260 ttl=255 time=128183.902 ms
64 bytes from 1.1.1.1: seq=261 ttl=255 time=128163.238 ms
64 bytes from 1.1.1.1: seq=262 ttl=255 time=128141.204 ms
64 bytes from 1.1.1.1: seq=263 ttl=255 time=128189.806 ms
64 bytes from 1.1.1.1: seq=264 ttl=255 time=128169.727 ms
64 bytes from 1.1.1.1: seq=265 ttl=255 time=128149.188 ms
64 bytes from 1.1.1.1: seq=267 ttl=255 time=127198.048 ms
64 bytes from 1.1.1.1: seq=268 ttl=255 time=128157.349 ms
64 bytes from 1.1.1.1: seq=269 ttl=255 time=128208.249 ms
64 bytes from 1.1.1.1: seq=270 ttl=255 time=130148.205 ms
64 bytes from 1.1.1.1: seq=271 ttl=255 time=131177.226 ms
64 bytes from 1.1.1.1: seq=272 ttl=255 time=131158.283 ms
64 bytes from 1.1.1.1: seq=273 ttl=255 time=141149.229 ms
64 bytes from 1.1.1.1: seq=274 ttl=255 time=141198.959 ms
64 bytes from 1.1.1.1: seq=275 ttl=255 time=142156.598 ms
64 bytes from 1.1.1.1: seq=276 ttl=255 time=142204.986 ms
64 bytes from 1.1.1.1: seq=277 ttl=255 time=152197.204 ms
64 bytes from 1.1.1.1: seq=278 ttl=255 time=153154.130 ms
64 bytes from 1.1.1.1: seq=279 ttl=255 time=153204.573 ms
64 bytes from 1.1.1.1: seq=280 ttl=255 time=153183.180 ms
64 bytes from 1.1.1.1: seq=281 ttl=255 time=153162.962 ms
64 bytes from 1.1.1.1: seq=282 ttl=255 time=153214.471 ms
64 bytes from 1.1.1.1: seq=283 ttl=255 time=153192.247 ms
64 bytes from 1.1.1.1: seq=284 ttl=255 time=153175.152 ms
64 bytes from 1.1.1.1: seq=285 ttl=255 time=154204.691 ms
64 bytes from 1.1.1.1: seq=286 ttl=255 time=154181.609 ms
64 bytes from 1.1.1.1: seq=287 ttl=255 time=154160.863 ms
64 bytes from 1.1.1.1: seq=288 ttl=255 time=154212.726 ms
64 bytes from 1.1.1.1: seq=289 ttl=255 time=154188.385 ms
64 bytes from 1.1.1.1: seq=290 ttl=255 time=154168.711 ms
64 bytes from 1.1.1.1: seq=291 ttl=255 time=154217.619 ms
64 bytes from 1.1.1.1: seq=292 ttl=255 time=155179.417 ms
64 bytes from 1.1.1.1: seq=293 ttl=255 time=155227.907 ms
64 bytes from 1.1.1.1: seq=294 ttl=255 time=155209.354 ms
64 bytes from 1.1.1.1: seq=295 ttl=255 time=155189.392 ms
64 bytes from 1.1.1.1: seq=296 ttl=255 time=159158.870 ms
64 bytes from 1.1.1.1: seq=297 ttl=255 time=159208.869 ms
64 bytes from 1.1.1.1: seq=298 ttl=255 time=159186.837 ms
64 bytes from 1.1.1.1: seq=299 ttl=255 time=159165.503 ms
64 bytes from 1.1.1.1: seq=300 ttl=255 time=161175.966 ms
64 bytes from 1.1.1.1: seq=301 ttl=255 time=161227.173 ms
64 bytes from 1.1.1.1: seq=302 ttl=255 time=161203.910 ms
64 bytes from 1.1.1.1: seq=303 ttl=255 time=161186.309 ms
64 bytes from 1.1.1.1: seq=304 ttl=255 time=161164.602 ms
64 bytes from 1.1.1.1: seq=305 ttl=255 time=161215.886 ms
64 bytes from 1.1.1.1: seq=306 ttl=255 time=161193.471 ms
64 bytes from 1.1.1.1: seq=307 ttl=255 time=161172.955 ms
64 bytes from 1.1.1.1: seq=308 ttl=255 time=161224.986 ms
64 bytes from 1.1.1.1: seq=309 ttl=255 time=161202.462 ms
64 bytes from 1.1.1.1: seq=310 ttl=255 time=166224.560 ms
64 bytes from 1.1.1.1: seq=311 ttl=255 time=170194.436 ms
64 bytes from 1.1.1.1: seq=312 ttl=255 time=170170.655 ms
64 bytes from 1.1.1.1: seq=313 ttl=255 time=173230.698 ms
64 bytes from 1.1.1.1: seq=314 ttl=255 time=174192.909 ms
64 bytes from 1.1.1.1: seq=315 ttl=255 time=174238.925 ms
64 bytes from 1.1.1.1: seq=316 ttl=255 time=174221.349 ms
64 bytes from 1.1.1.1: seq=317 ttl=255 time=174201.048 ms
64 bytes from 1.1.1.1: seq=318 ttl=255 time=176210.741 ms
64 bytes from 1.1.1.1: seq=319 ttl=255 time=178216.730 ms
64 bytes from 1.1.1.1: seq=320 ttl=255 time=178197.136 ms
64 bytes from 1.1.1.1: seq=321 ttl=255 time=195256.657 ms
64 bytes from 1.1.1.1: seq=322 ttl=255 time=203216.083 ms
64 bytes from 1.1.1.1: seq=323 ttl=255 time=211248.427 ms
64 bytes from 1.1.1.1: seq=324 ttl=255 time=212208.381 ms

I've tested this with sturgeon and sparrow. Since you mentioned dbus spam I also tried an older version (97694fe) but that seems to perform similarly.e

Oh my… that is very weird… This should not happen… I can't work on this right now, but the network connection worked very well last time I checked…
Could you try a different Android phone?

@MagneFire
Copy link
Member

@I-asked I've been testing your PRs, great work! But I'm wondering what kind of performance we can expect? Currently pinging seems to take some time:

# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=99 ttl=255 time=188805.175 ms
64 bytes from 1.1.1.1: seq=100 ttl=255 time=187948.871 ms
64 bytes from 1.1.1.1: seq=101 ttl=255 time=187224.688 ms
64 bytes from 1.1.1.1: seq=102 ttl=255 time=186367.484 ms
64 bytes from 1.1.1.1: seq=103 ttl=255 time=185504.062 ms
64 bytes from 1.1.1.1: seq=104 ttl=255 time=184644.709 ms
64 bytes from 1.1.1.1: seq=105 ttl=255 time=183783.534 ms
64 bytes from 1.1.1.1: seq=106 ttl=255 time=182925.377 ms
64 bytes from 1.1.1.1: seq=107 ttl=255 time=182064.671 ms
64 bytes from 1.1.1.1: seq=108 ttl=255 time=181202.581 ms
64 bytes from 1.1.1.1: seq=109 ttl=255 time=180341.358 ms
64 bytes from 1.1.1.1: seq=110 ttl=255 time=179483.193 ms
64 bytes from 1.1.1.1: seq=111 ttl=255 time=178620.772 ms
64 bytes from 1.1.1.1: seq=112 ttl=255 time=177762.640 ms
64 bytes from 1.1.1.1: seq=113 ttl=255 time=176899.436 ms
64 bytes from 1.1.1.1: seq=114 ttl=255 time=176042.034 ms
64 bytes from 1.1.1.1: seq=115 ttl=255 time=175178.675 ms
64 bytes from 1.1.1.1: seq=116 ttl=255 time=174319.242 ms
64 bytes from 1.1.1.1: seq=117 ttl=255 time=173457.937 ms
64 bytes from 1.1.1.1: seq=118 ttl=255 time=172597.405 ms
64 bytes from 1.1.1.1: seq=119 ttl=255 time=171740.272 ms
64 bytes from 1.1.1.1: seq=120 ttl=255 time=170878.897 ms
64 bytes from 1.1.1.1: seq=121 ttl=255 time=170017.614 ms
64 bytes from 1.1.1.1: seq=122 ttl=255 time=169157.162 ms
64 bytes from 1.1.1.1: seq=123 ttl=255 time=168295.214 ms
64 bytes from 1.1.1.1: seq=124 ttl=255 time=167437.646 ms
64 bytes from 1.1.1.1: seq=125 ttl=255 time=166571.517 ms
64 bytes from 1.1.1.1: seq=126 ttl=255 time=165715.434 ms
64 bytes from 1.1.1.1: seq=127 ttl=255 time=164850.061 ms
64 bytes from 1.1.1.1: seq=128 ttl=255 time=163989.448 ms
64 bytes from 1.1.1.1: seq=129 ttl=255 time=163132.940 ms
64 bytes from 1.1.1.1: seq=130 ttl=255 time=162268.721 ms
64 bytes from 1.1.1.1: seq=131 ttl=255 time=161409.818 ms
64 bytes from 1.1.1.1: seq=132 ttl=255 time=160550.705 ms
64 bytes from 1.1.1.1: seq=133 ttl=255 time=159687.290 ms
64 bytes from 1.1.1.1: seq=134 ttl=255 time=158826.802 ms
64 bytes from 1.1.1.1: seq=135 ttl=255 time=157966.914 ms
64 bytes from 1.1.1.1: seq=136 ttl=255 time=157109.391 ms
64 bytes from 1.1.1.1: seq=137 ttl=255 time=156248.113 ms
64 bytes from 1.1.1.1: seq=138 ttl=255 time=155386.425 ms
64 bytes from 1.1.1.1: seq=139 ttl=255 time=154526.799 ms
64 bytes from 1.1.1.1: seq=140 ttl=255 time=153666.778 ms
64 bytes from 1.1.1.1: seq=141 ttl=255 time=152804.089 ms
64 bytes from 1.1.1.1: seq=142 ttl=255 time=151942.933 ms
64 bytes from 1.1.1.1: seq=143 ttl=255 time=151084.241 ms
64 bytes from 1.1.1.1: seq=144 ttl=255 time=150224.787 ms
64 bytes from 1.1.1.1: seq=145 ttl=255 time=149364.806 ms
64 bytes from 1.1.1.1: seq=146 ttl=255 time=148505.286 ms
64 bytes from 1.1.1.1: seq=147 ttl=255 time=147641.848 ms
64 bytes from 1.1.1.1: seq=148 ttl=255 time=146781.578 ms
64 bytes from 1.1.1.1: seq=149 ttl=255 time=145923.483 ms
64 bytes from 1.1.1.1: seq=150 ttl=255 time=145060.536 ms
64 bytes from 1.1.1.1: seq=151 ttl=255 time=144203.806 ms
64 bytes from 1.1.1.1: seq=152 ttl=255 time=143342.543 ms
64 bytes from 1.1.1.1: seq=153 ttl=255 time=142482.023 ms
64 bytes from 1.1.1.1: seq=154 ttl=255 time=141618.118 ms
64 bytes from 1.1.1.1: seq=155 ttl=255 time=140757.069 ms
64 bytes from 1.1.1.1: seq=156 ttl=255 time=139901.244 ms
64 bytes from 1.1.1.1: seq=157 ttl=255 time=139036.518 ms
64 bytes from 1.1.1.1: seq=158 ttl=255 time=138179.396 ms
64 bytes from 1.1.1.1: seq=159 ttl=255 time=137318.933 ms
64 bytes from 1.1.1.1: seq=160 ttl=255 time=136455.065 ms
64 bytes from 1.1.1.1: seq=161 ttl=255 time=135597.834 ms
64 bytes from 1.1.1.1: seq=162 ttl=255 time=134734.172 ms
64 bytes from 1.1.1.1: seq=163 ttl=255 time=133874.764 ms
64 bytes from 1.1.1.1: seq=164 ttl=255 time=133014.167 ms
64 bytes from 1.1.1.1: seq=165 ttl=255 time=132293.203 ms
64 bytes from 1.1.1.1: seq=166 ttl=255 time=131432.634 ms
64 bytes from 1.1.1.1: seq=167 ttl=255 time=130575.128 ms
64 bytes from 1.1.1.1: seq=168 ttl=255 time=129711.740 ms
64 bytes from 1.1.1.1: seq=169 ttl=255 time=128854.663 ms
64 bytes from 1.1.1.1: seq=170 ttl=255 time=127993.459 ms
64 bytes from 1.1.1.1: seq=171 ttl=255 time=127132.200 ms
64 bytes from 1.1.1.1: seq=172 ttl=255 time=126270.555 ms
64 bytes from 1.1.1.1: seq=173 ttl=255 time=125410.323 ms
64 bytes from 1.1.1.1: seq=174 ttl=255 time=124551.808 ms
64 bytes from 1.1.1.1: seq=175 ttl=255 time=123691.455 ms
64 bytes from 1.1.1.1: seq=176 ttl=255 time=122832.185 ms
64 bytes from 1.1.1.1: seq=177 ttl=255 time=121971.919 ms
64 bytes from 1.1.1.1: seq=178 ttl=255 time=121111.333 ms
64 bytes from 1.1.1.1: seq=179 ttl=255 time=120251.129 ms
64 bytes from 1.1.1.1: seq=180 ttl=255 time=119389.873 ms
64 bytes from 1.1.1.1: seq=181 ttl=255 time=118526.502 ms
64 bytes from 1.1.1.1: seq=182 ttl=255 time=117669.644 ms
64 bytes from 1.1.1.1: seq=183 ttl=255 time=116805.400 ms
64 bytes from 1.1.1.1: seq=184 ttl=255 time=115947.994 ms
64 bytes from 1.1.1.1: seq=185 ttl=255 time=115088.160 ms
64 bytes from 1.1.1.1: seq=186 ttl=255 time=114224.866 ms
64 bytes from 1.1.1.1: seq=187 ttl=255 time=113363.582 ms
64 bytes from 1.1.1.1: seq=188 ttl=255 time=112503.397 ms
64 bytes from 1.1.1.1: seq=189 ttl=255 time=111645.410 ms
64 bytes from 1.1.1.1: seq=190 ttl=255 time=110784.811 ms
64 bytes from 1.1.1.1: seq=191 ttl=255 time=109924.576 ms
64 bytes from 1.1.1.1: seq=192 ttl=255 time=109064.758 ms
64 bytes from 1.1.1.1: seq=193 ttl=255 time=108200.506 ms
64 bytes from 1.1.1.1: seq=194 ttl=255 time=107343.300 ms
64 bytes from 1.1.1.1: seq=195 ttl=255 time=106480.522 ms
64 bytes from 1.1.1.1: seq=196 ttl=255 time=105619.641 ms
64 bytes from 1.1.1.1: seq=197 ttl=255 time=104761.399 ms
64 bytes from 1.1.1.1: seq=198 ttl=255 time=103969.579 ms
64 bytes from 1.1.1.1: seq=199 ttl=255 time=103111.232 ms
64 bytes from 1.1.1.1: seq=200 ttl=255 time=102246.894 ms
64 bytes from 1.1.1.1: seq=201 ttl=255 time=101389.902 ms
64 bytes from 1.1.1.1: seq=202 ttl=255 time=100526.468 ms
64 bytes from 1.1.1.1: seq=203 ttl=255 time=99668.868 ms
64 bytes from 1.1.1.1: seq=204 ttl=255 time=98806.105 ms
64 bytes from 1.1.1.1: seq=205 ttl=255 time=97944.330 ms
64 bytes from 1.1.1.1: seq=206 ttl=255 time=97087.624 ms
64 bytes from 1.1.1.1: seq=207 ttl=255 time=96223.053 ms
64 bytes from 1.1.1.1: seq=208 ttl=255 time=95365.559 ms
64 bytes from 1.1.1.1: seq=209 ttl=255 time=94505.304 ms
64 bytes from 1.1.1.1: seq=210 ttl=255 time=93642.694 ms
64 bytes from 1.1.1.1: seq=211 ttl=255 time=92784.797 ms
64 bytes from 1.1.1.1: seq=212 ttl=255 time=91921.391 ms
64 bytes from 1.1.1.1: seq=213 ttl=255 time=91062.480 ms
64 bytes from 1.1.1.1: seq=214 ttl=255 time=90200.766 ms
64 bytes from 1.1.1.1: seq=215 ttl=255 time=89412.301 ms
64 bytes from 1.1.1.1: seq=216 ttl=255 time=88550.975 ms
64 bytes from 1.1.1.1: seq=217 ttl=255 time=87692.942 ms
64 bytes from 1.1.1.1: seq=218 ttl=255 time=86832.202 ms
64 bytes from 1.1.1.1: seq=219 ttl=255 time=85968.589 ms
64 bytes from 1.1.1.1: seq=220 ttl=255 time=85112.144 ms
64 bytes from 1.1.1.1: seq=221 ttl=255 time=84247.779 ms
64 bytes from 1.1.1.1: seq=222 ttl=255 time=83390.314 ms
64 bytes from 1.1.1.1: seq=223 ttl=255 time=82806.827 ms
64 bytes from 1.1.1.1: seq=224 ttl=255 time=82088.299 ms
64 bytes from 1.1.1.1: seq=225 ttl=255 time=81368.823 ms
64 bytes from 1.1.1.1: seq=226 ttl=255 time=80788.159 ms
64 bytes from 1.1.1.1: seq=227 ttl=255 time=79925.690 ms
64 bytes from 1.1.1.1: seq=228 ttl=255 time=79207.165 ms
64 bytes from 1.1.1.1: seq=229 ttl=255 time=78347.362 ms
64 bytes from 1.1.1.1: seq=230 ttl=255 time=77623.402 ms
64 bytes from 1.1.1.1: seq=231 ttl=255 time=76764.931 ms
64 bytes from 1.1.1.1: seq=232 ttl=255 time=90325.709 ms
64 bytes from 1.1.1.1: seq=233 ttl=255 time=90165.373 ms
64 bytes from 1.1.1.1: seq=234 ttl=255 time=99175.571 ms
64 bytes from 1.1.1.1: seq=235 ttl=255 time=99155.438 ms
64 bytes from 1.1.1.1: seq=236 ttl=255 time=99134.542 ms
64 bytes from 1.1.1.1: seq=237 ttl=255 time=102120.961 ms
64 bytes from 1.1.1.1: seq=238 ttl=255 time=104134.035 ms
64 bytes from 1.1.1.1: seq=239 ttl=255 time=115171.447 ms
64 bytes from 1.1.1.1: seq=240 ttl=255 time=116133.420 ms
64 bytes from 1.1.1.1: seq=241 ttl=255 time=116179.866 ms
64 bytes from 1.1.1.1: seq=242 ttl=255 time=118191.911 ms
64 bytes from 1.1.1.1: seq=243 ttl=255 time=118172.226 ms
64 bytes from 1.1.1.1: seq=244 ttl=255 time=118151.148 ms
64 bytes from 1.1.1.1: seq=245 ttl=255 time=118201.221 ms
64 bytes from 1.1.1.1: seq=246 ttl=255 time=118180.112 ms
64 bytes from 1.1.1.1: seq=247 ttl=255 time=118159.576 ms
64 bytes from 1.1.1.1: seq=248 ttl=255 time=118138.773 ms
64 bytes from 1.1.1.1: seq=249 ttl=255 time=118185.635 ms
64 bytes from 1.1.1.1: seq=250 ttl=255 time=120195.343 ms
64 bytes from 1.1.1.1: seq=251 ttl=255 time=121157.762 ms
64 bytes from 1.1.1.1: seq=252 ttl=255 time=122187.400 ms
64 bytes from 1.1.1.1: seq=253 ttl=255 time=122168.372 ms
64 bytes from 1.1.1.1: seq=254 ttl=255 time=123196.818 ms
64 bytes from 1.1.1.1: seq=255 ttl=255 time=123172.538 ms
64 bytes from 1.1.1.1: seq=256 ttl=255 time=123153.181 ms
64 bytes from 1.1.1.1: seq=257 ttl=255 time=123201.942 ms
64 bytes from 1.1.1.1: seq=258 ttl=255 time=123181.665 ms
64 bytes from 1.1.1.1: seq=259 ttl=255 time=123162.299 ms
64 bytes from 1.1.1.1: seq=260 ttl=255 time=128183.902 ms
64 bytes from 1.1.1.1: seq=261 ttl=255 time=128163.238 ms
64 bytes from 1.1.1.1: seq=262 ttl=255 time=128141.204 ms
64 bytes from 1.1.1.1: seq=263 ttl=255 time=128189.806 ms
64 bytes from 1.1.1.1: seq=264 ttl=255 time=128169.727 ms
64 bytes from 1.1.1.1: seq=265 ttl=255 time=128149.188 ms
64 bytes from 1.1.1.1: seq=267 ttl=255 time=127198.048 ms
64 bytes from 1.1.1.1: seq=268 ttl=255 time=128157.349 ms
64 bytes from 1.1.1.1: seq=269 ttl=255 time=128208.249 ms
64 bytes from 1.1.1.1: seq=270 ttl=255 time=130148.205 ms
64 bytes from 1.1.1.1: seq=271 ttl=255 time=131177.226 ms
64 bytes from 1.1.1.1: seq=272 ttl=255 time=131158.283 ms
64 bytes from 1.1.1.1: seq=273 ttl=255 time=141149.229 ms
64 bytes from 1.1.1.1: seq=274 ttl=255 time=141198.959 ms
64 bytes from 1.1.1.1: seq=275 ttl=255 time=142156.598 ms
64 bytes from 1.1.1.1: seq=276 ttl=255 time=142204.986 ms
64 bytes from 1.1.1.1: seq=277 ttl=255 time=152197.204 ms
64 bytes from 1.1.1.1: seq=278 ttl=255 time=153154.130 ms
64 bytes from 1.1.1.1: seq=279 ttl=255 time=153204.573 ms
64 bytes from 1.1.1.1: seq=280 ttl=255 time=153183.180 ms
64 bytes from 1.1.1.1: seq=281 ttl=255 time=153162.962 ms
64 bytes from 1.1.1.1: seq=282 ttl=255 time=153214.471 ms
64 bytes from 1.1.1.1: seq=283 ttl=255 time=153192.247 ms
64 bytes from 1.1.1.1: seq=284 ttl=255 time=153175.152 ms
64 bytes from 1.1.1.1: seq=285 ttl=255 time=154204.691 ms
64 bytes from 1.1.1.1: seq=286 ttl=255 time=154181.609 ms
64 bytes from 1.1.1.1: seq=287 ttl=255 time=154160.863 ms
64 bytes from 1.1.1.1: seq=288 ttl=255 time=154212.726 ms
64 bytes from 1.1.1.1: seq=289 ttl=255 time=154188.385 ms
64 bytes from 1.1.1.1: seq=290 ttl=255 time=154168.711 ms
64 bytes from 1.1.1.1: seq=291 ttl=255 time=154217.619 ms
64 bytes from 1.1.1.1: seq=292 ttl=255 time=155179.417 ms
64 bytes from 1.1.1.1: seq=293 ttl=255 time=155227.907 ms
64 bytes from 1.1.1.1: seq=294 ttl=255 time=155209.354 ms
64 bytes from 1.1.1.1: seq=295 ttl=255 time=155189.392 ms
64 bytes from 1.1.1.1: seq=296 ttl=255 time=159158.870 ms
64 bytes from 1.1.1.1: seq=297 ttl=255 time=159208.869 ms
64 bytes from 1.1.1.1: seq=298 ttl=255 time=159186.837 ms
64 bytes from 1.1.1.1: seq=299 ttl=255 time=159165.503 ms
64 bytes from 1.1.1.1: seq=300 ttl=255 time=161175.966 ms
64 bytes from 1.1.1.1: seq=301 ttl=255 time=161227.173 ms
64 bytes from 1.1.1.1: seq=302 ttl=255 time=161203.910 ms
64 bytes from 1.1.1.1: seq=303 ttl=255 time=161186.309 ms
64 bytes from 1.1.1.1: seq=304 ttl=255 time=161164.602 ms
64 bytes from 1.1.1.1: seq=305 ttl=255 time=161215.886 ms
64 bytes from 1.1.1.1: seq=306 ttl=255 time=161193.471 ms
64 bytes from 1.1.1.1: seq=307 ttl=255 time=161172.955 ms
64 bytes from 1.1.1.1: seq=308 ttl=255 time=161224.986 ms
64 bytes from 1.1.1.1: seq=309 ttl=255 time=161202.462 ms
64 bytes from 1.1.1.1: seq=310 ttl=255 time=166224.560 ms
64 bytes from 1.1.1.1: seq=311 ttl=255 time=170194.436 ms
64 bytes from 1.1.1.1: seq=312 ttl=255 time=170170.655 ms
64 bytes from 1.1.1.1: seq=313 ttl=255 time=173230.698 ms
64 bytes from 1.1.1.1: seq=314 ttl=255 time=174192.909 ms
64 bytes from 1.1.1.1: seq=315 ttl=255 time=174238.925 ms
64 bytes from 1.1.1.1: seq=316 ttl=255 time=174221.349 ms
64 bytes from 1.1.1.1: seq=317 ttl=255 time=174201.048 ms
64 bytes from 1.1.1.1: seq=318 ttl=255 time=176210.741 ms
64 bytes from 1.1.1.1: seq=319 ttl=255 time=178216.730 ms
64 bytes from 1.1.1.1: seq=320 ttl=255 time=178197.136 ms
64 bytes from 1.1.1.1: seq=321 ttl=255 time=195256.657 ms
64 bytes from 1.1.1.1: seq=322 ttl=255 time=203216.083 ms
64 bytes from 1.1.1.1: seq=323 ttl=255 time=211248.427 ms
64 bytes from 1.1.1.1: seq=324 ttl=255 time=212208.381 ms

I've tested this with sturgeon and sparrow. Since you mentioned dbus spam I also tried an older version (97694fe) but that seems to perform similarly.e

Oh my… that is very weird… This should not happen… I can't work on this right now, but the network connection worked very well last time I checked… Could you try a different Android phone?

Indeed very interesting! I've now tried on another phone it where it works much better:

/ # ping -I tap0 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=255 time=136.311 ms
64 bytes from 1.1.1.1: seq=1 ttl=255 time=95.188 ms
64 bytes from 1.1.1.1: seq=2 ttl=255 time=114.186 ms
64 bytes from 1.1.1.1: seq=3 ttl=255 time=74.685 ms
64 bytes from 1.1.1.1: seq=4 ttl=255 time=91.796 ms
64 bytes from 1.1.1.1: seq=5 ttl=255 time=110.148 ms
64 bytes from 1.1.1.1: seq=6 ttl=255 time=70.879 ms
64 bytes from 1.1.1.1: seq=7 ttl=255 time=212.782 ms
64 bytes from 1.1.1.1: seq=8 ttl=255 time=172.226 ms
64 bytes from 1.1.1.1: seq=9 ttl=255 time=192.006 ms
64 bytes from 1.1.1.1: seq=10 ttl=255 time=151.115 ms
64 bytes from 1.1.1.1: seq=11 ttl=255 time=108.580 ms
64 bytes from 1.1.1.1: seq=12 ttl=255 time=131.104 ms
64 bytes from 1.1.1.1: seq=13 ttl=255 time=90.655 ms
64 bytes from 1.1.1.1: seq=14 ttl=255 time=106.894 ms
64 bytes from 1.1.1.1: seq=15 ttl=255 time=125.800 ms
64 bytes from 1.1.1.1: seq=16 ttl=255 time=148.037 ms
64 bytes from 1.1.1.1: seq=17 ttl=255 time=228.504 ms
64 bytes from 1.1.1.1: seq=18 ttl=255 time=184.394 ms
64 bytes from 1.1.1.1: seq=19 ttl=255 time=204.262 ms
64 bytes from 1.1.1.1: seq=20 ttl=255 time=227.475 ms
64 bytes from 1.1.1.1: seq=21 ttl=255 time=123.927 ms
64 bytes from 1.1.1.1: seq=22 ttl=255 time=146.543 ms
64 bytes from 1.1.1.1: seq=23 ttl=255 time=103.989 ms
64 bytes from 1.1.1.1: seq=24 ttl=255 time=125.627 ms
64 bytes from 1.1.1.1: seq=25 ttl=255 time=82.807 ms
64 bytes from 1.1.1.1: seq=26 ttl=255 time=104.865 ms
64 bytes from 1.1.1.1: seq=27 ttl=255 time=121.320 ms
64 bytes from 1.1.1.1: seq=28 ttl=255 time=81.011 ms
64 bytes from 1.1.1.1: seq=29 ttl=255 time=163.172 ms
64 bytes from 1.1.1.1: seq=30 ttl=255 time=119.247 ms
64 bytes from 1.1.1.1: seq=31 ttl=255 time=79.904 ms
64 bytes from 1.1.1.1: seq=32 ttl=255 time=102.881 ms
64 bytes from 1.1.1.1: seq=33 ttl=255 time=121.377 ms
64 bytes from 1.1.1.1: seq=34 ttl=255 time=80.706 ms
64 bytes from 1.1.1.1: seq=35 ttl=255 time=100.589 ms
64 bytes from 1.1.1.1: seq=36 ttl=255 time=119.973 ms
64 bytes from 1.1.1.1: seq=37 ttl=255 time=76.380 ms
64 bytes from 1.1.1.1: seq=38 ttl=255 time=158.727 ms
64 bytes from 1.1.1.1: seq=39 ttl=255 time=117.640 ms
64 bytes from 1.1.1.1: seq=40 ttl=255 time=134.273 ms
64 bytes from 1.1.1.1: seq=41 ttl=255 time=93.276 ms
64 bytes from 1.1.1.1: seq=42 ttl=255 time=116.294 ms
64 bytes from 1.1.1.1: seq=43 ttl=255 time=135.547 ms
64 bytes from 1.1.1.1: seq=44 ttl=255 time=92.157 ms
64 bytes from 1.1.1.1: seq=45 ttl=255 time=114.357 ms
64 bytes from 1.1.1.1: seq=46 ttl=255 time=129.717 ms

For reference the phone showing terrible results is a Samsung Galaxy S23 Ultra (Android 14). The phone with proper looking results is the a Xiaomi Mi5 (LineageOS with Android 11).

The difference in performance is enough to actually successfully connect to ssh (via the phone)

@I-asked
Copy link
Author

I-asked commented Aug 16, 2024

Perhaps the Samsung has some weird "battery saving" feature you could try disabling?

@MagneFire
Copy link
Member

We already prompt to disable battery saving. Maybe this isn't enough on Samsung. Or maybe it's something with newer Android devices? What phone did you test this with?

@I-asked
Copy link
Author

I-asked commented Aug 16, 2024

Is the Samsung connected to a wi-fi network? Could you try those two phones both over cellular and wi-fi?

@I-asked
Copy link
Author

I-asked commented Aug 16, 2024

I last tested on my Xperia 1 IV which was running A13.

@MagneFire
Copy link
Member

There appears to be no difference when I use WiFi or cellular.

I've slightly altered your version before the dbus library change and the additional dbus services as there have been a some SDK updates which result in runtime errors. This version is available here: https://github.com/MagneFire/AsteroidOSSync/commits/slirp-2/

Attached are the logs for both phones:
mi5.log
s23.log

Interestingly D-Bus connection seems to also fail on the Samsung phone.

@MagneFire
Copy link
Member

Here are some logs with a little more debug information.

There are clear large gaps visible when looking at the timestamps. Maybe it's some retry logic that has a different timeout?

mi5-2.log
s23-2.log

@MagneFire
Copy link
Member

Not entirely sure why but it seems that on the Samsung phone the SlirpService freezes in one of the synchronized blocks.
Removing these blocks results in a segfault, which is probably due to threading issues.

Replacing the synchronized blocks with conventional ReentrantLock locks solves the freeing issue.
Finally changing the resetMtu() function to handle lock acquire issues solves the networking issue and now it seems to work fine:

PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=255 time=83.523 ms
64 bytes from 1.1.1.1: seq=1 ttl=255 time=71.867 ms
64 bytes from 1.1.1.1: seq=2 ttl=255 time=72.282 ms
64 bytes from 1.1.1.1: seq=3 ttl=255 time=69.696 ms
64 bytes from 1.1.1.1: seq=4 ttl=255 time=64.137 ms
64 bytes from 1.1.1.1: seq=6 ttl=255 time=109.322 ms
64 bytes from 1.1.1.1: seq=7 ttl=255 time=109.446 ms
64 bytes from 1.1.1.1: seq=8 ttl=255 time=104.601 ms
64 bytes from 1.1.1.1: seq=9 ttl=255 time=104.356 ms
64 bytes from 1.1.1.1: seq=10 ttl=255 time=101.120 ms
64 bytes from 1.1.1.1: seq=11 ttl=255 time=97.537 ms
64 bytes from 1.1.1.1: seq=12 ttl=255 time=145.215 ms
64 bytes from 1.1.1.1: seq=13 ttl=255 time=92.959 ms
64 bytes from 1.1.1.1: seq=14 ttl=255 time=87.186 ms
64 bytes from 1.1.1.1: seq=15 ttl=255 time=86.865 ms
64 bytes from 1.1.1.1: seq=16 ttl=255 time=132.849 ms

Changes are available here: https://github.com/MagneFire/AsteroidOSSync/commits/slirp-2/

@MagneFire
Copy link
Member

MagneFire commented Aug 18, 2024

Hmm, after more testing it seems to be related to MTU. The app requests 247 (which is initially also used for libslirp).
But once connected the MTU changes to 515. Which results in a libslirp re-initialization with the new MTU. At this point communication seizes to work (ping doesn't respond).

If the requested MTU is 515 it all seems to work fine, but in this case the libslirp re-initialization does not occur. Forcing a libslirp re-initialization (by overriding mDevice.getMtu(); to always return 247) results in the same communication issues.

Next I'll try these things on the known working phone (Xiaomi Mi5, Android 11) to compare if it behaves identically.

Tested on the known working phone. It seems that the MTU doesn't change once connected, it stays at 247. To find out if the issues is with MTU or libslirp re-initialization I've changed the default MTU to 515 and request a different MTU (247) upon second connect, which results in a libslirp re-initialization. Letting libslirp re-initialize results in the same issue as with the other phone (ping not working/very large ttl). Communication works fine when the libslirp re-initialization isn't executed (Thus using MTU 247 with a BLE MTU of 515).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants