Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Mar 2001 08:52:13 -0700
From:      Wes Peters <wes@softweyr.com>
To:        Nick Rogness <nick@rogness.net>
Cc:        Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>, freebsd-net@FreeBSD.ORG
Subject:   Re: same interface Route Cache
Message-ID:  <3AB3882D.5EAC34@softweyr.com>
References:  <Pine.BSF.4.21.0103160904310.9691-100000@cody.jharris.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Nick Rogness wrote:
> 
> On Fri, 16 Mar 2001, Jeroen Ruigrok/Asmodai wrote:
> 
> > -On [20010310 04:00], Nick Rogness (nick@rogness.net) wrote:
> > >
> > >Is anyone working on route caching functionality within FreeBSD?  This
> > >would eliminate a lot of problems with using FreeBSD as a router...which
> > >seems to be a common role of which FreeBSD seems to fit.  Especially for
> > >machine that are dual-homed.
> >
> > Correct me if wrong, but if I recall BSD natively already held a route
> > cache, although it might not be the best route cache which we could come
> > up with.
> 
>         Well, I'm sure it does have some route cache functionality but not
>         what is considered to be useful.
> 
>         I'll clarify real quick for people who are asking 'why?'.  Bare
>         with me.  As a packet comes in one interface, there should be a
>         way when the packet comes back out to be sent out that same
>         interface it was received on, regardless of what the default route
>         says.

You seem to have a deep misunderstanding of how the routing table works.
The ingress interface has nothing to do with which interface the packet
will egress on.  The packet is received, checked against a list of local
addresses, and delivered upstream if a match is found.  If a match is not
found, the forwarding variable is checked.  If forwarding is off, the packet
is dropped.  If forwarding is one, the packet is delivered to ip_output.

At this point, the packet is routed in exactly the same manner as a packet
coming from the local host - a destination for it is found via the routing
table (or short-circuited via the single-entry route cache if it is destined
for the same IP address as the last packet that was routed) and sent out the
proper interface.

The default route is used ONLY if there is no better route that can be found.

If the packet is sent back out the same interface it arrived on, the system
will generate an ICMP redirect message instructing the source to send packets
for this destination directly to OUR idea of the proper router for them, in
order to save on redundant traffic.

>         For dual-homed hosts, this is a problem because your packet gets
>         sent out the default gateway, which may or may not get filtered
>         upstream.  This is usually solved by running a routing deamon but
>         most upstreams won't allow you to do that anyway (cable,dsl,etc).

If you have a dual-homed host that is simply routing an internal LAN to 
the external network, you don't need anything other than a default route.
If it's not bound for the internal network, it goes to the external 
network, by definition.

I completely fail to see that you have actually stated a problem yet.

What exactly is the problem you think you're trying to solve here?

-- 
            "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                         Softweyr LLC
wes@softweyr.com                                           http://softweyr.com/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AB3882D.5EAC34>