How to Simulate Interior Gateway Routing Protocol Using NS2

To simulate Interior Gateway Routing Protocol (IGRP) projects in NS2 has includes to design the behaviour of a distance-vector routing protocol. Since NS2 does not directly support IGRP, we can replicate similar behaviour using protocols such as Routing Information Protocol (RIP), that is also a distance-vector routing protocol and distribute several features with IGRP.

IGRP was intended by Cisco by the way of a distance-vector protocol for routing in an autonomous system. It utilizes the parameters such as bandwidth, delay, reliability, and load to regulate the optimal path. RIP, alteration, utilizes hop count as a parameter; however it can still serve as a good approximation for replicating an IGRP-like behaviour in NS2.

To replicate IGRP or IGRP-like behaviour in NS2, follow the steps below. If we have an IGRP patch or extension, we need to utilize it. Then, we can replicate the behaviour using RIP as a proxy.

Steps to Simulate IGRP Projects Using NS2

  1. Install NS2

Ensure NS2 is installed on the system.

  1. TCL Script for Simulating IGRP-like Behavior Using RIP

In this instance, we simulate the IGRP protocol by using RIP as a proxy. RIP is also a distance-vector protocol and can be utilized to replicate the dynamic exchange of routing tables and path selection according to hop count. If we have an IGRP-specific patch, we can replace RIP with IGRP.

Here is an instance of TCL script that configures a simple RIP-based network that approximates the behaviour of IGRP.

Example TCL Script for IGRP-like Simulation Using RIP

# Create a simulator object

set ns [new Simulator]

# Open files for tracing and NAM visualization

set tracefile [open igrp_simulation.tr w]

$ns trace-all $tracefile

set namfile [open igrp_simulation.nam w]

$ns namtrace-all $namfile

# Define network topology and setup the nodes

set topo [new Topography]

$topo load_flatgrid 1000 1000

# Create nodes

set node_count 4

for {set i 0} {$i < $node_count} {incr i} {

set node($i) [$ns node]

}

# Define link parameters: bandwidth, delay, and queue type

set bw 10Mb

set delay 10ms

set queue DropTail

# Create links between nodes (simulating the IGRP-like behavior using RIP)

$ns duplex-link $node(0) $node(1) $bw $delay $queue

$ns duplex-link $node(1) $node(2) $bw $delay $queue

$ns duplex-link $node(2) $node(3) $bw $delay $queue

$ns duplex-link $node(3) $node(0) $bw $delay $queue

# Set routing protocol to RIP (as a proxy for IGRP)

$ns node-config -adhocRouting RIP

# Attach TCP agent to node 0 (source node)

set tcp0 [new Agent/TCP]

$ns attach-agent $node(0) $tcp0

# Attach TCP Sink agent to node 3 (destination node)

set sink [new Agent/TCPSink]

$ns attach-agent $node(3) $sink

# Connect TCP agent and Sink agent

$ns connect $tcp0 $sink

# Create an FTP application over TCP and start traffic

set ftp [new Application/FTP]

$ftp attach-agent $tcp0

$ns at 1.0 “$ftp start”

$ns at 10.0 “$ftp stop”

# End the simulation after 15 seconds

$ns at 15.0 “finish”

# Define the finish procedure

proc finish {} {

global ns tracefile namfile

$ns flush-trace

close $tracefile

close $namfile

exec nam igrp_simulation.nam &

exit 0

}

# Run the simulation

$ns run

  1. Explanation of the Script
  • Simulator Setup: The simulator object is created, and trace and NAM files are opened for logging.
  • Node Creation: Four nodes are generated to replicate a simple network topology.
  • Link Configuration: Links are configuring among the nodes with a bandwidth of 10Mbps, a latency of 10ms, and DropTail queuing.
  • Routing Protocol: The RIP protocol is utilized as a proxy for IGRP, while both are distance-vector protocols. RIP will interchange routing tables with its neighbours; estimate the shortest path (in hops) to each destination.
  • Traffic Generation: FTP traffic is created over a TCP connection from node 0 (source) to node 3 (destination).
  • Simulation End: The simulation executes for 15 seconds, with traffic begins at 1 second and terminates at 10 seconds.
  1. Running the Simulation

Save the above TCL script (e.g., igrp_simulation.tcl) and execute it using NS2 with the following command:

ns igrp_simulation.tcl

This will creates trace files and a NAM visualization file for the simulation.

  1. Analysing the Results
  • NAM Visualization: Open the .nam file in NAM (Network Animator) to envision how packets are routed, and track the dynamic interchange of routing information among nodes.

nam igrp_simulation.nam

  • Trace File Analysis: The .tr file logs events in the simulation, like packet transmissions, routing table updates, and packet forwarding. we can measure the trace file using AWK or Python scripts to extract parameters such as:
    • End-to-End Delay: Time taken for packets to travel from the source to the destination.
    • Packet Delivery Ratio (PDR): Ratio of successfully delivered packets.
    • Routing Overhead: Evaluate the number of routing messages interchanged among nodes to estimate the optimal path.
  1. Performance Metrics for IGRP-like Simulation

When replicating an IGRP, or any distance-vector routing protocol, important parameters that contain:

  • Hop Count: IGRP and RIP estimate the shortest path according to the number of hops. We can evaluate the hop count for each path utilized in the simulation.
  • End-to-End Delay: Assess the time taken for packets to travel via the network.
  • Throughput: Estimate the total amount of data successfully delivered.
  • Routing Overhead: Track the number of routing table updates interchanged among the nodes.
  1. Extending the Simulation

We can expand the IGRP-like simulation by:

  • Dynamic Topology: Establish node or link failures to replicate dynamic changes in the network and track on how the routing protocol variation.
  • Multiple Traffic Flows: incorporate multiple TCP or UDP connections to replicate different kinds of traffic in the network.
  • Link Metrics: Since RIP utilizes hop count, we can adapt the simulation to contain additional parameters such as bandwidth and delay, which are closer to how IGRP works.

With the help of this procedure you can obtain the knowledge and can be able to simulate the Interior Gateway Routing Protocol projects in ns2 tool. Additional specific details regarding the Interior Gateway Routing Protocol project also provided.

Interior Gateway Routing Protocols projects are exclusively conducted by phdprime.com, where we have a proficient team dedicated to executing them using the NS2 tool.Send us all your details by mail we will give you best guidance.

Opening Time

9:00am

Lunch Time

12:30pm

Break Time

4:00pm

Closing Time

6:30pm

  • award1
  • award2