This chapter will serve as an installation guide for the software that will be used to monitor the traffic on your local network. These utilities can help determine which devices on your network are hogging the bandwidth, which slows down the network for other devices on your network. Here are the topics that we are going to cover in this chapter:
Traceroute is a tool that can show the path from one node on a network to another. This can help determine the ideal placement of a router to maximize wireless bandwidth in order to stream music and videos from the BeagleBone server to remote devices. Traceroute can be installed with the following command:
apt-get install traceroute
Once Traceroute is installed, it can be run to find the path from the BeagleBone to any server anywhere in the world. For example, here's the route from my BeagelBone to the Canadian Google servers:
Now, it is time to decipher all the information that is presented. This first command line tells traceroute the parameters that it must use:
traceroute to google.ca (74.125.225.23), 30 hops max, 60 byte packets
This gives the hostname, the IP address returned by the DNS server, the maximum number of hops to be taken, and the size of the data packet to be sent. The maximum number of hops can be changed with the –m
flag and can be up to 255
. In the context of this book, this will not have to be changed.
After the first line, the next few lines show the trip from the BeagleBone, through the intermediate hosts (or hops), to the Google.ca
server. Each line follows the following format:
hop_number host_name (host IP_address) packet_round_trip_times
From the command that was run previously (specifically hop number 4
):
2 10.149.206.1 (10.149.206.1) 15.335 ms 17.319 ms 17.232 ms
Here's a breakdown of the output:
2
: This is a count of the number of hosts between this host and the originating host. The higher the number, the greater is the number of computers that the traffic has to go through to reach its destination.10.149.206.1
: This denotes the hostname. This is the result of a reverse DNS lookup on the IP address. If no information is returned from the DNS query (as in this case), the IP address of the host is given instead.(10.149.206.1)
: This is the actual host IP address.Sometimes, the traceroute will return some asterisks (*
). This indicates that the packet has not been acknowledged by the host. If there are consecutive asterisks and the final destination is not reached, then there may be a routing problem. In a local network trace, it most likely is a firewall that is blocking the data packet.
My Traceroute (MTR) is an extension of traceroute, which probes the routers on the path from the packet source and destination, and keeps track of the response times of the hops. It does this repeatedly so that the response times can be averaged.
Now, install mtr
with the following command:
sudo apt-get install mtr
After it is run, mtr
will provide quite a bit more information to look at, which would look like the following:
While the output may look similar, the big advantage over traceroute is that the output is constantly updated. This allows you to accumulate trends and averages and also see how network performance varies over time.
When using traceroute, there is a possibility that the packets that were sent to each hop happened to make the trip without incident, even in a situation where the route is suffering from intermittent packet loss. The mtr
utility allows you to monitor this by gathering data over a wider range of time.
Here's an mtr
trace from my BeagleBone to my Android smartphone:
Here's another trace, after I changed the orientation of the antennae of my router:
As you can see, the original orientation was almost 100 milliseconds faster for ping traffic.