HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Limit in the number of socket port in machine...
Operating System - HP-UX
1832764
Members
3146
Online
110045
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
12-11-2002 06:20 AM
12-11-2002 06:20 AM
Hi,
my question is , there are any limit in the number of socket port in machines with Unix??
If there is a limit , which is the maximum number??
Thanks in advance.
Ana.
my question is , there are any limit in the number of socket port in machines with Unix??
If there is a limit , which is the maximum number??
Thanks in advance.
Ana.
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 06:31 AM
12-11-2002 06:31 AM
Solution
Ana, assuming I understand your question correctly, the answer is 65535 (64k) but that is not a Unix-related limitation.
The low number ports (0-1023) are called the "well-known" ports for services such as FTP, SMTP, HTTP, etc. and only the root user or a privileged process can use them as source ports.
Port numbers 1024-49151 are called "registered" ports. They can be used by ordinary users and are only registered for convenience.
Port numbers 49152-65535 are called "dynamic" or sometimes, "private" ports and I don't believe anyone keeps a listing of their usage.
You may find this URL useful:
http://www.iana.org/assignments/port-numbers
HTH,
Paul
The low number ports (0-1023) are called the "well-known" ports for services such as FTP, SMTP, HTTP, etc. and only the root user or a privileged process can use them as source ports.
Port numbers 1024-49151 are called "registered" ports. They can be used by ordinary users and are only registered for convenience.
Port numbers 49152-65535 are called "dynamic" or sometimes, "private" ports and I don't believe anyone keeps a listing of their usage.
You may find this URL useful:
http://www.iana.org/assignments/port-numbers
HTH,
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 06:46 AM
12-11-2002 06:46 AM
Re: Limit in the number of socket port in machines with Unix
Sockets are actually allocated out of dynamic memory and thus, the number is not
limited by a table directly. The
real limiting factors are typically file table entries or port numbers. When an
application creates a socket with the
socket(2) system call or accepts a new network connection with the accept(2)
system call, the operating system must
allocate a file descriptor to point to the newly allocated socket structure.
This means that there needs to be space in the kernel file table, the size of
which is controlled by the kernel tunable
"nfile". Typically if the kernel file table is full or near full, there will be
other problems with the system such as problems
starting new programs and there will be messages on the console indicating "file
table overflow".
Each process on the system also has has a table of file descriptors which is
typically limited to 60 open files per
process. This is more often an issue than is the kernel file table. The number
of open "files", including sockets is
controlled by the kernel tunable called "maxfiles".
Finally, a TCP or UDP port number must be assigned to each socket before it
actually gets used for communications.
The port number is assigned explicitly with the bind(2) system call or
implicitly with a connect(2) call, a sento(2) call
or a bind(2) call with a port number of 0. If the application asks for a
specific port number using the bind(2) call, it will
get an error if that port number is not available. If the application lets the
system allocate a port number, the port will
come out of a pool of numbers. The port numbers used for such allocation are
from 1024 to 5000 on a standard 10.20
system. If and "ARPA transport" patch starting with [PHNE_13287/PACHRDME/English] or later is
installed then you also have the option
of specifying a different range of port numbers using the nettune command.
/usr/contrib/bin/nettune -l high_port_enable
will display if the use of "high" port numbers is enabled (use "nettune -s
high_port_enable 1" to enable high port numbers)
When the use of high port nmbers is enabled the dynamically (aka ephemeral) port
numbers will be allocated starting at
port number 49152. The upper port number is, by default, 65535. The lower limit
is fixed but the upper limit can be
reduced, if desired using:
/usr/local/bin/nettune -s high_port_max 60000
This will set the range to be from 49152 to 6000, thus allowing for 10,848
dynamically allocated port numbers.
The nettune command modifies the running kernel only and thus must be run during
system startup.
The use of "high ports" should be avoided unless you are sure you are actually
being limited by a lack of port
numbers. This would typically only be a problem on system running a very large
number of outbound conections.
The use of "high ports" has no impact on use of "reserved ports" which are in
the range from512-1204. The reserved port
limited by a table directly. The
real limiting factors are typically file table entries or port numbers. When an
application creates a socket with the
socket(2) system call or accepts a new network connection with the accept(2)
system call, the operating system must
allocate a file descriptor to point to the newly allocated socket structure.
This means that there needs to be space in the kernel file table, the size of
which is controlled by the kernel tunable
"nfile". Typically if the kernel file table is full or near full, there will be
other problems with the system such as problems
starting new programs and there will be messages on the console indicating "file
table overflow".
Each process on the system also has has a table of file descriptors which is
typically limited to 60 open files per
process. This is more often an issue than is the kernel file table. The number
of open "files", including sockets is
controlled by the kernel tunable called "maxfiles".
Finally, a TCP or UDP port number must be assigned to each socket before it
actually gets used for communications.
The port number is assigned explicitly with the bind(2) system call or
implicitly with a connect(2) call, a sento(2) call
or a bind(2) call with a port number of 0. If the application asks for a
specific port number using the bind(2) call, it will
get an error if that port number is not available. If the application lets the
system allocate a port number, the port will
come out of a pool of numbers. The port numbers used for such allocation are
from 1024 to 5000 on a standard 10.20
system. If and "ARPA transport" patch starting with [PHNE_13287/PACHRDME/English] or later is
installed then you also have the option
of specifying a different range of port numbers using the nettune command.
/usr/contrib/bin/nettune -l high_port_enable
will display if the use of "high" port numbers is enabled (use "nettune -s
high_port_enable 1" to enable high port numbers)
When the use of high port nmbers is enabled the dynamically (aka ephemeral) port
numbers will be allocated starting at
port number 49152. The upper port number is, by default, 65535. The lower limit
is fixed but the upper limit can be
reduced, if desired using:
/usr/local/bin/nettune -s high_port_max 60000
This will set the range to be from 49152 to 6000, thus allowing for 10,848
dynamically allocated port numbers.
The nettune command modifies the running kernel only and thus must be run during
system startup.
The use of "high ports" should be avoided unless you are sure you are actually
being limited by a lack of port
numbers. This would typically only be a problem on system running a very large
number of outbound conections.
The use of "high ports" has no impact on use of "reserved ports" which are in
the range from512-1204. The reserved port
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP