Fault tolerance in gateways (Cisco)
Translation of the original in Catalan. Read it in: CatalàCastellano
I was reading the book for the CISCO CCIE certification and I have found a chapter that talked about fault tolerance in the LAN gateways. Apart from the typical Cisco proprietary protocols to solve this problem with their products I have also found a couple of quite interesting techniques. Neither of the two is the 'panacea' but they can be very useful when we have to solve this problem, for example, in companies with few resources and where we can't put a Linux acting as the main gateway of the LAN, or some other similar device.
Introduction
When configuring a device inside a TCP/IP LAN you have to set the IP of the device, the network mask and the gateway (the gateway towards the outside of the LAN). Well, what happens if the WAN link of the gateway goes down, obviously no matter how many other points there are in the LAN to get out of it, if we don't change the gateway on each device of the network it won't be able to get out through the new gateway.
Maybe you don't know why this happens nor will I explain it in this article, but I can tell you that it has to do with the ARP protocol and how access to IP addresses inside a LAN works. So, you can look at any basic networking manual and you'll understand the reason why you have to know the gateway. A place where you can look is in the CCNA syllabus, for example.
Objective
So the objective of the article is to explain how with no extra resource, I can configure these two (or more) routers and/or these devices of the LAN so that when one of these WAN accesses goes down the devices of the LAN use the other gateway without having to change the network configurations on each of them. I suppose that for more than one person this subject will have made their head boil more than once.
Techniques to solve the problem
The techniques I'll explain here aren't mine, since on this subject there are people who have been racking their brains for many more years than me. So the only thing I'll try to do is to explain the two techniques that the CCIE book explains to solve this situation (gateway going down) and I'll refer to a 3rd technique proprietary to the CISCO devices.
-ICMP Redirects: we take advantage of the ICMP Redirect messages to redirect the traffic.
-ProxyARP: we take advantage of the ProxyARP functions of the routers to redirect the traffic.
-HSRP (Hot Standby Routing Protocol): this is the best technique of the 3, of course, but it is a proprietary CISCO protocol that leaves one of the LAN routers active and the other or others routers stay in standby waiting for the main one to go down to come into operation, taking over its IP address and its MAC address so that the clients don't notice that they aren't accessing the same device as before. If you have to use this Cisco technique I recommend that you look at the manual since it is very easy to implement and in a few minutes you'll have mastered it.
ICMP Redirect
The ICMP (Internet Control Message Protocol) messages are used to capture and test errors in TCP/IP networks, but specifically there is one of the ICMP messages that can serve us to implement fault tolerance, the "ICMP Redirect" since this message informs the sender of a packet for which the destination isn't found which other gateway it has to try in order to reach the destination it was looking for.
In order to get the routers, that can't route a packet, to inform which is the other gateway to try, a routing protocol has to be enabled. What does that mean in a few words, that for example if we enable the RIP protocol on the routers with an Internet exit of our LAN. When the internet link of one of them fails it will return an ICMP Redirect packet informing us which is the other gateway we can use. So, our device (e.g. PC) will automatically re-send the packet to the other router. In this example, you only have to set the IP of one of the routers as the gateway, whichever we want, when this gateway fails thanks to RIP we'll automatically jump to the other router.
Advantages of the system
-
The failure support is fast, but not instantaneous. A few packets can be lost while the switch is made.
-
Almost all routers, no matter how bad they are, support it.
-
It's very easy to understand and to implement.
Disadvantages of the system
-
A lot of ICMP traffic on the network until the normal situation is restored.
-
Many static routes are created on the clients, because at no moment is the default route changed. Instead, static host routes are created with a gateway different from the default route.
-
When the normal situation is restored, the static routes of the clients take a long while to be removed or they never are if the new static route doesn't fail and a new ICMP Redirect forces the new change.
Proxy ARP
An important point to understand this technique is to know the operation of the Proxy ARP. To not go on too long in the explanation we will define a Proxy ARP as an intermediate device between two devices that want to communicate. This 3rd device answers with the MAC address of the second device since the first one has no physical access to the second. As a curiosity I'd add that this idea was developed to solve the problems of networks connected through telephone accesses (Dial-up LAN connections).
In order to apply the Proxy ARP technique in fault tolerance what we have to do is configure the devices of the LAN with their own IP as the IP of the gateway. For example, IP of the host: 10.1.1.1 and gateway of the host 10.1.1.1. Now on the routers of the LAN we enable the proxyARP function (if they support it, of course). This way when some client makes a request to an IP (ARP request) that isn't from the LAN, the routers will answer saying that they can access that IP and will inform of their MAC, so that the device of the LAN can send the packet there.
You will always access the router that has answered first and therefore the one whose answer the client device receives first. This way we also manage to do a load 'balancing', or rather, a random access to the different routers of the LAN. In case any of the WAN links of the routers went down it would obviously stop answering with its proxyARP and this way we'd be sending all the traffic to the router(s) that still has (have) access to the WAN.
Advantages of the system
-
Very simple to implement.
-
The devices don't depend on the IP of the gateway.
-
Load balancing, inherent to the idea.
Disadvantages of the system
-
There can be delays of up to 10min until a device knows that a WAN link has gone down. Because you have to wait for the MAC tables of the ARP protocol to be refreshed.
-
A large amount of broadcast traffic in the segment, due to the many ARP packets that are sent.
-
Not all routers support the proxyARP function.
Conclusions
Neither of the two techniques is anything out of this world, nor will it solve our lives. But if we have networks where there is no administrator to be able to manually do the gateway switching in case of failure and besides the company doesn't want to spend a single penny on putting in a device that does that automatically. These two solutions can help us avoid more than one trip to these companies. A type of company that our experience tells us there are not few of.
Obviously if we have Cisco routers don't waste your time: use HSRP. In spite of being a proprietary protocol, which is always bad, the results are excellent and if we've spent the cash on a Cisco at least we take advantage of the good things they have.
1 comment
Comments from the old blog, as they were written. Comments are closed.
bu
Y quien no use Ciscos, está la versión del ietf, que no es
propietario, y está implementado bajo Linux, y funciona y todo, el vrrp
(virtual routing redundancy protocol)
Lo malo de vrrp es que solo es válido para redes ethernet (con token
como que no va muy bien).
Lo bueno que tiene, todo lo que tiene hsrp y cositas nuevas, como que las
interficies que participan del vrrp (secundary) responden a los pings.