Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Real time reading of multiple pcap 'instances' at once

by Corion (Patriarch)
on Nov 15, 2008 at 12:24 UTC ( [id://723791]=note: print w/replies, xml ) Need Help??


in reply to Real time reading of multiple pcap 'instances' at once

At least under Linux or other unixish OSes, the select approach of reading from multiple tcpdump instances should work. Otherwise, I'd aim for the mod//Net::Pcap approach, using pcap_loop() to read some packets. Also, consider combining the "queries" you hand to the different Pcap instances into one large query. For example, if you want to capture (HTTP) traffic between the local machine and two different hosts, use the following specification:

(dest www1.example.com && (tcp port 80)) ||(src www1.example.com && (tcp port 80)) ||(dest www2.example.com && (tcp port 80)) ||(src www2.example.com && (tcp port 80))

So if you have traffic going over different (known) ports to different (known) machines/IP addresses, the simplest approach might be to capture them all in one stream and sort them out in your Perl code again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://723791]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found