From: Hasso Tepper <hasso@estpak.ee>
To: netdev@oss.sgi.com
Subject: Link detection
Date: Mon, 14 Mar 2005 14:35:38 +0200 [thread overview]
Message-ID: <200503141435.38227.hasso@estpak.ee> (raw)
We (the Quagga project) are planning to rework link detection in Quagga to
support more platforms (only Linux and Solaris are supported at the moment)
and to have proper abstraction of link detection in zebra daemon. During
discussions several questions were raised.
1) What's the proper way to detect carrier in Linux for user space
application like Quagga?
Till now I thought that IFF_RUNNING flag should be used for that. But some
time ago I tried to bug Stephen Hemminger about missing IFF_RUNNING flag in
ip output and got answer that IFF_RUNNING is BSD'ism and shouldn't be used
any more and /sys/class/net/eth0/carrier should be looked at.
True, IFF_RUNNING is from BSD, but as long as the code in
net/core/dev.c:dev_get_flags() is there, it gives nice clean way to get
carrier status from user space (AFAIK it's used in same way in Solaris).
Especially for applications using rtnetlink - ie. without it there is no
all info in the netlink message any more. If these applications will
receive RTM_NEWLINK, they have to poll kernel "look, maybe carrier status
is changed" every time?
2) There is no difference between "we know that carrier is really on" and
"interface doesn't support carrier detection" in Linux.
>From users' point of view it might make huge difference - can I rely on info
I get from OS, or have to run to the equipment to see whether links are
really up or not? It's not critical, but would be still nice to have.
3) Connected routes in carrier down situations. If address are added to the
interface, "connected" route is added to the interface as well. Problem is
that this route is still there if carrier is down, but there is no
difference for user if just carrier is down or interface is
administratively down - network behind this interface is still actually
unreachable.
It's not only the issue related with routing protocols, but the general one.
I'm using laptop with two interfaces - ethernet and wireless. If I plug off
ethernet cable and walk away from my desk, the network on this ethernet
segment should be still reachable for me via wireless (default route), but
no ... I have to shut down ethernet interface manually.
There are several scenarios which are affected - building redundant
firewalls/gateways, computers/equipment with backup links etc. And of
course routers. We take care of this in Quagga not to take nexthops in down
network into account, but it doesn't matter if destination of actual
traffic is this particular network on interface which is actually down.
Before someone proposes that - yes, managing these routes can be done from
user space in theory (like zebra daemon), but there are several problems
regarding this.
* Managing connected routes from user space might leave network in
inconsistent state. You can't create routes with protocol kernel with ip
utility, so kernel will not remove these routes if address is really
deleted from interface.
* There are several applications which would be interested in this, but it
would be dangerous imho if several applications at once will manage
connected routes in kernel.
And I don't see any actual reason not to manage removal/adding connected
routes in kernel level if link goes down/up. Or is there any? Why would
anyone need route to the interface if it's actually known to be unusable?
with my best wishes,
--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
next reply other threads:[~2005-03-14 12:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-14 12:35 Hasso Tepper [this message]
2005-03-14 13:32 ` Link detection Thomas Graf
2005-03-14 14:05 ` Hasso Tepper
2005-03-14 14:57 ` Thomas Graf
2005-03-14 18:41 ` Hasso Tepper
2005-03-14 14:41 ` Hasso Tepper
2005-03-14 15:03 ` Thomas Graf
2005-03-14 16:54 ` Thomas Graf
2005-03-14 16:16 ` [PATCH] ip link should print NO-CARRIER for !IFF_RUNNING && IFF_UP Thomas Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200503141435.38227.hasso@estpak.ee \
--to=hasso@estpak.ee \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).