How to Start Temporally Ordered Routing Algorithm Using NS2
To start a Temporally Ordered Routing Algorithm (TORA) project in NS2, which is a distributed routing protocol created for mobile ad-hoc networks (MANETs) and it is specifically matched for networks including frequent topology changes. We follow these comprehensive steps to get started.
Steps to Start Temporally Ordered Routing Algorithm Project in NS2
Step 1: Set Up NS2 Environment
- Install NS2:
- We should install NS2 environment on the system.
- We can install all necessary dependencies like Tcl, OTcl, and NAM.
- Confirm the installation to utilise following code:
ns -version
- Explore Examples:
- Focus on simple routing scripts through ns-allinone-2.x/examples/ for insights to set up routing protocols.
Step 2: Understand TORA
- What is TORA?
- It is a reactive routing protocol created for dynamic networks.
- It launches routes on demand and sustains them waiting they are no longer is required.
- It employs directed acyclic graph (DAG) rooted for routing on the destination.
- Phases of TORA:
- Route Creation: Launch a route for nodes to utilise height parameters.
- Route Maintenance: Actively modify the route in responds to topology changes.
- Route Erasure: It supports to eliminate invalid routes for preventing loops.
- Key Features:
- Supports multipath routing.
- Rapid adaptation to network modifications.
Step 3: Design Network Topology
- Define Nodes and Links:
- Make a MANET environment including wireless nodes.
set ns [new Simulator]
# Configure wireless topology
set opt(chan) Channel/WirelessChannel
set opt(prop) Propagation/TwoRayGround
set opt(netif) Phy/WirelessPhy
set opt(mac) Mac/802_11
set opt(ifq) Queue/DropTail/PriQueue
set opt(ll) LL
set opt(ant) Antenna/OmniAntenna
set opt(x) 1000
set opt(y) 1000
$ns node-config -adhocRouting TORA \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen 50 \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channelType $opt(chan)
# Create nodes
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
- Set Node Positions:
- Locate the nodes within a 2D grid or arbitrary positions:
$n1 set X_ 100
$n1 set Y_ 200
$n1 set Z_ 0
$n2 set X_ 150
$n2 set Y_ 250
$n2 set Z_ 0
$n3 set X_ 300
$n3 set Y_ 350
$n3 set Z_ 0
- Define Traffic Sources:
# Attach UDP agent
set udp [new Agent/UDP]
$ns attach-agent $n1 $udp
set sink [new Agent/Null]
$ns attach-agent $n3 $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”
Step 4: Implement or Configure TORA in NS2
- Use Built-In TORA in NS2:
- NS2 environment has TORA which is a portion of their ad-hoc routing protocols.
- Make sure that the routing protocol is configured to TORA:
$ns node-config -adhocRouting TORA
- Define Traffic Flows:
- Make several traffic flows to experiment the dynamic route establishment of TORA:
set tcp [new Agent/TCP]
$ns attach-agent $n2 $tcp
set sink2 [new Agent/TCPSink]
$ns attach-agent $n4 $sink2
$ns connect $tcp $sink2
set ftp [new Application/Traffic/FTP]
$ftp attach-agent $tcp
$ns at 2.0 “$ftp start”
Step 5: Simulate and Analyze
- Run the Simulation:
- We need to store the script like tora_simulation.tcl and then run the simulation using:
ns tora_simulation.tcl
- Visualize in NAM:
- Monitor how routes are dynamically launched and sustained with the help of NAM (Network Animator):
nam tora_simulation.nam
- Analyze the Trace File:
- Key performance parameters to estimate:
- Routing overhead.
- Packet delivery ratio.
- Route establishment time.
- Average end-to-end delay.
- Key performance parameters to estimate:
Step 6: Enhance TORA Project
- Dynamic Topology:
- Replicate the node mobility to utilise arbitrary waypoint or predefined patterns:
$n1 setdest 500 500 10
- Failure Handling:
- Launch link or node failures to experiment the route maintenance abilities of TORA.
- Performance Comparison:
- Now, equate the performance of TORA with other routing protocols such as AODV or DSR for parameters such as scalability, reliability, and efficiency.
- Advanced Features:
- Integrate the power-aware routing parameters.
- For high-mobility environments, we need to enhance the TORA.
In this demonstration, we presented the step-by-step detailed guide on how to configure and replicate the Temporally Ordered Routing Algorithm and how to analyse and extend these projects using NS2 environment. If you need any extra details on this topic, we will offer it.