Connection slow but speed fast when connected

1

I am experiencing an interesting type of slow connection buildup and would like to ask people more up to the topic on any ideas what could cause this and how to troubleshoot it. (On my background, I am an IT student fairly experienced with computers and networks)

On my network we have a router connected to the internet and serving multiple devices over wireless 802.11n. There is some interference with other WiFis but normally the connection is stable. Also all devices are in one room, less than 5 meters from the antenna, nothing blocking it.

There are times where everything works normal and there are times where it takes up to 30 seconds for a connection to finish the handshake, but once that is done, the connection speeds up to 20MBit/s.

You can see this extremely good on downloads like steam, where the graph has spikes every 10 or so seconds when one package clears. But youtube videos or http-downloads are fast once the initial connection is made. Image showing download speed (averaged) over 5 Minutes

This happens regardless of device or operation system (Windows, Linux, Android) and restarting the router, flushing dns does not resolve it.

Sending a ping to ip or domain goes in under 50ms and chat systems (probably working with sockets) are doing just fine.

While it seems to not be a dns issue, loading the exact same page a second time results in much faster connection.

  • mysite.com?page=1 (10 seconds)
  • mysite.com?page=2 (10 seconds)
  • mysite.com?page=1 (0,5 seconds)

I am curious as to what could cause this and what tools I can use to analyse it. This is more a question for me to learn the technical background behind this and I would love to have an answer going into technical details.

If you need any more details I am happy to provide them!

reggaemuffin

Posted 2015-06-13T19:42:53.300

Reputation: 111

"While it seems to not be a dns issue," My first thought is that it is a DNS issue. Have you tried changing the DNS setting in your router? See also 10 Ways to Troubleshoot DNS Resolution Issues

– DavidPostill – 2015-06-13T19:54:22.043

@DavidPostill thanks for the link, I have tried all steps there, sadly my router does not let me change any dns settings and all clients use him as the server. nslookup on windows clears in under one second for random domains. Pinging the dns server (router and higher up) clears in milliseconds. – reggaemuffin – 2015-06-13T20:05:43.817

Do you have a dynamic or static IP? Also, are you trying to open the pages on a private window or a normal session in your browser? Since we have to consider the browser cache too when opening the page for the second time. Or you can reload the page by pressing Ctrl+F5. – Erlis D. – 2015-06-13T20:10:07.380

The network uses DHCP and renewing the lease does not do anthing. browsing is done in a normal browser (or in any other application using the internet). Force-reload with Ctrl+F5 results in the same fast loading speed (under one second on this question page). – reggaemuffin – 2015-06-13T20:14:57.620

A couple of tools I can recommend, so you test your connection: NetBalancer, Wireshark (most probably you already know this), BitMeter OS (not that much useful in your case, but who knows) and openDNS. Try openDNS to test if anything changes on the http speed, use NetBalancer to get a list of IPs and more data on the connection. Have you checked you public ip with tracert to see the route time (ping)? Also if you have a dynamic IP, you should try contacting your ISP. They usually switch the pool you are connected to. – Erlis D. – 2015-06-13T20:23:31.367

@ErlisD. Thanks a lot, i will try it with the tools you have listed and will edit my answer/comment here on what the results are. – reggaemuffin – 2015-06-13T20:29:37.387

@ErlisD. Sadly, NetBalancer has driver issues on Win10, but changing my local dns to the servers from opendns changed something. Conections to websites got a little slower as it seems, but my steam download changed to an continuous (but slow) stream instead of spikes. tracert times are 500ms to 1sec per hop, changing to opendns did not change much. – reggaemuffin – 2015-06-13T20:44:35.563

I see... In my opinion this happens either for the fact that your ISP does not allow "external DNS" or the DNS server is too far to reach your destination. in my opinion the only options would be to try and reset your router firmware and update it if you can, and second, try to contact your ISP. Anyway, let us know if you can if you find a solution. It would be difficult to give a proper answer in this situation. – Erlis D. – 2015-06-13T21:49:37.057

Answers

1

I too am led to believe you have a problem with DNS. Your comment

nslookup on windows clears in under one second for random domains

did nothing to assuage these fears. I can offer a test, and a solution.

Dnscrypt is an extremely useful package, developed by the fine folks at OpenDNS.org, which will not only change the DNS port, but will also encrypt DNS queries. The point here is that your ISP may have enabled its own system of DNS and firewall which recognizes DNS queries based on port and/or protocol, so that just changing the port will not do. Encryption will allow you to bypass your ISP's DNS. On the Web site you will find download packages for both Windows and MacOs. Install one and see whether anything changes.

If this works, the simplest solution is to mount your own router behind the one given to you by your ISP, and route all of your traffic through this new router. To this end, you can either use a suitably crafted Linux version (even on old, second-hand hardware like I do), or buy yoursself a new router compatible with the Tomato by Shibby firmware, you may find a list here. This firmware has dnscrypt, which you may configure as you see fit, see for instance here.

MariusMatutiae

Posted 2015-06-13T19:42:53.300

Reputation: 41 321

0

This could also be an issue with IPv6. Maybe your Browser tries to connect via IPv6 and waits until that times out before retrying with IPv4.

That said, I'm also led to believe that this is a DNS issue.

Could you try to talk to an HTTP-Server directly via telnet?

Something like telnet www.google.com 80 should do it. Then look how long it takes to connect and also note if it tries to connect via IPv4 or IPv6.

Once connected you can do a handcrafted HTTP query like this and monitor the response time again.

GET / HTTP/1.1
Host: www.google.com
Connection: Close

The last line has to be terminated with 2(!) newlines to trigger the server response.

Thilo

Posted 2015-06-13T19:42:53.300

Reputation: 1