Routing is a process which is performed by layer 3 (or network layer) devices in order to deliver the packet by choosing an optimal path from one network to another.
There are 3 types of routing:
1. Static routing –
Static routing is a process in which we have to manually add routes in routing table.
- No routing overhead for router CPU which means a cheaper router can be used to do routing.
- It adds security because only administrator can allow routing to particular networks only.
- No bandwidth usage between routers.
- For a large network, it is a hectic task for administrator to manually add each route for the network in the routing table on each router.
- The administrator should have good knowledge of the topology. If a new administrator comes, then he has to manually add each route so he should have very good knowledge of the routes of the topology.
R1 having IP address 172.16.10.6/30 on s0/0/1, 192.168.10.1/24 on fa0/0.
R2 having IP address 172.16.10.2/30 on s0/0/0, 192.168.20.1/24 on fa0/0.
R3 having IP address 172.16.10.5/30 on s0/1, 172.16.10.1/30 on s0/0, 10.10.10.1/24 on fa0/0.
Now configuring static routes for router R3:
R3(config)#ip route 192.168.10.0 255.255.255.0 172.16.10.2 R3(config)#ip route 192.168.20.0 255.255.255.0 172.16.10.6
Here, provided the route for 192.168.10.0 network where 192.168.10.0 is its network I’d and 172.16.10.2 and 172.16.10.6 are the next hop address.
Now, configuring for R2:
R2(config)#ip route 192.168.20.0 255.255.255.0 172.16.10.1 R2(config)#ip route 10.10.10.0 255.255.255.0 172.16.10.1 R2(config)#ip route 172.16.10.4 255.255.255.0 172.16.10.1
Similarly for R1:
R1(config)#ip route 192.168.10.0 255.255.255.0 172.16.10.5 R1(config)#ip route 10.10.10.0 255.255.255.0 172.16.10.5 R1(config)#ip route 172.16.10.0 255.255.255.0 172.16.10.5
2. Default Routing –
This is the method where the router is configured to send all packets towards a single router (next hop). It doesn’t matter to which network the packet belongs, it is forwarded out to router which is configured for default routing. It is generally used with stub routers. A stub router is a router which has only one route to reach all other networks.
Using the same topology which we have used for the static routing before.
In this topology, R1 and R2 are stub routers so we can configure default routing for both these routers.
Configuring default routing for R1:
R1(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.5
Now configuring default routing for R2:
R2(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.1
3. Dynamic Routing –
Dynamic routing makes automatic adjustment of the routes according to the current state of the route in the routing table. Dynamic routing uses protocols to discover network destinations and the routes to reach it. RIP and OSPF are the best examples of dynamic routing protocol. Automatic adjustment will be made to reach the network destination if one route goes down.
A dynamic protocol have following features:
- The routers should have the same dynamic protocol running in order to exchange routes.
- When a router finds a change in the topology then router advertises it to all other routers.
- Easy to configure.
- More effective at selecting the best route to a destination remote network and also for discovering remote network.
- Consumes more bandwidth for communicating with other neighbors.
- Less secure than static routing.
- Computer Network | Distance vector routing v/s Link state routing
- Computer Network | Routing Protocols Set 1 (Distance Vector Routing)
- Computer Network | Securing Routing Protocols
- Computer Network | Routing v/s Routed Protocols
- Computer Network | Routing Information Protocol (RIP)
- Computer Network | Classification of Routing Algorithms
- Computer Network | Classes of routing protocols
- Computer Network | Fixed and Flooding Routing algorithms
- Computer Network | Classless Inter Domain Routing (CIDR)
- Computer Network | Types of Network address translation (NAT)
- Computer Network | Features of Enhanced Interior Gateway Routing Protocol (EIGRP)
- Computer Network | Types of MANET
- Computer Network | Types of switches
- Computer Network | Types of Server Virtualization
- Computer Network | Types of area networks - LAN, MAN and WAN
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : nidhi_biet