Skip to content
View in the app

A better way to browse. Learn more.

Gear Crushers

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Does windows have a TCP Port limit?

Featured Replies

Having trouble with connection issues and after doing a wireshark capture of the traffic I see source port 1025 all the way to 5000 and wireshark says tcp port reuse which tells me the windows box has run out of tcp ports?


 


 


  • Moderators

These are reserved well known port range 1-1024 and anything 1025 and up to 65534 are dynamic ports.  Just like you said, your first dynamic port is 1025 and with windows (yuck) you have a default limit of 4000 ports between two IP's instead of utilizing the full 65534 ports so you'll run out of dynamic ports at TCP port 5000.



 



No server should have a limit of only 4000 tcp source ports.



 



When a client initiates a TCP/IP socket connection to a server, the client typically connects to a specific port on the server and requests that the server respond to the client over a dynamic, or short lived, TCP or UDP port. On Windows Server 2003 and Windows XP the default range of dynamic ports used by client applications is from 1025 through 5000. Under certain conditions it is possible that the available ports in the default range will be exhausted.



 



The symptoms of TCP/IP port exhaustion may vary from one client application to another but are typically manifested as an error indicating a failed network connection. To determine if failed network connections are being caused by TCP/IP port exhaustion, follow these steps on the client computer:



  1. On a computer running Windows XP or Windows Server 2003, click Start, click Run, type cmd, and then click OK to open a command prompt.

  2. Enter the following command in the command prompt on a Windows XP or Windows Server 2003 computer to display the active connections being used by the TCP/IP protocol on this computer: netstat -n

    1. ​This will list the TCP/IP addresses bound to the client computer and the ports on which the TCP/IP addresses are communicating with a remote server. If the listed ports consume all of the available ports then TCP/IP port exhaustion occurs.

  3. Enter the following command in the command prompt on a Windows Server 2003-based client computer to display the active connections being used by the TCP/IP protocol: netstat -b

    1. This will list the TCP/IP address bound to the client computer, the port on which the TCP/IP address are communicating with a remote server, and the application that is using the ports. This information can help determine which client applications are consuming excessive TCP/IP ports.

Each port reservation that is made by a client application consumes kernel memory. If an unusually high number of client port reservations are made then Windows kernel memory use will increase accordingly.



 



 



TCP/IP port exhaustion can occur on a client computer if the client computer is engaging in an unusually high number of TCIP/IP socket connections. This can occur if many client applications are initiating connections.


 


If all of the available dynamic ports are allocated to client applications then the client experiences a condition known as TCP/IP port exhaustion. When TCP/IP port exhaustion occurs, client port reservations cannot be made and errors will occur in client applications that attempt to connect to a server via TCP/IP sockets.


 


TCP/IP port exhaustion is more likely to occur under high load conditions than under normal load conditions.


 


In effort to correct the issue or even avoid TCP/IP port exhaustion and its associated problems follow these steps:




  1. Verify that one or more client applications are not generating excessive TCP/IP socket connections. This can be checked by running netstat -n on Windows Server 2003 and Windows XP or by running netstat -b on Windows Server 2003 as described above.




  2. If a particular client application is engaging in an unusually high number of TCP/IP socket connections then consider redesigning the client application to make more use of TCP/IP socket connections.


    1. Note: If an unusually high number of client port reservations are allocated to an instance of the specific Application service then verify that any custom code configured to run in the Application service is not making excessive TCP/IP socket connections.



  3. If a large number of client applications are initiating the expected number of TCP/IP socket connections but there are not enough available dynamic ports to satisfy the connection requests then implement one or more of the following registry modifications.

Here are some instructions on how to increase the upper range of dynamic ports that are dynamically allocated to client TCP/IP socket connections.





  1. Start Registry Editor.




  2. Browse to, and then click the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters




  3. On the Edit menu, click New, DWORD Value, and then add the following registry value to increase the number of ephemeral ports that can by dynamically allocated to clients:



    1. Value name


      MaxUserPort


      Value data






  4. Close Registry Editor



    1. Note


      You must restart your computer for this change to take effect.






    2. Note


      Increasing the range of dynamic ports used for client TCP/IP connections consumes Windows kernel memory. Do not increase the upper limit for this setting to a value higher than is required to accommodate client application socket connections so as to minimize unnecessary consumption of Windows kernel memory.


       








 


Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.