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 07-26-2011, 06:14 AM   #1
EddieT
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Rep: Reputation: 0
identify all PIDs sharing a TCP/IP stack


Hi,

Is there a linux command (or command combination or utility) that can identify all processes (PIDs) that are sharing a TCP/IP stack ?
 
Old 07-26-2011, 08:55 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You'd have to define what you meant by "stack".

You can use "lsof -i @<hostname>" to see all sockets associated with a specific hostname (or @<ip address> for the IP Address).

You can use "lsof -i :<port>" to see all sockets associated with a specific port (port name or number).

You can use "lsof -i @<hostname>:<port>" to see only sockets on the desired port and hostname.
 
1 members found this post helpful.
Old 07-28-2011, 04:07 AM   #3
EddieT
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for your reply. I dont think there is any mechanism which will identify all processes sharing a TCP/IP stack, but in your response I learned somethings I never knew.

By stack - I mean an instance of a TCP/IP stack which includes transmit/receive queues, open connections and port numbers.
 
Old 07-28-2011, 11:32 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Is netstat of any help to you?
 
Old 07-28-2011, 03:20 PM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
OK the lsof -i stuff gives you the port and open connections.

lsof has many other uses as well.

netstat can give you quite a bit of information and on Linux it is much more useful for some information than on most UNIX variants but lsof is available for both Linux and most UNIX variants.
 
  


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
How to find the active TCP and PIDs corresponding to them in Linux programming? tetelee Programming 1 10-19-2010 05:01 PM
Identify the tcp flooding kirukan Linux - Security 1 10-15-2009 12:36 PM
Identify what child threads/PIDs are doing jmdjr Linux - Enterprise 2 03-27-2009 07:13 AM
TCP STACK Implementaion vibhayadaw Linux - Newbie 0 03-01-2008 09:01 AM
TCP cannections in TCP stack hegdeshashi Linux - Networking 1 01-04-2006 07:24 PM

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

All times are GMT -5. The time now is 09:39 AM.

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