220 likes | 352 Views
Network Simulator 2 Practice. SungKyunKwan-Univ Mobile Computing LAB (http://csn.skku.ac.kr) 안혜환 hyehwan@ece.skku.ac.kr. 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
E N D
Network Simulator 2 Practice SungKyunKwan-Univ Mobile Computing LAB(http://csn.skku.ac.kr) 안혜환hyehwan@ece.skku.ac.kr
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
User’s view of NS-2 It can be available by using script such as “awk” • Network Topology • Event OTcl C++
What are Tcl, Otcl, Tclcl, NS ? Linkage • Ns is Not Simulator but Object • set ns [new Simulator] • common/simulator.cc Like “C++” Like “C” C++ Object
Very Important Tcl “ns-lib.tcl” Otcl Library set ns [ new Simulator] 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 ……. ……. ……. ns-allinone-xxx/ns-2xx/MakefileTCL_LIB . .
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
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
Drop and Not Drop Packet (WinCam) Drop Packet Not Drop Packet
Sensor Network Simulator • Topology Generator • Simulation - Directed Diffusion- Flood • Experiment • Performance Evaluation
Experiment (WinCam) • Sensor network 1000 nodes with Flooding • Sensor network 1000 nodes with Directed Diffusion
Performance Evaluation • Sink and Source Node Transmission Frequency • Agent Level and Entire Network Transmission Frequency
Reference • Ns manual • NS by example
Thank You Q & A