Question regarding DNS handling

The forum for help and support with FreeNATS as well as any useful hints and tips
wolfgang
Posts: 21
Joined: Wed Jun 11, 2008 9:09 pm
Location: Montreal, Canada

Question regarding DNS handling

Post by wolfgang » Fri Sep 04, 2009 2:00 pm

Hi,

Sorry, this is a longer post. But couldnt find a way to explain this more simple in this specific setup.

At first I have to say really great S/W. Have used it in a couple of my projects. Now with the configurable email relay the notification is perfect. Anyway, have a new setup. Was supposed to be a simple project....and as usual it ends complicated. Have setup freenats 1.04.6b in VM on a laptop with a USB internet stick (HSUPA) to monitor a portal on the mobile network if it fails. Had to change the vm to have a NAT network and not bridged, because network only authenticates my laptop and not a second IP on network from a bridged network....this is no issue (I can work around all the issues this is causing, tunneling the email etc). Now to the issue:

I monitor a portal, one time with IP address in webtime test and the second time with full FQDN(URL).
Have also setup DNS query of the same domain withe the 2 DNS servers on the mobile network.

There is very little difference when i compare the graphs from the IP and the URL test of the portal.

When I look at the DNS query (A-record, UDP test set) there is a lot of times the DNS server does not answer.
Now my assumption was, when DNS query fails, the same must happen to webserver test with the FQDN. Then when looking in DNS spec it says if first DNS query via UDP fails it will be repeated with TCP......This would explain that I do not have drop outs for the Portal test with FQDN. But the DNS spec says also, when the first UDP request fails the seond request with TCP will be done after 2-5 seconds........now my assumption was I should see now a 2-5 second delay on the portal test with FQDN when compared the same test with IP address. But there is almost no difference, for sure no 2-5 sec bigger delay.

Any idea what is the problem?
What is the delay when web test with UDP fails and then repeats with TCP ?

The DNS has dropp-outs, I verified this with http://swmirror.org/drupal/?q=node/93

Other question, when set to simple test, what is the timeout that freenats will log test fails ?

Any help appreciated, Thanks Wolfgang

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Question regarding DNS handling

Post by dave » Sat Sep 05, 2009 7:22 pm

Hi Wolfgang,

The FreeNATS DNS query test does the network-level request and lookup manually. The DNS spec may call for a TCP retry after a UDP fail but the test library doesn't implement this.

My guess is that the UDP is failing now and again and would suggest you either turn up the number of retries or move to TCP.

As for the FQDN the address is pre-resolved as part of the test into the cache (and may well be there already). This is a deliberate step to stop DNS resolution delays/retries being part of the time.

It also gets round the problem where a first test takes longer as the DNS isn't cached but the next ones happen quicker (which was the case before the timing was moved and the DNS pre-resolved).

If you'd like I can cobble together a custom test that does include a lookup or whatever and/or a DNS test following DNS "rules".

Hope that helps,

Dave.

wolfgang
Posts: 21
Joined: Wed Jun 11, 2008 9:09 pm
Location: Montreal, Canada

Re: Question regarding DNS handling

Post by wolfgang » Wed Sep 09, 2009 2:05 pm

Hi Dave,

Thanks for the reply. If the DNS is cached, then it explains my result....great! This shows also that my monitored system behaves correctly, but the DNS is bad. But this means also that the user experience must be very bad, (and there are complains about this, and I am to find out 'who's" fault it is) On the most mobiles (not class A) Data session is only opned when someone want to go on the server, so in most cases the browser on phone will not have cached anything, so first hitting the server will then have major delays when it first tries UDP and then TCP, because the complete process must add this 2-5 sec delay.

If you could implement a variant for the http test with same behavior as browser without cache...at first UDP and then TCP DNS request if no answer on UDP would be really great. Then you can show with the existing http test that server behaves right and still the user experience can be for certain users very bad (means very inconsistant). My answer is yes! if you could do a test following the DNS rules.

Thanks for your support, Wolfgang

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Question regarding DNS handling

Post by dave » Wed Sep 09, 2009 2:25 pm

Hi Wolfgang,

It will not be possible to exactly do what you're talking about as we would need to totally clear the DNS cache before doing a lookup every time.

How about a test that did the following:

- started the timer
- tried UDP lookup of DNS on a specified server
- if that failed try a TCP lookup of DNS on a specified server
- if no DNS can be resolved the test fails with an error code meaning "DNS Lookup Failed"
- cached the DNS (sort of a repeat but required as my manual DNS test doesn't use the cache or update it but quick once in the cache)
- requested the FQDN URL of the page, failing with a "Connection Failed" error code on failure
- stopped the timer and recorded the result

Cheers,

Dave.

wolfgang
Posts: 21
Joined: Wed Jun 11, 2008 9:09 pm
Location: Montreal, Canada

Re: Question regarding DNS handling

Post by wolfgang » Wed Sep 09, 2009 3:06 pm

Hi Dave,

If UDP and also TCP lookup of DNS fails, your test scenario scenario sounds ok to me. But what shall be done, when folowing happens: UDP lookup fails, but TCP lookup is ok, the graph should show that the server responded with a dealy (this 2-5 sec delay what should be between UDP and TCP lookup). Can you add this dealy as a fixed value when the graph is shown to this value this happend as explained ?

You are in Namibia at the moment? I sit in Saudi at the moment :-)

//Wolfgang

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Question regarding DNS handling

Post by dave » Wed Sep 09, 2009 3:09 pm

Hi,

Yes this shouldn't be a problem. There may well be some delay anyway (the time it takes the UDP to decide it has failed) - I'll then make it wait until total time is x seconds before continuing to do a TCP lookup like the client DNS subsystem should.

Yes I am in Namibia! How is Saudi? Hotter than here I bet!

Regards,

Dave.

wolfgang
Posts: 21
Joined: Wed Jun 11, 2008 9:09 pm
Location: Montreal, Canada

Re: Question regarding DNS handling

Post by wolfgang » Wed Sep 09, 2009 3:22 pm

Hi,

Sounds really great if you could do this! Yes the temperature is 39 C during night and 46 C during the day, but very dry, so it is not that bad as it sounds. The real issue is NBNE (no beer no entertainment), not even a movie theater, now is Ramadan, during the day you can not eat in public or at work (you must hide to drink a coffee), all places are closed during the day.

//Wolfgang

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: Question regarding DNS handling

Post by dave » Thu Sep 10, 2009 9:52 am

Hi,

Well Namibia is hot (not quite that hot!) and very dry. There's plenty to drink though even if where I am at least there is not a lot else to do.

I've done a test which should do everything you need I think.

http://www.purplepixie.org/freenats/dev ... ad_sim.zip

Put the PHP file contained in your server/base/site/tests directory and enable includes (site.include.tests set to 1).

You should see the new test type in the list. You specify a DNS server to do the lookup on, an FQDN and a DNS delay (combined time the UDP test takes to fail and wait before retrying via TCP) which will default to zero.

Let me know if that is ok for you or if it needs tweaking. I'm off again for another two weeks from the weekend though so apologies if it takes a while.

Regards,

Dave.

wolfgang
Posts: 21
Joined: Wed Jun 11, 2008 9:09 pm
Location: Montreal, Canada

Re: Question regarding DNS handling

Post by wolfgang » Fri Sep 11, 2009 11:08 am

Hi Dave,

Thanks a lot! Will test in the next days and let you know the result.

//Wolfgang

wolfgang
Posts: 21
Joined: Wed Jun 11, 2008 9:09 pm
Location: Montreal, Canada

Re: Question regarding DNS handling

Post by wolfgang » Sat Sep 12, 2009 8:07 am

Hi Dave,

Have some difficulties here. I am not a Linux and php man. So I tried to use the EXT2 driver for windows http://www.fs-driver.org/ and the vmware disk mount, latest version http://www.vmware.com/pdf/VMwareDiskMount.pdf to copy the php file into the freeNATs vm. Well i used this combination before with older versions on XP and this worked (not with freeNATs but other linux VM) now I have only a Vista laptop available, well I do not get it to work to "see" the linux file system even if the virtual disk is mounted.

Any good suggestion how to get the php file into the vm?

Thanks, Wolfgang

Post Reply