17. NS-2 Directory Structure tcl code example validation test C++ code tcl code core sim tk8.0 otcl Tcl tcl8.0 ns-2 nam-1 tcl ex test lib ... ...
18. Node Architecture Agents are either protocol endpoints or related objects that generate/fill-in packet fields. Classifiers: packet demultiplexers. Classifier Classifier Agent Link Agent Agent Node Addr Port Node entry point Local Link Link
21. Links Links: keeps track of “from” and “to” node objects. blocked Enq Trace Deq Trace Rcv Trace Drp Trace Delay TTL Drop head Queue Link entry point
22. Link Link Application N1 N2 Classifier Classifier Agent Node Addr Port Local Classifier Classifier Agent Node Addr Port Local Enq Trace Deq Trace Rcv Trace Drp Trace Delay TTL Drop head Queue Application
23.
24.
25.
26. Shadowing TclObject Agent Agent/DSDV Agent/DSDV OTcl shadow object Agent/DSDV C++ object TclObject() Agent() DSDVAgent() OTcl class hierarchy C++ class hierarchy
27. Object Correspondence TCL C++ Agent/DSDV Constructor Agent Constructor Invoke parent TclObject Constructor Invoke parent AgentDSDV() Constructor Create C++ Agent() Constructor Invoke parent TclObject() Constructor Invoke parent Do nothing, return bind and return bind and return OTcl shadow init complete init complete
This section talks about the discrete event schedulers of NS. As described in the Overview section, the main users of an event scheduler are network components that simulate packet-handling delay or that need timers. Figure shows each network object using an event scheduler. Note that a network object that issues an event is the one who handles the event later at scheduled time. Also note that the data path between network objects is different from the event path. Actually, packets are handed from one network object to another using send(Packet* p) {target_->recv(p)}; method of the sender and recv(Packet*, Handler* h = 0) method of the receiver