1849835 Members
2873 Online
104044 Solutions
New Discussion

Re: ports allocation

 
Alan D Johnson
Occasional Advisor

ports allocation

Does any on know the order in which ports are allocated? is it lowest to highest, highest to lowest? Does it statr over at the lowest highest once the max has been reached?
4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: ports allocation

What ports are you talking about? pty's?

I think with pty ports, it just looks for whatevever the next available one is. If pty/0 thru pty/10 are used and then pty/6 gets cleared, the next connection will use pty/6. I THINK!!!
Ron Kinner
Honored Contributor

Re: ports allocation

If you are talking about what port it uses to originate a TCP or UDP connection then it depends on the OS version. Early versions were very predictable and tended to stay within a narrow range (1K to 5K if I remember correctly). However, there were problems with hackers guessing the next number and doing nasty things to your system so later versions (at least from 11.0 on) use a very wide range of ports (around 5000 to 65K or so)and choose then in a random process. I think ndd offers an option to change the lowest number port tcp or udp can use.

Ron
A. Clay Stephenson
Acclaimed Contributor

Re: ports allocation

Your question is not very clear but if you are referring to udp/tcp ports then then answer is that it depends. I assume that you are talking about requesting a port 0 so that the system selects an usused port otherwise your question makes no sense. Your best bet is to man 2 accept.
If it ain't broke, I can fix that.

Re: ports allocation