FH2025-NETWORK LAB- Expt 3
FH2025-NETWORK LAB- Expt 3
Learning Objectives:
1. To get familiar with Initialization and termination aspects of network simulators.
2. To understand defining the network nodes, links, queues and topology.
3. To understand the agents and Network Animator (NAM) and tracing.
Prerequisites:Knowledge of
1. Network Topology
2. NS2 node and link commands
Hardware Requirements:
PC i3 processor and above
Software Requirements:
● Linux (Ubuntu 10.04)
● NS2.34 package
● gedit
Quiz Questions (if any): (Online Exam will be taken separately batchwise, attach the certificate/
Marks obtained)
Experiment/Assignment Evaluation:
Sr. Parameters Marks Out of
No. obtain
ed
1 Technical Understanding (Assessment may be done based on Q 6
& A or any other relevant method.) Teacher should mention the
other
method used -
2 Neatness/presentation 2
3 Punctuality 2
Date of performance Total marks obtained 10
(DOP)
Date of checking (DOC) Signature of teacher
THEORY <HANDWRITTEN>
Topology refers to the layout or structure of a network, which consists of nodes (representing computers,
routers, etc.) and links (representing communication paths between nodes).
In NS2, the network topology is specified using a TCL script by creating nodes and connecting them using
links. A node can be any network element (host, router, etc.), and a link represents the communication
channel between two nodes.
2. Links: Links connect two nodes and can be defined with various parameters such as bandwidth, delay,
and queue type. The basic command to create a link between two nodes is:
$ns duplex-link $n0 $n1 10Mb 10ms DropTail
3. Running the Simulation: Once the topology and traffic have been set up, the simulation is run by
invoking the $ns run command.
awk '{if ($1 == "r" && $4 == "1") print $0}' out.tr | awk
'{sum+=($10)} END {print sum/1000000}'
# Finish procedure
proc finish {} {
$ns flush-trace
close $tracefile
close $namfile
exit 0
}
# Run the simulator
$ns run
# Step 9: Finish procedure (close files and run NAM for visualization)
proc finish {} {
$ns flush-trace
close $tracefile
close $namfile
exit 0
$ns run
Use the cd command to navigate to the directory where the network_sim.tcl file is saved.
For example:
cd /path/to/your/script/directory
To run the script using the NS-2 simulator, use the following command:
ns FILENAME.tcl
RESULTS: <PASTE OUTPUT HERE>
Conclusion: <Handwritten>
1. Applications of the studied technique in industry – Understand network administration.
3. Skills Developed –
Understanding the user system requirements and dependencies prior to any actual design and
development work.
References:
1. J. F. Kurose and K. W. Ross, Computer Networking: A Top-Down Approach, 7th ed., Pearson
Education, 2017.
2. R. W. Stevens, Unix Network Programming: Volume 1: The Sockets Networking API, 3rd ed.,
Prentice Hall, 1994.
3. D. E. Comer, Computer Networks and Internets, 6th ed., Pearson Education, 2018.
4. Cisco Networking Academy, Networking Essentials, Cisco Press, 2022.
5. Microsoft, "Network Command Line Tools," Microsoft Docs, 2021. [Online]. Available:
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/network-too
ls.