Routing
What is Routing
Routing
Routing is the process of forwarding data packets from one network to another network using the best possible path. It is performed by devices called routers, which analyze the destination IP address and decide where to send the packet next.
1. Basic Concept (Paragraph Explanation)
In computer networks, devices inside the same network can communicate directly. But when data needs to travel between different networks, routing is required. A router connects multiple networks and acts like a traffic manager, ensuring data reaches the correct destination efficiently. It uses logical addressing (IP addresses) instead of physical addresses (MAC).
2. How Routing Works (Step-by-Step)
Let’s understand with a simple flow:
- A source device creates a data packet with destination IP
- It checks whether the destination is in the same network
- If not, it sends the packet to the default gateway (router)
- The router checks its routing table
- It selects the best path (based on metric like hop count, cost, etc.)
- The packet is forwarded to the next router (next hop)
- This process continues until the packet reaches the destination
3. Example
Imagine this network:
- PC1 → 192.168.1.10 (Network A)
- PC2 → 192.168.2.10 (Network B)
- Router connects both networks
👉 Process:
- PC1 wants to send data to PC2
- PC1 sends packet to router (default gateway: 192.168.1.1)
- Router checks routing table
- Router forwards packet to Network B
- PC2 receives the data
✔ This entire process is called routing
Types of Routing
Routing is mainly divided into three types based on how routes are learned and managed in a network.
- Static Routing → Manually configured routes set by the administrator.
- Dynamic Routing → Routes learned automatically using routing protocols.
- Default Routing → A fallback route used when no specific route is available.
1. Static Routing (Manual Routing)
Static routing is a type of routing where routes are manually configured by the network administrator. The router does not change the route automatically even if the network changes.
👉 Explanation
In static routing, the administrator defines the exact path that packets should follow. It is simple and secure because no automatic updates occur, but it is not suitable for large networks. If a link fails, the administrator must manually update the route.
👉 Example:
ip route 192.168.2.0 255.255.255.0 192.168.1.2
Use Case of Static Routing (Detailed Explanation with Examples)
Static routing is best used in networks where the path is fixed, simple, and does not change frequently. Since routes are manually configured, it gives full control to the administrator.
1. Small Networks (Home / Small Office)
In small networks with only a few routers, static routing is easy to configure and manage.
👉 Example:
A small office has 2 networks:
- Network A → 192.168.1.0
- Network B → 192.168.2.0
A single router connects them.
You can manually configure a static route to reach Network B.
No need for complex dynamic routing protocols.
Advantages Disadvantages of Static Routing
1. Simple and Easy to Configure
Static routes are manually added, so they are easy to understand and configure, especially in small networks.
👉 Example: A network with 2 routers can be connected using just one static route.
2. No Bandwidth Usage for Updates
Unlike dynamic routing, static routing does not send routing updates, so it saves network bandwidth.
3. Better Security
Static routes are not shared with other routers, so it reduces the risk of unauthorized route updates or attacks.
4. Full Control Over Routing Path
The administrator decides the exact path for data, giving complete control over traffic flow.
👉 Example: Forcing traffic through a firewall.
5. Low CPU and Memory Usage
No routing protocols are used, so router resources (CPU & RAM) are not heavily used.
6. Predictable Behavior
Routes remain fixed unless manually changed, making the network behavior stable and predictable.
❌ Disadvantages of Static Routing
1. Not Scalable
In large networks, manually configuring routes for many networks becomes difficult and time-consuming.
2. No Automatic Updates
If a link fails, static routes do not change automatically. The administrator must manually update them.
👉 Example: If a route goes down, traffic will fail until fixed.
3. High Maintenance
Any network change (new network, topology change) requires manual reconfiguration.
4. Human Error
Manual configuration increases the chance of mistakes, which can cause network issues.
5. No Load Balancing
Static routing cannot automatically balance traffic across multiple paths like dynamic routing can.
Summary Table
| Advantages | Disadvantages |
|---|---|
| Simple configuration | Not scalable |
| No bandwidth usage | No automatic updates |
| High security | High maintenance |
| Full control | Human errors possible |
| Low resource usage | No load balancing |
| Predictable | Not suitable for large networks |
Dynamic Routing (Automatic Routing)
Dynamic routing allows routers to automatically learn and update routes using routing protocols.
👉 Explanation
In dynamic routing, routers communicate with each other using protocols to share network information. If a network change occurs (like link failure), routers automatically update their routing tables and choose a new best path. This makes it ideal for large and complex networks.
👉 Examples of Protocols:
- OSPF
- RIP
- EIGRP
👉 Example Scenario:
If one route fails, OSPF automatically finds another shortest path.
👉 Use Case:
- Large enterprise networks
- Frequently changing networks
Advantages Disadvantages of Dynamic Routing
Advantages of Dynamic Routing
Dynamic routing uses protocols like RIP, OSPF, and EIGRP to automatically exchange routing information between routers.
1. Automatic Route Updates
Routers automatically learn and update routes. If a network change occurs (link failure or new network), the routing table updates without manual work.
Example:
If Router A loses a link to Router B, it can automatically find another path through Router C.
2. Less Manual Configuration
No need to manually configure routes for every network, which reduces human errors.
3. Better Scalability
Dynamic routing works well in large networks where many routers are connected.
Example:
In a company with 100+ routers, dynamic routing saves a lot of time compared to static routing.
4. Supports Load Balancing
Some dynamic routing protocols can use multiple paths to send traffic.
Example:
OSPF can send traffic through two equal-cost paths.
5. Fault Tolerance (High Availability)
If one path fails, the router automatically selects another best path.
Disadvantages of Dynamic Routing
1. High CPU and Memory Usage
Routers need more processing power to calculate routes and run routing protocols.
2. Network Bandwidth Usage
Routing protocols send updates periodically, which consumes bandwidth.
Example:
RIP sends updates every 30 seconds, even if no changes occur.
3. Complex Configuration
Dynamic routing protocols are more complex than static routing.
Example:
Configuring OSPF requires understanding areas, LSAs, and cost.
4. Slower Convergence (in some protocols)
It may take time for routers to learn new routes after a change.
Example:
RIP takes longer to converge compared to OSPF.
5. Security Risks
Dynamic routing can be vulnerable if not properly secured.
Example:
Unauthorized routers can send false routing updates.
Summary Table
| Feature | Dynamic Routing |
|---|---|
| Configuration | Easy (automatic) |
| Maintenance | Low |
| Scalability | High |
| Resource Usage | High |
| Convergence Speed | Medium (depends on protocol) |
| Security | Needs configuration |
Default Route
What is a Default Route
A default route is a routing rule used by a router to forward packets when there is no specific route available for the destination network in its routing table. It acts as a “last option” path, ensuring that data can still be sent even when the router does not know the exact route. The default route is represented as 0.0.0.0/0, which matches all IP addresses. For example, in a home network, a router may have routes only for local networks like 192.168.1.0/24, but when a user tries to access a website like Google (8.8.8.8), the router does not have a specific route for it. In this case, the router forwards the packet to the default route, usually pointing to the ISP router (e.g., 10.0.0.1), which then handles the packet and sends it toward the internet.
Why Do We Need a Default Route?
A default route is needed because a router cannot store routes for every possible network, especially the entire internet. Instead of keeping thousands of routes, the router uses a default route (0.0.0.0/0) to forward all unknown traffic to a specific next-hop router (usually the ISP).
Main Reasons
1. Simplifies Routing
Without a default route, you would need to manually configure routes for every destination network, which is not practical.
2. Enables Internet Access
Your router does not know all internet networks, so it sends unknown traffic to the ISP using the default route.
3. Reduces Routing Table Size
Only one default route is needed instead of storing many routes.
4. Useful for Small/Stub Networks
Networks with only one exit path use default routing for simplicity.
Without Default Route (Problems )
If a router does not have a default route, it can only send packets to networks that are already listed in its routing table. Any unknown destination will cause problems.
1. Packet Dropping
When a packet arrives:
- Router checks routing table
- No matching route found
- No default route available
👉 Result: Packet is dropped
2. No Internet Access
Routers in small networks (home/office) usually don’t know internet routes.
❌ Without default route:
- Cannot reach websites (Google, YouTube, etc.)
- Internet completely fails
3. Limited Communication
Router can only communicate with:
- Directly connected networks
- Manually configured routes
👉 Cannot reach external or unknown networks
Default Route vs Static Route vs Dynamic Routing (Chart)
| Feature | Default Route | Static Route | Dynamic Routing |
|---|---|---|---|
| Definition | Route used when no specific path is found | Manually configured route to a specific network | Routes learned automatically using protocols |
| Route Example | 0.0.0.0/0 | ip route 192.168.2.0 255.255.255.0 10.0.0.2 | Learned via OSPF, RIP, EIGRP |
| Configuration | Very simple (one command) | Manual configuration required | Complex configuration |
| Routing Updates | No updates (fixed path) | No updates (manual changes) | Automatic updates |
| Routing Table Size | Very small | Medium (depends on entries) | Large (many routes learned) |
| Scalability | Low | Medium | High |
| CPU/Memory Usage | Very low | Low | High |
| Path Selection | No intelligence (single path) | Fixed path | Best path calculated automatically |
| Failure Handling | No automatic recovery | No automatic recovery | Automatic rerouting (high availability) |
| Best Use Case | Small networks, internet access | Small/medium networks, specific control | Large and complex networks |
| Example Use | Home router → ISP | Company connecting two branches | ISP networks, enterprise networks |
Quick Summary (Easy to Remember)
- Default Route 👉 “Send everything unknown here”
- Static Route 👉 “Manually defined fixed path”
- Dynamic Routing 👉 “Automatically learns best path”
IGP and EGP Protocols
IGP (Interior Gateway Protocol)
IGP is a type of routing protocol used to exchange routing information within a single Autonomous System (AS), such as a company network or an organization. It helps routers inside the same network communicate and find the best path for data transmission. IGP protocols automatically update routing tables and adapt to network changes. Common IGP protocols include RIP, OSPF, EIGRP, and IS-IS. For example, in a company with multiple routers across different departments, IGP is used to manage internal traffic efficiently.
EGP (Exterior Gateway Protocol)
EGP is used to exchange routing information between different Autonomous Systems (AS), such as between different organizations or over the internet. It helps routers decide how to route data across large, complex networks like the global internet. The most important EGP protocol is BGP (Border Gateway Protocol), which is used by ISPs and large networks. For example, when data travels from your ISP to another ISP to reach a website, BGP is used to determine the best path.
Key Difference
The main difference between IGP and EGP is that IGP works within a single network (inside an AS), while EGP works between different networks (between AS). IGP is faster and simpler, whereas EGP is more complex and designed for large-scale routing like the internet.
Types of IGP Protocols (Interior Gateway Protocols)
IGP protocols are mainly classified based on how they calculate routes and share routing information inside a network. There are three main types of IGP protocols:
1. Distance Vector Protocols
Distance Vector protocols determine the best path based on distance (hop count) and direction. Each router shares its entire routing table with its directly connected neighbors at regular intervals. The routers do not have full knowledge of the network topology; they only know the distance to a destination and the next hop.
A common example is RIP (Routing Information Protocol), which uses hop count as a metric. If a route has too many hops, it is considered unreachable. These protocols are simple to configure but have disadvantages like slow convergence and routing loops, making them less suitable for large networks.
2. Link-State Protocols
Link-State protocols work by sharing detailed information about the state of each link in the network. Every router creates a complete map (topology) of the network and calculates the shortest path using algorithms like Dijkstra’s algorithm.
Examples include OSPF (Open Shortest Path First) and IS-IS (Intermediate System to Intermediate System). These protocols provide fast convergence, better scalability, and more efficient routing. They are widely used in large enterprise and service provider networks because they quickly adapt to network changes.
3. Hybrid Protocols
Hybrid protocols combine features of both Distance Vector and Link-State protocols. They use advanced algorithms and metrics to make routing decisions more efficiently.
The main example is EIGRP (Enhanced Interior Gateway Routing Protocol). It uses metrics such as bandwidth, delay, reliability, and load to select the best path. EIGRP offers fast convergence, reduced bandwidth usage, and high performance, making it more efficient than traditional distance vector protocols.
Summary
The three types of IGP protocols—Distance Vector, Link-State, and Hybrid—differ in how they exchange routing information and calculate the best path. Distance Vector is simple but slower, Link-State is fast and scalable, and Hybrid provides a balance of both with improved performance.
Types of EGP Protocols (Exterior Gateway Protocols)
Exterior Gateway Protocols (EGP) are used for routing between different autonomous systems (AS), such as communication between different organizations, ISPs, or large networks on the internet.
1. Path Vector Protocol
The main and most widely used type of EGP is the Path Vector protocol. It maintains the path (list of AS numbers) that data must travel to reach a destination. Instead of just calculating distance or topology, it records the entire route path, which helps in avoiding routing loops and making better routing decisions.
The most important example is BGP (Border Gateway Protocol). BGP is used on the internet to exchange routing information between ISPs. It selects the best path based on attributes like AS path, next hop, policies, and rules, rather than just shortest distance. BGP is highly scalable and is the backbone of internet routing.
2. Classic EGP (Old EGP Protocol)
The original EGP (Exterior Gateway Protocol) was an early protocol used before BGP. It worked in a simple way where routers only checked whether a network was reachable or not, without calculating the best path.
However, this protocol had many limitations:
- No support for complex routing decisions
- Poor scalability
- Not suitable for modern internet
Because of these drawbacks, it is now obsolete and has been completely replaced by BGP.
Summary
There are mainly two types of EGP protocols:
- Path Vector Protocol (BGP) – Modern, powerful, and widely used
- Classic EGP – Old and no longer used
Today, BGP is the only standard EGP protocol used for
Routing Table
The routing table, an essential part of network devices, is a set of rules that directs where to send data packets (information sent between computers) over an IP network, identifying which physical interfaces the data packet should use while traveling from one device to another. If the data packet is meant for an external network or a different subnet, then the routing table sends it to the gateway.
Updated through manual manipulation by a network administrator or through network routing protocols and stored within the random access memory (RAM) of storage devices like network switches and routers, routing tables are individually unique, and each works as a network address map, storing source and destination IP addresses, routing information, and the addresses for default gateways. Ultimately, this helps computers communicate with other devices on different networks, expanding the distance at which networks can interact with each other.
What is a Routing Table?
A routing table is a data table stored inside a router (or a computer) that contains information about available network destinations and the paths to reach them. It helps the router decide where to send incoming data packets so they reach the correct destination efficiently.
1. Basic Concept
Whenever a router receives a packet, it checks its routing table to determine the best path to forward that packet. The routing table acts like a map of the network, showing different routes and how to reach them.
👉 Example:
If a packet needs to go to network 192.168.2.0, the router looks into its routing table and finds the best next hop to send that packet.
2. Information Stored in a Routing Table
A routing table typically contains the following details:
- Destination Network – The target network address
- Subnet Mask – Defines the network size
- Next Hop – The next router or gateway
- Interface – The exit interface (like FastEthernet, GigabitEthernet)
- Metric – Cost of the route (hop count, bandwidth, delay, etc.)
3. Types of Routes in Routing Table
Routing tables can include different types of routes:
- Static Routes – Manually configured by the administrator
- Dynamic Routes – Learned from routing protocols (like OSPF, RIP, EIGRP)
- Default Route – Used when no specific route is found (0.0.0.0/0)
How Does a Routing Table Work
The goal of a routing table is to help routers determine the most effective routes for data packets. When sending data packets to host devices or other networks, routers consult routing tables to attain the IP addresses and best paths. Routing tables direct the packets to the appropriate neighboring router or next hop, eventually getting the packet to its intended destination. The entire process can happen incredibly fast, with a router consulting its routing table over a million times per second.
Network routing protocols help to keep routing tables updated and determine where data packets go. Two types of routing protocols exist to maintain the routing tables:
Static routing protocols: Static routing protocols use routes that network administrators manually input, giving routers information on how to reach different network IDs within the more extensive network. This protocol works best with preconfigured routes on the same subnet but falters when communication expands beyond the subnet. Since routers do not share static routes, static routing can conserve overhead and bandwidth. Static routing protocols are typically best used in smaller networks, as every entry requires manual entry and updates to function.
Dynamic routing protocols: Dynamic routing protocols, such as routing information protocol (RIP) and open shortest path first (OSPF), automatically create and maintain the routing table. They work automatically to communicate using routing protocols instead of a network administrator. It allows dynamic routing protocols to automatically change routes when better routes are available. This makes dynamic routing a better fit for larger organizations since automatic routing eliminates manual human interaction.
However, another protocol combines dynamic and static protocols since they connect interior autonomous systems to external networks.
Automatic routing
Automatic routing occurs when small networks contain one router. This low-level routing mechanism is helpful because it limits routing packets’ cycles and storage requirements. Automatic network routing involves fast packet switching, no-session awareness, and source routing through end nodes.
In automatic routing, the router handles all routing protocols without manually managing or maintaining the routing table. Automatic routing often works with networks that have a single router, since they cannot add additional routing information that is not already available on the router.
Route determination
The routing table is important because it determines the network route that data packets follow. Before route determination occurs, the packet is sent to the router and receives an IP address to help dictate the best route. The router receives this data packet and references it against the routing table, using the table to send the packet closer to its destination. Each router tries to get the package to the next hop, consulting the routing table of every router and trying to use the fewest hops. The packet reaches its destination when the destination IP address matches the network that receives it.
What comprises a routing table?
Data tables require specific information to send packets to where they need to go. Let’s examine some of the information that comprises a routing table.
Network ID: A network ID contains the host ID and information on the route to the destination.
Destination address: A destination address is the final IP address for the device’s network that requested the packet.
Subnet mask: A subnet mask is a 32-bit netmask that matches the destination address to the IP address, indicating whether or not the destination address is in the network. Subnetting can divide networks into smaller, more connected networks.
Metric: The metric gives each route a value that determines some routes’ preference level or priority over others. It does this by measuring how many hops each route contains to reach the intended destination, indicating the minimal number and most efficient route.
Gateway: The gateway is the next hop available, revealing the routing information for the closest neighboring router to which the data packet forwards.
How Does a Routing Table Work 2
A routing table works as a decision-making tool inside a router. Whenever a data packet arrives, the router uses this table to determine the best path to send the packet toward its destination network.
1. Packet Arrival
When a router receives a packet, it first reads the destination IP address from the packet header. This address tells the router where the packet needs to go.
👉 Example:
A packet is sent to 192.168.10.5, so the router focuses on the destination network 192.168.10.0.
2. Searching the Routing Table
The router checks its routing table and compares the destination IP with all available routes. It uses a method called Longest Prefix Match, which means it selects the route with the most specific subnet mask.
👉 Example:
- Route 1:
192.168.0.0/16 - Route 2:
192.168.10.0/24✅ (chosen because it is more specific)
3. Selecting the Best Route
If multiple routes exist, the router chooses the best one based on the metric (cost). Lower metric means a better path.
👉 Metrics may include:
- Hop count (RIP)
- Cost (OSPF)
- Bandwidth & delay (EIGRP)
4. Forwarding the Packet
After selecting the best route, the router forwards the packet to:
- The next hop router, or
- Directly to the destination if it is connected
It sends the packet through the correct exit interface.
5. Using Default Route (If No Match Found)
If the router cannot find a matching route, it checks for a default route (0.0.0.0/0).
👉 If default route exists → packet is forwarded
👉 If no default route → packet is dropped
6. Continuous Updates
Routing tables are updated:
- Manually (static routes)
- Automatically via routing protocols (like RIP, OSPF, EIGRP)
This ensures the router always has the latest network paths.
Routing Table Working with Example
A routing table works by helping a router decide the best path to send data packets from source to destination. It contains a list of networks, next-hop addresses, and metrics that guide the forwarding process.
1. Packet Arrival
When a packet reaches a router, the router first checks the destination IP address in the packet header. This tells the router where the packet needs to go.
👉 Example:
A packet arrives with destination IP 192.168.2.10.
2. Checking the Routing Table
The router looks into its routing table to find a matching network. It compares the destination IP with all available routes using the Longest Prefix Match rule (most specific network).
👉 Routing Table Example:
| Destination Network | Subnet Mask | Next Hop | Interface |
|---|---|---|---|
| 192.168.1.0 | /24 | Direct | Fa0/0 |
| 192.168.2.0 | /24 | 10.0.0.2 | Fa0/1 |
| 0.0.0.0 | /0 | 10.0.0.1 | Fa0/1 |
Here, the router finds that 192.168.2.10 belongs to 192.168.2.0/24.
3. Selecting the Best Route
If multiple matching routes exist, the router selects the one with the lowest metric (cost). In this case, there is only one matching route, so it is selected.
4. Forwarding the Packet
The router forwards the packet to the next hop (10.0.0.2) through interface Fa0/1. From there, the packet continues its journey toward the destination network.
5. Using Default Route (If Needed)
If no specific route matches the destination IP, the router uses the default route (0.0.0.0/0).
👉 Example:
If destination is 8.8.8.8, the router sends it to 10.0.0.1 (default gateway).
6. Real-Life Scenario
Imagine a company network:
- Router A connected to 192.168.1.0 network
- Router B connected to 192.168.2.0 network
When a computer in Network 1 sends data to Network 2:
- Router A checks its routing table
- Finds route via Router B
- Forwards packet to Router B
- Router B delivers it to destination
7. Summary
A routing table works by:
- Receiving the packet
- Checking destination IP
- Finding the best matching route
- Forwarding to next hop or destination
This process ensures that data travels efficiently across networks.
Types of Routing Protocols
Types of routing protocols
Each routing protocol has a different way of selecting the best path to send data packets. Below is a list of popular routing protocols:
- Routing information protocol (RIP)
- Open shortest path first (OSPF)
- Enhanced interior gateway routing protocol (EIGRP)
- Border gateway protocol (BGP)
Let’s look deeper at some standard routing protocols and how they differ.
Routing information protocol (RIP)
RIP is one of the oldest and most widely used routing protocols, and you can use it with local area networks (LANs) and wide area networks (WANs). RIP evaluates networks by sharing their IP address and communicating with them. However, the biggest con of RIP is that it is only useful for small networks since it has a maximum hop count of 15 and uses hop count as its only metric for deciding the best path.
Open shortest path first (OSPF)
OSPF is a widely used interior gateway routing protocol in LAN networks. Routing information through an algorithm called Dijkstra, the OSPF protocol uses link state and the shortest path forward (SPF) algorithm to determine the shortest path of the data packet. Routers share link state information to calculate distances. Unlike RIP, OSPF sends information faster and has no hop count limit, making it more scalable.
Enhanced interior gateway routing protocol (EIGRP)
EIGRP is a routing protocol developed by Cisco that allows for 255 hops and uses autonomous systems. EIGRP has a shorter administrative distance than RIP and OSPF, making it a fast and efficient routing protocol. Using a dependable transport protocol, EIGRP diffuses the update algorithm to create a quicker convergence process. EIGRP stores all routes, not just the best routes, making transfers quick, even if the best route fails. EIGRP is a protocol that only Cisco routers use, so all routers on an EIGRP network must be Cisco.
Border gateway protocol (BGP)
Unlike the previous three routing protocols, which are all interior gateway protocols, BGP is an exterior gateway protocol. BGP can communicate with routers outside of a LAN, making it the protocol used for the internet. BGP chooses the best path forward using path length, origin type, router identification, and neighbor IP addresses to determine routes. Authorizing advanced security, BGP only allows authorized users to alter transfer routes and exchange data, making it a more secure protocol.
Cisco Routing Table
1.0 Interpreting the Components of a Routing Table
1.1 Routing Protocol code
Routing protocol codes are there to indicate how the route was learned. It tells us through what means the route made it’s way onto our routing table. Luckily there is a very handy list of codes and what they mean at the top of the routing table! You will not have this list on the exam.
Each code directly corresponds with the route that is on the same line.
Let’s go over some of the most common routing protocol codes:
| Code | Title | Meaning |
|---|---|---|
| L | Local | Route to an IP address that exists locally on this device. Usually a /32 |
| C | Connected | Route to a network that this device is directly connected to with one of it’s interfaces |
| S | Static | Route that was manually, explicitly configured by a network admin |
| O | OSPF | Route learned dynamically via the Open Shortest Path First (OSPF) routing protocol |
| D | EIGRP | Route learned dynamically via the Enhanced Interior Gateway Routing Protocol (EIGRP) |
| B | BGP | Route learned dynamically via the Border Gateway Protocol (BGP) |
1.2 Destination Network
This is is the portion of routing table entry that tells you for which network this route pertains to. This is what gets compared to each packets layer 3 header, specifically the “Destination IP” portion.
1.3 Next Hop
The next hop, along with the destination network, are arguably the two most important pieces of information you can pull from this table. This is the portion of the entry that indicates what the router will do next with packet whose destination IP address matches the route.
This portion of the entry may contain:
- The next hop IP address (ex. 192.168.12.2)
- The outgoing interface (ex. GigabitEthernet0/2)
- The duration that this entry has been on the table (dynamic routes only)
1.4 Administrative Distance
What does your router do when it learns about the exact same subnet via multiple different sources? It can only pick one! Administrative Distance (AD) is a value that Cisco assigned to various sources of routing information to act as a tie-breaker in this common situation.
The lower the Administrative Distance, the better
Here are the most common AD’s that you need to know
| Protocol | AD |
|---|---|
| Connected | 0 |
| Static | 1 |
| BGP | 20 |
| EIGRP | 90 |
| OSPF | 110 |
Remember, the routing table only shows the best routes to any given destination
If you’re router learns about 192.168.0.0 /24 from three different sources:
- Static (1 AD)
- EIGRP (90 AD)
- OSPF (110 AD)
Only the Static route will show on the table, because that source has the lowest, or best AD.
Once again, AD is used to determine which route source takes priority, as the routing table will only show the best path to any destination.
1.5 Metric
Alright, so if AD is used when we learn about a subnet via different routing sources, what about when we receive multiple routes to the same subnet via the same routing protocol? That is where Metric comes into play.
Metric is a number used internally by each routing protocol to determine the most optimal route
With dynamic routing protocols, you will often be advertised multiple paths to the same destination. Here’s an example of when that would happen
In this situation, the router looks at the metric to determine which route gets installed onto the routing table. Remember, the routing table only shows the best routes.
Remember, lowest metric wins
So, in the example above, R1 would choose R2 as it’s next hop to the 2.2.2.2/32 network, simply because that path has a lower metric value.
1.6 Gateway Of Last Resort
The “Gateway of last resort”, also known as the “default route”, is the place your router will send packets for which it has no other route. The gateway of last resort is a static route that can be configured manually or via DHCP.
ou’ll notice it’s destination network, 0.0.0.0/0 , matches ALL networks
Your PC has a default route, it’s “Default Gateway”. Your home router has a default route to the ISP.
It’s basically: “If you don’t know where to send this, you can send it here as a last ditch effort of delivery”
You might be wondering:
“If that route points everything to a certain address, doesn’t that make all the other routes useless?”
Short Answer: No, it doesn’t, but that question perfectly transitions us to the next topic.
Alright, so now we know how to read the various letters and numbers on the routing table, but how does the router read it?
How does the router choose which route to use?
Lets talk about the various rules and tie-breakers that the router uses to pick its next hop!
2.1 Longest Match
The first thing considered by the router, is how specific the route is. The more specific, the better. This is why having a default route doesn’t take over your whole routing table. Every route is more specific than 0.0.0.0/0, so therefor it only is used when no other route to the destination is present
Here’s an example.
Introduction to Routing
Understanding the Routing Concepts:
This tutorial will guide you through the basic concepts of routing and routing protocols. We aim to clearly explain how networks route data and to prepare you for common interview questions on this topic. Let’s begin with some essential questions to lay a solid foundation
What is routing ?
Routing is the process of determining the path data packets take through a network to reach their destination. Devices within the network, such as routers, carry out this process, and personal computers and other devices equipped with routing capabilities can also perform it. Routing involves analyzing the destination address contained in each packet and using this information, along with a set of rules and routing tables, to decide the best route for the packet. This ensures that data efficiently and accurately reaches its intended endpoint, whether it’s within a local network or across multiple networks.
What is a routing table ?
A router or networked device uses a routing table to list the routes to various network destinations. This table compiles information about all known networks and the best paths to reach them, not just the immediate network topology. It includes the Network addresses, Mask, IP addresses of the next hops, Exit interface along with associated metrics like distance and cost, which help in determining the most efficient path for traffic. If specific routes are not known, the table may also contain default routes, which guide packets toward a preset path when no explicit route exists.
What is Static Routing?
In static routing, a network administrator manually configures and enters network routes into the router’s routing table. Instead, a network administrator sets up each static route to define a specific path for data to travel between devices, and these routes remain unchanged unless manually altered. Static routing characterizes itself by its simplicity and direct approach, explicitly defining each path for packets to follow. This method does not involve dynamic protocols to update or exchange routes between routers.
Advantages of Static Routing:
Static routing offers several key benefits that make it suitable for certain network environments. First, implementing this method is straightforward and doesn’t require the computational overhead associated with dynamic routing protocols. This makes it ideal for smaller networks or scenarios where network traffic patterns are predictable and stable. Static routing allows network administrators to exercise a high level of control over the paths, determining precisely how traffic is routed through the network. This control ensures predictable traffic flows and facilitates easier network management
Limitations of Static Routing:
Despite its benefits, static routing has limitations that may affect its suitability for larger or more dynamic environments. One major drawback is scalability; as networks grow or change, manually updating routes becomes increasingly cumbersome and error-prone. This method also lacks automatic failover capabilities, which means it does not dynamically adapt to network changes, such as link failures. Without manual intervention to reconfigure routes, this can lead to potential disruptions in network connectivity. Additionally, the manual configuration process, while straightforward, requires a thorough understanding of the network’s architecture to avoid misconfigurations that could lead to suboptimal paths and network performance issues.
What is Dynamic Routing?
Dynamic routing is a method that enables routers to automatically discover and maintain routes using various protocols. Unlike static routing, where administrators manually set routes that remain unchanged, dynamic routing actively adjusts to network conditions like link failures or congestion, finding new optimal paths dynamically.
How Does Dynamic Routing Work?
Dynamic routing uses different protocols, each designed for specific network scenarios. These protocols include RIP (Routing Information Protocol), OSPF (Open Shortest Path First), EIGRP (Enhanced Interior Gateway Routing Protocol), ISIS (Intermediate System to Intermediate System), and BGP (Border Gateway Protocol). These protocols help routers to share information about changes in network topology, manage the topology information efficiently, and maintain up-to-date routing tables. The process typically involves discovering neighboring routers, exchanging network information to assess available paths, and selecting the best route based on the protocol’s specific algorithm.
Advantages of Dynamic Routing:
Dynamic routing offers significant flexibility and scalability, making it ideal for large and complex network environments where network traffic and topology can change frequently. It reduces network downtime by automatically rerouting traffic around failed links or congested areas, thus enhancing the resilience and reliability of the network. Furthermore, dynamic routing optimizes the use of network resources by adjusting routes based on current network conditions, which improves overall network performance and efficiency.
Limitations of Dynamic Routing:
Despite its benefits, dynamic routing also presents several challenges. The complexity o protocols can make them difficult to configure and manage, particularly in very large networks. These protocols are resource-intensive, requiring more CPU power and memory on routers due to the need to process frequent updates and maintain complex algorithms. Additionally, if not properly secured, dynamic routing can expose networks to certain types of security vulnerabilities and attacks.
Dynamic routing is an essential tool for network administrators, allowing for efficient and adaptive network management in variable conditions. Understanding the deployment and management of protocols is crucial for designing networks that are both robust and flexible.