the rd ns v sim ulator w orkshop br ought to you by kevin
play

The rd NS v Sim ulator W orkshop br ought to you by - PDF document

The rd NS v Sim ulator W orkshop br ought to you by Kevin F all La wrence Berk eley National Lab oratory kfal le elblgov httpwwwnr ge elblgovkfal l AND Kannan V aradhan


  1. The �rd NS �v�� Sim ulator W orkshop br ought to you by Kevin F all La wrence Berk eley National Lab oratory kfal l�e e�lbl�gov http���www�nr g�e e�lbl�gov�kfal l AND Kannan V aradhan �formerly at USC�ISI� kannan�c atarina�usc�e du http���www�isi�e du��kannan August �� ����

  2. Audience and Outline � Audience net w ork researc hers � educators � dev elop ers � � T opics for to da y VINT pro ject goals and status �Kevin� � � arc hitecture plus some history �Kevin�Kannan� � o v erview of ma jor comp onen ts �Kevin� pro ject�co de status �Kevin� � details of ma jor comp onen ts �Kevin� � em ulation facilit y �Kevin� � C���OTcl link age and sim ulation debugging �Kannan� � scenario generation and session�lev el supp ort �Kannan� � m ulticast and reliable m ulticast �Kannan� � a complex link� CBQ �Kevin� � � p erformance issues �Kannan� � discussion and futures �Ev ery one� �rd NSv� W orkshop kfal l�e e�lbl�gov Slide �

  3. NSv� Arc hitecture � Ob ject�orien ted structure � ev olution from NSv� �C�� with regular Tcl� � ob jects implemen ted in C�� and �OTcl� � OTcl� ob ject�orien ted extension to Tcl �from Da vid W etherall at MIT�LCS for V uSystem� �no w supp orted b y UCB Mash group� � Con trol��Data� separation con trol op erations in OTcl � data pass through C�� ob jects �for sp eed� � � Mo dular approac h � �ne�grain ob ject decomp osition � p ositives � comp osible� re�usable � negatives � m ust �plum b� in OTcl� dev elop er m ust b e comfortable with b oth en vironmen ts� to ols �fairly steep learning curv e� �rd NSv� W orkshop kfal l�e e�lbl�gov Slide �

  4. Dev elopmen t Status � sim ulator co de basis for VINT Pro ject � �ish p eople activ ely con tributing to the co de base � con tributions from� Xero x P AR C� USC�ISI� UCB� LBNL � Some appro ximate n um b ers� ��K lines of C�� co de � ��K lines of OTcl supp ort co de � ��K lines of test suites� examples � ��K lines of do cumen tation� � � Users w e kno w ab out� �� univ ersities� �� companies� � US go v ernmen t sites � � See main VINT and NS�� w eb pages at� http���netweb�usc�edu�vint http���www�mash�cs�berkeley�edu�ns� ns�htm l � Op en mailing lists� ns�users�mash�cs�b erk eley �edu � ns�announce�mash�cs�b erk eley �edu � � T o subscrib e� ma jordomo�mash�cs�b erk eley �edu � �rd NSv� W orkshop kfal l�e e�lbl�gov Slide �

  5. Directory Structure � directory shared b et w een MASH �UCB� and VINT pro jects common WORK vint common doc Tcl ns-2 nam www conf tcl bin ... lib test ex �rd NSv� W orkshop kfal l�e e�lbl�gov Slide �

  6. Class Hierarc h y � T op�lev el classes implemen t simple abstractions� Shared with MASH Project: TclObject NsObject Connector Classifier ... Queue McastClassifier AddrClassifier Agent Trace Delay Replicator Trace/Enq DropTail Trace/Deq Agent/TCP Agent/Message ... Trace/Hop RED Trace/Drop Reno Agent/Message/Prober NewReno �rd NSv� W orkshop kfal l�e e�lbl�gov Slide �

  7. Example� a no de � de � a collection of agents and classi�ers No � Agen ts� usually proto col endp oin ts and related ob jects � Classi�ers� pac k et dem ultiplexers Node Agent Port Classifier Agent Local Addr Node.entry Agent Addr Classifier Link Link � Note that the no de �routes� to itself or to do wnstream links �rd NSv� W orkshop kfal l�e e�lbl�gov Slide �

  8. Example� a link � k eeps trac k of �from� and �to� ob jects No de � generally encapsulates a queue� dela y and p ossibly ttl c hec k er Link (OTcl class) Queue Delay split classes � Man y more complex ob jects built from this base �rd NSv� W orkshop kfal l�e e�lbl�gov Slide �

  9. Example� routers � routers �unicast and m ulticast� b y �plum bing� Node Node Link Node.entry ... Link ... Link � m ulticast router adds additional classi�ers and replicators � Replicators� dem uxers with m ultiple fanout MulticastNode Addr Classifier Link unicast? Node.entry Link Replicator multicast? Addr Classifier (S1, G1) Replicator (S2, G2) Mcast Link Classifier (S3, G3) ... ... �rd NSv� W orkshop kfal l�e e�lbl�gov Slide �

  10. OTcl Basics � See the page at ftp���ftp�tns�lcs�mit�edu�pub�otcl� � ob ject orien ted extension to tcl � classes are ob jects with supp ort for inheritance � Analogs to C��� C�� has single class decl � � OTcl attac hes metho ds to ob ject or class � C�� constructor�destructor � OTcl init�destro y metho ds this � � self � � OTcl metho ds alw a ys �virtual� C�� shado w ed metho ds called explicitly with scop e op erator � � OTcl metho ds com bined implicitly with � self next C�� static v ariables � OTcl class v ariables � � �m ultiple inheritance is supp orted� � F or use with tcl���� see http���www�mash�cs�berkeley�edu�dist �rd NSv� W orkshop kfal l�e e�lbl�gov Slide ��

  11. OTcl Basics �con td� � use instvar and instpr o c to de�ne�access mem b er functions and v ariables � Example� Class Counter fg f Counter instproc init �self instvar cnt set cnt � g fg f Counter instproc bump �self instvar cnt incr cnt g fg f Counter instproc val �self instvar cnt return �cnt g Counter c � c val � c bump � c val � �rd NSv� W orkshop kfal l�e e�lbl�gov Slide ��

  12. C���OTcl Split Ob jects � Split ob jects� implemen t metho ds in either language � new and delete set c �new Counter� �c val �� � �c bump �c val �� � delete �c � De�ne instance v ariables in either C�� or OTcl� Counter��Counter�� f bind��cnt �� �value �� vs� �self set cnt �� value � ��� ��� g bind�� simply uses Tcl T r ac eV ar �rd NSv� W orkshop kfal l�e e�lbl�gov Slide ��

  13. Example� a simple sim ulation � A small but complete sim ulation script� � set up ��no de top ology and one bulk�data transfer TCP � arrange to trace the queue on the r��k� link � place trace output in the �le simp�out�tr � � Create a simple four node topology� � s� � � � �Mb��ms � ���Mb���ms � r� ��������� k� � �Mb��ms � � � � s� set stoptime ���� set ns �new Simulator� set node��s�� ��ns node� set node��s�� ��ns node� set node��r�� ��ns node� set node��k�� ��ns node� �ns duplex�link �node��s�� �node��r�� �Mb �ms DropTail �ns duplex�link �node��s�� �node��r�� �Mb �ms DropTail �ns duplex�link �node��r�� �node��k�� ���Kb ��ms DropTail �ns queue�limit �node��r�� �node��k�� � �ns queue�limit �node��k�� �node��r�� � set tcp� ��ns create�connection TCP �node��s�� TCPSink �node��k�� �� �tcp� set window� �� �tcp� set packetSize� ���� � Set up FTP source set ftp� ��tcp� attach�source FTP� set tf �open simp�out�tr w� �ns trace�queue �node��r�� �node��k�� �tf �ns at ��� ��ftp� start� �ns at �stoptime �close �tf� puts ��simulation complete��� �ns halt� �ns run �rd NSv� W orkshop kfal l�e e�lbl�gov Slide ��

Recommend


More recommend