Re: Detecting Closed COnnections

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks. The RTO throws some light on the problem I am having.
I think I have to build a workaround for that.

"Alan J. McFarlane" <alanjmcf@xxxxxxxxxxxxxxxxx> wrote in message
news:428b1fc6$0$562$ed2619ec@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> In article news:ewhz11iWFHA.3488@xxxxxxxxxxxxxxxxxxxx, SRLoka wrote:
>> I have a TCP server to which some third party mobile devices send
>> periodic data and I respond with just a simple 2 byte ack. This is
>> written in C#. Occasionally(very rarely - once a month may be), I
>> send data(50 to 100 bytes - some config commands) to these devices on
>> the same connection. If a device disconnects(the connection could be
>> terminated by cellular coverage loss or device powering down etc),
>> how can I detect that socket has been disconnected ?
>> If I send any bytes to a device that has been powered down(my test
>> device), the Socket Send does NOT fail or thow an exception. I am not
>> sure if this is a C# /.Net problem or a general problem with Sockets.
>
> When TCP gets no response from a peer during a connection, it will retry a
> number of times; this is by default five times in Windows. If it still
> gets no response it will then abort the connection. A Winsock programmer
> will get an error the next time send, recv etc is called. I don't know
> that .Net does...
>
> Note that the time to fails depends on the round-trip time that the
> connection is experiencing, the retries are send at exponentially
> increasing intervals. If the RTO (retransmission timeout) is calculated
> to be 5 seconds then retries will be send at 5, 10, 20, 40, 80, and the
> after a further 160 seconds it will fail, so the total retry time is 5
> minutes 15 seconds (315 seconds).
>
>> Should I set the SO_SNDBUF to zero and the TCP_NODELAY (I havent't
>> figured out those in C# yet) ? Is it OK to do this for such an app ?
>>
> No.
> --
> Alan J. McFarlane
> http://www.alanjmcf.me.uk/
> Please follow-up in the newsgroup for the benefit of all.
>


.



Relevant Pages

  • [Full-disclosure] Cisco PIX TCP Connection Prevention
    ... Cisco PIX TCP ... Connection Prevention, posted on November 22, 2005. ... By sending a TCP SYN packet with an incorrect checksum through a PIX ...
    (Full-Disclosure)
  • [Full-disclosure] Cisco PIX TCP Connection Prevention
    ... Cisco PIX TCP ... Connection Prevention, posted on November 22, 2005. ... By sending a TCP SYN packet with an incorrect checksum through a PIX ...
    (Full-Disclosure)
  • [NEWS] Cisco PIX TCP Connection DoS
    ... Get your security news from a reliable source. ... By crafting a special TCP packet and sending it to a vulnerable Cisco PIX, ... embryonic connection open until the embryonic connection timeout which is ...
    (Securiteam)
  • FreeBSD Security Advisory FreeBSD-SA-01:39.tcp-isn
    ... TCP network connections use an initial sequence number as part of the ... incoming connection is being established, ... Systems running insecure protocols which blindly trust a TCP ... requiring other authentication of the originator are vulnerable to ...
    (FreeBSD-Security)
  • Re: Firewall vs. IPS - Differences now (ISS, Intrushield 2.1?)
    ... If we expire a connection too early, ... The way we solved this at NFR is to never expire idle TCP states. ... For example the timeout for the SYN|ACK may have been ...
    (Focus-IDS)