- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- process id's and portnumber
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2006 08:51 PM
10-16-2006 08:51 PM
process id's and portnumber
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2006 09:48 PM
10-16-2006 09:48 PM
Re: process id's and portnumber
A network connection is defined through a socket={src-ip,src-port,dest-ip,dest-port}.
If you open a connection, say http, you know that you have to adress dest-port=80/tcp (http) because that service is "well-known" (see /etc/services).
If not portnumbers but PIDs would be used for dest-ports, how do you know the PID of httpd who serves www.google.com?
Or
If you, for example, replace the src-port with your browser-PID and you visit a site with lots of gifs your multithreaded browser will open lots of connetions, all with the same PID, how would your browser determine what ip-packet belongs to which gif?
Now this work is done for every application by the tcp/ip stack. The applications only specify the target and will get a handle back for further work with that connection.
Now if you want to know to what process opened a certain connection use lsof(8)
$ lsof -i @yourhost:src-port
hns@AVALON:/home/hns> lsof -i @avalon:52545
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ssh 829 hns 3u IPv4 0xc4a23910 0t0 TCP avalon:52545->snowdon:ssh (ESTABLISHED)
A good source for reading is
R. Stevens "UNIX Network programming Vol.I"
rgds
HGH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2006 10:27 PM
10-16-2006 10:27 PM
Re: process id's and portnumber
http://www.faqs.org/faqs/unix-faq/socket/
http://www.google.com/url?sa=t&ct=res&cd=2&url=http%3A%2F%2Fwww.kohala.com%2Fstart%2F&ei=-a80RaGnMYe-2wLnk_20AQ&sig=__v746GYO1_ZHFw694VCXV27VnTY4=&sig2=nO-OpI9mIcHHiUZ3W59-dQ
http://www.google.com/url?sa=t&ct=res&cd=3&url=http%3A%2F%2Fwww.kegel.com%2Funpv1%2F&ei=-a80RaGnMYe-2wLnk_20AQ&sig=__Z8j9rt5Zb_jYe1Zp-aZUz-M8wT4=&sig2=SnqgRE1pvp-r0pN3YZYQyA
http://www.google.com/url?sa=t&ct=res&cd=5&url=http%3A%2F%2Fwww.scit.wlv.ac.uk%2F~jphb%2Fcomms%2Fsockets.html&ei=-a80RaGnMYe-2wLnk_20AQ&sig=__2ol3SoeAP-JHJijp3B9tE16w-hc=&sig2=cWGCPKkPv7F7w65G70Mlag
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2006 12:34 AM
10-17-2006 12:34 AM
Re: process id's and portnumber
lsof |grep number-port
this goes to bring together numbers it of the process, that this leaving the door in Lock
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2006 01:25 AM
10-17-2006 01:25 AM
Re: process id's and portnumber
When the program starts, a PID is created for the process.
As many network services can be running in a server, you need a way to allow multiple services running on the same network address. There is where ports numbers plays. To avoid service conflicts, every network service listen on a different network port but in the same IP address.