How to Start DSDV Protocol Projects Using NS2

To start Destination-Sequenced Distance-Vector (DSDV) protocol using NS2 which is a table-driven routing protocol leveraged for mobile ad-hoc networks (MANETs) utilises a series of number that helps to preventing the routing loops. To execute the DSDV protocol projects encompasses for replicating a network, setting up DSDV, and examining their performance in diverse scenarios within NS2. Below is a basic procedure to get started:

Steps to Start DSDV Protocol Projects in NS2

  1. Understand DSDV Protocol

Following is a DSDV protocol’s crucial aspects:

  • Proactive (table-driven) routing protocol.
  • It sustains the routing tables using shortest path to each destination.
  • It consumes the series of numbers to make sure route freshness and prevent loops.
  • Periodic updates are transmitted for sustaining the consistency.
  1. Set Up NS2
  1. Install NS2:
    • We can set up NS2 using the version of NS2.35 on Linux for the best results.
  2. Verify Installation:
    • Execute a simple simulation script for making sure that NS2 is properly installed.
  1. Define Your Project Objectives

Focus on the certain areas for defining the projects goals:

  • Performance Analysis:
    • Measure the performance parameters such as packet delivery ratio (PDR), end-to-end delay, and routing overhead for analysis.
  • Protocol Optimization:
    • Fine-tune or refine the DSDV for minimizing routing overhead or enhancing the scalability.
  • Scenario Simulation:
    • Experiment DSDV protocol in diverse simulation scenarios like node mobility, varying traffic loads.
  1. Create a TCL Simulation Script

Inscribe a simulation tcl script for executing the DSDV protocol.

Example: Basic DSDV Simulation

  1. Define Network Topology:
    • Make a network topology that contains nodes and describe its mobility models.

set ns [new Simulator]

set nf [open out.nam w]

$ns namtrace-all $nf

set n1 [$ns node]

set n2 [$ns node]

set n3 [$ns node]

$ns duplex-link $n1 $n2 1Mb 10ms DropTail

$ns duplex-link $n2 $n3 1Mb 10ms DropTail

  1. Configure DSDV as the Routing Protocol:
    • Configure DSDV for the simulation which is a routing protocol.

set val(rp) DSDV ;# Specify DSDV as the routing protocol

  1. Set Traffic Patterns:
    • Integrate sources of traffic like TCP, UDP.

set udp [new Agent/UDP]

$ns attach-agent $n1 $udp

set null [new Agent/Null]

$ns attach-agent $n3 $null

$ns connect $udp $null

set cbr [new Application/Traffic/CBR]

$cbr set packetSize_ 512

$cbr set interval_ 0.1

$cbr attach-agent $udp

  1. Define Mobility:
    • Combine a movement models for nodes.

$ns at 5.0 “$n1 setdest 100 200 10.0”

$ns at 10.0 “$n2 setdest 200 100 15.0”

  1. Run the Simulation:
    • Set the simulation duration and output trace files to execute the simulation.

set tracefile [open out.tr w]

$ns trace-all $tracefile

$ns at 50.0 “finish”

proc finish {} {

global ns nf

$ns flush-trace

close $nf

exec nam out.nam &

exit 0

}

$ns run

  1. Analyze the Trace Files

NS2 makes trace files (out.tr) that has in-depth records about the network events. Examine these files for measuring the performance of DSDV.

Example Analysis:

  1. Packet Delivery Ratio (PDR):
    • Assess the percentage of packets that are effectively received to the total transmitted packets:

awk ‘{ if ($1 == “r” && $4 == “AGT”) recd++; if ($1 == “s” && $4 == “AGT”) sent++ } END { print “PDR:”, recd/sent*100 “%” }’ out.tr

  1. End-to-End Delay:
    • From source to destination node, we can compute the average delay of packets.
    • Obtain timestamps for transmitted and received packets from the trace file.
  2. Routing Overhead:
    • Estimate the volume of routing packets that are generated for routing overhead:

awk ‘{ if ($4 == “RTR” && $7 == “DSDV”) count++ } END { print “Routing Overhead:”, count }’ out.tr

  1. Visualize Results
  1. Use NAM (Network Animator):
    • Envision the node movement, packet flow, and routing behaviors to utilising NAM:

nam out.nam

  1. Plot Metrics:
    • Graph the performance indicators like PDR vs. mobility, delay vs. node density leveraging external tools such as Python, MATLAB, or Excel.
  1. Extend the Project
  1. Modify DSDV Parameters:
    • Alter the DSDV metrics such as update intervals or series of number approaches for examining the effect of performance.
  2. Simulate Larger Networks:
    • Maximize the volume of large network nodes and experiment the scalability.
  3. Introduce Fault Scenarios:
    • We can replicate link failures or node failures to experiment the retrieval approaches of DSDV under fault scenarios.
  4. Enhance DSDV:
    • We need to prolong the DSDV optimizations, like
      • Minimizing update frequency.
      • Enhancing route selection strategies.
      • To add energy efficiency.
  1. Compare DSDV with Other Protocols

Replicate other routing protocols like AODV, DSR for equating its performance with DSDV protocol in same situations.

  1. Document the Project

For research or project purposes, we can contain:

  • Project’s goals and problem definition.
  • Simulation setup and configurations.
  • Outcomes and performance analysis.
  • Insights and conclusions.
  • Potential enhancements and advanced work.

Example Project Ideas

  1. Performance Analysis of DSDV:
    • We will measure the DSDV performance in diverse node densities and mobility models.
  2. Energy-Efficient DSDV:
    • We can intend the improvements for reducing energy utilization within mobile networks.
  3. Fault-Tolerant DSDV:
    • Experiment and enhance the performance of DSDV including often link failures in scenarios.
  4. Comparison with Reactive Protocols:
    • We will equate the DSDV protocols with other reactive protocols like AODV and DSR’s scalability, delay, and overhead.
  5. DSDV in IoT Networks:
    • We can delve into the DSDV applications including constrained devices in IoT scenarios.

In this simulation, you can observe how to start, simulate and analyse the DSDV protocol projects that contains essential concepts with sample coding and advanced project ideas of this protocol using NS2 environment. Based on your requirements, we can ready to extend this project further.