<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to reserve a TCP port in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893475#M402803</link>
    <description>Your developers didn't quite play by the rules. They should have chosen a port in the range 1024-49150 that is not already registered by another vendor at &lt;A href="http://www.iana.org." target="_blank"&gt;www.iana.org.&lt;/A&gt;&lt;BR /&gt;-- and then registered this port.&lt;BR /&gt;&lt;BR /&gt;The port you are using is in the dynamically assigned range and thus is a free-for-all. The first server to attach wins.&lt;BR /&gt;&lt;BR /&gt;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.</description>
    <pubDate>Wed, 30 Mar 2005 13:50:21 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-03-30T13:50:21Z</dc:date>
    <item>
      <title>How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893471#M402799</link>
      <description>We have a custom client-server application running on our b2600 workstation under HPUX 11.11.  For this application, our workstation acts as the server and the server side always needs to listen on tcp port 55651.  The client is at a remote location and they connect to port 55651.&lt;BR /&gt;&lt;BR /&gt;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 &amp;gt;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.&lt;BR /&gt;&lt;BR /&gt;Is there any way to reserve a port &amp;gt; 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 &amp;gt; 1024 for a client application.</description>
      <pubDate>Wed, 30 Mar 2005 13:10:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893471#M402799</guid>
      <dc:creator>Tom Fellowes</dc:creator>
      <dc:date>2005-03-30T13:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893472#M402800</link>
      <description>I'm not sure on this, but perhaps adding an entry to /etc/services might do the trick. I would think this file would be checked before opening a random port.&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Wed, 30 Mar 2005 13:17:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893472#M402800</guid>
      <dc:creator>David Child_1</dc:creator>
      <dc:date>2005-03-30T13:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893473#M402801</link>
      <description>Start your application before X terminal damon. i.e in run level 3 (assuming that your application will be started at run level three, at boot time), start your application before X damon starts. i.e you will have to give lower start number than x daemon.&lt;BR /&gt;&lt;BR /&gt;That is if X damon startup script is S230xxx, your startup script should be S200yyy&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Wed, 30 Mar 2005 13:20:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893473#M402801</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-03-30T13:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893474#M402802</link>
      <description>Adding an entry to /etc/services will NOT &lt;BR /&gt;help.&lt;BR /&gt;&lt;BR /&gt;If you take a look at your /etc/services &lt;BR /&gt;file, it's clearly documented that X uses &lt;BR /&gt;many of the ports you are using.&lt;BR /&gt;&lt;BR /&gt;Take a look at your /etc/services file and&lt;BR /&gt;pick a port &amp;gt;1024 AND not used by another &lt;BR /&gt;service. Don't use ports with higher values&lt;BR /&gt;as they are dynamically allocated by the &lt;BR /&gt;system.&lt;BR /&gt;&lt;BR /&gt;As long as the server binds to your newly&lt;BR /&gt;choosen port and client connects to that, &lt;BR /&gt;it does not matter if you have an &lt;BR /&gt;/etc/services entry.&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Mar 2005 13:33:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893474#M402802</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-03-30T13:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893475#M402803</link>
      <description>Your developers didn't quite play by the rules. They should have chosen a port in the range 1024-49150 that is not already registered by another vendor at &lt;A href="http://www.iana.org." target="_blank"&gt;www.iana.org.&lt;/A&gt;&lt;BR /&gt;-- and then registered this port.&lt;BR /&gt;&lt;BR /&gt;The port you are using is in the dynamically assigned range and thus is a free-for-all. The first server to attach wins.&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Wed, 30 Mar 2005 13:50:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893475#M402803</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-30T13:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893476#M402804</link>
      <description>As Clay suggested, for complete list of assigned ports,&lt;BR /&gt;go to &lt;A href="http://www.iana.org." target="_blank"&gt;www.iana.org.&lt;/A&gt; Here is a HP released doc &lt;BR /&gt;containing the port numbers of HP-UX services and&lt;BR /&gt;applications:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/5990-7252/ch02s01.html" target="_blank"&gt;http://docs.hp.com/en/5990-7252/ch02s01.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Mar 2005 13:58:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893476#M402804</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2005-03-30T13:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893477#M402805</link>
      <description>Thanks for all the help.  Sorry to be stupid but I have a couple more questions.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;Thanks again and I'll be sure to give points.</description>
      <pubDate>Wed, 30 Mar 2005 14:24:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893477#M402805</guid>
      <dc:creator>Tom Fellowes</dc:creator>
      <dc:date>2005-03-30T14:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893478#M402806</link>
      <description>Yes, although if you don't register this port with the IANA then other vendors are also free to use this port and conflicts can still occur. Even with a registered port, you really should map to a service name rather than directly to a port number so that it much more easily user configurable.</description>
      <pubDate>Wed, 30 Mar 2005 14:29:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893478#M402806</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-30T14:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893479#M402807</link>
      <description>The _default_ dynamic (aka anonymous, aka ephemeral) port range for _HP-UX_ 11 and later is 49152 to 65535.  However, there are ndd parameters that could change either the lower or upper bound of that range. (tcp_smallest_anon_port and tcp_largest_annon_port IIRC)&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;As already stated, the only way to make sure that you get any *specific* port number is to be the first to request it. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;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)&lt;BR /&gt;&lt;BR /&gt;PPS - don't select 12865 - that one is in use by "my" server - netserver of the netperf benchmark :) :) :)</description>
      <pubDate>Thu, 31 Mar 2005 11:38:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893479#M402807</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2005-03-31T11:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to reserve a TCP port</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893480#M402808</link>
      <description>Info from others was helpful</description>
      <pubDate>Mon, 04 Apr 2005 11:02:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-reserve-a-tcp-port/m-p/4893480#M402808</guid>
      <dc:creator>Tom Fellowes</dc:creator>
      <dc:date>2005-04-04T11:02:18Z</dc:date>
    </item>
  </channel>
</rss>

