1 / 18

NS Simulator for beginners

NS Simulator for beginners. Chapter 2 & 3. ns Simulator Preliminaries 2009-09-02 Thiep M. Ha thiep03@yahoo.com. Contents. Initialization and termination Definition of a network of links and nodes Agents and applications Scheduling events Visualisation: using nam Tracing

jasia
Download Presentation

NS Simulator for beginners

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NS Simulator for beginners Chapter 2 & 3. ns Simulator Preliminaries 2009-09-02 Thiep M. Ha thiep03@yahoo.com

  2. Contents • Initialization and termination • Definition of a network of links and nodes • Agents and applications • Scheduling events • Visualisation: using nam • Tracing • Random variables

  3. Initialization and termination • An ns simulation starts with the command • Creating output files (trace files or nam files)

  4. Initialization and termination • The termination of the program • At the end of the ns program we should call the procedure “finish” and specify at what time the termination should occur.

  5. Definition of a network of links and nodes • Definition of a node • Definition of a link • In NS, an output queue of a node is implemented as a part of each link whose input is that node. • Definition of the buffer capacity of the queue related to each link

  6. Definition of a network of links and nodes • Form of a simplex link • Duplex link is constructed from two parallel simplex links.

  7. Definition of a network of links and nodes • Defining nodes, links and assigning queue size

  8. Agents and applications • FTP over TCP

  9. Agents and applications • CBR over UDP

  10. Scheduling events • The Tcl script defines when event should occur. • Format • Examples • The scheduler is started when running ns, i.e. through the command $ns run.

  11. Visualisation: using nam • Giving node position (for NAM)

  12. Tracing • Tracing objects in a simplex link • EnqT registers information concerning a packet that arrives and is queued at the input queue of the link. • DrpT handles the information concerning the dropped packet. • DeqT registers information at the instant the packet is dequed. • RecvT gives us information about packets that have been received at the output of the link.

  13. Tracing • Structure of trace files • Event: event type. • r: receive (at the output of the link) • +: enqueued • -: dequeued • d: dropped • Time: the time at which the events occurs. • From node: givens the input node of the link at which the events occurs. • To node: gives the output node of the link at which the events occurs. • Pkt id: unique id of the packet

  14. Tracing • Example • Tracing a subset of events

  15. Random variables • Seeds and generators • The seed value of 0 results in the generation of a new random variable each time we run the simulation. • In contrast, if we use other seeds then each time we run the simulation, the same sequence of random variables that are generated in a simulation will be generated. • Creating random variables • Creating a new generator • When actually creating a random variable, we have to define its distribution type and its parameters.

  16. Random variables

  17. Random variables

  18. Random variables

More Related