Kudos to Amtrak for having free Wi-Fi. But the network quality is dependent on a mobile data connection, which varies throughout the trip. Meanwhile, I also have tethering on my phone.
One might guess that the connection quality would be pretty much identical between the two, since they both rely on similar or the same networks over the same geographic areas. One might also guess that the Amtrak connection would be consistently better, since they presumably have bigger and higher-up antennas.
Both of these are not consistently true. Sometime when the Amtrak connection cuts out, I can switch to tethering and get decent or good signal. My phone is on T-Mobile, maybe Amtrak is on Verizon or AT&T. Or maybe the Amtrak hardware is just older/different.
In any case, knowing this, I want to optimize which connection I'm on throughout my trip. But how to test this other than with trial and error when my connection cuts out?
Here's what I've come up with. First, figure out the IP addresses assigned to each adapter, using
ifconfig. Here's what the output looks like for me (I've redacted my MAC addresses with "---").
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
media: autoselect (none)
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 10.83.104.223 netmask 0xfffffc00 broadcast 10.83.107.255
fw0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 4078
media: autoselect <full-duplex>
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
en6: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe80::d896:95ff:fe00:79eb%en6 prefixlen 64 scopeid 0x8
inet 172.20.10.2 netmask 0xfffffff0 broadcast 172.20.10.15
media: 100baseTX <full-duplex>
For me, Wi-Fi is en1 and tethering is en6.
Then, in two terminal windows, continually send out pings through each adapter. This is achieved with the
-S flag. The
-i flag specifies to ping every 10 seconds. I chose to ping google because they are reliable and I don't feel guilty about using their resources. If anyone has an idea for a more neutral or useful entity for this purpose let me know.
ping -S 10.83.104.223 -i 10 126.96.36.199
ping -S 172.20.10.2 -i 10 188.8.131.52
Now, just keep these running. What you end up with is an ongoing history of recent network quality. Both the ping times and the incidents of failure can be used to eyeball which connection has been more reliable in the last few minutes.
To switch between adapters, you could drag around their order in network settings (in OS X). This involves a lot of steps though. I've found that simply leaving Wi-Fi prioritized above tethering and then turning Wi-Fi on and off from the menu bar is sufficient. The drawback is that when Wi-Fi is off you can't monitor the connection quality anymore. I've found that this is still overall an effective way to go about it. I just leave tethering on until I find a problem, then turn on Wi-Fi for 20 seconds, compare them, and go from there. It sounds like a lot of overhead but overall it works out well.
Ta-Da! Happy Amtraking.