lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Handling link-up/down, netif-up/down events in LwIP


From: Sylvain Rochet
Subject: Re: [lwip-users] Handling link-up/down, netif-up/down events in LwIP
Date: Sat, 7 Jul 2012 13:50:00 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,


On Sat, Jul 07, 2012 at 11:56:45AM +0100, Kieran Mansley wrote:
> 
> They probably wouldn't.  TCP is designed to cope with links coming and 
> going, and will just retransmit if any packets are lost while the link 
> is down for example.  Connections should survive link being removed 
> and restored.

I agree. TCP idle sessions without link between the hosts can live as 
long as no end try to send data. However there is some limitations set 
by equipments doing connections tracking for NAT, stateful firewall, and 
such. Linux connections tracking feature defaults to 5 days idle timeout 
on established session:

net.netfilter.nf_conntrack_tcp_timeout_established = 432000


> I would experiment on Linux or similar to see what happens there, but 
> my guess is that setting the interface down (not quite the same as the 
> link state being down) will result in the route being invalid and 
> you'll get an error such as "host unreachable" or "no route to host".

Yep,

Interface down = administratively down, so voluntarily down
Link state down = carrier lost, unplug media, fiber cut, ...

Linux remove all routes going to an interface switched to 
administratively down:

# ip route show dev tap1
192.168.1.0/24  proto kernel  scope link  src 192.168.1.1 
# ip route add 172.16.0.0/24 via 192.168.1.10
# ip route show dev tap1
172.16.0.0/24 via 192.168.1.10 
192.168.1.0/24  proto kernel  scope link  src 192.168.1.1 
# ip link set down dev tap1
# ip route show dev tap1
# 

Other OSes, like most *BSD ones IIRC, keep the routes in the routing 
table, both approach seem valid for me.


Sylvain

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]