LinuxQuestions.org
Visit Jeremy's Blog.
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-09-2011, 06:43 PM   #1
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Rep: Reputation: 16
Question view received packets to specific UDP/TCP socket


I would like to find out received datagrams to particular UDP socket and packets to specific TCP socket using netstat. One is easily able to check this information per protocol- for example "netstat -s --udp" gives:

Code:
Udp:
    23344 packets received
    0 packets to unknown port received.
    0 packet receive errors
    80117 packets sent
..and "netstat -s --tcp" outputs:

Code:
Tcp:
    18782079 active connections openings
    36762 passive connection openings
    1261775 failed connection attempts
    54981 connection resets received
    2 connections established
    23431679 segments received
    37719328 segments send out
    18012073 segments retransmited
    23 bad segments received.
    610940 resets sent
..but how to see this information for one specific socket? For example I have a SSH server listening on port 22:

Code:
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      11642/sshd
..how to see received TCP segments to this socket?
 
Old 10-10-2011, 12:51 AM   #2
kasl33
Member
 
Registered: Oct 2004
Location: USA
Distribution: Ubuntu-Server, Mac OS X, Arch Linux
Posts: 356

Rep: Reputation: 48
try taking the code that you used to get the final result, but rather than manually formatting it, use grep:

Code:
 command you used | grep -i "sshd"
 
Old 10-10-2011, 12:29 PM   #3
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by kasl33 View Post
try taking the code that you used to get the final result, but rather than manually formatting it, use grep:

Code:
 command you used | grep -i "sshd"
Unfortunately this does not work. For example netstat -s --tcp prints out summary information for all TCP statistics, but I would like to have such statistics per process. I'm afraid it's not possible with netstat, but is there some other more low-level tool which might do the thing?
 
  


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
[SOLVED] IP Route UDP and TCP packets different interfaces howudodat Linux - Networking 2 09-22-2010 05:14 PM
QOS for packets received on a server socket scottbiker Programming 1 06-19-2008 02:55 AM
encapsulating TCP packets in UDP packets... yoshi95 Programming 3 06-03-2004 02:53 PM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM
Only receiving UDP packets, no TCP erevlehdeux Linux - Networking 1 04-23-2004 07:36 PM

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

All times are GMT -5. The time now is 11:09 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