netperf を macOS と Linux へインストールして TCP, UDP レイテンシ(遅延)を測定してみてみた

[クラウドでのネットワーク レイテンシの測定](https://cloud.google.com/blog/ja/products/networking/using-netperf-and-ping-to-measure-network-latency?hl=ja)より
クラウド アーキテクトによく寄せられる質問の一つに、「2 つのエンドポイント間でリクエストとレスポンスをどの程度まで迅速に交換できるのですか？」というのがあります。ネットワークのラウンドトリップ レイテンシを測定するツールには ping、iperf、netperf などがありますが、すべてが同じように実装、構成されるわけではないため、ツールによって結果が異なる場合があります。ほとんどの場合、この質問に対する代表的な回答が得られるツールは、netperf であると考えられます。
netperfコマンドは、単一リージョン内の単一のゾーンにある 2 台のマシン間でゾーン内レイテンシ ベンチマークを実行します。このようなゾーン内ベンチマークを使用することで、緊密に連携するマシン間の非常に低いレイテンシをマイクロ秒単位で示すことができます。
ということで、詳しい内容は この情報を読むということで、netperf を macOS と Linux(Redhat と Debian系)へインストールして実行してみてみます。


# ■ Macbook へのインストール
## ● Homebrewホームページ
・Homebrew netperf URL: https://formulae.brew.sh/formula/netperf

![01_netperf.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/109087/13ad5948-551b-4cdf-ab73-f337f8f6b933.png)

## ● netperfインストール
```
shirok@macbook ~ % brew install netperf
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:bbb73a9d86fa37128c54c74b020096a646c46c525fd5eb0c4a2467551fb2d377
########################################################################################################################################## 100.0%
==> Pouring portable-ruby-3.3.2.arm64_big_sur.bottle.tar.gz
==> homebrew/core is old and unneeded, untapping to save space...
Untapping homebrew/core...
Untapped 3 commands and 7096 formulae (7,477 files, 822.8MB).
==> homebrew/cask is old and unneeded, untapping to save space...
Untapping homebrew/cask...
Untapped 6927 casks (4,510 files, 414.7MB).
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
ansible-creator              fern-api                     kuzu                         oj                           stripe-cli
apache-flink-cdc             ffmpeg@6                     lexido                       openfa                       stripe-mock
autotrace                    flawz                        liblc3                       parsedmarc                   superfile

・・・

font-hedvig-letters-sans                         font-open-iconic                                 zulu@17
font-hedvig-letters-serif                        font-open-sans                                   zulu@21
font-heebo                                       font-open-sans-hebrew                            zulu@8

You have 8 outdated formulae installed.

==> Downloading https://ghcr.io/v2/homebrew/core/netperf/manifests/2.7.0-1
########################################################################################################################################## 100.0%
==> Fetching netperf
==> Downloading https://ghcr.io/v2/homebrew/core/netperf/blobs/sha256:dbb69e91e2bbb449c4b6ce47a4a3e624461262ed275327236afd7b83af588778
########################################################################################################################################## 100.0%
==> Pouring netperf--2.7.0.arm64_sonoma.bottle.1.tar.gz
🍺  /opt/homebrew/Cellar/netperf/2.7.0: 12 files, 608.3KB
==> Running `brew cleanup netperf`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> `brew cleanup` has not been run in the last 30 days, running now...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
```

## ● 確認
```
shirok@macbook~ % netperf -h

Usage: netperf [global options] -- [test options]

Global options:
    -a send,recv      Set the local send,recv buffer alignment
    -A send,recv      Set the remote send,recv buffer alignment
    -B brandstr       Specify a string to be emitted with brief output
    -c [cpu_rate]     Report local CPU usage
    -C [cpu_rate]     Report remote CPU usage
    -d                Increase debugging output
    -D time,[units] * Display interim results at least every time interval
                      using units as the initial guess for units per second
                      A negative value for time will make heavy use of the
                      system's timestamping functionality
    -f G|M|K|g|m|k    Set the output units
    -F lfill[,rfill]* Pre-fill buffers with data from specified file
    -h                Display this text
    -H name|ip,fam *  Specify the target machine and/or local ip and family
    -i max,min        Specify the max and min number of iterations (15,1)
    -I lvl[,intvl]    Specify confidence level (95 or 99) (99)
                      and confidence interval in percentage (10)
    -j                Keep additional timing statistics
    -l testlen        Specify test duration (>0 secs) (<0 bytes|trans)
    -L name|ip,fam *  Specify the local ip|name and address family
    -o send,recv      Set the local send,recv buffer offsets
    -O send,recv      Set the remote send,recv buffer offset
    -n numcpu         Set the number of processors for CPU util
    -N                Establish no control connection, do 'send' side only
    -p port,lport*    Specify netserver port number and/or local port
    -P 0|1            Don't/Do display test headers
    -r                Allow confidence to be hit on result only
    -s seconds        Wait seconds between test setup and test start
    -S                Set SO_KEEPALIVE on the data connection
    -t testname       Specify test to perform
    -T lcpu,rcpu      Request netperf/netserver be bound to local/remote cpu
    -v verbosity      Specify the verbosity level
    -W send,recv      Set the number of send,recv buffers
    -v level          Set the verbosity level (default 1, min 0)
    -V                Display the netperf version and exit
    -y local,remote   Set the socket priority
    -Y local,remote   Set the IP_TOS. Use hexadecimal.
    -Z passphrase     Set and pass to netserver a passphrase

For those options taking two parms, at least one must be specified;
specifying one value without a comma will set both parms to that
value, specifying a value with a leading comma will set just the second
parm, a value with a trailing comma will set just the first. To set
each parm to unique values, specify both and separate them with a
comma.

* For these options taking two parms, specifying one value with no comma
will only set the first parms and will leave the second at the default
value. To set the second value it must be preceded with a comma or be a
comma-separated pair. This is to retain previous netperf behaviour.

```

# ■ Redhut(RHEL)系 (Oracle Linux等)へのインストール
yumリポジトリにない場合、Webサイトからダウンロードしてインストールします。
　・参考: [The Netperf Homepage](https://hewlettpackard.github.io/netperf/)

 https://hewlettpackard.github.io/netperf/

Oracle Linuxでは エンタープライズ Linux 用の拡張パッケージ [Oracle Linux Repositories](https://yum.oracle.com/) Webサイトに netperfが RPMで提供されています。
Oracle Linux 8の場合は次にあります。

https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/x86_64/


## ● Install実行
```
[root@tokyo-inst01 ~]# yum install https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/x86_64/getPackage/netperf-2.7.0-1.20210803git3bc455b.el8.x86_64.rpm
	This system is receiving updates from OSMS server.
	Last metadata expiration check: 2:24:44 ago on Wed 17 Jan 2024 11:52:39 AM GMT.
	netperf-2.7.0-1.20210803git3bc455b.el8.x86_64.rpm                                                                  2.9 MB/s | 677 kB     00:00
	Dependencies resolved.
	===================================================================================================================================================
	 Package                     Architecture               Version                                             Repository                        Size
	===================================================================================================================================================
	Installing:
	 netperf                     x86_64                     2.7.0-1.20210803git3bc455b.el8                      @commandline                     677 k
	
	Transaction Summary
	===================================================================================================================================================
	Install  1 Package
	
	Total size: 677 k
	Installed size: 1.5 M
	Is this ok [y/N]: y
	Downloading Packages:
	Running transaction check
	Transaction check succeeded.
	Running transaction test
	Transaction test succeeded.
	Running transaction
	  Preparing        :                                                                                                                           1/1
	  Installing       : netperf-2.7.0-1.20210803git3bc455b.el8.x86_64                                                                             1/1
	  Running scriptlet: netperf-2.7.0-1.20210803git3bc455b.el8.x86_64                                                                             1/1
	  Verifying        : netperf-2.7.0-1.20210803git3bc455b.el8.x86_64                                                                             1/1
	
	Installed:
	  netperf-2.7.0-1.20210803git3bc455b.el8.x86_64
	
	Complete!
```

## ● インストール確認
**1) Version 情報確認**
```
[root@tokyo-inst01 ~]# netperf -V
	Netperf version 2.7.1
```

**2) Help 情報確認**
```
[root@tokyo-inst01 ~]# netperf -h
	
	Usage: netperf [global options] -- [test options]
	
	Global options:
	    -a send,recv      Set the local send,recv buffer alignment
	    -A send,recv      Set the remote send,recv buffer alignment
	    -B brandstr       Specify a string to be emitted with brief output
	    -c [cpu_rate]     Report local CPU usage
	    -C [cpu_rate]     Report remote CPU usage
	    -d                Increase debugging output
	    -D time,[units] * Display interim results at least every time interval
	                      using units as the initial guess for units per second
	                      A negative value for time will make heavy use of the
	                      system's timestamping functionality
	    -f G|M|K|g|m|k    Set the output units
	    -F lfill[,rfill]* Pre-fill buffers with data from specified file
	    -h                Display this text
	    -H name|ip,fam *  Specify the target machine and/or local ip and family
	    -i max,min        Specify the max and min number of iterations (15,1)
	    -I lvl[,intvl]    Specify confidence level (95 or 99) (99)
	                      and confidence interval in percentage (10)
	    -j                Keep additional timing statistics
	    -l testlen        Specify test duration (>0 secs) (<0 bytes|trans)
	    -L name|ip,fam *  Specify the local ip|name and address family
	    -o send,recv      Set the local send,recv buffer offsets
	    -O send,recv      Set the remote send,recv buffer offset
	    -n numcpu         Set the number of processors for CPU util
	    -N                Establish no control connection, do 'send' side only
	    -p port,lport*    Specify netserver port number and/or local port
	    -P 0|1            Don't/Do display test headers
	    -r                Allow confidence to be hit on result only
	    -s seconds        Wait seconds between test setup and test start
	    -S                Set SO_KEEPALIVE on the data connection
	    -t testname       Specify test to perform
	    -T lcpu,rcpu      Request netperf/netserver be bound to local/remote cpu
	    -v verbosity      Specify the verbosity level
	    -W send,recv      Set the number of send,recv buffers
	    -v level          Set the verbosity level (default 1, min 0)
	    -V                Display the netperf version and exit
	    -y local,remote   Set the socket priority
	    -Y local,remote   Set the IP_TOS. Use hexadecimal.
	    -Z passphrase     Set and pass to netserver a passphrase
	
	For those options taking two parms, at least one must be specified;
	specifying one value without a comma will set both parms to that
	value, specifying a value with a leading comma will set just the second
	parm, a value with a trailing comma will set just the first. To set
	each parm to unique values, specify both and separate them with a
	comma.
	
	* For these options taking two parms, specifying one value with no comma
	will only set the first parms and will leave the second at the default
	value. To set the second value it must be preceded with a comma or be a
	comma-separated pair. This is to retain previous netperf behaviour.
```






# ■ Debian系 (Ubuntu等)へのインストール
Debian ベースのディストリビューションの場合は、次のコマンドを実行して gitからソースをダウンロードしてインストールします。

```
sudo apt update
sudo apt-get install git build-essential autoconf texinfo -y
git clone https://github.com/HewlettPackard/netperf.git
cd netperf
./autogen.sh
./configure --enable-histogram --enable-demo=yes
make
sudo make install
```

## ● apt update実施
アップデートが可能なパッケージのリストを更新
必要に応じてアップグレードも実施
```
shirok@gcp-instance-ubuntu:~$ sudo apt update
    Hit:1 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal InRelease
    Get:2 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates InRelease [128 kB]
    Get:3 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports InRelease [128 kB]
    Get:4 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB]
    Get:5 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
    Get:6 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
    Get:7 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
    Get:8 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
    Get:9 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
    Get:10 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [3392 kB]
    Get:11 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [531 kB]
    Get:12 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [3040 kB]
    Get:13 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [425 kB]
    Get:14 http://security.ubuntu.com/ubuntu focal-security InRelease [128 kB]       
    Get:15 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1199 kB]
    Get:16 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [289 kB]
    Get:17 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [25.7 kB]
    Get:18 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [27.1 kB]
    Get:19 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [7936 B]
    Get:20 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [620 B]
    Get:21 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [45.7 kB]
    Get:22 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports/main Translation-en [16.3 kB]
    Get:23 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [1420 B]
    Get:24 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
    Get:25 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [25.0 kB]
    Get:26 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [16.3 kB]
    Get:27 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B]
    Get:28 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
    Get:29 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [3020 kB]
    Get:30 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [452 kB]
    Get:31 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [2924 kB]
    Get:32 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [409 kB]
    Get:33 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [980 kB]
    Get:34 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [207 kB]
    Get:35 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [19.2 kB]
    Get:36 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [24.8 kB]
    Get:37 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5968 B]
    Get:38 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [548 B]
    Fetched 31.7 MB in 5s (6776 kB/s)                           
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    5 packages can be upgraded. Run 'apt list --upgradable' to see them.
```


## ● neterfインストールに必要なパッケージをインストール
```
shirok@gcp-instance-ubuntu:~$ sudo apt-get install git build-essential autoconf texinfo -y
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following additional packages will be installed:
    automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-9 dpkg-dev fakeroot g++
    g++-9 gcc gcc-9 gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
    libasan5 libatomic1 libauthen-sasl-perl libbinutils libc-dev-bin libc6-dev libcc1-0 libcrypt-dev
    libctf-nobfd0 libctf0 libdata-dump-perl libdpkg-perl libencode-locale-perl libfakeroot
    libfile-fcntllock-perl libfile-listing-perl libfont-afm-perl libgcc-9-dev libgomp1 libhtml-form-perl
    libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl
    libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libio-html-perl
    libio-socket-ssl-perl libisl22 libitm1 liblsan0 liblwp-mediatypes-perl liblwp-protocol-https-perl
    libmailtools-perl libmpc3 libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libquadmath0
    libstdc++-9-dev libtext-unidecode-perl libtimedate-perl libtry-tiny-perl libtsan0 libubsan1 liburi-perl
    libwww-perl libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl
    libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl linux-libc-dev m4 make manpages-dev
    perl-openssl-defaults tex-common
    Suggested packages:
    autoconf-archive gnu-standards autoconf-doc libtool gettext binutils-doc cpp-doc gcc-9-locales
    debian-keyring g++-multilib g++-9-multilib gcc-9-doc gcc-multilib flex bison gdb gcc-doc gcc-9-multilib
    git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki
    git-svn libdigest-hmac-perl libgssapi-perl glibc-doc bzr libcrypt-ssleay-perl libstdc++-9-doc
    libauthen-ntlm-perl libxml-sax-expatxs-perl m4-doc make-doc debhelper texlive-base texlive-latex-base
    texlive-plain-generic texlive-fonts-recommended
    The following NEW packages will be installed:
    autoconf automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp
    cpp-9 dpkg-dev fakeroot g++ g++-9 gcc gcc-9 gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl
    libalgorithm-merge-perl libasan5 libatomic1 libauthen-sasl-perl libbinutils libc-dev-bin libc6-dev libcc1-0
    libcrypt-dev libctf-nobfd0 libctf0 libdata-dump-perl libdpkg-perl libencode-locale-perl libfakeroot
    libfile-fcntllock-perl libfile-listing-perl libfont-afm-perl libgcc-9-dev libgomp1 libhtml-form-perl
    libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl
    libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libio-html-perl
    libio-socket-ssl-perl libisl22 libitm1 liblsan0 liblwp-mediatypes-perl liblwp-protocol-https-perl
    libmailtools-perl libmpc3 libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libquadmath0
    libstdc++-9-dev libtext-unidecode-perl libtimedate-perl libtry-tiny-perl libtsan0 libubsan1 liburi-perl
    libwww-perl libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl
    libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl linux-libc-dev m4 make manpages-dev
    perl-openssl-defaults tex-common texinfo
    The following packages will be upgraded:
    git
    1 upgraded, 83 newly installed, 0 to remove and 4 not upgraded.
    Need to get 54.8 MB of archives.
    After this operation, 226 MB of additional disk space will be used.
    Get:1 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/universe amd64 tex-common all 6.13 [32.7 kB]
    Get:2 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/main amd64 m4 amd64 1.4.18-4 [199 kB]
    Get:3 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/main amd64 autoconf all 2.69-11.1 [321 kB]
    ・・・
    Get:82 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/main amd64 manpages-dev all 5.05-1 [2266 kB]
    Get:83 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/universe amd64 texinfo amd64 6.7.0.dfsg.2-5 [1375 kB]
    Get:84 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu focal/main amd64 libauthen-sasl-perl all 2.1600-1 [48.7 kB]
    Fetched 54.8 MB in 2s (25.7 MB/s)                 
    Extracting templates from packages: 100%
    Selecting previously unselected package tex-common.
    (Reading database ... 62143 files and directories currently installed.)
    Preparing to unpack .../00-tex-common_6.13_all.deb ...
    Unpacking tex-common (6.13) ...
    Selecting previously unselected package m4.
    ・・・
    Preparing to unpack .../82-texinfo_6.7.0.dfsg.2-5_amd64.deb ...
    Unpacking texinfo (6.7.0.dfsg.2-5) ...
    Selecting previously unselected package libauthen-sasl-perl.
    Preparing to unpack .../83-libauthen-sasl-perl_2.1600-1_all.deb ...
    Unpacking libauthen-sasl-perl (2.1600-1) ...
    Setting up manpages-dev (5.05-1) ...
    Setting up libfont-afm-perl (1.20-2) ...
    Setting up libfile-fcntllock-perl (0.22-3build4) ...
    ・・・
    Setting up libnet-http-perl (6.19-1) ...
    Setting up libxml-sax-perl (1.02+dfsg-1) ...
    update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::PurePerl with priority 10...
    update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...

    Creating config file /etc/perl/XML/SAX/ParserDetails.ini with new version
    Setting up libasan5:amd64 (9.4.0-1ubuntu1~20.04.2) ...
    Setting up libxml-libxml-perl (2.0134+dfsg-1build1) ...
    update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX::Parser with priority 50...
    update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX with priority 50...
    update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...
    Replacing config file /etc/perl/XML/SAX/ParserDetails.ini with new version
    Setting up libwww-robotrules-perl (6.02-1) ...
    Setting up libhtml-parser-perl (3.72-5) ...
    Setting up cpp-9 (9.4.0-1ubuntu1~20.04.2) ...
    Setting up libc6-dev:amd64 (2.31-0ubuntu9.16) ...
    ・・・
    Setting up libwww-perl (6.43-1) ...
    Setting up libxml-parser-perl (2.46-1) ...
    Setting up libxml-sax-expat-perl (0.51-1) ...
    update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::Expat with priority 50...
    update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...
    Replacing config file /etc/perl/XML/SAX/ParserDetails.ini with new version
    Processing triggers for install-info (6.7.0.dfsg.2-5) ...
    Processing triggers for libc-bin (2.31-0ubuntu9.16) ...
    Processing triggers for man-db (2.9.1-1) ...
```

## ● netperf の Git リポジトリをコピー
```
shirok@gcp-instance-ubuntu:~$ git clone https://github.com/HewlettPackard/netperf.git
    Cloning into 'netperf'...
    remote: Enumerating objects: 5252, done.
    remote: Counting objects: 100% (324/324), done.
    remote: Compressing objects: 100% (94/94), done.
    remote: Total 5252 (delta 234), reused 305 (delta 229), pack-reused 4928
    Receiving objects: 100% (5252/5252), 16.75 MiB | 24.20 MiB/s, done.
    Resolving deltas: 100% (3930/3930), done.
```


## ● netperfインストール

**1) netperf Sourceディレクトリ移動**
```
shirok@gcp-instance-ubuntu:~$ ls -l 
     total 4
     drwxrwxr-x 6 shirok shirok 4096 Jun 30 01:54 netperf
shirok@gcp-instance-ubuntu:~$ cd netperf/
shirok@gcp-instance-ubuntu:~/netperf$ ls -l
     total 312
     -rw-rw-r-- 1 shirok shirok  9483 Jun 30 01:54 AUTHORS
     -rw-rw-r-- 1 shirok shirok  1120 Jun 30 01:54 COPYING
     -rw-rw-r-- 1 shirok shirok    27 Jun 30 01:54 ChangeLog
     -rw-rw-r-- 1 shirok shirok  9240 Jun 30 01:54 INSTALL
     -rw-rw-r-- 1 shirok shirok  1239 Jun 30 01:54 Makefile.am
     -rw-rw-r-- 1 shirok shirok     0 Jun 30 01:54 NEWS
     -rw-rw-r-- 1 shirok shirok  1503 Jun 30 01:54 README
     -rw-rw-r-- 1 shirok shirok  1673 Jun 30 01:54 README.aix
     -rw-rw-r-- 1 shirok shirok  1770 Jun 30 01:54 README.hpux
     -rw-rw-r-- 1 shirok shirok   258 Jun 30 01:54 README.osx
     -rw-rw-r-- 1 shirok shirok  2373 Jun 30 01:54 README.ovms
     -rw-rw-r-- 1 shirok shirok  1260 Jun 30 01:54 README.solaris
     -rw-rw-r-- 1 shirok shirok   720 Jun 30 01:54 README.vmware
     -rw-rw-r-- 1 shirok shirok  4348 Jun 30 01:54 README.windows
     -rw-rw-r-- 1 shirok shirok 48195 Jun 30 01:54 Release_Notes
     -rw-rw-r-- 1 shirok shirok 14000 Jun 30 01:54 acinclude.m4
     -rwxrwxr-x 1 shirok shirok    95 Jun 30 01:54 autogen.sh
     -rwxrwxr-x 1 shirok shirok 43641 Jun 30 01:54 config.guess
     -rw-rw-r-- 1 shirok shirok 11043 Jun 30 01:54 config.h.in
     -rwxrwxr-x 1 shirok shirok 31743 Jun 30 01:54 config.sub
     -rw-rw-r-- 1 shirok shirok 15863 Jun 30 01:54 configure.ac
     -rwxrwxr-x 1 shirok shirok 13866 Jun 30 01:54 depcomp
     drwxrwxr-x 3 shirok shirok  4096 Jun 30 01:54 doc
     -rw-rw-r-- 1 shirok shirok    30 Jun 30 01:54 inet_ntop.c
     -rwxrwxr-x 1 shirok shirok 13663 Jun 30 01:54 install-sh
     drwxrwxr-x 3 shirok shirok  4096 Jun 30 01:54 m4
     -rwxrwxr-x 1 shirok shirok 10266 Jun 30 01:54 missing
     -rwxrwxr-x 1 shirok shirok  1988 Jun 30 01:54 mkinstalldirs
     -rw-rw-r-- 1 shirok shirok  1845 Jun 30 01:54 netperf.spec.in
     drwxrwxr-x 5 shirok shirok  4096 Jun 30 01:54 src
```

**2) Source から Build ./autogen.sh 実行してconfigure作成**
```
shirok@gcp-instance-ubuntu:~/netperf$ ./autogen.sh 
    configure.ac:28: installing './compile'
```

**3) configure 実行**
```
shirok@gcp-instance-ubuntu:~/netperf$ ./configure --enable-histogram --enable-demo=yes
     checking build system type... x86_64-unknown-linux-gnu
     checking host system type... x86_64-unknown-linux-gnu
     checking target system type... x86_64-unknown-linux-gnu
    ・・・
     checking whether to include initial burst support in _RR tests... yes
     checking which CPU utilization measurement type to use... "procstat - auto"
     checking that generated files are newer than configure... done
     configure: creating ./config.status
     config.status: creating Makefile
     config.status: creating src/netperf_version.h
     config.status: creating src/Makefile
     config.status: creating src/missing/Makefile
     config.status: creating src/missing/m4/Makefile
     config.status: creating doc/Makefile
     config.status: creating doc/examples/Makefile
     config.status: creating netperf.spec
     config.status: creating config.h
     config.status: executing depfiles commands
```

**4) make 実行**
```
shirok@gcp-instance-ubuntu:~/netperf$ make
    (CDPATH="${ZSH_VERSION+.}:" && cd . && autoheader)
	rm -f stamp-h1
	touch config.h.in
	cd . && /bin/bash ./config.status config.h
	config.status: creating config.h
	config.status: config.h is unchanged
	make  all-recursive
	make[1]: Entering directory '/home/shirok/netperf'
	Making all in src
	make[2]: Entering directory '/home/shirok/netperf/src'
	Making all in missing
	make[3]: Entering directory '/home/shirok/netperf/src/missing'
	Making all in m4
	make[4]: Entering directory '/home/shirok/netperf/src/missing/m4'
	make[4]: Nothing to be done for 'all'.
	make[4]: Leaving directory '/home/shirok/netperf/src/missing/m4'
	make[4]: Entering directory '/home/shirok/netperf/src/missing'
	make[4]: Nothing to be done for 'all-am'.
	make[4]: Leaving directory '/home/shirok/netperf/src/missing'
	make[3]: Leaving directory '/home/shirok/netperf/src/missing'
	make[3]: Entering directory '/home/shirok/netperf/src'
	gcc -DHAVE_CONFIG_H -I. -I..      -MT netperf.o -MD -MP -MF .deps/netperf.Tpo -c -o netperf.o netperf.c
	mv -f .deps/netperf.Tpo .deps/netperf.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT netlib.o -MD -MP -MF .deps/netlib.Tpo -c -o netlib.o netlib.c
	netlib.c: In function ‘bind_to_specific_processor’:
	netlib.c:2366:9: warning: implicit declaration of function ‘sched_setaffinity’; did you mean ‘SYS_sched_setaffinity’? [-Wimplicit-function-declaration]
	 2366 |     if (sched_setaffinity(getpid(), len, &netperf_cpu_set)) {
	      |         ^~~~~~~~~~~~~~~~~
	      |         SYS_sched_setaffinity
	netlib.c: In function ‘get_id’:
	netlib.c:3495:10: warning: ‘%-15s’ directive output may be truncated writing between 15 and 64 bytes into a region of size between 16 and 65 [-Wformat-truncation=]
	 3495 |    "%-15s%-15s%-15s%-15s%-15s",
	      |          ^~~~~
	 3496 |    system_name.sysname,
	 3497 |    system_name.nodename,
	      |    ~~~~~~~~~~~~~~~~~~~~
	netlib.c:3485:2: note: ‘snprintf’ output between 76 and 321 bytes into a destination of size 80
	 3485 |  snprintf(id_string, sizeof(id_string),
	      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	 3486 | #ifdef WIN32
	      | ~~~~~~~~~~~~
	 3487 |    "%-15s%-15s%d.%d%d",
	      |    ~~~~~~~~~~~~~~~~~~~~
	 3488 |    "Windows NT",
	      |    ~~~~~~~~~~~~~
	 3489 |    system_name ,
	      |    ~~~~~~~~~~~~~
	 3490 |    GetVersion() & 0xFF ,
	      |    ~~~~~~~~~~~~~~~~~~~~~
	 3491 |    GetVersion() & 0xFF00 ,
	      |    ~~~~~~~~~~~~~~~~~~~~~~~
	 3492 |    SystemInfo.dwProcessorType
	      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~
	 3493 | 
	      |   
	 3494 | #else
	      | ~~~~~
	 3495 |    "%-15s%-15s%-15s%-15s%-15s",
	      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	 3496 |    system_name.sysname,
	      |    ~~~~~~~~~~~~~~~~~~~~
	 3497 |    system_name.nodename,
	      |    ~~~~~~~~~~~~~~~~~~~~~
	 3498 |    system_name.release,
	      |    ~~~~~~~~~~~~~~~~~~~~
	 3499 |    system_name.version,
	      |    ~~~~~~~~~~~~~~~~~~~~
	 3500 |    system_name.machine
	      |    ~~~~~~~~~~~~~~~~~~~
	 3501 | #endif /* WIN32 */
	      | ~~~~~~~~~~~~~~~~~~
	 3502 |    );
	      |    ~
	mv -f .deps/netlib.Tpo .deps/netlib.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT netsh.o -MD -MP -MF .deps/netsh.Tpo -c -o netsh.o netsh.c
	mv -f .deps/netsh.Tpo .deps/netsh.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_bsd.o -MD -MP -MF .deps/nettest_bsd.Tpo -c -o nettest_bsd.o nettest_bsd.c
	mv -f .deps/nettest_bsd.Tpo .deps/nettest_bsd.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_dlpi.o -MD -MP -MF .deps/nettest_dlpi.Tpo -c -o nettest_dlpi.o nettest_dlpi.c
	mv -f .deps/nettest_dlpi.Tpo .deps/nettest_dlpi.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_unix.o -MD -MP -MF .deps/nettest_unix.Tpo -c -o nettest_unix.o nettest_unix.c
	mv -f .deps/nettest_unix.Tpo .deps/nettest_unix.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_xti.o -MD -MP -MF .deps/nettest_xti.Tpo -c -o nettest_xti.o nettest_xti.c
	mv -f .deps/nettest_xti.Tpo .deps/nettest_xti.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_sctp.o -MD -MP -MF .deps/nettest_sctp.Tpo -c -o nettest_sctp.o nettest_sctp.c
	mv -f .deps/nettest_sctp.Tpo .deps/nettest_sctp.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_sdp.o -MD -MP -MF .deps/nettest_sdp.Tpo -c -o nettest_sdp.o nettest_sdp.c
	mv -f .deps/nettest_sdp.Tpo .deps/nettest_sdp.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_omni.o -MD -MP -MF .deps/nettest_omni.Tpo -c -o nettest_omni.o nettest_omni.c
	nettest_omni.c: In function ‘recv_data_no_copy’:
	nettest_omni.c:3167:19: warning: implicit declaration of function ‘splice’ [-Wimplicit-function-declaration]
	 3167 |     bytes_recvd = splice(data_socket,
	      |                   ^~~~~~
	mv -f .deps/nettest_omni.Tpo .deps/nettest_omni.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT net_uuid.o -MD -MP -MF .deps/net_uuid.Tpo -c -o net_uuid.o net_uuid.c
	mv -f .deps/net_uuid.Tpo .deps/net_uuid.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT dscp.o -MD -MP -MF .deps/dscp.Tpo -c -o dscp.o dscp.c
	mv -f .deps/dscp.Tpo .deps/dscp.Po
	gcc -DHAVE_CONFIG_H -I. -I..      -MT netcpu_procstat.o -MD -MP -MF .deps/netcpu_procstat.Tpo -c -o netcpu_procstat.o netcpu_procstat.c
	mv -f .deps/netcpu_procstat.Tpo .deps/netcpu_procstat.Po
	gcc     -o netperf netperf.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o nettest_omni.o net_uuid.o dscp.o netcpu_procstat.o  -lrt -lm 
	gcc -DHAVE_CONFIG_H -I. -I..      -MT netserver.o -MD -MP -MF .deps/netserver.Tpo -c -o netserver.o netserver.c
	mv -f .deps/netserver.Tpo .deps/netserver.Po
	gcc     -o netserver netserver.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o nettest_omni.o net_uuid.o dscp.o netcpu_procstat.o  -lrt -lm 
	make[3]: Leaving directory '/home/shirok/netperf/src'
	make[2]: Leaving directory '/home/shirok/netperf/src'
	Making all in doc
	make[2]: Entering directory '/home/shirok/netperf/doc'
	Making all in examples
	make[3]: Entering directory '/home/shirok/netperf/doc/examples'
	make[3]: Nothing to be done for 'all'.
	make[3]: Leaving directory '/home/shirok/netperf/doc/examples'
	make[3]: Entering directory '/home/shirok/netperf/doc'
	restore=: && backupdir=".am$$" && \
	am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \
	rm -rf $backupdir && mkdir $backupdir && \
	if (makeinfo --version) >/dev/null 2>&1; then \
	  for f in netperf.info netperf.info-[0-9] netperf.info-[0-9][0-9] netperf.i[0-9] netperf.i[0-9][0-9]; do \
	    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
	  done; \
	else :; fi && \
	cd "$am__cwd"; \
	if makeinfo   -I . \
	 -o netperf.info netperf.texi; \
	then \
	  rc=0; \
	  CDPATH="${ZSH_VERSION+.}:" && cd .; \
	else \
	  rc=$?; \
	  CDPATH="${ZSH_VERSION+.}:" && cd . && \
	  $restore $backupdir/* `echo "./netperf.info" | sed 's|[^/]*$||'`; \
	fi; \
	rm -rf $backupdir; exit $rc
	make[3]: Leaving directory '/home/shirok/netperf/doc'
	make[2]: Leaving directory '/home/shirok/netperf/doc'
	make[2]: Entering directory '/home/shirok/netperf'
	make[2]: Leaving directory '/home/shirok/netperf'
	make[1]: Leaving directory '/home/shirok/netperf'
```

**5) make install 実行**
```
shirok@gcp-instance-ubuntu:~/netperf$ sudo make install
	Making install in src
	make[1]: Entering directory '/home/shirok/netperf/src'
	Making install in missing
	make[2]: Entering directory '/home/shirok/netperf/src/missing'
	Making install in m4
	make[3]: Entering directory '/home/shirok/netperf/src/missing/m4'
	make[4]: Entering directory '/home/shirok/netperf/src/missing/m4'
	make[4]: Nothing to be done for 'install-exec-am'.
	make[4]: Nothing to be done for 'install-data-am'.
	make[4]: Leaving directory '/home/shirok/netperf/src/missing/m4'
	make[3]: Leaving directory '/home/shirok/netperf/src/missing/m4'
	make[3]: Entering directory '/home/shirok/netperf/src/missing'
	make[4]: Entering directory '/home/shirok/netperf/src/missing'
	make[4]: Nothing to be done for 'install-exec-am'.
	make[4]: Nothing to be done for 'install-data-am'.
	make[4]: Leaving directory '/home/shirok/netperf/src/missing'
	make[3]: Leaving directory '/home/shirok/netperf/src/missing'
	make[2]: Leaving directory '/home/shirok/netperf/src/missing'
	make[2]: Entering directory '/home/shirok/netperf/src'
	make[3]: Entering directory '/home/shirok/netperf/src'
	 /usr/bin/mkdir -p '/usr/local/bin'
	  /usr/bin/install -c netperf netserver '/usr/local/bin'
	make[3]: Nothing to be done for 'install-data-am'.
	make[3]: Leaving directory '/home/shirok/netperf/src'
	make[2]: Leaving directory '/home/shirok/netperf/src'
	make[1]: Leaving directory '/home/shirok/netperf/src'
	Making install in doc
	make[1]: Entering directory '/home/shirok/netperf/doc'
	Making install in examples
	make[2]: Entering directory '/home/shirok/netperf/doc/examples'
	make[3]: Entering directory '/home/shirok/netperf/doc/examples'
	make[3]: Nothing to be done for 'install-exec-am'.
	make[3]: Nothing to be done for 'install-data-am'.
	make[3]: Leaving directory '/home/shirok/netperf/doc/examples'
	make[2]: Leaving directory '/home/shirok/netperf/doc/examples'
	make[2]: Entering directory '/home/shirok/netperf/doc'
	make[3]: Entering directory '/home/shirok/netperf/doc'
	make[3]: Nothing to be done for 'install-exec-am'.
	 /usr/bin/mkdir -p '/usr/local/share/info'
	 /usr/bin/install -c -m 644 ./netperf.info '/usr/local/share/info'
	 install-info --info-dir='/usr/local/share/info' '/usr/local/share/info/netperf.info'
	install-info: warning: no info dir entry in `/usr/local/share/info/netperf.info'
	 /usr/bin/mkdir -p '/usr/local/share/man/man1'
	 /usr/bin/install -c -m 644 'netperf.man' '/usr/local/share/man/man1/netperf.1'
	 /usr/bin/install -c -m 644 'netserver.man' '/usr/local/share/man/man1/netserver.1'
	make[3]: Leaving directory '/home/shirok/netperf/doc'
	make[2]: Leaving directory '/home/shirok/netperf/doc'
	make[1]: Leaving directory '/home/shirok/netperf/doc'
	make[1]: Entering directory '/home/shirok/netperf'
	make[2]: Entering directory '/home/shirok/netperf'
	make[2]: Nothing to be done for 'install-exec-am'.
	make[2]: Nothing to be done for 'install-data-am'.
	make[2]: Leaving directory '/home/shirok/netperf'
	make[1]: Leaving directory '/home/shirok/netperf'
```

## ● netperfインストール確認
**1) netperfコマンド確認**
```
shirok@gcp-instance-ubuntu:~$ which netperf
     /usr/local/bin/netperf

shirok@gcp-instance-ubuntu:~$ netperf -h

    Usage: netperf [global options] -- [test options] 
	
	Global options:
	    -a send,recv      Set the local send,recv buffer alignment
	    -A send,recv      Set the remote send,recv buffer alignment
	    -B brandstr       Specify a string to be emitted with brief output
	    -c [cpu_rate]     Report local CPU usage
	    -C [cpu_rate]     Report remote CPU usage
	    -d                Increase debugging output
	    -D time,[units] * Display interim results at least every time interval
	                      using units as the initial guess for units per second
	                      A negative value for time will make heavy use of the
	                      system's timestamping functionality
	    -f G|M|K|g|m|k    Set the output units
	    -F lfill[,rfill]* Pre-fill buffers with data from specified file
	    -h                Display this text
	    -H name|ip,fam *  Specify the target machine and/or local ip and family
	    -i max,min        Specify the max and min number of iterations (15,1)
	    -I lvl[,intvl]    Specify confidence level (95 or 99) (99) 
	                      and confidence interval in percentage (10)
	    -j                Keep additional timing statistics
	    -l testlen        Specify test duration (>0 secs) (<0 bytes|trans)
	    -L name|ip,fam *  Specify the local ip|name and address family
	    -o send,recv      Set the local send,recv buffer offsets
	    -O send,recv      Set the remote send,recv buffer offset
	    -n numcpu         Set the number of processors for CPU util
	    -N                Establish no control connection, do 'send' side only
	    -p port,lport*    Specify netserver port number and/or local port
	    -P 0|1            Don't/Do display test headers
	    -r                Allow confidence to be hit on result only
	    -s seconds        Wait seconds between test setup and test start
	    -S                Set SO_KEEPALIVE on the data connection
	    -t testname       Specify test to perform
	    -T lcpu,rcpu      Request netperf/netserver be bound to local/remote cpu
	    -v verbosity      Specify the verbosity level
	    -W send,recv      Set the number of send,recv buffers
	    -v level          Set the verbosity level (default 1, min 0)
	    -V                Display the netperf version and exit
	    -y local,remote   Set the socket priority
	    -Y local,remote   Set the IP_TOS. Use hexadecimal.
	    -Z passphrase     Set and pass to netserver a passphrase
	
	For those options taking two parms, at least one must be specified;
	specifying one value without a comma will set both parms to that
	value, specifying a value with a leading comma will set just the second
	parm, a value with a trailing comma will set just the first. To set
	each parm to unique values, specify both and separate them with a
	comma.
	
	* For these options taking two parms, specifying one value with no comma
	will only set the first parms and will leave the second at the default
	value. To set the second value it must be preceded with a comma or be a
	comma-separated pair. This is to retain previous netperf behaviour.

```

**2) netserver確認**
```
shirok@gcp-instance-ubuntu:~$ which netserver 
     /usr/local/bin/netserver

shirok@gcp-instance-ubuntu:~$  netserver -h

	Usage: netserver [options] 
	
	Options:
	    -h                Display this text
	    -D                Do not daemonize
	    -d                Increase debugging output
	    -f                Do not spawn chilren for each test, run serially
	    -L name,family    Use name to pick listen address and family for family
	    -N                No debugging output, even if netperf asks
	    -p portnum        Listen for connect requests on portnum.
	    -4                Do IPv4
	    -6                Do IPv6
	    -v verbosity      Specify the verbosity level
	    -V                Display version information and exit
	    -Z passphrase     Expect passphrase as the first thing received
```






# ■ netperf での TCP, UDP レイテンシ測定
TCPとUDPプロトコルでの測定を実施してみます。

## ● Server(受信側)設定
```
[root@osaka-inst01 ~]# netserver
    Starting netserver with host 'IN(6)ADDR_ANY' port '12865' and family AF_UNSPEC
```


## ● Client(送信側)実行

**・ TCP Laitency**
単位は 1μs (0.001ms)です。
```
[root@tokyo-inst01 ~]# netperf -H 10.20.0.2 -t TCP_RR -- -k MIN_LATENCY,MEAN_LATENCY,MAX_LATENCY
	MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.20.0.2 () port 0 AF_INET : histogram : interval : dirty data : demo : first burst 0
	MIN_LATENCY=7985
	MEAN_LATENCY=8071.47
	MAX_LATENCY=16252
```

**・ UDP Laitency**
単位は 1μs (0.001ms)です。
```
[root@tokyo-inst01 ~]# netperf -H 10.20.0.2 -t UDP_RR -- -k MIN_LATENCY,MEAN_LATENCY,MAX_LATENCY
	MIGRATED UDP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.20.0.2 () port 0 AF_INET : histogram : interval : dirty data : demo : first burst 0
	MIN_LATENCY=8353
	MEAN_LATENCY=8415.86
	MAX_LATENCY=10508
```

# ■ ping での 1μs (0.001ms)間隔 ICMP レイテンシ測定
-i オプションで ping実行間隔を 1μs (0.001ms) の単位に制御できます。
200ms以下は、root権限で実行する必要があります。

## ● root権限ない場合(失敗)
```
[opc@tokyo-inst01 ~]$ ping 10.20.0.2 -i 0.001 -c 10
	PING 10.20.0.2 (10.20.0.2) 56(84) bytes of data.
	ping: cannot flood; minimal interval allowed for user is 200ms
```

## ● root権限で実行(成功)

```
[opc@tokyo-inst01 ~]$ sudo ping 10.20.0.2 -i 0.001 -c 10
	PING 10.20.0.2 (10.20.0.2) 56(84) bytes of data.
	64 bytes from 10.20.0.2: icmp_seq=1 ttl=62 time=8.52 ms
	64 bytes from 10.20.0.2: icmp_seq=2 ttl=62 time=8.40 ms
	64 bytes from 10.20.0.2: icmp_seq=3 ttl=62 time=8.40 ms
	64 bytes from 10.20.0.2: icmp_seq=4 ttl=62 time=8.35 ms
	64 bytes from 10.20.0.2: icmp_seq=5 ttl=62 time=8.40 ms
	64 bytes from 10.20.0.2: icmp_seq=6 ttl=62 time=8.34 ms
	64 bytes from 10.20.0.2: icmp_seq=7 ttl=62 time=8.39 ms
	64 bytes from 10.20.0.2: icmp_seq=8 ttl=62 time=8.35 ms
	64 bytes from 10.20.0.2: icmp_seq=9 ttl=62 time=8.40 ms
	64 bytes from 10.20.0.2: icmp_seq=10 ttl=62 time=8.35 ms

	--- 10.20.0.2 ping statistics ---
	10 packets transmitted, 10 received, 0% packet loss, time 76ms
	rtt min/avg/max/mdev = 8.342/8.388/8.519/0.049 ms
```


# ■ 参考
　・[Git: netperf](https://github.com/HewlettPackard/netperf)
　・[The Netperf Homepage](https://hewlettpackard.github.io/netperf/)
　・[【Linux】pingコマンドの使い方](https://www.server-memo.net/tips/command/ping/ping.html#toc8)
　・[Oracle Linux Repositories](https://yum.oracle.com/)
　・[クラウドでのネットワーク レイテンシの測定](https://cloud.google.com/blog/ja/products/networking/using-netperf-and-ping-to-measure-network-latency?hl=ja)
　・[Interconnect を介したネットワークのスループットを計算する](https://cloud.google.com/network-connectivity/docs/interconnect/tutorials/calculate-network-throughput-over-interconnect?hl=ja)