In this blog, you will learn about the First Hop Redundancy Protocol (FHRP). You must know that it is not a specific protocol. However, it consists of 3 main types of protocols that are very important to learn if you want to take the Cisco Certified Network Associate (CCNA 200-301) exam.
The last time the word ‘redundancy’ was considered good was when we learned about the Spanning Tree Protocol (STP) where redundancy is good but it can crash the whole network. On the contrary, the redundancy is good in FHRPs and not as harmful as that of STP.
It is time to move up a layer. The STP was a Layer 2 protocol. However, the FHRPs are a Layer 3 protocol!
For the CCNA 200-301 exam, all you need to know is about the purpose of First Hop Redundancy Protocols! Without any more waiting, let us begin with learning in-depth about the FHRPs!
Note: If you haven’t read the previous blog of our CCNA 200-301 series, I highly recommend you do so.
What is the purpose of the First Hop Redundancy Protocol (FHRP)?
In the intro, I specified a word called ‘redundancy’. Let us shed some light on it!
You must have heard something like “Two is one, one is None.” This stands very true when we talk about networks, especially large business networks. This is very apt in relation to routers where if there are 2 routers working, even if one fails, the other keeps on working. However, if there is just one router and it fails, the whole network is taken down!
So, the redundancy that we talk about in the FHRPs is the router redundancy specifically. It means having a surplus router. In such a case, if the primary connection fails to work, the alternate connection can run the network up until the primary connection is recovered.
This alternate connection could be cheap as well. However, the working of the alternate router is not that simple. This is why!
Consider two networks as shown in the image above. The first network (left image) has a main gateway router which is configured as the default gateway. In such a case, if any of the PCs connected to it wants to send traffic outside the local subnet, they will send it to the default gateway (Router0).
Even if we have a backup router (Router1), the PCs will still not be able to send the traffic to it in case the default gateway crashes down. Why is it so?
It is because Router0 is set as the default router and the network addresses of all the PCs correspond to that of the default router. These PCs will still send all the traffic to the default router even if it crashes down.
So, how does the backup router work?
That is when the First Hop Redundancy Protocol (FHRP) comes into play!
What is Understood By First Hop Redundancy Protocol (FHRP)?
The First Hop Redundancy Protocol (FHRP) is a computer network protocol build to protect the default gateway by allowing two or more routers to backup for that address in a subnetwork. This way the backup router can substitute (take place of) the active router in a few seconds in case of a router crash.
The name ‘first-hop’ refers to the default router which is considered the first hop in a network to which the PCs send the traffic.
How Do the FHRPs Work?
A virtual IP address is commonly shared between the default router and the backup router. All the PCs present in the network can be configured to use that virtual IP address to use as their default gateway instead of the actual IP address of the default router (Router0).
This has to be discussed by the two routers. They do so by sending multi-cast “Hello” messages to each other. The roles that these two routers discuss are:
- One of the routers becomes the active router (router0). The other router becomes the standby router (router1). Therefore, the active router will act as the default gateway for the traffic in a subnet.
- Router1 is the standby router. This means that it will not function until router0 fails.
Let us now understand the working of the FHRPs with the help of an example.
Suppose that one of the PCs such as PC1 present in the network wants to send a request to the Google to ask for some information. To do so and to send the traffic, it needs 4 different addresses:
- Source IP Address (PC1 address)
- Destination IP Address (Google’s IP address)
- Source MAC address (PC1 MAC address)
- Destination MAC address (Virtual MAC)
- To know the virtual MAC address, the PC1 broadcasts the ARP request in the network to know the virtual MAC address. Thanks to the STP protocol, no broadcast storms are formed!
- Since router0 is the active router, it will send a unicast reply to PC1 giving the virtual MAC address to the PC.
- The PC1 then sends its traffic to router0.
What happens if the default router (router0) crashes?
- When the active router or the default gateway crashes down, there is no default gateway in the network.
- After a few seconds, the standby router realizes that it has not received “Hello” messages from the active router.
- In such a case, the standby router becomes the active router.
- It then has to update all the other PCs that it has now become the active router.
- It does so by making all the switches update their MAC address tables.
- The router1 now sends frames with a source MAC address of the virtual MAC address.
- Therefore, it sends ‘gratuitous ARP’ messages that are sent without being requested.
- Since these messages are broadcasted, all switches receive the frame and update their MAC address table.
- Now the switches can reach out to the virtual MAC address.
- Now, the frame will be sent to router 1.
Note: When router0 comes online again and is fixed, it is not considered as the active router anymore. Now, it becomes the standby router.
We have learned about the purpose and functioning of the FHRP protocols. In the upcoming blog, we will learn about the three different types of FHRPs and how they differ from each other.
Stay tuned for more blogs in the CCNA series!