🌐 What is Routing?

 

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:

  1. It reads the destination IP address from the packet 
  2. It checks its routing table 
  3. It determines the best possible path 
  4. It forwards the packet to the next device 

This entire decision-making process is called routing.

 

📌 Key Points about Routing

  • Routing is required when communication happens between different networks 
  • It ensures that data reaches the correct destination 
  • It helps in efficient data transmission 
  • It can be done manually (static routing) or automatically (dynamic routing) 

 

🌍 Real-Life Analogy

Routing can be compared to a road transportation system.

Imagine you want to travel from one city to another:

  • There are multiple routes available 
  • Some routes are shorter, some are longer 
  • Some routes may have traffic 

You choose the best route based on distance and time.

👉 Similarly, in networking:

  • Data travels through different routes 
  • Router selects the best path 
  • Data reaches the destination efficiently 

 

🧠 Simple Meaning of Routing

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.”

 

💡 Easy Example

Suppose you are sending a message from your computer to a website like Google.

  • Your computer sends the request 
  • The request goes through multiple routers 
  • Each router decides where to send it next 
  • Finally, it reaches Google’s server 

👉 This step-by-step forwarding of data is routing.

 

⚡ Important Concept

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.

 

📦 What is a Packet?

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.]

 

📋 Why Data is Divided into Packets?

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

 

🔄 Why Routing is Required?

Routing is required when:

✔ Devices are in different networks
✔ Data needs to travel across multiple networks

 

❌ Without Routing

  • Devices in different networks cannot communicate 

Example:

PC1 → 192.168.1.10
PC2 → 192.168.2.10

👉 These are different networks
👉 Communication is not possible without routing

✅ With Routing

A router connects both networks and enables communication.

 

🛜 What is a Router?

A router is a networking device that:

✔ Connects multiple networks
✔ Forwards packets between networks
✔ Makes routing decisions

 

🎯 Main Functions of Router

1️⃣ Path Selection

  • Chooses best route to destination 

2️⃣ Packet Forwarding

  • Sends packet to next device 

3️⃣ Network Separation

  • Divides networks into segments 

4️⃣ Traffic Control

  • Manages data flow 

 

🔍 How Routing Works (Step-by-Step)

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

 

📊 Example

PC1 → Router → Router → PC2

  • PC1 sends packet 
  • Router 1 checks route 
  • Sends to Router 2 
  • Router 2 sends to PC2 

 

🧾 Routing Decision Factors

Router decides path based on:

  • Destination IP address 
  • Routing table entries 
  • Metrics (in dynamic routing) 
  • Administrative configuration

 

🌐 Types of Routing

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:

  • Static Routing 
  • Dynamic Routing 
  • Default Routing 

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.

 

1️⃣ Static Routing

 

📖 Definition

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.

 

🔍 Concept Explanation

Static routing works on a very simple idea:

  • Router does not learn routes automatically 
  • Router does not communicate with other routers 
  • All routing paths are manually defined 

👉 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.

 

📌 How Static Routing Works

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

 

📊 Example

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:

  • Destination network → 192.168.2.0 
  • Subnet mask → 255.255.255.0 
  • Next hop → 10.0.0.2 

👉 After this, the router will always send packets for this network to 10.0.0.2.

 

🔗 Important Terms

  • Destination Network → where the data has to go 
  • Subnet Mask → defines network size 
  • Next Hop → next router in the path 
  • Exit Interface → port through which packet leaves 

 

✨ Key Features of Static Routing

  • Routes are manually configured by the administrator 
  • Router does not update routes automatically 
  • No communication takes place between routers 
  • The path for data transmission remains fixed unless changed manually 
  • Requires very low CPU and memory usage compared to dynamic routing 

 

✅ Advantages of Static Routing

  • It is simple and easy to configure in small networks where the number of routes is limited and manageable 
  • It provides full control to the administrator over how data should flow in the network 
  • It is more secure because no routing information is shared with other routers 
  • It does not use extra bandwidth for exchanging routing updates 
  • It consumes very less system resources such as CPU and memory 

 

❌ Disadvantages of Static Routing

  • It is not suitable for large networks because configuring and managing many routes manually becomes difficult and time-consuming 
  • If there is any change in the network topology, the administrator has to update all routes manually 
  • The router cannot automatically detect failures in the network and cannot choose an alternate path 
  • There is a higher chance of configuration errors because everything depends on manual input 
  • It is less flexible compared to dynamic routing 

 

📍 Where Static Routing is Used

Static routing is mostly used in:

  • Small office networks 
  • Home networks 
  • Networks with very few routers 
  • Stable networks (no frequent changes) 

 

⚠️ Important Understanding

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.

 

🎯 Key Idea

👉 Static routing = Manual control over routing path
👉 Router = Follows instructions only

 

2️⃣ Dynamic Routing

 

📖 Definition

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.

 

🧠 Simple Meaning

👉 Dynamic routing means:
Routers automatically find and update the best path to send data without needing manual configuration for every route.

 

🔍 Concept Explanation

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.

  • Routers learn routes automatically 
  • Routers share routing information 
  • Routing tables are updated automatically 

👉 This means the router has built-in intelligence, and it can take decisions based on network conditions instead of just following fixed instructions.

 

📡 Role of Routing Protocols

Dynamic routing works with protocols such as:

  • RIP (Routing Information Protocol) 
  • OSPF (Open Shortest Path First) 
  • EIGRP (Enhanced Interior Gateway Routing Protocol) 

These protocols help routers build and update their routing tables dynamically.

 

📌 How Dynamic Routing Works

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.

 

📊 Example

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.

 

🔗 Important Terms

  • Routing Protocol → set of rules used by routers to share information 
  • Routing Table → list of routes learned automatically 
  • Metric → value used to choose the best path 
  • Neighbor Router → router with which information is exchanged 

 

✨ Key Features of Dynamic Routing

  • Routes are learned automatically by routers 
  • Routers communicate with each other to share information 
  • Routing tables are updated automatically when network changes 
  • Can find alternate paths if one path fails 
  • Uses more CPU and memory compared to static routing 

 

📡 Common Routing Protocols

Dynamic routing uses protocols such as:

  • RIP (Routing Information Protocol) 
  • OSPF (Open Shortest Path First) 
  • EIGRP (Enhanced Interior Gateway Routing Protocol) 

👉 These protocols help routers exchange routing information.

 

✅ Advantages of Dynamic Routing

  • It reduces manual work because routes are automatically learned and maintained by routers 
  • It is suitable for large and complex networks where manual configuration is not practical 
  • It automatically adapts to changes in the network such as link failure or addition of new networks 
  • It can find alternate paths, which improves network reliability 
  • It makes network management easier in large environments 

 

❌ Disadvantages of Dynamic Routing

  • It is more complex to understand and configure compared to static routing 
  • It uses more CPU, memory, and bandwidth for exchanging routing information 
  • It requires proper configuration of routing protocols 
  • It may take some time to update routes when network changes occur 
  • It is less secure compared to static routing because routing information is shared between routers 

 

⚠️ Important Understanding

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.

 

🎯 Key Idea

👉 Dynamic routing = Automatic path selection
👉 Router = Makes decisions on its own

 

3️⃣ Default Routing

 

📖 Definition

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.

 

🧠 Simple Meaning

👉 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.

 

🔍 Concept Explanation

Default routing works on a very simple idea:

  • Router checks routing table 
  • If no matching route is found 
  • It uses the default route 

👉 This means the router does not need to store all possible routes, and it can still forward packets using one common path.

 

📌 How Default Routing Works

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.

 

📊 Default Route Syntax

ip route 0.0.0.0 0.0.0.0 <next-hop>

👉 Meaning:

  • 0.0.0.0 → represents all networks 
  • Subnet mask 0.0.0.0 → matches any destination 

👉 So, any unknown traffic will go to the specified next hop.

 

🔗 Important Term

👉Gateway of Last Resort
This is the default route used when no other route is available in the routing table.

 

🌍 Real-Life Example

Think of a situation where you ask someone for directions:

  • If they know the exact place → they guide you directly 
  • If they don’t know → they send you to a main office 

👉 That main office = Default route

 

📡 Practical Example (Network)

In a home network:

  • Your router does not know all internet routes 
  • It sends all unknown traffic to ISP 

👉 ISP router acts as default route

 

✨ Key Features of Default Routing

  • Used when no specific route is available 
  • Simple and easy to configure 
  • Reduces size of routing table 
  • Commonly used in small networks 
  • Works as a backup or fallback path 

 

✅ Advantages of Default Routing

  • It reduces the need to configure multiple routes manually 
  • It simplifies routing in small networks 
  • It allows communication with unknown networks 
  • It is very useful for internet access 
  • It reduces memory usage by keeping routing table small 

 

❌ Disadvantages of Default Routing

  • It may send packets through a non-optimal path 
  • It depends on a single route, which can become a point of failure 
  • It is not suitable for large and complex networks 
  • It does not provide detailed routing control 

 

⚠️ Important Understanding

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.

 

🎯 Key Idea

👉 Default routing = Fallback path for unknown networks
👉 Router = Uses it when no route is found


 

🛠 Static Routing Configuration (Syntax & Steps)

 

📖 Introduction

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.

 

📌 Static Routing Syntax

The basic syntax used to configure static routing in a router is:

ip route <destination-network> <subnet-mask> <next-hop / exit-interface>

 

🔍 Explanation of Syntax

  • ip route → command used to configure a static route 
  • destination-network → the network where data needs to go 
  • subnet-mask → defines the size of that network 
  • next-hop → IP address of the next router
    OR 
  • exit-interface → interface through which packet will leave 

 

📊 Example

ip route 192.168.2.0 255.255.255.0 10.0.0.2

👉 Meaning:

  • Destination network → 192.168.2.0 
  • Subnet mask → 255.255.255.0 
  • Next hop → 10.0.0.2 

👉 The router will send all packets for this network to 10.0.0.2.

 

🔄 Types of Static Route Configuration

Static routes can be configured in two ways:

1️⃣ Using Next-Hop IP Address

ip route 192.168.2.0 255.255.255.0 10.0.0.2

👉 Router sends packet to next router

 

2️⃣ Using Exit Interface

ip route 192.168.2.0 255.255.255.0 g0/0

👉 Router sends packet through specified interface

 

🧠 Concept

Before configuring static routing, we must:

  • Know all network IP addresses 
  • Understand topology 
  • Identify next hop routers 

 

🔧 Step-by-Step Configuration

1️⃣ Enter Privileged Mode

Router> enable

👉 This command gives administrative access

 

2️⃣ Enter Global Configuration Mode

Router# configure terminal

👉 Used to configure router settings

 

3️⃣ Configure Static Route

Router(config)# ip route <destination-network> <subnet-mask> <next-hop>

👉 This is the main step where routing is defined

 

4️⃣ Exit Configuration Mode

Router(config)# end

👉 Returns to privileged mode

 

5️⃣ Verify Configuration

Router# show ip route

👉 Displays routing table

Router# show running-config

👉 Shows configured routes

 

📊 Complete Example

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

  • Next hop must be reachable 
  • Interfaces should be up (use no shutdown) 
  • IP addresses must be correct 
  • Wrong configuration will cause communication failure 
     

 

🚀 Practical Implementation of Static Routing in 4 LAN Network

 

🌐 Introduction

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.

 

 

🖼️ Network Topology

 

👉 This topology contains:

  • LAN 1 → 192.168.100.0/24 
  • LAN 2 → 192.168.101.0/24 
  • LAN 3 → 192.168.102.0/24 
  • LAN 4 → 192.168.103.0/24 

👉 Routers used:

  • GATEWAY1 
  • ROUTER1 
  • GATEWAY2 

 

📡 IP Addressing Overview

 

LANNetwork AddressRouter Interface
LAN 1192.168.100.0/24GATEWAY1 (Fa0/0)
LAN 2192.168.101.0/24Between GATEWAY1 & ROUTER1
LAN 3192.168.102.0/24Between ROUTER1 & GATEWAY2
LAN 4192.168.103.0/24GATEWAY2 (Fa0/0)

 

⚙️ Router Configurations :-

 

🔹 GATEWAY1 Configuration :

 

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

 

🔹 ROUTER1 Configuration :

 

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

 

🔹 GATEWAY2 Configuration :

 

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

 

 

🖼️ Connectivity Test

 

 

 

👉 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.

 

 

🖼️ Routing Table Verification

 

 

👉 From the routing table, we can see:

  • Directly connected networks 
  • Static routes (marked with S)  
  • Next hop addresses 

This confirms that routes are properly configured.

 

🎯 Key Understanding

  • Each router knows only directly connected networks by default 
  • Static routes are added to reach other networks 
  • Next hop tells the router where to send packets 
  • All routers must be configured properly for full connectivity 

 

🎯 Summary

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.