Network Simulator 2 Practice

22
Network Simulator 2 Network Simulator 2 Practice SungKyunKwan-Univ Mobile Computing LAB (http://csn.skku.ac.kr) 안안안 [email protected]

description

Network Simulator 2 Practice. SungKyunKwan-Univ Mobile Computing LAB (http://csn.skku.ac.kr) 안혜환 [email protected]. 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 - PowerPoint PPT Presentation

Transcript of Network Simulator 2 Practice

Page 1: Network Simulator 2 Practice

Network Simulator 2

Network Simulator 2 Practice

SungKyunKwan-Univ Mobile Computing LAB(http://csn.skku.ac.kr)

안혜환 [email protected]

Page 2: Network Simulator 2 Practice

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

Page 3: Network Simulator 2 Practice

Network Simulator 2

User’s view of NS-2

•Network Topology

•Event

It can be available by using script such as “awk”

OTcl

C++

Page 4: Network Simulator 2 Practice

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

Page 5: Network Simulator 2 Practice

Network Simulator 2

Tcl Function Implementation

Page 6: Network Simulator 2 Practice

Network Simulator 2

Otcl Function Implementation

Page 7: Network Simulator 2 Practice

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

…….

…….

…….

.

.

Page 8: Network Simulator 2 Practice

Network Simulator 2

Add New Uniform Distribution Agent 1/2

Page 9: Network Simulator 2 Practice

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

Page 10: Network Simulator 2 Practice

Network Simulator 2

Add New Uniform Distribution Agent (WinCam)

Result

Page 11: Network Simulator 2 Practice

Network Simulator 2

Variable Binding

Page 12: Network Simulator 2 Practice

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

Page 13: Network Simulator 2 Practice

Network Simulator 2

Implementation :33% Packets are not sent

Page 14: Network Simulator 2 Practice

Network Simulator 2

Drop and Not Drop Packet (WinCam)

Drop Packet Not Drop Packet

Page 15: Network Simulator 2 Practice

Network Simulator 2

Sensor Network Simulator

Topology Generator Simulation

- Directed Diffusion- Flood

Experiment Performance Evaluation

Page 16: Network Simulator 2 Practice

Network Simulator 2

Topology Generator “setdest” (WinCam)

Page 17: Network Simulator 2 Practice

Network Simulator 2

Experiment (WinCam)

Sensor network 1000 nodes with Flooding Sensor network 1000 nodes with Directed

Diffusion

Page 18: Network Simulator 2 Practice

Network Simulator 2

Performance Evaluation

Sink and Source Node Transmission Frequency Agent Level and Entire Network Transmission

Frequency

Page 19: Network Simulator 2 Practice

Network Simulator 2

Sink and Source Node Transmission Frequency

Page 20: Network Simulator 2 Practice

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

Page 21: Network Simulator 2 Practice

Network Simulator 2

Reference

Ns manual NS by example

Page 22: Network Simulator 2 Practice

Network Simulator 2

Thank You

Q & A