How do we implement EIGRP, OSPF, and RIP routing protocols?

In computer networks, routing protocols act like traffic controllers, efficiently guiding data packets to their destinations. These protocols are essential for ensuring smooth communication between devices within a network.

Routing protocol

Think of a routing protocol as a set of rules that routers (devices that direct traffic in a network) follow to find the best paths for data to travel from one place to another. These rules help routers share information about the network and decide the fastest and safest data route to reach its destination.

Importance of routing protocols

Routing protocols are crucial because they automate finding and updating the best paths for data transmission in a network. Instead of manually configuring each router with static routes (which would be impractical in large or changing networks), routing protocols allow routers to adapt to changes in the network, like new devices being added or links going down.

Types of routing protocols

Let’s look into the types of routing protocols and how to implement them in a computer network topology. First, let’s design a simple computer network:

A simple computer network
A simple computer network

The above network has three hosts with their respective IP addresses. On this topology, we will implement each routing protocol one by one.

Routing Information Protocol (RIP)

Routing Information Protocol (RIP) counts how many “hops” or routers data packets must pass through to reach their destination. They share routing updates with neighboring routers, but this method can sometimes take longer to find the best route and can use more network resources. We perform the following steps to configure this protocol on our network topology.

First, we will check all the networks connected to our respective routers. For example, if we are configuring for host A, we have host B (IP address 1.0.0.1/8) and host C (IP address 2.0.0.1/) attached. To view the network addresses of the routers attached to our router, run the following command on host A’s CLI:

show ip routes
CLI command to view the networks connected to our router.

This command will show us the following result:

Result of the "show ip route" command on host A
Result of the "show ip route" command on host A

We now know the network addresses of all the networks connected to host A. This makes it easier to configure a routing protocol.

Next, we’ll start the routing process. Now that we know the networks connected to host A, we can use the following commands to configure RIP on host A.

1. config terminal
2. router rip
3. version 2
4. network 1.0.0.0
5. network 2.0.0.0
6. end
Commands to run in CLI tab of router configuration for Host A.

The explanation for each command is as follows:

  • Line 1: This command enters global configuration mode, which allows us to configure global parameters for the router.

  • Line 2: This command enters RIP configuration mode, where we can configure parameters specific to the RIP routing process.

  • Line 3: This command specifies that RIP version 2 should be used. RIP version 2 supports classless routing, and variable-length subnet masking (VLSM).

  • Lines 4–5: This command specifies the network address or subnet in CIDR notation that will participate in RIP routing. It enables RIP on interfaces that belong to the specified network. So, in this example, it will enable RIP on interfaces that belong to the network 1.0.0.0 and 2.0.0.0.

  • Line 6: This command exits the RIP configuration mode and returns to global configuration mode.

Lastly, we’ll test whether RIP was properly configured on our router using the following in global configuration mode:

show ip protocols
CLI command to check which IP protocol is configured on our router

This should give a result which looks like this:

Result of command to see the routing protocol on router, Host A
Result of command to see the routing protocol on router, Host A

Performing these three steps on all routers will configure RIP on our network.

Now, if we use the show ip route command on host A, we will get a completely different result.

IP routes connected to host A after configuring RIP on entire network topology
IP routes connected to host A after configuring RIP on entire network topology

We have an additional network in our routes, which is the network address 3.0.0.0. This is because when a router is configured with RIP, it advertises its connected networks to other routers in the RIP domain. These connected networks are the networks directly connected to the router’s interfaces. As a result of RIP advertisements, the host may receive additional routing information beyond what is configured statically on its network interface. These additional routes are learned from other routers in the RIP domain and are added to the host’s routing table.
Now, host A can send data to host C through host B and vice versa.

Open Shortest Path First (OSPF)

Open Shortest Path First (OSPF) is a link-state routing protocol that calculates the best path for forwarding data packets in computer networks. OSPF employs the Dijkstra shortest path algorithm, considering factors like link cost and network topology. It organizes networks into areas to enhance scalability and reduce overhead, with routers exchanging link-state information within their respective areas.

Let’s configure OSPF on host A. Since we already know the networks attached to host A, we don’t have to perform that step again. First, we need to choose a process ID and area number and find out our network’s wildcard mask. The wildcard mask is the reverse of our subnet mask.

For our example, the subnet mask is 255.0.0.0, and its corresponding wildcard mask is 0.255.255.255. Furthermore, let’s specify the process ID as 1 and the area number as 1.

With configuration, run the following commands on the router’s CLI:

1. config terminal
2. router ospf 1
3. network 1.0.0.0 0.255.255.255 1
4. network 2.0.0.0 0.255.255.255 1
5. end
Commands to configure OSPF with process ID 1 and area number 1 on host A

The explanation of the commands is as follows:

  • Line 1: This command enters global configuration mode, which allows us to configure global parameters for the router.

  • Line 2: This command enters OSPF configuration mode, where we can configure parameters specific to the OSPF routing process. The parameter 1 here is the process ID decided earlier.

  • Lines 3–4: This command configures OSPF to include networks matching the specified network address and wildcard mask in OSPF routing updates. In this example, it includes network 1.0.0.0 with a wildcard mask of 0.255.255.255 in OSPF updates. The last parameter 1 specifies the OSPF area to which the network belongs. This command enables OSPF on interfaces with IP addresses within the specified network range.

  • Line 5: This command exits the OSPF configuration mode and returns to global configuration mode.

After configuring our router, let’s check if the protocol has changed to OSPF through the show ip protocols command. We should get this result to indicate that it has successfully changed:

Result of running the above command on host A after configuring OSPF protocol on it.
Result of running the above command on host A after configuring OSPF protocol on it.

The line “Routing Protocol is “ospf 1”” tells us that the routing has successfully changed to OSPF.

Let’s perform the routing on our other routers and see the difference.

Result of running show ip route on host A after configuring OSPF protocol on entire network.
Result of running show ip route on host A after configuring OSPF protocol on entire network.

The result shows that host A is connected to host C through host B as well. Host A, host B, and host C belong to Area 1. This establishes OSPF neighbor relationships, enabling the exchange of link-state advertisements, the calculation of the shortest path tree, the population of routing tables, the dynamic advertisement of routes, and the assurance of network convergence and fault tolerance within area 1 of the OSPF domain.

Enhanced Interior Gateway Routing Protocol (EIGRP)

Enhanced Interior Gateway Routing Protocol (EIGRP) is a sophisticated routing protocol designed by Cisco Systems. It combines the advantages of distance vector and link-state routing protocols, offering fast convergence, low bandwidth usage, and easy configuration. EIGRP routers maintain neighbor relationships with adjacent routers and exchange routing information only when there is a change in the network topology, minimizing network overhead. EIGRP supports variable-length subnet masking (VLSM) and automatic summarization, making it suitable for small and large networks.

Let’s start by configuring EIGRP on host A. EIGRP has one parameter, Autonomous System (AS), which creates a group of routers that share routing information. We can choose the parameter as any number, so let's choose 1. Secondly, to configure EIGRP, we need the network’s wildcard mask, too.

After seeing the routes connected to host A, run the following commands on its CLI:

1. config terminal
2. router eigrp 1
3. network 1.0.0.0 0.255.255.255
4. network 2.0.0.0 0.255.255.255
5.end
CLI commands to configure EIGRP on host A

This will configure EIGRP with AS 1 on host A. We can check if the commands ran successfully using the show ip protocols command. If it is successful, we will get the following result:

Result of successfully configuring EIGRP on host A.
Result of successfully configuring EIGRP on host A.

Now, let’s configure EIGRP with AS as 1, and check the routing for host A. We will repeat the above commands for each host, and configure our routing protocol.

After configuring, let’s run the show ip route command on host A to see the updated routes:

Networks connected to host A after applying EIGRP routing on the entire network
Networks connected to host A after applying EIGRP routing on the entire network

Our entire network is connected with EIGRP, establishing EIGRP neighbor relationships, exchanging routing information, calculating best paths, populating routing tables, dynamically advertising routes, and ensuring convergence, network resilience, scalability, and flexibility within AS 1.

Conclusion

Implementing OSPF, EIGRP, and RIP in a network offers a comprehensive approach to routing that addresses various network requirements and scenarios. With its link-state routing algorithm and support for areas, OSPF provides scalability and fast convergence, making it suitable for large and complex networks. EIGRP combines the benefits of distance vector and link-state protocols, offering fast convergence, low bandwidth usage, and advanced features like variable-length subnet masking (VLSM) and automatic summarization, making it ideal for Cisco-based networks.

On the other hand, RIP, although less sophisticated compared to OSPF and EIGRP, offers simplicity and ease of configuration, making it suitable for smaller networks with simpler requirements. By implementing a combination of OSPF, EIGRP, and RIP, network administrators can design routing solutions tailored to their specific needs, ensuring efficient and reliable packet forwarding while accommodating the scale and complexity of their networks.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved