- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to reserve a TCP port
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
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
тАО03-30-2005 05:10 AM
тАО03-30-2005 05:10 AM
Recently, we ran into a problem where our workstation was already connected to an Xterminal on port 55651. As you may already know, each display (in this case the Xterminal) runs an Xserver (on tcp port 6000). The system to which the Xterminal is connected connects to the Xterminal's port 6000 on a random port >1024 (as expected with client-server). Our workstation had connected to the Xterminal using port 55651. Our custom software errored out because it couldn't open port 55651 for listening.
Is there any way to reserve a port > 1024 so that other applications (in this case the random port selection of X connecting to the Xserver on the Xterminal) cannot use the port? To be clear, I want the workstation to NOT use a certain port when selecting a random port number > 1024 for a client application.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2005 05:17 AM
тАО03-30-2005 05:17 AM
Re: How to reserve a TCP port
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2005 05:20 AM
тАО03-30-2005 05:20 AM
Re: How to reserve a TCP port
That is if X damon startup script is S230xxx, your startup script should be S200yyy
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2005 05:33 AM
тАО03-30-2005 05:33 AM
Re: How to reserve a TCP port
help.
If you take a look at your /etc/services
file, it's clearly documented that X uses
many of the ports you are using.
Take a look at your /etc/services file and
pick a port >1024 AND not used by another
service. Don't use ports with higher values
as they are dynamically allocated by the
system.
As long as the server binds to your newly
choosen port and client connects to that,
it does not matter if you have an
/etc/services entry.
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2005 05:50 AM
тАО03-30-2005 05:50 AM
Solution-- and then registered this port.
The port you are using is in the dynamically assigned range and thus is a free-for-all. The first server to attach wins.
The best approach is to have your developers allow a command-line port assignment or bind to an entry in /etc/services like "superduper" that you can set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2005 05:58 AM
тАО03-30-2005 05:58 AM
Re: How to reserve a TCP port
go to www.iana.org. Here is a HP released doc
containing the port numbers of HP-UX services and
applications:
http://docs.hp.com/en/5990-7252/ch02s01.html
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2005 06:24 AM
тАО03-30-2005 06:24 AM
Re: How to reserve a TCP port
I see from the HP document and the IANA port listing that the ports 49152-65535 are listed as dynamic ports. Does this mean that they are the only ports that will be used as dynamic ports by HP-UX? I might sound stupid, but if that's true, I didn't know it.
It sounds like if I was able to change the listening port to something less than 49152, that was registered to a service I'm sure we don't use (like one of the Nimbus ones at the end of the IANA listing), I'd probably be OK and HPUX wouldn't dynamically select that port when connecting to a remote server. Does that sound right?
Thanks again and I'll be sure to give points.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-30-2005 06:29 AM
тАО03-30-2005 06:29 AM
Re: How to reserve a TCP port
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-31-2005 03:38 AM
тАО03-31-2005 03:38 AM
Re: How to reserve a TCP port
While other OSes may have the same defaults, you cannot *really* count on that. And indeed, applications could try to bind to specific port numbers outside of that range.
As already stated, the only way to make sure that you get any *specific* port number is to be the first to request it.
Another option would be to use something like portmapper. It is an additional level of indirection and complexity, but it would allow you to have your server listen at any old port number and have clients find that portnumber.
BTW, make sure your server sets SO_REUSEADDR before trying to bind() to its port. That will preclude what may be the next step in the evolution of your server - trying to restart while there are still TCP endpoints with that port number. (Say in TIME_WAIT, or any state other than LISTEN)
PPS - don't select 12865 - that one is in use by "my" server - netserver of the netperf benchmark :) :) :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2005 04:02 AM
тАО04-04-2005 04:02 AM