point-source / dart_ping

Multi-platform network ping utility for Dart
30 stars 13 forks source link

No IP in response when specifying TTL #49

Closed Vasilisk7 closed 9 months ago

Vasilisk7 commented 1 year ago

When calling the ping command and specifying ttl, for example, I will take 1, we do not receive the ip address of the host in the response, although if we run the same request via the command line, the answer will be.

Please add the ip address of the host to the server response, if we specified ttl in the ping parameters. p.s. Android My code:

final Ping ping = Ping('google.com', count: 1, ttl: 1);
print('flutter Running command: ${ping.command}');

ping.stream.listen((PingData event) {
    print('flutter event $event');
});

Flutter image Command line 1

point-source commented 1 year ago

In the first screenshot, that appears to be output from Android showing a NoReply error. In the second screenshot, windows is successfully pinging the device.

If you are setting a TTL of 1, this could be caused by the Android device being more than 1 hop away from the target while the windows device is within one hop.

Alternatively, the Android device may not be able to reach/ping the target at all. Try increasing the ttl to something higher and trying it (on Android).

Vasilisk7 commented 1 year ago

@point-source

The error will also be with ttl 2, 3, 4... until it reaches the endpoint of the node, this is the problem image

I want to do a tracert (traceroute) and for this I need a response from ping in the form of IP for each step (ttl) up to the final one. I separately ping each IP to each node, and get what I need => tracert (traceroute)

Command line example image

I already did this in native android and I made an application: https://play.google.com/store/apps/details?id=com.appsteka.traceroute&hl=en_US

I want to repeat it for flutter. Your application is the only one that can help me, I hope for your help.

point-source commented 1 year ago

Ah yes, that makes more sense. I will look into this and update the package.

Vasilisk7 commented 11 months ago

Tell me, is there any work on my issue, when to wait for the update? Or maybe a separate branch for work?

point-source commented 11 months ago

I'll get you a fix in the next few days

Vasilisk7 commented 10 months ago

Hello, the problem persists I am using version 9.0.0 I run the code shown in the screenshot ttl set 1,2,3,4,5.... 10..20 After ttl 20 starts to give an answer, tell me what's the problem?

image

Vasilisk7 commented 9 months ago

Please, is there any progress on the issue?

point-source commented 9 months ago

Try this now on 9.0.1. For what it's worth, this only works on an actual Android device since the emulator does not properly show TTL / hops. On the emulator, everything appears as a single hop away. I tested 9.0.1 with a real device and it worked.

Vasilisk7 commented 9 months ago

I'm using a real device dart_ping: ^9.0.1

ip is now written, but there is no time( (ttl 1,2.... for 20, after is good) image

Although other applications have response times On the computer in the terminal too Expected to jump (tll)

Без имени2

Screenshot_2023-10-06-16-09-17-638_com appsteka traceroute


    • Flutter version 3.13.2 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ff5b5b5fa6 (6 weeks ago), 2023-08-24 08:12:28 -0500
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Vasil\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.8+0--10799086)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.8+0--10799086)

[√] IntelliJ IDEA Ultimate Edition (version 2023.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2023.2.2
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] Connected device (4 available)
    • 2201123G (mobile) • f98696a1 • android-arm64  • Android 13 (API 33)
    • Windows (desktop) • windows  • windows-x64    • Microsoft Windows [Version 10.0.22621.2361]
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 117.0.5938.134
    • Edge (web)        • edge     • web-javascript • Microsoft Edge 117.0.2045.47

[√] Network resources
    • All expected network resources are available.```
point-source commented 9 months ago

I tried running ping -O -n -W 2 -i 1 -t 2 -c 1 google.com on an android terminal emulator on a real device and it did not output a timestamp. Without a timestamp in the output, there is not timestamp for me to provide via dart_ping since it uses the native ping binary. If another app is doing this, they are either:

Other platforms (such as Windows) are not relevant here since each platform uses different ping binaries in the OS and they have different behaviors. Since I am not the author of the ping tool itself, that would have to be a ticket opened on the respective ping tool for each platform in an attempt to get them to reach feature parity with one another.

Vasilisk7 commented 9 months ago

Dear friend, I realized my mistake! Everything works, thanks for your work!