Mailing List Archive

Re: [quagga-users 2166] Inserting src in routes and/or changing tables
Paul wrote:

> Is it possible to have a src inserted into the routes received by
> zebra from bgpd/ripd/etc?
[...]

Seems that what you're asking for is very very Linux specific, isn't it?
Well, in this case I can recommend that

#1, either you patch your sources in some ad-hoc manner, so as to allow
you add a source attribute to netlink messages; I've done that at least
for one case (I had to insert explicit connected routes into the
kernel), it's basically quite an easy fix to
zebra/rt_netlink.c/netlink_route_multipath(). However, if you also need
to code a more flexible framework to define dynamic policy for such
source attributes, then it may take more design and coding (VTY, RIB, etc.)

#2, as for the multiple routing table question -- I've once posted a
preliminary patch that allows associating routes of daemon X with Linux
forwarding table Y; you should look through zebra's archives, because
there's no way I can restore it locally... ;-) But anyway, that was a
heavy-weigth, Linux-specific piece of code, and definitely nothing I
would apply to a package that claims platform independence, standard
compliance, or the like. Note that this approach suffers from some
serious conceptual flaws, and if you are considering multi-context
routing seriously, then I would recommend that you promote VRFs in
zebra/quagga (then again, a long discussed issue, but nothing practical
so far ;-) )

HTH, good luck!
Gilad
Re: [quagga-users 2166] Inserting src in routes and/or changing tables [ In reply to ]
On Wed, 9 Jun 2004, Paul wrote:

> Is it possible to have a src inserted into the routes received by
> zebra from bgpd/ripd/etc? for instance, a route shows

Not at moment.

> 1.1.1.0/24 via 1.2.3.4 dev c1 proto zebra metrix 0 equalize

> now i want it to show

> 1.1.1.0/24 via 1.2.3.4 dev c1 proto zebra metrix 0 equalize src 5.6.7.8

> and/or be able to drop it into a certain routing table say , if it
> originates from BGPD we put it in table 5 and set the src to
> 5.6.7.8 if it originates from ripd we put it in table 10 and src is
> 6.7.8.9

> This is something that we would really like to do but I don't see
> any way of doing it.

There isnt at moment.

Ability to specify src for static routes would be relatively easy to
add. For daemon routes it would require the ZSERV protocol to be
extended to handle passing a source. It would also require extending
each daemon to be able to store desired source routes in their RIB.
(which sounds like an argument for a unified 'rib' object to be used
by all daemons to store routes to me.).

The table command.. hmmm.. that's a trickier one. I'm not even sure I
understand the issues either.

> Thanks
>
> Paul

regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
warning: do not ever send email to spam@dishone.st
Fortune:
scribline, n.:
The blank area on the back of credit cards where one's signature goes.
-- "Sniglets", Rich Hall & Friends
Re: [quagga-users 2166] Inserting src in routes and/or changing tables [ In reply to ]
On Fri, 11 Jun 2004, Gilad Arnold wrote:

> considering multi-context routing seriously, then I would recommend
> that you promote VRFs in zebra/quagga (then again, a long discussed
> issue, but nothing practical so far ;-) )

Hmm.. "why cant i use linux route tables" is a regular question. I
dont really remember the issues, but iirc, the main one was that in
concept we should strive for VRF support, not table support, as
former will (presumably) be the more portable concept.

What conceptual problems would there be with equating VRF contexts
with a linux routing table?

I know linux routing tables arent quite as seperated as we'd like for
VRF contexts, and AIUI (iirc) one of the big problems would be fact
that some tables are special and we always read them in zebra. Even
if it were not perfect and had limitations, to be able to say 'bgpd
routes are vrf X' and treat X as table X might be useful to a lot of
people.

I dont think I understand the issues fully though.

> HTH, good luck!
> Gilad

regards,
--
Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A
warning: do not ever send email to spam@dishone.st
Fortune:
Familiarity breeds attempt.
Re: [quagga-users 2166] Inserting src in routes and/or changing tables [ In reply to ]
(Apologies for late response...)

Paul Jakma wrote:

> What conceptual problems would there be with equating VRF contexts with
> a linux routing table?
>
> I know linux routing tables arent quite as seperated as we'd like for
> VRF contexts, and AIUI (iirc) one of the big problems would be fact that
> some tables are special and we always read them in zebra. Even if it
> were not perfect and had limitations, to be able to say 'bgpd routes are
> vrf X' and treat X as table X might be useful to a lot of people.

There is a conceptual flaw with implementing VRFs via linux tables,
mainly becuase they aren't isomorphic -- few things that come to mind:

#1, you can't guarantee disjoint splitting of your interface resources
to routing contexts, forwarding-wise, because you don't control linux
rules (and I don't really thing you want to).

#2, you can't beat the kernel's default behavior of having connected
routes (kernel connected routes, that is) within the main table, as well
as not being able to block that table from global access (because kernel
must have those routes in order to validate nexthops). So you can't
really guarantee separation of VRF contexts.

#3, you can't bind application layer sockets to linux tables -- this
means that, even if you have an instance of some application (be it even
a thread in your bgpd) that is "bound" to some VRF context, you can't
bind its TCP sockets to that VRF, and so your self-originated packets
are routed uniformly.

(Obviously, the fact that linux tables are linux-specific doesn't make
much contribution to this stand either...)

But then again, in some specific setup, when you are sure that (1) you
are running linux and zebra is the sole maintainer of kernel
address/rules/routes, (2) you don't really care for strict separation of
routing contexts, and (3) you can live with self-originated packets not
bound to VRFs, then it can be done with tables and rules.. (i.e. have
done that ;-) ). I would definitely not promote that as anything to be
integrated into the open-source zebra/quagga.

On the other, I know of some well-established (or at least,
long-existing) implementations of VRF for linux (e.g. linux-vrf,
maintained by Jim Leu, IIRC). I'm not saying that modifying quagga based
on the assumption that linux-vrf will finally make it into official
kernel code is promised to be fruitful, but in the lack of other
implementations on the one hand, and in the emerging need for such
functionality in the domain of open-source routing packages, this could
be a nice collaboration. (Your thoughts? ;-) )

Gilad