Fix Harry's wifi

From Finninday
Revision as of 15:36, 25 February 2014 by Rday (Talk | contribs)

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

  • DNS lookup
  • Connecting
  • Sending
  • Waiting
  • Receiving

At home on wired network visiting finninday.net Main_page:

DNS Connecting Sending Waiting Receiving
35ms 0 0 228ms 56ms

how many hops to DNS?

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

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

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