[En-Nut-Discussion] media sense/cable detect

Theodore A. Roth troth at openavr.org
Wed Sep 17 21:51:18 CEST 2003


On Wed, 17 Sep 2003, Austin Schutz wrote:

> On Wed, Sep 17, 2003 at 09:56:53AM +0200, Harald Kipp wrote:
> > Hi Damian,
> >
> >
> > >has anyone looked at media sense to detect if the cable is unplugged, like
> > >Windows2000/XP?
> > >
> > >When the cable is unplugged all TCP connections can be flaged as closed.
> >
> > Does Windows do this?
> >
> > TCP rules define, that a connection should _not_ be closed on lower
> > level problems. The application may close the connection on
> > transmit failures.
> >
> > If one node is receiving and the remote is switched off, the
> > receiver will never detect the loss. It may use a socket timeout
> > (supported by Nut/Net) or set the KEEPALIVE option (not supported
> > by Nut/Net).
> >
> > Beside that, it would still make a lot of sense to detect a link
> > loss, but I never tried. Anyone else?
> >
>
> 	If the link is down it should flag packets going to that interface
> with an icmp network unreachable, or something like that. The received icmp
> should be interpreted by the device as being a good reason to close the
> connection. Or something like that. I'm not _that_ familiar with the
> exact method.

There's an excellant discussion of this in the Introduction section of
chapter 23 ("TCP Keepalive Timer") in Stevens "TCP Illustrated Vol 1."

Is it possible to tell the difference between the cable being
disconnected and the hub/switch/router losing power temporarily?

Ted Roth



More information about the En-Nut-Discussion mailing list