1 / 15

Chapter 6 Links: Simple Links

Chapter 6 Links: Simple Links. Reporter: 林峰正 Date: 2002/5/14. Outline. Review Simple link example Instance Procedures for Links and SimpleLinks Connectors Object hierarchy Commands at a glance. Review. Chapter 5 : Described how to create the nodes in ns

varian
Télécharger la présentation

Chapter 6 Links: Simple Links

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. Chapter 6 Links: Simple Links Reporter: 林峰正 Date: 2002/5/14

  2. Outline • Review • Simple link example • Instance Procedures for Links and SimpleLinks • Connectors • Object hierarchy • Commands at a glance

  3. Review • Chapter 5 : Described how to create the nodes in ns • Chapter 6 : Describes how to create the links to connect the nodes and complete the topology

  4. Simple Links Example • Nodes are composed of classifiers. • Simple link is built up from a sequence of connectors. • Simplex link Example: • Set ns [new Simulator] • $ns simplex-link <node0> <node1> <bandwidth> <delay> <queue type> • #Create links between the nodes Example • $ns simplex-link $n0 $n2 2Mb 10ms DropTail • $ns duplex-link $n1 $n2 2Mb 10ms DropTail • $ns duplex-link $n2 $n3 1.7Mb 20ms DropTail

  5. Instance Procedures for Links and SimpleLinks • Link procedures : • The class Link is implemented in Otcl. • The Otcl SimpleLink class use the C++ LinkDelay class to simulate packet delivery delays. • Instance:p.62 • head{} – return the handle for head_ • queue{} – return the handle for queue_ • Link{} , up{}, down{}, up?{}, all-connectors{}, cost{}, cost?{} .. etc.

  6. Instance Procedures for Links and SimpleLinks (cont.) • SimpleLink procedures : simple point-to-point link with an associated queue and delay. • It’s derived from the base Otcl class Link. • Instance: p.62 • Class SinpleLink –superclass Link • SimpleLink instproc init {src dst bw*delay q{lltype “DelayLink”}} • { $self next $src $dst • $self instvar link_ queue_ head_ toNode_ ttl • …. • }

  7. Connector • A connector will receive a packet, perform some function, and deliver the packet to its neighbor, or drop the packet • Each connector performs a different function • - networkinterface (chapter26) • - DynaLink(chapter27) • - DelayLink(chapter8) • - Queues(chapter7) • - TTLChecker

  8. Object hierarchy • The base class used to present links is called Link. • Methods for this class are listed in the next section. • Derived from the base class are given as follow: • -SimpleLink object • -DelayLink object

  9. Object hierarchy (cont.) • SimpleLink object • - $simplelink enable-mcast <src> <dst> • - $simplelink trace <ns> <file> <optional:op> • - $simplelink nam-trace <ns> <file> • - $simplelink trace-dynamics <ns> <file> <optional:op>

  10. Object hierarchy (cont.) • SimpleLink object • - $simplelink init-motor <ns> <qtrace> <sampleInterval> • - $simplelink attach-monitors <insnoop> <outsnoop> <dropsnoop> <qmon> • - $simplelink dynamic • - $simplelink errormodule <args> • - $simplelink insert-linkloss <args>

  11. Object hierarchy (cont.) • DelayLink Object – determine the amount of time required for a packet to traverse a link. • Configuration Parametets are: • - bandwith_ Link bandwidth in bits per second • - delay_ Link propagation delay in seconds.

  12. Commands at a glance • $ns_ simplex-link <node1> <node2> <bw> <delay> <qtype> <args> • $ns_ duplex-link <node1> <node2> <bw> <delay> <qtype> <args> • $ns_ duplex-intserv-link <n1> <n2> <bw> <dly> <sched><signal> <adc><args> • $ns_ simplex-link-op <n1> <n2> <op> <args> • $ns_ duplex-link-op <n1> <n2> <op> <args>

  13. Commands at a glance (cont.) • $ns_ link-lossmodel <lossobj> <from> <to> • $ns_ lossmodel <lossobj> <from> <to>

  14. Link-related procedures • $ns_ register-nam-linkconfig <link> • $ns_ remove-nam-linkconfig <id1> <id2> • $link head • $link add-to-head <connector> • $link link • $link queue • $link cost <c>

  15. Link-related procedures (cont.) • $link cost? • $link if-label? • $link up • $link down • $link up? • $link all-connectors op

More Related