Routing All Concepts
Routing All Concepts
Types of Protocols 🔗
Routed Protocols (L3 protocols that assign logical addresses): 🏷️
IP, IPX
Routing Protocols (Build routing tables dynamically): 🔄
RIP, IGRP, OSPF
Metric: Determines best route within a routing protocol (e.g., hop count in RIP, cost in OSPF).
Administrative Distance (AD): Determines best routing protocol when multiple provide the same
route (Lowest AD Wins).
🔗 Connected 0
🔧 Static 1
🏆 EIGRP Summary 5
🌍 External BGP 20
⚡ Internal EIGRP 90
📡 IGRP 100
🔄 OSPF 110
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 1/29
Protocol AD Value
🗺️ IS-IS 115
🔁 RIP 120
🏁 External EIGRP 170
💡 Key Takeaways:
Routers prefer more specific routes (longest prefix match).
Lower Administrative Distance means a more trusted route.
Metrics decide the best route within a single protocol.
Equal-cost routes can be load-balanced.
📌 Command:
bash
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 2/29
120 = Administrative Distance (AD)
1 = Metric (Hop Count)
Selection Criteria 🎯
1️⃣ Prefix-Length (Most Specific Route Wins)
2️⃣ Metric (Lowest Within the Same Protocol Wins)
3️⃣ Administrative Distance (Lowest Across Protocols Wins)
Example Scenario: Routing to 192.168.111.5/24
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 3/29
✅ Step 3: Administrative Distance (Lowest Wins)
OSPF (AD 110) is preferred over RIP (AD 120).
Key Takeaways 💡
Prefix-length (specificity) is always checked first.
Within a routing protocol, the best metric route is chosen.
Across different protocols, the lowest AD is preferred.
AD is only considered if prefix-length is the same.
🔴 Potential Issue: If incorrect assumptions are made, routing errors can occur.
Diagram 🖥️
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 4/29
lua
`+------------+ +------------+
| Router A | <---> | Router B |
+------------+ +------------+
(10.4.0.0/16) (10.2.0.0)
`
Key Takeaways 💡
✅ Classful protocols: Do not send subnet masks, assume defaults.
✅ Classless protocols: Include subnet masks, support VLSM.
✅ Classful routing requires consistent subnet masks across networks.
✅ Using classless protocols (like OSPF, EIGRP) avoids misinterpretation.
arduino
`Router(config)# no ip classless
`
arduino
`Router(config)# ip classless
`
Key Takeaways 💡
✅ Classful routing does not support VLSM, while classless does.
✅ Classful routers may drop packets to unknown subnets, even with a default route.
✅ Classless mode (default in modern IOS) ensures better routing efficiency.
✅ Always use classless routing protocols for more flexible subnetting and scalability.
🔹 Classful routing protocols (e.g., RIPv1) do not send subnet masks in updates.
🔹 Subnet masks are inferred based on the receiving interface.
🔹 Works only if subnets are contiguous and use the same mask.
🔹 Issues arise when networks are non-contiguous, causing incorrect summarization.
Example 1: Working Scenario ✅
✔ Networks are contiguous (10.1.0.0, 10.2.0.0, 10.3.0.0, etc.).
✔ All routers infer the correct subnet mask based on directly connected interfaces.
Router B's Routing Table Output:
shell
`Router(config)# ip classless
`
shell
shell
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 9/29
Key Difference: Routing Protocols vs. Routed Protocols
📌 Routed Protocols (Layer 3): Assign logical addresses & enable communication (e.g., IP).
📌 Routing Protocols: Build & maintain routing tables (e.g., RIP, OSPF, EIGRP).
🛠️ When to Use What?
✅ Use Static Routing for small networks or specific, secure routes.
✅ Use Dynamic Routing for large, complex, and scalable networks.
✅ Combine both using floating static routes for backup paths.
1. Neighbor Table: Lists all neighbors and the interfaces they are connected to.
2. Topology Table: Stores a map of all links in the area, with each link's status.
3. Shortest-Path Table (Routing Table): Stores the best route to each destination.
✔ How it Works:
1️⃣ Link-State Advertisements (LSAs): When the state of a link changes (e.g., interface failure), only the
change is advertised to all routers.
2️⃣ Topology Table: Contains information about every link's state.
3️⃣ Shortest-Path Table: Stores the best path to each destination, calculated using Dijkstra's
algorithm.
✔ Advantages:
⚡ Fast Convergence: Routers update quickly in response to changes.
🔄 No Routing Loops: Because all routers have the same topology table, loops are prevented.
📉 Efficient Bandwidth Usage: Only the changes to links are sent, reducing bandwidth
consumption.
✔ Disadvantages:
🧠 Higher Resource Usage: Requires more CPU and RAM due to maintaining three tables.
✔ Metric:
Typically based on bandwidth (lower cost = better route).
📌 Best For: Larger networks with complex topologies requiring quick adaptation and efficient routing.
Example:
bash
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 12/29
bash
bash
bash
bash
bash
bash
Discarding Traffic:
Direct traffic to a null interface to discard it:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 13/29
bash
📌 Default Routes
A default route (gateway of last resort) forwards traffic to unknown destinations.
bash
⚙️ Summary
Static routes offer granular control and low overhead but lack fault tolerance.
They can be configured with specific next-hop IPs or exit interfaces.
Advanced options like floating static routes, permanent routes, and discard routes provide
flexibility.
Periodic Updates:
RIP sends full routing table updates every 30 seconds.
Metric:
RIP uses hopcount as its metric. The maximum hopcount is 15, and a route with a hopcount of 16
is considered unreachable (infinity metric).
Load Balancing:
RIP supports load balancing across multiple paths (up to 4 paths) with the same hopcount, though
this can lead to congestion on slower links due to equal traffic distribution.
UDP Port 520:
RIP operates on UDP port 520.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 14/29
📌 RIP Characteristics:
Routing Protocol Type: Distance Vector
Administrative Distance: 120 (higher than static and most dynamic protocols)
Maximum Hopcount: 15 hops (anything greater is unreachable)
Protocols Supported: IP and IPX routing
Convergence: RIP can experience slow convergence due to its periodic full-table updates.
Load Balancing Limitation: It can load balance only when the hopcount is equal, which can lead
to performance issues (e.g., slower links congesting faster links in equal metric cases).
⚙️ Summary
RIP is best for smaller networks due to its simplicity but limited scalability.
Its periodic updates, hopcount-based metric, and maximum hopcount of 15 limit its effectiveness
in larger, more complex networks.
📌 Key Differences:
RIPv1: Classful, broadcasts updates, lacks VLSM support.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 15/29
RIPv2: Classless, multicast updates, supports VLSMs, and additional security features
(authentication).
⚙️ Configuration Note
By default, Cisco devices use RIPv1 unless RIPv2 is manually configured.
bash
2. Advertise Networks: Specify the directly connected networks (using classful network boundaries,
no subnet mask):
bash
bash
2. Advertise Networks:
bash
bash
bash
📌 Key Points:
`router rip`:Enables RIP routing protocol.
`network [network address]`: Specifies which directly connected networks to advertise.
Classful routing: RIP advertises networks based on classful boundaries (no subnet mask).
Limitations of RIPv1 🚫
RIPv1 has limitations due to its classful nature, which restricts its ability to handle non-contiguous
subnets and lack of subnet mask information in routing updates. Below is a summary of these
limitations.
Example:
Router A sends a routing update for `10.1.0.0`, and Router B applies the subnet mask of its
directly connected interface to interpret the route. This works as long as the networks are
contiguous.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 17/29
Example:
Router A sends a summarized route `10.0.0.0/8` to Router B because it considers itself a border
router (since `10.1.0.0` and `192.168.123.0` don’t belong to the same classful network).
Router B receives the `10.0.0.0` route without knowing the exact subnet mask, leading to the
inaccurate installation of routes.
📊 Diagram:
The below diagram shows how RIP v1 would summarize routes:
plaintext
💡 Note: In this scenario, Router A and Router C send summarized `10.0.0.0/8` routes to Router B,
which leads to incorrect route installation.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 18/29
📌 Routing Table Updates and Load Balancing
Router B’s Routing Table after receiving the summarized `10.0.0.0/8` route:
Router B installs two equal-metric routes for `10.0.0.0`, one via Router A and the other via
Router C.
Load balancing occurs, where Router B splits traffic evenly between these two routes, even
though they lead to the same summarized network, causing inefficiency and congestion.
Example:
bash
bash
💡 Solution Tip: Consider upgrading to RIPv2 to handle VLSM and more accurate route
summarization, avoiding these issues.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 19/29
RIPv2 Configuration 🔧
RIPv2 overcomes the limitations of RIPv1 by supporting classless routing, which includes the subnet
mask in routing updates.
bash
bash
3. Default Behavior:
By default, RIPv2 still performs auto-summarization at classful boundaries, similar to RIPv1.
4. Disable Auto-Summarization (if necessary):
To avoid auto-summarization and allow RIPv2 to advertise subnetted networks, use the
following command:
bash
`RouterA(config-router)# no auto-summary
`
5. Result:
Once auto-summary is disabled, RIPv2 will send updates including subnetted networks and
their corresponding subnet masks, ensuring accurate network advertisements.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 20/29
📌 Key Points:
RIPv2 includes the subnet mask in updates, allowing classless routing.
Auto-summary is enabled by default, which may cause summarization issues at classful
boundaries.
Disabling auto-summary ensures RIPv2 behaves properly with subnetted networks.
💡 Tip: Disabling auto-summary is critical when using VLSM (Variable Length Subnet Masking) to
ensure accurate routing.
RIP Timers ⏱️
RIP uses four basic timers to manage the state of routes in the routing table. These timers control how
routing information is updated, invalidated, and removed.
📌 RIP Timers:
1. Update Timer (default: 30 seconds)
Controls how frequently the router sends routing updates.
2. Invalid Timer (default: 180 seconds)
Determines how long a route remains valid without new updates. If no update is received, the
route is marked as invalid (metric of 16) and placed in a hold-down state.
3. Hold-down Timer (default: 180 seconds)
Defines how long RIP suppresses a route marked as invalid. The router will not accept any
updates for that route until the hold-down timer expires.
4. Flush Timer (default: 240 seconds)
Specifies how long a route remains in the routing table before being flushed if no updates are
received. This timer runs concurrently with the invalid timer, and the route is flushed 60
seconds after being invalidated.
📌 Key Points:
Timer Synchronization: All RIP routers must have identical timers to avoid network instability.
Invalid Timer: Marks a route as invalid if no updates are received within the specified time.
Hold-down Timer: Prevents the acceptance of new, potentially incorrect updates for routes in
hold-down.
Flush Timer: Removes routes from the routing table after being invalid for a set duration.
💡 Tip: Adjusting timers can help optimize network stability, but they must be consistent across all
routers.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 21/29
📌 Example of RIP Timer Behavior:
Router A receives a RIP update from Router B for the network 172.18.0.0.
Router A adds the network to its routing table:
arduino
Timers Activated:
Invalid Timer: Starts at 180 seconds.
Flush Timer: Starts at 240 seconds.
If no update is received:
Invalid Timer: Marks the route as invalid.
Hold-down Timer: The route enters the hold-down state (180 seconds).
Flush Timer: After 240 seconds, the route is removed from the routing table.
shell
shell
📌 Key Points:
Invalid Timer (180s default): Marks a route as invalid if no updates are received.
Hold-down Timer (180s default): Prevents new updates for invalid routes until the timer expires.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 22/29
Flush Timer (240s default): Removes invalid routes after the timer expires.
Timer Synchronization: All routers in the RIP network must have the same timer settings.
💡 Tip: Adjusting RIP timers can help improve network stability and performance based on your specific
requirements.
📌 Key Points:
Split-Horizon: Stops routing updates from being sent back to the router where the route was
learned.
Route-Poisoning: Instantly marks failed routes as unreachable.
Hold-Down Timers: Stops RIP from accepting new updates for a failed route during a failure
recovery period.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 23/29
These mechanisms work together to prevent loops and improve RIP stability.
💡 Example Scenario:
Router C does not want to send RIP updates on Serial0 but still wants to listen for updates from
Router B.
🔧 Commands:
1. Prevent Updates on a Specific Interface:
Use `passive-interface` to stop updates from being sent out on a specific interface, but still
receive updates.
Command Example:
arduino
scss
📌 Key Points:
Passive Interface: Prevents updates from being sent out a specific interface, while still receiving
them.
Passive-Interface Default: Makes all interfaces passive by default.
No Passive-Interface: Re-enables updates on selected interfaces.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 24/29
RIP Neighbors 🏘️
RIP updates are usually sent as broadcasts (RIPv1) or multicasts (RIPv2). However, you can configure RIP
to unicast updates to specific neighbors for more control over the routing updates.
💡 Example Scenario:
Router B sends RIP updates as unicast to specific neighbors (Router A and Router C), but still
broadcasts or multicasts to all other routers.
🔧 Commands:
1. Configure Neighbors:
Use `neighbor` command to unicast RIP updates to specific neighbors.
Command Example:
arduino
arduino
📌 Key Points:
Neighbor Command: Unicasts RIP updates to specified neighbors.
Passive Interface: Prevents RIP updates from being broadcasted or multicasted, allowing unicast
updates to neighbors.
RIPv2 Authentication 🔐
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 25/29
RIPv2 supports authentication to secure routing updates between routers. Here's a summary of how to
configure it:
arduino
arduino
`RouterA(config)# interface s0
RouterA(config-if)# ip rip authentication key-chain MYCHAIN
RouterB(config)# interface s0
RouterB(config-if)# ip rip authentication key-chain MYCHAIN
`
scss
`RouterA(config)# interface s0
RouterA(config-if)# ip rip authentication mode text
`
arduino
`RouterA(config)# interface s0
RouterA(config-if)# ip rip authentication mode md5
`
📌 Key Points:
Key Chain: Shared authentication key between routers.
Key-String: Specifies the password used for authentication.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 26/29
Authentication Mode: Can be clear text or MD5 encryption (must be the same on both routers).
Interface Configuration: Apply the key chain to interfaces that connect the routers.
arduino
arduino
This command increases the metric by 4 for the 192.168.100.0 network received via Router C
on Serial 1, making Router A's route preferred.
3. Alternatively, Adjust the Metric on Router C:
You can also change the metric on Router C by advertising a higher metric for the route.
Command Example:
arduino
📌 Key Points:
Access List: Defines which route to alter.
Offset-List: Adjusts the metric for the specified route.
Inbound/Outbound: The metric change can be applied inbound (on the receiving router) or
outbound (on the advertising router).
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 27/29
Interoperating between RIPv1 and RIPv2 🔄
RIPv1 and RIPv2 can interoperate with some configuration changes. Here’s how to configure them for
compatibility:
arduino
`RouterA(config)# interface s0
RouterA(config-if)# ip rip send version 2
`
arduino
`RouterB(config)# interface s0
RouterB(config-if)# ip rip receive version 1
`
arduino
`RouterB(config)# interface s0
RouterB(config-if)# ip rip receive version 1 2
`
arduino
`RouterB(config)# interface s0
RouterB(config-if)# ip rip v2-broadcast
`
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 28/29
📌 Key Points:
Per-Interface Configuration: The version of RIP is set on each interface individually.
Version Compatibility: Configuring either router to send or receive different RIP versions ensures
interoperability.
Troubleshooting RIP 🔧
To troubleshoot and gather information on RIP, use the following commands to check the protocol's
settings and routing database:
📌 Key Points:
The `show ip protocols` command provides an overview of RIP timers, version settings, and
routing information.
The `show ip rip database` command reveals all RIP entries, including those not yet in the routing
table.
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 29/29