How do I check why my internet is only half working? - docker

My internet is only working for heavily cached sites. Reddit, Gmail, Facebook, etc. The odd thing is, sites like Reddit make queries to non-reddit sites to import the images and they pop up fine when viewing from there, but when I get sent to out.reddit.com and then if I go elsewhere to other non-heavily cached sites, I get timed out connection error.
I can't even visit SpeedTest.net because it times out. I also can't even post a question on StackExchange because of it. What could possibly be going on and how to I debug?
EDIT: I had an inclination that it had to do with Docker. I removed all traces using a powershell script and through remove programs and still didn't work.

user3654055 are friends IRL and we debugged this in person.
It's always best to start from layer 1 and work our way up.
user3654055's computer could connect to wireless networks. This tells us layers 1 and 2 are working
.
user3654055's computer received a DHCP lease. Further testing of layer 3 showed inconsistent results with pinging local IP addresses.
I ran route print to print all routes. This produced a huge amount of output.
Normal output for a Windows computer connected to a flat LAN should produce perhaps 3 routes.
user3654055 had recently installed Docker and attempted to set up a private
internal network for the containers on their PC.
user3654055 had created two virtual networks (one internal vEthernet switch, one external vEthernet switch), a NAT interface, and bridged the wireless adapter to one of those interfaces and had not set up routing correctly for any traffic.
This produced the above scenario where certain traffic was routed correctly or hit the cache and the page would load, but most traffic was routed incorrectly and resulted in a timeout.
Disabling all the vEthernet switches and the NAT interface and removing the wireless adapter from the bridge let the user use their wireless card again.
The above configuration could work if the user set up routing correctly by hand, but we can save that for a later date.

Sounds like a DNS issue...do you know what you are using as a DNS address? You could try using Google's which is 8.8.8.8 for primary and 8.8.4.4 for secondary. Failing that does it get better following a router reboot?

To debug your internet connection, I would at first check what happens with tracert.
Traceroute command shows you the path taken by your packets and its latency from hop to hop.
From console (linux) or from cmd (windows)
tracert stackoverflow.com
this shows you where you are lagging, the first entry may be your router IP. If the first entry appears with high latency try to reboot your router.
Checking for DNS Issues
Try to use nslookup. This is what you should get:
nslookup stackoverflow.com
Server: UnKnown
Address: 192.168.1.1
Risposta da un server non autorevole: //italian comment
Nome: stackoverflow.com.home
Address: 54.72.52.58
if this fails or replies with high latency try to change your DNS to Google DNS.
Primary DNS: 8.8.8.8
Secondary DNS: 8.8.4.4

Related

VMWare on Windows - Disabling Internet for CentOS7 VM without disabling network access

I need two things:
Disabled Internet access on my VM.
Enabled local network access from my VM.
I'm currently trying to replicate a bug on my CentOS7 VM which requires that I have no direct internet access, only able to connect to the web through a proxy on my local network. I've taken two paths to this so far:
Disable the Internet on my Windows machine. Why this didn't work: My VM just...froze until the internet was turned back on. Currently considering looking into the possibility of a daemon and disabling it.
Disable Internet access only on my VM. This hasn't worked yet. It's the path I'm taking right now, but everything I've tried has done the same as the above: frozen my VM, only this time in order to get it back I need to shut it down completely and restart it. Given that I have to mount drives on it to do what I need to do, it's understandable that this is a less than ideal approach. Below are images of my NAT settings and the in-VM Network UI.
I've also gone in and turned on Airplane Mode, disabled the IPv4 and IPv6 manually, and went through all the network settings to see what there was. A Google search turned up nothing except an OSX-specific workaround which I couldn't replicate on my system.
Does anybody have any suggestions?
EDIT:
The above still applies, but I'm trying to take another route to #2. What I'd like to do is shut down all traffic to my VM except from the proxy and network. However, my network is accessible only through my host machine, so I don't want to shut my host machine out entirely, just internet coming from it. Any thoughts?
You could achieve the desired effect by disabling the nameserver configuration.
Just empty the /etc/resolv.conf file (of course after making a backup for later).

How bittorrent or P2P works independently of the router settings?

This may be a silly question but I was googling a lot last days and I've just found related but not a direct answer to this. In order to express it better let me mention a comparison:
If I setup an http server in a computer behind a router , I must set port forwarding and also that computer must have an static internal IP address in order to receive the requests on that port for that particular IP address. For instance, my router does not allow port forwarding so I could not set it up for the HTTP server. However , Bittorent works like a charm behind that same router without any static IP , nothing. How bittorrent can get requests and it can also seed? How other peers will connect to my computer while seeding? I did verify that when Bittorrent is running the port it uses for example 39031, is actually open ( using yougetsignal_dot_com). How the router can be made to open the port without using its admin settings ( we can also use Bitorrent in a public hot spot where is no way to mess with the router). I know the trackers may do some help, but there are a lot of information about a decentralized way with no trackers or basically that the peers are also trackers but not details on how it works.
Finally, why this "trick" (if any) cannot be used with an HTTP server and we must always depend on the router settings ?
BitTorrent does work behind NAT, to a certain extent. It works better if port forwarding is configured, though.
BitTorrent works reasonably well behind NAT for the following reasons:
BitTorrent is peer-to-peer, and either peer can initiate a connection; therefore, communication will succeed if either of two peers is not behind NAT or properly port forwarded;
some BitTorrent clients are able to automatically set up port forwardings using uPNP or PMP;
modern BitTorrent clients use µTP instead of TCP, and some clients are able to perform UDP hole punching.

Does pinging a website increase number of hits?

I recently found the ping command on the mac. I used to it casually ping my rails heroku app. I was wondering if this type of ping, from the terminal, increases the total number of hits the website gets (obviously not unique hits).
ping is a network command not using the port 80 or http protocol.
So there's no way it can count towards a rails application hit.
More info :
http://wiki.answers.com/Q/Which_port_is_used_by_Ping_command
The ping command only pings the host, it is a network tool to check connectivity between machines, it is a different protocol from HTTP, please read this, it may help you understand a bit better what is ping http://en.wikipedia.org/wiki/Ping_%28networking_utility%29 and what is his uses.
Cheers
What Anthony said above is true. Ping uses ICMP which is lower in the stack than an http request going over port 80. Ping only sends a single packet, expecting a single packet in response which is rather small (I think 64bytes round trip).
This can however generate load on the box running your server. So be wary of excess use as you could inadvertently cause a denial of service :)

NSStream - reverse DNS lookup error

I have to open an NSStream to a wifi access point that has only a numerical address, not a name. It takes NSStream 30-40 seconds to open a socket. In experimenting, i found that telnet-ing to the AP from a windows box was instantaneous, but on a mac, connecting the same 30-40 seconds. in researching telnet, i found that the implementation is a little different on a mac, in that it by default tries to to a name lookup. reading the manual page for telnet, i found:
-N Prevents IP address to name lookup when destination host is given as an IP address.
when I used "telnet -N IP-address port", my connection was instantaneous! I suspect that this same problem is causing the delay in my NSStream connection. Is there any way to do the equivalent of setting the"-N" flag in NSStream?
It looks like NSHost is not available on Cocoa Touch, so you cannot force a host with a given address, though I don't know if that negates the need for a dns lookup.
This problem has been around since 2005, though this might not apply to Cocoa Touch libraries. In any case there is no given solution:
http://developer.apple.com/library/ios/#DOCUMENTATION/Networking/Conceptual/CFNetwork/Concepts/Concepts.html#//apple_ref/doc/uid/TP30001132-CH4-SW10
http://developer.apple.com/library/ios/#DOCUMENTATION/CoreFoundation/Reference/CFSocketRef/Reference/reference.html#//apple_ref/doc/c_ref/CFSocketCreate

Point to point network connection through firewalls

I would like to setup a network connection (RTP or UDP) between two computers at different locations, each of which is behind a NAT modem/firewall. I do not want any modification of the firewalls.
My working assumption is that I need a bot somewhere that both computers can reach (eg a shell account on an internet server). Each computer connects out to the bot and the bot allows the two computers to update and query status and to exchange data.
This is ok as far as it goes, but it means that all data travels via the bot. Is there a way I can connect the two computers without the bot, or failing that, allow the bot to drop out of the data exchange once a connection has been setup? My feeling is that there is no way to do this, but my TCP/IP is a bit rusty...
If you assume nothing on the NAT/Firewall your are correct.
Hole-Punching for example will not work with overloaded NAT (PAT) as far as I know, because the source port is randomized by the NAT device, and it maps/match both the destination public address and the picked up source port elected.
UPnP may work, but again you need to assume it exist and enabled on the NAT device.
As I see it, you got only two options if you want to be generic:
1. Configure the NAT.
2. Use a proxy (the bot you mentioned).
Skype for example uses the second, but does it in a distributed manner by using every Skype client as a potential proxy (probably only if it detects it is not behind a NAT or not limited by it).

Resources