2012年(21)
分类: 虚拟化
2012-11-04 07:46:10
mtools是组播测试工具,支持FreeBSD、Sunos、win2k、Linux等多种操作系统,丰富的可选参数能够测出点对点、多对点、多对多之间组播传输的丢包率。Msend用于组播发送,mdump用于组播接收。
msend具体参数如下:
Usage: msend [-1|2|3|4|5] [-b burst_count] [-d] [-h] [-l loops] [-m msg_len] [-n num_bursts] [-p pause] [-P payload] [-q] [-s stat_pause] [-S Sndbuf_size] group port [ttl] [interface]
Where:
-1 : pre-load opts for basic connectivity (1 short msg per sec for 10 min)
-2 : pre-load opts for long msglen (1 5k msg each sec for 5 seconds)
-3 : pre-load opts for moderate load (bursts of 100 8K msgs for 5 seconds)
-4 : pre-load opts for heavy load (1 burst of 5000 short msgs)
-5 : pre-load opts for VERY heavy load (1 burst of 50,000 800-byte msgs)
-b burst_count : number of messages per burst [1]
-d : decimal numbers in messages [hex])
-h : help
-l loops : number of times to loop test [1]
-m msg_len : length of each message (0=use length of sequence number) [0]
-n num_bursts : number of bursts to send (0=infinite) [0]
-p pause : pause (milliseconds) between bursts [1000]
-P payload : hex digits for message content (implicit -m)
-q : loop more quietly (can use '-qq' for complete silence)
-s stat_pause : pause (milliseconds) before sending stat msg (0=no stat) [0]
-S Sndbuf_size : size (bytes) of UDP send buffer (SO_SNDBUF) [65536]
(use 0 for system default buff size)
-t :tcp ('group' becomes destination IP) [multicast]
-u : unicast udp ('group' becomes destination IP) [multicast]
group : multicast group or IP address to send to (required)
port : destination port (required)
ttl : time-to-live (limits transition through routers) [2]
interface : optional IP addr of local interface (for multi-homed hosts)
实例:从172.17.33.35向239.1.1.5组播地址的11115端口发送组播
–m70 -n1 -p1000 -q -s2000 –S0 239.1.1.5 11115 15 192.168.37.30
其中-b5000发送5000个包,-m70每个包70字节(千兆网络环境选择20,百兆网络环境选择70),-n1发送一个,-p1000间隔1s发送一个burst,-S0为buffer的大小,选择0为使用系统默认值,239.1.1.5为组播地址,11115为组播端口,15是组播生命周期,172.17.33.35为本机IP
发送结束后,发送端会提示如下:
Sending 1 bursts of 5000 20-byte messages
.Pausing before sending 'stat'
Sending stat
5000 messages sent (not including 'stat')
mdump具体参数如下:
Usage: mdump [-h] [-q] [-Q Quiet_lvl] [-r rcvbuf_size] [-p pause_ms/num] [-v] [-s] group port [interface]
Where:
-h : help
-o ofile : print results to file (in addition to stdout)
-p pause_ms[/num] : milliseconds to pause after each receive [0: no pause]
and number of loops to apply the pause [0: all loops]
-Q Quiet_lvl : set quiet level [0] :
0 - print full datagram contents
1 - print datagram summaries
2 - no print per datagram (same as '-q')
-q : no print per datagram (same as '-Q 2')
-r rcvbuf_size : size (bytes) of UDP receive buffer (SO_RCVBUF) [4194304]
(use 0 for system default buff size)
-s : stop execution when status msg received
-t : Use TCP (use '0.0.0.0' for group)
-v : verify the sequence numbers
group : multicast address to receive (required, use '0.0.0.0' for unicast)
port : destination port (required)
interface : optional IP addr of local interface (for multi-homed hosts) [INADDR_ANY]
实例:在172.17.33.17从239.1.1.5组播地址的11115端口接受组播
其中-o指定log保存名称,-q不输出到屏幕,239.1.1.5组播地址,11115组播端口,172.17.33.17为本机IP
测试结束后,组播接收端log最后一行,即为此次组播测试的丢包率,如下:
5000 msgs sent, 5000 received (not including 'stat')
0.000000% loss
Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi; mso-font-kerning:1.0pt;}