Routing is the process of selecting and determining the best possible path for data to travel from a source device to a destination device across one or more networks.
In computer networking, when a device (like a computer, laptop, or mobile phone) sends data to another device, the data does not always travel directly. Instead, it often passes through multiple intermediate devices and networks before reaching its final destination. The process of deciding which path the data should take is known as routing.
Routing is performed by a networking device called a router, which operates at the Network Layer (Layer 3) of the OSI model.
Whenever data is sent over a network, it is first converted into small units called packets. Each packet contains important information such as the source IP address and the destination IP address.
When a router receives a packet, it performs the following actions:
This entire decision-making process is called routing.
Routing can be compared to a road transportation system.
Imagine you want to travel from one city to another:
You choose the best route based on distance and time.
👉 Similarly, in networking:
In simple words, routing means:
👉 “Finding the best way to send data from one network to another.”
Or even simpler:
👉 “Routing is the process of guiding data to its destination.”
Suppose you are sending a message from your computer to a website like Google.
👉 This step-by-step forwarding of data is routing.
Routing does not move the entire data at once.
Instead, it works on small pieces of data (packets).
That’s why understanding packets is very important.
A packet is a small unit of data that is transmitted over a network.
When you send data (like a message, file, or video), it is not sent as a single large block. Instead, it is divided into smaller parts called packets so that it can be transmitted efficiently.
👉[ A packet is a small piece of data that travels through a network.]
Data is divided into packets because:
✔ It improves speed of transmission
✔ It allows better error handling
✔ It reduces network congestion
✔ It makes communication more reliable
Routing is required when:
✔ Devices are in different networks
✔ Data needs to travel across multiple networks
Example:
PC1 → 192.168.1.10
PC2 → 192.168.2.10
👉 These are different networks
👉 Communication is not possible without routing
A router connects both networks and enables communication.
A router is a networking device that:
✔ Connects multiple networks
✔ Forwards packets between networks
✔ Makes routing decisions
1️⃣ Path Selection
2️⃣ Packet Forwarding
3️⃣ Network Separation
4️⃣ Traffic Control
Let’s understand with a simple flow:
1️⃣ Sender sends data packet
2️⃣ Packet reaches router
3️⃣ Router checks destination IP
4️⃣ Router searches in routing table
5️⃣ Router selects best path
6️⃣ Packet is forwarded to next hop
7️⃣ Process repeats until destination reached
PC1 → Router → Router → PC2
Router decides path based on:
Routing is the process of forwarding data from one network to another. When a router receives a packet, it must decide the correct path to send that packet so that it can reach its destination network.
However, an important question arises here:
👉 How does a router know which path to choose?
The answer depends on the type of routing mechanism used in the network. Based on how routes are learned and maintained, routing is classified into three main types:
Each of these routing types follows a different approach to determine the path for data transmission. Understanding these types is very important because they form the foundation for configuring and managing networks.
Static routing is a method of routing in which the network administrator manually configures routes in a router so that the router knows exactly where to send data packets when they need to travel from one network to another network.
In networking, when data needs to move between different networks, the router must know the correct path to forward that data, and in static routing, this path information is not learned automatically but is provided manually by the administrator, which means the router completely depends on the configuration given by the user to perform routing.
👉 Static routing means:
We manually tell the router which path it should follow to reach a specific network, and the router keeps using that same path unless we change it manually.
Static routing works on a very simple idea:
👉 This means the router has no intelligence of its own, and it simply follows the instructions given by the administrator without checking for better or alternate paths.
Let’s understand step-by-step:
1️⃣ A device sends data to another network
2️⃣ The packet reaches the router
3️⃣ Router checks the destination IP address
4️⃣ Router looks into its routing table
5️⃣ It finds the static route
6️⃣ It forwards the packet to the next hop
👉 Router does not think or calculate — it just follows what we configured
Suppose a router needs to send data to network 192.168.2.0, then the administrator will configure a static route like this:
ip route 192.168.2.0 255.255.255.0 10.0.0.2
👉 Meaning:
👉 After this, the router will always send packets for this network to 10.0.0.2.
Static routing is mostly used in:
In static routing, the router does not check whether the path is working or not, and if the path fails, the router will still try to send data through the same path until the administrator manually updates or corrects the configuration.
👉 Static routing = Manual control over routing path
👉 Router = Follows instructions only
Dynamic routing is a method of routing in which routers automatically learn, update, and maintain routes in their routing tables by communicating with other routers using routing protocols so that data packets can be forwarded through the best possible path without manual configuration of each route.
In networking, when the size of the network increases and multiple paths are available to reach different destinations, it becomes very difficult to manually configure and manage all routes, and to solve this problem, dynamic routing is used, where routers automatically exchange information with each other and update their routing tables, which makes the network more flexible and easier to manage.
👉 Dynamic routing means:
Routers automatically find and update the best path to send data without needing manual configuration for every route.
Dynamic routing works on the concept of automatic learning and sharing of routes, where routers use special protocols to communicate with each other and exchange information about different networks.
👉 This means the router has built-in intelligence, and it can take decisions based on network conditions instead of just following fixed instructions.
Dynamic routing works with protocols such as:
These protocols help routers build and update their routing tables dynamically.
When dynamic routing is enabled, routers continuously exchange routing information with each other, and when a packet arrives, the router checks the destination IP address and then looks into its routing table, which has been automatically updated, and based on that information, it selects the best available path and forwards the packet, and if any network change occurs, such as a link failure, the router automatically updates its routing table and chooses a new path.
Suppose there are multiple routers connected in a network, and a router wants to send data to network 192.168.2.0, then instead of manually configuring the route, the router learns about this network from other routers using routing protocols, and it automatically decides the best path to reach that network based on certain conditions like shortest path or least cost.
Dynamic routing uses protocols such as:
👉 These protocols help routers exchange routing information.
In dynamic routing, the router continuously learns and updates routes, which means it can automatically handle network changes, but this also increases resource usage and complexity compared to static routing.
👉 Dynamic routing = Automatic path selection
👉 Router = Makes decisions on its own
Default routing is a method in which a router forwards all the packets whose destination networks are not present in the routing table to a predefined route so that the data can still reach its destination instead of being dropped.
In a network, a router uses its routing table to decide where to send data packets, but sometimes the router may not have information about a particular destination network, and in such situations, instead of discarding the packet, the router uses a special route called the default route, which acts as a fallback path and ensures that communication continues even when the exact route is not known.
👉 Default routing means:
If the router does not know where to send the data, it sends it to a fixed path called the default route.
Default routing works on a very simple idea:
👉 This means the router does not need to store all possible routes, and it can still forward packets using one common path.
When a packet reaches the router, the router first checks its routing table to find a matching destination network, and if no matching entry is found, the router then checks whether a default route is configured, and if it exists, the router forwards the packet to the next hop defined in the default route instead of dropping it.
ip route 0.0.0.0 0.0.0.0 <next-hop>
👉 Meaning:
👉 So, any unknown traffic will go to the specified next hop.
👉Gateway of Last Resort
This is the default route used when no other route is available in the routing table.
Think of a situation where you ask someone for directions:
👉 That main office = Default route
In a home network:
👉 ISP router acts as default route
Default routing is very useful in situations where the router does not have complete routing information, but it should be used carefully because all unknown traffic depends on a single path, and if that path fails, communication may be affected.
👉 Default routing = Fallback path for unknown networks
👉 Router = Uses it when no route is found
In static routing, after understanding the concept, the next important step is to configure static routes in a router so that it can forward packets to the correct destination network. This configuration is done manually by the administrator using Cisco IOS commands, and it requires proper understanding of destination network, subnet mask, and next hop.
The basic syntax used to configure static routing in a router is:
ip route <destination-network> <subnet-mask> <next-hop / exit-interface>
ip route 192.168.2.0 255.255.255.0 10.0.0.2
👉 Meaning:
👉 The router will send all packets for this network to 10.0.0.2.
Static routes can be configured in two ways:
ip route 192.168.2.0 255.255.255.0 10.0.0.2
👉 Router sends packet to next router
ip route 192.168.2.0 255.255.255.0 g0/0
👉 Router sends packet through specified interface
Before configuring static routing, we must:
Router> enable
👉 This command gives administrative access
Router# configure terminal
👉 Used to configure router settings
Router(config)# ip route <destination-network> <subnet-mask> <next-hop>
👉 This is the main step where routing is defined
Router(config)# end
👉 Returns to privileged mode
Router# show ip route
👉 Displays routing table
Router# show running-config
👉 Shows configured routes
Router> enable
Router# configure terminal
Router(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2
Router(config)# end
Router# show ip route
⚠️ Important Points
In this practical, we have created a 4 LAN topology where each LAN is connected through routers, and static routing is configured so that all devices from different networks can communicate with each other successfully. Since each LAN belongs to a different network, routers are required to forward packets between them, and for that, we manually configure static routes on each router.

👉 This topology contains:
👉 Routers used:
| LAN | Network Address | Router Interface |
| LAN 1 | 192.168.100.0/24 | GATEWAY1 (Fa0/0) |
| LAN 2 | 192.168.101.0/24 | Between GATEWAY1 & ROUTER1 |
| LAN 3 | 192.168.102.0/24 | Between ROUTER1 & GATEWAY2 |
| LAN 4 | 192.168.103.0/24 | GATEWAY2 (Fa0/0) |
Router>ENABLE
Router#CONFIG T
Router(config)#HOSTNAME GATEWAY1
GATEWAY1(config)#INTERFACE FA0/0
GATEWAY1(config-if)#IP ADDRESS 192.168.100.4 255.255.255.0
GATEWAY1(config-if)#NO SHUTDOWN
GATEWAY1(config-if)#EXIT
GATEWAY1(config)#INTERFACE FA0/1
GATEWAY1(config-if)#IP ADDRESS 192.168.101.1 255.255.255.0
GATEWAY1(config-if)#NO SHUTDOWN
GATEWAY1(config-if)#EXIT
GATEWAY1(config)#IP ROUTE 192.168.102.0 255.255.255.0 192.168.101.2
GATEWAY1(config)#IP ROUTE 192.168.103.0 255.255.255.0 192.168.101.2
GATEWAY1(config)#EXIT
Router>ENABLE
Router#CONFIG T
Router(config)#HOSTNAME ROUTER1
ROUTER1(config)#INTERFACE FA0/0
ROUTER1(config-if)#IP ADDRESS 192.168.101.2 255.255.255.0
ROUTER1(config-if)#NO SHUTDOWN
ROUTER1(config-if)#EXIT
ROUTER1(config)#INTERFACE FA0/1
ROUTER1(config-if)#IP ADDRESS 192.168.102.1 255.255.255.0
ROUTER1(config-if)#NO SHUTDOWN
ROUTER1(config-if)#EXIT
ROUTER1(config)#IP ROUTE 192.168.100.0 255.255.255.0 192.168.101.1
ROUTER1(config)#IP ROUTE 192.168.103.0 255.255.255.0 192.168.102.2
ROUTER1(config)#EXIT
Router>ENABLE
Router#CONFIG T
Router(config)#HOSTNAME GATEWAY2
GATEWAY2(config)#INTERFACE FA0/0
GATEWAY2(config-if)#IP ADDRESS 192.168.103.1 255.255.255.0
GATEWAY2(config-if)#NO SHUTDOWN
GATEWAY2(config-if)#EXIT
GATEWAY2(config)#INTERFACE FA0/1
GATEWAY2(config-if)#IP ADDRESS 192.168.102.2 255.255.255.0
GATEWAY2(config-if)#NO SHUTDOWN
GATEWAY2(config-if)#EXIT
GATEWAY2(config)#IP ROUTE 192.168.100.0 255.255.255.0 192.168.102.1
GATEWAY2(config)#IP ROUTE 192.168.101.0 255.255.255.0 192.168.102.1
GATEWAY2(config)#EXIT
👉 As shown in the image, the PC is successfully pinging 192.168.103.2, which proves that static routing is working correctly and all LANs are able to communicate with each other.

👉 From the routing table, we can see:
This confirms that routes are properly configured.
In this 4 LAN topology, static routing is used to manually define paths between different networks, and by configuring routes on all routers (GATEWAY1, ROUTER1, and GATEWAY2), successful communication is achieved between all LANs, which is verified using ping and routing table commands.