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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 32Hierarchical RoutingThis chapter describes the internals of hierarchical routing implemented in <strong>ns</strong>. This chapter co<strong>ns</strong>ists of two sectio<strong>ns</strong>. In thefirst section we give an overview of hierarchical routing. In the second section we walk through the API’s used for settinghierarchical routing <strong>and</strong> describe the architecture, internals <strong>and</strong> code p<strong>at</strong>h for hier rtg in the process.<strong>The</strong> functio<strong>ns</strong> <strong>and</strong> procedures described in this chapter can be found in ~<strong>ns</strong>/tcl/lib/<strong>ns</strong>-hiernode.tcl, tcl/lib/<strong>ns</strong>-address.tcl,tcl/lib/<strong>ns</strong>-route.tcl <strong>and</strong> route.cc.32.1 Overview of Hierarchical RoutingHierarchical routing was mainly devised, among other things, to reduce memory requirements of simul<strong>at</strong>io<strong>ns</strong> over very largetopologies. A topology is broken down into several layers of hierarchy, thus dow<strong>ns</strong>izing the routing table. <strong>The</strong> table size isreduced from n 2 , for fl<strong>at</strong> routing, to about log n for hierarchical routing. However some overhead costs results as numberof hierarchy levels are increased. Optimum results were found for 3 levels of hierarchy <strong>and</strong> the current <strong>ns</strong> implement<strong>at</strong>io<strong>ns</strong>upports upto a maximum of 3 levels of hierarchical routing.To be able to use hierarchical routing for the simul<strong>at</strong>io<strong>ns</strong>, we need to define the hierarchy of the topology as well as providethe nodes with hierarchical addressing. In fl<strong>at</strong> routing, every node knows about every other node in the topology, thus resultingin routing table size to the order of n 2 . For hierarchical routing, each node knows only about those nodes in its level. Forall other destin<strong>at</strong>io<strong>ns</strong> outside its level it forwards the packets to the border router of its level. Thus the routing table size getsdow<strong>ns</strong>ized to the order of about log n.32.2 Usage of Hierarchical routingHierarchical routing requires some additional fe<strong>at</strong>ures <strong>and</strong> mechanisms for the simualtion. For example, a new node objectcalled HierNode is been defined for hier rtg. <strong>The</strong>refore the user must specify hierarchical routing requirements before cre<strong>at</strong>ingtopology. This is done as shown below:First, the address form<strong>at</strong> ( ) or the address space used for node <strong>and</strong> port address, needs to be set in the hierarchical mode. Itmay be done in one of the two ways:set <strong>ns</strong> [new Simul<strong>at</strong>or]281

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

Saved successfully!

Ooh no, something went wrong!