Dileep Simha | 4 Aug 2011 15:25
Picon

tcpreplay-edit question

Hi, I was wondering if there was a way to modify tcpreplay-edit so that it actually saves the modified pcap file before sending it through the network.  For instance, it I were to run:

./tcpreplay-edit --intf1=eth0 --topspeed --seed=10 --loop=20, 
I want to be able to save all the packets sent (including repeats with the loop) into a pcap file.
Thanks,
Dileep Simha
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support
Aaron Turner | 4 Aug 2011 19:07
Picon

Re: Now i have subscribed !!!!! Re: [Tcpreplay-devel] question about real-time replay precision



On Thu, Aug 4, 2011 at 2:13 AM, <Moussa.Alawieh <at> zodiacaerospace.com> wrote:
Hi Aaron

Now i have subscribed !!!!! (  phew! )

Great.  But you should be asking the list and not me directly. :)

 

Just an other question please.
 how far can we go in the accuracy in replaying a pcap file capture with "tcpreplay"?
And what is the minimum recommended hardware to achieve maximum accuracy in replaying pcap file, from the TCPreplay software ?


Honestly, there are so many variables that nobody can tell you exactly how accurate it can replay your traffic.  That's because it's very dependent on your traffic profile.  Your best bet is to try it and see.

I also highly recommend you read the FAQ and Documentation sections regarding performance since there's a lot of information already written about performance:

http://tcpreplay.synfin.net/wiki/FAQ#RunningTcpreplay

http://tcpreplay.synfin.net/wiki/tcpreplay

I'd also recommend reading this ticket to decide which version of tcpreplay would work for you best:

http://tcpreplay.synfin.net/ticket/421

--
Aaron Turner
http://synfin.net/         Twitter: <at> synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety. 
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support
Aaron Turner | 4 Aug 2011 19:11
Picon

Re: tcpreplay-edit question

On Thu, Aug 4, 2011 at 6:25 AM, Dileep Simha <dsimha <at> gmail.com> wrote:
> Hi, I was wondering if there was a way to modify tcpreplay-edit so that it
> actually saves the modified pcap file before sending it through the network.
>  For instance, it I were to run:
> ./tcpreplay-edit --intf1=eth0 --topspeed --seed=10 --loop=20,
> I want to be able to save all the packets sent (including repeats with the
> loop) into a pcap file.
> Thanks,
> Dileep Simha

Yes it's possible.  You'd just have to write the code!

-- 
Aaron Turner
http://synfin.net/         Twitter:  <at> synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Aaron Turner | 5 Aug 2011 22:18
Picon

Re: tcpreplay-edit question

On Fri, Aug 5, 2011 at 1:02 PM, Dileep Simha <dsimha <at> gmail.com> wrote:
> Thanks.
> I've looked through the code and figured out how to do it.  The only thing
> left for me to finish is to add a new command line argument to
> tcpreplay-edit in order to be able to save the pcap file.  I am sorry to
> keep pestering you with questions, but I just want to know what files would
> I need to edit in order to add a new argument.  I've tried editting
> tcpreplay_edit_opts.c and tcpreplay_edit_opts.h but I still haven't gotten
> the program to accept the argument when I run it.
> I swear this is my last question.  Thanks for being patient with me :D
> - Dileep Simha

Actually, you never want to edit those files since they're
auto-generated.  Edit tcprewrite_opts.def instead.  All the CLI/config
file parsing is done via GNU Autogen/AutoOpts which is documented
here:

http://autogen.sourceforge.net/autoopts.html

Then you can check to see if that flag is set in tcprewrite.c:post_args()

-- 
Aaron Turner
http://synfin.net/         Twitter:  <at> synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Andrew James Dunlop | 9 Aug 2011 23:06
Picon

New dualfile option in tcpreplay 3.4.5 beta1

tcpreplay 3.4.5 beta1 has a new option --dualfile which enables
sending two files our of two interfaces while keeping them in sync. I
have been using this and under normal operation this works well.
However I have encountered a problem when I try to use the packet
speed changing options (multiplier, pps, mbps). It appears that
tcpreplay does change the sending speed for the first file but not the
second. Is this a bug, known issue or am I just doing it wrong?
Thanks,
Andrew

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Aaron Turner | 10 Aug 2011 00:34
Picon

Re: New dualfile option in tcpreplay 3.4.5 beta1

On Tue, Aug 9, 2011 at 2:06 PM, Andrew James Dunlop <ajdunlop <at> gmail.com> wrote:
> tcpreplay 3.4.5 beta1 has a new option --dualfile which enables
> sending two files our of two interfaces while keeping them in sync. I
> have been using this and under normal operation this works well.
> However I have encountered a problem when I try to use the packet
> speed changing options (multiplier, pps, mbps). It appears that
> tcpreplay does change the sending speed for the first file but not the
> second. Is this a bug, known issue or am I just doing it wrong?

Sounds like a bug to me.  Does it replay the 2nd file at original speed?

Thanks for the bug report!

-- 
Aaron Turner
http://synfin.net/         Twitter:  <at> synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Andrew Dunlop | 10 Aug 2011 09:34
Picon

Re: New dualfile option in tcpreplay 3.4.5 beta1

On Tue, 09 Aug 2011 15:35:00 -0700,  Aaron Turner wrote:
>Sounds like a bug to me.  Does it replay the 2nd file at original speed?
Yes, It looks like the 2nd file is at normal speed and the 1st file at
the speed specified by the multiplier, pps or mbps options.
I'm sure this shouldn't be a major change to fix but I am unfamiliar
with the codebase so I am not having much luck.

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Aaron Turner | 10 Aug 2011 17:51
Picon

Re: New dualfile option in tcpreplay 3.4.5 beta1

On Wed, Aug 10, 2011 at 12:34 AM, Andrew Dunlop <ajdunlop <at> gmail.com> wrote:
> On Tue, 09 Aug 2011 15:35:00 -0700,  Aaron Turner wrote:
>>Sounds like a bug to me.  Does it replay the 2nd file at original speed?
> Yes, It looks like the 2nd file is at normal speed and the 1st file at
> the speed specified by the multiplier, pps or mbps options.
> I'm sure this shouldn't be a major change to fix but I am unfamiliar
> with the codebase so I am not having much luck.

The function in question is src/sendpacket.c:send_dual_packets()

Honestly, it's been a few months since I've looked at the code and a 2
minute look didn't make it obvious as to why you'd see that issue.
Would it be possible for you to send me the two pcaps in question and
what arguments are you using for tcpreplay?

-- 
Aaron Turner
http://synfin.net/         Twitter:  <at> synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Senthil Kumar S | 18 Aug 2011 12:17

PCAPs can be concatenated ?

Hi All,

 

I am a new user for this TCPREPLAY utility. I have one doubt,

 

Is it possible to concatenate two pcap files into one pcap file.

(eg: 1.pcap, 2.pcap ===> combined 3.pcap)

 

By the way I am using tcpreplay-3.4.4

 

Thanks in advance

Senthil.


SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email.
Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support
Picon

Re: PCAPs can be concatenated ?

Hi,

 

To join the large number of file pcap, I wrote a script language PYTHON, which uses wireshark (for OS windows).

To use it, you must install PYTHON, put the script file in a directory with pcap files to merge and run script without any parameters.

 

 

#start

import subprocess

import glob

import os

import shutil

 

if __name__ == '__main__':

    if os.path.exists('all.pcap'):

        os.unlink('all.pcap')

    if os.path.exists('alla.pcap'):

        os.unlink('alla.pcap')

    names = glob.glob('*.pcap')

    args=['C:/Program Files/Wireshark/mergecap.exe','-a','-w','all.pcap']

    i=0;

    for name in names:

        print 'processing {:s} ...'.format(name)

        i+=1;

        args.append(name)

        if(i%100==0):

            p=subprocess.Popen(args)

            if p.wait()<>0:

                print 'Error on i={:d}'.format(i)

                break;

            args=['C:/Program Files/Wireshark/mergecap.exe','-a','-w','all.pcap','alla.pcap']

            shutil.move('all.pcap', 'alla.pcap')

    if len(args)>5:

        p=subprocess.Popen(args)

        if p.wait()<>0:

            print 'Error on the last section'

    print 'Done. {:d} files processed!'.format(i)

    if os.path.exists('alla.pcap'):

        if os.path.exists('all.pcap'):

            os.unlink('alla.pcap')

        else:

            shutil.move('alla.pcap','all.pcap')

#end

 

 

Yuriy.

 

From: Senthil Kumar S [mailto:senthilkumar.s <at> sasken.com]
Sent: Thursday, August 18, 2011 2:18 PM
To: tcpreplay-users <at> lists.sourceforge.net
Subject: [Tcpreplay-users] PCAPs can be concatenated ?

 

Hi All,

 

I am a new user for this TCPREPLAY utility. I have one doubt,

 

Is it possible to concatenate two pcap files into one pcap file.

(eg: 1.pcap, 2.pcap ===> combined 3.pcap)

 

By the way I am using tcpreplay-3.4.4

 

Thanks in advance

Senthil.

 

SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email.
Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Tcpreplay-users mailing list
Tcpreplay-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcpreplay-users
Support Information: http://tcpreplay.synfin.net/trac/wiki/Support

Gmane