Load balancing and "default gateway" - Unix
This is a discussion on Load balancing and "default gateway" - Unix ; As far as I know, one of the main ideas behind Internet was the
independent routing of each packet in an error-prone and non-
centralized network. I.e. packages should be able to take different
paths even for the same stream ...
-
Load balancing and "default gateway"
As far as I know, one of the main ideas behind Internet was the
independent routing of each packet in an error-prone and non-
centralized network. I.e. packages should be able to take different
paths even for the same stream (TCP).
What bothers me is the concept of a "default gateway" that you're
supposed to fill in for most hosts (Linux and Windows). Why is a
"default gateway" even needed?
A closely related question is "load balancing". The increasing number
of wide open private home WLAN gateways makes it possible to observe
the fact that different ISP certainly have different abilities to
route to remote networks (i.e. networks not directly adjacent to the
ISP back-bone).
So to my main questions: Would it be possible to set up hosts (or
small LANs) so that one has more than one "default gateways", where
each gateway connects to a different ISP. How would one set such a
host (or LAN) up in practical terms?
QNX I believe used to have a feature called "network load balancing"
which I think was to address this particular networking issue. Is this
common among OS:es and/or does it require special kernel hacks or
routing daemons?
Suppose the hosts are mobile, but you still want both multiple NIC:s
connecting to networks as you pass through the reach of a whole region
of friendly private network owners, would it still work and would it
make the total reliability/reachability of the moving host better?
Regards
/Michael
-
Re: Load balancing and "default gateway"
In article <1192215913.011866.159970@z24g2000prh.googlegroups. com>,
aprak.ofatys@gmail.com wrote:
> As far as I know, one of the main ideas behind Internet was the
> independent routing of each packet in an error-prone and non-
> centralized network. I.e. packages should be able to take different
> paths even for the same stream (TCP).
>
> What bothers me is the concept of a "default gateway" that you're
> supposed to fill in for most hosts (Linux and Windows). Why is a
> "default gateway" even needed?
Because the alternative is requiring every host to participate in a
routing protocol to learn all the routers. This is considered to be an
excessive requirement for leaf nodes, many of which are very simple
devices (e.g. the proverbial Internet-enabled toaster). Since most leaf
networks only have one connection to the main Internet, the default
gateway model works very well in practice.
>
> A closely related question is "load balancing". The increasing number
> of wide open private home WLAN gateways makes it possible to observe
> the fact that different ISP certainly have different abilities to
> route to remote networks (i.e. networks not directly adjacent to the
> ISP back-bone).
>
> So to my main questions: Would it be possible to set up hosts (or
> small LANs) so that one has more than one "default gateways", where
> each gateway connects to a different ISP. How would one set such a
> host (or LAN) up in practical terms?
Many operating systems allow multiple default gateways to be configured,
although often *not* through the normal GUI. You may need to use CLI
tools, such as the "route add" command on Unix variants.
However, if the routers are doing NAT, you need to ensure that load
balancing only takes place at the connection level, not the packet
level. If it operates at the packet level, packets that are part of the
same connection may go out through different gateways, and get NATted to
different outside addresses. The remote system won't recognize these as
being part of the same connection, because the source address is used to
match against the TCB.
>
> QNX I believe used to have a feature called "network load balancing"
> which I think was to address this particular networking issue. Is this
> common among OS:es and/or does it require special kernel hacks or
> routing daemons?
>
> Suppose the hosts are mobile, but you still want both multiple NIC:s
> connecting to networks as you pass through the reach of a whole region
> of friendly private network owners, would it still work and would it
> make the total reliability/reachability of the moving host better?
>
> Regards
> /Michael
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
-
Re: Load balancing and "default gateway"
>As far as I know, one of the main ideas behind Internet was the
>independent routing of each packet in an error-prone and non-
>centralized network. I.e. packages should be able to take different
>paths even for the same stream (TCP).
>
>What bothers me is the concept of a "default gateway" that you're
>supposed to fill in for most hosts (Linux and Windows). Why is a
>"default gateway" even needed?
If I have a packet that goes to an IP address that is not directly
connected (it's not within the netblock/subnet mask for any interface),
where should it go? Not every system can do routing protocols, and
most ISPs won't LET you participate in routing protocols (where
stupidity or malicious intent can cause serious problems if you
advertise a cheap route to someplace you're not connected to. One of
the worst examples would be advertising a cheap link between two ISPs
that actually has very low bandwidth).
>A closely related question is "load balancing". The increasing number
>of wide open private home WLAN gateways makes it possible to observe
>the fact that different ISP certainly have different abilities to
>route to remote networks (i.e. networks not directly adjacent to the
>ISP back-bone).
>So to my main questions: Would it be possible to set up hosts (or
>small LANs) so that one has more than one "default gateways", where
>each gateway connects to a different ISP. How would one set such a
>host (or LAN) up in practical terms?
This kind of alternate routing requires participation from both
ISPs involved. You sent a packet to me, some web site on the public
internet. Which ISP should the reply be sent to? You might be
able to load-balance the stuff going OUT, but you can't load-balance
the stuff coming IN without an IP block that is independently
routable, and cooperation from the ISPs you are connected to.
Oh, yes, it is likely that if you have IP block A from ISP A, and
IP block B from ISP B, that if you send a packet to ISP A with a
return address from block B, that ISP A is going to drop it. An
ISP will likely prevent you from "forging" traffic from an IP it
doesn't think you own.
It *is* possible to do half-assed approach, using something like
FreeBSD's ipfw: each local host that needs to talk outside has two
IP addresses, one from each ISP. If a packet going to the world
has a FROM IP address that belongs to ISP A, send it out the link
to ISP A. If it's got the address that belongs to ISP B, send it
out the link to ISP B.
Incoming connections from outside (e.g. to your web server) stay
on the connection they came in on. (You might try DNS round-robin
for load-balancing). If the link to ISP B breaks, all those URLS
involving ISP B's IP blocks break, but those for A keep working.
You can select which ISP an OUTGOING connection uses by selecting
which local IP address to use for the connection. Unfortunately,
most network programs (e.g web browsers) don't let you do that.
>QNX I believe used to have a feature called "network load balancing"
>which I think was to address this particular networking issue. Is this
>common among OS:es and/or does it require special kernel hacks or
>routing daemons?
The big problem is that it requires the cooperation of your ISP to
have real load balancing, unless you're talking about load-balancing
the five OC-12 links going between the north end and the south end
of your own house.
>Suppose the hosts are mobile, but you still want both multiple NIC:s
>connecting to networks as you pass through the reach of a whole region
>of friendly private network owners, would it still work and would it
>make the total reliability/reachability of the moving host better?
For Wi-Fi within an office, I've found that a single IP, a single
wireless NIC, and many access points with the *SAME* SSID connected
on the same wire but distributed throughout the building works
pretty well. Your wireless card switches between access points without
needing to change IP.