Categorization of C++ Classes in NS2

6,423 views

Published on

Published in: Spiritual, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,423
On SlideShare
0
From Embeds
0
Number of Embeds
2,525
Actions
Shares
0
Downloads
210
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • \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

    1. 1. 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
    2. 2. OUTLINEConventional Class CategorizationSimulation Class CategorizationExample: Packet transmission www.ns2ultimate.com
    3. 3. 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
    4. 4. 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
    5. 5. 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
    6. 6. 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
    7. 7. 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
    8. 8. 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
    9. 9. 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
    10. 10. 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
    11. 11. 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
    12. 12. Conventional class categorization C++ OTcl Compiled Interpreted Bound classes classesStandalone C++ classes OTcl classes www.ns2ultimate.com
    13. 13. OUTLINEConventional Class CategorizationSimulation Class CategorizationExample: Packet transmission www.ns2ultimate.com
    14. 14. 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
    15. 15. 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).
    16. 16. 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
    17. 17. OUTLINEConventional Class CategorizationSimulation Class CategorizationExample: Packet transmission www.ns2ultimate.com
    18. 18. example: packet transmissionSending a packet from an Agent object to aQueue object Packet Agent Queue www.ns2ultimate.com
    19. 19. example: packet transmissionClass hierarchy NsObject ➠ Agent and Queue Event ➠ Packet NsObject Event Packet Agent Queue www.ns2ultimate.com
    20. 20. 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

    ×