Fix Harry's wifi

From Finninday
Jump to: navigation, search

Background

A friend suffers from crappy wifi. I keep telling him that I'll fix it, but I haven't yet. We spend time talking or eating instead of poking at the wifi. Before I go over again, I want to have a streamlined process for diagnosing the problem with all the necessary tools pre-loaded on my laptop so I can look like a rock star.

So I'm practicing on our wifi and trying to make sure I've got all my tools together. These procedures assume that I have access to an Android phone and a linux laptop both on the wifi network of interest.

Tools

Details

Android Wifi Analyzer for signal strength

At home I get a maximum signal of about -50 db from Portlandia when the phone is less than 5 feet from it. I get about -75 db from ahub which is one floor down from the phone.

Identify protocol

Standard android wifi settings page tells me link speed, security type, and IP.

  • Portlandia: 54Mbps (802.11g)
  • ahub: 36Mbps (mixed 802.11b+g)

Other possibilities are:

  • 802.11n (2009) up to 150Mbps
  • 802.11ac (2012) up to 866Mbps

see what dhcp is giving us

root@ferret:~# less /var/lib/dhcp/dhclient.leases

lease {
  interface "eth0";
  fixed-address 10.0.0.6;
  option subnet-mask 255.0.0.0;
  option routers 10.0.0.3;
  option dhcp-lease-time 43200;
  option dhcp-message-type 5;
  option domain-name-servers 8.8.8.8,8.8.4.4;
  option dhcp-server-identifier 10.0.0.3;
  option domain-name "finninday.net";
  renew 0 2013/11/24 04:12:33;
  rebind 0 2013/11/24 08:53:29;
  expire 0 2013/11/24 10:23:29;
}

what does the routing table look like?

root@ferret:~# ip route list
default via 10.0.0.3 dev eth0  proto static 
10.0.0.0/8 dev eth0  proto kernel  scope link  src 10.0.0.6  metric 1 

root@ferret:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.3        0.0.0.0         UG    0      0        0 eth0
10.0.0.0        0.0.0.0         255.0.0.0       U     1      0        0 eth0

measure ping time and packet loss to default gateway with mtr

  • on a wired network ping time is between 0.2 and 0.4ms
  • across portlandia ping time between a desktop and a tablet is between 1.9 and 99ms. Average is 57ms.
  • there is no measurable packet loss

use firebug net to measure stages of web page load

Location DNS ms Connecting ms Sending ms Waiting ms Receiving ms Notes
Home wired 35 0 0 228 56
Harlans 0 120 0 307 174 Used Chrome. Funny that it doesn't show slow DNS.

how many hops to DNS?

At home I have 14 hops.

root@ferret:~# mtr --report 8.8.8.8
Start: Tue Feb  4 18:09:22 2014
HOST: ferret                      Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- weasel.local               0.0%    10    0.1   0.1   0.1   0.2   0.0
  2.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  3.|-- xe-0-0-3-sur03.troutdale.  0.0%    10    8.1   8.0   4.9  13.7   2.2
  4.|-- ae-53-0-ar03.beaverton.or  0.0%    10    9.2  18.3   7.6  69.6  20.3
  5.|-- ae-1-0-ar03.troutdale.or.  0.0%    10    7.5  13.7   7.5  43.6  11.6
  6.|-- he-2-0-0-0-11-cr01.seattl  0.0%    10   13.3  13.7  11.6  15.2   1.1
  7.|-- be-10-pe03.seattle.wa.ibo  0.0%    10   15.1  13.1  12.0  15.1   0.7
  8.|-- as15169-1-c.seattle.wa.ib  0.0%    10   17.8  13.7  12.1  17.8   1.7
  9.|-- 209.85.249.32              0.0%    10   11.6  12.0  10.9  13.1   0.3
 10.|-- 66.249.94.199              0.0%    10   12.6  13.1  11.9  15.4   1.1
 11.|-- 216.239.46.200             0.0%    10   20.0  19.5  18.4  21.6   0.8
 12.|-- 216.239.48.167             0.0%    10   20.7  19.4  15.1  22.8   1.9
 13.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
 14.|-- google-public-dns-a.googl  0.0%    10   19.1  19.5  15.9  22.7   1.9

At Harlan's there are 11 hops, but it is slower. Almost 100ms just to get to DNS.

[root@servo rday]# mtr --report 8.8.8.8
Start: Fri May  2 16:10:55 2014
HOST: servo.finninday.net         Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- dslmodem.domain            0.0%    10    2.1   1.9   1.7   2.1   0.0
  2.|-- lactwahed11                0.0%    10   30.7  31.8  30.7  34.4   1.1
  3.|-- lsancarccor52              0.0%    10   54.1  52.8  51.6  54.1   0.6
  4.|-- lsancarccor52              0.0%    10   52.8  52.7  51.9  53.1   0.0
  5.|-- 72.14.234.45              70.0%    10   53.9  60.0  53.9  72.3  10.6
  6.|-- 64.233.174.188             0.0%    10   53.0  53.4  52.2  55.8   0.9
  7.|-- 216.239.46.154             0.0%    10  102.2 100.1  95.4 111.6   6.0
  8.|-- 216.239.46.55              0.0%    10   95.8  95.5  94.2  97.9   0.7
  9.|-- 216.239.46.191             0.0%    10   95.1  98.7  94.1 132.4  11.8
 10.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
 11.|-- google                     0.0%    10   94.4  94.9  94.4  95.7   0.0

how fast is DNS?

I can expect a response in 20 to 35 ms.

root@ferret:~# dig finninday.net

; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1.1 <<>> finninday.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28458
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;finninday.net.			IN	A

;; ANSWER SECTION:
finninday.net.		217	IN	A	216.99.216.99

;; Query time: 20 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Feb 04 18:07:56 PST 2014
;; MSG SIZE  rcvd: 58

Harlan DNS is slower. Over 100ms.

[root@servo rday]# dig finninday.net

; <<>> DiG 9.9.4-P2-RedHat-9.9.4-12.P2.fc20 <<>> finninday.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61312
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;finninday.net.			IN	A

;; ANSWER SECTION:
finninday.net.		410	IN	A	216.99.216.99

;; AUTHORITY SECTION:
finninday.net.		79345	IN	NS	yns2.yahoo.com.
finninday.net.		79345	IN	NS	yns1.yahoo.com.

;; ADDITIONAL SECTION:
yns1.yahoo.com.		63133	IN	A	67.195.1.92
yns2.yahoo.com.		63133	IN	A	98.139.247.192

;; Query time: 117 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Fri May 02 16:09:15 PDT 2014
;; MSG SIZE  rcvd: 126

measure bandwidth with curl

The curl manual says the speed is measured in bytes per second.

Over a wired link, I get this:

root@ferret:~# curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 20  500M   20  103M    0     0  5683k      0  0:01:30  0:00:18  0:01:12 6896k^C

Over Portlandia, I get about 2MBps out of a theoretical max of 6.75MBps:

[rday@servo lf]$ curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  7  500M    7 38.2M    0     0  1595k      0  0:05:20  0:00:24  0:04:56 1936k^C

Over ahub, I get about 2.6MBps out of a theoretical max of 4.5 to 6.75MBps:

[rday@servo lf]$ curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 11  500M   11 56.3M    0     0  2397k      0  0:03:33  0:00:24  0:03:09 2632k^C