How to Start TORA Projects Using NS2
To start a Temporally Ordered Routing Algorithm (TORA) project in Network Simulator 2 (NS2) that is a reactive routing protocol which appropriate for highly dynamic networks such as mobile ad-hoc networks (MANETs). It is created for reducing response to topology changes whereas making sure loop-free routes. We follow this structured approach to get started.
Steps to Start TORA Projects in NS2
Step 1: Set Up NS2 Environment
- Install NS2:
- We can download and install the latest version of NS2 on the system.
- Confirm installation:
ns -version
- Familiarize with NS2 Basics:
- Study basic NS2 scripting to make nodes, links, and traffic flows.
- Discover relevant samples within ns-allinone-2.x/examples/.
Step 2: Understand TORA
- What is TORA?
- TORA is highly adaptive, distributed, and scalable routing protocol.
- It utilises a Directed Acyclic Graph (DAG) rooted for routing on the destination.
- It functions within 3 stages:
- Route Creation
- Route Maintenance
- Route Erasure
- Key Features:
- Reduces network response to topology modifications.
- Loop-free routes.
- Multi-path support for fault tolerance and load balancing.
Step 3: Design Network Topology
- Create Nodes and Links:
- Make the network topology with nodes and links to utilise NS2 Tcl scripting.
set ns [new Simulator]
# Define nodes
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
# Define links with bandwidth and delay
$ns duplex-link $n1 $n2 10Mb 5ms DropTail
$ns duplex-link $n2 $n3 10Mb 10ms DropTail
$ns duplex-link $n3 $n4 10Mb 15ms DropTail
$ns duplex-link $n1 $n3 5Mb 20ms DropTail
- Validate Topology:
- Make sure that have several routes among a few nodes to experiment the route maintenance and elimination approaches of TORA.
Step 4: Configure TORA Routing
- Set TORA as the Routing Protocol:
- TORA is available as a portion of ad-hoc routing protocols in NS2.
$ns node-config -adhocRouting TORA \
-llType LL \
-macType Mac/802_11 \
-ifqType Queue/DropTail/PriQueue \
-ifqLen 50 \
-antType Antenna/OmniAntenna \
-propType Propagation/TwoRayGround
- Create Nodes with TORA:
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
Step 5: Add Traffic Sources
- Define Traffic Flows:
- Connect traffic sources and sinks for replicating data forwarding over network.
# Attach agents
set udp [new Agent/UDP]
$ns attach-agent $n1 $udp
set sink [new Agent/Null]
$ns attach-agent $n4 $sink
$ns connect $udp $sink
# Add CBR application
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set packetSize_ 512
$cbr set interval_ 0.05
$ns at 1.0 “$cbr start”
- Test with Multiple Flows:
- Integrate additional sources and destinations for analysing the performance of TORA in diverse loads.
Step 6: Simulate and Analyze
- Run the Simulation:
- We need to store the script like tora_simulation.tcl and then run the simulation to utilise below command line:
ns tora_simulation.tcl
- Visualize in NAM:
- Monitor TORA’s route creation, maintenance, and erasure to utilise NAM (Network Animator):
nam tora_simulation.nam
- Analyze the Trace File:
- Crucial performance parameters to measure:
- Average end-to-end delay.
- Route creation time.
- Packet delivery ratio.
- Routing overhead.
- Crucial performance parameters to measure:
Step 7: Enhance the TORA Project
- Dynamic Topology Changes:
- Make use of random waypoint or predefined movement patterns to replicate the node mobility:
$n1 setdest 500 500 10
$n2 setdest 300 300 15
- Failure Recovery:
- Launch link or node failures and also monitor routing establishment capabilities of TORA.
- Performance Comparison:
- We can equate the performance of TORA including other routing protocols such as AODV, DSR, or OLSR.
- Scalability Testing:
- Maximize the volume of nodes and traffic flows for analysing stability of TORA.
These steps guides you how to simulate and examine the TORA Projects within NS2 simulation environment through above simulation strategy with sample coding using TCL script with more specifics are forthcoming.