%% fig-alt: "DSR route caching through overhearing. Node A sends data to F via route [B,D,F]. Node C, positioned near Node B, overhears the transmission and extracts route information. Node C caches multiple learned routes: complete route to F via [B,D,F], partial route to D via [B,D], and neighbor discovery that B is adjacent to A. This passive learning reduces future route discovery overhead."
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#7F8C8D'}}}%%
graph TB
subgraph Scenario["Route Caching Scenario"]
A["Node A"] -->|"DATA to F via B-D-F"| B["Node B"]
B --> D["Node D"]
D --> F["Node F"]
C["Node C<br/>Overhears"]
end
B -.->|Overhears| C
subgraph Cache["Node C's Cache"]
C1["Route to F:<br/>via B-D-F"]
C2["Route to D:<br/>via B-D"]
C3["B is neighbor<br/>of A"]
end
C --> Cache
style A fill:#16A085,stroke:#2C3E50,color:#fff
style B fill:#16A085,stroke:#2C3E50,color:#fff
style C fill:#E67E22,stroke:#2C3E50,color:#fff
style D fill:#16A085,stroke:#2C3E50,color:#fff
style F fill:#16A085,stroke:#2C3E50,color:#fff
style C1 fill:#2C3E50,stroke:#16A085,color:#fff
style C2 fill:#2C3E50,stroke:#16A085,color:#fff
style C3 fill:#2C3E50,stroke:#16A085,color:#fff
251 DSR Caching and Route Maintenance
251.1 Learning Objectives
By the end of this chapter, you will be able to:
- Evaluate Route Caching: Assess benefits and drawbacks of route caching in different mobility scenarios
- Design Cache Strategies: Select appropriate caching strategies based on network mobility characteristics
- Understand Route Maintenance: Explain how DSR detects and recovers from link failures
- Apply DSR Optimizations: Implement optimization techniques for IoT deployments
- Troubleshoot DSR Networks: Diagnose stale routes, broken paths, and discovery failures
251.2 Prerequisites
Before diving into this chapter, you should be familiar with:
- DSR Fundamentals and Route Discovery: Understanding RREQ/RREP mechanisms and source routing is essential for comprehending how cached routes are used and maintained
- Ad Hoc Routing: Proactive (DSDV): Comparing DSDV’s continuous maintenance with DSR’s on-demand approach helps contextualize caching trade-offs
251.3 Route Caching
DSR nodes cache overheard routes for efficiency, reducing the need for repeated route discoveries.
251.3.1 How Route Caching Works
251.3.2 Benefits of Route Caching
- Reduced route discovery overhead: Use cached routes instead of flooding
- Faster communication: Skip discovery phase if route cached
- Learn from others’ communication: Overhear and cache routes
- Multiple routes: Cache alternate paths for redundancy
251.3.3 Cache Management Strategies
- Timeout: Remove stale routes after period of inactivity
- LRU replacement: Evict least recently used when cache full
- Adaptive timeout: Adjust based on node mobility patterns
251.3.4 The Stale Cache Problem
251.4 Route Maintenance
When a cached route breaks, DSR uses Route Error (RERR) messages to notify the source and trigger recovery.
251.4.1 Detecting and Handling Link Failures
%% fig-alt: "DSR route maintenance when link fails. Node A uses cached route [B,D,F] to send data. Data forwards through B to D successfully. When D attempts to forward to F, link is broken (F moved away). Node D detects failure, generates RERR (Route Error) message identifying broken link D-F. RERR propagates back through B to source A. Node A removes invalid route from cache and initiates new RREQ flood to discover fresh route to F."
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#7F8C8D'}}}%%
sequenceDiagram
participant A as Node A<br/>(Source)
participant B as Node B
participant D as Node D<br/>(Detects failure)
participant F as Node F<br/>(Moved away)
Note over A: Using cached route<br/>[B,D,F]
A->>B: DATA for F
B->>D: DATA for F
D-xF: Link broken!
Note over D: Detect failure
D->>B: RERR: Link D-F broken
B->>A: RERR: Link D-F broken
Note over A: Remove route from cache
A->>B: New RREQ for F
Note over A,F: New route discovery
251.4.2 Route Error (RERR) Message
- Generated by node detecting link failure
- Sent back to original source
- Contains broken link identification
- Source removes affected routes from cache
251.5 DSR Characteristics Summary
251.6 DSR Optimizations for IoT
251.6.1 1. Aggressive Route Caching
- Cache every route overheard
- Reduces discovery frequency
- Trade memory for reduced transmissions
251.6.2 2. Piggybacking
- Attach route cache to data packets
- Proactive route dissemination without flooding
- Helps neighbors build route databases
251.6.3 3. Expanding Ring Search
- Limit initial RREQ flood to nearby nodes (TTL=1)
- Expand search radius if no reply
- Reduces flooding for nearby destinations
251.6.4 4. Gratuitous Route Reply
- Intermediate nodes with cached routes reply directly
- Reduces discovery latency
- Risk of stale route if cache outdated
251.7 Knowledge Check
251.8 Summary
This chapter covered DSR route caching and maintenance mechanisms:
- Route Caching Strategy: Nodes cache overheard routes for future reuse, reducing discovery frequency in stable networks but causing stale route problems in mobile environments
- Cache Management: Timeout-based expiration, LRU replacement, and adaptive timeouts based on mobility patterns help balance cache freshness against discovery overhead
- Route Maintenance: Uses RERR (Route Error) messages to notify sources of broken links, triggering cache invalidation and new route discovery if no alternate cached routes available
- Stale Cache Trade-offs: Cache timeout should align with node mobility interval - too long causes stale routes, too short causes excessive discoveries
- Optimization Techniques: Expanding ring search limits flooding, aggressive caching reduces discoveries, gratuitous replies from intermediate nodes lower latency, and piggybacking shares route information
Continue Learning: - DSR Worked Examples - Practical scenarios and calculations
Deep Dives: - Ad Hoc Routing: Proactive (DSDV) - Table-driven continuous route maintenance - Ad Hoc Routing: Hybrid (ZRP) - Balancing proactive and reactive approaches - Multi-hop Fundamentals - Path discovery and forwarding
Implementation: - Ad-hoc Production and Review - Route caching and maintenance strategies - Ad-hoc Labs and Quiz - DSR simulation and testing
251.9 What’s Next
The next chapter provides DSR Worked Examples, with detailed calculations for route discovery latency, cache timeout optimization, energy trade-off analysis, and route error recovery scenarios.