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.

App2 3FilterF1FilterF24 5 6 71Directed Diffusion Core8Figure 20.1: Message flow in directed diffusionapps contai<strong>ns</strong> sample source <strong>and</strong> sink applic<strong>at</strong>io<strong>ns</strong> like gear, ping <strong>and</strong> rmst.lib has DiffusionRouting class definitio<strong>ns</strong> <strong>and</strong> definitio<strong>ns</strong> of diffusion applic<strong>at</strong>ion class. In addition there are sub-dirs calledmain <strong>and</strong> nr. main houses misc diffusion utility code. nr includes <strong>at</strong>tribute definition <strong>and</strong> the class NR which is anabstract factory for the API (so th<strong>at</strong> either ISI or MIT implement<strong>at</strong>io<strong>ns</strong> may derive from it.<strong>ns</strong> contai<strong>ns</strong> <strong>ns</strong> wrappers for diffusion code.ă<strong>The</strong>se wrapper classes allow the core diffusion code <strong>and</strong> the diffusion API to beseamlessly incorpor<strong>at</strong>ed into the NS class hierarchy. <strong>The</strong> DiffRoutingAgent is a wrapper for the Core Diffusion code,<strong>and</strong> DiffAppAgent is a wrapper for the DiffusionRouting (API) code.filter_core has the core diffusion agent.filters holds the different filters supported by diffusion implement<strong>at</strong>ion including two-phase-pull, one-phase-pull, gear, rmst,log, tag <strong>and</strong> srcrt (as of 10/03/03).<strong>The</strong> above Figure 20.1 is from SCADDS’ network routing API document available from their homepage (URL given earlier).<strong>The</strong> document describes <strong>at</strong>tribute factories, m<strong>at</strong>ching rules for <strong>at</strong>tributes, how applic<strong>at</strong>io<strong>ns</strong> interface with the core diffusionlayer, <strong>and</strong> filter/timer APIs. All messages coming from/going out in the network is received <strong>at</strong>/sent out from the core diffusionlayer. Messages can also come to core-diffusion layer from local applic<strong>at</strong>io<strong>ns</strong> <strong>and</strong>/or filters th<strong>at</strong> might be connected to thenode. <strong>The</strong> applic<strong>at</strong>io<strong>ns</strong> use the publish/subscribe/send interface to send interest <strong>and</strong> d<strong>at</strong>a messages to the network.<strong>The</strong> core diffusion agent <strong>and</strong> diffusion applic<strong>at</strong>ion agent are <strong>at</strong>tached to two well-known ports defined in ~<strong>ns</strong>//tcl/lib/<strong>ns</strong>default.tcl.Diffusion applic<strong>at</strong>io<strong>ns</strong> <strong>at</strong>tached to the node call the underlying diffusion applic<strong>at</strong>ion agent for publishing/subscribing/sendingd<strong>at</strong>a.20.3 Some mac issues for diffusion in <strong>ns</strong>In the shim layer th<strong>at</strong> sits between diffusion <strong>and</strong> <strong>ns</strong>, (see diffusion3/<strong>ns</strong> dir for code implementing this layer) all diffusionpackets are encapsul<strong>at</strong>ed within <strong>ns</strong> packets <strong>and</strong> are marked to be broadcasted. In previous versio<strong>ns</strong> all diffusion packets weremarked to be broadcast in <strong>ns</strong>. This is now changed. Now all diffusion pkts in <strong>ns</strong> uses the diffusion next_hop info thus allowingboth broadcast <strong>and</strong> unicast.So previously this only-brdcast fe<strong>at</strong>ure supported for diffusion packets resulted in some problems <strong>at</strong> the mac layer. <strong>The</strong> mac-802.11 doesnot try to re-tra<strong>ns</strong>mit a broadcast packet incase there is a collision <strong>and</strong> the packet is dropped. Coupled to this wasthe fact th<strong>at</strong> mac-802.11 didn’t do r<strong>and</strong>om selection of slots in the contention window before it tra<strong>ns</strong>mitted a packet (a brdcastd<strong>at</strong>a or rts for unicast pkts). As a result there were a high number of collisio<strong>ns</strong> <strong>at</strong> the mac layer <strong>and</strong> a lot of packets were lost.This was fixed by adding r<strong>and</strong>om selection of slots before mac tx’ed a brdcast pkt (or a rts pkt).195

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

Saved successfully!

Ooh no, something went wrong!