Routing Protocols:

Shir Hussain Tabesh
11 min readFeb 17, 2021

Hey, don’t get confused of ‘routing’ and ‘routing protocol’. Routing is the process of selecting a path or route from a source to a destination in a network. Routing protocols are some rules or a set of instructions that are configured on routers, so the routers select the best path or route while sending a message from a source device to a destination device.

Routing Protocols

In order to keep the routers connected to one another, they need to have the routing information of other routers in their routing table. There are two ways of configuring routing protocols on routers in a network: static and dynamic. In the static approach, the network administrator has to manually introduce all the unconnected routers to one another which is applicable for small networks. However, when it comes to large networks, it’s not possible to manually introduce all the routers to one another. There are specific algorithms that are used to define some protocols among the routers, so they can learn about one another automatically exchanging their routing tables.

Routing Protocol Characteristics

Routing protocols can be compared based on the following characteristics:

  • Speed of convergence: Speed of convergence defines how quickly the routers in the network topology share routing information and reach a state of consistent knowledge. The faster the convergence, the more preferable the protocol. Routing loops can occur when inconsistent routing tables are not updated due to slow convergence in a changing network.
  • Scalability: Scalability defines how large a network can become, based on the routing protocol that is deployed. The larger the network is, the more scalable the routing protocol needs to be.
  • Classful or classless (use of VLSM): Classful routing protocols do not include the subnet mask and cannot support variable-length subnet mask (VLSM). Classless routing protocols include the subnet mask in the updates. Classless routing protocols support VLSM and better route summarization.
  • Resource usage: Resource usage includes the requirements of a routing protocol such as memory space (RAM), CPU utilization, and link bandwidth utilization. Higher resource requirements necessitate more powerful hardware to support the routing protocol operation, in addition to the packet forwarding processes.
  • Implementation and maintenance: Implementation and maintenance describes the level of knowledge that is required for a network administrator to implement and maintain the network based on the routing protocol deployed.

Configuring the routes statically or dynamically:

There are two ways a router can learn about the routes in the network: statically or dynamically. First, the network administer can configure the router manually that is called static approach. Second, the network administer can set a routing protocol on routers, then the routers can learn about the routes in the network dynamically.

Note: before starting the routers configurations, we need to know a bit about cisco IOS commands.

A brief introduction to CISCO IOS CLI:

Cisco IOS has a Command Line Interface (CLI) and it has three command line modes. Each mode has access to different set of IOS commands.

User mode (User EXEC mode)

User Mode is the first mode a user has access to after logging into the router. The user mode can be identified by the > prompt following the router name. This mode allows the user to execute only the basic commands, such as those that show the system’s status. The router cannot be configured or restarted from this mode.

The user mode can be identified as shown below:

Router>

Privileged mode (Privileged EXEC Mode)

Privileged mode allows users to view the system configuration, restart the system, and enter router configuration mode. Privileged mode also allows all the commands that are available in user mode. Privileged mode can be identified by the # prompt following the router name. From the user mode, a user can change to Privileged mode, by running the “enable” command. Also we can keep a enable password or enable secret to restrict access to Privileged mode. An enable secret password uses stronger encryption when it is stored in the configuration file and it is safer.

The Privileged mode can be identified as shown below

Router#

Global Configuration mode

Global Configuration mode allows users to modify the running system configuration. From the Privileged mode a user can move to configuration mode by running the “configure terminal” command from privileged mode. To exit configuration mode, the user can enter “end” command or press Ctrl-Z key combination.

The Global Configuration mode can be identified as shown below.

Router(config)#
  • Global Configuration mode has various submodes, starting with global configuration mode, which can be identified by the (config)# prompt following the router name. Following are the important Global Configuration submodes.
  • Interface mode (Router physical interface configuration mode)
Router(config-if)#
  • Subinterface mode (Router sub-interface configuration mode)
Router(config-subif)#
  • Line mode (Router line configuration mode — console, vty etc.)
Router(config-line)#
  • Router configuration mode (Routing protocols configuration mode.)
Router(config-router)#

Configuring the route statically:

A static route is a route that is created manually by a network administrator. Static routes are typically used in smaller networks. In static routing, the Router’s routing table entries are populated manually by a network administrator.

Advantages:

  • Routing Efficiency: in contrast to dynamic routing, the route update packet is not sent in static routing and that is disabled on the router. So, it saves some bandwidth and reduce traffic.
  • Security: we can filter the routing data by firewalls or using VPN.

Disadvantages:

  • Maintenance: if routes change, we need to update all routers to reflect new routes, statically.
  • Accuracy: if the network changes, we need to update the static route, otherwise; there will happen delay or loss.
  • Scalability: if we use static route in large networks, for any change we have to update all of them individually, which seems to be impossible.

Configuring Static Route:

All directly connected routers do not need for routing configuration. They are already connected. Introduce all other LANs to the intended router as follows.

Default Routes:

Default Route can be configured by the following IOS commands.

Router>
Router>enable (or en)
Router#configure terminal (or config t)
Router(config)#ip route 0.0.0.0 0.0.0.0 Next-Hop-IP | Interface | Default-Gateway
Router(config)#exit
Router#exit
Router>

Go to the any network with any Netmask via the Default-Gateway | Next-Hop-IP | Interface

Static Configuration:

From network 192.168.6.0/24 to network 192.168.1.0/24, two routes or paths exist:

  1. Via Router6: 192.168.5.0/24 and 192.168.2.0/24
  2. Via Router5: 192.168.4.0/24 and 192.168.3.0.24

Now we statically select the first path, and complete the configuration as bellow. Then you can confirm this route using the ‘Trace Route’ application i.e. tracert 192.168.1.2

Router6:

Router>
Router>enable (or en)
Router#configure terminal (or config t)
Router(config)#ip route 192.168.6.0 255.255.255.0 192.168.5.2
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.2
Router(config)#exit
Router#exit
Router>

Router4:

Router>
Router>enable (or en)
Router#configure terminal (or config t)
Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.5.1
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.5.1
Router(config)#exit
Router#exit
Router>

Router7:

Router>
Router>enable (or en)
Router#configure terminal (or config t)
Router(config)#ip route 192.168.5.0 255.255.255.0 192.168.2.1
Router(config)#ip route 192.168.6.0 255.255.255.0 192.168.2.1
Router(config)#exit
Router#exit
Router>

Note: Unidirectional static routes must be configured to and from a stub network to allow communications to occur.

Dynamic Routes:

Dynamic routes are route that change over time. Routing protocols define and maintain dynamic routes.

Advantages:

  • Low maintenance: if we change the routers, there is no need for updating. The routes are automatically updated by routing protocols.
  • Accuracy: routing protocols keep track of network changes. So, accuracy improves.
  • Scalability: we can use it in large networks because we can define it automatically.

Disadvantages:

Unlike static route, dynamic routing protocols consume some bandwidth because they constantly send route update packets between routers.

Routing protocols:

Routing protocols exchange network, routes, and metric information between routers to help find optimal routers as fast as possible. Routers use the information provided by routing protocols to build their routing tables for each routed protocol to keep track of networks, paths to networks, and metrics associated with each route.

Routing decision criteria:

While selecting the best path, routers decides based on administrative distance and metrics associated with routing protocols. Routers keep separate routing tables for each protocol. Routers constantly monitor the state of each route considering the traffic, available bandwidth, and link state so change the route dynamically.

Administrative distance:

The administrative distance determines the reliability of the information source that provided the data about the network route. Routers learn about network routes using various methods:

  • Router connects directly to a network: firsthand information, because the router is directly connected;
  • Router doesn’t connect to the network, but a static route exists to that network: learns about the network via a reliable source as far as it’s static.
  • Router is connected indirectly, through other router(s), to a network: learns about the network from other routers.

Routing Protocol Metrics

There are cases when a routing protocol learns of more than one route to the same destination. To select the best path, the routing protocol must be able to evaluate and differentiate between the available paths. This is accomplished through the use of routing metrics.

A metric is a measurable value that is assigned by the routing protocol to different routes based on the usefulness of that route. In situations where there are multiple paths to the same remote network, the routing metrics are used to determine the overall “cost” of a path from source to destination. Routing protocols determine the best path based on the route with the lowest cost.

Different routing protocols use different metrics. The metric used by one routing protocol is not comparable to the metric used by another routing protocol. Two different routing protocols might choose different paths to the same destination.

Routers using the link state protocol creates three types of tables; neighbor table, topology table, and routing table. The neighbor table stores details of neighboring routers using the link state routing protocol, the topology table stores the whole network topology, and the routing table stores the most efficient routes.

Metrics for some protocols are as below: RIP, Hop count. OSPF, Bandwidth, EIGRP, Bandwidth and delay.

Routing methods:

Routing protocols use different methods to exchange information about network routes.

Distance vector routing:

Some routing protocols use the distance to a network to evaluate the quality of a network route. Shorter routers (fewer hops) are considered better than longer routes. Routers using these protocols build their routing tables based on routed distance, and they exchange and combine their routing table with their neighbors. Neighbor routers trust each other’s route information, and they relay the combined information farther.

Convergence: The initial routing information exchange between routers is called convergence.

Route updates: After they have converged, routers continue to update each other about network routes they know. These route updates keep track of route changes. Distance vector routing protocols send updates that contain the whole routing table, and it consumes the bandwidth a lot.

Routing loop: Routing loops route data packets, in loop, continuously, between neighbor routers. This occurs when all the routers do not have the same knowledge of the network. Distance vector routing protocols incorporate solutions such as the following mechanisms to avoid loops:

  • Maximum hop count: The maximum hop count feature ensures that a data packet never takes a route that counts more than a predefined maximum number of hops.
  • Split horizon: The split horizon feature prevents a route from being advertised back to its advertiser.
  • Route poisoning: The route poisoning feature changes the hop count associated with a route that becomes unreachable: It sets the hop count to the maximum hop count plus 1. This effectively tells all routers in the network that the route is unreachable because the hop count exceeds the maximum hop count allowed by the routing protocol. It is a method of disabling an unavailable route in the routing tables as quickly as possible.
  • Poison reverse: The poison reverse feature is similar to router poisoning but in the reverse direction.
  • Hold-down timer: The hold-down timer prevents a router from accepting updates about a route for a certain time if that route was advertises as unavailable. This prevents routing loops by ensuring that when a route has been advertised as being unreachable, it is not re-advertised as being back up by a router that did not receive the “route down” message yet.
  • Triggered update: The triggered update feature allows routers to update each other as soon as a change occurs in the network, as opposed to waiting until the scheduled routed updates to be exchanged.

Routing Information Protocol — RIP configuration:

In RIP, we introduce the directly connected networks to the router.

Router0

Router>
Router>ena
Router#conf t
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 192.168.1.0
Router(config-router)#network 192.168.2.0
Router(config-router)#network 192.168.4.0
Router(config-router)#exit
Router(config)#exit
Router#

Router2

Router>
Router>ena
Router#conf t
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 192.168.2.0
Router(config-router)#network 192.168.3.0
Router(config-router)#exit
Router(config)#exit
Router#

Router1

Router>
Router>ena (or enable)
Router#conf t (or configure terminal)
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 192.168.3.0
Router(config-router)#network 192.168.4.0
Router(config-router)#network 192.168.5.0
Router(config-router)#exit
Router(config)#exit
Router#

Link-state routing:

Links-state protocols enable routers to have a clear image of their neighbors, network topology, and routes to their neighbors and beyond. The main characteristics are as bellow:

  • Route updates are only sent when routes change, as opposed to distance vector protocols, which send route updates periodically.
  • Route updates contain information about the route that changed only, as opposed to distance vector protocols, which send route updates that contain the whole combined routing table.
  • Routers first exchange “hello” messages to get acquainted with their neighbors, as opposed to distance vector protocols, which exchange and combine their routing tables from the get-go.
  • Routers maintain neighbor and topology tables in addition to routing tables to help routers keep track not only of routes but also of the topology of the network and of their neighbor routers.

Open Shortest Path First — OSPF:

OSPF is a link-state routing protocol, and maintains these routing tables:

  • Neighbor table: This table keeps track of the neighbors of a router.
  • Link-state table: This table keeps track of the state of the links on neighbor routers.
  • Routing table: This table keeps track of the metrics of each link tracked by the link-state table.

Characteristics of OSPF:

  • Route updates are only sent when routes change. Each router sends a link-state advertisement (LSA) whenever a change occurs in one of the routes known to the router.
  • LSAs contain information about the route that changed only.
  • Routers exchange “Hello” messages during the convergence process to build their neighbor tables.
  • OSPF supports variable-length subnet masking (VLSM).
  • OSPF supports an unlimited number of network hops.
  • OSPF scales out very well because
  1. It divides the routing domain (autonomous system) into areas.
  2. It classifies routers hierarchically.
  3. It converges very quickly.
  4. It sends routes updates (LSAs) only when routes change, minimizing route change traffic.
  5. LSA packets have a small footprint.
  6. LSA traffic is consolidated to the designated router.
  7. LSA traffic is minimized when routes are summarized.

OSPF Configuration (Single Area):

OSPF is configured considering the following format: Process ID ranges from 1 to 65535.

(config)#router ospf <process ID>
(config-router)#network <NetworkID> <wildcardMask> area <area id>

R1

Router>
Router>ena
Router#conf t
Router(config)#router ospf 1
Router(config-router)#network 192.168.10.0 0.0.0.255 area 0
Router(config-router)#network 192.168.11.0 0.0.0.255 area 0
Router(config-router)#exit
Router(config)#exit
Router#

R2

Router>
Router>ena
Router#conf t
Router(config)#router ospf 1
Router(config-router)#network 192.168.11.0 0.0.0.255 area 0
Router(config-router)#network 192.168.12.0 0.0.0.255 area 0
Router(config-router)#network 192.168.13.0 0.0.0.255 area 0
Router(config-router)#exit
Router(config)#exit
Router#

R3

Router>
Router>ena
Router#conf t
Router(config)#router ospf 1
Router(config-router)#network 192.168.13.0 0.0.0.255 area 0
Router(config-router)#network 192.168.14.0 0.0.0.255 area 0
Router(config-router)#exit
Router(config)#exit
Router#

Note: you can get the wildcard mask by subtracting the given net-mask from the global subnet mask (255.255.255.255). For instance, the 255.255.255.0 sub-net mask is given. You can find its wildcard mask by subtracting it from 255.255.255.255.

255.255.255.255 - 255.255.255.0 = 0.0.0.255 (Wildcard mask)

References used for providing this tutorial:

  1. https://www.ciscopress.com/articles/article.asp?p=2180210&seqNum=7
  2. https://www.comparitech.com/net-admin/routing-protocol-types-guide/#Classful_and_Classless_Routing_Protocols
  3. omnisecu.com/cisco-certified-network-associate-ccna/cisco-ios-command-line-modes.php
  4. CCNA Certification All-in-One For Dummies

Note: I’ll enhance this tutorial, aligning with topics we study in this course.

Wish you success!

--

--