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

Add iroh doctor utility #986

Merged
merged 28 commits into from
May 16, 2023
Merged

Add iroh doctor utility #986

merged 28 commits into from
May 16, 2023

Conversation

rklaehn
Copy link
Contributor

@rklaehn rklaehn commented May 9, 2023

Closes #979

The intent of the utility is to be able to do two things

  • find out global network status, public ip and properties of local LAN/WLAN
  • connect to one particular other peer

Example usage:

Report

> drderp report
getting report using derp map DerpMap {
    regions: {
        1: DerpRegion {
            region_id: 1,
            nodes: [
                DerpNode {
                    name: "default-1",
                    region_id: 1,
                    host_name: "derp.iroh.computer",
                    stun_only: false,
                    stun_port: 3478,
                    stun_test_ip: None,
                    ipv4: None,
                    ipv6: None,
                    derp_port: 0,
                },
            ],
            avoid: false,
            region_code: "default",
        },
    },
}
Report {
    udp: true,
    ipv6: false,
    ipv4: true,
    ipv6_can_send: false,
    ipv4_can_send: false,
    os_has_ipv6: true,
    icmpv4: false,
    mapping_varies_by_dest_ip: None,
    hair_pinning: Some(
        false,
    ),
    upnp: None,
    pmp: None,
    pcp: None,
    preferred_derp: 1,
    region_latency: {
        1: 123.08325ms,
    },
    region_v4_latency: {
        1: 123.08325ms,
    },
    region_v6_latency: {},
    global_v4: Some(
        82.76.245.176:64363,
    ),
    global_v6: None,
    captive_portal: None,
}

Connect

> drderp connect
run 'drderp connect 537a4f6d07d4edec7fff226c1ac63a9f9655ed57a10e534dc633b9ad6b119a2d' in another terminal or on another machine
(do as you are told)
sending 1 bytes
done in 2.597788667 s
speed 0.3849427833384262 bytes/s
sending 16 bytes
done in 0.745654084 s
speed 21.457670980851223 bytes/s
sending 256 bytes
done in 0.7459795 s
speed 343.1729692303877 bytes/s
sending 4096 bytes
done in 0.623054958 s
speed 6574.058913114371 bytes/s
sending 65536 bytes
done in 2.202245291 s
speed 29758.719552189974 bytes/s
test done

@rklaehn rklaehn changed the title WIP add DrDerp utility Add DrDerp utility May 9, 2023
@rklaehn rklaehn marked this pull request as ready for review May 9, 2023 14:19
src/bin/drderp.rs Outdated Show resolved Hide resolved
@rklaehn
Copy link
Contributor Author

rklaehn commented May 11, 2023

I turned it into a subcommand, as @dignifiedquire suggested:

❯ iroh dr-derp accept                                                                               
Run

iroh dr-derp connect 5b33f30b2b53bce0cb1c8853539fe373b95028c5783cbb62e420310219f0155e --remote-endpoint 82.76.245.176:57541 --remote-endpoint 192.168.1.135:57541

in another terminal or on another machine to connect by key and addr.
Omit the --remote-endpoint args to connect just by key.

Accepted connection. Performing test.

send: 193.63 MiB/s
recv: 193.15 MiB/s
echo: 93.73 MiB/s

src/main.rs Outdated Show resolved Hide resolved
src/hp/drderp.rs Outdated Show resolved Hide resolved
also remove min_size, max_size stuff, too complicated. Now just size
@rklaehn
Copy link
Contributor Author

rklaehn commented May 12, 2023

Renamed to doctor and added gui on the connect side, so the connect side also has something to look at.

src/hp/doctor.rs Outdated Show resolved Hide resolved
src/hp/doctor.rs Outdated Show resolved Hide resolved
src/hp/doctor.rs Outdated Show resolved Hide resolved
src/hp/doctor.rs Outdated Show resolved Hide resolved
src/hp/doctor.rs Outdated Show resolved Hide resolved
@rklaehn rklaehn changed the title Add DrDerp utility Add iroh doctor utility May 15, 2023
# Conflicts:
#	src/hp/netcheck.rs
* Add some metrics counters to the doctor

* Add counters to distinguish between ipv4 and ipv6 during sending

Also switch to reporting bytes instead of just packets.

* clippy
# Conflicts:
#	src/hp/magicsock/conn.rs
@rklaehn rklaehn merged commit 4fc70f5 into x-hp May 16, 2023
4 of 17 checks passed
@rklaehn rklaehn deleted the dr_derp branch May 16, 2023 06:13
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.

None yet

2 participants