10
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Latte for Windows でコンピュート間のレイテンシ(遅延)をマイクロ秒(μs)単位で測定してみてみた

Last updated at Posted at 2025-07-16

latteロゴ.png
Azure VM 間のネットワーク待機時間をテストするより~
Latte は、TCP (Transmission Control Protocol) と UDP (User Datagram Protocol) トラフィック レイテンシ を マイクロ秒(μs)単位で測定できます。 ほとんどのアプリケーションではこれらのプロトコルが使用され、このトラフィックはアプリケーションのパフォーマンスに最も大きな影響を及ぼします。
Latte は、TCP または UDP ペイロードのデリバリー時間のみを測定します。 このツールでは、次の方法を使用して、2 台の物理コンピューターまたは仮想コンピューター間のネットワーク待機時間を測定します。

1) 送信側(Server)と受信側(Client)を指定して、コンピューター間に双方向の通信チャネルを作成し
2) 双方向でパケットを送受信し、ラウンドトリップ時間 (RTT)を測定できます。

ということで、Latte for Windows を使用して、Oracle Cloud Infrastructure(OCI) コンピュート VM.Standard.E5.Flex 間のネットワーク・レイテンシを測定してみてみます。

Ping などの他の一般的なネットワーク待機時間テスト ツールの多くは、TCP または UDP トラフィックを測定しません。 Ping などのツールでは、アプリケーションで使用されないインターネット制御メッセージ プロトコル (ICMP) が使用されます。 ICMP トラフィックはアプリケーション トラフィックとは異なる方法で処理され、アプリケーションのパフォーマンスに直接影響を与えるわけではありません。 ICMP テスト結果は、TCP と UDP を使用するワークロードには直接適用されません。

■ Latte インストール

● latte.exe ダウンロード

https://github.com/microsoft/latte から 最新バージョンの latte.exe をダウンロード

● latte.exe 配置

C:\tools などのフォルダーに配置します。
今回は、環境変数(PATH)の設定の手間をはぶくため、、pingコマンドと同じディレクトリ C:\Windows\System32\latte.exe へ配置してみてみます。

配置家訓
PS C:\> where.exe latte
	C:\Windows\System32\latte.exe

● latte.exe 確認

・ Version 確認

PS C:\> latte.exe -ver
	Latte version 0000.8303

・ Help 確認
Latte の使い方はここから学びます。

PS C:\> latte.exe

This tool measures the average latency between T0 and T3 over a number of
iterations of the following sequence of operations:
  T0: client sends a message to server
  T1: server receives the message
  T2: server sends the message back to client
  T3: client receives the message back

Following parameters control the behavior:

-ga : get args from client (server only, must be specified first)
-sa : send args to server  (client only, must be specified first)
-so : turns server off  (client only, must be specified first)
-c : client (default: server)
-a <IP address/port> : communication address
-bl <IP address/port> : local address (client only, default: wildcard)
-tcp | -udp | -raw : socket type (default: tcp)
-s : use send-then-receive sequence on server (-tcp only)
-r : use receive-then-send sequence on client (-tcp only)
-rio : Use RIO send/receive
-riopoll <count> : Poll <count> times before waiting on RIO CQ
-proc <proc number> : processor number to affinitize to (default: no affinity)
-group <group number>: processor group to affinitize to
-mcast : use multicast (-udp and -raw only)
-snd b | nb | ove | ovc | ovp | sel : send method (default: b - blocking)
-rcv b | nb | ove | ovc | ovp | sel : receive method (default: b - blocking)
-m <message size in bytes> (default: 4)
-i <iterations> (default: 10000)
-t <duration> : test duration (sec) (default: iterations will be used)
                if -t and -i are both present -t overrides the -i option
-sb <send buffer size> (default: SO_SNDBUF not set)
-rb <receive buffer size> (default: SO_RCVBUF not set)
-tick : Use GetTickCount() instead of performance counters
-csv : print results in CSV format on a single line without headers
-csvh : print results in CSV format on a single line with headers
-csvtag <tag> : adds the specified tag string to the CSV output
-hist : print histogram of per-iteration latency values (client only)
-hs <start-value> : histogram 1st interval start value (default: 0 usec)
-hl <interval-length> : length of histogram intervals (default: 100 usec)
-hc <interval-count> : number of histogram intervals (default: 10)
-ver : print the version and exit
-it <timeout> : iteration timeout (msec) (default: no timeout)
-dump <filename> : dump all values to <filename>
-hrtt : calculate half round-trip latency

● Windows Defender ファイアウォール設定

受信側 Windows で、Latte トラフィックの着信を許可する Windows Defender ファイアウォール allow ルールを作成します。
特定の受信 TCP ポートを許可するよりも、名前で latte.exeプログラム を許可する方が簡単です。 コマンドで、プレースホルダーを c:\tools\ など、ダウンロードした latte.exeパスに置き換えます。

Windows コマンド プロンプト
netsh advfirewall firewall add rule program=<latte.exe PATH> name="Latte" protocol=any dir=in action=allow enable=yes profile=ANY
実行例
PS C:\> netsh advfirewall firewall add rule program=C:\Windows\System32\latte.exe name="Latte" protocol=any dir=in action=allow enable=yes profile=ANY
Ok.

■ Latte TCP測定実行

● Server側コンピュートでの実行

Windows コマンド ラインから latte.exe を実行します。
受信側(IP: 10.10.0.11)で次のコマンドを実行します。

Windows コマンド プロンプト
latte -a <receiver IP address>:<port> -i <iterations>

	- iterations: 代表的な結果を返すには、65000 前後のイテレーションが十分です。
	- port: 使用可能な任意のポート番号で構いません。
実行結果
PS C:\> latte.exe -a 10.10.0.11:5005 -i 65100                                                                 Protocol      TCP
	SendMethod    Blocking
	ReceiveMethod Blocking
	SO_SNDBUF     Default
	SO_RCVBUF     Default
	MsgSize(byte) 4
	Iterations    65100

● Client側コンピュートでの実行

送信側 で、Client の オプション -c を追加して受信側と同じコマンドを実行します。

Windows コマンド プロンプト
latte -c -a <receiver IP address>:<port> -i <iterations>

結果を待ちます。 VM 同士の距離によっては、テストの完了までに数分かかる場合があります。 長いテストを実行する前に、成功についてテストするために少数のイテレーションで開始することを検討してください。

実行結果
PS C:\> latte.exe -c -a 10.10.0.11:5005 -i 65100
Protocol      TCP
SendMethod    Blocking
ReceiveMethod Blocking
SO_SNDBUF     Default
SO_RCVBUF     Default
MsgSize(byte) 4
Iterations    65100
Latency(usec) 34.53
CPU(%)        5.9
CtxSwitch/sec 68121     (2.35/iteration)
SysCall/sec   69740     (2.41/iteration)
Interrupt/sec 91927     (3.17/iteration)

実行結果から レイテンシは マイクロ秒(μs)単位で確認できます
Latency(usec) 34.53 = 0.03453 ms

■ Latte UDP測定実行

-udp オプションを追加することで UDPで測定できます。

PS C:\> latte.exe -c -a 10.10.0.11:5005 -i 65100 -udp
Protocol      UDP
SendMethod    Blocking
ReceiveMethod Blocking
SO_SNDBUF     Default
SO_RCVBUF     Default
MsgSize(byte) 4
Iterations    65100
Latency(usec) 34.95
CPU(%)        4.7
CtxSwitch/sec 58029     (2.03/iteration)
SysCall/sec   58668     (2.05/iteration)
Interrupt/sec 86328     (3.02/iteration)

実行結果から レイテンシは マイクロ秒(μs)単位で確認できます
Latency(usec) 34.95 = 0.03495 ms

■ その他

● Linux でのレイテンシ(遅延)測定

Linux では Netperf もしくは SockPerf を使用して TCP、UDP レイテンシをマイクロ秒(μs)単位で測定します。

・ Netperf

・ SockPerf

● ネットワーク チューニング

マルチクラウド展開にまつわる既成概念を覆すより
データ転送では、特に長距離の場合にレイテンシ(遅延)が問題になることがありますが、現在はすべてのクラウド・プロバイダーがそれぞれの物理インフラストラクチャを互いの近くに配置(専門用語では「コロケーション」)しているため、これはさほど問題となりません。この近接性(場合によっては同一コロケーション施設内の別の部屋)は、クラウド間のレイテンシがミリ秒単位であることを意味します。それに加え、クラウド・データセンター・リージョンは世界中で増加しており、クラウド・リージョン間の距離は縮まっています。
という事で、レイテンシ(遅延)について、まとめてみてみます。

■ 参考

Azure VM 間のネットワーク待機時間をテストする
Microsoft Latte
仮想ネットワークへの VPN スループットを検証する方法

10
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?