[HPADM] SUMMARY: Reserving tcp/ip ports

From: O'Donovan, Kevin (Kevin.O'Donovan_at_acs-inc.com)
Date: 02/13/04

  • Next message: Omar Al-Saiari: "[HPADM] FW: frecover work from sam but not from comamand line"
    To: hpux-admin@dutchworks.nl
    Date: Fri, 13 Feb 2004 11:43:41 -0600
    
    

    Thanks to the guys who replied - Chris Medaglia, Rick Jones, Corne Beerse
    and Bill Hassell. Here's the lowdown:

     

    There doesn't appear to be an way of reserving network ports, unless you
    make your application a 'client' of inetd, like ftpd/telnetd/etc.:

    "Instead of writing your own daemon, you might simply have things coded so
    they can run as a child of inetd. Inetd starts rather early in the boot
    process and so is a good fit for "first come, first served"

     

    "(see http://www.sourcecodecorner.com/articles/vnc/linux.asp
    <http://www.sourcecodecorner.com/articles/vnc/linux.asp> for an

    example on how vnc is hooked into inetd.)"

     

    Adding to /etc/services does not reserve the ports, although I would suggest
    if you use particular ports consistently add them in there as a 'flag' to
    let other users know you are using those ports. Better than nothing!

    "The /etc/services file is documentation. It does not reserve a port. Some
    programs

    will refer to the port by service name so if it is not listed, the program
    will abort."

     

     

    The way to go with this issue is to watch what ports you use:

    "look at a netstat output to see what ports are being used while the machine
    is busy, and pick a set of ports that are far away from the others. Also,
    have a look at this:

     

    http://www.iana.org/assignments/port-numbers
    <http://www.iana.org/assignments/port-numbers>

     

    This explains the well-known, registered, and dynamic/private ports concept.
    If you stay between 49152 and 65535, chances are, you're safe. Most of the
    registered ports are not likely to be used on your system, so if you want a
    lower number for an internal app, you shouldn't have a problem if you just
    avoid the ones on your particular systems."

     

    "Also, if you select a port number above tcp_smallest_nonpriv_port and below
    tcp_smallest_anon_port (I think those are the ndd settings) you can be
    reasonably sure that plain random applications that don't select specific
    port numbers will not get the port number(s) you want to use."

     

    Thanks,

    Kevin.

     

    -----Original Message-----
    From: hpux-admin-owner@DutchWorks.nl [mailto:hpux-admin-owner@DutchWorks.nl]
    On Behalf Of O'Donovan, Kevin
    Sent: 12 February 2004 16:29
    To: hpux-admin@DutchWorks.nl
    Subject: [HPADM] Reserving tcp/ip ports

     

    Hi,

     

    I have a user, with 2 machines, and an application on each machine that
    wants to communicate with the application on the other machine, via tcp/ip.
    However none of the processes involved use the /etc/services file. So,
    machine X has App1 running on it, machine Y has App2 running on it, App1
    wants to talk to App2 over tcp/ip.

     

    Basically what I need to do is prevent other processes from using the ports
    these applications want to use, is there any way of doing that? Short of
    writing a C program that listens at a port, and a wrapper shell script to
    terminate/run that process when it needs to use/reserve those ports...

     

    Thanks in advance,

    Kevin.

    --
                 ---> Please post QUESTIONS and SUMMARIES only!! <---
            To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
           Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
     
     Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
                http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)
    

  • Next message: Omar Al-Saiari: "[HPADM] FW: frecover work from sam but not from comamand line"

    Relevant Pages

    • Re: Cant run TCP/IP through AX.25 using Linux
      ... TCP/IP is suppose to self calculate retry etc periods based on the first few packet failures. ... That can mess things up as TCP/IP thinks it has a faster throughput speed than it really doesnt. ... FTP and telnet use a port for each direction whereas web browsers can use 100+ source ports to get a web page. ... now to connect my house network to my business network in a rural area. ...
      (rec.radio.amateur.digital.misc)
    • Re: NetBEUI and security
      ... TCP/IP is the least safe and slowest of the network protocols. ... >>be transmitted over NetBeui. ... > all of the computer to access the hub. ... with ports or a switch. ...
      (comp.security.firewalls)
    • Re: increase in ftp scanning
      ... > Has any one else notice a huge increase in ftp scanning over the last ... closing the tcp 21 server socket. ... Ordinarily, with inetd removing ftp from the game, tcp port 21 would no longer ... servicing two new ports. ...
      (Incidents)
    • Re: LPR Problems
      ... Unix and setup an LPR Port to the device? ... The tcp/ip protocol does not allow reuse of the ports ... Windows Printing Team ...
      (microsoft.public.windowsxp.print_fax)
    • Re: WinXP SP2 firewall
      ... Please learn the basics of networking with the TCP/IP protocol family, ... handling packets for a TCP connection for example. ... them don't have the concept of ports like ICMP and IGMP, ... "Ich bin ein freier Mensch und werde jetzt von meinen Freiheitsrechten ...
      (comp.security.firewalls)