-
Notifications
You must be signed in to change notification settings - Fork 200
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
DNS lookup on connect causes delay #873
Comments
For reference and in case anyone else finds this useful here's the quick shell script being used:
|
What rig is this? And what makes you think it's a DNS lookup? I don't see a DNS packet here.hamlib does not do a DNS lookup except on opening the rig.
And what version of hamlib are running?
Mike W9MDB
On Saturday, November 20, 2021, 07:02:18 AM CST, madpsy ***@***.***> wrote:
I've attached a wireshark screenshot from the box rigctld is running on. Highlighted first is the 'f' being sent to request frequency and from the time difference between that and the next highlighted line is this mysterious delay.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
The rig is actually SDR Console over a virtual com port - it presents itself as a TS-2000. It might not be DNS but can't think what else it is. If I run the same test locally (i.e. from localhost) there's no issue at all (returns within a few milliseconds) so it's not the 'rig' side of things. If I use SparkSDR (which implements its own version of rigctld) it's also fine over the network. The network itself isn't the issue, it's something that rigctld on Windows is doing. The order of events as I understand it from what I've tested is:
The fact rigctl logs 'rpi4:36714' means it's translated the source address to 'rpi4' otherwise I'd expect to see '192.168.9.35:36714'. The PTR request is of course the standard way of doing lookups so I'm wondering if windows is trying some proprietary lookup nonsense before it resorts to a PTR lookup. I assume rigctl is using a standard library to perform the hostname resoluition of the source address - I believe it's something in there causing the delay. I would question why rigctl even cares what the hostname of the source request is. |
Forgot to say: hamlib 4.3.1 |
I've just reversed the test - ran rigctld on rpi4 and my test script via WSL on the Windows 11 box and there's no delay:
This really does suggest a Windows specific issue with rigctld in my case, however, this delay would also occur in any situation where the lookup is slow for whatever reason. |
I believe the lookup is being performed here: https://github.com/Hamlib/Hamlib/blob/master/tests/rigctld.c#L960 and here too: https://github.com/Hamlib/Hamlib/blob/master/tests/rigctld.c#L1198 I see no reason to perform these I would try this fixing this myself but unsure how to compile for Windows.
|
Here's a discussion about I would suggest either not trying to resolve IPs to hostnames or add a flag to disable it. It's been a fun ride this morning and good to get to the bottom of it (albeit completely untested)! Would someone be willing to remove those calls and compile for me to test? |
…Windows long delay on reverse lookups #873
Try tonight's package from http://n0nb.users.sourceforge.net/ |
Nice one thanks - returns instantly:
|
The reason for this bug report was my work on the following project: https://github.com/madpsy/xpa125b_controller In its rawest form it's a multi-API interface for rigctl which now works as expected so thanks for all your effort. |
It appears when a connection comes in to rigctld it performs a reverse loopup of the source address. Depending on circumstance this can cause quite a delay.
In this case rigctld is running on a Windows 11 box and is being queried from a Pi over the local network.
For example:
That's nearly 5 seconds in this case. I can see in the rigctl output:
The delay occurs before the
Connection opened
line is outputted. This all suggests it it is indeed performing some kind of DNS related shinanigans in order to resolve it as 'rpi4'. Having looked at the available options (-L) I don't see any mention of being able to disable these lookups.I can also see the PTR lookup hitting the local nameserver (answered in 1.3ms):
This lookup only hits the nameserver after this weird random delay so I'm confused what it's doing before making this PTR DNS request as that's the bit that's taking all the time. Maybe it's not DNS causing the delay but something is as I've no idea what.
If I use different software which also has a rigctld compatible interface (namely SparkSDR) there's no delay whatsoever so it's specific to rigctld.
My questions are therefore:
Thanks
The text was updated successfully, but these errors were encountered: