Click to See Complete Forum and Search --> : network traffic capture
kirannapit
February 27th, 2004, 02:16 AM
hi,
what API and tools in widows will help me to capture network traffic so that i can plot graph for it , I am using LAN on ethernet based network.including win2k and xp OS.
links and code will be greatly helpful
kiran
Ejaz
February 27th, 2004, 03:58 AM
May be this can give you a start
http://www.codeguru.com/Cpp/I-N/network/tcpip/article.php/c5413/
Mathew Joy
February 27th, 2004, 07:18 AM
Originally posted by kirannapit
hi,
what API and tools in widows will help me to capture network traffic so that i can plot graph for it , I am using LAN on ethernet based network.including win2k and xp OS.
links and code will be greatly helpful
kiran Steps are simple
Create a raw socket. Bind it to the ip you want to monitor. Using WSAIoctl() set the socket option to SIO_RCVALL. Call recv() to get all the traffic that comes thru the IP. Now the recv buf will contain the data including the packet header.
Andreas Masur
February 27th, 2004, 07:52 AM
[Moved thread]
kirannapit
March 3rd, 2004, 02:28 AM
I used WSAIoctl to capture the packets .
Now about network traffic, how do i calculate the total packets recevied, sent,error packets, so as to plot graph dynamically as any other network monitor tool
kiran
Mathew Joy
March 3rd, 2004, 07:07 AM
Originally posted by kirannapit
I used WSAIoctl to capture the packets .
Now about network traffic, how do i calculate the total packets recevied, sent,error packets, so as to plot graph dynamically as any other network monitor tool
kiran As I said, use recv() to get data. The data will contain the whole packet (data and the header). Do some research about the packet structure. This (http://blacksun.box.sk/books.html) may help you to start. Search where raw sockets are discussed.
jpo234
March 8th, 2004, 08:58 AM
I suggest you look at the packet capture library available from http://winpcap.polito.it
It comes with examples and should let you do everything you might ever want.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.