Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to capture tcpdump data to simulate connections from multiple IPs?

Reply
Thread Tools Display Modes

How to capture tcpdump data to simulate connections from multiple IPs?

 
 
draghuram@gmail.com
Guest
Posts: n/a

 
      06-19-2006, 02:23 AM
Hi,

This is a generic question about how to capture packets on linux for
testing purpose. I need to capture packets comprising TCP connections
from multiple IPs to a single host. This is to test my code (in
verilog). I can capture packets using tcpdump but since I have only two
machines at home, I will only be getting packets from same source
address. I am considering two alternatives:

1) bind different IP addresses to same interface and use each as source
address. I am not sure if I can indeed bind large number of addresses
on Linux to single interface. Can someone tell me if it is possible?

2) follow these steps
a) capture packets corresponding to a simgle connection from node A
to node B.
b) repeat above step, say, 100 times.
c) Now, I have 100 files, each containing packets for one TCP
connection.
d) Overwrite bytes for source IP address in each file.
e) merge 100 files in some random fashion to simulate concurrent
connections

I would appreciate it if someone can comment on both these approaches
and importantly, if they sound plausible. If there is some other way to
achieve this, please let me know.

Thanks in advance,
Raghu.

 
Reply With Quote
 
 
 
 
Tauno Voipio
Guest
Posts: n/a

 
      06-19-2006, 06:52 AM
(E-Mail Removed) wrote:
> Hi,
>
> This is a generic question about how to capture packets on linux for
> testing purpose. I need to capture packets comprising TCP connections
> from multiple IPs to a single host. This is to test my code (in
> verilog). I can capture packets using tcpdump but since I have only two
> machines at home, I will only be getting packets from same source
> address. I am considering two alternatives:
>
> 1) bind different IP addresses to same interface and use each as source
> address. I am not sure if I can indeed bind large number of addresses
> on Linux to single interface. Can someone tell me if it is possible?
>
> 2) follow these steps
> a) capture packets corresponding to a simgle connection from node A
> to node B.
> b) repeat above step, say, 100 times.
> c) Now, I have 100 files, each containing packets for one TCP
> connection.
> d) Overwrite bytes for source IP address in each file.
> e) merge 100 files in some random fashion to simulate concurrent
> connections
>
> I would appreciate it if someone can comment on both these approaches
> and importantly, if they sound plausible. If there is some other way to
> achieve this, please let me know.
>
> Thanks in advance,
> Raghu.
>


The correct place to capture the data is at the target host.
Do you have root access to it?

If not, you need an Ethernet tapping cable between the target
and the node feeding it, and put an extra computer to record
the data from the tap.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Reply With Quote
 
draghuram@gmail.com
Guest
Posts: n/a

 
      06-19-2006, 03:53 PM
Hi,

I have root access to target host. The two machines I referred are my
home systems (one linux and one windows).

Thanks,
Raghu.

Tauno Voipio wrote:
> (E-Mail Removed) wrote:
> > Hi,
> >
> > This is a generic question about how to capture packets on linux for
> > testing purpose. I need to capture packets comprising TCP connections
> > from multiple IPs to a single host. This is to test my code (in
> > verilog). I can capture packets using tcpdump but since I have only two
> > machines at home, I will only be getting packets from same source
> > address. I am considering two alternatives:
> >
> > 1) bind different IP addresses to same interface and use each as source
> > address. I am not sure if I can indeed bind large number of addresses
> > on Linux to single interface. Can someone tell me if it is possible?
> >
> > 2) follow these steps
> > a) capture packets corresponding to a simgle connection from node A
> > to node B.
> > b) repeat above step, say, 100 times.
> > c) Now, I have 100 files, each containing packets for one TCP
> > connection.
> > d) Overwrite bytes for source IP address in each file.
> > e) merge 100 files in some random fashion to simulate concurrent
> > connections
> >
> > I would appreciate it if someone can comment on both these approaches
> > and importantly, if they sound plausible. If there is some other way to
> > achieve this, please let me know.
> >
> > Thanks in advance,
> > Raghu.
> >

>
> The correct place to capture the data is at the target host.
> Do you have root access to it?
>
> If not, you need an Ethernet tapping cable between the target
> and the node feeding it, and put an extra computer to record
> the data from the tap.
>
> --
>
> Tauno Voipio
> tauno voipio (at) iki fi


 
Reply With Quote
 
Allen McIntosh
Guest
Posts: n/a

 
      06-24-2006, 01:38 AM
> 1) bind different IP addresses to same interface and use each as source
> address. I am not sure if I can indeed bind large number of addresses
> on Linux to single interface. Can someone tell me if it is possible?


I'm sure you can bind a few on your Linux box without running out of
resources. I don't know about XP - but you could just boot Knoppix or
something. Once you have some data, you can use (2) to expand whatever
you capture. It will require a little more care to get the source and
destination addresses right. I suspect you will need to put them on
different class C networks for anything to work.
>
> 2) follow these steps
> a) capture packets corresponding to a simgle connection from node A
> to node B.
> b) repeat above step, say, 100 times.
> c) Now, I have 100 files, each containing packets for one TCP
> connection.
> d) Overwrite bytes for source IP address in each file.
> e) merge 100 files in some random fashion to simulate concurrent
> connections


There are some tools that come with ethereal that will help you do this:
- editcap to adjust times
- mergecap to merge together multiple capture files
Off the top of my head I can't think of anything to change the IP
addresses. Check the tool list on the Caida website.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can tcpdump not capture all packets zhengda Linux Networking 0 03-16-2008 12:10 PM
Reinject tcpdump capture b0bjes Wireless Internet 1 11-27-2007 07:32 PM
can tcpdump capture more than packet headers? eddie Linux Networking 3 09-24-2006 09:01 PM
when does tcpdump capture link layer frame? Steven Woody Linux Networking 0 09-01-2006 02:26 AM
how to capture packet headers but not the payload in tcpdump? George Nychis Linux Networking 1 02-08-2006 12:17 AM



1 2 3 4 5 6 7 8 9 10 11