All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] the routing cache and route selection; is this correct?
@ 2002-10-29  3:40 Martin A. Brown
  2002-10-29 10:15 ` Julian Anastasov
  0 siblings, 1 reply; 2+ messages in thread
From: Martin A. Brown @ 2002-10-29  3:40 UTC (permalink / raw)
  To: lartc

Hello all,

I do not read C very well (especially kernel C).  Though I have tried to
muddle my way through an understanding of what's going on in fib_hash.c,
fib_rules.c, and route.c, I have not succeeded to my satisfaction, hence 
my post.

I'm trying to document the general process of route selection, and have
come up with the following overview.  Could somebody point out any flaws
in my understanding of the use of the routing cache during route 
selection and the route selection process?

Starting point:  packet enters the routing stage.

  - Attempt a lookup in the routing cache according to the following:
    + destination address
    + source address
    + type of service (tos)
    + fwmark (fwmark)
    + interface on which packet was received (iif)

  - If a routing cache entry exists, we're done: the route has 
    been selected.

  - If there is no routing cache entry, we continue with route selection
    by consulting the RPDB and routing tables.

    1 start traversing the RPDB at the highest priority
    2 keep traversing the RPDB for the next matching entry
    3 when a match is found, try to find a match for the destination
      in the designated table
    4 if there is no matching route in the specified routing table
      continue to traverse the RPDB (skip back to step 2)
    5 if there is a matching route, the route has been selected

So, my question:

Is the routing cache actually keyed on the above items?  If I understand
Arthur's post of last Friday properly
(http://mailman.ds9a.nl/pipermail/lartc/2002q4/005641.html), he's
suggesting that the keys in the routing cache are src, dest, and tos.

If I understand my empirical evidence properly, and have muddled enough
understanding of fib_rules.c, this statement is accurate, but not complete.

My empirical evidence: I know I'm using fwmark routing on a particular
host, and packets are transmitted out the "correct" interfaces when I
generate traffic for all of the fwmark'd routes.  What confuses me is the
output of "ip route show cache ip.ad.dr.es".  There is no reference
whatsoever to fwmark in this output.

Can somebody confirm (as the evidence suggests) that the routing cache is
keyed on the above five elements?

-Martin

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com






_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LARTC] the routing cache and route selection; is this correct?
  2002-10-29  3:40 [LARTC] the routing cache and route selection; is this correct? Martin A. Brown
@ 2002-10-29 10:15 ` Julian Anastasov
  0 siblings, 0 replies; 2+ messages in thread
From: Julian Anastasov @ 2002-10-29 10:15 UTC (permalink / raw)
  To: lartc


	Hello,

On Mon, 28 Oct 2002, Martin A. Brown wrote:

>   - If there is no routing cache entry, we continue with route selection
>     by consulting the RPDB and routing tables.
>
>     1 start traversing the RPDB at the highest priority
>     2 keep traversing the RPDB for the next matching entry

	Lookup the list with ip rules and match by using the following
keys:

- dest
- src
- tos (optional)
- fwmark (optional)
- iif (optional)

>     3 when a match is found, try to find a match for the destination
>       in the designated table

	In the designated table lookup for routes by using the following
keys:

- dest
- tos
- scope
- oif (optional)

> So, my question:
>
> Is the routing cache actually keyed on the above items?  If I understand
> Arthur's post of last Friday properly

	Yes, you listed the cache keys correctly.

> (http://mailman.ds9a.nl/pipermail/lartc/2002q4/005641.html), he's
> suggesting that the keys in the routing cache are src, dest, and tos.

> My empirical evidence: I know I'm using fwmark routing on a particular
> host, and packets are transmitted out the "correct" interfaces when I
> generate traffic for all of the fwmark'd routes.  What confuses me is the
> output of "ip route show cache ip.ad.dr.es".  There is no reference
> whatsoever to fwmark in this output.

	May be for compatibility reasons the fwmark is not
listed in the route cache entries.

> Can somebody confirm (as the evidence suggests) that the routing cache is
> keyed on the above five elements?

	Yes, this is my understanding reading the sources

> -Martin

Regards

--
Julian Anastasov <ja@ssi.bg>

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-29 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-29  3:40 [LARTC] the routing cache and route selection; is this correct? Martin A. Brown
2002-10-29 10:15 ` Julian Anastasov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.