利用iiperf测试UDP带宽

客户端命令行:iperf -u -c 2xx.1xx.1xx.1xx -p 20001 -l 1380 -B 172.16.28.173 -t 10 -i 1 -b 1800K

e.g. 

iperf -u -c 10.12.23.47 -p 8080 -l 1380  -B 10.12.32.45 -t 10 -i 1 -b 200M

参数解释:

1) 测试对端是10.12.23.47

2) 测试对端的端口是8080

3) 数据包大小是1380个字节

4) 绑定本地网卡10.12.32.45

5) 测试持续10秒钟

6) 每隔1秒钟打印一次信息

7) 最大发送带宽200M


服务器命令行:iperf.exe -s -u -i 1 -p 8080 -l 1380



   
   
  1. /*
  2. * Bandwidth Test with iperf
  3. *
  4. * Client Command Line:
  5. * 1) a packet is of 1380 bytes length.
  6. * 2) bind to a local interface 172.16.28.173
  7. * 3) Test for 10 seconds, and every 1 second, print a recode.
  8. * 4) limit the send Bandwidth to 1800K.
  9. * iperf -u -c 2xx.1xx.1xx.1xx -p 20001 -l 1380 -t 10 -B 172.16.28.173 -t 10 -i 1 -b 1800K
  10. *
  11. * Test Sample I.
  12. ------------------------------------------------------------
  13. Client connecting to 211.160.178.10, UDP port 20001
  14. Binding to local address 172.16.28.173
  15. Sending 1380 byte datagrams
  16. UDP buffer size: 112 KByte (default)
  17. ------------------------------------------------------------
  18. [ 3] local 172.16.28.173 port 20001 connected with 211.160.178.10 port 20001
  19. [ ID] Interval Transfer Bandwidth
  20. [ 3] 0.0- 1.0 sec 221 KBytes 1.81 Mbits/sec
  21. [ 3] 1.0- 2.0 sec 220 KBytes 1.80 Mbits/sec
  22. [ 3] 2.0- 3.0 sec 220 KBytes 1.80 Mbits/sec
  23. [ 3] 3.0- 4.0 sec 220 KBytes 1.80 Mbits/sec
  24. [ 3] 4.0- 5.0 sec 220 KBytes 1.80 Mbits/sec
  25. [ 3] 5.0- 6.0 sec 220 KBytes 1.80 Mbits/sec
  26. [ 3] 6.0- 7.0 sec 220 KBytes 1.80 Mbits/sec
  27. [ 3] 7.0- 8.0 sec 220 KBytes 1.80 Mbits/sec
  28. [ 3] 8.0- 9.0 sec 220 KBytes 1.80 Mbits/sec
  29. [ 3] 9.0-10.0 sec 220 KBytes 1.80 Mbits/sec
  30. [ 3] 0.0-10.0 sec 2.15 MBytes 1.80 Mbits/sec
  31. [ 3] Sent 1632 datagrams
  32. [ 3] Server Report:
  33. [ 3] 0.0-10.4 sec 1.66 MBytes 1.34 Mbits/sec 9.661 ms 371/ 1631 (23%)
  34. *
  35. * so the bandwidth is 1.34M, with loss ratio is about 23%
  36. *
  37. * Test Sample II.
  38. ------------------------------------------------------------
  39. Client connecting to 211.160.178.10, UDP port 20001
  40. Binding to local address 172.16.28.173
  41. Sending 1380 byte datagrams
  42. UDP buffer size: 112 KByte (default)
  43. ------------------------------------------------------------
  44. [ 3] local 172.16.28.173 port 20001 connected with 211.160.178.10 port 20001
  45. [ ID] Interval Transfer Bandwidth
  46. [ 3] 0.0- 1.0 sec 171 KBytes 1.40 Mbits/sec
  47. [ 3] 1.0- 2.0 sec 171 KBytes 1.40 Mbits/sec
  48. [ 3] 2.0- 3.0 sec 171 KBytes 1.40 Mbits/sec
  49. [ 3] 3.0- 4.0 sec 171 KBytes 1.40 Mbits/sec
  50. [ 3] 4.0- 5.0 sec 171 KBytes 1.40 Mbits/sec
  51. [ 3] 5.0- 6.0 sec 170 KBytes 1.39 Mbits/sec
  52. [ 3] 6.0- 7.0 sec 171 KBytes 1.40 Mbits/sec
  53. [ 3] 7.0- 8.0 sec 171 KBytes 1.40 Mbits/sec
  54. [ 3] 8.0- 9.0 sec 171 KBytes 1.40 Mbits/sec
  55. [ 3] 9.0-10.0 sec 171 KBytes 1.40 Mbits/sec
  56. [ 3] 0.0-10.0 sec 1.67 MBytes 1.40 Mbits/sec
  57. [ 3] Sent 1270 datagrams
  58. [ 3] Server Report:
  59. [ 3] 0.0-10.1 sec 1.66 MBytes 1.38 Mbits/sec 4.779 ms 5/ 1270 (0.39%)
  60. *
  61. * so the bandwidth is still about 1.38M, but with loss ratio is about 0.39%
  62. *
  63. * Server Command Line:
  64. * Listen at 8080, expect packet length to 1380 bytes.
  65. * iperf.exe -s -u -i 1 -p 8080 -l 1380
  66. *
  67. * Test sample I.
  68. [ 3] local 10.12.23.47 port 8080 connected with 119.6.254.189 port 1313
  69. [ 3] 0.0- 1.0 sec 206 KBytes 1.69 Mbits/sec 4.446 ms 0/ 153 (0%)
  70. [ 3] 1.0- 2.0 sec 206 KBytes 1.69 Mbits/sec 4.582 ms 2/ 155 (1.3%)
  71. [ 3] 2.0- 3.0 sec 181 KBytes 1.48 Mbits/sec 6.017 ms 0/ 134 (0%)
  72. [ 3] 3.0- 4.0 sec 187 KBytes 1.53 Mbits/sec 3.772 ms 18/ 157 (11%)
  73. [ 3] 4.0- 5.0 sec 150 KBytes 1.23 Mbits/sec 6.712 ms 47/ 158 (30%)
  74. [ 3] 5.0- 6.0 sec 158 KBytes 1.29 Mbits/sec 6.847 ms 59/ 176 (34%)
  75. [ 3] 6.0- 7.0 sec 150 KBytes 1.23 Mbits/sec 5.924 ms 27/ 138 (20%)
  76. [ 3] 7.0- 8.0 sec 151 KBytes 1.24 Mbits/sec 7.331 ms 63/ 175 (36%)
  77. [ 3] 8.0- 9.0 sec 123 KBytes 1.00 Mbits/sec 7.982 ms 48/ 139 (35%)
  78. [ 3] 9.0-10.0 sec 131 KBytes 1.07 Mbits/sec 11.196 ms 76/ 173 (44%)
  79. [ 3] 0.0-10.4 sec 1.66 MBytes 1.34 Mbits/sec 9.661 ms 371/ 1631 (23%)
  80. *
  81. * so the bandwidth is about 1.34M with loss ratio about 23%
  82. *
  83. * Test Sample II.
  84. [ 4] local 10.12.23.47 port 8080 connected with 119.6.254.189 port 1153
  85. [ 4] 0.0- 1.0 sec 150 KBytes 1.23 Mbits/sec 5.167 ms 0/ 111 (0%)
  86. [ 4] 1.0- 2.0 sec 162 KBytes 1.32 Mbits/sec 4.087 ms 0/ 120 (0%)
  87. [ 4] 2.0- 3.0 sec 187 KBytes 1.53 Mbits/sec 5.615 ms 0/ 139 (0%)
  88. [ 4] 3.0- 4.0 sec 178 KBytes 1.46 Mbits/sec 6.416 ms 1/ 133 (0.75%)
  89. [ 4] 4.0- 5.0 sec 179 KBytes 1.47 Mbits/sec 3.836 ms 0/ 133 (0%)
  90. [ 4] 5.0- 6.0 sec 171 KBytes 1.40 Mbits/sec 3.852 ms 0/ 127 (0%)
  91. [ 4] 6.0- 7.0 sec 164 KBytes 1.35 Mbits/sec 4.243 ms 1/ 123 (0.81%)
  92. [ 4] 7.0- 8.0 sec 175 KBytes 1.44 Mbits/sec 4.258 ms 2/ 132 (1.5%)
  93. [ 4] 8.0- 9.0 sec 127 KBytes 1.04 Mbits/sec 6.852 ms 1/ 95 (1.1%)
  94. [ 4] 9.0-10.0 sec 182 KBytes 1.49 Mbits/sec 3.438 ms 0/ 135 (0%)
  95. [ 4] 0.0-10.1 sec 1.66 MBytes 1.38 Mbits/sec 4.780 ms 5/ 1270 (0.39%)
  96. *
  97. * so the bandwidth is still about 1.38M, but with loss ratio 0.39%.
  98. *
  99. */

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值