Network Simulator 2 Practice
-
Upload
germane-atkinson -
Category
Documents
-
view
45 -
download
0
description
Transcript of Network Simulator 2 Practice
Network Simulator 2
Network Simulator 2 Practice
SungKyunKwan-Univ Mobile Computing LAB(http://csn.skku.ac.kr)
Network Simulator 2
Contents User’s view of NS-2 What are Tcl, Otcl, Tclcl, NS ? Tcl Function Implementation Otcl Function Implementation Very Important Tcl “ns-lib.tcl” Otcl Library Add New Uniform Distribution Agent Add New Uniform Distribution Agent (WinCam) Binding Variable Add New Application Implementation :33% Packets are not sent Drop and Not Drop Packet (WinCam) Sensor Network Simulation Topology Generator “setdest” (WinCam) Experiment (WinCam) Performance Evaluation Sink and Source Node Transmission Frequency Agent Level and Entire Network Transmission Frequency Reference
Network Simulator 2
User’s view of NS-2
•Network Topology
•Event
It can be available by using script such as “awk”
OTcl
C++
Network Simulator 2
What are Tcl, Otcl, Tclcl, NS ?
Linkage
Like “C++”
Like “C”
Ns is Not Simulator but Object• set ns [new Simulator] • common/simulator.cc
C++ Object
Network Simulator 2
Tcl Function Implementation
Network Simulator 2
Otcl Function Implementation
Network Simulator 2
Very Important Tcl “ns-lib.tcl” Otcl Library
set ns [ new Simulator] ns-allinone-xxx/
ns-2xx/MakefileTCL_LIB
source ns-autoconf.tcl
source ns-address.tcl
source ns-node.tcl
source ns-rtmodule.tcl
source ns-hiernode.tcl
source ns-mobilenode.tcl
source ns-bsnode.tcl
source ns-link.tcl
…….
…….
…….
.
.
Network Simulator 2
Add New Uniform Distribution Agent 1/2
Network Simulator 2
Add New Uniform Distribution Agent 2/2 Modify : “ns-allinone2.xx/ns-2.xx/Makefile OBJ_CC= common/ex-uniform.o Re Compile : make clean, make depend, make
Network Simulator 2
Add New Uniform Distribution Agent (WinCam)
Result
Network Simulator 2
Variable Binding
Network Simulator 2
Add New Application New Data Structure New Application C++ New Application Header New Agent C++ New Agent Header
Modify packet.h Modify ns-packet.tcl Modify agent.h Modify app.h Modify /ns-allinone-2.xx/ns-2.xx/Makefile
Set Default Values in ns-default.tcl NS-2 Recompile Implementation : 33% Uniform Distribution Send Loss Drop Modeling
Network Simulator 2
Implementation :33% Packets are not sent
Network Simulator 2
Drop and Not Drop Packet (WinCam)
Drop Packet Not Drop Packet
Network Simulator 2
Sensor Network Simulator
Topology Generator Simulation
- Directed Diffusion- Flood
Experiment Performance Evaluation
Network Simulator 2
Topology Generator “setdest” (WinCam)
Network Simulator 2
Experiment (WinCam)
Sensor network 1000 nodes with Flooding Sensor network 1000 nodes with Directed
Diffusion
Network Simulator 2
Performance Evaluation
Sink and Source Node Transmission Frequency Agent Level and Entire Network Transmission
Frequency
Network Simulator 2
Sink and Source Node Transmission Frequency
Network Simulator 2
Agent Level and Entire Network Transmission Frequency
0
500000
1000000
1500000
2000000
2500000
3000000
3500000
100 300 500 700 1000 Nodes
TransmissionDD-AGT DD-Total
Flood-AGT Flood-Total
Network Simulator 2
Reference
Ns manual NS by example
Network Simulator 2
Thank You
Q & A