Giter Site home page Giter Site logo

appneta / tcpreplay Goto Github PK

View Code? Open in Web Editor NEW
1.1K 51.0 263.0 12.4 MB

Pcap editing and replay tools for *NIX and Windows - Users please download source from

Home Page: http://tcpreplay.appneta.com/wiki/installation.html#downloads

Shell 0.13% C 90.88% Perl 0.28% Makefile 3.02% M4 5.48% Roff 0.21%
tcpreplay pcap netmap c replays-pcap-files flow traffic netflow performance performance-testing

tcpreplay's Introduction

Tcpreplay

Build Status Test Status Coverity Scan Build Status Website CodeQL cpp-linter

Tcpreplay is a suite of GPLv3 licensed utilities for UNIX (and Win32 under Cygwin) operating systems for editing and replaying network traffic which was previously captured by tools like tcpdump and Wireshark. It allows you to classify traffic as client or server, rewrite Layer 2, 3 and 4 packets and finally replay the traffic back onto the network and through other devices such as switches, routers, firewalls, NIDS and IPS's. Tcpreplay supports both single and dual NIC modes for testing both sniffing and in-line devices.

Tcpreplay is used by numerous firewall, IDS, IPS, NetFlow and other networking vendors, enterprises, universities, labs and open source projects. If your organization uses Tcpreplay, please let us know who you are and what you use it for so that I can continue to add features which are useful.

Tcpreplay is designed to work with network hardware and normally does not penetrate deeper than Layer 2. Yazan Siam with sponsorship from Cisco developed tcpliveplay to replay TCP pcap files directly to servers. Use this utility if you want to test the entire network stack and into the application.

As of version 4.0, Tcpreplay has been enhanced to address the complexities of testing and tuning IP Flow/NetFlow hardware. Enhancements include:

  • Support for netmap modified network drivers for 10GigE wire-speed performance
  • Increased accuracy for playback speed
  • Increased accuracy of results reporting
  • Flow statistics including Flows Per Second (fps)
  • Flow analysis for analysis and fine tuning of flow expiry timeouts
  • Hundreds of thousands of flows per second (dependent flow sizes in pcap file)

Version 4.0 is the first version delivered by Fred Klassen and sponsored by AppNeta. Many thanks to the author of Tcpreplay, Aaron Turner who has supplied the world with a a solid and full-featured test product thus far. The new author strives to take Tcprelay performance to levels normally only seen in commercial network test equipment.

Downloads

Products

Releases

The Tcpreplay suite includes the following tools:

Network playback products:

  • tcpreplay - replays pcap files at arbitrary speeds onto the network with an option to replay with random IP addresses
  • tcpreplay-edit - replays pcap files at arbitrary speeds onto the network with numerous options to modify packets packets on the fly
  • tcpliveplay - replays TCP network traffic stored in a pcap file on live networks in a manner that a remote server will respond to

Pcap file editors and utilities:

  • tcpprep - multi-pass pcap file pre-processor which determines packets as client or server and splits them into creates output files for use by tcpreplay and tcprewrite
  • tcprewrite - pcap file editor which rewrites TCP/IP and Layer 2 packet headers
  • tcpbridge - bridge two network segments with the power of tcprewrite
  • tcpcapinfo - raw pcap file decoder and debugger

Install package

Please visit our downloads page on our wiki for detailed download and installation instructions.

Simple directions for Unix users:

./configure 
make
sudo make install

Build netmap feature

This feature will detect netmap capable network drivers on Linux and BSD systems. If detected, the network driver is bypassed for the execution duration of tcpreplay and tcpreplay-edit, and network buffers will be written to directly. This will allow you to achieve full line rates on commodity network adapters, similar to rates achieved by commercial network traffic generators.

Note that bypassing the network driver will disrupt other applications connected through the test interface. Don't test on the same interface you ssh'ed into.

Download latest and install netmap from http://info.iet.unipi.it/~luigi/netmap/ If you extracted netmap into /usr/src/ or /usr/local/src you can build normally. Otherwise you will have to specify the netmap source directory, for example:

./configure --with-netmap=/home/fklassen/git/netmap
make
sudo make install

You can also find netmap source here.

Detailed installation instructions are available in the INSTALL document in the tar ball.

Install Tcpreplay from source code

Download the tar ball or zip file. Optionally clone the git repository:

git clone [email protected]:appneta/tcpreplay.git

Support

If you have a question or think you are experiencing a bug, submit them here. It is important that you provide enough information for us to help you.

If your problem has to do with COMPILING tcpreplay:

  • Version of tcpreplay you are trying to compile
  • Platform (Red Hat Linux 9 on x86, Solaris 7 on SPARC, OS X on PPC, etc)
  • Contents of config.status
  • Output from configure and make
  • Any additional information you think that would be useful.

If your problem has to do with RUNNING tcpreplay or one of the sub-tools:

  • Version information (output of -V)
  • Command line used (options and arguments)
  • Platform (Red Hat Linux 9 on Intel, Solaris 7 on SPARC, etc)
  • Make & model of the network card(s) and driver(s) version
  • Error message (if available) and/or description of problem
  • If possible, attach the pcap file used (compressed with bzip2 or gzip preferred)
  • The core dump or backtrace if available
  • Detailed description of your problem or what you are trying to accomplish

Note: The author of tcpreplay primarily uses OS X and Linux; hence, if you're reporting an issue on another platform, it is important that you give very detailed information as I may not be able to reproduce your issue.

You are also strongly encouraged to read the extensive documentation (man pages, FAQ, documents in /docs and email list archives) BEFORE posting to the tcpreplay-users email list:

http://lists.sourceforge.net/lists/listinfo/tcpreplay-users

If you have a bug to report you can submit it here:

https://github.com/appneta/tcpreplay/issues

If you want to help with development, visit our developers wiki:

https://github.com/appneta/tcpreplay/wiki

Lastly, please don't email the authors directly with your questions. Doing so prevents others from potentially helping you and your question/answer from showing up in the list archives.

License

Tcpreplay 3.5 is GPLv3 and includes software developed by the University of California, Berkeley, Lawrence Berkeley Laboratory and its contributors.

Authors and Contributors

Tcpreplay is authored by Aaron Turner. In 2013 Fred Klassen, Founder and VP Network Technology, AppNeta added performance features and enhancements, and ultimately took over the maintenance of Tcpreplay.

The source code repository has moved to GitHub. You can get a working copy of the repository by installing git and executing:

git clone https://github.com/appneta/tcpreplay.git

How To Contribute

It's easy. Basically you...


Details:

You will find that you will not be able to contribute to the Tcpreplay project directly if you use clone the appneta/tcpreplay repo. If you believe that you may someday contribute to the repository, GitHub provides an innovative approach. Forking the @appneta/tcpreplay repository allows you to work on your own copy of the repository and submit code changes without first asking permission from the authors. Forking is also considered to be a compliment so fork away:

  • if you haven't already done so, get yourself a free GitHub ID and visit @appneta/tcpreplay
  • click the Fork button to get your own private copy of the repository
  • on your build system clone your private repository:
git clone [email protected]:<your ID>/tcpreplay.git
  • we like to keep the master branch available for projection ready code so we recommend that you make a branch for each feature or bug fix
  • when you are happy with your work, push it to your GitHub repository
  • on your GitHub repository select your new branch and submit a Pull Request to master
  • optionally monitor the status of your submission here

We will review and possibly discuss the changes with you through GitHub services. If we accept the submission, it will instantly be applied to the production master branch.

Additional Information

Please visit our wiki.

or visit our developers wiki

tcpreplay's People

Contributors

aindeev avatar brianmicek avatar chipitsine avatar codacy-badger avatar corentin-p1 avatar cpackham avatar dave-craig-brightsign avatar demirten avatar dlangille avatar domt4 avatar doughdemon avatar dumprop avatar ffontaine avatar fklassen avatar fweimer-rh avatar gabrielganne avatar geraldcombs avatar glebius avatar guijan avatar hpeduartepe avatar jer-gentoo avatar jsbarber avatar kylemcdonald avatar marsman1996 avatar mattbing avatar nigredon1991 avatar ppietikainen avatar synfinatic avatar thesamesam avatar timgates42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tcpreplay's Issues

netmap injector

Enhancement that in my test environment is achieving full wire-rate with tcpreplay on my Intel 10GigE ixgbe (82599) adapter. I am also able to achieve full wire rate on Intel igb (server i350) GigE adapters. Note that I am only achieving 900Mbps on Intel e1000e (desktop 82574L) adapters, which appears to be the physical limitation of this adapter.

Performance is gained by replacing network drivers with netmap enabled drivers. These drivers by default run in normal mode, but once tcpreplay switches the driver to bypass mode, the network driver is bypassed and tcpreplay can write directly into the network adapter buffers. Netmap is available here http://info.iet.unipi.it/~luigi/netmap/

Typically the injector method is selected at compile time. I propose that in cases where tcpreplay is specifically compiled with netmap functionality, that the injector is dynamically selected. Upon initialization it will query (via ioctl) the adapter's ability to run in netmap mode, in which case the adapter will be switched to bypass mode for the duration of the tcpreplay execution. Otherwise the execution uses the default injector.

I also propose that an informational message be printed that states the injector method uses in cases where netmap functionality is available.

Doesn't support ARM aarch64 in f19 and rawhide

Reported in RedHat https://bugzilla.redhat.com/show_bug.cgi?id=926615

Sayeth Dennis Gilmore:

Support for the ARM 64 bit CPU architecture (aarch64) was introduced in
autoconf 2.69. tcpreplay appears to use an earlier version of
autoconf, preventing its being built. This can be fixed in of three ways (In order of preference):

  1. Work with upstream to migrate the package to autoconf 2.69.
  2. Rerun autoconf or autoreconf in %prep or %build prior to running
    configure.
  3. Apply the patch at http://ausil.fedorapeople.org/aarch64/tcpreplay/tcpreplay-aarch64.patch
    which updates config.guess and config.sub to recognize aarch64.

can tcpreplay used to send traffic bidirectional?

i have 1000s of packet captures with client server communication.
i know tcpreplay supports to change source and destination ip according to our local setup.
Can it make the traffic flow in bidirection. i.e Client server communication.?
How to do the same?

improve --mbps option stability and performance

On fast links (i.e. 10GigE) the '--mbps' option is not performing as quickly as the '-t' option. This should be improved. Example:

# tcpreplay --preload-pcap --intf1=eth7 -t --loop 10 bosTap.pcap 
File Cache is enabled
Actual: 7916150 packets (3554177840 bytes) sent in 4.31 seconds.
Rated: 824635200.0 Bps, 6597.08 Mbps, 1836693.75 pps
Statistics for network device: eth7
    Attempted packets:         7916150
    Successful packets:        7916150
    Failed packets:            0
    Retried packets (ENOBUFS): 0
    Retried packets (EAGAIN):  0

# tcpreplay --preload-pcap --intf1=eth7 --mbps=4000 --loop 10 bosTap.pcap
File Cache is enabled
Actual: 7916150 packets (3554177840 bytes) sent in 8.99 seconds.
Rated: 395347936.0 Bps, 3162.78 Mbps, 880550.62 pps
Statistics for network device: eth7
    Attempted packets:         7916150
    Successful packets:        7916150
    Failed packets:            0
    Retried packets (ENOBUFS): 0
    Retried packets (EAGAIN):  0

Does not compile on ARM

Various issues including missing files on dist and failure to compile using methods of compiling from source.

Bug - merge build fails when building netmap after merge #20

After merge get the following error

gcc -DHAVE_CONFIG_H -I. -I../../src    -I.. -I../..   -D_U_="__attribute__((unused))"  -Wall -O3 -std=gnu99 -Wextra -Wno-variadic-macros -Wfatal-errors -I/usr/include -I/usr/src/netmap-backup//sys -MT sendpacket.o -MD -MP -MF .deps/sendpacket.Tpo -c -o sendpacket.o sendpacket.c
sendpacket.c: In function โ€˜sendpacket_openโ€™:
sendpacket.c:515: error: โ€˜sendpacket_typeโ€™ undeclared (first use in this function)
compilation terminated due to -Wfatal-errors.
make[4]: *** [sendpacket.o] Error 1
make[4]: Leaving directory `/home/fklassen/git/tcpreplay/src/common'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/fklassen/git/tcpreplay/src/common'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/fklassen/git/tcpreplay/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/fklassen/git/tcpreplay/src'

Unable to compile on OS X due to libpcap

Not sure if I have to compile libpcap with special options. Library seems to be missing something:

sendpacket.c:225:22: warning: function 'sendpacket_open_pcap' has internal linkage but is not defined [-Wundefined-internal]
static sendpacket_t *sendpacket_open_pcap(const char *, char *) _U_;
                     ^
sendpacket.c:541:18: note: used here
            sp = sendpacket_open_pcap(device, errbuf);
                 ^
sendpacket.c:226:32: warning: function 'sendpacket_get_hwaddr_pcap' has internal linkage but is not defined [-Wundefined-internal]
static struct tcpr_ether_addr *sendpacket_get_hwaddr_pcap(sendpacket_t *) _U_;

and when linking...

"_sendpacket_get_hwaddr_pcap", referenced from:Undefined symbols for architecture x86_64:
-bash: _sendpacket_get_hwaddr_pcap,: command not found

--stats displays bad values

Not sure if this only happens with -t but --stats doesn't calculate the time correctly because end_time isn't initialized.

Actual: 193775 packets (120555946 bytes) sent in -1392234103.04 seconds.
Rated: 0.0 Bps, 0.000 Mbps, 0.00 pps

Probably could be fixed in send_packets.c with just "ctx->stats.end_time = now;" before calling packet_stats. However wasn't sure if in non -t mode if end_time is used for something else. Tried locally and it seems to work for us. :)

Build error on host without tcpdump

Hi,

I updated the tcpreplay version in buildroot[1] to 4.0.0 (will update to 4.0.2 shortly). While it built fine for me and others the automated build system started showing failures[2]. Eventually another developer figured out that if the host system didn't have tcpdump installed then the build would fail. Reproduction below

[1] - http://buildroot.org
[2] - http://autobuild.buildroot.net/results/69e/69e5adcb5c92259566556aea2b0ac4290f6d0cd2/build-end.log

sudo mv /usr/sbin/tcpdump /usr/sbin/tcpdump.copy
./configure
make
...
gcc -DHAVE_CONFIG_H -I.    -I../libopts -I..   -DTCPREPLAY -D_U_="__attribute__((unused))"  -Wall -O3 -std=gnu99  -Wno-variadic-macros -Wfatal-errors -Wno-format-contains-nul -I/usr/include -MT tcpreplay-tcpreplay_api.o -MD -MP -MF .deps/tcpreplay-tcpreplay_api.Tpo -c -o tcpreplay-tcpreplay_api.o `test -f 'tcpreplay_api.c' || echo './'`tcpreplay_api.c
tcpreplay_api.c: In function โ€˜tcpreplay_set_verboseโ€™:
tcpreplay_api.c:693:5: error: expected expression before โ€˜)โ€™ token

Unexpected packet counts with --loop and --cachefile enabled

From Thomas McMurphy:

Version information (output of -V)
tcpreplay version: 4.0.3 (build git:v4.0.3)
Copyright 2013-2014 by Fred Klassen -
AppNeta Inc.
Copyright 2000-2012 by Aaron Turner
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Not compiled with libdnet.
Compiled against libpcap: 1.5.3
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Packet editing: disabled
Fragroute engine: disabled
Injection method: PF_PACKET send()

Platform (Red Hat Linux 9 on Intel, Solaris 7 on SPARC, etc)
Debian 3.11.8-1

Make & model of the network card(s) and driver(s) version
Card: Intel Corporation Ethernet 10G 2P X520 Adapter (rev 01)
Driver: ixgbe 3.18.7

If possible, attach the pcap file used (compressed with bzip2 or gzip preferred)
bigFlows.pcap from http://tcpreplay.appneta.com/wiki/captures.html

Detailed description of your problem or what you are trying to accomplish
I have a linux host with two interfaces 'traffic1' and 'traffic2'.
Both of these interfaces are connected to each other through a switch.
With this setup I am trying to test a pcap/cachefile pair for
bidirectional replay.

To create the cachefile I used the following command:
/usr/local/bin/tcpprep --auto=client --pcap=bigFlows.pcap
--cachefile=bigFlows.cache

Then used the following command to replay the file one time:
/usr/local/bin/tcpreplay --loop=1 --quiet --topspeed
--cachefile=bigFlows.cache --intf1=traffic1 --intf2=traffic2
bigFlows.pcap

And received the following report:
Actual: 791615 packets (355417784 bytes) sent in 0.602658 seconds.
Rated: 589750379.1 Bps, 4718.00 Mbps, 1313539.35 pps
Flows: 40686 flows, 67510.92 fps, 791179 flow packets, 436 non-flow
Statistics for network device: traffic1
Attempted packets: 584308
Successful packets: 584308
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
Flows total: 28397
Flows unique: 0
Flows expired: 0
Flow packets: 584308
Non-flow packets: 0
Invalid flow packets: 0
Statistics for network device: traffic2
Attempted packets: 207307
Successful packets: 207307
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
Flows total: 12289
Flows unique: 0
Flows expired: 0
Flow packets: 206871
Non-flow packets: 436
Invalid flow packets: 0

After that I ran the following command to replay the file two times:
/usr/local/bin/tcpreplay --loop=2 --quiet --topspeed
--cachefile=bigFlows.cache --intf1=traffic1 --intf2=traffic2
bigFlows.pcap

And received the following report:
Actual: 791615 packets (355417784 bytes) sent in 0.846339 seconds.
Rated: 419947307.1 Bps, 3359.57 Mbps, 935340.33 pps
Flows: 40686 flows, 48072.93 fps, 1582358 flow packets, 872 non-flow
Statistics for network device: traffic1
Attempted packets: 584308
Successful packets: 584308
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
Flows total: 28397
Flows unique: 0
Flows expired: 0
Flow packets: 584308
Non-flow packets: 0
Invalid flow packets: 0
Statistics for network device: traffic2
Attempted packets: 207307
Successful packets: 207307
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
Flows total: 12289
Flows unique: 0
Flows expired: 0
Flow packets: 206871
Non-flow packets: 436
Invalid flow packets: 0

Now with the second run I was expecting to see twice as many packets
transmitted as the first. To confirm the packet counts are really the
same I reran the tcpreplay commands again with tcpdump running on both
traffic interfaces. For both scenarios, tcpreplay and tcpdump reports
that 791615 packets were seen.

I have tried replaying the file again without the '--intf2' or
'--cachefile' options and I am seeing the packet count values I was
expecting.

/usr/local/bin/tcpreplay --quiet --topspeed --intf1=traffic1 bigFlows.pcap
Actual: 791615 packets (355417784 bytes) sent in 0.749699 seconds.
Rated: 474080643.0 Bps, 3792.64 Mbps, 1055910.43 pps
Flows: 40686 flows, 54269.78 fps, 791179 flow packets, 436 non-flow
Statistics for network device: traffic1
Attempted packets: 791615
Successful packets: 791615
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0

/usr/local/bin/tcpreplay --loop=2 --quiet --topspeed --intf1=traffic1
bigFlows.pcap
Actual: 1583230 packets (710835568 bytes) sent in 1.04 seconds.
Rated: 481899875.8 Bps, 3855.19 Mbps, 1073326.06 pps
Flows: 40686 flows, 27582.43 fps, 3164716 flow packets, 1744 non-flow
Statistics for network device: traffic1
Attempted packets: 1583230
Successful packets: 1583230
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0

  • Is the behaviour the result of something I've done wrong?
  • Anyone got ideas for more tests I can run to narrow down the issue?

DLT conversion and IP address conversion cannot be done in one pass

As per mail list discussion:

Hi Aaron,
You're right, using /0 is not the right thing to do, but I started off using /32 and got increasingly desperate.

However, your suggestion seems to have made it work nicely. For the future archaeologists, here's what I did that worked:

tcprewrite --infile=../pcap/sendfax.pcap --outfile=../pcap/mod_sendfax.pcap --dlt=enet
tcprewrite --srcipmap=91.194.225.4/32:192.168.1.211/32 --dstipmap=91.194.225.103/32:192.168.1.170/32 --infile=../pcap/mod_sendfax.pcap --outfile=../pcap/final_sendfax.pcap --fixcsum

And that seems to have made the exact changes I was looking for, when I check the new file in Wireshark.
However, if I don't change it to enet first, and just run:
tcprewrite --srcipmap=91.194.225.4/32:192.168.1.211/32 --dstipmap=91.194.225.103/32:192.168.1.170/32 --infile=../pcap/sendfax.pcap --outfile=../pcap/final_sendfax.pcap --dlt=enet --fixcsum
Then the source ip breaks, becoming 255.255.255.4, with bad checksums.

Anyway, thanks for the help.
Ryan

On 2014-02-10, at 11:49 PM, Aaron Turner wrote:

Using 94.194.255.4/0 is a bit odd. You're basically writing 0.0.0.0/0
or 255.255.255.255/0... they're all equivalent and so you're matching
everything.
Could be a bug with calculating the offsets though. Try first
converting it to Ethernet first and then running tcprewrite a second

time to change the source IP.

Aaron Turner
http://synfin.net/ Twitter: @synfinatic
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin
On Mon, Feb 10, 2014 at 2:00 PM, Ryan d'Eon [email protected] wrote:
Hello,
I've taken a pcap file from: https://code.osso.nl/projects/sipp/browser#pcap , the one labeled "sendfax.pcap".
I've viewed it in wireshark, looked at the source and dest IPs, and want to change them to ones of my choosing.
To try to change source ip = 94.194.255.4 to 192.168.1.211, I used:
tcprewrite --srcipmap=94.194.255.4/0:192.168.1.211/32 --infile=../pcap/sendfax.pcap --outfile=../pcap/mod_sendfax.pcap --dlt=enet --fixcsum
But when I view this output file in wireshark, instead I find that the source IP has changed to 255.255.192.168 and dest IP is now 1.211.255.103 . Notice the ip I was looking for, 192.168.1.211, is split across the two! Wireshark also tells me the checksum is now wrong.
This looks to (naive) me like the tool might have edited the wrong bytes. However, I know so little about the syntax of this operation, that I can't be sure. I've tried a variety of xx.xx.xx.xx/y , with colons and commas, and this experimentation + reading the docs has left me here.
So, any help you could give would great.
In case it helps,
$ tcprewrite -V
tcprewrite version: 3.4.4 (build 2450)
Copyright 2000-2010 by Aaron Turner
Cache file supported: 04
Not compiled with libdnet.
Compiled against libpcap: 1.1.1
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Fragroute engine: disabled
I'm using OSX 10.7.5, and there are no error messages. The input file is Linux Cooked (DLT_LINUX_SLL), which is why I had to specify the output encoding to enet.
Thanks,
Ryan

Number of packets is Inaccurate when use --netmap method

Version information (output of -V)
tcpreplay version: 4.0.3 (build git:v4.0.3)
Copyright 2013-2014 by Fred Klassen - AppNeta Inc.
Copyright 2000-2012 by Aaron Turner
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Not compiled with libdnet.
Compiled against libpcap: 1.4.0
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Packet editing: disabled
Fragroute engine: disabled
Default injection method: PF_PACKET send()
Optional injection method: netmap

netmap is from http://code.google.com/p/netmap/

Command line used (options and arguments)
tcpreplay -i eth3 --netmap -tK ./ipv4_http.pcap

Platform (Red Hat Linux 9 on Intel, Solaris 7 on SPARC, etc)
debian 7 on Intel

Make & model of the network card(s) and driver(s) version
Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
ixgbe (netmap diff)

Error message (if available) and/or description of problem
I use Switch to receive the packet from my machine.After sending,the switch show lost some packet,but tcpreply say no packet lost.I found that there are some packets left in tx queue. so ,I add one func at src/common/sendpacket.c

ifdef HAVE_NETMAP

int
sync_netmap(sendpacket_t *sp)
{
ioctl(sp->handle.fd, NIOCTXSYNC, NULL);
return 0;
}

endif

And, call it at src/send_packet.c send_packets() 605 line

603 } /* while */
604
605 #ifdef HAVE_NETMAP
606 sync_netmap(sp);
607 #endif
608
609 ++ctx->iteration;
610 }

After that, it's ok.
I hope that is help to you.
My English is no good,sorry.

netmap-libpcap not recognized

According to Luigi Rizzo, netmap-libpcap doesn't work. Here is his email to me...

there is one thing i wanted to mention:
netmap (and netmap-libpcap) now encode in the device name
all parameters of interest: whether it is a NIC, a VALE port
or a pipe, whether you want to access an individual queue
or the host stack or the master/slave side of a pipe, etc.

The consequence is that we cannot really have an enumerate
routine in netmap-libpcap, and i have been told that tcpreplay
(and i have seen other apps) seems unhappy if the name
is not one returned by the pcap_findalldevs().

So do you know if there is (or, could you provide) a flag
to accept arbitrary device names and skip the match with
the enumeration results ?

thanks
luigi

option updates and 4.0 merge

As per discussion with @synfinatic

I am thinking the following, and please let me know if you have concerns:

  1. get rid of --rdtcs and --rdtsc-clicks - as discussed
  2. get rid of --sleep-accel - already done. Not required now that timestamps happen after packet is sent, and time stamping doesnโ€™t happen when it detects that TX is falling behind. Now --mbps as fast as or faster than --pps
  3. get rid of --sleep-mode - v325 not as good as current version

Questionable:

  1. is --enable_file_cache required if we have --preload-pcap ?
  2. is --pktlen real? I havenโ€™t seen anything lately that captures bigger than caplen, so can this be removed?
  3. Juniper DLT - I notice this in 4.0alpha1. Seems cool, but is there a demand? Has it been tested, i.e. if I copy it over without testing will it work?
  4. Other 4.0alpha1 stuff - I find lots of other good things in it (other than cmake) that I would like to copy over

Unable to compile on FreeBSD10

cc -DHAVE_CONFIG_H -I.    -I../libopts -I..   -DTCPPREP -D_U_="__attribute__((unused))"  -Wall -O3 -std=gnu99  -Wno-variadic-macros -Wfatal-errors  -I/usr/include -MT tcpprep-tree.o -MD -MP -MF .deps/tcpprep-tree.Tpo -c -o tcpprep-tree.o `test -f 'tree.c' || echo './'`tree.c
tree.c:85:29: fatal error: use of undeclared identifier 'AF_INET'
        if (node->family == AF_INET) {

4.0.0beta2

Found some bugs including inability to compile on BSD

Fail if interface specified is actually a file or directory

As reported...

The problem, in a nutshell:

# tcpreplay -t -i p1p1 big.pcap

Fatal Error:
%s is not a valid Tcpreplay character device

Two issues.
(1) This seems to have intended to be routed through a printf function,
but doesnยนt seem to be (see missing args below).
(2) It doesnยนt work, whereas old tcpreplay 3.4.4 works fine.


This problem seems independent of the pcap file specified.
It has been reproduced on a different CentOS 6.5 system, but with ๋˜ชoยน,
and with a more recent kernel.

Yes, I am root (uid=0). No, SELinux is not running.


Any thoughts? Details follow ...

Thanks for any help you can offer.

kind regards,

Seth

. . . .

CentOS 6.3, 2.6.32-279.19.1.el6.x86_64 kernel.

tcpreplay version: 4.0.3 (build git:v4.0.3)
Copyright 2013-2014 by Fred Klassen <tcpreplay at appneta dot com> -
AppNeta Inc.
Copyright 2000-2012 by Aaron Turner <aturner at synfin dot net>
The entire Tcpreplay Suite is licensed under the GPLv3
Cache file supported: 04
Not compiled with libdnet.
Compiled against libpcap: 1.4.0
64 bit packet counters: enabled
Verbose printing via tcpdump: enabled
Packet editing: disabled
Fragroute engine: disabled
Injection method: PF_PACKET send()

driver: ixgbe
version: 3.12.6
firmware-version: 0x61bd0001
bus-info: 0000:01:00.0

# tcpreplay ๋•—istnics
Available network interfaces:
p1p1
p1p2
em1
em2
any

#0  0x000000370e6acea0 in _exit () from /lib64/libc.so.6
#1  0x000000370e635d52 in exit () from /lib64/libc.so.6
#2  0x000000000040ab7c in sendpacket_open (device=0x832a50 "p1p1",
    errbuf=0x7fffffffdcb0 "", direction=TCPR_DIR_C2S,
    sendpacket_type=<value optimized out>) at sendpacket.c:555
#3  0x0000000000407258 in tcpreplay_post_args (ctx=0x827010,
    argc=<value optimized out>) at tcpreplay_api.c:289
#4  0x00000000004054f5 in main (argc=1, argv=0x7fffffffe610) at
tcpreplay.c:73

#2  0x000000000040ab7c in sendpacket_open (device=0x832a50 "p1p1",
    errbuf=0x7fffffffdcb0 "", direction=TCPR_DIR_C2S,
    sendpacket_type=<value optimized out>) at sendpacket.c:555
555             err(1, "%s is not a valid Tcpreplay character deviceยฒ);

(gdb) list
550         if (((sdata.st_mode & S_IFMT) == S_IFCHR)) {
551
552             sp = sendpacket_open_khial(device, errbuf);
553
554         } else {
555             err(1, "%s is not a valid Tcpreplay character device");
556         }
557     } else {
558 #ifdef HAVE_NETMAP
559         if (sendpacket_type == SP_TYPE_NETMAP)
(gdb) p /x sdata.st_mode
$2 = 0x41ed

Also ...

Based on this comment and running strace on tcpreplay and stat, I am 90%
sure that the problem is that some other user created a directory called
ล’p1p1ยน. It didnยนt occur to me to look for this until you said that.
You can probably reproduce my issue by doing a ล’mkdir <ifacename>ยน and
then trying to invoke 'tcpreplay -i <ifacename>ยน from that directory.

When I run tcpreplay from /tmp, the problem goes away. So you could say I
have a workaround.

add --unique-flows feature

This feature in tcpreplay will ensure IPv4 and IPv6 packets will be unique for each iteration of the --loop option. This must be done in a way that will not affect CRC, and therefore not affect wire-rate performance. This will significantly increase the flows/sec over multiple loop iterations.

Merge Juniper Encapsulated Ethernet DLT support

Originally from synfinatic/appneta master.

As per Mike Komer, may be difficult to test ....

The only devices I have access to are in a lab and controlled by lab d00ds. The Link Layer is EthernetII. I can try and find the folks responsible for the code and see what they use for test beds. As everyone is off for the next 5 days, blue flu is setting in around here so it might take a while.

4.0.3

Pick up build issues reported by users

netmap on igb driver slow

With/without netmap results:

root@portwell24:~/netmap# tcpreplay -i eth9 -t --preload-pcap /root/tcpreplay-netmap/bosTap.pcap 
File Cache is enabled
Actual: 791615 packets (355417784 bytes) sent in 3.00 seconds.
Rated: 118099949.9 Bps, 944.79 Mbps, 263041.68 pps
Flows: 40686 flows, 13519.34 fps, 791179 flow packets, 436 non-flow
Statistics for network device: eth9
    Attempted packets:         791615
    Successful packets:        791615
    Failed packets:            0
    Truncated packets:         0
    Retried packets (ENOBUFS): 0
    Retried packets (EAGAIN):  0
root@portwell24:~/netmap# tcpreplay -i eth9 -t --preload-pcap --netmap /root/tcpreplay-netmap/bosTap.pcap 
Switching network driver for eth9 to netmap bypass mode... done!
File Cache is enabled
Actual: 791615 packets (355417784 bytes) sent in 10.06 seconds.
Rated: 33436254.0 Bps, 267.49 Mbps, 74471.90 pps
Flows: 40686 flows, 3827.57 fps, 791179 flow packets, 436 non-flow
Statistics for network device: eth9
    Attempted packets:         791615
    Successful packets:        791615
    Failed packets:            0
    Truncated packets:         0
    Retried packets (ENOBUFS): 0
    Retried packets (EAGAIN):  0
Switching network driver for eth9 to normal mode... done!

Get the following on the console log:

[  587.950621] eth9: no IPv6 routers present
[  643.946107] 388.602407 netmap_memory_config [808] reconfiguring
[  644.012206] 388.668693 netmap_mem_finalize_all [696] Have 100 KB for interfaces, 7200 KB for rings and 320 MB for buffers
[  644.077938] 388.734616 netmap_mem_finalize_all [698] Free buffers: 163838
[  644.169091] 388.826029 netmap_reset [3123] TX hwofs 0 -> 0, hwavail 255 -> 255
[  644.222525] 388.879617 netmap_reset [3123] TX hwofs 0 -> 0, hwavail 255 -> 255
[  644.275974] 388.933218 netmap_reset [3123] TX hwofs 0 -> 0, hwavail 255 -> 255
[  644.329383] 388.986780 netmap_reset [3123] TX hwofs 0 -> 0, hwavail 255 -> 255
[  644.382791] 389.040341 netmap_reset [3123] TX hwofs 0 -> 0, hwavail 255 -> 255
[  644.436194] 389.093897 netmap_reset [3123] TX hwofs 0 -> 0, hwavail 255 -> 255
[  644.489600] 389.147455 netmap_reset [3123] TX hwofs 0 -> 0, hwavail 255 -> 255
[  644.543006] 389.201014 netmap_reset [3123] TX hwofs 0 -> 0, hwavail 255 -> 255
[  644.586466] 389.244599 netmap_reset [3123] RX hwofs 0 -> 0, hwavail 0 -> 0
[  644.627868] 389.286119 netmap_reset [3123] RX hwofs 0 -> 0, hwavail 0 -> 0
[  644.669245] 389.327614 netmap_reset [3123] RX hwofs 0 -> 0, hwavail 0 -> 0
[  644.710621] 389.369109 netmap_reset [3123] RX hwofs 0 -> 0, hwavail 0 -> 0
[  644.751998] 389.410604 netmap_reset [3123] RX hwofs 0 -> 0, hwavail 0 -> 0
[  644.793375] 389.452099 netmap_reset [3123] RX hwofs 0 -> 0, hwavail 0 -> 0
[  644.834751] 389.493594 netmap_reset [3123] RX hwofs 0 -> 0, hwavail 0 -> 0
[  644.876128] 389.535089 netmap_reset [3123] RX hwofs 0 -> 0, hwavail 0 -> 0
[  644.917521] 389.576600 netmap_enable_all_rings [401] enabling ffff8803d11f8000
[  644.960964] 389.620168 netmap_enable_all_rings [401] enabling ffff8803d11f8080
[  645.004414] 389.663742 netmap_enable_all_rings [401] enabling ffff8803d11f8100
[  645.047866] 389.707318 netmap_enable_all_rings [401] enabling ffff8803d11f8180
[  645.091315] 389.750891 netmap_enable_all_rings [401] enabling ffff8803d11f8200
[  645.134765] 389.794466 netmap_enable_all_rings [401] enabling ffff8803d11f8280
[  645.178220] 389.838045 netmap_enable_all_rings [401] enabling ffff8803d11f8300
[  645.221667] 389.881616 netmap_enable_all_rings [401] enabling ffff8803d11f8380
[  645.265117] 389.925191 netmap_enable_all_rings [401] enabling ffff8803d11f8400
[  645.308566] 389.968764 netmap_enable_all_rings [405] enabling ffff8803d11f8480
[  645.352018] 390.012340 netmap_enable_all_rings [405] enabling ffff8803d11f8500
[  645.395469] 390.055916 netmap_enable_all_rings [405] enabling ffff8803d11f8580
[  645.438915] 390.099485 netmap_enable_all_rings [405] enabling ffff8803d11f8600
[  645.482367] 390.143062 netmap_enable_all_rings [405] enabling ffff8803d11f8680
[  645.525821] 390.186639 netmap_enable_all_rings [405] enabling ffff8803d11f8700
[  645.569274] 390.230218 netmap_enable_all_rings [405] enabling ffff8803d11f8780
[  645.612721] 390.273788 netmap_enable_all_rings [405] enabling ffff8803d11f8800
[  645.656172] 390.317364 netmap_enable_all_rings [405] enabling ffff8803d11f8880
[  647.988280] igb: eth9 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[  649.728208] device eth9 entered promiscuous mode
[  650.218456] 394.892691 igb_netmap_txsync [180] ouch, hwavail -2
[  650.254139] 394.928479 igb_netmap_txsync [180] ouch, hwavail -3
[  650.289851] 394.964293 igb_netmap_txsync [180] ouch, hwavail -4
[  650.325523] 395.000067 igb_netmap_txsync [180] ouch, hwavail -5
[  650.361197] 395.035843 igb_netmap_txsync [180] ouch, hwavail -6
[  650.396873] 395.071621 igb_netmap_txsync [180] ouch, hwavail -7
[  650.432542] 395.107392 igb_netmap_txsync [180] ouch, hwavail -8
[  650.468208] 395.143160 igb_netmap_txsync [180] ouch, hwavail -9
[  650.503882] 395.178935 igb_netmap_txsync [180] ouch, hwavail -10
[  650.540068] 395.215225 igb_netmap_txsync [180] ouch, hwavail -11
[  650.576242] 395.251503 igb_netmap_txsync [180] ouch, hwavail -12
[  650.612415] 395.287780 igb_netmap_txsync [180] ouch, hwavail -13
[  650.648546] 395.324013 igb_netmap_txsync [180] ouch, hwavail -14
[  650.684684] 395.360255 igb_netmap_txsync [180] ouch, hwavail -15
[  650.720826] 395.396501 igb_netmap_txsync [180] ouch, hwavail -16
[  650.756965] 395.432742 igb_netmap_txsync [180] ouch, hwavail -17
[  650.793106] 395.468987 igb_netmap_txsync [180] ouch, hwavail -18
[  650.829246] 395.505230 igb_netmap_txsync [180] ouch, hwavail -19
[  650.865392] 395.541479 igb_netmap_txsync [180] ouch, hwavail -20
[  650.901527] 395.577718 igb_netmap_txsync [180] ouch, hwavail -21
[  650.937664] 395.613958 igb_netmap_txsync [180] ouch, hwavail -22
[  650.973807] 395.650205 igb_netmap_txsync [180] ouch, hwavail -23
[  651.009945] 395.686446 igb_netmap_txsync [180] ouch, hwavail -24
[  651.046090] 395.722695 igb_netmap_txsync [180] ouch, hwavail -25
[  651.082233] 395.758940 igb_netmap_txsync [180] ouch, hwavail -26
[  651.118374] 395.795185 igb_netmap_txsync [180] ouch, hwavail -27
[  651.154511] 395.831426 igb_netmap_txsync [180] ouch, hwavail -28
[  651.190651] 395.867668 igb_netmap_txsync [180] ouch, hwavail -29
[  651.226781] 395.903903 igb_netmap_txsync [180] ouch, hwavail -30
[  651.262925] 395.940150 igb_netmap_txsync [180] ouch, hwavail -31
[  651.299062] 395.976390 igb_netmap_txsync [180] ouch, hwavail -32
[  651.335202] 396.012633 igb_netmap_txsync [180] ouch, hwavail -33
[  651.371345] 396.048879 igb_netmap_txsync [180] ouch, hwavail -34
[  651.407484] 396.085122 igb_netmap_txsync [180] ouch, hwavail -35
[  651.443628] 396.121369 igb_netmap_txsync [180] ouch, hwavail -36
[  651.479767] 396.157611 igb_netmap_txsync [180] ouch, hwavail -37
[  651.515908] 396.193855 igb_netmap_txsync [180] ouch, hwavail -38
[  651.552047] 396.230098 igb_netmap_txsync [180] ouch, hwavail -39
[  651.588186] 396.266341 igb_netmap_txsync [180] ouch, hwavail -40
[  651.624329] 396.302586 igb_netmap_txsync [180] ouch, hwavail -41
[  651.660474] 396.338835 igb_netmap_txsync [180] ouch, hwavail -42
[  651.696611] 396.375076 igb_netmap_txsync [180] ouch, hwavail -43
[  651.732750] 396.411318 igb_netmap_txsync [180] ouch, hwavail -44
[  651.768890] 396.447561 igb_netmap_txsync [180] ouch, hwavail -45
[  651.805029] 396.483803 igb_netmap_txsync [180] ouch, hwavail -46
[  651.841173] 396.520051 igb_netmap_txsync [180] ouch, hwavail -47
[  651.877301] 396.556282 igb_netmap_txsync [180] ouch, hwavail -48
[  651.913422] 396.592507 igb_netmap_txsync [180] ouch, hwavail -49
[  651.949501] 396.628689 igb_netmap_txsync [180] ouch, hwavail -50
[  651.985592] 396.664883 igb_netmap_txsync [180] ouch, hwavail -51
[  652.021683] 396.701077 igb_netmap_txsync [180] ouch, hwavail -52
[  652.057775] 396.737272 igb_netmap_txsync [180] ouch, hwavail -53
[  652.093867] 396.773467 igb_netmap_txsync [180] ouch, hwavail -54
[  652.129953] 396.809656 igb_netmap_txsync [180] ouch, hwavail -55
[  652.166039] 396.845845 igb_netmap_txsync [180] ouch, hwavail -56
[  652.202127] 396.882037 igb_netmap_txsync [180] ouch, hwavail -57
[  652.238217] 396.918230 igb_netmap_txsync [180] ouch, hwavail -58
[  652.274305] 396.954421 igb_netmap_txsync [180] ouch, hwavail -59
[  652.310393] 396.990612 igb_netmap_txsync [180] ouch, hwavail -60
[  652.346483] 397.026806 igb_netmap_txsync [180] ouch, hwavail -61
[  652.382571] 397.062997 igb_netmap_txsync [180] ouch, hwavail -62
[  652.418659] 397.099188 igb_netmap_txsync [180] ouch, hwavail -63
[  652.454749] 397.135381 igb_netmap_txsync [180] ouch, hwavail -64
[  652.490836] 397.171571 igb_netmap_txsync [180] ouch, hwavail -65
[  652.526925] 397.207764 igb_netmap_txsync [180] ouch, hwavail -66
[  652.563016] 397.243957 igb_netmap_txsync [180] ouch, hwavail -67
[  652.599103] 397.280148 igb_netmap_txsync [180] ouch, hwavail -68
[  652.635189] 397.316338 igb_netmap_txsync [180] ouch, hwavail -69
[  652.671281] 397.352532 igb_netmap_txsync [180] ouch, hwavail -70
[  652.707368] 397.388723 igb_netmap_txsync [180] ouch, hwavail -71
[  652.743458] 397.424917 igb_netmap_txsync [180] ouch, hwavail -72
[  652.779546] 397.461107 igb_netmap_txsync [180] ouch, hwavail -73
[  652.815632] 397.497296 igb_netmap_txsync [180] ouch, hwavail -74
[  652.851724] 397.533491 igb_netmap_txsync [180] ouch, hwavail -75
[  652.887812] 397.569683 igb_netmap_txsync [180] ouch, hwavail -76
[  652.923901] 397.605875 igb_netmap_txsync [180] ouch, hwavail -77
[  652.959990] 397.642068 igb_netmap_txsync [180] ouch, hwavail -78
[  652.996078] 397.678258 igb_netmap_txsync [180] ouch, hwavail -79
[  653.032169] 397.714453 igb_netmap_txsync [180] ouch, hwavail -80
[  653.068262] 397.750648 igb_netmap_txsync [180] ouch, hwavail -81
[  653.104349] 397.786839 igb_netmap_txsync [180] ouch, hwavail -82
[  653.140435] 397.823028 igb_netmap_txsync [180] ouch, hwavail -83
[  653.176525] 397.859221 igb_netmap_txsync [180] ouch, hwavail -84
[  653.212614] 397.895413 igb_netmap_txsync [180] ouch, hwavail -85
[  653.248704] 397.931607 igb_netmap_txsync [180] ouch, hwavail -86
[  653.284791] 397.967797 igb_netmap_txsync [180] ouch, hwavail -87
[  653.320878] 398.003987 igb_netmap_txsync [180] ouch, hwavail -88
[  653.356966] 398.040179 igb_netmap_txsync [180] ouch, hwavail -89
[  653.393055] 398.076370 igb_netmap_txsync [180] ouch, hwavail -90
[  653.429143] 398.112562 igb_netmap_txsync [180] ouch, hwavail -91
[  653.465236] 398.148758 igb_netmap_txsync [180] ouch, hwavail -92
[  653.501378] 398.185004 igb_netmap_txsync [180] ouch, hwavail -93
[  653.537516] 398.221244 igb_netmap_txsync [180] ouch, hwavail -94
[  653.573604] 398.257435 igb_netmap_txsync [180] ouch, hwavail -95
[  653.609694] 398.293628 igb_netmap_txsync [180] ouch, hwavail -96
[  653.645782] 398.329820 igb_netmap_txsync [180] ouch, hwavail -97
[  653.681868] 398.366009 igb_netmap_txsync [180] ouch, hwavail -98
[  653.717955] 398.402200 igb_netmap_txsync [180] ouch, hwavail -99
[  653.754045] 398.438391 igb_netmap_txsync [180] ouch, hwavail -100
[  653.790648] 398.475100 igb_netmap_txsync [180] ouch, hwavail -101
[  653.827259] 398.511816 igb_netmap_txsync [180] ouch, hwavail -102
[  653.863866] 398.548527 igb_netmap_txsync [180] ouch, hwavail -103
[  653.900474] 398.585240 igb_netmap_txsync [180] ouch, hwavail -104
[  653.937079] 398.621950 igb_netmap_txsync [180] ouch, hwavail -105
[  653.973689] 398.658665 igb_netmap_txsync [180] ouch, hwavail -106
[  654.010291] 398.695372 igb_netmap_txsync [180] ouch, hwavail -107
[  654.046899] 398.732084 igb_netmap_txsync [180] ouch, hwavail -108
[  654.046915] etmap_txsync [180] ouch, hwavail -3712
<3>[  654.090483] 398.775793 igb_netmap_tsync [180] ouch, hwavail -7304
<3>[  654.133114] 398.818546 igb_netmap_txsync [18ync [180] ouch, hwavail -10884
[  654.175601] 398.861155 igb_netmap_txsync [187344] 398.903017 igb_netmap_txsync [180] ouch, hwavail -14428
[  654.217356] 3ch, hwavail -17971
<3>[  654.259175] 398.944968 igb_netmap_txsync [180] ouch, h987024 igb_netmap_txsync [180] ouch, hwavail -21515
[  654.301124] 398.987036il -25058
<3>[  654.342588] 399.028618 igb_netmap_txsync [180] ouch, hwavail -2b_netmap_txsync [180] ouch, hwavail -28602
[  654.384474] 399.070624 igb_netmap3>[  654.426294] 399.112564 igb_netmap_txsync [180] ouch, hwavail -32146
[  6ync [180] ouch, hwavail -35689
<3>[  654.467808] 399.154197 igb_netmap_txsync [509749] 399.196257 igb_netmap_txsync [180] ouch, hwavail -39233
[  654.509760 ouch, hwavail -42776
<3>[  654.551438] 399.238066 igb_netmap_txsync [180] ouch99.280002 igb_netmap_txsync [180] ouch, hwavail -46320
[  654.593267] 399.280avail -49863
<3>[  654.634652] 399.321518 igb_netmap_txsync [180] ouch, hwavail igb_netmap_txsync [180] ouch, hwavail -53407
[  654.676561] 399.363547 igb_n950
<3>[  654.717950] 399.405054 igb_netmap_txsync [180] ouch, hwavail -56951
map_txsync [180] ouch, hwavail -60494
[  654.759943] 399.447168 igb_netmap_tx  654.801357] 399.488699 igb_netmap_txsync [180] ouch, hwavail -64038
[  654c [180] ouch, hwavail -67581
<3>[  654.842680] 399.530141 igb_netmap_txsync [184560] 399.572141 igb_netmap_txsync [180] ouch, hwavail -71125
[  654.884572] uch, hwavail -74668
<3>[  654.925891] 399.613590 igb_netmap_txsync [180] ouch,9.655665 igb_netmap_txsync [180] ouch, hwavail -78212
[  654.967858] 399.6556vail -81755
<3>[  655.009111] 399.697048 igb_netmap_txsync [180] ouch, hwavail igb_netmap_txsync [180] ouch, hwavail -85299
[  655.050876] 399.738932 igb_n842
<3>[  655.092431] 399.780606 igb_netmap_txsync [180] ouch, hwavail -88843
map_txsync [180] ouch, hwavail -92386
[  655.134285] 399.822579 igb_netmap_t[  655.175521] 399.863934 igb_netmap_txsync [180] ouch, hwavail -95930
[  65nc [180] ouch, hwavail -99473
<3>[  655.216663] 399.905194 igb_netmap_txsync -102976
<3>[  655.257899] 399.946547 igb_netmap_txsync [180] ouch, hwavail -1102] 399.987868 igb_netmap_txsync [180] ouch, hwavail -106473
[  655.299114tmap_txsync [180] ouch, hwavail -109969
<3>[  655.339666] 400.028548 igb_netmh, hwavail -113465
<3>[  655.380771] 400.069771 igb_netmap_txsync [180] ouch,>[  655.421950] 400.111067 igb_netmap_txsync [180] ouch, hwavail -116962
00.151699 igb_netmap_txsync [180] ouch, hwavail -120458
[  655.462471] 400.151nc [180] ouch, hwavail -123954
<3>[  655.503516] 400.192867 igb_netmap_txsyncl -127450
<3>[  655.544689] 400.234157 igb_netmap_txsync [180] ouch, hwavail 85907] 400.275493 igb_netmap_txsync [180] ouch, hwavail -130947
[  655.5859netmap_txsync [180] ouch, hwavail -134443
<3>[  655.626532] 400.316234 igb_neuch, hwavail -137939
<3>[  655.667602] 400.357422 igb_netmap_txsync [180] ouc<3>[  655.708767] 400.398705 igb_netmap_txsync [180] ouch, hwavail -141436
00.439816 igb_netmap_txsync [180] ouch, hwavail -144932
[  655.749767] 400.43ync [180] ouch, hwavail -148428
<3>[  655.790465] 400.480636 igb_netmap_txsynil -151924
<3>[  655.831644] 400.521933 igb_netmap_txsync [180] ouch, hwavail872746] 400.563153 igb_netmap_txsync [180] ouch, hwavail -155421
[  655.872_netmap_txsync [180] ouch, hwavail -158917
<3>[  655.913198] 400.603721 igb_nouch, hwavail -162413
<3>[  655.954380] 400.645020 igb_netmap_txsync [180] ou
<3>[  655.995470] 400.686228 igb_netmap_txsync [180] ouch, hwavail -165910
00.727368 igb_netmap_txsync [180] ouch, hwavail -169406
[  656.036504] 400.xsync [180] ouch, hwavail -172902
<3>[  656.077334] 400.768326 igb_netmap_txsvail -176398
<3>[  656.118366] 400.809475 igb_netmap_txsync [180] ouch, hwava6.159462] 400.850688 igb_netmap_txsync [180] ouch, hwavail -179895
[  656.1gb_netmap_txsync [180] ouch, hwavail -183391
<3>[  656.200160] 400.891502 igb_ ouch, hwavail -186887
<3>[  656.241437] 400.932898 igb_netmap_txsync [180] o3
401.015594 igb_netmap_txsync [180] ouch, hwavail -193880h, hwavail -190384
[  656.323909] 401txsync [180] ouch, hwavail -197376
<3>[  656.364363] 401.056175 igb_netmap_txavail -200872
<3>[  656.405474] 401.097404 igb_netmap_txsync [180] ouch, hwava6.446836] 401.138884 igb_netmap_txsync [180] ouch, hwavail -204369
[  656.4gb_netmap_txsync [180] ouch, hwavail -207865
<3>[  656.487572] 401.179737 igb] ouch, hwavail -211361
<3>[  656.528878] 401.221161 igb_netmap_txsync [180] o7
401.303880 igb_netmap_txsync [180] ouch, hwavail -218354h, hwavail -214858
[  656.611373] 401txsync [180] ouch, hwavail -221850
<3>[  656.651951] 401.344585 igb_netmap_txavail -225346
<3>[  656.693251] 401.386004 igb_netmap_txsync [180] ouch, hwava6.734570] 401.427441 igb_netmap_txsync [180] ouch, hwavail -228843
[  656.7gb_netmap_txsync [180] ouch, hwavail -232339
<3>[  656.775292] 401.468280 igb_ ouch, hwavail -235835
<3>[  656.816600] 401.509706 igb_netmap_txsync [180] o1
401.592468 igb_netmap_txsync [180] ouch, hwavail -242828h, hwavail -239332
[  656.899139] 401.xsync [180] ouch, hwavail -246324
<3>[  656.939973] 401.633431 igb_netmap_txsvail -249820
<3>[  656.981176] 401.674752 igb_netmap_txsync [180] ouch, hwavai.022460] 401.716154 igb_netmap_txsync [180] ouch, hwavail -253317
[  657.02b_netmap_txsync [180] ouch, hwavail -256813
<3>[  657.063136] 401.756946 igb_nouch, hwavail -260309
<3>[  657.104335] 401.798263 igb_netmap_txsync [180] ou
<3>[  657.145480] 401.839526 igb_netmap_txsync [180] ouch, hwavail -263806
01.880846 igb_netmap_txsync [180] ouch, hwavail -267302
[  657.186694] 401.8sync [180] ouch, hwavail -270798
<3>[  657.227670] 401.921951 igb_netmap_txsyail -274294
<3>[  657.268902] 401.963301 igb_netmap_txsync [180] ouch, hwavail310186] 402.004702 igb_netmap_txsync [180] ouch, hwavail -277791
[  657.310_netmap_txsync [180] ouch, hwavail -281287
<3>[  657.350698] 402.045330 igb_nouch, hwavail -284783
<3>[  657.391784] 402.086534 igb_netmap_txsync [180] ou
<3>[  657.432918] 402.127786 igb_netmap_txsync [180] ouch, hwavail -288280
02.169042 igb_netmap_txsync [180] ouch, hwavail -291776
[  657.474067] 402.1sync [180] ouch, hwavail -295272
<3>[  657.514653] 402.209754 igb_netmap_txsyail -298768
<3>[  657.556027] 402.251247 igb_netmap_txsync [180] ouch, hwavail597395] 402.292733 igb_netmap_txsync [180] ouch, hwavail -302265
[  657.597_netmap_txsync [180] ouch, hwavail -305761
<3>[  657.638155] 402.333610 igb_neuch, hwavail -309257
<3>[  657.679428] 402.375001 igb_netmap_txsync [180] ouc<3>[  657.720745] 402.416435 igb_netmap_txsync [180] ouch, hwavail -312754
02.457482 igb_netmap_txsync [180] ouch, hwavail -316250
[  657.761680] 402.4574c [180] ouch, hwavail -319746
<3>[  657.802961] 4dmesg -n802.498887 igb_netmap hwavail -323242
<3>[  657.844304] 402.540348 igb_netmap_txsync [180] ouch, hw 657.885544] 402.581706 igb_netmap_txsync [180] ouch, hwavail -326739
[  658 igb_netmap_txsync [180] ouch, hwavail -330235
<3>[  657.926212] 402.622490 180] ouch, hwavail -333731
<3>[  657.967502] 402.663899 igb_netmap_txsync [1807227
<3>[  658.008826] 102.705341 igb_netmap_txsync [180] ouch, hwavail -3372] 402.746957 igb_netmap_txsync [180] ouch, hwavail -340724
[  658.050336] 40_txsync [180] ouch, hwavail -344220
<3>[  658.091649] 402.788401 igb_netmap_txavail -347716
<3>[  658.133013] 402.829883 igb_netmap_txsync [180] ouch, hwav58.174241] 402.871228 igb_netmap_txsync [180] ouch, hwavail -351213
[  658.igb_netmap_txsync [180] ouch, hwavail -354709
<3>[  658.214821] 402.911925 igb] ouch, hwavail -358205
<3>[  658.255959] 4

add --l1-stats option

Adds Layer 1 stats. Specifically it will add 14-18 bytes to the total for every Ethernet packet received.

add flow statistics

This counts number of unique flows in the pcap file. Report # flows and flows/sec. Multiply by # loops if --unique ID's specified.

update netmap as per netmap author

Luigi reviewed code and had some suggestions for improving paced performance. That is, endure that packets do not bunch up together when sending slower than maximum speed. His suggestions may also improve overall performance.

implement pseudo-CRC routine

tcpreplay-edit performance is impacted by expensive CRC recalculations whenever an IP address changes. This enhancement implements pseudo-CRC code similar to routines found in Linux kernel in an attempt to improve overall performance.

Small pcap files capacity too high

Example of increasing --loops reduces capacity due to socket buffers not flushed.

# tcpreplay -i eth7 -K -t smallFlows.pcap 
File Cache is enabled
Actual: 14261 packets (9216531 bytes) sent in 0.007740 seconds.
Rated: 1190766279.0 Bps, 9526.13 Mbps, 1842506.45 pps
Flows: 1209 flows, 156201.55 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
# tcpreplay -i eth7 -t -K --loop 100 smallFlows.pcap 
File Cache is enabled
Actual: 1426100 packets (921653100 bytes) sent in 0.818373 seconds.
Rated: 1126201744.1 Bps, 9009.61 Mbps, 1742603.92 pps
Flows: 1209 flows, 1477.32 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

option --unique-ip is slower than expected.

In POC for this feature based on 3.5.0beta1 am able to achieve about 7150Mbps on 10GigE link, both with and without this feature. When running netmap get around 9490Mbps with and without unique IP feature.

Current master sees overhead when running this feature.

Without - 7379 Mbps
With - 6717 Mbps

It is more pronounced with --netmap feature ...

Without 9492 Mbps
With 8839 Mbps

This routine needs optimization.

Seed tests fail.

$ sudo make test
NOTICE: Tests must be run as root
Sending traffic on 'eth0' and 'eth0'
[tcpprep] Auto/Router mode test:        OK
[tcpprep] Auto/Bridge mode test:        OK
[tcpprep] Auto/Client mode test:        OK
[tcpprep] Auto/Server mode test:        OK
[tcpprep] Auto/First mode test:         OK
[tcpprep] CIDR mode test:           OK
[tcpprep] Regex mode test:          OK
[tcpprep] Port mode test:           OK
[tcpprep] MAC mode test:            OK
[tcpprep] Comment mode test:            OK
[tcpprep] Print info mode test:         OK
[tcpprep] Print comment mode test:      OK
[tcpprep] Config mode test:             OK
[tcpprep] MAC reverse mode test:        OK
[tcpprep] CIDR reverse mode test:       OK
[tcpprep] Regex reverse mode test:      OK
[tcpreplay] Basic test:             OK
[tcpreplay] Cache test:             OK
[tcpreplay] Packets/sec test:           OK
[tcpreplay] Mbps test:              OK
[tcpreplay] Topspeed test:          OK
[tcpreplay] Config file/VLAN add test:      OK
[tcpreplay] Multiplier test:            OK
[tcpreplay] Packets/sec Multiplier test:    OK
[tcpreplay] Precache test:          OK
[tcpreplay] Statistics test:            OK
[tcpreplay] Dual file test:             OK
[tcpreplay] Maximum sleep test:         OK
[tcprewrite] Portmap test:          OK
[tcprewrite] Endpoint test:             OK
[tcprewrite] Pseudo NAT test:           OK
[tcprewrite] Truncate test:             OK
[tcprewrite] Pad test:              OK
[tcprewrite] Seed IP test: make: *** [rewrite_seed] Error 2
[tcprewrite] Src/Dst MAC test:          OK
[tcprewrite] Layer2 test:           OK
[tcprewrite] Config/VLAN Add test:      OK
[tcprewrite] Skip bcast test: make: *** [rewrite_skip] Error 2
[tcprewrite] DLT User test:             OK
[tcprewrite] DLT Cisco HDLC test:       OK
[tcprewrite] VLAN Delete test:          OK
[tcprewrite] Remove EFCS:           OK
[tcprewrite] Force TTL:             OK
[tcprewrite] Increase TTL:          OK
[tcprewrite] Reduce TTL:            OK
[tcprewrite] TOS test:              OK
[tcprewrite] MTU Truncate test:         OK
make: Target `test' not remade because of errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.