This tutorial explains the types of routes and routing. Learn the differences between automatic routing, static or manual routing, and dynamic routing.
A router connects different networks. It works as an intermediate device. It has multiple interfaces. When it receives a packet on an interface, it reads the destination address of the packet and forwards the packet from the interface that is connected to the destination address. If no interface is connected to the destination network, the router discards the packet. This process is known as routing.
The routing process involves three steps. These steps are the following.
- Receiving a packet
- Forwarding decision
- Forwarding the packet
To take the forwarding decision, the router must learn, store, maintain, and update information about the connected networks. Routers use routing tables to store information about the connected networks. This information is known as routing information.
There are three methods to add, update, and maintain routing information. These methods are the following.
- Automatic routing
- Static or Manual routing
- Dynamic routing
Automatic routing
In this method, a router automatically adds and manages the routing information. To get the routing information, the router uses the IP configuration of the active interfaces. When the administrator changes the IP configuration or the state of the interface, the router automatically updates the related information in the routing table.
Since automatic routing uses IP configurations of interfaces, it can’t add routes that are not available on the router. The following image shows an example network where you can use automatic routing.
If you have two or more routers in the network, you have to use either static routing or dynamic routing.
Manual or static routing
In this method, the administrator manages the routing information. The administrator manually adds routing information to the routing table. If any change occurs in the network, the administrator has to update the related information in the routing table.
Static routing is a good option if the network size is small. The following image shows an example network where you can use static routing.
Dynamic routing
In this method, the administrator configures a routing protocol on the router. The routing protocol automatically adds and manages the routing information in the routing table. If any change occurs in the network, the routing protocol automatically updates the related information in the routing table.
Dynamic routing is a good option if the network size is large.
Differences between automatic, manual, and dynamic routing
The following table lists the differences between automatic routing, manual routing, and dynamic routing.
Automatic routing | Static or manual routing | Dynamic routing |
Automatic routing is the easiest. The router does all jobs. You don’t need to do anything. | Manual routing is easier than dynamic routing but harder than automatic routing. You have to manage all routing-related information manually. | Dynamic routing is easy. You have to configure a routing protocol. The routing protocol manages all routing-related information automatically. |
No routing knowledge is required. | You must know how to add and manage routes in the routing table. | You must know how to configure and manage the routing protocol. |
A router does not know routes available outside the router. It can only add routes that are available on its interfaces. | An administrator knows all routes available in the network. The administrator can add or remove routes as per the requirement. | A routing protocol uses its mechanism to discover all routes in the network. The administrator can configure this mechanism to meet the network requirement. |
By default automatic routing is enabled on all routers. | Static routing is not enabled by default. | Dynamic routing is also not enabled by default. |
Automatic routing is a good option if you have only one router in the network. | Static routing is a good option if you have only some routers in the network. | Dynamic routing is a good option if you have many routers in the network. |
Automatic routing does not use additional hardware resources. | Static routing also does not use additional hardware resources. | Dynamic routing uses hardware resources to learn and manage routes. |
Types of routes
There are four types of routes. These types are connected route, local route, static route, and dynamic route.
Automatic routing adds connected routes and local routes to the routing table. Automatic routing calculates these routes from the IP configuration of active interfaces. The routing table respectively uses codes C and L to show connected and local routes.
Static or manual routing adds static routes to the routing table. An administrator manually creates and adds these routes to the routing table. The routing table uses the code S to show static routes.
Dynamic routing adds dynamic routes to the routing table. A routing protocol learns and adds these routes to the routing table. Dynamic routes are further classified based on the routing protocols. Each routing protocol uses a different code to show its routes in the routing table.
To view the code of each type of route you can use the 'show ip route' command. The following image shows the output of this command.
That’s all for this tutorial. In this tutorial, we discussed the routing methods and learned how each method differs from the others. In the next tutorial, we will discuss automatic routing in detail.