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.

the destin<strong>at</strong>ion node id of outgoing packet. Other nodes listen in the preamble <strong>and</strong> record the time slots to receive packets.Like other common TDMA protocols (GSM, for example), each node has a d<strong>at</strong>a tra<strong>ns</strong>mission slot to send packets.To avoid unnecessary power co<strong>ns</strong>umption, each node tur<strong>ns</strong> its radio on <strong>and</strong> off explicitly by invoking node API set_node_sleep().<strong>The</strong> radio only needs to be on when: in the pramble phase (takes one slot time) <strong>and</strong> there is a packet to send <strong>and</strong> receive.<strong>The</strong> preamble is implemented as a central d<strong>at</strong>a structure tdma_preamble_, which is accessible to all the nodes. At thebeginning of a frame, each node writes the destin<strong>at</strong>ion node id into its subslot in preamble if it has a packet to send. Followingpreamble phase, each node sends packet in its d<strong>at</strong>a tra<strong>ns</strong>mission slot <strong>and</strong> checks the preamble to determine if there is a packetto receive in other slots.<strong>The</strong> following parameters are user configurable: the wireless link b<strong>and</strong>width b<strong>and</strong>with_, the slot length packet_slot_len_,<strong>and</strong> the number of nodes max_node_num_. See ~<strong>ns</strong>/mac-tdma.{cc,h} for implement<strong>at</strong>ion details.16.1.5 Different types of Routing Agents in mobile networking<strong>The</strong> four different ad-hoc routing protocols currently implemented for mobile networking in <strong>ns</strong>are dsdv, dsr, aodv <strong>and</strong> tora.In this section we shall briefly discuss each of them.DSDVIn this routing protocol routing messages are exchanged between neighbouring mobilenodes (i.e mobilenodes th<strong>at</strong> are withinrange of one another). Routing upd<strong>at</strong>es may be triggered or routine. Upd<strong>at</strong>es are triggered in case a routing inform<strong>at</strong>ion fromone of t he neighbours forces a change in the routing table. A packet for which the route to its destin<strong>at</strong>ion is not known iscached while routing queries are sent out. <strong>The</strong> pkts are cached until route-replies are received from the destin<strong>at</strong>ion. <strong>The</strong>re isa maximum buffer size for caching the pkts waiting for routing inform<strong>at</strong>ion beyond which pkts are dropped.All packets destined for the mobilenode are routed directly by the address dmux to its port dmux. <strong>The</strong> port dmux h<strong>and</strong>sthe packets to the respective destin<strong>at</strong>ion agents. A port number of 255 is used to <strong>at</strong>tach routing agent in mobilenodes. <strong>The</strong>mobilenodes al so use a default-target in their classifier (or address demux). In the event a target is not found for the destin<strong>at</strong>ionin the classifier (which happe<strong>ns</strong> when the destin<strong>at</strong>ion of the packet is not the mobilenode itself), the pkts are h<strong>and</strong>ed to thedefault-ta rget which is the routing agent. <strong>The</strong> routing agent assig<strong>ns</strong> the next hop for the packet <strong>and</strong> sends it down to the linklayer.<strong>The</strong> routing protocol is mainly implemented in C++. See ~<strong>ns</strong>/dsdv directory <strong>and</strong> ~<strong>ns</strong>/tcl/mobility/dsdv.tcl for all proceduresrel<strong>at</strong>ed to DSDV protocol implement<strong>at</strong>ion.DSRThis section briefly describes the functionality of the dynamic source routing protocol. As mentioned earlier the SRNode isdifferent from the MobileNode. <strong>The</strong> SRNode’s entry_ points to the DSR routing agent, thus forcing all packets receivedby the node to be h<strong>and</strong>ed down to the routing agent. This model is required for future implement<strong>at</strong>ion of piggy-backed routinginform<strong>at</strong>ion on d<strong>at</strong>a packets which otherwise would not flow through the routing agent.<strong>The</strong> DSR agent checks every d<strong>at</strong>a packet for source-route inform<strong>at</strong>ion. It forwards the packet as per the routing inform<strong>at</strong>ion.Incase it doesnot find routing inform<strong>at</strong>ion in the packet, it provides the source route, if route is known, or caches the packet<strong>and</strong> sends out route queries if route to destin<strong>at</strong>ion is not known. Routing queries, always triggered by a d<strong>at</strong>a packet with noroute to its destin<strong>at</strong>ion, are initially broadcast to all neighbours. Route-replies are send back either by intermedi<strong>at</strong>e nodes orthe destin<strong>at</strong>ion node, to the source, if it can find routing info for the destin<strong>at</strong>ion in the route-query. It h<strong>and</strong>s over all packets153

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

Saved successfully!

Ooh no, something went wrong!