Unix Programming - How to collect network information on LINUX platform

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2005 > How to collect network information on LINUX platform





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to collect network information on LINUX platform
Benjamin Wang

2005-05-30, 2:48 am

Hello,

I need to collect some network information about TCP, IP, UDP and SCTP on
linux platform. About IP, I need to collect such as number of packets
received , packets transmitted, bytes received, bytes transmitted, bad
packets received, packet transmit errors, received packets dropped and
transmit packets dropped.
About TCP and UDP, I need to collect the number of connection opens,
segments received and so on. About SCTP, I need to collect the number of
failed connection attempts, chunks received and so on.

I think i could get some of them from the file /proc/net/snmp. But for bytes
received and resets sent, I do not know how to get it. And I don't know how
to get information about SCTP.

Could you tell me how I can get those inforamtion? Also, could I get thost
information by ioctl()? how?

Thanks very much!


vishal

2005-05-30, 7:53 am

try `netstat -s`, it's portable and would give you most of the
information you desire for protocols. As for interface statistics
(frames delivered, errors, etc), try `netstat -i`.

not sure if the linux netstat implementation is SCTP-aware though. as
for ioctls, maybe you need to look at the netstat code; my guess is, it
would be taking those values from /proc.

vishal

Benjamin Wang

2005-05-31, 2:48 am

Vishal,

Thanks for your information!
The linux kernel I used is 2.4. Could it support SCTP?
I have checked /proc, but didn't get the data for SCTP.

Thanks,
Ben

"vishal" <vishal.ag@gmail.com> wrote in message
news:1117442882.530161.258570@g49g2000cwa.googlegroups.com...
> try `netstat -s`, it's portable and would give you most of the
> information you desire for protocols. As for interface statistics
> (frames delivered, errors, etc), try `netstat -i`.
>
> not sure if the linux netstat implementation is SCTP-aware though. as
> for ioctls, maybe you need to look at the netstat code; my guess is, it
> would be taking those values from /proc.
>
> vishal
>



vishal

2005-05-31, 7:48 am

i've not worked with SCTP.. maybe you should try posting this on
comp.protocols.tcp-ip

vishal

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com