LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-12-2005, 04:39 AM   #1
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Rep: Reputation: 15
Arrow Info on TCP Packets


Hi Folks,

I was wondering if any of you guys would know how I could find out statistics on TCP packets sent/recieved by my system. Have been looking at netstat -s command but can't see anything apparent.

I ran the "netstat -s | grep "packets sent" and "netstat -s | grep "packets recieved" commands and from this I got what looked to be pretty promising figures, but on further investiagtion of this I found out that these packets sent/received were infact UDP packets, and not the required TCP packets.

So I was just wondering if anyone could tell me where or how I could find out more statistics on incoming/outgoing TCP packets...

Many thanks
Regards
Ciaran.
 
Old 10-12-2005, 05:30 AM   #2
okmyx
Member
 
Registered: May 2004
Location: Cornwall, UK
Distribution: Ubuntu 8.04
Posts: 464

Rep: Reputation: 31
Google around for info on TCPDump
 
Old 10-12-2005, 05:39 AM   #3
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Yeah...

Been looking at TCPDump as well as Ethereal and my understanding of these tool is that they capture packets that are in the network at any one time, and also do not give any report on lost/retransmitted packets or errors encountered, and this is the kind of information I am hoping to get access to...
 
Old 10-12-2005, 05:51 AM   #4
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 787
Blog Entries: 6

Rep: Reputation: 75
statistics i not sure but this below command will tell u how many urs RX & TX and error pckts
since u on the pc

[rou@net test]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:22:B0:7D:CD
inet addr:192.168.0.88 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:22ff:feb0:7dcd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5296297 errors:0 dropped:0 overruns:0 frame:0
TX packets:5292567 errors:0 dropped:0 overruns:3 carrier:0
collisions:1914707 txqueuelen:1000
RX bytes:607551994 (579.4 MiB) TX bytes:589643754 (562.3 MiB)
Interrupt:11 Base address:0xc400

root@noc:~# /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:60:67:44:1F:30
inet addr:192.168.0.11 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5505852 errors:0 dropped:0 overruns:0 frame:2
TX packets:4063211 errors:3 dropped:0 overruns:3 carrier:0
collisions:1847372 txqueuelen:1000
RX bytes:2110272425 (2012.5 Mb) TX bytes:2219772733 (2116.9 Mb)
Interrupt:9 Base address:0xf880


sorry if not this what u need
 
Old 10-12-2005, 05:55 AM   #5
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
It certainly looks promising... But what exactly does TX and RX stand for?
 
Old 10-12-2005, 06:24 AM   #6
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Yeah these numbers of TX and RX are for packet transfers if I've done my research correctly. But unfortunatly this information is for all packets including TCP & UDP whereas I require information on TCP Packets only...

Thanks anyhow.
Ciaran
 
Old 10-12-2005, 06:25 AM   #7
newpenguin
Member
 
Registered: Sep 2002
Location: lahore pakistan
Distribution: slackware,redhat, FreeBSD,openbsd
Posts: 219

Rep: Reputation: 30
u need to use snmp.
 
Old 10-12-2005, 06:29 AM   #8
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Hi Newpenguin...

In what way do I need to use snmp? I've never used this before and only briefly heard of it. So could you please further advise?

Many thanks
CICA
 
Old 10-12-2005, 06:38 AM   #9
newpenguin
Member
 
Registered: Sep 2002
Location: lahore pakistan
Distribution: slackware,redhat, FreeBSD,openbsd
Posts: 219

Rep: Reputation: 30
snmp protocol is used for performance/load measuring on remote devices.
u need to run snmp daemon in your machine, then u can use any tool like mrtg to graph the traffic counters.

search for net-snmp, mrtg configurations

and u can find tutorials where both configurations are mentioned. then use the snmp specific code to get all tcp inbound outbound packets graphs.
 
Old 10-12-2005, 06:43 AM   #10
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
this sounds really good, and specific to what I need! I'll keep you up-dated on progress...

Thanks
CICA
 
Old 10-12-2005, 07:44 AM   #11
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Hi Newpenguin,

This package looks pretty neat, but it also looks pretty complex and I have to get this information regarding the TCP stats as soon as I can because it is for a college dissertation, and I may not have the adequate time to get to grips with the tool, to get the info I require. I'm pretty new to Linux hence the following question. I am about to run the make install command, but before I do so I wanted to check to ask how easy it would be to uninstall this package i.e. is there a command I can run that will uninstall all related files. I am asking this incase I have to uninstall the package due to not having enough time to learn how to use it efficiently to get the required stats...

Many thanks
CICA
 
Old 10-12-2005, 08:37 AM   #12
CICA
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 15
Hi newpenguin,

I have since installed the net-snmp package. But when I try running the following command I get this result:

[root@localhost /]# snmpnetstat -s 192.168.0.5
ip:
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
icmp:
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
tcp:
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
udp:
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
snmpnetstat: Bad version specified
[root@localhost /]#

This ip address is definatly in use, so can you please advise?

Thanks
CICA
 
Old 10-12-2005, 09:23 AM   #13
Slim_Pikins
LQ Newbie
 
Registered: Jul 2004
Location: Manchester UK
Posts: 21

Rep: Reputation: 15
Hi

I use iptarif, it has lots of statistics about the packets to and from you pc and has both kinds udp and tcp

http://cebu.mozcom.com/riker/iptraf/
 
Old 10-12-2005, 11:10 AM   #14
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Hi
Also you can see the output of:

$ netstat -st tcp

Last edited by nx5000; 10-12-2005 at 11:11 AM.
 
Old 10-12-2005, 12:52 PM   #15
newpenguin
Member
 
Registered: Sep 2002
Location: lahore pakistan
Distribution: slackware,redhat, FreeBSD,openbsd
Posts: 219

Rep: Reputation: 30
please follow
http://www.linuxhomenetworking.com/linux-hn/mrtg.htm
and if you are in hurry , then i think nx5000 has given u very good solution.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
encapsulating TCP packets in UDP packets... yoshi95 Programming 3 06-03-2004 02:53 PM
tcp packets wedgeworth Linux - Software 7 05-10-2004 04:40 PM
Only receiving UDP packets, no TCP erevlehdeux Linux - Networking 1 04-23-2004 07:36 PM
How can I distinguish a whole mail from TCP packets sunnyriver Linux - Networking 2 03-22-2004 11:08 PM
tcp/ip packets lackluster Programming 4 07-07-2002 05:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration