How to Start SD WAN Protocol Projects Using NS2

To start Software-Defined Wide Area Network (SD-WAN) protocol projects in NS2 (Network Simulator 2), which supports to enhance the routing, traffic management, and dynamic path selection applying software-defined control through the WAN networks. Below is an ordered procedure to get started:

Steps to Start SD-WAN Protocol Projects in NS2

  1. Set Up the NS2 Environment

We make sure that NS2 is installed and functioning correctly:

  • On Linux/Ubuntu:

sudo apt-get update

sudo apt-get install ns2 nam xgraph

  • Verify installation:

ns

We can view the % prompt as NS2 is properly installed.

  1. Understanding SD-WAN Concepts

SD-WAN integrate the software-defined networking (SDN) utilising WAN technologies for:

  1. Dynamic Path Selection: Traffic is actively routed through available connections.
  2. Centralized Management: A software-based controller takes decisions for routing.
  3. QoS Management: Give precedence to critical traffic for best performance analysis.
  4. Link Failover and Load Balancing.

Protocols for SD-WAN in NS2:

  • Replicate the SD-WAN-like behavior with the support of Dynamic Routing Protocols like:
    • OSPF (Open Shortest Path First)
    • BGP (Border Gateway Protocol)
    • AODV (Ad hoc On-Demand Distance Vector)
  1. Plan the Network Topology

Create a network topology for simulating the behaviour of SD-WAN:

  • Edge Nodes: Customer or branch office routers.
  • WAN Links: It has several routes with high bandwidth, low bandwidth for selecting the dynamic path.
  • SD-WAN Controller: We can be replicated by a central routing decision approach.
  1. Create a TCL Script for SD-WAN

Here’s a basic NS2 script, which simulates the functionality of SD-WAN using dynamic routing and traffic prioritization.

SD-WAN Simulation Script in NS2

# Initialize the Simulator

set ns [new Simulator]

set tracefile [open sdwan_trace.tr w]

$ns trace-all $tracefile

set namfile [open sdwan_nam.nam w]

$ns namtrace-all $namfile

# Define Colors for Visualization

$ns color 1 Blue

$ns color 2 Red

$ns color 3 Green

# Create Nodes: SD-WAN Edge Nodes and WAN Core

set branch1 [$ns node]

set branch2 [$ns node]

set core1 [$ns node]

set core2 [$ns node]

set controller [$ns node]

# Define Links (WAN Paths)

$ns duplex-link $branch1 $core1 5Mb 10ms DropTail

$ns duplex-link $branch1 $core2 2Mb 20ms DropTail

$ns duplex-link $branch2 $core1 5Mb 10ms DropTail

$ns duplex-link $branch2 $core2 2Mb 20ms DropTail

$ns duplex-link $core1 $controller 10Mb 5ms DropTail

$ns duplex-link $core2 $controller 10Mb 5ms DropTail

# Assign Labels for Nodes

$branch1 label “Branch1”

$branch2 label “Branch2”

$core1 label “WAN-Core1”

$core2 label “WAN-Core2”

$controller label “SD-WAN Controller”

# Dynamic Routing Protocol (Simulating SD-WAN Behavior)

$ns rtproto OSPF

# Define Traffic Sources (UDP/CBR Traffic with QoS Priorities)

set udp1 [new Agent/UDP]

set null1 [new Agent/Null]

$ns attach-agent $branch1 $udp1

$ns attach-agent $branch2 $null1

$ns connect $udp1 $null1

set cbr1 [new Application/Traffic/CBR]

$cbr1 attach-agent $udp1

$cbr1 set packetSize_ 512

$cbr1 set rate_ 1Mb

# Schedule Traffic

$ns at 1.0 “$cbr1 start”

$ns at 9.0 “$cbr1 stop”

# Simulate Controller-Based Path Change

$ns at 3.0 “puts \”SD-WAN Controller: Switching to higher bandwidth link\””

$ns at 3.5 “$ns link-loss $branch1 $core2 100.0” ;# Failover simulation

$ns at 4.0 “$ns link-loss $branch1 $core2 0.0”

# Finish Procedure

proc finish {} {

global ns tracefile namfile

$ns flush-trace

close $tracefile

close $namfile

exec nam sdwan_nam.nam &

exit 0

}

# Run Simulation

$ns at 10.0 “finish”

$ns run

  1. Run the Simulation
  1. We can store the tcl script like sdwan_simulation.tcl.
  2. Then, run the simulation script utilising NS2:

ns sdwan_simulation.tcl

  1. Outputs:
    • Trace File: sdwan_trace.tr which helps to specified records of packets, routes.
    • NAM File: sdwan_nam.nam support for envisioning the network and route selection.
  1. Analyze the Results

Performance Metrics:

  1. Packet Delivery Ratio (PDR): We need to estimate how many packets were sent effectively:

awk ‘BEGIN {sent=0; recv=0} {if ($1==”s”) sent++; if ($1==”r”) recv++}

END {print “PDR:”, recv/sent*100 “%”}’ sdwan_trace.tr

  1. Path Failover Analysis: Verify the trace file for link failures and retrieval time’s analysis.
  2. Throughput: Estimate the entire data that were received over time for simulation.
  3. End-to-End Delay: Compute the average delay transmits and receive times for packet.
  1. Extend the Project
  1. Multiple Traffic Types:
    • We want to integrate the numerous traffic types of FTP (TCP) for critical traffic and CBR (UDP) for non-critical traffic.
  2. QoS Implementation:
    • Give precedence to traffic according to the bandwidth or delay needs.
  3. Link Failover and Load Balancing:
    • During link failures, replicate the dynamic path modifications.
  4. Protocol Comparison:
    • Equate the performance of routing protocols like OSPF and BGP for dynamic routing.
  5. Scalability Testing:
    • Combine additional branches and WAN routes for monitoring the performance of scalability.
  1. Document Results

This project report contains:

  1. Network Topology: Create a network topology with the graph of nodes and links.
  2. Simulation Setup: Configuration of traffic, routing protocols, and bandwidth.
  3. Performance Metrics
    • Estimate the performance parameters such as PDR, throughput, delay, and recovery time in the course of failovers.
  4. Observations:
    • Explanation regarding dynamic path selection behavior and QoS enhancements.

This project delivers wide range of simulation for SD WAN Protocol Projects using NS2 which were simulated and examined the performance outcomes. We plan to deliver the detailed instructions to these projects to in further manual.