[En-Nut-Discussion] detecting an unplugged network cable

Bernd Walter enut at cicely.de
Thu Nov 11 22:36:28 CET 2010


On Thu, Nov 11, 2010 at 06:43:00PM -0200, Thiago A. Corrêa wrote:
> Hi Ulrich,
> 
>    It's probably a bit more than you might want to work on, but I
> believe that a cable disconnect should call from within the driver a
> IP stack function to let the upper layer know that it occurred. The IP
> Stack should then close all connections that are open with that
> interface (in Nut/OS case, that's every socket not in listen mode).
> 
>    At least that's how the PCs behave and what I suspect most ppl expect.

That's the most evil thing you can do.
Ethernut is not for PCs and even there it is evil.
A disconnection is nothing more than a temporary network failure and TCP
connections can recover from network failures.
If my FreeBSD system would drop ssh or X connections just because I
rebooted a switch I would get crazy.
The connections should drop after normal retransmission failure timeouts.
What you observ with some PC OSes has different reasons - the reason is
that they completely deconfigure the IP on such interfaces in the
assumption to get a new one from a new network - I consider this as a
very bad design.
I assume this can be handled much better in that the DHCP is retriggered
and just drop connections if - and only then - the host can't reestablish
the former IP, because if it loose it's IP the connections technically
can't be used anymore.

Ulrich is right that the PHY renegotiates the link and that the MAC
has to be reconfigured to the new negoatian, but I don't consider this
as a major problem unless the new link has different setup and I consider
almost all upstream ports today to be 100M/FDX cpable.

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



More information about the En-Nut-Discussion mailing list