Active Directory close LDAP connections with [RST, ACK] instead of [FIN, ACK]

LDAP Connect/disconnect from Client 192.168.0.121 to Domain Controller 192.168.0.121, WireShark on DC:

WireShark on the client:

Via a proxy, WireShark on the client side:

6 Responses to Active Directory close LDAP connections with [RST, ACK] instead of [FIN, ACK]

  1. dmitriano says:

    Why does Active Directory close LDAP connections with [RST, ACK] instead of [FIN, ACK]?
    https://stackoverflow.com/questions/56194847/why-does-active-directory-close-ldap-connections-with-rst-ack-instead-of-fin

  2. dmitriano says:

    Когда TCP-сокеты отказываются умирать
    https://habr.com/ru/articles/700470/

  3. dmitriano says:

    .NET при создании LdapConnection открывает UDP-сокет на loopback (127.0.0.1).
    Этот сокет используется внутренне библиотекой, в частности:

    для реализации обработки Abandon / Cancel операций;

    для внутреннего пробуждения потоков, ожидающих событий из сетевого стека (так называемый “wakeup socket” или “select trick”);

    иногда для поддержки асинхронных уведомлений от сервера (LDAPv3 Controls).

  4. dmitriano says:

    Опция SO_LINGER ― это настройка сокета в ядре ОС, Wireshark её не может показать напрямую, потому что она не передаётся по сети.
    Но её эффект можно распознать по характеру завершения TCP-соединения:

    Если SO_LINGER включён с таймаутом = 0
    При close() приложение сразу рвёт соединение.
    В захвате увидишь RST вместо обычного завершения по FIN.

  5. dmitriano says:

    When to use SO_LINGER with timeout 0
    https://stackoverflow.com/questions/3757289/when-is-tcp-option-so-linger-0-required
    Again, according to “UNIX Network Programming” third edition page 202-203, setting SO_LINGER with timeout 0 prior to calling close() will cause the normal termination sequence not to be initiated.
    Instead, the peer setting this option and calling close() will send a RST (connection reset) which indicates an error condition and this is how it will be perceived at the other end. You will typically see errors like “Connection reset by peer”.
    Therefore, in the normal situation it is a really bad idea to set SO_LINGER with timeout 0 prior to calling close() – from now on called abortive close – in a server application.

Leave a Reply

Your email address will not be published. Required fields are marked *