Adhoc and Sensor Networks Laboratory
IT1003C Laboratory IV (Based on Electives)
Department of Information Technology, Tripura University
IT1003C Laboratory IV (Based on Electives)
Department of Information Technology, Tripura University
Prior Software Installation and Setup
Download and Install VirtualBox (Click here) Tutorial
Download and Install Fedora 13 (fedora13.iso) Tutorial
Download and Install Aqua-Sim (Link to Download)
Commands:
To write TCL Programme: vi filename.tcl
To compile TCL Programme: ns filename.tcl
Experiment 01. Write a TCL script to simulate wireless networks topology with three nodes n0, n1, and n2 where n1 is in the range of n0 and n2. Transfer data between n0 to n1 using FTP application and n2 to n1 using CBR application.
Assume the following for the simulation:
i) Topological area of 500 X 500
ii) Coordinate values of the nodes are (100, 100), (200, 100), and (300, 100)
iii) MAC Protocol: IEEE 802.11
iv) Routing Protocol: AODV
v) Transport Protocol: TCP and UDP (as per application)
vi) Assume the rest of the parameters as per your requirements
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) Observation
Solutions:
exp1_wireless-network.tcl, NAM Output
Experiment 02: Write AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay, and Residual Energy from trace file of the wireless networks i.e. from Experiment 01.
Output:
i) Write 5 lines of trace file
iii) Output of Throughput, PDR, Delay, and Energy
iii) Observation
Solutions:
AWK Script: throughput_wireless.awk, pdr_delay_wireless.awk, energy_wireless.awk
NAM Output: throughput_wireless.png
Experiment 03: Write TCL Scripts to compare MAC (Data Link layer) protocols for wireless networks with varying sensor nodes.
Assume the following for the Simulation:
i) Topology Area: 1000X1000
ii) No of Nodes: 3,6,9,12
iii) MAC protocol: IEEE 802.11, IEEE 802.3, 802.15.4
iv) Routing protocols: AODV
v) Transport Layer protocol: TCP
vi) Application Layer protocol: FTP
vii) Assume the rest of the parameters as per your requirements.
viii) Run AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay and Residual Energy from trace file of the experiment.
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) 4 Tables for Throughput, PDR, Delay and Energy
iv) 4 Graphs for Throughput, PDR, Delay and Energy
v) Observation
Solutions:
TCL Script: ieee_802_11.tcl, ieee_802_15_4.tcl
NAM Output: ieee_802_11.png, ieee_802_15_4.png
Experiment No 04: Write TCL scripts to compare Routing (Network Layer) protocols for wireless networks with variable data rates.
Assume the following for the Simulation:
i) Topology Area: 1000X1000
ii) No of Nodes: 100
iii) MAC protocol: IEEE 802.11
iv) Routing protocols: AODV; DSDV; DSR
v) Transport Layer protocol: TCP
vi) Application Layer protocol: FTP
vii) Data rate: 0.1 to 0.9 with variation of 0.1
viii) Assume the rest of the parameters as per your requirements.
viii) Run AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay and Residual Energy from trace file of the experiment.
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) 4 Tables for Throughput, PDR, Delay and Energy
iv) 4 Graphs for Throughput, PDR, Delay and Energy
v) Observation
Solutions:
TCL Script: aodv.tcl, dsdv.tcl, dsr.tcl
NAM Output: aodv.png, dsdv.png, dsr.png
Experiment No 05: Write TCL scripts to compare Transport Layer protocols for wireless networks with variable data rates.
Assume the following for the Simulation:
i) Topology Area: 1000X1000
ii) No of Nodes: 100
iii) MAC protocol: IEEE 802.11
iv) Routing protocols: AODV
v) Transport Layer protocol: TCP, FTP and Others
vi) Application Layer protocol: FTP, CBR and others
vii) Data rate: 0.1 to 0.9 with variation of 0.1
viii) Assume the rest of the parameters as per your requirements.
viii) Run AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay and Residual Energy from trace file of the experiment.
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) 4 Tables for Throughput, PDR, Delay and Energy
iv) 4 Graphs for Throughput, PDR, Delay and Energy
v) Observation
Experiment No 06: Write a TCL Script to simulate a Terrestrial Wireless Sensor Network environment.
Assume the following for the Simulation:
i) Topology Area: 1000X1000
ii) No of Nodes: 100
iii) MAC protocol: IEEE 802.15.4
iv) Routing protocols: AODV
v) Transport Layer protocol: UDP
vi) Application Layer protocol: CBR
vii) Assume the rest of the parameters as per your requirements.
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) 4 Tables for Throughput, PDR, Delay and Energy
iv) 4 Graphs for Throughput, PDR, Delay and Energy
v) Observation
Solutions:
TCL Script, NAM Output, Trace Output
Experiment 07: Write AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay and Residual Energy from trace file of the Terrestrial Wireless Sensor Networks.
Output:
i) Write 5 lines of trace file
iii) Output of Throughput, PDR, Delay and Energy
iii) Observation
Experiment No 08: Write a TCL Script to simulate an Underwater Wireless Sensor Network environment.
Assume the following for the Simulation:
i) Topology Area: 1000X1000
ii) No of Nodes: 10
iii) Channel: Underwater Channel
iv)Propagation: Underwater Propagation
v) Network Interface: Underwater Phy
iii) MAC protocol: UWAN-MAC
iv) Routing protocols: Vector-based forward
v) Transport Layer protocol: UDP
vi) Application Layer protocol: CBR
vii) Assume the rest of the parameters as per your requirements.
Hints:
set opt(chan) Channel/UnderwaterChannel
set opt(prop) Propagation/UnderwaterPropagation
set opt(netif) Phy/UnderwaterPhy
set opt(mac) Mac/UnderwaterMac/UWANMac
set opt(adhocRouting) Vectorbasedforward ;
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) 4 Tables for Throughput, PDR, Delay and Energy
iv) 4 Graphs for Throughput, PDR, Delay and Energy
v) Observation
TCL Script: uwanmac.tcl
Experiment 09: Write AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay and Residual Energy from trace file of the Underwater Wireless Sensor Networks.
Output:
i) Write 5 lines of trace file
iii) Output of Throughput, PDR, Delay and Energy
iii) Observation
Solutions: throughput.awk, pdr.awk, delay.awk, energy.awk
Experiment 10: Write TCL Scripts to compare clustering protocols for underwater wireless sensor networks with variable data rates.
Solutions:
TCL Script: k-means.tcl KmeansA.tcl
NAM Output: K-means.png K-meansA_2.png
Experiment 11: Write TCL Scripts to compare MAC (Data Link Layer) protocols for underwater wireless sensor networks with variable data rates.
Assume the following for the Simulation:
i) Topology Area: 1000X1000
ii) Data rate: 0.1 to 0.9 with a variation of 0.1
iii) MAC protocol: BMAC, FAMA, RMAC, TMAC, UWAN-MAC
iv) Routing protocols: Vectorbasedforward
v) Transport Layer protocol: TCP
vi) Application Layer protocol: FTP
vii) Assume the rest of the parameters as per your requirements.
viii) Run AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay and Residual Energy from trace file of the experiment.
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) 4 Tables for Throughput, PDR, Delay and Energy
iv) 4 Graphs for Throughput, PDR, Delay and Energy
v) Observation
Solutions:
bmac.tcl, fama.tcl, rmac.tcl, tmac.tcl, uwanmac.tcl
Experiment 12: Write TCL Scripts to compare Routing (Network Layer) protocols for underwater wireless sensor networks with variable data rates.
Assume the following for the Simulation:
i) Topology Area: 1000X1000
ii) Data rate: 0.1 to 0.9 with a variation of 0.1
iii) MAC protocol: BroadcastMac
iv) Routing protocols: hop_by_hop_vbf, vbf_Vectorbasedforward, vbva_VectorbasedVoidAvoidance
v) Transport Layer protocol: TCP
vi) Application Layer protocol: FTP
vii) Assume the rest of the parameters as per your requirements.
viii) Run AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay and Residual Energy from trace file of the experiment.
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) 4 Tables for Throughput, PDR, Delay and Energy
iv) 4 Graphs for Throughput, PDR, Delay and Energy
v) Observation
Solutions:
hop_by_hop_vbf, vbf_Vectorbasedforward, vbva_VectorbasedVoidAvoidance
Experiment 13: Write TCL Scripts to compare Transport Layer protocols for underwater wireless sensor networks with variable data rates.
Assume the following for the Simulation:
i) Topology Area: 1000X1000
ii) Data rate: 0.1 to 0.9 with a variation of 0.1
iii) MAC protocol: BroadcastMac
iv) Routing protocols: vbf_Vectorbasedforward
v) Transport Layer protocol: TCP, UDP
vi) Application Layer protocol: FTP, UDP
vii) Assume the rest of the parameters as per your requirements.
viii) Run AWK scripts to calculate Network Throughput, Packet Delivery Ratio (PDR), Delay and Residual Energy from trace file of the experiment.
Output:
i) Draw output of NAM file
ii) Write 5 lines of trace file
iii) 4 Tables for Throughput, PDR, Delay and Energy
iv) 4 Graphs for Throughput, PDR, Delay and Energy
v) Observation
(Google CoLab Python Code)
import matplotlib.pyplot as plt
# DataRate (same for all protocols)
datarate = [0.05, 0.25, 0.5, 1.0]
# Throughput data for each protocol
throughput_vbf = [1.53, 1.52, 1.53, 1.54]
throughput_vbva = [3.41, 3.41, 3.41, 3.41]
throughput_hhvbf = [11.88, 11.00, 12.18, 11.44]
plt.figure(figsize=(8, 6))
# Plot for VBF
plt.plot(datarate, throughput_vbf, marker='o', linestyle='-', color='blue', label='VBF')
# Plot for VBVA
plt.plot(datarate, throughput_vbva, marker='s', linestyle='-', color='green', label='VBVA')
# Plot for HH-VBF
plt.plot(datarate, throughput_hhvbf, marker='^', linestyle='-', color='red', label='HH-VBF')
# Formatting
#plt.title("Throughput vs DataRate Comparison")
plt.xlabel("DataRate (kbps)")
plt.ylabel("Throughput (kbps)")
plt.grid(True)
plt.legend()
plt.tight_layout()
plt.show()