Dynamic Source Routing (DSR) protocol is a reactive routing protocol designed specifically for use in multi-hop wireless ad hoc networks of mobile nodes.
This model was developed by the ResiliNets research group at the University of Kansas.
This model implements the base specification of the Dynamic Source Routing (DSR) protocol. Implementation is based on RFC4728.
Protocol operation depends on many adjustable parameters. We support parameters, with their default values, from RFC and parameters that enable/disable protocol features or tune for specific simulation scenarios, such as the max size of the send buffer and its timeout value. The full parameter list is found in the dsr-routing.cc file.
DSR discovers routes on-demand. Therefore, our DSR model buffers all packets, while a route request packet (RREQ) is disseminated. We implement a packet buffer in dsr-rsendbuff.cc. The packet queue implements garbage collection of old packets and a queue size limit. When the packet is sent out from the send buffer, it will be queued in maintenance buffer for next hop acknowledgment.
The Route Cache implementation support garbage collection of old entries and state machine, as defined in the standard. It implements as a STL map container. The key is the destination IP address.
Protocol operation strongly depends on broken link detection mechanism. We implement the three heuristics recommended.
First, we use layer 2 feedback when possible. A link is considered to be broken if frame transmission results in a transmission failure for all retries. This mechanism is meant for active links and works much faster than in its absence. Layer 2 feedback implementation relies on TxErrHeader trace source, currently it is supported in AdhocWifiMac only.
Second, passive acknowledgment should be used whenever possible. The node turns on “promiscuous” receive mode, in which it can receive packets not destined for itself, and when the node assures the delivery of that data packet to its destination, it cancels the passive acknowledgment timer.
Last, we use a network layer acknowledge scheme to notify the receipt of a packet. Route request packet will not be acknowledged or retransmitted.
The following optional protocol optimizations aren’t implemented:
Flow state
First Hop External (F), Last Hop External (L) flags
Handling unknown DSR options
DSR operates with direct access to IP header, and operates between network and transport layer.
The DsrFsHeader has added 3 fields: message type, source id, destination id, and these changes only for post-processing
Route Reply header is not word-aligned in DSR rfc, change it to word-aligned in implementation
DSR works as a shim header between transport and network protocol, it needs its own forwarding mechanism, we are changing the packet transmission to hop-by-hop delivery, so we added two fields in dsr fixed header to notify packet delivery
# message type to notify the type of this packet: data packet or control one # source id to identify the real source address of this packet # destination id to identify the real destination
This implementation used “path cache”, which is simple to implement and ensures loop-free paths:
The following should be kept in mind when running DSR as routing protocol:
To have a node run DSR, the easiest way would be to use the DsrHelper and DsrMainHelpers in your simulation script. For instance:
DsrHelper dsr;
DsrMainHelper dsrMain;
dsrMain.Install (dsr, adhocNodes);
The example scripts inside src/dsr/examples/ demonstrate the use of DSR based nodes in different scenarios. The helper source can be found inside src/dsr/helper/dsr-main-helper.{h,cc} and src/dsr/helper/dsr-helper.{h,cc}
The example can be found in src/dsr/examples/:
DSR is also built in the routing comparison case in examples/routing/:
This model has been tested as follows:
A paper was presented on these results at the Workshop on ns-3 in 2011.
[1] Link for the original paper:
[2] Link for RFC 4728:
[3] Link for the Broch’s comparison paper: