12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 29Unicast RoutingThis section describes the structure of unicast routing in <strong>ns</strong>. We begin by describing the interface to the user (Section 29.1),through methods in the class Simul<strong>at</strong>or <strong>and</strong> the class RouteLogic. We then describe configur<strong>at</strong>ion mechanismsfor specialized routing (Section 29.2) such as asymmetric routing, or equal cost multip<strong>at</strong>h routing <strong>The</strong> next section describesthe the configur<strong>at</strong>ion mechanisms for individual routing str<strong>at</strong>egies <strong>and</strong> protocols (Section 29.3). We conclude with a comprehe<strong>ns</strong>ivelook <strong>at</strong> the internal architecture (Section 29.4) of routing in <strong>ns</strong>.<strong>The</strong> procedures <strong>and</strong> functio<strong>ns</strong> described in this chapter can be found in ~<strong>ns</strong>/tcl/lib/<strong>ns</strong>-route.tcl, ~<strong>ns</strong>/tcl/rtglib/route-proto.tcl,~<strong>ns</strong>/tcl/mcast/McastProto.tcl, <strong>and</strong> ~<strong>ns</strong>/rtProtoDV.{cc, h}.29.1 <strong>The</strong> Interface to the Simul<strong>at</strong>ion Oper<strong>at</strong>or (<strong>The</strong> API)<strong>The</strong> user level simul<strong>at</strong>ion script requires one comm<strong>and</strong>: to specify the unicast routing str<strong>at</strong>egy or protocols for the simul<strong>at</strong>ion.A routing str<strong>at</strong>egy is a general mechanism by which <strong>ns</strong> will compute routes for the simul<strong>at</strong>ion. <strong>The</strong>re are four routing str<strong>at</strong>egiesin <strong>ns</strong>: St<strong>at</strong>ic, Session, Dynamic <strong>and</strong> <strong>Manual</strong>. Conversely, a routing protocol is a realiz<strong>at</strong>ion of a specific algorithm. Currently,St<strong>at</strong>ic <strong>and</strong> Session routing use the Dijkstra’s all-pairs SPF algorithm []; one type of dynamic routing str<strong>at</strong>egy is currentlyimplemented: the Distributed Bellman-Ford algorithm []. In <strong>ns</strong>, we blur the distinction between str<strong>at</strong>egy <strong>and</strong> protocol forst<strong>at</strong>ic <strong>and</strong> session routing, co<strong>ns</strong>idering them simply as protocols 1 .rtproto{} is the i<strong>ns</strong>tance procedure in the class Simul<strong>at</strong>or th<strong>at</strong> specifies the unicast routing protocol to be used inthe simul<strong>at</strong>ion. It takes multiple arguments, the first of which is m<strong>and</strong><strong>at</strong>ory; this first argument identifies the routing protocolto be used. Subsequent arguments specify the nodes th<strong>at</strong> will run the i<strong>ns</strong>tance of this protocol. <strong>The</strong> default is to run thesame routing protocol on all the nodes in the topology. As an example, the following comm<strong>and</strong>s illustr<strong>at</strong>e the use of thertproto{} comm<strong>and</strong>.$<strong>ns</strong> rtproto St<strong>at</strong>ic;# Enable st<strong>at</strong>ic route str<strong>at</strong>egy for the simul<strong>at</strong>ion$<strong>ns</strong> rtproto Session;# Enable session routing for this simul<strong>at</strong>ion$<strong>ns</strong> rtproto DV $n1 $n2 $n3 ;# Run DV agents on nodes $n1, $n2, <strong>and</strong> $n3$<strong>ns</strong> rtproto LS $n1 $n2;# Run link st<strong>at</strong>e routing on specified nodesIf a simul<strong>at</strong>ion script does not specify any rtproto{} comm<strong>and</strong>, then <strong>ns</strong> will run St<strong>at</strong>ic routing on all the nodes in thetopology.1 <strong>The</strong> co<strong>ns</strong>ider<strong>at</strong>ion is th<strong>at</strong> st<strong>at</strong>ic <strong>and</strong> session routing str<strong>at</strong>egies/protocols are implemented as agents derived from the class Agent/rtProto similarto how the different dynamic routing protocols are implemented; hence the blurred distinctio<strong>ns</strong>.250

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!