Windows error 4227

Fixes an issue in which an event ID 4227 is logged when a client application tries to connect to a Windows Server 2008 SP2-based server during a dynamic port allocation process.

Windows Server 2008 Service Pack 2 Windows Server 2008 Enterprise Windows Server 2008 Enterprise without Hyper-V Windows Server 2008 Datacenter Windows Server 2008 Datacenter without Hyper-V Windows Server 2008 for Itanium-Based Systems Windows Server 2008 Foundation Windows Server 2008 Standard Windows Server 2008 Standard without Hyper-V Windows Server 2008 Web Edition More…Less

Symptoms

When a client application tries to connect to a Windows Server 2008 Service Pack 2 (SP2)-based server during a dynamic port allocation process, the connection fails, and the application does not work as expected. Additionally, event ID 4227 is logged on the server, and the client application receives a WinSock error 10048 (WSAEADDRINUSE).

Notes

  • This issue occurs even though there are available dynamic ports on the server.

  • For more information about event ID 4227 and WinSock error 10048, go to the following Microsoft websites:

    Event ID 4227 — TCP/IP network connectivity

    Winsock error codes

Cause

This issue occurs because a new dynamic port that has a «Closing» status is allocated. Then, the Tcpip.sys driver registers the event ID 4227 on the server.

Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a «Hotfix download available» section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website:

http://support.microsoft.com/contactus/?ws=supportNote The «Hotfix download available» form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must be running Windows Server 2008 SP2.

For more information about how to obtain a Windows Server 2008 service pack, click the following article number to view the article in the Microsoft Knowledge Base:

968849How to obtain the latest service pack for Windows Server 2008

Registry information

To apply this hotfix, you do not have to make any changes to the registry.

Restart requirement

You must restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.

The global version of this hotfix installs files that have the attributes that are listed in the following tables. The dates and the times for these files are listed in Coordinated Universal Time (UTC). The dates and the times for these files on your local computer are displayed in your local time together with your current daylight saving time (DST) bias. Additionally, the dates and the times may change when you perform certain operations on the files.

Windows Server 2008 file information notesImportant Windows Vista hotfixes and Windows Server 2008 hotfixes are included in the same packages. However, only «Windows Vista» is listed on the Hotfix Request page. To request the hotfix package that applies to one or both operating systems, select the hotfix that is listed under «Windows Vista» on the page. Always refer to the «Applies To» section in articles to determine the actual operating system that each hotfix applies to.

  • The files that apply to a specific product, SR_Level (RTM, SPn), and service branch (LDR, GDR) can be identified by examining the file version numbers as shown in the following table.

    Version

    Product

    SR_Level

    Service branch

    6.0.600
    2.
    23xxx

    Windows Server 2008

    SP2

    LDR

  • The MANIFEST files (.manifest) and the MUM files (.mum) that are installed for each environment are

    listed separately in the «Additional file information for Windows Server 2008» section. MUM files and MANIFEST files, and the associated security catalog (.cat) files, are extremely important to maintaining the state of the updated component. The security catalog files, for which the attributes are not listed, are signed with a Microsoft digital signature.

For all supported x86-based versions of Windows Server 2008

File name

File version

File size

Date

Time

Platform

Tcpipreg.sys

6.0.6002.23264

31,232

02-Nov-2013

11:42

x86

Tcpip.sys

6.0.6002.23264

915,392

02-Nov-2013

13:24

x86

For all supported x64-based versions of Windows Server 2008

File name

File version

File size

Date

Time

Platform

Tcpipreg.sys

6.0.6002.23264

40,448

02-Nov-2013

12:23

x64

Tcpip.sys

6.0.6002.23264

1,417,152

02-Nov-2013

14:15

x64

For all supported IA-64-based versions of Windows Server 2008

File name

File version

File size

Date

Time

Platform

Tcpipreg.sys

6.0.6002.23264

80,896

02-Nov-2013

11:29

IA-64

Tcpip.sys

6.0.6002.23264

2,976,192

02-Nov-2013

13:11

IA-64

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the «Applies to» section.

More Information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684Description of the standard terminology that is used to describe Microsoft software updates

Additional file information for Windows Server 2008

Additional files for all supported x86-based versions of Windows Server 2008

File property

Value

File name

X86_07d832875b515e11fe3999cc548cc028_31bf3856ad364e35_6.0.6002.23264_none_2b23f4283c15afe6.manifest

File version

Not applicable

File size

717

Date (UTC)

05-Nov-2013

Time (UTC)

07:09

File name

X86_3b48f9f8dc57d913deb2d9f72b6317af_31bf3856ad364e35_6.0.6002.23264_none_815b028d63e6b50b.manifest

File version

Not applicable

File size

702

Date (UTC)

05-Nov-2013

Time (UTC)

07:09

File name

X86_microsoft-windows-l..istry-support-tcpip_31bf3856ad364e35_6.0.6002.23264_none_8850572a1bde0ab9.manifest

File version

Not applicable

File size

4,845

Date (UTC)

02-Nov-2013

Time (UTC)

13:40

File name

X86_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.0.6002.23264_none_b55133757cd75123.manifest

File version

Not applicable

File size

6,400

Date (UTC)

02-Nov-2013

Time (UTC)

13:41

Additional files for all supported x64-based versions of Windows Server 2008

File property

Value

File name

Amd64_e3bf7d0554c2c36ba963d571463e64b6_31bf3856ad364e35_6.0.6002.23264_none_bea0c8227a5202a0.manifest

File version

Not applicable

File size

706

Date (UTC)

05-Nov-2013

Time (UTC)

07:09

File name

Amd64_e441d8f93eea3011129e54d91e13e6b5_31bf3856ad364e35_6.0.6002.23264_none_c487551864b86765.manifest

File version

Not applicable

File size

721

Date (UTC)

05-Nov-2013

Time (UTC)

07:09

File name

Amd64_microsoft-windows-l..istry-support-tcpip_31bf3856ad364e35_6.0.6002.23264_none_e46ef2add43b7bef.manifest

File version

Not applicable

File size

5,122

Date (UTC)

02-Nov-2013

Time (UTC)

14:33

File name

Amd64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.0.6002.23264_none_116fcef93534c259.manifest

File version

Not applicable

File size

6,422

Date (UTC)

02-Nov-2013

Time (UTC)

14:34

Additional files for all supported IA-64-based versions of Windows Server 2008

File property

Value

File name

Ia64_1eea6fd3c7b4167e49b833da130dd1b0_31bf3856ad364e35_6.0.6002.23264_none_88cab8bbb592f16f.manifest

File version

Not applicable

File size

1,066

Date (UTC)

05-Nov-2013

Time (UTC)

07:09

File name

Ia64_microsoft-windows-l..istry-support-tcpip_31bf3856ad364e35_6.0.6002.23264_none_8851fb201bdc13b5.manifest

File version

Not applicable

File size

5,118

Date (UTC)

02-Nov-2013

Time (UTC)

13:29

File name

Ia64_microsoft-windows-tcpip-binaries_31bf3856ad364e35_6.0.6002.23264_none_b552d76b7cd55a1f.manifest

File version

Not applicable

File size

6,411

Date (UTC)

02-Nov-2013

Time (UTC)

13:29

Need more help?

  • Remove From My Forums
  • Question

  • I am seeing this error in the event logs on a number of our w2012r2 servers. These servers are barely being utilized because they are not production yet. I find it hard to believe that the server is running out of ports.  I did a netstat on a few
    servers and there are very few ports that are in use. Are there any other reasons why we would be getting this warning? Is there any other ways to troubleshoot this issue? When I do the netstat command it may be an hour after the error is logged. Its
    hard to catch the error and do the netstat at the same time the error is logged.

    TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint. This error typically occurs when outgoing connections are opened and closed at a high rate, causing all available
    local ports to be used and forcing TCP/IP to reuse a local port for an outgoing connection. To minimize the risk of data corruption, the TCP/IP standard requires a minimum time period to elapse between successive connections from a given local endpoint to
    a given remote endpoint.

    Any help is appreciated.

    Thanks

Answers

  • Hi missyz21,

    Check if decrease TcpTimeWaitDelay and increase MaxUserPort could help to solve the issue.

    1. The location of the TcpTimeWaitDelay is:

    HKEY_LOCAL-MACHINESystemCurrentControlSetServicesTcpipParameters. Add REG_DWORD named TcpTimedWaitDelay, we may set the value to 30 seconds, by default, the value is 4 minutes.

    Here is the detailed information about TcpTimedWaitDelay:

    https://technet.microsoft.com/en-us/library/cc938217.aspx

    2. Then we may use command netsh int ipv4 set dynamicport tcp start=10000 num=20000 to expand dynamic port range.

    Best Regards,

    Anne


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by

      Tuesday, December 29, 2015 9:07 AM

    • Marked as answer by
      Anne HeMicrosoft contingent staff
      Wednesday, January 6, 2016 1:52 AM

Содержание

  1. Tcp ip 4227 windows server 2012
  2. Tcp ip 4227 windows server 2012
  3. Устранение проблем нехватки портов Troubleshoot port exhaustion issues
  4. Динамический диапазон порта по умолчанию для TCP/IP Default dynamic port range for TCP/IP
  5. Устранение неполадок в истощении порта Troubleshoot Port exhaustion
  6. Метод 1 Method 1
  7. Метод 2 Method 2
  8. Метод 3 Method 3
  9. Полезные ссылки Useful links

Tcp ip 4227 windows server 2012

Профиль | Отправить PM | Цитировать

Здравствуйте уважаемые!
Есть 2 КД на базе win 2008 standard. Регулярно обновляются.
Основной КД выходит в интернет через девайс DFL-860e.
Был я подключен через l2tp к билайну, все было нормально.
Но сейчас пришлось сменить провайдера, который выводит в интернет через статические настройки, без туннеля.
После этого я стал наблюдать на основном КД (на втором все тихо) ошибку:

TCPIP 4227
Произошла ошибка TCP/IP при попытке установить исходящее подключение, так как выбранная локальная конечная точка недавно использовалась для подключения к той же удаленной конечной точке. Эта ошибка обычно возникает тогда, когда исходящее подключение открывается и закрывается с высокой частотой, в результате чего все доступные локальные порты используются и протокол TCP/IP должен повторно использовать локальный порт для исходящего подключения. Для уменьшения риска повреждения данных стандарт TCP/IP требует, чтобы существовал минимальный промежуток времени между последовательными подключениями из определенной начальной точки к определенной конечной точке.

Ошибок за день всего пару. Почитал в интернете, пишут что это связанно с тем, что большая пауза на резервирование портов и надо сменить с 240с на 60с или 30с.

Но все дело в том, что ошибки эти появились одна в 19:31 ,а другая в 23:41 , когда все компы выключены и работают только 2 КД на всю сеть, а сетевая активность стремиться к нулю.

И еще смущает результат команды netstat –a –b:

[dns.exe]
UDP 0.0.0.0:64574 *:*
[dns.exe]
UDP 0.0.0.0:64575 *:*
[dns.exe]
UDP 0.0.0.0:64576 *:*
[dns.exe]
UDP 0.0.0.0:64577 *:*
[dns.exe]
UDP 0.0.0.0:64578 *:*
[dns.exe]
UDP 0.0.0.0:64579 *:*
[dns.exe]
UDP 0.0.0.0:64580 *:*
[dns.exe]
UDP 0.0.0.0:64581 *:*
[dns.exe]
UDP 0.0.0.0:64582 *:*
[dns.exe]
UDP 0.0.0.0:64583 *:*
[dns.exe]
UDP 0.0.0.0:64584 *:*
[dns.exe]
UDP 0.0.0.0:64585 *:*
[dns.exe]
UDP 127.0.0.1:53 *:*
[dns.exe]
UDP 127.0.0.1:49795 *:*
[taskeng.exe]
UDP 127.0.0.1:49796 *:*
[DFSRs.exe]
UDP 127.0.0.1:55812 *:*
[dfssvc.exe]
UDP 127.0.0.1:55813 *:*
[mmc.exe]
UDP 127.0.0.1:57610 *:*
NlaSvc
[svchost.exe]
UDP 127.0.0.1:57611 *:*
[era.exe]
UDP 127.0.0.1:57612 *:*
gpsvc
[svchost.exe]
UDP 127.0.0.1:59817 *:*
[lsass.exe]
UDP 127.0.0.1:61120 *:*
[spoolsv.exe]
UDP 127.0.0.1:63215 *:*
LanmanWorkstation
[svchost.exe]
UDP 127.0.0.1:64586 *:*
DHCPServer
[svchost.exe]
UDP 127.0.0.1:64587 *:*
[dns.exe]
UDP 127.0.0.1:64588 *:*
[ismserv.exe]
UDP 192.168.0.5:53 *:*
[dns.exe]
UDP 192.168.0.5:67 *:*
DHCPServer
[svchost.exe]
UDP 192.168.0.5:68 *:*
DHCPServer
[svchost.exe]
UDP 192.168.0.5:88 *:*
[lsass.exe]
UDP 192.168.0.5:137 *:*

Не удается получить сведения о владельце

x. Сбой при инициализации Windows Sockets: 5
UDP 192.168.0.5:138 *:*

Не удается получить сведения о владельце

x. Сбой при инициализации Windows Sockets: 5
UDP 192.168.0.5:389 *:*
[lsass.exe]
UDP 192.168.0.5:464 *:*
[lsass.exe]
UDP 192.168.0.5:2535 *:*
DHCPServer
[svchost.exe]
UDP [::]:123 *:*
W32Time
[svchost.exe]
UDP [::]:500 *:*
IKEEXT
[svchost.exe]
UDP [::]:59822 *:*
[dns.exe]
UDP [::1]:53 *:*
[dns.exe]
UDP [::1]:59820 *:*
[dns.exe]

На всякий случай прогнал AVZ . Чисто все.
Подскажите, в чем может быть проблема?

Tcp ip 4227 windows server 2012

Профиль | Отправить PM | Цитировать

Здравствуйте уважаемые!
Есть 2 КД на базе win 2008 standard. Регулярно обновляются.
Основной КД выходит в интернет через девайс DFL-860e.
Был я подключен через l2tp к билайну, все было нормально.
Но сейчас пришлось сменить провайдера, который выводит в интернет через статические настройки, без туннеля.
После этого я стал наблюдать на основном КД (на втором все тихо) ошибку:

TCPIP 4227
Произошла ошибка TCP/IP при попытке установить исходящее подключение, так как выбранная локальная конечная точка недавно использовалась для подключения к той же удаленной конечной точке. Эта ошибка обычно возникает тогда, когда исходящее подключение открывается и закрывается с высокой частотой, в результате чего все доступные локальные порты используются и протокол TCP/IP должен повторно использовать локальный порт для исходящего подключения. Для уменьшения риска повреждения данных стандарт TCP/IP требует, чтобы существовал минимальный промежуток времени между последовательными подключениями из определенной начальной точки к определенной конечной точке.

Ошибок за день всего пару. Почитал в интернете, пишут что это связанно с тем, что большая пауза на резервирование портов и надо сменить с 240с на 60с или 30с.

Но все дело в том, что ошибки эти появились одна в 19:31 ,а другая в 23:41 , когда все компы выключены и работают только 2 КД на всю сеть, а сетевая активность стремиться к нулю.

И еще смущает результат команды netstat –a –b:

[dns.exe]
UDP 0.0.0.0:64574 *:*
[dns.exe]
UDP 0.0.0.0:64575 *:*
[dns.exe]
UDP 0.0.0.0:64576 *:*
[dns.exe]
UDP 0.0.0.0:64577 *:*
[dns.exe]
UDP 0.0.0.0:64578 *:*
[dns.exe]
UDP 0.0.0.0:64579 *:*
[dns.exe]
UDP 0.0.0.0:64580 *:*
[dns.exe]
UDP 0.0.0.0:64581 *:*
[dns.exe]
UDP 0.0.0.0:64582 *:*
[dns.exe]
UDP 0.0.0.0:64583 *:*
[dns.exe]
UDP 0.0.0.0:64584 *:*
[dns.exe]
UDP 0.0.0.0:64585 *:*
[dns.exe]
UDP 127.0.0.1:53 *:*
[dns.exe]
UDP 127.0.0.1:49795 *:*
[taskeng.exe]
UDP 127.0.0.1:49796 *:*
[DFSRs.exe]
UDP 127.0.0.1:55812 *:*
[dfssvc.exe]
UDP 127.0.0.1:55813 *:*
[mmc.exe]
UDP 127.0.0.1:57610 *:*
NlaSvc
[svchost.exe]
UDP 127.0.0.1:57611 *:*
[era.exe]
UDP 127.0.0.1:57612 *:*
gpsvc
[svchost.exe]
UDP 127.0.0.1:59817 *:*
[lsass.exe]
UDP 127.0.0.1:61120 *:*
[spoolsv.exe]
UDP 127.0.0.1:63215 *:*
LanmanWorkstation
[svchost.exe]
UDP 127.0.0.1:64586 *:*
DHCPServer
[svchost.exe]
UDP 127.0.0.1:64587 *:*
[dns.exe]
UDP 127.0.0.1:64588 *:*
[ismserv.exe]
UDP 192.168.0.5:53 *:*
[dns.exe]
UDP 192.168.0.5:67 *:*
DHCPServer
[svchost.exe]
UDP 192.168.0.5:68 *:*
DHCPServer
[svchost.exe]
UDP 192.168.0.5:88 *:*
[lsass.exe]
UDP 192.168.0.5:137 *:*

Не удается получить сведения о владельце

x. Сбой при инициализации Windows Sockets: 5
UDP 192.168.0.5:138 *:*

Не удается получить сведения о владельце

x. Сбой при инициализации Windows Sockets: 5
UDP 192.168.0.5:389 *:*
[lsass.exe]
UDP 192.168.0.5:464 *:*
[lsass.exe]
UDP 192.168.0.5:2535 *:*
DHCPServer
[svchost.exe]
UDP [::]:123 *:*
W32Time
[svchost.exe]
UDP [::]:500 *:*
IKEEXT
[svchost.exe]
UDP [::]:59822 *:*
[dns.exe]
UDP [::1]:53 *:*
[dns.exe]
UDP [::1]:59820 *:*
[dns.exe]

На всякий случай прогнал AVZ . Чисто все.
Подскажите, в чем может быть проблема?

Устранение проблем нехватки портов Troubleshoot port exhaustion issues

Протоколы TCP и UDP работают на основе номеров портов, используемых для установления подключения. TCP and UDP protocols work based on port numbers used for establishing connection. Любому приложению или службе, необходимой для установления подключения TCP/UDP, потребуется порт на его стороне. Any application or a service that needs to establish a TCP/UDP connection will require a port on its side.

Существует два типа портов: There are two types of ports:

  • Эфемерныепорты, которые обычно являются динамическими портами, являются набором портов, которые по умолчанию будут иметь каждый компьютер, чтобы сделать исходящие подключения. Ephemeral ports, which are usually dynamic ports, are the set of ports that every machine by default will have them to make an outbound connection.
  • Известные порты — это определенный порт для конкретного приложения или службы. Well-known ports are the defined port for a particular application or service. Например, служба файловой серверной службы находится в порту 445, HTTPS — 443, HTTP — 80, RPC — 135. For example, file server service is on port 445, HTTPS is 443, HTTP is 80, and RPC is 135. Настраиваемые приложения также будут иметь определенные номера портов. Custom application will also have their defined port numbers.

Клиенты при подключении к приложению или службе будут использовать эфемерный порт из его машины для подключения к известному порту, определенному для этого приложения или службы. Clients when connecting to an application or service will make use of an ephemeral port from its machine to connect to a well-known port defined for that application or service. Браузер на клиентской машине будет использовать эфемерный порт для подключения к https://www.microsoft.com порту 443. A browser on a client machine will use an ephemeral port to connect to https://www.microsoft.com on port 443.

В сценарии, в котором один и тот же браузер создает много подключений к нескольким веб-сайтам, для любого нового подключения, которое пытается использовать браузер, используется эфемерный порт. In a scenario where the same browser is creating a lot of connections to multiple website, for any new connection that the browser is attempting, an ephemeral port is used. Через некоторое время вы заметите, что подключения начнут сбой и одна высокая возможность для этого будет потому, что браузер использовал все доступные порты для подключения за пределами и любые новые попытки установить подключение не удастся, так как нет более доступных портов. After some time, you will notice that the connections will start to fail and one high possibility for this would be because the browser has used all the available ports to make connections outside and any new attempt to establish a connection will fail as there are no more ports available. Когда все порты на компьютере используются, мы используем его как истощение порта. When all the ports are on a machine are used, we term it as port exhaustion.

Динамический диапазон порта по умолчанию для TCP/IP Default dynamic port range for TCP/IP

Чтобы соответствовать рекомендациям управления номерами, заданными в Интернете, Корпорация Майкрософт увеличила динамический диапазон клиентских портов для исходяющих подключений. To comply with Internet Assigned Numbers Authority (IANA) recommendations, Microsoft has increased the dynamic client port range for outgoing connections. Новый порт запуска по умолчанию — 49152, а конечный порт по умолчанию — 65535. The new default start port is 49152, and the new default end port is 65535. Это изменение конфигурации более ранних версий Windows, которые использовали диапазон портов по умолчанию от 1025 до 5000. This is a change from the configuration of earlier versions of Windows that used a default port range of 1025 through 5000.

Динамический диапазон порта можно просмотреть на компьютере с помощью следующих команд сетки: You can view the dynamic port range on a computer by using the following netsh commands:

  • netsh int ipv4 show dynamicport tcp
  • netsh int ipv4 show dynamicport udp
  • netsh int ipv6 show dynamicport tcp
  • netsh int ipv6 show dynamicport udp

Диапазон устанавливается отдельно для каждого транспорта (TCP или UDP). The range is set separately for each transport (TCP or UDP). Диапазон порта теперь — это диапазон, который имеет отправную точку и конечную точку. The port range is now a range that has a starting point and an ending point. Клиенты Майкрософт, развертывавшие серверы с Windows Server, могут иметь проблемы, влияющие на связь RPC между серверами, если брандмауэры используются во внутренней сети. Microsoft customers who deploy servers that are running Windows Server may have problems that affect RPC communication between servers if firewalls are used on the internal network. В этих ситуациях рекомендуется перенастроить брандмауэры, чтобы разрешить трафик между серверами в динамическом диапазоне портов от 49152 до 65535. In these situations, we recommend that you reconfigure the firewalls to allow traffic between servers in the dynamic port range of 49152 through 65535. Этот диапазон помимо известных портов, используемых службами и приложениями. This range is in addition to well-known ports that are used by services and applications. Или диапазон портов, используемый серверами, может быть изменен на каждом сервере. Or, the port range that is used by the servers can be modified on each server. Этот диапазон можно настроить с помощью команды netsh следующим образом. You adjust this range by using the netsh command, as follows. Вышеуказанная команда задает динамический диапазон порта для TCP. The above command sets the dynamic port range for TCP.

Порт запуска — это число, а общее число портов — диапазон. The start port is number, and the total number of ports is range. Ниже приводится пример команд: The following are sample commands:

  • netsh int ipv4 set dynamicport tcp start=10000 num=1000
  • netsh int ipv4 set dynamicport udp start=10000 num=1000
  • netsh int ipv6 set dynamicport tcp start=10000 num=1000
  • netsh int ipv6 set dynamicport udp start=10000 num=1000

Эти примерные команды устанавливают динамический диапазон портов для запуска в порте 10000 и окончания в порте 10999 (1000 портов). These sample commands set the dynamic port range to start at port 10000 and to end at port 10999 (1000 ports). Минимальный диапазон портов, который можно установить, — 255. The minimum range of ports that can be set is 255. Минимальный порт запуска, который можно установить, — 1025. The minimum start port that can be set is 1025. Максимальный конечный порт (в зависимости от настраиваемого диапазона) не может превышать 65535. The maximum end port (based on the range being configured) cannot exceed 65535. Чтобы повторить поведение Windows Server 2003 по умолчанию, используйте 1025 в качестве порта запуска, а затем используйте 3976 в качестве диапазона для TCP и UDP. To duplicate the default behavior of Windows Server 2003, use 1025 as the start port, and then use 3976 as the range for both TCP and UDP. Это приводит к запуску порта 1025 и конечного порта 5000. This results in a start port of 1025 and an end port of 5000.

В частности, для исходящие подключения в качестве входящих подключений не потребуется эфемерный порт для приемки подключений. Specifically, about outbound connections as incoming connections will not require an Ephemeral port for accepting connections.

Так как исходящие подключения начинают сбой, вы увидите много ниже поведения: Since outbound connections start to fail, you will see a lot of the below behaviors:

Не удается войти в машину с учетными данными домена, однако вход с локальной учетной записью работает. Unable to sign in to the machine with domain credentials, however sign-in with local account works. Для регистрации домена потребуется связаться с dc для проверки подлинности, которая снова является исходящие подключения. Domain sign-in will require you to contact the DC for authentication which is again an outbound connection. Если у вас есть набор учетных данных кэша, вход в домен может по-прежнему работать. If you have cache credentials set, then domain sign-in might still work.

Сбои обновления групповой политики: Group Policy update failures:

Недоступными являются файлы: File shares are inaccessible:

RDP с пострадавшего сервера не удается: RDP from the affected server fails:

Любое другое приложение, запущенное на компьютере, начнет выдать ошибки Any other application running on the machine will start to give out errors

Перезагрузка сервера позволит решить проблему временно, но все симптомы будут возвращаться через некоторое время. Reboot of the server will resolve the issue temporarily, but you would see all the symptoms come back after a period of time.

Если вы подозреваете, что машина находится в состоянии истощения порта: If you suspect that the machine is in a state of port exhaustion:

Попробуйте сделать исходящие подключения. Try making an outbound connection. На сервере/компьютере можно получить доступ к удаленной совместной информации или попробовать RDP на другом сервере или telnet на сервере в порту. From the server/machine, access a remote share or try an RDP to another server or telnet to a server on a port. Если исходящие подключения не удается для всех этих, перейдите к следующему шагу. If the outbound connection fails for all of these, go to the next step.

Откройте для просмотра событий и в системных журналах и посмотрите события, которые четко указывают текущее состояние: Open event viewer and under the system logs, look for the events which clearly indicate the current state:

а. a. Event ID 4227 Event ID 4227

б. b. ID события 4231 Event ID 4231

Сбор данных netstat -anob output с сервера. Collect a netstat -anob output from the server. Вывод netstat покажет вам огромное количество записей для TIME_WAIT для одного piD. The netstat output will show you a huge number of entries for TIME_WAIT state for a single PID.

После изящного закрытия сеанса или внезапного закрытия сеанса через 4 минуты (по умолчанию) порт, используемый для этого процесса или приложения, будет выпущен обратно в доступный пул. After a graceful closure or an abrupt closure of a session, after a period of 4 minutes (default), the port used the process or application would be released back to the available pool. В течение 4 минут состояние подключения TCP будет TIME_WAIT состояние. During this 4 minutes, the TCP connection state will be TIME_WAIT state. В ситуации, когда вы подозреваете истощение порта, приложение или процесс не смогут освободить все потребляемые порты и останутся в TIME_WAIT состоянии. In a situation where you suspect port exhaustion, an application or process will not be able to release all the ports that it has consumed and will remain in the TIME_WAIT state.

Вы также можете CLOSE_WAIT подключений состояния в одном и том же выходе, однако CLOSE_WAIT состояние — это состояние, когда одна сторона одноранговой сети TCP не имеет больше данных для отправки (fin sent), но может получать данные с другого конца. You may also see CLOSE_WAIT state connections in the same output, however CLOSE_WAIT state is a state when one side of the TCP peer has no more data to send (FIN sent) but is able to receive data from the other end. Это состояние не обязательно указывает на исчерпание порта. This state does not necessarily indicate port exhaustion.

Наличие огромных подключений в TIME_WAIT состоянии не всегда указывает на то, что сервер в настоящее время находится вне портов, если первые две точки не будут проверены. Having huge connections in TIME_WAIT state does not always indicate that the server is currently out of ports unless the first two points are verified. Наличие многких подключений TIME_WAIT указывает на то, что процесс создает большое количество подключений TCP и в конечном итоге может привести к исчерпанию порта. Having lot of TIME_WAIT connections does indicate that the process is creating lot of TCP connections and may eventually lead to port exhaustion.

Netstat был обновлен в Windows 10 с добавлением переключателя -Q, чтобы показать порты, которые перешли из времени ожидания, как в состоянии BOUND. Netstat has been updated in Windows 10 with the addition of the -Q switch to show ports that have transitioned out of time wait as in the BOUND state. Выпущено обновление Windows 8.1 и Windows Server 2012 R2. An update for Windows 8.1 and Windows Server 2012 R2 has been released that contains this functionality. В cmdlet PowerShell Get-NetTCPConnection в Windows 10 также показаны эти порты BOUND. The PowerShell cmdlet Get-NetTCPConnection in Windows 10 also shows these BOUND ports.

До 10/2016 netstat был неточным. Until 10/2016, netstat was inaccurate. Исправления для netstat, от порта до 2012 R2, позволили Netstat.exe и Get-NetTcpConnection правильно сообщать об использовании порта TCP или UDP в Windows Server 2012 R2. Fixes for netstat, back-ported to 2012 R2, allowed Netstat.exe and Get-NetTcpConnection to correctly report TCP or UDP port usage in Windows Server 2012 R2. Дополнительные данные см. в пункте Windows Server 2012 R2: Ephemeral ports hotfixes. See Windows Server 2012 R2: Ephemeral ports hotfixes to learn more.

Откройте командную подсказку в режиме администрирования и запустите приведенную ниже команду Open a command prompt in admin mode and run the below command

Откройте файл server.etl с помощью сетевого монитора и в разделе фильтра применяйте фильтр Wscore_MicrosoftWindowsWinsockAFD.AFD_EVENT_BIND. Status.LENTStatus.Code == 0x209. Open the server.etl file with Network Monitor and in the filter section, apply the filter Wscore_MicrosoftWindowsWinsockAFD.AFD_EVENT_BIND.Status.LENTStatus.Code == 0x209. Вы должны увидеть записи, которые говорят STATUS_TOO_MANY_ADDRESSES. You should see entries which say STATUS_TOO_MANY_ADDRESSES. Если вы не найдете записей, сервер по-прежнему не выходит из портов. If you do not find any entries, then the server is still not out of ports. Если их найти, можно подтвердить, что сервер находится под истощением порта. If you find them, then you can confirm that the server is under port exhaustion.

Устранение неполадок в истощении порта Troubleshoot Port exhaustion

Главное — определить, какой процесс или приложение использует все порты. The key is to identify which process or application is using all the ports. Ниже приведены некоторые средства, которые можно использовать для изоляции одного процесса Below are some of the tools that you can use to isolate to one single process

Метод 1 Method 1

Начните с вывода netstat. Start by looking at the netstat output. Если вы используете Windows 10 или Windows Server 2016, вы можете выполнить команду и проверить для процесса ID, который имеет максимальное количество записей как netstat -anobq BOUND. If you are using Windows 10 or Windows Server 2016, then you can run the command netstat -anobq and check for the process ID which has maximum entries as BOUND. Кроме того, вы также можете запустить команду powershell ниже, чтобы определить процесс: Alternately, you can also run the below Powershell command to identify the process:

Большинство утечек портов вызваны процессами пользовательского режима, которые неправильно закрывают порты, когда произошла ошибка. Most port leaks are caused by user-mode processes not correctly closing the ports when an error was encountered. В портах уровня пользователя (на самом деле розетки) обрабатываются. At the user-mode level ports (actually sockets) are handles. И TaskManager, и ProcessExplorer могут отображать подсчеты обработки, что позволяет определить, какой процесс потребляет все порты. Both TaskManager and ProcessExplorer are able to display handle counts which allows you to identify which process is consuming all of the ports.

Для Windows 7 и Windows Server 2008 R2 можно обновить версию Powershell, чтобы включить вышеуказанное. For Windows 7 and Windows Server 2008 R2, you can update your Powershell version to include the above cmdlet.

Метод 2 Method 2

Если метод 1 не помогает определить процесс (до Windows 10 и Windows Server 2012 R2), то посмотрите на диспетчер задач: If method 1 does not help you identify the process (prior to Windows 10 and Windows Server 2012 R2), then have a look at Task Manager:

Добавьте столбец под названием «ручки» под сведениями и процессами. Add a column called “handles” under details/processes.

Сортировать ручки столбца, чтобы определить процесс с самым большим числом рули. Sort the column handles to identify the process with the highest number of handles. Обычно виновником может быть процесс с ручками более 3000, за исключением таких процессов, как System, lsass.exe, store.exe, sqlsvr.exe. Usually the process with handles greater than 3000 could be the culprit except for processes like System, lsass.exe, store.exe, sqlsvr.exe.

Если какой-либо другой процесс имеет более высокое число, остановите этот процесс, а затем попробуйте войти с помощью учетных данных домена и узнайте, удастся ли ему это сделать. If any other process than these has a higher number, stop that process and then try to login using domain credentials and see if it succeeds.

Метод 3 Method 3

Если диспетчер задач не помог вам определить процесс, используйте Обозреватель процессов для изучения проблемы. If Task Manager did not help you identify the process, then use Process Explorer to investigate the issue.

Действия по использованию проводника процесса: Steps to use Process explorer:

Скачайте Explorer процесса и запустите его с повышенными уровнями. Download Process Explorer and run it Elevated.

Alt + щелкните заглавную колонку, выберите Выберите столбцыи на вкладке Производительность процесса добавьте количество обработок. Alt + click the column header, select Choose Columns, and on the Process Performance tab, add Handle Count.

Выберите Представление Показать нижнюю области. Select View Show Lower Pane.

Выберите Представление Представление нижней области Ручки. Select View Lower Pane View Handles.

Щелкните столбец Ручки для сортировки по этому значению. Click the Handles column to sort by that value.

Изучите процессы с более высоким количеством обрабатываемой обработки, чем остальные (если вы не можете сделать исходящие подключения более 10 000). Examine the processes with higher handle counts than the rest (will likely be over 10,000 if you can’t make outbound connections).

Щелкните, чтобы выделить один из процессов с высоким количеством обработки. Click to highlight one of the processes with a high handle count.

В нижней области окантовки, указанные ниже, являются розетками. In the lower pane, the handles listed as below are sockets. (Sockets — это технически обработки файлов). (Sockets are technically file handles).

Файл DeviceAFD File DeviceAFD

Некоторые из них являются нормальными, но большое число из них не являются (от сотен до тысяч). Some are normal, but large numbers of them are not (hundreds to thousands). Закрой процесс, о чем идет речь. Close the process in question. Если это восстанавливает исходящие подключения, то вы еще раз доказали, что это приложение является причиной. If that restores outbound connectivity, then you have further proven that the app is the cause. Свяжитесь с поставщиком этого приложения. Contact the vendor of that app.

Наконец, если вышеперечисленные методы не помогли изолировать процесс, предлагаем собрать полную свалку памяти машины в состоянии проблемы. Finally, if the above methods did not help you isolate the process, we suggest you collect a complete memory dump of the machine in the issue state. При сбросе будет посвеяно, какой процесс имеет максимальные ручки. The dump will tell you which process has the maximum handles.

В качестве обходного решения перезагрузка компьютера возвращает его в нормальное состояние и поможет вам решить проблему в настоящее время. As a workaround, rebooting the computer will get the it back in normal state and would help you resolve the issue for the time being. Однако при нецелесообразной перезагрузке можно также рассмотреть возможность увеличения количества портов на машине с помощью нижеупомяг. However, when a reboot is impractical, you can also consider increasing the number of ports on the machine using the below commands:

В этом случае динамический диапазон портов будет начинаться в порту 10000 и заканчивается в порте 10999 (1000 портов). This will set the dynamic port range to start at port 10000 and to end at port 10999 (1000 ports). Минимальный диапазон портов, который можно установить, — 255. The minimum range of ports that can be set is 255. Минимальный порт запуска, который можно установить, — 1025. The minimum start port that can be set is 1025. Максимальный конечный порт (в зависимости от настраиваемого диапазона) не может превышать 65535. The maximum end port (based on the range being configured) cannot exceed 65535.

Обратите внимание, что увеличение динамического диапазона портов является не постоянным решением, а временным. Note that increasing the dynamic port range is not a permanent solution but only temporary. Вам потребуется отслеживать, какие процессы и процессоры потребляют максимальное количество портов и устраняют неполадки с точки зрения этого процесса, чтобы понять, почему он потребляет такое большое количество портов. You will need to track down which process/processors are consuming max number of ports and troubleshoot from that process standpoint as to why its consuming such high number of ports.

Для Windows 7 и Windows Server 2008 R2 можно использовать ниже сценарий для сбора вывода netstat с определенной частотой. For Windows 7 and Windows Server 2008 R2, you can use the below script to collect the netstat output at defined frequency. Из выходных данных можно увидеть тенденцию использования порта. From the outputs, you can see the port usage trend.

Полезные ссылки Useful links

Истощение порта и вы! Port Exhaustion and You! — в этой статье приводится подробная информация о состояниях netstat и о том, как можно использовать выход netstat для определения состояния порта — this article gives a detail on netstat states and how you can use netstat output to determine the port status

Обнаружение эфемерного истощенияпорта: в этой статье имеется скрипт, который будет работать в цикле, чтобы сообщить о состоянии порта. Detecting ephemeral port exhaustion: this article has a script which will run in a loop to report the port status. (Применимо для Windows 2012 R2, Windows 8, Windows 10) (Applicable for Windows 2012 R2, Windows 8, Windows 10)

I did a search and found a recent posting on EE here, but there was little information other than running a malware scan: https://www.experts-exchange.com/Networking/Network_Management/Network_Analysis/Q_28273755.html

I also have responded to this same issue over on the Windows 8 forums: http://www.eightforums.com/network-sharing/28502-windows-8-stops-allowing-new-connections-3.html#post306663

Here is the issue: About every 4-6 days I start getting the ‘error 4227’ in my Windows Event log: ‘Warning, TCP/IP, Event 4227: TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint‘.

I can always tell when the issue starts because I can no longer remote into my home computer from work using LogMeIn. After I found this thread, I decided before I did anything else, to close Chrome, and the ~25 tabs I had open at the time. Within just a few moments, all my internet connections, and other network connections started coming back online. I didn’t reboot or anything, I simply closed Chrome and left Chrome closed.

I have been chasing this problem for a while now, trying to narrow down what was using all my TCP/IP ports up. When I would reboot my computer, the first thing I would do was reopen all the windows I previously had open, including all the tabs I was in while using Chrome. I figured this must be when the countdown to all my TCP/IP ports being used up starts, so when I get to 4-6 days in, I start having network/internet port issues. I never realized leaving my internet browser (Chrome) open with several tabs would cause this problem.

Although many of my local network services restored themselves after closing Chrome, it appears my Internet is still not fully functional. It looks like I will still have to either bounce my NIC, or reboot my machine to fully restore functionality. So, although closing Chrome helped, it was not the the only culprit. Something else is still not releasing all my TCP/IP ports.

After I got home I still had to reboot my computer to fully regain Internet connectivity, so all the ports were not released. I still would like to figure out what is doing this, since I run with a ton of stuff open on my work computer, including ~30 open tabs in Chrome, and my computer stays up for a month or more before I reboot it for security updates. My work computer (also Windows 8.1) never has any issues, so the problem on my home computer must be larger than just leaving Chrome open for a few days with a bunch of tabs. My wife’s computer (Windows 8.1) is up for weeks at a time with several things open too, yet she never has the issue of running out of TCP/IP ports either.

In all my research I have also read the problem could be attributed to either a bad NIC card, bad network cable, or a need for upgraded NIC drivers on my current NIC. Anyone want to weigh in on this perspective? I don’t want to go buy a new NIC arbitrarily without having a better idea of what my issue may be.

To summarize, I am running Windows 8.1 Pro, with all the latest Windows updates. This is my gaming rig, but I also have other things running on it like Steam, Mumble, Trillian Pro, Argus Monitor, Moo0 system monitor, eMClient (email), Chrome, Internet Explorer (Work OWA email), Logitech Gaming Software (keyboard and mouse config software).

I have MalwareBytes Pro loaded with ‘real time’ protection running. I have run several FULL system scans on my computer, always coming back clean. I have tried three different versions of NIC drivers for my Broadcom NetLink Gigabit Ethernet adapter, and the problem continues to persist.

My next step is to buy a new Intel NIC and install it to see if that stops my issue, unless there is more info I can provide here to assist with a solid diagnosis.

Thanks in advance for any suggestions or feedback.

Понравилась статья? Поделить с друзьями:
  • Windows error 1812
  • Windows error 1726
  • Windows error 1450
  • Windows error 1326
  • Windows error 1314