Feb 13 20032Tutorial SchedulenBasic introduction LeonNs fundamentals Leon2 internalnExtending ns2 SimulatorFeb 13 20033Introduction ReviewnCreate the event schedulernTurn on tracingnCreate networknS ID: 893556
Download Pdf The PPT/PDF document "NS2 TutorialQingKenny Shao SFUCNLPolly H..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
1 NS2 TutorialQing(Kenny) Shao (SFU/CNL)Po
NS2 TutorialQing(Kenny) Shao (SFU/CNL)Polly Huang(AT&T Labs Research)Communication Networks Laboratoryhttp://www.ensc.s
2 fu.ca/research/cnlSchool of Engineering
fu.ca/research/cnlSchool of Engineering ScienceSimon Fraser University Feb. 13, 20032 Tutorial SchedulenBasic introduct
3 ion (Leo)nNs fundamentals (Leo)n2 inter
ion (Leo)nNs fundamentals (Leo)n2 internalnExtending ns-2 Simulator Feb. 13, 20033 Introduction (Review)nCreate the ev
4 ent schedulernTurn on tracingnCreate net
ent schedulernTurn on tracingnCreate networknSetup routingnInsert errorsnCreate transport connectionnCreate trafficnTra
5 nsmit application level data Feb. 13, 20
nsmit application level data Feb. 13, 20034 Discrete Event SchedulernNetwork TopologynPacket FlownPacket Format Feb. 13
6 , 20035 Discrete Event Scheduler time_,
, 20035 Discrete Event Scheduler time_, uid_, next_, handler_head_ -handler_ - handle() time_, uid_, next_, han
7 dler_ insert head_ - Feb. 13, 20036 Netw
dler_ insert head_ - Feb. 13, 20036 Network Topology - n1 Port Classifier Node entry Unicast Multicast Classifier Node
8 entryMulticast Node $ns muliticast(right
entryMulticast Node $ns muliticast(right after set $ns [new scheduler])$ns rtproto type Feb. 13, 20037 Network Topology
9 - n1 Feb. 13, 20038 Network Topology -
- n1 Feb. 13, 20038 Network Topology - $ns trace-all filename or $ns namtraceall filenameInserting trace object Feb. 1
10 3, 20039 Network Topology - $ns monitor-
3, 20039 Network Topology - $ns monitor-queue node1 node2 $ns at 0.0 qmontrace $filename Agent/Null Queue Monitoring h
11 ead Feb. 13, 200310 n1 Port Classifier 1
ead Feb. 13, 200310 n1 Port Classifier 1 Port Classifier 0 Link n0- Link n1- Feb. 13, 200311 1 n1Port Classifier Port C
12 lassifier 0 Link n0- Link n1- Feb. 13, 2
lassifier 0 Link n0- Link n1- Feb. 13, 200312 1 n1Port Classifier Port Classifier 0 Link n0- Link n1- Feb. 13, 200313 P
13 acket Flow01 n1Port Classifier Port Clas
acket Flow01 n1Port Classifier Port Classifier 0 Link n0- Link n1- Feb. 13, 200314 Packet Format header ip header tcp h
14 eader rtp header trace header cmn header
eader rtp header trace header cmn header ... Feb. 13, 200315 Tutorial SchedulenBasic introduction (Leo)nNs fundamentals
15 (Leo)n2 internalnExtending ns-2 Simula
(Leo)n2 internalnExtending ns-2 Simulator Feb. 13, 200316 Extending ns-2 SimulatornMaking changesnCreating new compon
16 ents Feb. 13, 200317 2 Directory Structu
ents Feb. 13, 200317 2 Directory Structure ns tcl ... tcl validation test C++ code tclcode core Feb. 13, 200318 M
17 aking Changes in C++/OtclExisting coden(
aking Changes in C++/OtclExisting coden(source) and recompile Feb. 13, 200319 Making changesnCreating new components Fe
18 b. 13, 200320 Creating New ComponentsnGu
b. 13, 200320 Creating New ComponentsnGuidelines nInheritance HierarchynC++ andotcl Feb. 13, 200321 Decide its inherita
19 nce structurenCreate the class and fill
nce structurenCreate the class and fill in the virtual functionslinkage functionsnWrite the necessaryotclcode to access
20 your agent Feb. 13, 200322 Class Hierar
your agent Feb. 13, 200322 Class Hierarchy (Partial) TclObject Feb. 13, 200323 C++ andotcl: bind() methodn: command()
21 method Feb. 13, 200324 Static class MyAg
method Feb. 13, 200324 Static class MyAgentClass: public TclClass) {}TclObject* create, const char*const*) {retur
22 n (new MyAgent} class_my_agent;$ns new A
n (new MyAgent} class_my_agent;$ns new Agent/myAgentOtcl Static class MyAgentClass: public TclClass) {}TclObject*
23 create, const char*const*) {return (new
create, const char*const*) {return (new MyAgent} class_my_agent;$ns new Agent/myAgentOtcl Feb. 13, 200325 : bind()n()
24 {bind(, $my_var1);bind(
{bind(, $my_var1);bind(, $my_var2); myagent set my_var1_otcl$myagent set my_var2_otcl Fe
25 b. 13, 200326 : command()nInt MyAgent::c
b. 13, 200326 : command()nInt MyAgent::command (int argc, const char*const*argvif (argc== 2) {if (strcmp[1], call
26 _my_priv) == 0) {MyPrivFunc}return
_my_priv) == 0) {MyPrivFunc}return (Agent::command[new Agent/MyagentOtcl Feb. 13, 200327 () and puts
27 nplace debug 1at the appropriate locatio
nplace debug 1at the appropriate locationntrap to debugger from the scriptnsingle stepping through lines of codesnexami