【问题标题】:How do I pump traffic using tcpreplay at 100 MBps, 500 MBps and 1Gbps speeds?如何使用 tcpreplay 以 100 MBps、500 MBps 和 1Gbps 的速度泵送流量?
【发布时间】:2014-03-04 06:17:13
【问题描述】:

我使用了 -R 和 -K 选项,但它似乎不起作用,因为我使用 tcpdump 捕获了泵送的流量,而且我在那里看到的数据包数量似乎与我当时预期的数据包数量不匹配框架。

【问题讨论】:

    标签: network-programming wireshark tcpdump network-monitoring tcpreplay


    【解决方案1】:

    首先确保您使用的是最新版本,可用here。您将需要使用 -K 和 --mbps(或 -M)选项,例如:

    # 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 How To。这是一个例子:

    # 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!
    

    【讨论】:

      猜你喜欢
      • 2012-08-06
      • 1970-01-01
      • 1970-01-01
      • 2017-08-20
      • 1970-01-01
      • 2017-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多