Re: Picking an unused port number

Discussion in 'Java' started by markspace, Oct 21, 2010.

  1. markspace

    markspace Guest

    On 10/20/2010 1:02 PM, Spud wrote:

    > Are there any conventions out there for selecting what port(s) your app
    > should use for application-specific communication?



    Yes. Let the operating system pick an unused one for you.


    > So we have to pick another port number. We could use 8080 like Tomcat,
    > but there might also be a Tomcat instance running that we don't control.



    If you are going to pick one manually, you MUST have control of the OS
    and all ports to assign one. Otherwise, you just really can't. Talk
    the administrator and see if he or she will reserve one for you.


    > So, in general, is there any rule you should use when selecting a port
    > number, other than picking one > 1024?



    Don't select ports close to 1024, they're typically used by NAT and
    other temporary ports. Talk to the sys-ops, hopefully they'll have a
    block of ports that are manually assigned and can give you one out of
    that block.
     
    markspace, Oct 21, 2010
    #1
    1. Advertising

  2. markspace

    Nigel Wade Guest

    On 21/10/10 21:57, markspace wrote:
    > On 10/20/2010 1:02 PM, Spud wrote:
    >
    >> Are there any conventions out there for selecting what port(s) your app
    >> should use for application-specific communication?

    >
    >
    > Yes. Let the operating system pick an unused one for you.
    >


    Not very wise for a server/service. How do the clients get to know what
    port the operating system allocated to the server when it started?

    OTOH, that's exactly why portmapper and other similar services were
    developed. To allow a server to listen on whatever port was available,
    register that port and the service with portmapper, and then clients can
    query the portmapper to locate them. Then along came firewalls...

    --
    Nigel Wade
     
    Nigel Wade, Oct 22, 2010
    #2
    1. Advertising

  3. "Nigel Wade" <> wrote in message
    news:...
    > On 21/10/10 21:57, markspace wrote:
    >> On 10/20/2010 1:02 PM, Spud wrote:
    >>
    >>> Are there any conventions out there for selecting what port(s) your app
    >>> should use for application-specific communication?

    >>
    >>
    >> Yes. Let the operating system pick an unused one for you.
    >>

    >
    > Not very wise for a server/service. How do the clients get to know what
    > port the operating system allocated to the server when it started?
    >
    > OTOH, that's exactly why portmapper and other similar services were
    > developed. To allow a server to listen on whatever port was available,
    > register that port and the service with portmapper, and then clients can
    > query the portmapper to locate them. Then along came firewalls...


    It's kind of amusing how the most sophisticated networking apps sit upon
    something as ancient as IP. Imagine if you were building a registry for
    networked services: would you have each one identify itself to the world
    solely by a 16-bit integer?
     
    Mike Schilling, Oct 23, 2010
    #3
  4. On 23/10/2010 03:13, Mike Schilling wrote:
    > It's kind of amusing how the most sophisticated networking apps sit upon
    > something as ancient as IP.


    It's also kind of amusing how the most sophisticated intellect sits upon
    something as ancient as meat.
    http://baetzler.de/humor/meat_beings.html


    > Imagine if you were building a registry for
    > networked services: would you have each one identify itself to the world
    > solely by a 16-bit integer?



    Its probably more a question of management. If IANA rented out 16-bit
    port number registrations by the year and if you lost registration for
    any protocol that constituted less than (say) 0.01% of Internet traffic
    in a year, the range of "well known port numbers" would probably be
    adequate for quite some time.

    Anyway, a ridiculous (and increasing?) number of services now sit on a
    single port, HTTP, mainly as a way of bypassing uncooperative firewall
    administrators? For example, you can have a stupidly large number of
    distinct SOAP services sitting on port 80.

    On a related note, a 16-bit port number plus a 128-bit IP address† seems
    to me to be a address space with sufficient room to swing the occasional
    cat. A port-mapper approach makes the limit of less than 65,536 distinct
    types of service per single computer somewhat irrelevant.


    Just my 2-bits worth.

    --
    RGB
    †V6
     
    RedGrittyBrick, Oct 25, 2010
    #4
  5. markspace

    Tom Anderson Guest

    On Mon, 25 Oct 2010, RedGrittyBrick wrote:

    > On 23/10/2010 03:13, Mike Schilling wrote:
    >> It's kind of amusing how the most sophisticated networking apps sit upon
    >> something as ancient as IP.

    >
    > It's also kind of amusing how the most sophisticated intellect sits upon
    > something as ancient as meat.
    >
    > http://baetzler.de/humor/meat_beings.html


    There's a rather good short film version of that:

    http://www.youtube.com/watch?v=gaFZTAOb7IE

    On the subject of portmappers, don't forget good old TCPMUX:

    http://en.wikipedia.org/wiki/TCP_Port_Service_Multiplexer

    tom

    --
    I really don't know what any of this shit means, but it looks
    impressive. -- zerolives, on YVFC
     
    Tom Anderson, Oct 25, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John T. Goodman

    Overhead of 4-port over 2-port SRAM

    John T. Goodman, Jan 25, 2005, in forum: VHDL
    Replies:
    0
    Views:
    617
    John T. Goodman
    Jan 25, 2005
  2. Sean Wolfe
    Replies:
    1
    Views:
    2,270
    Joerg Jooss
    Apr 28, 2005
  3. b3ny
    Replies:
    11
    Views:
    937
    Babu Kalakrishnan
    Nov 20, 2004
  4. Gerald Klix
    Replies:
    0
    Views:
    1,284
    Gerald Klix
    Oct 26, 2005
  5. Roedy Green

    Re: Picking an unused port number

    Roedy Green, Oct 21, 2010, in forum: Java
    Replies:
    2
    Views:
    357
    Arne Vajhøj
    Oct 22, 2010
Loading...

Share This Page