如何使用tcpreplay以100 MBps,500 MBps和1Gbps的速度泵送流量? [英] How do I pump traffic using tcpreplay at 100 MBps, 500 MBps and 1Gbps speeds?

查看:892
本文介绍了如何使用tcpreplay以100 MBps,500 MBps和1Gbps的速度泵送流量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了-R和-K选项,但是它似乎无法正常工作,因为我使用tcpdump捕获了泵送的流量,并且我看到的数据包数量似乎与我当时期望的数据包数量不匹配框架.

I used the -R and -K option but it doesnt seem to be working as I captured the pumped traffic using tcpdump and the number of packets that I see there dont seem to match the number of packets that I expect in the time frame.

推荐答案

首先请确保您使用的是最新版本,该版本可用

First of all make sure you are using the latest version, available here. You will want to use the -K and --mbps (or -M) options, for example:

# tcpreplay -i eth7 -K --mbps 1000 smallFlows.pcap 
File Cache is enabled
Actual: 14261 packets (9216531 bytes) sent in 0.073761 seconds.
Rated: 124951275.0 Bps, 999.61 Mbps, 193340.65 pps
Flows: 1209 flows, 16390.77 fps, 14243 flow packets, 18 non-flow
Statistics for network device: eth7
    Attempted packets:         14261
    Successful packets:        14261
    Failed packets:            0
    Truncated packets:         0
    Retried packets (ENOBUFS): 0
    Retried packets (EAGAIN):  0

当您尝试提高速度(例如10GigE)时,您可能需要使用--loop选项生成更大的数据块.同样在Tcpreplay 4.0版中,还有更高级的--netmap和--unique-ip选项,它们在正确设置的系统上将实现接近线速和非常高的流量/秒.有关更多信息,请访问 Tcpreplay操作方法.这是一个示例:

When you attempt to move to higher speeds (e.g. 10GigE) you may need to generate a bigger block of data by using the --loop option. Also with Tcpreplay version 4.0 there are the more advanced --netmap and --unique-ip options which on a properly set up system, will achieve near wire rate and very high flows/sec. More information available at Tcpreplay How To. Here is an example:

# tcpreplay -i eth7 -K --mbps 9500 --loop 100 --netmap --unique-ip smallFlows.pcap 
Switching network driver for eth7 to netmap bypass mode... done!
File Cache is enabled
Actual: 1426100 packets (921653100 bytes) sent in 0.776133 seconds.
Rated: 1187493767.1 Bps, 9499.95 Mbps, 1837442.80 pps
Flows: 120900 flows, 155772.27 fps, 1424300 flow packets, 1800 non-flow
Statistics for network device: eth7
    Attempted packets:         1426100
    Successful packets:        1426100
    Failed packets:            0
    Truncated packets:         0
    Retried packets (ENOBUFS): 0
    Retried packets (EAGAIN):  0
Switching network driver for eth7 to normal mode... done!

这篇关于如何使用tcpreplay以100 MBps,500 MBps和1Gbps的速度泵送流量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆