/
ns2 201Polly HuangUSCISIhuangisiedu ns2 201Polly HuangUSCISIhuangisiedu

ns2 201Polly HuangUSCISIhuangisiedu - PDF document

rodriguez
rodriguez . @rodriguez
Follow
343 views
Uploaded On 2021-10-02

ns2 201Polly HuangUSCISIhuangisiedu - PPT Presentation

1tclInterpreter With Extensionstcl80otcltclclEventSchedulerNetworkComponentExample Scriptset ns new Simulatorset n0 ns nodeset n1 ns noden0n1set ftp new ApplicationFTPftp attachagent tcpns at 02 ftp ID: 893554

150 149 classifier agent 149 150 agent classifier entry link tcl tcp classifierport dmux code network class node otcl

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "ns2 201Polly HuangUSCISIhuangisiedu" 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.


Presentation Transcript

1 1 ns-2 201Polly HuangUSC/ISIhuang@isi.ed
1 ns-2 201Polly HuangUSC/ISIhuang@isi.edu tclInterpreter With Extensions tcl8.0 otcl tclcl EventScheduler NetworkComponent Example Scriptset ns [new Simulator]set n0 [$ns node]set n1 [$ns node] n0n1set ftp [new Application/FTP]$ftp attach-agent $tcp$ns at 0.2 "$ftp start"$ns at 1.2 ”exit"$ns duplex-link $n0 $n1 1.5Mb 10msDropTailsettcp[$ns create-connection TCP $n0TCPSink$n1 0] OutlineInternals•Making changes•Creating new components 2 Internals•Discrete Event Scheduler•Network Topology•Routing•Transport•App

2 lication•Packet Flow•Packet Fo
lication•Packet Flow•Packet Format Discrete Event Scheduler time_, uid_, next_, handler_he�ad_ -handle�r_ - handle() time_, uid_, next_, handler_ insert he�ad_ - Network Topology -Node n0n1 Addr ClassifierPort Classifier classifier_dmux_entry_Node entry Node Multicast Classifier classifier_dmux_entry_Node entryMulticast Node multiclassifier_ Network Topology -Link n0n1 enqT_ queue_ deqT_ drophead_ drpT_ link_ ttl_ entry_head_ 3 n0n1 Addr ClassifierPort Classifier classifier_dmux_entry_Node entry 01 enqT_ queue_ deqT

3 _ drophead_ drpT_ link_ ttl_ n1 entry_he
_ drophead_ drpT_ link_ ttl_ n1 entry_head_ Routing (cont.) n0n1 Addr ClassifierPort Classifier classifier_dmux_entry_ 01 Addr ClassifierPort Classifier classifier_dmux_entry_ 0 Link n0-n1 Link n1-n0 Transport n0n1Addr ClassifierPort Classifierclassifier_dmux_entry_ Agent/TCP agents_Addr ClassifierPort Classifierclassifier_dmux_entry_ 0 Link n0-n1 Link n1-n0 0 Agent/TCPSink agents_dst_=1.0dst_=0.0 Application n0n1Addr ClassifierPort Classifierclassifier_dmux_entry_ Agent/TCP agents_Addr ClassifierPort Classifierclassifier_dmux_entry_ 0 Link n0-n1

4 Link n1-n0 0 Agent/TCPSink agents_dst_=
Link n1-n0 0 Agent/TCPSink agents_dst_=1.0dst_=0.0 Application/FTP 4 Packet Flow n0n1Addr ClassifierPort Classifierentry_ Agent/TCP Addr ClassifierPort Classifierentry_ 0 Link n0-n1 Link n1-n0 0 Agent/TCPSink dst_=1.0dst_=0.0 Application/FTP Packet Format ip header tcp header rtp header trace header cmn header ptype_ iface_ Outline•InternalsMaking changes•Creating new components ns-2 Directory Structure otcl nam-1 test ... ... tcl code example validation test C++ code tcl code core 5 Making Changes in C++ Space•Existing code–

5 recompile•Addition–change Make
recompile•Addition–change Makefile and recompile Making Changes inotclSpace•Existing code–recompile–source•Addition–source–change Makefile(NS_TCL_LIB), tcl/ns-lib.tcl (source) and recompile Outline•Internals•Making changesCreating new components Creating New Components•Guidelines•Inheritance Hierarchy•C++ andotclInterface•Examples–Network layer–Transport layer–Application layer 6 Guidelines•Decide its inheritance structure•Create the class and fill in t

6 he API virtual functions•Define otc
he API virtual functions•Define otcl linkage functions•Write the necessary otcl code to access your agent Class Hierarchy (Partial) TclObject NsObject Connector Classifier Delay AddrClassifier Agent McastClasifier Queue Trace DropTail Drop Reno C++ and otcl Interface•Supported by tclcl (a.k.a., Tcl)•Tcl&tcl=Tcl::instance();•Implementation is 100% in C++–otcl-� C++ •command(): tclcomm&#xo150;and•tcl.result()–C++ -&#xo150; otcl•tcl.eval(“tclactio&#xo140;n”)•bind() or [otcl-&#xo

7 140;C++] Network Layer•Network Inte
140;C++] Network Layer•Network Interface -Packet Labeler NetworkInterface A NetworkInterface B 7 Class Hierarchy TclObject NsObject Connector Classifier Delay AddrClassifier Agent McastClasifier Queue Trace DropTail Drop Reno Network Interface Network Interface Labeler•class NetworkInterface–NetworkInterface()–recv(pkt)•�pkt-iface() = label_–send(pkt)•targe�t-recv(pkt)–command()•label argv{label_ = argv}•TclClass(“networkinterface”) NetworkInterfacenetworkinterfaceset iface

8 [new networkinteface]$ifacelabel Acomman
[new networkinteface]$ifacelabel Acommand(): label Transport Layer•TCP Jump Start–from cwnd += 1–tocwnd= maxwin Class Hierarchy TclObject NsObject Connector Classifier Delay AddrClassifier Agent McastClasifier Queue Trace DropTail Drop Reno 8 TCP Linear Slow Start•class JSTcpAgent–openwin()–slowdown()•TclClass(“Agent/TCP/JS”) Application Layer•Message sender Message Sender Message Sender Class Hierarchy TclObject NsObject Connector Classifier Delay AddrClassifier Agent McastClasifier Queue Trace D

9 ropTail Drop Reno MessageAgent Message S
ropTail Drop Reno MessageAgent Message Sender•class MessageAgent–MessageAgent()–recv()–send()–command()•send {send()}•TclClass(“Agent/Message”) C++otclMessageAgentAgent/Messageset msg[new Agent/Message]$msgsendcommand(): send 9 ns-2 301 Preview•Generating representative web traffic–HttpSessioninternal -step by step code walk through•Isolating flow control or error recovery mechanisms from TCP–TCP internal -step by step code walk through Slides•http://www.research.att.com/~phuan

Related Contents


Next Show more