官术网_书友最值得收藏!

Testing and benchmarking your network

These are essential tests that can be carried out to troubleshoot network problems. You can also use some of these advanced techniques to benchmark your network.

Basic tests

The simplest way to check whether you are connected to the Internet is to ping a remote address.

Note

The following tests were carried out over Wi-Fi to not only test the reliability of the Wi-Fi connection but to also achieve the best stability; it is always recommended that you use an Ethernet connection. These examples demonstrate the various bottlenecks that you may encounter when using Wi-Fi.

We can ping http://www.google.com, but we can also use shorthand and an easy-to-remember IP address, such as 8.8.8.8, which is Google's public DNS server. This IP address will resolve to the nearest Google DNS server in your area, and even if it goes down, there are many backup servers, making this a reliable test:

ping -c 1 google.com
ping -c 1 8.8.8.8
Basic tests

A ping can help you determine whether you have access to the Internet. You may want to check how fast you can download files to the Raspberry Pi. We will use popular website, http://www.speedtest.com, to help us do this directly in the command line. This can be represented in one line:

wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip

My Raspberry Pi is connected to a fast wireless network connection, which is connected to a 75 megabit downstream-capable ISP. In the following screenshot, you can see that I've achieved about 4.27 megabytes. This varies greatly from site to site. The server used here is in America.

Basic tests

Advanced benchmarking tools

You may be a bit more serious about the performance of your network. Here are a few advanced ways to push your network to the maximum.

A speedtest application

There is a speed test application available on GitHub. It offers more advanced options than the command-line technique we used earlier as it automatically picks the nearest server and starts downloading a large file from there. The benefit of using the closest server will better demonstrate the maximum capacity of your wireless network or your ISP downstream using a wired connection.

Furthermore, the application also benchmarks your upstream bandwidth. This may be important to you if you were thinking of hosting applications for public Internet usage.

We will need to install git using aptitude's package manager. We do this by typing apt-get in the command line:

sudo apt-get install git-core

Follow the on-screen instruction to install the git package. Using the /tmp directory is ideal for short term applications. This directory in Raspbian is cleared out on each reboot or power failure. If you wish to keep the speed test application for future use, create a new directory in your home directory and update the path appropriately:

cd /tmp
git clone https://github.com/sivel/speedtest-cli.git
cd speedtest-cli
./speedtest_cli.py

iPerf

iPerf is a network administrator's secret tool that is included with Raspbian. It is a tool that tests a network by creating TCP and UDP streams. iPerf has client and server functionality, so it requires another computer, which known as the server. This can be another Raspberry Pi or computer that has iPerf installed on it.

This application will push the boundaries of your network interface and architecture. You can also use iPerf is to detect packet loss in a complex network, such as the Internet. If you have a virtual machine on the Internet, try installing iPerf on it and comparing the results of your local network against those found on the Internet. Let's install iPerf on the Raspberry Pi and remote computer:

sudo apt-get install iperf

The server will be listening for a connections type, so type the following:

iperf –s

The client will show you all the statistics related to the tests that are carried out:

iperf –c <ip address of server or domain name of public server>

Recommended bandwidth

A basic bandwidth of 256 kilobits of an up-and downstream is recommended for low use hosting of any kind. You can get away with 64 kilobits for personal use in the form of a basic website or the transfer of text data such as JSON.

It is standard practice for home ISP providers to supply you with a much larger downstream bandwidth, and with many countries reclassifying the Internet as a public utility, access to it should be faster and easier than before. But there is one main difference between home and business packages: it is the upstream bandwidth that matters when trying to serve content to users on the Internet. Typically, home Internet is only a fraction of the downstream, whereas businesses get a larger portion of the upstream, sometimes even equal, by purchasing Synchronous DSL (SDSL).

If you plan on using VoIP with Asterisk, a small upstream might cause terrible delays and jitters. But Asterisk comes licensed with GSM codecs that should work with an upstream bandwidth of 64 kilobits for a single call. You may purchase closed source codecs that work on much slower connections at the cost of voice quality.

Recommended bandwidth
主站蜘蛛池模板: 澄城县| 依安县| 古田县| 深州市| 铜山县| 息烽县| 山西省| 玉溪市| 营口市| 蒙阴县| 汉寿县| 镇原县| 班玛县| 临沭县| 宣汉县| 疏附县| 泾源县| 资源县| 萍乡市| 容城县| 安达市| 旌德县| 巴彦县| 突泉县| 托里县| 岳池县| 上饶县| 嘉祥县| 蓬溪县| 北宁市| 虞城县| 日喀则市| 霍州市| 安泽县| 全南县| 河间市| 南投市| 习水县| 大余县| 湖州市| 全椒县|