Categorization of C++ Classes in NS2
Upcoming SlideShare
Loading in...5
×
 

Categorization of C++ Classes in NS2

on

  • 5,359 views

 

Statistics

Views

Total Views
5,359
Views on SlideShare
3,210
Embed Views
2,149

Actions

Likes
0
Downloads
155
Comments
0

5 Embeds 2,149

http://www.ns2ultimate.com 1905
http://ns2ultimate.tumblr.com 235
http://translate.googleusercontent.com 4
http://translate.googleusercontent.com 4
http://www.ns2ultimate.com HTTP 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Categorization of C++ Classes in NS2 Categorization of C++ Classes in NS2 Presentation Transcript

  • Categorizationof C++ Classes in NS2 N S 2 U l t i m a t e . c o m b yT e e r a w a t I s s a r i y a k u l
  • OUTLINEConventional Class CategorizationSimulation Class CategorizationExample: Packet transmission www.ns2ultimate.com
  • Conventional Class categorization Two-language structure NS2 consists of two languages: C++ and OTcl The simplest form ➠ Standalone classes C OC.1 C.2 O.1 O.2 C++ classes OTcl classes www.ns2ultimate.com
  • Conventional class categorizationBut clearly, there can be more than on classhierarchy in both the domains C O C.1 C.2 O.1 O.2 C++ classes OTcl classes www.ns2ultimate.com
  • Conventional class categorization But clearly, there can be more than on class hierarchy in both the domains D PD.1 D.2 P.1 P.2 C O C.1 C.2 O.1 O.2 C++ classes OTcl classes www.ns2ultimate.com
  • Conventional object categorization Classes in the C++ domain can be bound to class in the OTcl domain D PD.1 D.2 P.1 P.2 C O C.1 C.2 O.1 O.2 bind C++ classes OTcl classes www.ns2ultimate.com
  • Conventional class categorization And, binding can be quite arbitrary D PD.1 D.2 P.1 P.2 bind C O C.1 C.2 O.1 O.2 bind C++ classes OTcl classes www.ns2ultimate.com
  • Conventional class categorization Now we have two categories of classes: “bound” and “standalone” D P D.1 D.2 P.1 P.2 Standalone bind OTcl classes C OStandaloneC++ classes C.1 C.2 O.1 O.2 bind www.ns2ultimate.com
  • Conventional class categorization Now we have two categories of classes: “bound” and “standalone” D P D.1 D.2 P.1 P.2 Standalone bind OTcl classes bound C OStandalone classesC++ classes C.1 C.2 O.1 O.2 bind www.ns2ultimate.com
  • Conventional class categorization Bound C++ = Compiled classes Bound OTcl = Interpreted classes Standalone bind OTcl classes C OStandaloneC++ classes C.1 C.2 O.1 O.2 bind www.ns2ultimate.com
  • Conventional class categorization Bound C++ = Compiled classes Bound OTcl = Interpreted classes Standalone bind OTcl classes C OStandaloneC++ classes C.1 C.2 O.1 O.2 bind Compiled Interpreted classes classes www.ns2ultimate.com
  • Conventional class categorization C++ OTcl Compiled Interpreted Bound classes classesStandalone C++ classes OTcl classes www.ns2ultimate.com
  • OUTLINEConventional Class CategorizationSimulation Class CategorizationExample: Packet transmission www.ns2ultimate.com
  • Simulation class categorization Six main categoriesBase C++ Class Characteristic TclObject Compiled classes Handler Default actions NsObject Receive packets Packet Packet reception event Event scheduler: put events on the simulation time line Scheduler and execute default actions at the right time. Others None of the above, e.g., Routing, timers, etc. www.ns2ultimate.com
  • related objects were discussed in Chapter 4. The packet-related objects will Simulation class be discussed in Chapter 8. The main helper objects will be discussed in Chapter 15. categorization 5.1.2 C++ Class Hierarchy This section gives an overview of C++ class hierarchies. The entire hierarchy consists of over 100 C++ classes and struct data types. Here, we only showSix main categories a part of the hierarchy (in Fig. 5.1). The readers are referred to [18] for the complete class hierarchy. OTcl Interface Default Action TclObject Handler Simulator PacketQueue NsObject AtHandler QueueHandler RoutingModule Network Component Classifier Connector LanRouter Uni-directional Point-to- point Object Connector Queue Agent ErrorModel LinkDelay Trace Fig. 5.1. A part of NS2 C++ class hierarchy (this chapter emphasizes on classes www.ns2ultimate.com in boxes with thick solid lines).
  • Simulation class categorization Six main categoriesBase C++ Class Characteristic TclObject Compiled classes Handler Default actions NsObject Receive packets (= Default action) Packet Packet reception event Event scheduler: put events on the simulation time Scheduler line and execute default actions at the right time. Others None of the above, e.g., Routing, timers, etc. www.ns2ultimate.com
  • OUTLINEConventional Class CategorizationSimulation Class CategorizationExample: Packet transmission www.ns2ultimate.com
  • example: packet transmissionSending a packet from an Agent object to aQueue object Packet Agent Queue www.ns2ultimate.com
  • example: packet transmissionClass hierarchy NsObject ➠ Agent and Queue Event ➠ Packet NsObject Event Packet Agent Queue www.ns2ultimate.com
  • For more information about NS2 P l e a s e s e e t h i s b o o k f r o m S p r i n g e rT. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009 or visit www.ns2ultimate.com