nuttcp — тестирование пропускной способности

Finally, we’ll take a look at nuttcp, which includes many options for tweaking buffer lengths, nodelay options, and type of service fields to see what impact this has on your network performance. nuttcp can show either overall bandwidth or the bandwidth achieved in the last second.

nuttcp is available in the Fedora 9 repositories but not for openSUSE or Ubuntu. Build and installation is shown below:

tar xjvf nuttcp-5.5.5.tar.bz2
cd ./nuttcp*
cc -O3 -o nuttcp nuttcp-5.5.5.c
strip nuttcp
sudo install -m 555 nuttcp /usr/local/bin/

Start the server using nuttcp -S. The client can be invoked with many options, followed by the server host name(s) at the end of the command line. The below test prints the bandwidth every second (specified by the -i1 option) while the test is running and runs for 10 seconds before completing.

$ nuttcp  -v -v -i1  192.168.10.210

nuttcp-t: v5.5.5: socket
nuttcp-t: buflen=65536, nstream=1, port=5001 tcp -> 192.168.10.210
nuttcp-t: time limit = 10.00 seconds
nuttcp-t: connect to 192.168.10.210 with mss=1448
nuttcp-t: send window size = 8192, receive window size = 43690
nuttcp-r: v5.5.5: socket
nuttcp-r: buflen=65536, nstream=1, port=5001 tcp

nuttcp-r: interval reporting every 1.00 second
nuttcp-r: accept from 192.168.0.200
nuttcp-r: send window size = 8192, receive window size = 43690

   85.3719 MB /   1.00 sec =  715.9765 Mbps
   86.3684 MB /   1.00 sec =  724.5411 Mbps
   85.9188 MB /   1.00 sec =  720.7551 Mbps
   84.4201 MB /   1.00 sec =  708.2533 Mbps
   87.7772 MB /   1.00 sec =  736.2222 Mbps
   86.7372 MB /   1.00 sec =  727.5696 Mbps
   91.4327 MB /   1.00 sec =  767.0191 Mbps
   89.4166 MB /   1.00 sec =  750.2228 Mbps
   85.4859 MB /   1.00 sec =  717.0937 Mbps
   87.0377 MB /   1.00 sec =  729.9696 Mbps

nuttcp-t: 870.1633 MB in 10.00 real seconds = 89091.75 KB/sec = 729.8396 Mbps
nuttcp-t: 13923 I/O calls, msec/call = 0.74, calls/sec = 1392.10
nuttcp-t: 0.0user 22.3sys 0:10real 224% 0i+0d 0maxrss 0+3pf 16198+1383csw

nuttcp-r: 870.1633 MB in 10.00 real seconds = 89083.52 KB/sec = 729.7722 Mbps
nuttcp-r: 55254 I/O calls, msec/call = 0.19, calls/sec = 5524.09
nuttcp-r: 0.0user 6.7sys 0:10real 67% 0i+0d 0maxrss 0+20pf 62619+635csw

You can also run multiple streams at once; use -N3 to start three connections, for example. The -B option makes the client receive traffic only, while the -D option transmits only. The default is for communication in both directions.

$ nuttcp  -v -v -N3 -B  192.168.10.210

nuttcp-t: v5.5.5: socket
nuttcp-t: buflen=65536, nstream=3, port=5001 tcp -> 192.168.10.210
nuttcp-t: time limit = 10.00 seconds
nuttcp-t: connect to 192.168.10.210 with mss=1448
nuttcp-t: send window size = 8192, receive window size = 43690
nuttcp-t: 1239.8698 MB in 10.00 real seconds = 126944.75 KB/sec = 1039.9314 Mbps
nuttcp-t: 19838 I/O calls, msec/call = 0.52, calls/sec = 1983.52
nuttcp-t: 0.0user 41.2sys 0:10real 413% 0i+0d 0maxrss 0+3pf 4758+3081csw

nuttcp-r: v5.5.5: socket
nuttcp-r: buflen=65536, nstream=3, port=5001 tcp
nuttcp-r: accept from 192.168.0.200
nuttcp-r: send window size = 8192, receive window size = 43690
nuttcp-r: 1239.8698 MB in 10.00 real seconds = 126934.93 KB/sec = 1039.8509 Mbps
nuttcp-r: 29899 I/O calls, msec/call = 0.34, calls/sec = 2989.25
nuttcp-r: 0.0user 8.5sys 0:10real 86% 0i+0d 0maxrss 0+18pf 12519+1847csw

$ nuttcp  -v -v -N3 -D  192.168.10.210
...
nuttcp-r: v5.5.5: socket
nuttcp-r: buflen=65536, nstream=3, port=5001 tcp
nuttcp-r: accept from 192.168.0.200
nuttcp-r: send window size = 8192, receive window size = 43690
nuttcp-r: 806.2317 MB in 10.00 real seconds = 82545.65 KB/sec = 676.2140 Mbps
nuttcp-r: 67104 I/O calls, msec/call = 0.15, calls/sec = 6709.39
nuttcp-r: 0.0user 5.7sys 0:10real 57% 0i+0d 0maxrss 0+18pf 73018+378csw

nuttcp provides similar options to nepim and is heavily focused on measuring the network bandwidth between hosts. Using -i1 with nuttcp, and by default with nepim, you see the bandwidth statistics printed every second while the test is taking place. The nuttcp man page shows many options for the type of service and buffer sizes that you can explicitly set when running nuttcp so you can see if your particular hardware and drivers do not perform well in certain configurations. Running nepim —help will show many more options for configuring the buffers, window sizes, and TCP options.

It is a matter of personal convenience whether you should use nuttcp or nepim. Since nepim is packaged for openSUSE and nuttcp is packaged for Fedora, it might boil down to what distribution you are running as to which of these two tools to use.

Both nepim and nuttcp provide options for setting the size of network packet queues and other more advanced options, such as the TCP maximum segment size, in order to improve the network performance by changing the software setup at each end. Meanwhile, the LMbench tests are quick to run and provide useful insight into your available bandwidth and latencies on your network link.

Read in the original layout at: http://www.linux.com/archive/feature/144532

Asterisk на Linux. Моя версия ))

Пример приводится для 64-битных процессоров. Использовал дешевую E1-карту Digium TE110P. Asterisk собирался из исходников.

Установка и настройка ОС

Устанавливаем и обновляем систему.

Ставим пакеты:

make
gcc
cpp
g++
linux-headers-2.6.26-2-amd64
bison
ncurses-dev
mysql-client
libmysqlclient-dev
libnewt-dev
php-gd

mpg123
sox

Установка и настройка ISDN-карты

Устанавливаем карту.

Качаем драйверы:

http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4.11.tar.gz
http://downloads.asterisk.org/pub/telephony/dahdi-linux/dahdi-linux-2.3.0.1.tar.gz
http://downloads.asterisk.org/pub/telephony/dahdi-tools/dahdi-tools-2.3.0.tar.gz

Очень желательно соблюдать очередность установки драйверов и самого Asterisk’а.

Установка драйверов:

LibPRI

make
make install

DAHDI

make
make install

DAHDI Tools

./configure
make menuselect
make
make install

Установка и настройка Asterisk

Качаем:
http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.4.32-rc1.tar.gz
http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.4.11.tar.gz

Устанавливаем:

*Asterisk

./configure
make menuselect
make
make install

*Asterisk Addons

./configure
make menuselect
make
make install

Перезагружаемся.

Проверяем работу драйвера и ISDN-карты

У нас используется карта [[Digium TE110P]].

Настройки драйвера:

»’cat /etc/dahdi/system.conf»’

span=1,1,0,ccs,hdb3
bchan=1-15,17-31
dchan=16
echocanceller=mg2,1-15,17-31
loadzone=ru
defaultzone=ru

»’cat /etc/asterisk/chan_dahdi.conf»’

[trunkgroups]

[channels]

context=from-fwd
switchtype=euroisdn
signalling=pri_cpe
usecallerid=yes
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes

group=1
callgroup=1
pickupgroup=1
channel => 1-15
channel => 17-31

Проверяем, загрузился ли модуль:

»’lsmod | sort»’

Module                  Size  Used by
...
crc_ccitt               6528  2 dahdi,hisax
dahdi                 204368  74 dahdi_echocan_mg2,wcte11xp
dahdi_echocan_mg2      10248  31
isdn                  127584  1 hisax
slhc                   10240  1 isdn
wcte11xp               28960  31
....

Проверяем, видит ли DAHDI нашу карту ([[Digium TE110P]]):

»’dahdi_cfg -vvvvvvvv»’

DAHDI Tools Version - 2.3.0

DAHDI Version: 2.3.0.1
Echo Canceller(s): MG2
Configuration
======================

SPAN 1: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)

Channel map:

Channel 01: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 01)
Channel 02: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 02)
...
Channel 14: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 14)
Channel 15: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 15)
Channel 16: D-channel (Default) (Echo Canceler: none) (Slaves: 16)
Channel 17: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 17)
...
Channel 30: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 30)
Channel 31: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 31)

31 channels to configure.

Setting echocan for channel 1 to mg2
Setting echocan for channel 2 to mg2
...
Setting echocan for channel 14 to mg2
Setting echocan for channel 15 to mg2
Setting echocan for channel 16 to none
Setting echocan for channel 17 to mg2
...
Setting echocan for channel 30 to mg2
Setting echocan for channel 31 to mg2

Проверяем настройки DAHDI:

»’dahdi_scan»’

[1]
active=yes
alarms=OK
description=Digium Wildcard TE110P T1/E1 Card 0
name=WCT1/0
manufacturer=Digium
devicetype=Digium Wildcard TE110P T1/E1
location=PCI Bus 03 Slot 02
basechan=1
totchans=31
irq=19
type=digital-E1
syncsrc=0
lbo=0 db (CSU)/0-133 feet (DSX-1)
coding_opts=HDB3
framing_opts=CCS,CRC4
coding=HDB3
framing=CCS

'''dahdi_tool'''
...

Конфигурация Asterisk

Копируем из бэкапа сервера телефонии содержимое папки /etc/asterisk/.

Автозагрузка Asterisk

Обычно Asterisk ставит init-скрипт для загрузки самостоятельно.

Можно использовать для этого стандартный вызов из файла /etc/init.d/rc.local:

/usr/sbin/asterisk -f -vvvg -c

Или лучше:

Скопировать из исходников Asterisk /usr/src/install_asterisk/asterisk-1.4.19/contrib/init.d/rc.debian.asterisk в /etc/init.d/asterisk

chmod 755 /etc/init.d/asterisk
cd /etc/init.d
# для удаления из автозагрузки
update-rc.d -f asterisk remove

# для установки в автозагрузку
update-rc.d asterisk defaults

Доступ к консоли Asterisk

"asterisk -Rvvv"

-r — Подключение к Asterisk на текущей системе
-R — Тоже самое, что и ключ -r, но при разсоединения происходит переподключение
-v — Больше подробностей при выводе (чем больше «v», тем больше подробностей)

Дополнительные пояснения искать тут:

http://itinfusion.ca/2007/05/06/howto-installing-asterisk-on-debian-etch/

Hamachi на Linux’е

Установка
1. Добавление репозитория в систему (Debian/Ubuntu):

echo "deb http://joe.emenaker.com/debian ./" | sudo tee -a /etc/apt/sources.list
sudo aptitude update

2. Установка Hamachi:

sudo apt-get install hamachi

3. Настройка Hamachi

Hamachi размещен в папке /usr/bin/, там же размещен и hamachi-init.

Генерация ключей:

sudo hamachi-init

Запуск Hamachi:

sudo hamachi start

Регистрации аккаунта и входа в сеть:

hamachi login

Присоединение к существующей сети:

sudo hamachi join название_сети

Статус on-line в сети:

sudo hamachi go-online название сети

Список всех членов сети и их статус:

hamachi list

Выход из сети и закрытие Hamachi:

sudo hamachi stop

Смена ника:

hamachi set-nick желаемый_ник

Официальный сайт http://www.hamachi.cc