Google Answers Logo
View Question
 
Q: A tcpdump like program needed to measure traffic based on UDP port ( Answered 4 out of 5 stars,   0 Comments )
Question  
Subject: A tcpdump like program needed to measure traffic based on UDP port
Category: Computers > Software
Asked by: sparkgameservers-ga
List Price: $20.00
Posted: 20 May 2003 22:26 PDT
Expires: 19 Jun 2003 22:26 PDT
Question ID: 206641
Hi, i'm searching for a redhat linux program that can simply measure
incoming and outgoing bandwidth in kbits/s or kbytes/s from the
console(a GUI will not work) on a local server (i dont need to monitor
this remotely) and have that output to a log file. The key is it needs
to measure based on a specified UDP port and update a logfile every
minute. Ideally, i'd start the program by passing in a port number and
a log file name. The program would be able to have many instances,
each with different ports. tcpdump basically does what i need it to by
running 'tcpdump -nvv src port 27960' and same for 'dst port'. However
i need something that efficiently gives me the total incoming and
outgoing bandwidth coming from a specified port. What i'm trying to do
is monitor the bandwidth coming from a game server (which runs via UDP
ports) so i can have a much better idea of my costs. I'm currently
using iptraf. The problem with it is it continuously monitors all the
ports i have to manually specify. I will be processing the log files
with php to determine cost and average kbits/s / 95th %. Thanks for
your help! Your expertise is appreciated!
Answer  
Subject: Re: A tcpdump like program needed to measure traffic based on UDP port
Answered By: chellphill-ga on 22 May 2003 04:49 PDT
Rated:4 out of 5 stars
 
Hi sparkgameservers-ga!
If you have any questions about the information I have provided,
please request a clarification, and give me
time to respond before rating my answer.

Thanks so much and best of luck to you!
chellphill-ga

http://www.ntop.org/ntop.html
"UDP traffic: The total amount of UDP traffic (volume and packets)
sorted by port. It
 is worth noting that it is possible to recognize simple portscan and
protocol scan
(e.g., an SNMP manager issued SNMP requests to a given host) when the
host has
 received packets at a specified port but has sent no data."
· Used bandwidth percentage: Actual, average, and peak bandwidth
usage.
· Traffic distribution: Local (subnet) traffic,                  
   local vs. remote (outside specified/local sub-               
   net), remote vs. local.                              
· IP traffic distribution: UDP vs. TCP traffic;           
   relative distribution of the IP protocols             
   according to the host name.                            
· Local network usage: Statistics about open            
   sockets, data sent/received, and contacted             
   peers for each process running on the host            
   where ntop is active. 
Traffic distribution: Local (subnet) traffic,      
   local vs. remote (outside specified/local subnet), remote vs.
local.
· Packet distribution: Total number of packets sorted by packet size,
unicast vs. multi-
   cast vs. broadcast, and IP vs. non-IP traffic.        
· Used bandwidth: Actual, peak, and average                
   bandwidth usage.
http://www.ntop.org/ntop.html
" Data gathered from the monitoring can be logged in a file for
posterior plotting using any spreadsheet application such as Sun's
Star Office. If you want to keep all of the information stored for
future structured retrieval, NTOP gives you the option to store it in
a SQL database. "

In the source under www/php there are examples on how to pull the data
with PHP
/ntop-2.2/ntop/www/README (it's in the source) (Very important info on
using PHP and PERL).
"If you want you can build ntop
as "configure --enable-micro-ntop" if you don't want to
include the full web interface that's not necessary for
the enclosed code."
"In former ntop versions, users could use the -l flag to periodically
generate a file that contains traffic statistics information. This
functionality has been replaced using this new API."

Other programs that might be worth looking into as well,
 http://dast.nlanr.net/Projects/Iperf/

http://ngrep.sourceforge.net/
more info about ngrep at
http://www.samag.com/documents/s=1151/sam0105l/0105l.htm
sparkgameservers-ga rated this answer:4 out of 5 stars
Great response! I did run across ntop after i posted this question but
the info you gave me about parsing the data with php should prove very
useful. Also, if i cant do anything with ntop, ngrep will definately
work!  Thanks for the time put into this!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy