view Side-By-Side changes
IETF MANET Working Group David B. Johnson, Rice University INTERNET-DRAFT David A. Maltz, AON Networks2 March21 November 2001 Yih-Chun Hu, Rice University Jorjeta G. Jetcheva, Carnegie Mellon University The Dynamic Source Routing Protocol for Mobile Ad Hoc Networks<draft-ietf-manet-dsr-05.txt>(DSR) <draft-ietf-manet-dsr-06.txt> Status of This Memo This document is an Internet-Draft and isin full conformance withsubject to all provisions of Section 10 of RFC2026 except that the right to produce derivative works is not granted.2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress". The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft is a submission to the IETF Mobile Ad Hoc Networks (MANET) Working Group. Comments on this draft may be sent to the Working Group at manet@itd.nrl.navy.mil, or may be sent directly to the authors. Johnson, et al Expires2 September 200121 May 2002 [Page i] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 Abstract The Dynamic Source Routing protocol (DSR) is a simple and efficient routing protocol designed specifically for use in multi-hop wireless ad hoc networks of mobile nodes. DSR allows the network to be completely self-organizing and self-configuring, without the need for any existing network infrastructure or administration. The protocol is composed of the two main mechanisms of "Route Discovery" and "Route Maintenance", which work together to allow nodes to discover and maintain source routes to arbitrary destinations in the ad hoc network. The use of source routing allows packet routing to be trivially loop-free, avoids the need for up-to-date routing information in the intermediate nodes through which packets are forwarded, and allows nodes forwarding or overhearing packets to cache the routing information in them for their own future use. All aspects of the protocol operate entirely on-demand, allowing the routing packet overhead of DSR to scale automatically to only that needed to react to changes in the routes currently in use. This document specifies the operation of the DSR protocol for routing unicastIPIPv4 packets in multi-hop wireless ad hoc networks. Johnson, et al Expires2 September 200121 May 2002 [Page ii] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 Contents Status of This Memo i Abstract ii 1. Introduction 1 2. Assumptions 3 3. DSR Protocol Overview 5 3.1. Basic DSR Route Discovery . . . . . . . . . . . . . . . . 5 3.2. Basic DSR Route Maintenance . . . . . . . . . . . . . . . 7 3.3. Additional Route Discovery Features . . . . . . . . . . .89 3.3.1. Caching Overheard Routing Information . . . . . .89 3.3.2. Replying to Route Requests using Cached Routes .910 3.3.3. Preventing Route Reply Storms . . . . . . . . . .1011 3.3.4. Route Request Hop Limits . . . . . . . . . . . .1213 3.4. Additional Route Maintenance Features . . . . . . . . . .1314 3.4.1. Packet Salvaging . . . . . . . . . . . . . . . .1314 3.4.2. Queued Packets Destined over a Broken Link . . . 14 3.4.3. Automatic Route Shortening . . . . . . . . . . .13 3.4.3.15 3.4.4. Increased Spreading of Route Error Messages . . .1416 4. Conceptual Data Structures1517 4.1. Route Cache . . . . . . . . . . . . . . . . . . . . . . .1517 4.2.Route Request TableSend Buffer . . . . . . . . . . . . . . . . . . .17 4.3. Send Buffer. . . . 20 4.3. Route Request Table . . . . . . . . . . . . . . . . . . .1821 4.4.Retransmission BufferGratuitous Route Reply Table . . . . . . . . . . . . . . 22 4.5. Network Interface Queue and Retransmission Buffer . . . .1923 5. DSR Header Format2025 5.1. Fixed Portion of DSR Header . . . . . . . . . . . . . . .2126 5.2. Route Request Option . . . . . . . . . . . . . . . . . .2328 5.3. Route Reply Option . . . . . . . . . . . . . . . . . . .2530 5.4. Route Error Option . . . . . . . . . . . . . . . . . . .2732 5.5. Acknowledgment Request Option . . . . . . . . . . . . . .2935 5.6. Acknowledgment Option . . . . . . . . . . . . . . . . . .3036 5.7. DSR Source Route Option . . . . . . . . . . . . . . . . .. . 3137 5.8. Pad1 Option . . . . . . . . . . . . . . . . . . . . . . .3339 5.9. PadN Option . . . . . . . . . . . . . . . . . . . . . . .3440 Johnson, et al Expires 21 May 2002 [Page iii] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 6. Detailed Operation3541 6.1. General Packet Processing . . . . . . . . . . . . . . . .3541 6.1.1. Originating a Packet . . . . . . . . . . . . . .3541 6.1.2. Adding a DSR Header to a Packet . . . . . . . . .3541 6.1.3. Adding a DSR Source Route Option to a Packet . .. . 3642 6.1.4.ReceivingProcessing a Received Packet . . . . . . . . . .. . . . . 36 Johnson, et al Expires 2 September 2001 [Page iii] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 200143 6.1.5. Processing a Received DSR Source Route Option . .. . 3845 6.2. Route Discovery Processing . . . . . . . . . . . . . . .4048 6.2.1. Originating a Route Request . . . . . . . . . . .4048 6.2.2. Processing a Received Route Request Option . . .4250 6.2.3. Generating a RouteRepliesReply using the Route Cache .4351 6.2.4. Originating a Route Reply . . . . . . . . . . . .4454 6.2.5. Processing a Received Route Reply Option . . . .. . . . . 4655 6.3. Route Maintenance Processing . . . . . . . . . . . . . .4757 6.3.1. UsingNetwork-LayerLink-Layer Acknowledgments . . . . . . .47. 57 6.3.2. UsingLink LayerPassive Acknowledgments . . . . . . . .48. . 58 6.3.3. Using Network-Layer Acknowledgments . . . . . . . 59 6.3.4. Originating a Route Error . . . . . . . . . . . .48 6.3.4.62 6.3.5. Processing a Received Route Error Option . . . .. . . . . 49 6.3.5.63 6.3.6. Salvaging a Packet . . . . . . . . . . . . . . .4964 7. Protocol Constants50and Configuration Variables 66 8. IANA Considerations5167 9. Security Considerations5268 Appendix A. Link-MaxLife Cache Description 69 Appendix B. Location of DSR in the ISO Network Reference Model5371 AppendixB.C. Implementation and Evaluation Status5472 Changes from Previous Version of the Draft 73 Acknowledgements5576 References5677 Chair's Address5980 Authors' Addresses6081 Johnson, et al Expires2 September 200121 May 2002 [Page iv] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 1. Introduction The Dynamic Source Routing protocol (DSR)[12, 13][13, 14] is a simple and efficient routing protocol designed specifically for use in multi-hop wireless ad hoc networks of mobile nodes. Using DSR, the network is completely self-organizing and self-configuring, requiring no existing network infrastructure or administration. Network nodes cooperate to forward packets for each other to allow communication over multiple "hops" between nodes not directly within wireless transmission range of one another. As nodes in the network move about or join or leave the network, and as wireless transmission conditions such as sources of interference change, all routing is automatically determined and maintained by the DSR routing protocol. Since the number or sequence of intermediate hops needed to reach any destination may change at any time, the resulting network topology may be quite rich and rapidly changing. The DSR protocol allows nodes to dynamically discover a source route across multiple network hops to any destination in the ad hoc network. Each data packet sent then carries in its header the complete, ordered list of nodes through which the packet will pass, allowing packet routing to be trivially loop-free and avoiding the need for up-to-date routing information in the intermediate nodes through which the packet is forwarded. By including this source route in the header of each data packet, other nodes forwarding or overhearing any of these packetsmaycan also easily cache this routing information for future use. In designing DSR, we sought to create a routing protocol that had very low overhead yet was able to react very quickly to changes in the network. The DSR protocol provides highly reactive service in order to help ensure successful delivery of data packets in spite of node movement or other changes in network conditions. The DSR protocol is composed of two main mechanisms that work together to allow the discovery and maintenance of source routes in the ad hoc network: - Route Discovery is the mechanism by which a node S wishing to send a packet to a destination node D obtains a source route to D. Route Discovery is used only when S attempts to send a packet to D and does not already know a route to D. - Route Maintenance is the mechanism by which node S is able to detect, while using a source route to D, if the network topology has changed such that it can no longer use its route to D because a link along the route no longer works. When Route Maintenance indicates a source route is broken, S can attempt to use any other route it happens to know to D, or can invoke Route Discovery again to find a new route for subsequent packets to D. Johnson, et al Expires2 September 200121 May 2002 [Page 1] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 Route Maintenance for this route is used only when S is actually sending packets to D. In DSR, Route Discovery and Route Maintenance each operate entirely "on demand". In particular, unlike other protocols, DSR requires no periodic packets of any kind at anylevellayer within the network. For example, DSR does not use any periodic routing advertisement, link status sensing, or neighbor detection packets, and does not rely on these functions from any underlying protocols in the network. This entirely on-demand behavior and lack of periodic activity allows the number of overhead packets caused by DSR to scale all the way down to zero, when all nodes are approximately stationary with respect to each other and all routes needed for current communication have already been discovered. As nodes begin to move more or as communication patterns change, the routing packet overhead of DSR automatically scales to only that needed to track the routes currently in use. Network topology changes not affecting routes currently in use are ignored and do not cause reaction from the protocol. In response to a single Route Discovery (as well as through routing information from other packets overheard), a node may learn and cache multiple routes to any destination. This allows the reaction to routing changes to be much more rapid, since a node with multiple routes to a destination can try another cached route if the one it has been using should fail. This caching of multiple routes also avoids the overhead of needing to perform a new Route Discovery each time a route in use breaks. The operation of both Route Discovery and Route Maintenance in DSR are designed to allow uni-directional links and asymmetric routes to be easily supported. In particular, as noted in Section 2, in wireless networks, it is possible that a link between two nodes may not work equally well in both directions, due to differing antenna or propagation patterns or sources of interference. DSR allows such uni-directional links to be used when necessary, improving overall performance and network connectivity in the system. This document specifies the operation of the DSR protocol for routing unicastIPIPv4 packets in multi-hop wireless ad hoc networks. Advanced, optional features, such as Quality of Service (QoS) support and efficient multicast routing, and operation of DSR with IPv6 [6], are covered in other documents. The specification of DSR in this document provides a compatible base on which such features can be added, either independently or by integration with the DSR operation specified here. The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [4]. Johnson, et al Expires2 September 200121 May 2002 [Page 2] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 2. Assumptions We assume in this document that all nodes wishing to communicate with other nodes within the ad hoc network are willing to participate fully in the protocols of the network. In particular, each node participating in the ad hoc network SHOULD also be willing to forward packets for other nodes in the network. The diameter of an ad hoc network is the minimum number of hops necessary for a packet to reach from any node located at one extreme edge of the ad hoc network to another node located at the opposite extreme. We assume that this diameter will often be small (e.g., perhaps 5 or 10 hops), but may often be greater than 1. Packets may be lost or corrupted in transmission on the wireless network. We assume that a node receiving a corrupted packet can detect the error and discard the packet. Nodes within the ad hoc network MAY move at any time without notice, and MAY even move continuously, but we assume that the speed with which nodes move is moderate with respect to the packet transmission latency and wireless transmission range of the particular underlying network hardware in use. In particular, DSR can support very rapid rates of arbitrary node mobility, but we assume that nodes do not continuously move so rapidly as to make the flooding of every individual data packet the only possible routing protocol. A common feature of many network interfaces, including most current LAN hardware for broadcast media such as wireless, is the ability to operate the network interface in "promiscuous" receive mode. This mode causes the hardware to deliver every received packet to the network driver software without filtering based on link-layer destination address. Although we do not require this facility, some of our optimizations can take advantage of its availability. Use of promiscuous mode does increase the software overhead on the CPU, but we believe that wireless network speeds are more the inherent limiting factor to performance in current and future systems; we also believe that portions of the protocol are suitable for implementation directly within a programmable network interface unit to avoid this overhead on the CPU[13].[14]. Use of promiscuous mode may also increase the power consumption of the network interface hardware, depending on the design of the receiver hardware, and in such cases, DSR can easily be used without the optimizations that depend on promiscuous receive mode, or can be programmed to only periodically switch the interface into promiscuous mode. Use of promiscuous receive mode is entirely optional. Wireless communication ability between any pair of nodes may at times not work equally well in both directions, due for example to differing antenna or propagation patterns or sources of interference Johnson, et al Expires2 September 200121 May 2002 [Page 3] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 around the two nodes [1,17].18]. That is, wireless communications between each pair of nodes will in many cases be able to operate bi-directionally, but at times the wireless link between two nodes may be only uni-directional, allowing one node to successfully send packets to the other while no communication is possible in the reverse direction. Although many routing protocols operate correctly only over bi-directional links, DSR can successfully discover and forward packets over paths that contain uni-directional links. Some MAC protocols, however, such as MACA[16],[17], MACAW [2], or IEEE 802.11[10],[11], limit unicast data packet transmission to bi-directional links, due to the required bi-directional exchange of RTS and CTS packets in these protocols and due to thelink-levellink-layer acknowledgement feature in IEEE 802.11; when used on top of MAC protocols such as these, DSR can take advantage of additional optimizations, such as theeasyability to reverse a source route to obtain a route back to the origin of the original route. The IP address used by a node using the DSR protocol MAY be assigned by any mechanism (e.g., static assignment or use of DHCP for dynamic assignment[8]),[7]), although the method of such assignment is outside the scope of this specification. Johnson, et al Expires2 September 200121 May 2002 [Page 4] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 3. DSR Protocol Overview 3.1. Basic DSR Route Discovery When some source node originates a new packet addressed to some destination node, the source node places in the header of the packet a source route giving the sequence of hops that the packet is to follow on its way to the destination. Normally, the sender will obtain a suitable source route by searching its "Route Cache" of routes previouslylearned, butlearned; if no route is found in its cache, it will initiate the Route Discovery protocol to dynamically find a new route to this destination node. In this case, we call the source node the "initiator" and the destination node the "target" of the Route Discovery. For example, suppose a node A is attempting to discover a route to node E. The Route Discovery initiated by node A in this example would proceed as follows: ^ "A" ^ "A,B" ^ "A,B,C" ^ "A,B,C,D" | id=2 | id=2 | id=2 | id=2 +-----+ +-----+ +-----+ +-----+ +-----+ | A |---->| B |---->| C |---->| D |---->| E | +-----+ +-----+ +-----+ +-----+ +-----+ | | | | v v v v To initiate the Route Discovery, node A transmits a "Route Request" as a single local broadcast packet, which is received by (approximately) all nodes currently within wireless transmission range of A, including node B in this example. Each Route Request identifies the initiator and target of the Route Discovery, and also contains a unique request identification (2, in this example), determined by the initiator of the Request. Each Route Request also contains a record listing the address of each intermediate node through which this particular copy of the Route Request has been forwarded. This route record is initialized to an empty list by the initiator of the Route Discovery. In this example, the route record initially lists only node A. When another node receives this Route Request (such as node B in this example), if it is the target of the Route Discovery, it returns a "Route Reply" to the initiator of the Route Discovery, giving a copy of the accumulated route record from the Route Request; when the initiator receives this Route Reply, it caches this route in its Route Cache for use in sending subsequent packets to this destination. Otherwise, if this node receiving the Route Request has recently seen another Route Request message from this initiator bearing this same Johnson, et al Expires2 September 200121 May 2002 [Page 5] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 request identification and target address, or if this node's own address is already listed in the route record in the Route Request, this node discards the Request. Otherwise, this node appends its own address to the route record in the Route Request and propagates it by transmitting it as a local broadcast packet (with the same request identification). In this example, node B broadcast the Route Request, which is received by node C; nodes C and D each also, in turn, broadcast the Request, resulting in a copy of the Request being received by node E. In returning the Route Reply to the initiator of the Route Discovery, such as in this example, node E replying back to node A, node E will typically examine its own Route Cache for a route back to A, and if found, will use it for the source route for delivery of the packet containing the Route Reply. Otherwise, E SHOULD perform its own Route Discovery for target node A, but to avoid possible infinite recursion of Route Discoveries, it MUST piggyback this Route Reply on the packet containing its own Route Request for A. It is also possible to piggyback other small data packets, such as a TCP SYN packet[25],[28], on a Route Request using this same mechanism. Node E could instead simply reverse the sequence of hops in the route record that it is trying to send in the Route Reply, and use this as the source route on the packet carrying the Route Reply itself. For MAC protocols such as IEEE 802.11 that require a bi-directional frame exchange as part of the MAC protocol[10], this[11], the discovered source routereversal is preferred, as it avoidsMUST be reversed in this way to return theoverhead of a possible secondRouteDiscovery, andReply since it tests the discovered route to ensure it is bi-directional before the Route Discovery initiator begins using theroute.route; this route reversal also avoids the overhead of a possible second Route Discovery. However, this route reversal technique will prevent the discovery of routes using uni-directionallinks. Inlinks, and in wireless environments where the use of uni-directional links is permitted, such routes may in some cases be more efficient than those with only bi-directional links, or they may be the only way to achieve connectivity to the target node. When initiating a Route Discovery, the sending node saves a copy of the original packet (that triggered the Discovery) in a local buffer called the "Send Buffer". The Send Buffer contains a copy of each packet that cannot be transmitted by this node because it does not yet have a source route to the packet's destination. Each packet in the Send Buffer is logically associated with the time that it was placed into the Send Buffer and is discarded after residing in the Send Buffer for some timeout period; if necessary for preventing the Send Buffer from overflowing, a FIFO or other replacement strategy MAY also be used to evict packets even before they expire. While a packet remains in the Send Buffer, the node SHOULD occasionally initiate a new Route Discovery for the packet's Johnson, et al Expires 21 May 2002 [Page 6] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 destination address. However, the node MUST limit the rate at which such new Route Discoveries for the same address are initiated, sinceJohnson, et al Expires 2 September 2001 [Page 6] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001it is possible that the destination node is not currently reachable. In particular, due to the limited wireless transmission range and the movement of the nodes in the network, the network may at times become partitioned, meaning that there is currently no sequence of nodes through which a packet could be forwarded to reach the destination. Depending on the movement pattern and the density of nodes in the network, such network partitions may be rare or may be common. If a new Route Discovery was initiated for each packet sent by a node in such a partitioned network, a large number of unproductive Route Request packets would be propagated throughout the subset of the ad hoc network reachable from this node. In order to reduce the overhead from such Route Discoveries, a nodeMUSTSHOULD use an exponential back-off algorithm to limit the rate at which it initiates new Route Discoveries for the same target, doubling the timeout between each successive Discovery initiated for the same target. If the node attempts to send additional data packets to this same destination node more frequently than this limit, the subsequent packets SHOULD be buffered in the Send Buffer until a Route Reply is received giving a route to this destination, but the node MUST NOT initiate a new Route Discovery until the minimum allowable interval between new Route Discoveries for this target has been reached. This limitation on the maximum rate of Route Discoveries for the same target is similar to the mechanism required by Internet nodes to limit the rate at which ARP Requests are sent for any single target IP address [3]. 3.2. Basic DSR Route Maintenance When originating or forwarding a packet using a source route, each node transmitting the packet is responsible for confirming that the packet has been received by the nexthopnode along the source route; the packet SHOULD be retransmitted (up to a maximum number of attempts) until this confirmation of receipt is received. For example, in the situation shown below, node A has originated a packet for node E using a source route through intermediate nodes B, C, and D: +-----+ +-----+ +-----+ +-----+ +-----+ | A |---->| B |---->| C|--x|-->? | D | | E | +-----+ +-----+ +-----+ +-----+ +-----+ In this case, node A is responsible for receipt of the packet at B, node B is responsible for receipt at C, node C is responsible for receipt at D, and node D is responsible for receipt finally at the destination E. Johnson, et al Expires 21 May 2002 [Page 7] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 This confirmation of receipt in many cases may be provided at no cost to DSR, either as an existing standard part of the MAC protocol in use (such as thelink-levellink-layer acknowledgement frame defined by IEEE 802.11[10]),[11]), or by a "passive acknowledgement"[15][16] (in which, for example, B confirms receipt at C by overhearing C transmit theJohnson, et al Expires 2 September 2001 [Page 7] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001packet when forwarding it on to D). If neither of these confirmation mechanisms are available, the node transmitting the packet can explicitly request a DSR-specific software acknowledgement be returned by the nexthop;node along the route; this software acknowledgement will normally be transmitted directly to the sending node, but if the link between these two nodes is uni-directional, this software acknowledgementmaycould travel over a different, multi-hop path.IfAt the original sender of a packet if no receipt confirmation is received after thepacketsender hasbeenretransmitted the packet the maximum number of attemptsby some hop, this node SHOULD return a "Route Error"to theoriginal sender offirst intermediate node on thepacket, identifyingsource route, then thelink over whichsender determines that this first hop of thepacket could not be forwarded.route is currently "broken". For example, in theexamplesituation shown above, ifCthe sender, node A, is unable to deliver the packet to the nexthop D,node B, thenC returns a Route Error to A, stating thatA determines that the hop from A to B is broken. In this case, node A removes this link from its Route Cache and removes the DSR routing information that it had previously added to the packet. Node A then again searches its Route Cache for a route to the destination node, and if no route is found in the cache, uses the Route Discovery protocol again to dynamically discover a new route for the packet. At an intermediate node forwarding a packet, if no receipt confirmation is received after the node has retransmitted the packet the maximum number of attempts, this node SHOULD return a "Route Error" to the original sender of the packet, identifying the link over which the packet could not be forwarded. For example, in the situation shown above, if C is unable to deliver the packet to the next node D, then C returns a Route Error to A, stating that the link from C to D is currently "broken". Node A then removes this broken link from its cache; any retransmission of the original packet can be performed by upper layer protocols such as TCP, if necessary. For sending such a retransmission or other packets to this same destination E, if A has in its Route Cache another route to E (for example, from additional Route Replies from its earlier Route Discovery, or from having overheard sufficient routing information from other packets), it can send the packet using the new route immediately. Otherwise, it SHOULD perform a new Route Discovery for this target (subject to theexponentialback-off described in Section 3.1). Johnson, et al Expires 21 May 2002 [Page 8] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 3.3. Additional Route Discovery Features 3.3.1. Caching Overheard Routing Information A node forwarding or otherwise overhearing any packetMAYSHOULD addtheall usable routing information from that packet to its own Route Cache.In particular, the source route usedThe usefulness of routing information in adata packet,packet depends on theaccumulated route record in a Route Request, ordirectionality characteristics of theroutephysical medium (Section 2), as well as the MAC protocol beingreturnedused. Specifically, three distinct cases are possible: - Links ina Route Reply MAY all be cached by any node. Routing information from anythe network frequently are capable ofthese packets received can be cached, whetheroperating only uni-directionally (not bi-directionally), and thepacket was addressed to this node, sent to a broadcast (or multicast)MACaddress, or received whileprotocol in use in thenode'snetworkinterfaceis capable of transmitting unicast packets over uni-directional links. - Links inpromiscuous mode. One limitation, however,the network occasionally are capable of operating only uni-directionally (not bi-directionally), but this uni-directional restriction oncachingany link is not persistent, almost all links are physically bi-directional, and the MAC protocol in use in the network is capable of transmitting unicast packets over uni-directional links. - The MAC protocol in use in the network is not capable of transmitting unicast packets over uni-directional links; only bi-directional links can be used by the MAC protocol for transmitting unicast packets. For example, the IEEE 802.11 Distributed Coordination Function (DCF) MAC protocol [11] is capable of transmitting a unicast packet only over a bi-directional link, since the MAC protocol requires the return of a link-level acknowledgement packet from the receiver and also optionally requires the bi-directional exchange of an RTS and CTS packet between the transmitter and receiver nodes. In the first case above, for example, the source route used in a data packet, the accumulated route record in a Route Request, or the route being returned in a Route Reply SHOULD all be cached by any node in the "forward" direction; any node SHOULD cache this information from any such packet received, whether the packet was addressed to this node, sent to a broadcast (or multicast) MAC address, or overheardrouting informationwhile the node's network interface is in promiscuous mode. However, thepossible presence"reverse" direction ofuni-directionalthe links identified inthesuch packet headers SHOULD NOT be cached. Johnson, et al Expires2 September 200121 May 2002 [Page8]9] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001ad hoc network (Section 2).For example, in the situation shown below, node A is using a source route to communicate with node E: +-----+ +-----+ +-----+ +-----+ +-----+ | A |---->| B |---->| C |---->| D |---->| E | +-----+ +-----+ +-----+ +-----+ +-----+^ | +-----+ +-----+ +-----+ +-----+ +-----+ | V |---->| W |---->| X |---->| Y |---->| Z | +-----+ +-----+ +-----+ +-----+ +-----+As node C forwards a data packet along the route from A to E, itMAYSHOULD add to its cache the presence of the "forward" direction links that it learns from the headers of these packets, from itself to D and from D to E.However,Node C SHOULD NOT, in this case, cache the "reverse" direction of the links identified inthethese packet headers, from itself back to B and from B to A,may not work for itsince these links might be uni-directional.If C knows thatIn thelinks aresecond case above, infact bi-directional, for example due towhich links may occasionally operate uni-directionally, theMAC protocol in use, it could cache them but otherwiselinks described above SHOULDnot. Likewise, node Vbe cached inthe example aboveboth directions. Furthermore, in this case, if node X overhears (e.g., through promiscuous mode) a packet transmitted by node C that is using adifferentsource routeto communicate with node Z. If node C overhearsfrom nodeX transmitting a data packet to forward itA toY (from V),E, nodeCX SHOULDconsider whether thecache all of these linksinvolved can be known to be bi-directional or not before caching them. Ifas well, also including the link fromX toC(over which this data packet was received) can be knowntobe bi-directional, then C MAY cacheX over which it overheard thelink from itself to X,packet. In thelink from X to Y, andfinal case, in which thelink from Y to Z. If allMAC protocol requires physical bi-directionality for unicast operation, linkscan be assumed tofrom a source route SHOULD bebi-directional, C MAYcached in both directions, except when the packet alsocachecontains a Route Reply, in which case only the linksfrom X to W and from W to V. Similar considerations apply toalready traversed in this source route SHOULD be cached, but therouting information that mightlinks not yet traversed in this route SHOULD NOT belearned from forwarded or otherwise overheard Route Request or Route Reply packets.cached. 3.3.2. Replying to Route Requests using Cached Routes A node receiving a Route Request for which it is not the target, searches its own Route Cache for a route to the target of the Request. If found, the node generally returns a Route Reply to the initiator itself rather than forwarding the Route Request. In the Route Reply, this node sets the route record to list the sequence of hops over which this copy of the Route Request was forwarded to it, concatenated with the source route to this target obtained from its own Route Cache. However, before transmitting a Route Reply packet that was generated using information from its Route Cache in this way, a node MUST verify that the resulting route being returned in the Route Reply,Johnson, et al Expires 2 September 2001 [Page 9] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001after this concatenation, contains no duplicate nodes listed in the route record. For example, the figure below illustrates a case in Johnson, et al Expires 21 May 2002 [Page 10] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 which a Route Request for target E has been received by node F, and node F already has in its Route Cache a route from itself to E: +-----+ +-----+ +-----+ +-----+ | A |---->| B |- >| D |---->| E | +-----+ +-----+ \ / +-----+ +-----+ \ / \ +-----+ / >| C |- +-----+ | ^ v | Route Request +-----+ Route: A - B - C - F | F | Cache: C - D - E +-----+ The concatenation of the accumulated route record from the Route Request and the cached route from F's Route Cache would include a duplicate node in passing from C to F and back to C. Node F in this case could attempt to edit the route to eliminate the duplication, resulting in a route from A to B to C to D and on to E, but in this case, node F would not be on the route that it returned in its own Route Reply. DSR Route Discovery prohibits node F from returning such a Route Reply from itscache for two reasons. First,cache; thislimitationprohibition increases the probability that the resulting route is valid, since node F in this case should have received a Route Error if the route had previously stopped working.Second,Furthermore, thislimitationprohibition means that a future Route Error traversing the route is very likely to pass through any node that sent the Route Reply for the route (including node F), which helps to ensure that stale data is removed from caches (such as at F) in a timelymanner. Otherwise,manner; otherwise, the next Route Discovery initiated by A might also be contaminated by a Route Reply from F containing the same stale route. Ifthenode F, due to this restriction on returning a RouteRequestReply based on information from its Route Cache, does notmeet these restrictions, thereturn such a Route Reply, node(nodeFin this example) discardspropagates the Route Requestrather than replying to it or propagating it.normally. 3.3.3. Preventing Route Reply Storms The ability for nodes to reply to a Route Request based on information in their Route Caches, as described in Section 3.3.2, could result in a possible Route Reply "storm" in some cases. In particular, if a node broadcasts a Route Request for a target node for which the node's neighbors have a route in their Route Caches, each neighbor may attempt to send a Route Reply, thereby wastingJohnson, et al Expires 2 September 2001 [Page 10] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001bandwidth and possibly increasing the number of network collisions in the area. Johnson, et al Expires 21 May 2002 [Page 11] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 For example, the figure below shows a situation in which nodes B, C, D, E, and F all receive A's Route Request for target G, and each has the indicated route cached for this target: +-----+ +-----+ | D |< >| C | +-----+ \ / +-----+ Cache: C - B - G \ / Cache: B - G \ +-----+ / -| A |- +-----+\ +-----+ +-----+ | | \--->| B | | G | / \ +-----+ +-----+ / \ Cache: G v v +-----+ +-----+ | E | | F | +-----+ +-----+ Cache: F - B - G Cache: B - G Normally, each of these nodes wouldallattempt to reply fromtheirits own RouteCaches,Cache, and they would thus all send their Route Replies at about the same time, since they all received the broadcast Route Request at about the same time. Such simultaneousrepliesRoute Replies from different nodes all receiving the Route Request may cause local congestion in the wireless network and may create packet collisions among some or all of these Repliesand may cause local congestion inif thewireless network.MAC protocol in use does not provide sufficient collision avoidance for these packets. In addition, it will often be the case that the different replies will indicate routes of different lengths, as shown in this example.IfIn order to reduce these effects, if a node can put its network interface into promiscuous receive mode, itSHOULDMAY delay sending its own Route Reply for a short period, while listening to see if the initiating node begins using a shorter route first.That is,Specifically, this nodeSHOULDMAY delay sending its own Route Reply for a random period d = H * (h - 1 + r) where h is the length in number of network hops for the route to be returned in this node's Route Reply, r is a random floating point number between 0 and 1, and H is a small constant delay (at least twice the maximum wireless link propagation delay) to be introduced per hop. This delay effectively randomizes the time at which each node sends its Route Reply, with all nodes sending Route Replies giving routes of length less than h sending their Replies before this node, and all nodes sending Route Replies giving routes of length greater than h sending their Replies after this node. Johnson, et al Expires2 September 200121 May 2002 [Page11]12] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 Within the delay period, this node promiscuously receives all packets, looking for data packets from the initiator of this Route Discovery destined for the target of the Discovery. If such a data packet received by this node during the delay period uses a source route of length less than or equal to h, this node may infer that the initiator of the Route Discovery has already received a Route Reply giving an equally good or better route. In this case, this node SHOULD cancel its delay timer and SHOULD NOT send its Route Reply for this Route Discovery. 3.3.4. Route Request Hop Limits Each Route Request message contains a "hop limit" that may be used to limit the number of intermediate nodes allowed to forward that copy of the Route Request. This hop limit is implemented using the Time-to-Live (TTL) field in the IP header of the packet carrying the Route Request. As the Request is forwarded, this limit is decremented, and the Request packet is discarded if the limit reaches zero before finding the target. This Route Request hop limit can be used to implement a variety of algorithms for controlling the spread of a Route Request during a Route Discovery attempt. For example, a node MAYsenduse this hop limit to implement a "non-propagating" Route Request as an initial phase of a Route Discovery. A node using this technique sends its first Route Request attempt for some target node using a hop limit of 1, such that any node receiving the initial transmission of the Route Request will not forward the Request to other nodes byrebroadcastingre-broadcasting it. This form of Route Request is called a "non-propagating" RouteRequest. ItRequest; it provides an inexpensive method for determining if the target is currently a neighbor of the initiator or if a neighbor node has a route to the target cached (effectively using the neighbors' Route Caches as an extension of the initiator's own Route Cache). If no Route Reply is received after a short timeout, then the node sends a "propagating" Route Request (i.e., with no hop limit) for the target node. As another example, a node MAYbe sent. Another possibleuseof thethis hop limitin a Route Request isto implement an "expanding ring" search for the target[13]. For example, a[14]. A nodecould sendusing this technique sends an initial non-propagating Route Request as described above; if no Route Reply is received for it, the nodecould initiateoriginates another Route Request with a hop limit of 2. For each Route Requestinitiated,originated, if no Route Reply is received for it, the nodecould doubledoubles the hop limit used on the previous attempt, to progressively explore for the target node without allowing the Route Request to propagate over the entire network. However, this expanding ring search approach could have the effect of increasing the average latency of Route Discovery, since multiple Discovery attempts and timeouts may be needed before discovering a route to the target node. Johnson, et al Expires2 September 200121 May 2002 [Page12]13] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 3.4. Additional Route Maintenance Features 3.4.1. Packet SalvagingAfter sendingWhen an intermediate node forwarding aRoute Error message as part ofpacket detects through Route Maintenanceas described in Section 3.2, a node MAY attempt to "salvage" the data packetthatcausedtheRoute Error rather than discardingnext hop along thepacket. To attempt to salvage a packet,route for that packet is broken, if the nodesending a Route Error searches its own Route Cache for ahas another routefrom itselfto the packet's destinationof the packet causing the Error. If such a route is found,in its Route Cache, the nodeMAY salvageSHOULD "salvage" the packetafter returningrather than discarding it. To salvage a packet, theRoute Error by replacingnode replaces the original source route on the packet with the route from its Route Cache. The node then forwards the packet to the next node indicated along this source route. For example, in the situation shown in the example of Section 3.2, if node C has another route cached to node E, it can salvage the packet by replacing the original route in the packet with this new route from its own Route Cache, rather than discarding the packet. When salvaging apacket in this way,packet, a count is maintained in the packet of the number of times that it has been salvaged, to prevent a single packet from being salvaged endlessly. Otherwise, it could be possible for the packet to enter a routing loop, as different nodes repeatedly salvage the packet and replace the source route on the packet with routes to each other.3.4.2. Automatic Route Shortening Source routesAs described inuse MAY be automatically shortened if one or moreSection 3.2, an intermediatehopsnode, such as in this case, that detects through Route Maintenance that the next hop along the routebecome no longer necessary. This mechanism of automatically shortening routes in usefor a packet that it issomewhat similar toforwarding is broken, theuse of passive acknowledgements [15]. In particular, if anodeis able to overhear a packet carryingalso SHOULD return asource route (e.g., by operating its network interface in promiscuous receive mode), then this node examinesRoute Error to theunused portionoriginal sender ofthat source route. If this node is nottheintended next hop forpacket, identifying thepacket but is named inlink over which thelater unused portion ofpacket could not be forwarded. If thepacket's source route, thennode sends this Route Error, itcan infer thatSHOULD originate theintermediate nodesRoute Error beforeitself in the source route are no longer needed insalvaging theroute.packet. 3.4.2. Queued Packets Destined over a Broken Link When an intermediate node forwarding a packet detects through Route Maintenance that the next-hop link along the route for that packet is broken, in addition to handling that packet as defined for Route Maintenance, the node SHOULD also handle in a similar way any pending packets that it has queued that are destined over this new broken link. Specifically, the node SHOULD search its Network Interface Queue and Retransmission Buffer (Section 4.5) for packets for which the next-hop link is this new broken link. Forexample,each such packet currently queued at this node, thefigure belownode SHOULD process that packet as follows: - Remove the packet from the node's Network Interface Queue and Retransmission Buffer and stop any retransmission activity for the packet. Johnson, et al Expires2 September 200121 May 2002 [Page13]14] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001illustrates an example in which node D has overheard- Originate adata packet being transmitted from B to C,Route Error forlater forwarding to D and to E: +-----+ +-----+ +-----+ +-----+ +-----+ | A |---->| B |---->| C | | D | | E | +-----+ +-----+ +-----+ +-----+ +-----+ \ ^ \ / --------------------- In this case,thisnode (node D) returns a "gratuitous" Route Replypacket to the original sender of thepacket (node A). The Route Reply givespacket, using theshorter routeprocedure described in Section 6.3.4, as if theconcatenation ofnode had already reached theportionmaximum number ofthe original source route up through the noderetransmission attempts for thattransmitted the overheardpacket(node B), plus the suffix of the original source route beginning with the node returning the gratuitousfor RouteReply (node D). In this example, the route returnedMaintenance. However, in sending such Route Errors for queued packets in response to a single new broken link detected, thegratuitousnode SHOULD send no more than one RouteReply message sent from DError toA giveseach original sender of any of these packets. - If thenewnode has another route to the packet's IP Destination Address in its Route Cache, the node SHOULD salvage the packet as described in Section 6.3.6. Otherwise, thesequencenode SHOULD discard the packet. 3.4.3. Automatic Route Shortening Source routes in use MAY be automatically shortened if one or more intermediate nodes in the route become no longer necessary. This mechanism ofhops from A to B to Dautomatically shortening routes in use is somewhat similar toE. 3.4.3. Increased Spreadingthe use ofRoute Error Messages Whenpassive acknowledgements [16]. In particular, if asourcenodereceives a Route Error foris able to overhear adatapacketthat it originated, thiscarrying a sourcenode propagates this Route Error to its neighborsroute (e.g., bypiggybacking it onoperating itsnext Route Request. In this way, stale informationnetwork interface in promiscuous receive mode), then this node examines thecachesunexpended portion ofnodes around thisthat source route. If this nodewillis notgenerate Route Replies that containthesame invalid linkintended next-hop destination forwhich thisthe packet but is named in the later unexpended portion of the packet's sourcenode receivedroute, then it can infer that theRoute Error. For example,intermediate nodes before itself in thesituation shownsource route are no longer needed in the route. For example, the figure below illustrates an exampleof Section 3.2,in which nodeA learns from the Route Error messageD has overheard a data packet being transmitted from B to C,that the link from Cfor later forwarding to Dis currently broken. It thus removes this link from its own Route Cacheandinitiates a new Route Discovery (if it has no other routeto E: +-----+ +-----+ +-----+ +-----+ +-----+ | A |---->| B |---->| C | | D | | Ein its Route Cache). On the Route Request packet initiating| +-----+ +-----+ +-----+ +-----+ +-----+ \ ^ \ / --------------------- In this case, thisRoute Discovery,nodeA piggybacks(node D) SHOULD return acopy"gratuitous" Route Reply to the original sender ofthisthe packet (node A). The RouteError, ensuringReply gives the shorter route as the concatenation of the portion of the original source route up through the node that transmitted the overheard packet (node B), plus the suffix of the original source route beginning with the node returning the gratuitous RouteError spreads well to other nodes, and guaranteeing that anyReply (node D). In this example, the route returned in the gratuitous Route Replythat it receives (including thosemessage sent fromother node's Route Caches) in responseD tothis Route Request does not contain aA gives the new routethat assumesas theexistencesequence ofthis broken link.hops from A to B to D to E. Johnson, et al Expires2 September 200121 May 2002 [Page14]15] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 20014. Conceptual Data Structures This document describes the operation of the DSR protocolWhen deciding whether to return a gratuitous Route Reply interms ofthis way, anumber of conceptual data structures. This section describes each of these data structures and provides an overview of its use in the protocol. In an implementation of the protocol, these data structuresnode MAYbe implemented in any manner consistent with the external behavior describedfactor inthis document. 4.1. Route Cache All routingadditional informationneeded by a node participating in an ad hoc network using DSR is stored in that node's Route Cache. Each node inbeyond thenetwork maintains its own Route Cache. A node adds information to its Route Cache asfact that itlearns of new links between nodes inwas able to overhear thead hoc network; forpacket. For example,athe nodemay learn of new linksMAY decide to return the gratuitous Route Reply only whenit receives athe overheard packetcarrying eitheris received with aRoute Replysignal strenth ora DSR Routing header. Likewise, asignal-to-noise ratio above some specific threshold. In addition, each noderemoves information from itsmaintains a Gratuitous RouteCacheReply Table, asit learns that existing linksdescribed in Section 4.4, to limit thead hoc network have broken;rate at which it originates gratuitous Route Replies forexample, a node may learnthe same returned route. 3.4.4. Increased Spreading of Route Error Messages When abroken link when itsource node receives apacket carrying aRoute Erroror through the link-layer retransmission mechanism reporting a failure in forwardingfor a data packet that it originated, this source node propagates this Route Error to itsnext-hop destination. It is possible to interface a DSR network with other networks, external toneighbors by piggybacking it on its next Route Request. In thisDSR network. Such external networks may, for example, be the Internet, or may be other ad hoc networks routed with a routing protocol other than DSR. Such external networks may also be other DSR networks that are treated as external networksway, stale information inorder to improve scalability. The complete handling of such external networks is beyondthescope of this document. However, this document specifies a minimal setcaches ofrequirements and features necessary to allownodesonly implementingaround thisspecification to interoperate correctly with nodes implementing interfaces to such external networks. This minimal set of requirements and features involve the First Hop External (F) and Last Hop External (L) bits in a Source Route option (Section 5.7) and asource node will not generate RouteReply option (Section 5.3) in a packet's DSR header (Section 5). These requirements also includeReplies that contain theaddition of an External flag bit tagging eachsame invalid link for which this source nodeinreceived the RouteCache, copied fromError. For example, in theFirst Hop External (F) and Last Hop External (L) bitssituation shown in theSource Route option orexample of Section 3.2, node A learns from the RouteReply optionError message fromwhichC, that the link from C to D is currently broken. It thus removes thisnode was learned. Thelink from its own Route CacheSHOULD support storing more than oneand initiates a new Route Discovery (if it has no other route toeach destination. In searchingE in its Route Cache). On the RouteCache forRequest packet initiating this Route Discovery, node A piggybacks aroute to some destination node,copy of this Route Error, ensuring that the RouteCache is indexed by destination node address. The following properties describeError spreads well to other nodes, and guaranteeing that any Route Reply that it receives (including those from other node's Route Caches) in response to thissearching function on aRouteCache:Request does not contain a route that assumes the existence of this broken link. Johnson, et al Expires2 September 200121 May 2002 [Page15]16] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001- Each implementation4. Conceptual Data Structures This document describes the operation of the DSRat any node MAY choose any appropriate strategyprotocol in terms of a number of conceptual data structures. This section describes each of these data structures andalgorithm for searchingprovides an overview of its use in the protocol. In an implementation of the protocol, these data structures MAY be implemented in any manner consistent with the external behavior described in this document. 4.1. Route Cacheand selecting a "best" route to the destination from among those found. For example,All ad hoc network routing information needed by a nodeMAY choose to selectimplementing DSR is stored in that node's Route Cache. Each node in theshortest routenetwork maintains its own Route Cache. A node adds information tothe destination (the shortest sequence of hops), orits Route Cache as itMAY use an alternate metric to select the route fromlearns of new links between nodes in theCache. - However, if there are multiple cached routes toad hoc network; for example, adestination, the selectionnode may learn ofroutesnew links whensearching theit receives a packet carrying a RouteCache SHOULD prefer routes that do not have the External flag set on any node. This preference will select routes that lead directly to the targetRequest, Route Reply, or DSR source route. Likewise, a nodeover routesremoves information from its Route Cache as it learns thatattempt to reach the target via any external networks connected toexisting links in theDSRad hocnetwork. - In addition, any route selected when searching the Route Cache MUST NOTnetwork havethe External bit set for any nodes other than possibly the first node, the last node, or both; the External bit MUST NOT be setbroken; forany intermediate hops in the route selected. An implementationexample, a node may learn of aRoute Cache MAY providebroken link when it receives afixed capacity for the cache, or the cache size MAY be variable. The following properties describe the management of available space withinpacket carrying anode'sRouteCache: - Each implementation of DSR at each node MAY choose any appropriate policy for managingError or through theentrieslink-layer retransmission mechanism reporting a failure in forwarding a packet to itsRoute Cache, such as when limited cache capacity requiresnext-hop destination. Anytime achoice of which entriesnode adds new information toretain inits Route Cache, theCache. For example, anodeMAY choseSHOULD check each packet in its own Send Buffer (Section 4.2) to determine whether a"least recently used" (LRU) cache replacement policy,route to that packet's IP Destination Address now exists inwhichtheentry last used longest ago is discarded fromnode's Route Cache (including thecache if a decision needs to be madeinformation just added toallow space inthecache for some new entry being added. - However,Cache). If so, theRoute Cache replacement policypacket SHOULDallow routes to be categorized based upon "preference", where routes with a higher preferences are less likely tothen be sent using that route and removed from thecache. For example,Send Buffer. It is possible to interface anode could prefer routesDSR network with other networks, external to this DSR network. Such external networks may, forwhich it initiatedexample, be the Internet, or may be other ad hoc networks routed with aRoute Discovery over routesrouting protocol other than DSR. Such external networks may also be other DSR networks thatit learnedare treated as external networks in order to improve scalability. The complete handling of such external networks is beyond theresultscope ofpromiscuous snooping on other packets. In particular,this document. However, this document specifies anode SHOULD prefer routes that it is presently using over those that it is not. Any suitable data structure organization, consistent withminimal set of requirements and features necessary to allow nodes only implementing thisspecification, MAY be usedspecification toimplement the Route Cache in any node. For example, the following two typesinteroperate correctly with nodes implementing interfaces to such external networks. This minimal set oforganization are possible: - In DSR,requirements and features involve theroute returnedFirst Hop External (F) and Last Hop External (L) bits ineacha DSR Source RouteReply that is received by the initiator ofoption (Section 5.7) and a RouteDiscovery (or that is learned from theReply option (Section 5.3) in a packet's DSR header (Section 5). These requirements also include the addition ofoverhead packets, as describedan External flag bit tagging each link in the Route Cache, copied from the First Hop External (F) and Last Hop External (L) bits inSection 6.1.4) represents a complete path (a sequence of links) leading tothe DSR Source Route option or Route Reply option from which this link was learned. Johnson, et al Expires2 September 200121 May 2002 [Page16]17] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001destination node. By caching each of these paths separately, a "path cache" organization for theThe Route Cachecan be formed. A path cache is very simpleSHOULD support storing more than one route toimplement and easily guarantees that all routes are loop-free, sinceeachindividual route from a Route Reply or Route Request or used in a packet is loop-free. To search for a route in a path cache data structure,destination. In searching thesending node can simply search itsRoute Cache forany path (or prefix ofapath) that leadsroute tothe intendedsome destinationnode. This type of organization fornode, the Route Cachein DSR has been extensively studied through simulation [5, 11, 18] and throughis indexed by destination node address. The following properties describe this searching function on a Route Cache: - Each implementation of DSRin a mobile outdoor testbed under significant workload [19, 20, 20]. - Alternatively, a "link cache" organization could be usedat any node MAY choose any appropriate strategy and algorithm forthesearching its RouteCache, in which each individual link (hop) inCache and selecting a "best" route to theroutes returned in Route Reply packets (or otherwise learneddestination fromthe header of overhead packets) is added to a unified graph data structure of this node's current view of the network topology. To search foramong those found. For example, aroute in link cache, the sendingnodemust use a more complex graph search algorithm, such as the well-known Dijkstra's shortest-path algorithm,MAY choose tofind the current best path throughselect thegraphshortest route to the destinationnode. Such(the shortest sequence of hops), or it MAY use analgorithm is more difficult to implement and may require significantly more CPU timealternate metric toexecute.select the route from the Cache. - However,a link cache organization is more powerful than a path cache organization, in its abilityif there are multiple cached routes toeffectively utilize all of the potential information thatanode might learn aboutdestination, thestateselection of routes when searching thenetwork: links learned from differentRouteDiscoveries or fromCache MUST prefer routes that do not have theheader ofExternal flag set on anyoverheard packets can be merged together to form newlink. This preference will select routesinthat lead directly to thenetwork, but this is not possible in a path cache duetarget node over routes that attempt to reach theseparation of each individual path intarget via any external networks connected to thecache. This type of organization forDSR ad hoc network. - In addition, any route selected when searching the Route Cachein DSR, including the effect of a range of implementation choices, has been studied through detailed simulation [9]. The choice of data structure organization to use forMUST NOT have theRoute Cache in any DSR implementation is a local matterExternal bit set foreach node and affects only performance;anyreasonable choice of organizationlinks other than possibly the first link, the last link, or both; the External bit MUST NOT be set for any intermediate hops in the route selected. An implementation of a Route Cachedoes not affect either correctness or interoperability. 4.2. Route Request Table The Route Request Table records information about Route Requests that have been recently originated or forwarded by this node. The table is indexed by IP address. Johnson, et al Expires 2 September 2001 [Page 17] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 The Route Request Table onMAY provide anode recordsfixed capacity for thefollowing information about nodes to which this node has initiated a Route Request: -cache, or the cache size MAY be variable. Thetime that this node last originatedfollowing properties describe the management of available space within a node's RouteRequest for that target node.Cache: -The numberEach implementation ofconsecutive Route Requests initiatedDSR at each node MAY choose any appropriate policy forthis target since receiving a validmanaging the entries in its RouteReply givingCache, such as when limited cache capacity requires aroute to that target node. - The remaining amountchoice oftime beforewhichthisentries to retain in the Cache. For example, a node MAYnext attempt atchose aRoute Discovery for that target node. - The Time-to-Live (TTL) field used"least recently used" (LRU) cache replacement policy, in which theIP header ofentry lastRoute Request initiated by this node for that target node. In addition,used longest ago is discarded from theRoute Request Table oncache if anode also recordsdecision needs to be made to allow space in thefollowing information about initiator nodes from which this node has received a Route Request: - A FIFOcacheof size REQUEST_TABLE_IDS entries containing the Identification value and target address fromfor some new entry being added. - However, themost recentRouteRequests received by this node from that initiator node. Nodes SHOULD use an LRUCache replacement policy SHOULD allow routes tomanage the entries in their Route Request Table. The number of Identification valuesbe categorized based upon "preference", where routes with a higher preferences are less likely toretain in each Route Request Table entry, REQUEST_TABLE_IDS, MUST NOTbeunlimited, since, inremoved from theworst case, whencache. For example, a nodecrashes and reboots, the first REQUEST_TABLE_IDScould prefer routes for which it initiated a RouteDiscoveriesDiscovery over routes that itinitiates after rebooting could appear to be duplicates tolearned as the result of promiscuous snooping on othernodes in the network.packets. Inaddition,particular, a node SHOULDbase its initial Identification value,prefer routes that it is presently using over those that it is not. Johnson, et al Expires 21 May 2002 [Page 18] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 Any suitable data structure organization, consistent with this specification, MAY be usedforto implement the RouteDiscoveries after rebooting, on a battery backed-up clock or other persistent memory device,Cache inorder to help avoidanypossible such delay in successfully discovering new routes after rebooting; if no such source of initial Identification value is available, a node SHOULD base its initial Identification value after rebooting on a random number. 4.3. Send Buffer The Send Buffer of a node implementing DSR is a queuenode. For example, the following two types ofpackets that cannot be sent by that node because it does not yet have a sourceorganization are possible: - In DSR, the routeto each such packet's destination. Each packetreturned inthe Send Buffereach Route Reply that islogically associated withreceived by thetimeinitiator of a Route Discovery (or thatit was placed into the Buffer, and SHOULD be removedis learned from theSend Buffer and silently discarded SEND_BUFFER_TIMEOUT seconds after initially being placedheader of overhead packets, as described inJohnson, et al Expires 2 September 2001 [Page 18] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001Section 6.1.4) represents a complete path (a sequence of links) leading to theBuffer. If necessary,destination node. By caching each of these paths separately, aFIFO strategy SHOULD"path cache" organization for the Route Cache can beused to evict packets before they timeoutformed. A path cache is very simple toprevent the bufferimplement and easily guarantees that all routes are loop-free, since each individual route fromoverflowing. Subject to the rate limiting defined in Section 6.2,a RouteDiscovery SHOULD be initiated as often as possible for the destination address of any packets residingReply or Route Request or used inthe Send Buffer. 4.4. Retransmission Buffer The Retransmission Buffer ofanode implementing DSRpacket is loop-free. To search for aqueue of packets sent by thisroute in a path cache data structure, the sending node can simply search its Route Cache for any path (or prefix of a path) thatare awaitingleads to thereceiptintended destination node. This type ofan acknowledgment fromorganization for thenext hopRoute Cache in DSR has been extensively studied through simulation [5, 9, 12, 19] and through implementation of DSR in a mobile outdoor testbed under significant workload [20, 21, 22]. - Alternatively, a "link cache" organization could be used for thesource route (Section 5.7). ForRoute Cache, in which eachpacketindividual link (hop) in theRetransmission Buffer,routes returned in Route Reply packets (or otherwise learned from the header of overhead packets) is added to a unified graph data structure of this node's current view of the network topology. To search for a route in link cache, the sending nodemaintains (1)must use acount ofmore complex graph search algorithm, such as thenumber of retransmissions and (2)well-known Dijkstra's shortest-path algorithm, to find thetime ofcurrent best path through thelast retransmission. Packets are removed fromgraph to theRetransmission Buffer whendestination node. Such anacknowledgmentalgorithm isreceived or when the numbermore difficult to implement and may require significantly more CPU time to execute. However, a link cache organization is more powerful than a path cache organization, in its ability to effectively utilize all ofretransmissions exceeds DSR_MAXRXTSHIFT. Inthelater case,potential information that a node might learn about theremovalstate of thepacketnetwork. In particular, links learned fromthe Retransmission Buffer SHOULD result in adifferent RouteError being returned toDiscoveries or from theoriginal sourceheader ofthe packet (Section 6.3). Johnson, et al Expires 2 September 2001 [Page 19] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 5. DSR Header Format The Dynamic Source Routing protocol makes use of a special header carrying control information thatany overheard packets can beincluded in any existing IP packet. This DSR header in a packet contains a small fixed-sized, 4-octet portion, followed by a sequence of zero or more DSR options carrying optional information. The end of the sequence of DSR optionsmerged together to form new routes in theDSR header is implied by total length of the DSR header. The DSR headernetwork, but this isinsertednot possible inthe packet following the packet's IP header, before any following header such asatraditional (e.g., TCP or UDP) transport layer header. Specifically, the Protocol field in the IP header is usedpath cache due toindicate that a DSR header follows the IP header, andtheNext Header fieldseparation of each individual path in theDSR header is used to indicate thecache. This type ofprotocol header (such as a transport layer header) following the DSR header. The total length oforganization for theDSR header (and thusRoute Cache in DSR, including thetotal, combined lengtheffect ofall DSR options present) MUST beamultiplerange of4 octets. This requirement preserves the alignmentimplementation choices, has been studied through detailed simulation [9]. The choice ofany following headers indata structure organization to use for thepacket.Route Cache in any DSR implementation is a local matter for each node and affects Johnson, et al Expires2 September 200121 May 2002 [Page20]19] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 20015.1. Fixed Portiononly performance; any reasonable choice ofDSR Headerorganization for the Route Cache does not affect either correctness or interoperability. Each entry in the Route Cache SHOULD have a timeout associated with it, to allow that entry to be deleted if not used within some time. Thefixed portionparticular choice ofthe DSR header isalgorithm and data structure used tocarry information that mustimplement the Route Cache SHOULD bepresentconsidered inany DSR header. This fixed portion ofchoosing theDSR header hastimeout for entries in thefollowing format: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6Route Cache. The configuration variable RouteCacheTimeout defined in Section 78 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Reserved | Payload Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . Options . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Next Header 8-bit selector. Identifies the type of header immediately followingspecifies theDSR header. Usestimeout to be applied to entries in thesameRoute Cache, although it is also possible to instead use an adaptive policy in choosing timeout valuesas the IPv4 Protocol field [26]. Reserved Sent as 0; ignored on reception. Payload Length The length of the DSR header, excluding the 4-octet fixed portion. The value of the Payload Length field defines the total length ofrather than using a single timeout setting for alloptions carried inentries; for example, theDSR header. Options Variable-length field;Link-MaxLife cache design (below) uses an adaptive timeout algorithm and does not use thelengthRouteCacheTimeout configuration variable. As guidance to implementors, Appendix A describes a type of link cache known as "Link-MaxLife" that has been shown to outperform other types of link caches and path caches studied in detailed simulation [9]. Link-MaxLife is an adaptive link cache in which each link in theOptions fieldcache has a timeout that isspecifieddetermined dynamically by thePayload Length field in this DSR header. Contains one or more piecescaching node according to its observed past behavior ofoptional information (DSR options), encoded in type-length-value (TLV) format (withtheexceptiontwo nodes at the ends of thePad1 option, describedlink; inSection 5.8). The placementaddition, when selecting a route for a packet being sent to some destination, among cached routes ofDSR options followingequal length (number of hops) to that destination, Link-MaxLife selects thefixed portionroute with the longest expected lifetime (highest minimum timeout of any link in theDSR header MAY be paddedroute). Use of the Link-MaxLife design foralignment. However, due tothetypically limited available wireless bandwidth in ad hoc networks, this paddingRoute Cache isnot required, and receiving nodes MUST NOT expect options withinrecommended in implementations of DSR. 4.2. Send Buffer The Send Buffer of a node implementing DSRheader tois a queue of packets that cannot bealigned. Asent by that nodeinserting a DSR header intobecause it does not yet have a source route to each such packet's destination. Each packetMUST set the Don't Fragment (DF) bitin thepacket's IP header. The following typesSend Buffer is logically associated with the time that it was placed into the Buffer, and SHOULD be removed from the Send Buffer and silently discarded after a period ofDSR options are definedSendBufferTimeout after initially being placed inthis document for use within a DSR header:the Buffer. If necessary, a FIFO strategy SHOULD be used to evict packets before they timeout to prevent the buffer from overflowing. Subject to the rate limiting defined in Section 6.2, a Route Discovery SHOULD be initiated as often as possible for the destination address of any packets residing in the Send Buffer. Johnson, et al Expires2 September 200121 May 2002 [Page21]20] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001-4.3. Route Requestoption (Section 5.2) -Table The RouteReply option (Section 5.3) -Request Table of a node implementing DSR records information about Route Requests that have been recently originated or forwarded by this node. The table is indexed by IP address. The RouteError option (Section 5.4) - AcknowledgementRequestoption (Section 5.5) - Acknowledgement option (Section 5.6) - SourceTable on a node records the following information about nodes to which this node has initiated a Routeoption (Section 5.7) - Pad1 option (Section 5.8)Request: -PadN option (Section 5.9) Johnson, et al Expires 2 September 2001 [Page 22] INTERNET-DRAFTTheDynamic Source Routing Protocol 2 March 2001 5.2.Time-to-Live (TTL) field used in the IP header of the Route RequestOptionfor the last Route Discovery initiated by this node for that target node. This value allows the node to implement a variety of algorithms for controlling the spread of its Route Request on each Route Discovery initiated for a target. As examples, two possible algorithms for this use of the TTL field are described in Section 3.3.4. - The time that this node last originated a Route RequestDSR option is encoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Target Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IP fields: Source Address MUST be setfor that target node. - The number of consecutive Route Discoveries initiated for this target since receiving a valid Route Reply giving a route tothe addressthat target node. - The remaining amount ofthe node originatingtime before which thispacket. Intermediate nodesnode MAY next attempt at a Route Discovery for thatretransmittarget node. When thepacket to propagatenode initiates a new Route Discovery for this target node, this field in the Route RequestMUST NOT change this field. Destination Address MUST be setTable entry for that target node is initialized to theIP limited broadcast address (255.255.255.255). Hop Limit (TTL)timeout for that Route Discovery, after which the node MAYbe varied from 1 to 255,initiate a new Discovery forexample tothat target. Until a valid Route Reply is received for this target node address, a node MUST implementnon-propagatinga back-off algorithm in determining this timeout value for each successive RouteRequests andDiscovery initiated for this target using the same Time-to-Live (TTL) value in the IP header of the Route Requestexpanding-ring searches (Section 3.3.4).packet. The timeout between such consecutive RouteRequest fields: Option Type 2 OptDiscovery initiations SHOULD increase by doubling the timeout value on each new initiation. In addition, the Route Request Table on a node also records the following information about initiator nodes from which this node has received a Route Request: - A FIFO cache of size RequestTableIds entries containing the Identification value and target address from the most recent Route Requests received by this node from that initiator node. Nodes SHOULD use an LRU policy to manage the entries in their Route Request Table. Johnson, et al Expires 21 May 2002 [Page 21] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 The number of Identification values to retain in each Route Request Table entry, RequestTableIds, MUST NOT be unlimited, since, in the worst case, when a node crashes and reboots, the first RequestTableIds Route Discoveries it initiates after rebooting could appear to be duplicates to the other nodes in the network. In addition, a node SHOULD base its initial Identification value, used for Route Discoveries after rebooting, on a battery backed-up clock or other persistent memory device, in order to help avoid any possible such delay in successfully discovering new routes after rebooting; if no such source of initial Identification value is available, a node after rebooting SHOULD base its initial Identification value on a random number. 4.4. Gratuitous Route Reply Table The Gratuitous Route Reply Table of a node implementing DSR records information about "gratuitous" Route Replies sent by this node as part of automatic route shortening. As described in Section 3.4.3, a node returns a gratuitous Route Reply when it overhears a packet transmitted by some node, for which the node overhearing the packet was not the intended next-hop node but was named later in the unexpended hops of the source route in that packet; the node overhearing the packet returns a gratuitous Route Reply to the original sender of the packet, listing the shorter route (not including the hops of the source route "skipped over" by this packet). A node uses its Gratuitous Route Reply Table to limit the rate at which it originates gratuitous Route Replies to the same original sender for the same node from which it overheard a packet to trigger the gratuitous Route Reply. Each entry in the Gratuitous Route Reply Table of a node contains the following fields: - The address of the node to which this node originated a gratuitous Route Reply. - The address of the node from which this node overheard the packet triggering that gratuitous Route Reply. - The remaining time before which this entry in the Gratuitous Route Reply Table expires and SHOULD be deleted by the node. When a node creates a new entry in its Gratuitous Route Reply Table, the timeout value for that entry should be initialized to the value GratReplyHoldoff. When a node overhears a packet that would trigger a gratuitous Route Reply, if a corresponding entry already exists in the node's Gratuitous Route Reply Table, then the node SHOULD NOT send a gratuitous Route Reply for that packet. Otherwise (no corresponding Johnson, et al Expires 21 May 2002 [Page 22] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 entry already exists), the node SHOULD create a new entry in its Gratuitous Route Reply Table to record that gratuitous Route Reply, with a timeout value of GratReplyHoldoff. 4.5. Network Interface Queue and Retransmission Buffer Depending on factors such as the structure and organization of the operating system, protocol stack implementation, network interface device driver, and network interface hardware, a packet being transmitted could be queued in a variety of ways. For example, outgoing packets from the network protocol stack might be queued at the operating system or link layer, before transmission by the network interface. The network interface might also provide a retransmission mechanism for packets, such as occurs in IEEE 802.11 [11]; the DSR protocol also requires limited retransmission of packets as part of Route Maintenance. The operation of DSR is defined here in terms of two conceptual data structures that together incorporate this queueing and retransmission behavior. The Network Interface Queue of a node implementing DSR is an output queue of packets from the network protocol stack waiting to be transmitted by the network interface; for example, in the 4.4BSD Unix network protocol stack implementation, this queue for a network interface is represented as a "struct ifqueue" [33]. This queue is used to hold packets while the network interface is in the process of transmitting another packet. The Retransmission Buffer of a node implementing DSR is a queue of packets sent by this node that are awaiting retransmission as part of Route Maintenance. For each packet in the Retransmission Buffer, a node maintains a count of the number of retransmissions and the time of the last retransmission. The Retransmission Buffer MAY be of limited size; when adding a new packet to the Retransmission Buffer, if the buffer size is insufficient to hold the new packet, the new packet SHOULD be silently discarded. The maximum number of retransmission attempts for a packet for Route Maintenance (after the initial transmission of the packet) is MaxMaintRexmt. After this time, if Route Maintenance for a packet has not been satisfied, the packet SHOULD be removed from the Retransmission Buffer, stopping retransmissions for that packet; in this case, the node also SHOULD originate a Route Error for this packet to the original source of the packet (Section 6.3) and SHOULD salvage the packet (Section 6.3.6) if it has another route to the packet's IP Destination Address in its Route Cache. The definition of MaxMaintRexmt conceptually includes any retransmissions that might be attempted for a packet at the link layer or within the network interface hardware. The retransmission timeout value to use for each transmission attempt for a packet Johnson, et al Expires 21 May 2002 [Page 23] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 depends on the type of acknowledgement mechanism used for Route Maintenance for that attempt, as described in Section 6.3. Johnson, et al Expires 21 May 2002 [Page 24] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5. DSR Header Format The Dynamic Source Routing protocol makes use of a special header carrying control information that can be included in any existing IP packet. This DSR header in a packet contains a small fixed-sized, 4-octet portion, followed by a sequence of zero or more DSR options carrying optional information. The end of the sequence of DSR options in the DSR header is implied by total length of the DSR header. For IPv4, the DSR header MUST immediately follow the IP header in the packet. (If a Hop-by-Hop Options extension header, as defined in IPv6 [6], becomes defined for IPv4, the DSR header MUST immediately follow the Hop-by-Hop Options extension header, if one is present in the packet, and MUST otherwise immediately follow the IP header.) To add a DSR header to a packet, the DSR header is inserted following the packet's IP header, before any following header such as a traditional (e.g., TCP or UDP) transport layer header. Specifically, the Protocol field in the IP header is used to indicate that a DSR header follows the IP header, and the Next Header field in the DSR header is used to indicate the type of protocol header (such as a transport layer header) following the DSR header. If any headers follow the DSR header in a packet, the total length of the DSR header (and thus the total, combined length of all DSR options present) MUST be a multiple of 4 octets. This requirement preserves the alignment of these following headers in the packet. Johnson, et al Expires 21 May 2002 [Page 25] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.1. Fixed Portion of DSR Header The fixed portion of the DSR header is used to carry information that must be present in any DSR header. This fixed portion of the DSR header has the following format: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Reserved | Payload Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . Options . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Next Header 8-bit selector. Identifies the type of header immediately following the DSR header. Uses the same values as the IPv4 Protocol field [29]. Reserved MUST be sent as 0 and ignored on reception. Payload Length The length of the DSR header, excluding the 4-octet fixed portion. The value of the Payload Length field defines the total length of all options carried in the DSR header. Options Variable-length field; the length of the Options field is specified by the Payload Length field in this DSR header. Contains one or more pieces of optional information (DSR options), encoded in type-length-value (TLV) format (with the exception of the Pad1 option, described in Section 5.8). The placement of DSR options following the fixed portion of the DSR header MAY be padded for alignment. However, due to the typically limited available wireless bandwidth in ad hoc networks, this padding is not required, and receiving nodes MUST NOT expect options within a DSR header to be aligned. A node inserting a DSR header into a packet MUST set the Don't Fragment (DF) bit in the packet's IP header. Johnson, et al Expires 21 May 2002 [Page 26] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 The following types of DSR options are defined in this document for use within a DSR header: - Route Request option (Section 5.2) - Route Reply option (Section 5.3) - Route Error option (Section 5.4) - Acknowledgement Request option (Section 5.5) - Acknowledgement option (Section 5.6) - DSR Source Route option (Section 5.7) - Pad1 option (Section 5.8) - PadN option (Section 5.9) Johnson, et al Expires 21 May 2002 [Page 27] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.2. Route Request Option The Route Request option in a DSR header is encoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Target Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IP fields: Source Address MUST be set to the address of the node originating this packet. Intermediate nodes that retransmit the packet to propagate the Route Request MUST NOT change this field. Destination Address MUST be set to the IP limited broadcast address (255.255.255.255). Hop Limit (TTL) MAY be varied from 1 to 255, for example to implement non-propagating Route Requests and Route Request expanding-ring searches (Section 3.3.4). Route Request fields: Option Type 2 Opt Data Len 8-bit unsigned integer. Length of the option, in octets, excluding the Option Type and Opt Data Len fields. Johnson, et al Expires 21 May 2002 [Page 28] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 Identification A unique value generated by the initiator (original sender) of the Route Request. Nodes initiating a Route Request generate a new Identification value for each Route Request, for example based on a sequence number counter of all Route Requests initiated by the node. This value allows a receiving node to determine whether it has recently seen a copy of this Route Request: if this Identification value is found by this receiving node in its Route Request Table (in the cache of Identification values in the entry there for this initiating node), this receiving node MUST discard the Route Request. When propagating a Route Request, this field MUST be copied from the received copy of the Route Request being propagated. Target Address The address of the node that is the target of the Route Request. Address[1..n] Address[i] is the address of the i-th node recorded in the Route Request option. The address given in the Source Address field in the IP header is the address of the initiator of the Route Discovery and MUST NOT be listed in the Address[i] fields; the address given in Address[1] is thus the address of the first node on the path after the initiator. The number of addresses present in this field is indicated by the Opt Data Len field in the option (n = (Opt Data Len - 6) / 4). Each node propagating the Route Request adds its own address to this list, increasing the Opt Data Len value by 4 octets. The Route Request option MUST NOT appear more than once within a DSR header. Johnson, et al Expires 21 May 2002 [Page 29] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.3. Route Reply Option The Route Reply option in a DSR header is encoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len |L| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IP fields: Source Address Set to the address of the node sending the Route Reply. In the case of a node sending a reply from its Route Cache (Section 3.3.2) or sending a gratuitous Route Reply (Section 3.4.3), this address can differ from the address that was the target of the Route Discovery. Destination Address MUST be set to the address of the source node of the route being returned. Copied from the Source Address field of the Route Request generating the Route Reply, or in the case of a gratuitous Route Reply, copied from the Source Address field of the data packet triggering the gratuitous Reply. Route Reply fields: Option Type 3 Opt Data Len 8-bit unsigned integer. Length of the option, in octets, excluding the Option Type and Opt Data Len fields. Johnson, et al Expires 21 May 2002 [Page 30] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 Last Hop External (L) Set to indicate that the last hop given by the Route Reply (the link from Address[n-1] to Address[n]) is actually an arbitrary path in a network external to the DSR network; the exact route outside the DSR network is not represented in the Route Reply. Nodes caching this hop in their Route Cache MUST flag the cached hop with the External flag. Such hops MUST NOT be returned in a cached Route Reply generated from this Route Cache entry, and selection of routes from the Route Cache to route a packet being sent MUST prefer routes that contain no hops flagged as External. Reserved MUST be sent as 0 and ignored on reception. Address[1..n] The source route being returned by the Route Reply. The route indicates a sequence of hops, originating at the source node specified in the Destination Address field of the IP header of the packet carrying the Route Reply, through each of the Address[i] nodes in the order listed in the Route Reply, ending with the destination node indicated by Address[n]. The number of addresses present in the Address[1..n] field is indicated by the Opt Data Len field in the option (n = (Opt Data Len - 1) / 4). A Route Reply option MAY appear one or more times within a DSR header. Johnson, et al Expires 21 May 2002 [Page 31] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.4. Route Error Option The Route Error option in a DSR header is encoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len | Error Type |Reservd|Salvage| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . Type-Specific Information . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type 4 Opt Data Len 8-bit unsigned integer. Length of the option, in octets, excluding the Option Type and Opt Data Len fields. For the current definition of the Route Error option, this field MUST be set to 10, plus the size of any Type-Specific Information present in the Route Error. Further extensions to the Route Error option format may also be included after the Type-Specific Information portion of the Route Error option specified above. The presence of such extensions will be indicated by the Opt Data Len field. When the Opt Data Len is greater than that required for the fixed portion of the Route Error plus the necessary Type-Specific Information as indicated by the Option Type value in the option, the remaining octets are interpreted as extensions. Currently, no such further extensions have been defined. Error Type The type of error encountered. Currently, the following type value is defined: 1 = NODE_UNREACHABLE Other values of the Error Type field are reserved for future use. Johnson, et al Expires 21 May 2002 [Page 32] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 Reservd Reserved. MUST be sent as 0 and ignored on reception. Salvage A 4-bit unsigned integer. Copied from the Salvage field in the DSR Source Route option of the packet triggering the Route Error. The "total salvage count" of the Route Error option is derived from the value in the Salvage field of this Route Error option and all preceding Route Error options in the packet as follows: the total salvage count is the sum of, for each such Route Error option, one plus the value in the Salvage field of that Route Error option. Error Source Address The address of the node originating the Route Error (e.g., the node that attempted to forward a packet and discovered the link failure). Error Destination Address The address of the node to which the Route Error must be delivered For example, when the Error Type field is set to NODE_UNREACHABLE, this field will be set to the address of the node that generated the routing information claiming that the hop from the Error Source Address to Unreachable Node Address (specified in the Type-Specific Information) was a valid hop. Type-Specific Information Information specific to the Error Type of this Route Error message. Currently, the Type-Specific Information field is defined only for Route Error messages of type NODE_UNREACHABLE. In this case, the Type-Specific Information field is defined as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unreachable Node Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Johnson, et al Expires 21 May 2002 [Page 33] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 Unreachable Node Address The address of the node that was found to be unreachable (the next-hop neighbor to which the node with address Error Source Address was attempting to transmit the packet). A Route Error option MAY appear one or more times within a DSR header. Johnson, et al Expires 21 May 2002 [Page 34] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.5. Acknowledgment Request Option The Acknowledgment Request option in a DSR header is encoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type 5 Opt Data Len 8-bit unsigned integer. Length of the option, in octets, excluding the Option Type and Opt Data Len fields. Identification The Identification field is set to a unique value and is copied into the Identification field of the Acknowledgement option when returned by the node receiving the packet over this hop. An Acknowledgement Request option MUST NOT appear more than once within a DSR header. Johnson, et al Expires 21 May 2002 [Page 35] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.6. Acknowledgment Option The Acknowledgment option in a DSR header is encoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type 6 Opt Data Len 8-bit unsigned integer. Length of the option, in octets, excluding the Option Type and Opt Data Len fields. Identification Copied from the Identification field of the Acknowledgement Request option of the packet being acknowledged. ACK Source Address The address of the node originating the acknowledgment. ACK Destination Address The address of the node to which the acknowledgment is to be delivered. An Acknowledgement option MAY appear one or more times within a DSR header. Johnson, et al Expires 21 May 2002 [Page 36] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.7. DSR Source Route Option The DSR Source Route option in a DSR header is encoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len |F|L|Reservd|Salvage| Segs Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type 7 Opt Data Len 8-bit unsigned integer. Length of the option, in octets, excluding the Option Type and Opt Data Len fields. For the format of the DSR Source Route option defined here, this field MUST be set to the value (n * 4) + 2, where n is the number of addresses present in the Address[i] fields. First Hop External (F) Set to indicate that the first hop indicated by the DSR Source Route option is actually an arbitrary path in a network external to the DSR network; the exact route outside the DSR network is not represented in the DSR Source Route option. Nodes caching this hop in their Route Cache MUST flag the cached hop with the External flag. Such hops MUST NOT be returned in a Route Reply generated from this Route Cache entry, and selection of routes from the Route Cache to route a packet being sent MUST prefer routes that contain no hops flagged as External. Last Hop External (L) Set to indicate that the last hop indicated by the DSR Source Route option is actually an arbitrary path in a network external to the DSR network; the exact route outside the DSR network is not represented in the DSR Source Route option. Nodes caching this hop in their Route Cache MUST flag the Johnson, et al Expires 21 May 2002 [Page 37] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 cached hop with the External flag. Such hops MUST NOT be returned in a Route Reply generated from this Route Cache entry, and selection of routes from the Route Cache to route a packet being sent MUST prefer routes that contain no hops flagged as External. Reserved MUST be sent as 0 and ignored on reception. Salvage A 4-bit unsigned integer. Count of number of times that this packet has been salvaged as a part of DSR routing (Section 3.4.1). Segments Left (Segs Left) Number of route segments remaining, i.e., number of explicitly listed intermediate nodes still to be visited before reaching the final destination. Address[1..n] The sequence of addresses of the source route. In routing and forwarding the packet, the source route is processed as described in Sections 6.1.3 and 6.1.5. The number of addresses present in the Address[1..n] field is indicated by the Opt Data Len field in the option (n = (Opt Data Len - 2) / 4). When forwarding a packet along a DSR source route using a DSR Source Route option in the packet's DSR header, the Destination Address field in the packet's IP header is always set to the address of the packet's ultimate destination. A node receiving a packet containing a DSR header with a DSR Source Route option MUST examine the indicated source route to determine if it is the intended next-hop node for the packet and determine how to forward the packet, as defined in Sections 6.1.4 and 6.1.5. Johnson, et al Expires 21 May 2002 [Page 38] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.8. Pad1 Option The Pad1 option in a DSR header is encoded as follows: +-+-+-+-+-+-+-+-+ | Option Type | +-+-+-+-+-+-+-+-+ Option Type 0 A Pad1 option MAY be included in the Options field of a DSR header in order to align subsequent DSR options, but such alignment is not required and MUST NOT be expected by a node receiving a packet containing a DSR header. If any headers follow the DSR header in a packet, the total length of a DSR header, indicated by the Payload Length field in the DSR header MUST be a multiple of 4 octets. In this case, when building a DSR header in a packet, sufficient Pad1 or PadN options MUST be included in the Options field of the DSR header to make the total length a multiple of 4 octets. If more than one consecutive octet of padding is being inserted in the Options field of a DSR header, the PadN option, described next, SHOULD be used, rather than multiple Pad1 options. Note that the format of the Pad1 option is a special case; it does not have an Opt Data Len or Option Data field. Johnson, et al Expires 21 May 2002 [Page 39] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 5.9. PadN Option The PadN option in a DSR header is encoded as follows: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - | Option Type | Opt Data Len | Option Data +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - Option Type 1 Opt Data Len 8-bit unsigned integer. Length of the option, in octets, excluding the Option Type and Opt Data Len fields. Option Data A number of zero-valued octets equal to the Opt Data Len. A PadN option MAY be included in the Options field of a DSR header in order to align subsequent DSR options, but such alignment is not required and MUST NOT be expected by a node receiving a packet containing a DSR header. If any headers follow the DSR header in a packet, the total length of a DSR header, indicated by the Payload Length field in the DSR header MUST be a multiple of 4 octets. In this case, when building a DSR header in a packet, sufficient Pad1 or PadN options MUST be included in the Options field of the DSR header to make the total length a multiple of 4 octets. Johnson, et al Expires 21 May 2002 [Page 40] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 6. Detailed Operation 6.1. General Packet Processing 6.1.1. Originating a Packet When originating any packet, a node using DSR routing MUST perform the following sequence of steps: - Search the node's Route Cache for a route to the address given in the IP Destination Address field in the packet's header. - If no such route is found in the Route Cache, then perform Route Discovery for the Destination Address, as described in Section 6.2. Initiating a Route Discovery for this target node address results in the node adding a Route Request option in a DSR header in this existing packet, or saving this existing packet to its Send Buffer and initiating the Route Discovery by sending a separate packet containing such a Route Request option. If the node chooses to initiate the Route Discovery by adding the Route Request option to this existing packet, it will replace the IP Destination Address field with the IP "limited broadcast" address (255.255.255.255) [3], copying the original IP Destination Address to the Target Address field of the new Route Request option added to the packet, as described in Section 6.2.1. - If the packet now does not contain a Route Request option, then this node must have a route to the Destination Address of the packet; if the node has more than one route to this Destination Address, the node selects one to use for this packet. If the length of this route is greater than 1 hop, or if the node determines to request a DSR network-layer acknowledgement from the first-hop node in that route, then insert a DSR header into the packet, as described in Section 6.1.2, and insert a DSR Source Route option, as described in Section 6.1.3. The source route in the packet is initialized from the selected route to the Destination Address of the packet. - Transmit the packet to the first-hop node address given in selected source route, using Route Maintenance to retransmit the packet if necessary, as described in Section 6.3. 6.1.2. Adding a DSR Header to a Packet A node originating a packet adds a DSR header to the packet, if necessary, to carry information needed by the routing protocol. A packet MUST NOT contain more than one DSR header. A DSR header is added to a packet by performing the following sequence of steps Johnson, et al Expires 21 May 2002 [Page 41] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 (these steps assume that the packet contains no other headers that MUST be located in the packet before the DSR header): - Insert a DSR header after the IP header but before any other header that may be present. - Set the Next Header field of the DSR header to the Protocol number field of the packet's IP header. - Set the Protocol field of the packet's IP header to the Protocol number assigned for a DSR header (TBA???). 6.1.3. Adding a DSR Source Route Option to a Packet A node originating a packet adds a DSR Source Route option to the packet, if necessary, in order to carry the source route from this originating node to the final destination address of the packet. Specifically, the node adding the DSR Source Route option constructs the DSR Source Route option and modifies the IP packet according to the following sequence of steps: - The node creates a DSR Source Route option, as described in Section 5.7, and appends it to the DSR header in the packet. (A DSR header is added, as described in Section 6.1.2, if not already present.) - The number of Address[i] fields to include in the DSR Source Route option (n) is the number of intermediate nodes in the source route for the packet (i.e., excluding address of the originating node and the final destination address of the packet). The Segments Left field in the DSR Source Route option is initialized equal to n. - The addresses within the source route for the packet are copied into sequential Address[i] fields in the DSR Source Route option, for i = 1, 2, ..., n. - The First Hop External (F) bit in the DSR Source Route option is copied from the External bit flagging the first hop in the source route for the packet, as indicated in the Route Cache. - The Last Hop External (L) bit in the DSR Source Route option is copied from the External bit flagging the last hop in the source route for the packet, as indicated in the Route Cache. - The Salvage field in the DSR Source Route option is initialized to 0. Johnson, et al Expires 21 May 2002 [Page 42] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 6.1.4. Processing a Received Packet When a node receives any packet (whether for forwarding, overheard, or as the final destination of the packet), if that packet contains a DSR header, then that node MUST process any options contained in that DSR header, in the order contained there. Specifically: - If the DSR header contains a Route Request option, the node SHOULD extract the source route from the Route Request and add this routing information to its Route Cache, subject to the conditions identified in Section 3.3.1. The routing information from the Route Request is the sequence of hop addresses initiator, Address[1], Address[2], ..., Address[n] where initiator is the value of the Source Address field in the IP header of the packet carrying the Route Request (the address of the initiator of the Route Discovery), and each Address[i] is a node through which this Route Request has passed, in turn, during this Route Discovery. The value n here is the number of addresses recorded in the Route Request option, or (Opt Data Len - 6) / 4. After possibly updating the node's Route Cache in response to the routing information in the Route Request option, the node MUST then process the Route Request option as described in Section 6.2.2. - If the DSR header contains a Route Reply option, the node SHOULD extract the source route from the Route Reply and add this routing information to its Route Cache, subject to the conditions identified in Section 3.3.1. The source route from the Route Reply is the sequence of hop addresses initiator, Address[1], Address[2], ..., Address[n] where initiator is the value of the Destination Address field in the IP header of the packet carrying the Route Reply (the address of the initiator of the Route Discovery), and each Address[i] is a node through which the source route passes, in turn, on the route to the target of the Route Discovery. Address[n] is the address of the target. If the Last Hop External (L) bit is set in the Route Reply, the node MUST flag the last hop from the Route Reply (the link from Address[n-1] to Address[n]) in its Route Cache as External. The value n here is the number of addresses in the source route being returned in the Route Reply option, or (Opt Data Len - 1) / 4. After possibly updating the node's Route Cache in response to the routing information in the Route Reply option, then if the Johnson, et al Expires 21 May 2002 [Page 43] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 packet's IP Destination Address matches one of this node's IP addresses, the node MUST then process the Route Reply option as described in Section 6.2.5. - If the DSR header contains a Route Error option, the node MUST process the Route Error option as described in Section 6.3.5. - If the DSR header contains an Acknowledgement Request option, the node MUST process the Acknowledgement Request option as described in Section 6.3.3. - If the DSR header contains an Acknowledgement option, then subject to the conditions identified in Section 3.3.1, the node SHOULD add to its Route Cache the single link from the node identified by the ACK Source Address field to the node identified by the ACK Destination Address field. After possibly updating the node's Route Cache in response to the routing information in the Acknowledgement option, the node MUST then process the Acknowledgement option as described in Section 6.3.3. - If the DSR header contains a DSR Source Route option, the node SHOULD extract the source route from the DSR Source Route and add this routing information to its Route Cache, subject to the conditions identified in Section 3.3.1. If the value of the Salvage field in the DSR Source Route option is zero, then the routing information from the DSR Source Route is the sequence of hop addresses source, Address[1], Address[2], ..., Address[n], destination and otherwise (Salvage is nonzero), the routing information from the DSR Source Route is the sequence of hop addresses Address[1], Address[2], ..., Address[n], destination where source is the value of the Source Address field in the IP header of the packet carrying the DSR Source Route option (the original sender of the packet), each Address[i] is the value in the Address[i] field in the DSR Source Route, and destination is the value of the Destination Address field in the packet's IP header (the last-hop address of the source route). The value n here is the number of addresses in source route in the DSR Source Route option, or (Opt Data Len8-bit unsigned integer. Length- 2) / 4. After possibly updating the node's Route Cache in response to the routing information in the DSR Source Route option, the node MUST then process the DSR Source Route option as described in Section 6.1.5. Johnson, et al Expires 21 May 2002 [Page 44] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 - Any Pad1 or PadN options in the DSR header are ignored. Finally, if the Destination Address in the packet's IP header matches one of this receiving node's own IP address(es), remove the DSR header and all the included DSR options in the header, and pass the rest of the packet to the network layer. 6.1.5. Processing a Received DSR Source Route Option When a node receives a packet containing a DSR Source Route option (whether for forwarding, overheard, or as the final destination of the packet), that node SHOULD examine the packet to determine if the receipt of that packet indicates an opportunity for automatic route shortening, as described in Section 3.4.3. Specifically, if this node is not the intended next-hop destination for the packet but is named in the later unexpended portion of the source route in the packet's DSR Source Route option, then this packet indicates an opportunity for automatic route shortening: the intermediate nodes after the node from which this node overheard the packet and before this node itself, are no longer necessary in the source route. In this case, this node SHOULD perform the following sequence of steps as part of automatic route shortening: - The node searches its Gratuitous Route Reply Table for an entry describing a gratuitous Route Reply earlier sent by this node, for which the original sender of the packet triggering the gratuitous Route Reply and the transmitting node from which this node overheard that packet in order to trigger the gratuitous Route Reply, both match the respective node addresses for this new received packet. If such an entry is found in the node's Gratuitous Route Reply Table, the node SHOULD NOT perform automatic route shortening in response to this receipt of this packet. - Otherwise, the node creates an entry for this overheard packet in its Gratuitous Route Reply Table. The timeout value for this new entry SHOULD be initialized to the value GratReplyHoldoff. After this timeout has expired, the node SHOULD delete this entry from its Gratuitous Route Reply Table. - After creating the new Gratuitous Route Reply Table entry above, the node originates a gratuitous Route Reply to the IP Source Address of this overheard packet, as described in Section 3.4.3. If the MAC protocol in use in the network is not capable of transmitting unicast packets over uni-directional links, as discussed in Section 3.3.1, then in originating this Route Reply, the node MUST use a source route for routing the Route Reply Johnson, et al Expires 21 May 2002 [Page 45] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 packet that is obtained by reversing the sequence of hops over which the packet triggering the gratuitous Route Reply was routed in reaching and being overheard by this node; this reversing of the route uses the gratuitous Route Reply to test this sequence of hops for bi-directionality, preventing the gratuitous Route Reply from being received by the initiator of the Route Discovery unless each of the hops over which the gratuitous Route Reply is returned is bi-directional. - Discard the overheard packet, since the packet has been received before its normal traversal of the packet's source route would have caused it to reach this receiving node. Another copy of the packet will normally arrive at this node as indicated in the packet's source route; discarding this initial copy of the packet, which triggered the gratuitous Route Reply, will prevent the duplication of this packet that would otherwise occur. If the packet is not discarded as part of automatic route shortening above, then the node MUST process the option according to the following sequence of steps: - If the value of theoption,Segments Left field inoctets, excludingtheOption Type and OptDSR Source Route option equals 0, then remove the DSR Source Route option from the DSR header. - Else, let n equal (Opt Data Lenfields. Johnson, et al Expires 2 September 2001 [Page 23] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 Identification A unique value generated by- 2) / 4. This is theinitiator (original sender)number of addresses in the DSR Source RouteRequest. Nodes initiating a Route Request generate a new Identificationoption. - If the valuefor each Route Request, for example based on a sequence number counterofall Route Requests initiated bythenode. This value allows a receiving nodeSegments Left field is greater than n, then send an ICMP Parameter Problem, Code 0, message [26] todetermine whether it has recently seen a copy of thisthe IP Source Address, pointing to the Segments Left field, and discard the packet. Do not process the DSR Source RouteRequest: if this Identificationoption further. - Else, decrement the valueis foundof the Segments Left field bythis receiving node in its Route Request Table (in1. Let i equal n minus Segments Left. This is thecacheindex ofIdentification valuesthe next address to be visited in theentry there for this initiating node), this receiving node MUST discardAddress vector. - If Address[i] or theRoute Request. When propagatingIP Destination Address is aRoute Request, this field MUST be copied frommulticast address, then discard thereceived copy ofpacket. Do not process the DSR Source RouteRequest being propagated. Target Address The addressoption further. - If the MTU of the link over which this nodethat iswould transmit thetarget ofpacket to forward it to theRoute Request. Address[1..n]node Address[i] is less than theaddresssize of thei-th hop recorded inpacket, theRoute Request option. The address given innode MUST discard the packet and send an ICMP Packet Too Big message to the packet's Source Addressfield in[26]. - Forward theIP header ispacket to the IP addressofspecified in theinitiatorAddress[i] field of theRoute DiscoveryIP header, following normal IP forwarding procedures, including checking andMUST NOT be listed in the Address[i] fields;decrementing theaddress givenTime-to-Live (TTL) field inAddress[1] is thustheaddresspacket's IP header [27, 3]. In this Johnson, et al Expires 21 May 2002 [Page 46] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 forwarding of thefirst node on the path afterpacket, theinitiator. The number of addresses present in this field is indicatednext-hop node (identified by Address[i]) MUST be treated as a direct neighbor node: theOpt Data Len fieldtransmission to that next node MUST be done in a single IP forwarding hop, without Route Discovery and without searching theoption (n = (Opt Data LenRoute Cache. -2) / 4). Each node propagatingIn forwarding the packet, perform RouteRequest adds its own address to this list, increasingMaintenance for theOpt Data Len valuenext hop of the packet, by4 octets. The Route Request optionverifying that the packet was received by that next-hop node, as described in Section 6.3. Multicast addresses MUST NOT appearmore than once withinin a DSR Source Route option or in the IP Destination Address field of a packet carrying a DSR Source Route option in a DSR header. Johnson, et al Expires2 September 200121 May 2002 [Page24]47] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 20015.3.6.2. RouteReply Option TheDiscovery Processing RouteReply DSR optionDiscovery isencoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+ | Option Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Opt Data Len |L| Reserved | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IP fields: Source Address Set to the address ofthe mechanism by which a nodesending the Route Reply. In the case ofS wishing to send a packet to a destination nodesendingD obtains areply from itssource route to D. RouteCache (Section 3.3.2) or sendingDiscovery is used only when S attempts to send agratuitous Route Reply (Section 3.4.2), this address can differ from the address that was the target of the Route Discovery. Destination Address MUST be setpacket tothe address of the source node of theD and does not already know a routebeing returned. Copied from the Source Address field of the Route Request generating the Route Reply, or in the case ofto D. The node initiating agratuitousRouteReply, copied from the Source Address field of the data packet triggeringDiscovery is known as thegratuitous Reply. Route Reply fields: Option Type 3 Opt Data Len 8-bit unsigned integer. Length"initiator" of theoption, in octets, excluding the Option TypeRoute Discovery, andOpt Data Len fields. Johnson, et al Expires 2 September 2001 [Page 25] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 Last Hop External (L) Set to indicate thatthelastdestination nodeindicated byfor which the RouteReply (Address[n])Discovery isactually in a network external toinitiated is known as theDSR network;"target" of theexact sequenceRoute Discovery. Route Discovery operates entirely on demand, with a node initiating Route Discovery based on its own origination ofhops leadingnew packets for some destination address to which itoutside the DSR network isdoes notrepresentedcurrently know a route. Route Discovery does not depend on any periodic or background exchange of routing information or neighbor node detection at any layer in the network protocol stack at any node. The RouteReply. Nodes caching this hop in theirDiscovery procedure utilizes two types of messages, a RouteCache MUST flagRequest (Section 5.2) and a Route Reply (Section 5.3), to actively search thecached hop withad hoc network for a route to theExternal flag. Such hops MUST NOTdesired destination. These DSR messages MAY bereturnedcarried ina cached Route Reply generated from this Route Cache entry, and selectionany type of IP packet, through use ofroutes fromthe DSR header as described in Section 5. Except as discussed in Section 6.3.5, a RouteCacheDiscovery for a destination address SHOULD NOT be initiated unless the initiating node has a packet in its Send Buffer requiring delivery toroute a packet being sent SHOULD prefer routesthatcontain no hops flagged as External. Reserved Sent as 0; ignored on reception. Identification Copied fromdestination. A Route Discovery for a given target node MUST NOT be initiated unless permitted by theIdentification field ofrate-limiting information contained in the Route Request Table. After each Route Discovery attempt, the interval between successive Route Discoveries forwhichthisReply is sent in response. Sent as 0 if thetarget SHOULD be doubled, up to a maximum of MaxRequestPeriod, until a valid Route Reply isnot sent in response toreceived for this target. 6.2.1. Originating a Route Request(a gratuitousA node initiating a RouteReply). Address[1..n] The source route being returned by theDiscovery for some target creates and initializes a RouteReply. The route indicatesRequest option in asequence of hops, originating atDSR header in some IP packet. This MAY be a separate IP packet, used only to carry this Route Request option, or thesourcenodespecifiedMAY include the Route Request option in some existing packet that it needs to send to theDestination Address field oftarget node (e.g., the IPheader of thepacketcarryingoriginated by this node, that caused the node to attempt RouteReply, through eachDiscovery for the destination address of theAddress[i] nodespacket). The Route Request option MUST be included inthe order listeda DSR header in the packet. To initialize the RouteReply, ending withRequest option, thedestinationnodeindicated by Address[n]. The number of addresses present in the Address[1..n] field is indicated by the Opt Data Len field inperforms theoption (n = (Opt Data Lenfollowing sequence of steps: -3) / 4). A Route ReplyThe Option Type in the optionMAY appear one or more times within a DSR header.MUST be set to the value 2. Johnson, et al Expires2 September 200121 May 2002 [Page26]48] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 20015.4. Route Error Option- The Opt Data Len field in the option MUST be set to the value 6. The total size of the RouteError DSRRequest option when initiated isencoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 789 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len | Error Type |Reservd|Salvage| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ . . . Type-Specific Information . . . +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type 4octets; the Opt Data Len8-bit unsigned integer. Length offield excludes theoption, in octets, excludingsize of the Option Type and Opt Data Lenfields. For the current definition of the Route Error option, thisfields themselves. - The Identification field in the option MUST be set to10, plus the size of any Type-Specific Information present in the Route Error. Further extensions to thea new value, different from that used for other RouteError option format may also be included after the Type-Specific Information portion of theRequests recently initiated by this node for this same target address. For example, each node MAY maintain a single counter value for generating a new Identification value for each RouteError option specified above.Request it initiates. - Thepresence of such extensions will be indicated byTarget Address field in theOpt Data Len field. Whenoption MUST be set to theOpt Data Len is greater thanIP address thatrequired foris thefixed portiontarget ofthethis RouteError plus the necessary Type-Specific Information as indicated by the Option Type value in the option, the remaining octets are interpreted as extensions. Currently, no such further extensions have been defined. Error TypeDiscovery. Thetype of error encountered. Currently,Source Address in thefollowing type value is defined: 1 = NODE_UNREACHABLE Other valuesIP header of this packet MUST be theError Type field are reserved for future use. Johnson, et al Expires 2 September 2001 [Page 27] INTERNET-DRAFTnode's own IP address. TheDynamic Source Routing Protocol 2 March 2001 Reservd Reserved. Sent as 0; ignored on reception. Salvage A 4-bit unsigned integer. Copied from the Salvage fieldDestination Address in theSource Route optionIP header ofthethis packettriggering the Route Error, incremented byMUST be the IP "limited broadcast" address (255.255.255.255). A nodereturning theMUST maintain in its RouteError. Error Source Address The address ofRequest Table, information about Route Requests that it initiates. When initiating a new Route Request, the nodeoriginatingMUST use the information recorded in the RouteError (e.g.,Request Table entry for thenodetarget of thatattempted to forward a packetRoute Request, anddiscovered the link failure). Error Destination Address The address ofit MUST update that information in thenode to whichtable entry for use in the next RouteError must be delivered For example, when the Error Type field is set to NODE_UNREACHABLE,Request initiated for this target. In particular: - The Route Request Table entry for a target node records the Time-to-Live (TTL) fieldwill be set toused in theaddressIP header of thenode that generatedRoute Request for therouting information claiminglast Route Discovery initiated by this node for that target node. This value allows thehop from the Error Source Addressnode toUnreachable Node Address (specified in the Type-Specific Information) wasimplement avalid hop. Type-Specific Information Information specific tovariety of algorithms for controlling theError Typespread ofthisits RouteError message. Currently, the Type-Specific Information field is defined only forRequest on each RouteError messages of type NODE_UNREACHABLE. InDiscovery initiated for a target. As examples, two possible algorithms for thiscase,use of theType-Specific InformationTTL fieldis defined as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unreachable Node Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Unreachable Node Addressare described in Section 3.3.4. - TheaddressRoute Request Table entry for a target node records the number of consecutive Route Requests initiated for this target since receiving a valid Route Reply giving a route to that target node, and the remaining amount of time before which this node MAY next attempt at a Route Discovery for thatwas foundtarget node. A node MUST use these values tobe unreachable (the next hop neighborimplement a back-off algorithm to limit the rate at which this node initiates new Route Discoveries for the same target address. In particular, until a valid Route Reply is received for this target node address, the timeout between consecutive Route Discovery initiations for this target node withaddress Error Source Address was attempting to transmitthepacket). A Route Error option MAY appear one or more times within a DSR header.same hop limit SHOULD increase by doubling the timeout value on each new initiation. Johnson, et al Expires2 September 200121 May 2002 [Page28]49] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 20015.5. Acknowledgment Request OptionTheAcknowledgmentbehavior of a node processing a packet containing DSR header with both a DSR Source Route option and a Route Request option is unspecified. Packets SHOULD NOT contain both a DSR Source Route option and a Route Request option. Packets containing a Route Request option SHOULD NOT include an Acknowledgement Request option, SHOULD NOT expect link-layer acknowledgement or passive acknowledgment, and SHOULD NOT be retransmitted. The retransmission of packets containing a Route Request option isencoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |controlled solely by the logic described in this section. 6.2.2. Processing a Received Route Request OptionType | Opt Data Len | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACKWhen a node receives a packet containing a Route Request option, that node MUST process the option according to the following sequence of steps: - If the Target Address field in the Route Request matches this node's own IP address, then the node SHOULD return a Route Reply to the initiator of this Route Request (the Source Address| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type 5 Opt Data Len 8-bit unsigned integer. Lengthin the IP header of theoption,packet), as described inoctets, excludingSection 6.2.4. The source route for this Reply is theOption Typesequence of hop addresses initiator, Address[1], Address[2], ..., Address[n], target where initiator is the address of the initiator of this Route Request, each Address[i] is an address from the Route Request, andOpttarget is the target of the Route Request (the Target Address field in the Route Request). The value n here is the number of addresses recorded in the Route Request, or (Opt Data Lenfields. Identification- 6) / 4. TheIdentificationnode then MUST replace the Destination Address fieldis set to a unique nonzeroin the Route Request packet's IP header with the valueand is copied intoin theIdentificationTarget Address field in the Route Request option, and continue processing the rest of theAcknowledgementRoute Request packet normally. The node MUST NOT process the Route Request optionwhen returned byfurther and MUST NOT retransmit the Route Request to propagate it to other nodes as part of the Route Discovery. - Else, the nodereceivingMUST examine thepacket over this hop. ACKroute recorded in the Route Request option (the IP Source AddressThefield and the sequence of Address[i] fields) to determine if this node's own IP address already appears in this list of addresses. If so, the noderequestingMUST discard theacknowledgment. An Acknowledgemententire packet carrying the Route Requestoptionoption. - Else, the node MUSTNOT appear more than once within a DSR header.search its Route Request Table for an entry for the initiator of this Route Request (the IP Source Address Johnson, et al Expires2 September 200121 May 2002 [Page29]50] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 20015.6. Acknowledgment Option The Acknowledgment DSR optionfield). If such an entry isencoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len |found in the table, the node MUST search the cache of Identification| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type 6 Opt Data Len 8-bit unsigned integer. Lengthvalues ofthe option,recently received Route Requests in that table entry, to determine if an entry is present inoctets, excludingtheOption Type and Opt Data Len fields. Identification Copied fromcache matching the Identificationfield ofvalue and target node address in this Route Request. If such an (Identification, target address) entry is found in this cache in this entry in theAcknowledgementRoute Requestoption ofTable, then the node MUST discard the entire packetbeing acknowledged. ACK Source Address The address ofcarrying the Route Request option. - Else, this nodeoriginatingSHOULD further process theacknowledgment. ACK Destination Address The addressRoute Request according to the following sequence of steps: o Add an entry for this Route Request in its cache of (Identification, target address) values of recently received Route Requests. o Conceptually create a copy of this entire packet and perform the following steps on the copy of thenodepacket. o Append this node's own IP address towhichtheacknowledgment is to be delivered. An Acknowledgement option MAY appear one or more times within a DSR header. Johnson, et al Expires 2 September 2001 [Page 30] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 5.7. Source Route Option The Source Route DSR option is encoded as follows: 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Opt Data Len |F|L|Reservd|Salvage| Segs Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type 7 Opt Data Len 8-bit unsigned integer. Lengthlist ofthe option,Address[i] values inoctets, excludingtheOption TypeRoute Request, and increase the value of the Opt Data Lenfields. Forfield in theformatRoute Request by 4 (the size of an IP address). o This node SHOULD search its own Route Cache for a route (from itself, as if it were theSourcesource of a packet) to the target of this Routeoption defined here,Request. If such a route is found in its Route Cache, then thisfield MUST be setnode SHOULD follow the procedure outlined in Section 6.2.3 to return a "cached Route Reply" to thevalue (n * 4) + 2, where n isinitiator of this Route Request, if permitted by thenumberrestrictions specified there. o If the node does not return a cached Route Reply, then this node SHOULD link-layer re-broadcast this copy ofaddresses present intheAddress[i] fields. First Hop External (F) Set to indicate thatpacket, with a short jitter delay before thefirst node indicated bybroadcast is sent. The jitter period SHOULD be chosen as a random period, uniformly distributed between 0 and BroadcastJitter. 6.2.3. Generating a Route Reply using theSourceRouteoption is actuallyCache As described in Section 3.3.2, it is possible for anetwork externalnode processing a received Route Request to avoid propagating theDSR network;Route Request further toward theexact sequencetarget ofhops leading from it outside the DSR network are not represented intheSource Route option. Nodes cachingRequest, if thishopnode has intheirits Route CacheMUST flag the cached hop with the External flag.a route from itself to this target. Suchhops MUST NOT be returned ina Route Reply generated by a node fromthis Route Cache entry, and selection of routes from the Route Cache toits own cached routea packet being sent SHOULD prefer routes that contain no hops flagged as External. Last Hop External (L) Settoindicate that the last hop indicated bytheSourcetarget of a RouteoptionRequest isactually incalled anetwork external to the DSR network;"cached Route Reply", and this mechanism can greatly reduce theexact sequenceoverall overhead ofhops leading to it outsideRoute Discovery on theDSRnetworkare not represented inby reducing theSourceflood of Routeoption. Nodes caching this hop in theirRequests. The general processing of a received RouteCache MUST flag the cachedRequest is described in Section 6.2.2; this section specifies Johnson, et alExpires 2 September 2001Expires 21 May 2002 [Page31]51] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001hop withtheExternal flag. Such hopsadditional requirements that MUSTNOTbereturned inmet before a cached Route Reply may be generatedfrom this Route Cache entry,andselection of routes fromreturned and specifies the procedure for returning such a cached RouteCacheReply. While processing a received Route Request, for a node toroutepossibly return apacket being sent SHOULD prefer routes that contain no hops flagged as External. Reserved Sent as 0; ignored on reception. Salvage A 4-bit unsigned integer. Count of number of times that this packet has been salvaged ascached Route Reply, it MUST have in its Route Cache apart of DSR routing (Section 3.4.1). Segments Left (Segs Left) Number ofroutesegments remaining, i.e., numberfrom itself to the target ofexplicitlythis Route Request. However, before generating a cached Route Reply for this Route Request, the node MUST verify that there are no duplicate addresses listedintermediate nodes still toin the route accumulated in the Route Request together with the route from this node's Route Cache. Specifically, there MUST bevisited before reachingno duplicates among thefinal destination. Address[1..n]following addresses: - Thesequence of addressesIP Source Address of thesource route. In routing and forwardingpacket containing thepacket,Route Request, - The Address[i] fields in the Route Request, and - The nodes listed in thesourceroute obtained from this node's Route Cache, excluding the address of this node itself (this node itself isprocessed as describedthe common point between the route accumulated inSections 6.1.3 and 6.1.5. When forwarding a packet along a DSR sourcethe Route Request and the routeusingobtained from the Route Cache). If any duplicates exist among these addresses, then the node MUST NOT send aSourcecached RouteoptionReply. The node SHOULD continue to process the Route Request as described in Section 6.2.2. If thepacket's DSR header,Route Request and theSource Address field inroute from thepacket's IP header is always set toRoute Cache meet theaddress ofrestriction above, then thepacket's ultimate destination. Anodereceiving a packet containing a DSR header withSHOULD construct and return aSourcecached Routeoption MUST examine the indicatedReply as follows: - The source routeto determine if itfor this reply is theintended nextsequence of hopforaddresses initiator, Address[1], Address[2], ..., Address[n], c-route where initiator is thepacket and determine how to forwardaddress of thepacket, as defined in Sections 6.1.4initiator of this Route Request, each Address[i] is an address from the Route Request, and6.1.5. Johnson, et al Expires 2 September 2001 [Page 32] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 5.8. Pad1 Option The Pad1 DSR optionc-route isencoded as follows: +-+-+-+-+-+-+-+-+ | Option Type | +-+-+-+-+-+-+-+-+ Option Type 0 A Pad1 option MAY be included intheOptions fieldsequence ofa DSR headerhop addresses inorderthe source route toalign subsequent DSR options, but such alignment is not required and MUST NOT be expected by nodes receiving packets containing a DSR header. The total length of a DSR header, indicated bythis target node, obtained from thePayload Length field innode's Route Cache. In appending this cached route to the source route for theDSR header MUST be a multiplereply, the address of4 octets. When building a DSR header in a packet, sufficient Pad1 or PadN optionsthis node itself MUST beincluded inexcluded, since it is already listed as Address[n]. - Send a Route Reply to theOptions fieldinitiator of theDSR header to makeRoute Request, using thetotal length a multiple of 4 octets. If more than one consecutive octetprocedure defined in Section 6.2.4. The initiator ofpaddingthe Route Request isbeing insertedindicated in theOptionsSource Address fieldof a DSR header,in thePadN option,packet's IP header. If the node returns a cached Route Reply as describednext, SHOULD be used, rather than multiple Pad1 options. Note thatabove, then theformat ofnode MUST NOT propagate thePad1 option is a special case; it does not have an Opt Data Len or Option Data field.Route Request further (i.e., the node MUST NOT rebroadcast the Route Request). In this case, instead, Johnson, et al Expires2 September 200121 May 2002 [Page33]52] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 20015.9. PadN Option The PadNif the packet contains no other DSRoptionoptions and contains no payload after the DSR header (e.g., the Route Request isencoded as follows: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - | Option Type | Opt Data Len | Option Data +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - Option Type 1 Opt Data Len 8-bit unsigned integer. Length ofnot piggybacked on a TCP or UDP packet), then the node SHOULD simply discard the packet. Otherwise (if the packet contains other DSR options or contains any payload after theoption, in octets, excludingDSR header), theOption Type and Opt Data Len fields. Option Data A number of zero valued octets equalnode SHOULD forward the packet along the cached route to theOpt Data Len. A PadNtarget of the Route Request. Specifically, if the node does so, it MUST use the following steps: - Copy the Target Address from the Route Request optionMAY be includedin theOptions field of aDSR headerin ordertoalign subsequent DSR options, but such alignment is not required and MUST NOT be expected by nodes receiving packets containing a DSR header. The total length of a DSR header, indicated bythePayload LengthDestination Address field in theDSR header MUST be a multiple of 4 octets. When building apacket's IP header. - Remove the Route Request option from the DSR header inathe packet,sufficient Pad1 or PadN options MUST be included inand add a DSR Source Route option to theOptions field ofpacket's DSR header. - In the DSRheaderSource Route option, set the Address[i] fields tomakerepresent thetotal length a multiplesource route found in this node's Route Cache to the original target of4 octets. Johnson, et al Expires 2 September 2001 [Page 34] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 6. Detailed Operation 6.1. General Packet Processing 6.1.1. Originating a Packet When originating any packet, athe Route Discovery (the new IP Destination Address of the packet). Specifically, the nodeusingcopies the hop addresses of the source route into sequential Address[i] fields in the DSRrouting MUST performSource Route option, for i = 1, 2, ..., n. Address[1] here is thefollowing sequenceaddress ofsteps: - Searchthis node itself (the first address in thenode's Route Cache for asource route found from this node to theaddress givenoriginal target of the Route Discovery). The value n here is the number of hop addresses in this source route, excluding the destination of the packet (which is instead already represented in theIPDestination Address field in the packet'sheader.IP header). -If no such route is foundInitialize the Segments Left field in the DSR Source RouteCache, then performoption to n as defined above. - The First Hop External (F) bit in the DSR Source RouteDiscoveryoption is copied from the External bit flagging the first hop in the source route for theDestination Address,packet, asdescribedindicated inSection 6.2.the Route Cache. -IfThe Last Hop External (L) bit in thepacket contains aDSR Source RouteRequest option, then replaceoption is copied from theIP Destination Address field withExternal bit flagging theIP "limited broadcast" address (255.255.255.255) [3]. - Else, this node must have alast hop in the source routetofor theDestination Address ofpacket, as indicated in thepacket (since otherwise aRouteRequest would have been added toCache. - The Salvage field in thepacket). IfDSR Source Route option MUST be initialized to some nonzero value; thelength ofparticular nonzero value used SHOULD be MAX_SALVAGE_COUNT. By initializing thisroute is greater than 1 hop, or if the node determinesfield torequest a DSR network-layer acknowledgement from the first hop of the route, then insertaDSR header as described in Section 6.1.2, and insertnonzero value, nodes forwarding or overhearing this packet will not consider a link to exist between the IP SourceRoute option, as described in Section 6.1.3. The source route inAddress of the packetis initialized from the route toand theDestination Address foundAddress[1] address in the DSR Source RouteCache.option (e.g., they will not attempt to add this to their Route Cache as a link). By choosing MAX_SALVAGE_COUNT as the nonzero value to Johnson, et al Expires 21 May 2002 [Page 53] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 which the node initializes this field, nodes furthermore will not attempt to salvage this packet. - Transmit the packet to theaddress givennext-hop node on the new source route in thenext hop,packet, usingRoute Maintenance to retransmitthepacket if necessary, asforwarding procedure described in Section6.3. 6.1.2. Adding a DSR Header to6.1.5. 6.2.4. Originating aPacketRoute Reply A nodeoriginatingoriginates apacket addsRoute Reply in order to reply to aDSR headerreceived and processed Route Request, according to the procedures described in Sections 6.2.2 and 6.2.3. The Route Reply is returned in a Route Reply option (Section 5.3). The Route Reply option MAY be returned to the initiator of the Route Request in a separate IP packet,if necessary,used only to carryinformation needed by the routing protocol. Athis Route Reply option, or it MAY be included in any other IP packet being sent to this address. The Route Reply option MUSTNOT contain more than one DSR header. Abe included in a DSR headeris added to ain the packetby performingreturned to the initiator. To initialize the Route Reply option, the node performs the following sequence ofsteps (these steps assume thatsteps: - The Option Type in the option MUST be set to thepacket contains no other headers thatvalue 3. - The Opt Data Len field in the option MUST belocatedset to the value (n * 4) + 3, where n is the number of addresses in thepacket beforesource route being returned (excluding theDSR header):Route Discovery initiator node's address). -Insert a DSR header afterThe Last Hop External (L) bit in theIP header but before any other header that mayoption MUST bepresent.initialized to 0. -Set the Next HeaderThe Reserved fieldofin theDSR headeroption MUST be initialized to 0. - The Route Request Identifier MUST be initialized to theProtocol numberIdentifier field of thepacket's IP header. Johnson, et al Expires 2 September 2001 [Page 35] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001Route Request that this reply is sent in response to. -SetThe sequence of hop addresses in theProtocol fieldsource route are copied into the Address[i] fields of thepacket's IP headeroption. Address[1] MUST be set to theProtocol number assigned for a DSR header (???). 6.1.3. Adding a Sourcefirst-hop address of the route after the initiator of the RouteOptionDiscovery, Address[n] MUST be set toa Packet A node originating a packet adds a Source Route optionthe last-hop address of the source route (the address of the target node), and each other Address[i] MUST be set to thepacket, if necessary,next address in sequence inorder to carrythe source route being returned. The Destination Address field in the IP header ofhops from this originating node tothefinal destinationpacket carrying the Route Reply option MUST be set to the address of thepacket. Specifically, the node addinginitiator of the Route Discovery (i.e., for a Route Reply being returned in Johnson, et al Expires 21 May 2002 [Page 54] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 response to some Routeoption constructsRequest, the IP Source Address of the Route Request). After creating and initializing the Route Reply option andmodifiesthe IP packetaccording tocontaining it, send thefollowing sequence of steps: - A SourceRouteoption, as described in Section 5.7, is createdReply. In sending the Route Reply from this node (but not from nodes forwarding the Route Reply), this node SHOULD delay the Reply by a small jitter period chosen randomly between 0 andappended toBroadcastJitter. When returning any Route Reply in theDSR headercase in which thepacket (a DSR header is added, as describedMAC protocol inSection 6.1.2, if not already present). - The number of Address[i] fields to includeuse in theDSR Source Route option (n)network isthe numbernot capable ofintermediate nodes intransmitting unicast packets over uni-directional links, the source route used for routing the Route Reply packet(i.e., excluding address of the originating node andMUST be obtained by reversing thefinal destination addresssequence ofthe packet). The Segments Left fieldhops in theDSR SourceRouteoptionRequest packet (the source route that isinitialized equalthen returned in the Route Reply). This restriction on returning a Route Reply enables the Route Reply ton. - The Destination Addresstest this sequence of hops for bi-directionality, preventing the Route Reply from being received by theIP headerinitiator of the Route Discovery unless each of the hops over which the Route Reply iscopied into Address[n]returned (and thus each of the hops in theDSR Sourcesource route being returned in the Reply) is bi-directional. If sending a Routeoption. - The first hopReply to the initiator of thesource route forRoute Request requires performing a Route Discovery, the Route Reply Option MUST be piggybacked on the packetis copied intothat contains theDestination Address field inRoute Request. This piggybacking prevents a loop wherein theIP header. - The remaining hopstarget of thesource route fornew Route Request (which was itself thepacket are copied into sequential Address[i] fields ininitiator of theSourceoriginal Routeoption, for i = 1, 2, ..., n-1. - The First Hop External (F) bitRequest) must do another Route Request in order to return its Route Reply. If sending theSourceRouteoption is copied fromReply to theExternal bit flagginginitiator of thefirst hopRoute Request does not require performing a Route Discovery, a node SHOULD send a unicast Route Reply inthe source routeresponse to every Route Request it receives for which it is the target node. 6.2.5. Processing a Received Route Reply Option Section 6.1.4 describes the general processing for a received packet,as indicatedincluding the addition of routing information from options in the packet's DSR header to the receiving node's Route Cache.- The Last Hop External (L) bit inIf the received packet contains a Route Reply, no additional special processing of theSourceRoute Reply option iscopied from the External bit flagging the last hop noderequired beyond what is described there. As described in Section 4.1 anytime a node adds new information to its Route Cache (including thesource route for the packet, as indicated ininformation added from this Route Reply option), theRoute Cache. 6.1.4. Receiving a Packet When anodereceives anySHOULD check each packetcontainingin its own Send Buffer (Section 4.2) to determine whether aDSR header, it MUST process the packet accordingroute tothe following sequence of steps: - If thethat packet's IP Destination Address now exists in thepacket's IP header matches one of this receivingnode'sown IP address(es), removeRoute Cache (including theDSRinformation just added to the Cache). If so, Johnson, et al Expires2 September 200121 May 2002 [Page36]55] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001header and all the included DSR options in the header, and pass the rest of the packet to the network layer. - Examine and process each of the options (if any) in the DSR header in the order in which they occur inthepacket, skipping over any Pad1 or PadN options. Any DSR routing information carried in apacket SHOULD then beexaminedsent using that route andreflected in the node's Route Cache, even if the options in the packet are not otherwise processed as described above. In particular,removed from thefollowing routing information SHOULD be handled in this way: - InSend Buffer. This general procedure handles all processing required for a received RouteRequest option, the accumulated route record, represented by the IPReply option. Johnson, et al Expires 21 May 2002 [Page 56] INTERNET-DRAFT The Dynamic SourceAddress ofRouting Protocol 21 November 2001 6.3. Route Maintenance Processing Route Maintenance is thepacket andmechanism by which a source node S is able to detect, while using a source route to some destination node D, if thesequence of Address[i] entries in the Route Request option SHOULD be addednetwork topology has changed such that it can no longer use its route tothe node's Route Cache. - InD because aRoute Reply option,link along the routerecord being returned, represented by the sequence of Address[i] entries in theno longer works. When RouteRequest option and by the Destination Address in the packet's IP header SHOULD be addedMaintenance indicates that a source route is broken, S can attempt tothe node's Route Cache. - In an Acknowledgement option, the single link from the ACK Source Addressuse any other route it happens tothe ACK Destination Address SHOULD be addedknow tothe node'sD, or can invoke RouteCache. - InDiscovery again to find a new route for subsequent packets to D. RouteError option,Maintenance for this route is used only when S is actually sending packets to D. Specifically, when forwarding a packet, a node MUST attempt to receive an acknowledgement for thesingle linkpacket from theError Source Address tonext-hop node. If no acknowledgement is received after MaxMaintRexmt retransmissions of theUnreachable Node Address MUST be removed frompacket (after thenode's Route Cache. - In a Source Route option,initial transmission of theindicated source route SHOULD be added topacket), thenode's Route Cache, subject tonode determines that theconditions identified in Section 3.3.1. The full sequencelink for this next-hop node ofhops intheDSR Source Route option is as follows: * The Source Address in the packet's IP headersource route is "broken". This acknowledgement from thefirst hop (the sender ofnext-hop node for Route Maintenance can be implemented using a link-layer acknowledgement (Section 6.3.1), using a "passive acknowledgement" (Section 6.3.2), or using a network-layer acknowledgement (Section 6.3.3); thepacket). * The sequenceparticular strategy for retransmission timing depends on the type ofhops Address[1], Address[2], ..., Address[n] follow immediatelyacknowledgement mechanism used. If no acknowledgment is received after MaxMaintRexmt retransmissions (if necessary), theIP Source Address in the source route, where n isnode SHOULD originate a Route Error to thenumberoriginal sender ofaddresses inthe packet, as described in Section 6.3.4. In deciding whether or(Opt Data Len - 2) / 4. * The Destination Addressnot to send a Route Error inthe packet's IP header is the final destination of theresponse to attempting to forward a packetand isfrom some sender over a broken link, a node MUST limit thelast hopnumber of consecutive packets from a single sender that thesource route. Johnson, et al Expires 2 September 2001 [Page 37] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 In additionnode attempts to forward over this same broken link for which theprocessing of received packets described above,node chooses not to return a Route Error; this requirement MAY be satisfied by returning a Route Error for each packet that the nodeSHOULD examineattempts to forward over a broken link. 6.3.1. Using Link-Layer Acknowledgments If thepacketMAC protocol in use provides feedback as todetermine ifthereceiptsuccessful delivery ofthisa data packetindicates an opportunity for automatic route shortening,(such asdescribed in Section 3.4.2. Ifis provided by thereceived packet satisfieslink-layer acknowledgement frame defined by IEEE 802.11 [11]), then the use of the DSR Acknowledgement Request and Acknowledgement options is not necessary. If such link-layer feedback is available, it SHOULD be used instead of any other acknowledgement mechanism for Route Maintenance, and thetests described there, then thisnode SHOULDperform the following sequence of steps: - Return a gratuitousNOT use either passive acknowledgements or network-layer acknowledgements for RouteReply toMaintenance. When using link-layer acknowledgements for Route Maintenance, theIPretransmission timing and the timing at which retransmission attempts Johnson, et al Expires 21 May 2002 [Page 57] INTERNET-DRAFT The Dynamic SourceAddress ofRouting Protocol 21 November 2001 are scheduled are generally controlled by thepacket, as describedparticular link layer implementation in use inSection 3.4.2. - Discardthereceived packet, sincenetwork. For example, in IEEE 802.11, the link-layer acknowledgement is returned after the data packethas been received before its normal traversalas a part of thepacket's source route would have caused it to reach this receiving node. Another copybasic access method of of thepacket will normally arriveIEEE 802.11 Distributed Coordination Function (DCF) MAC protocol; the time atthis node as indicated inwhich thepacket's source route; discarding this initial copy ofacknowledgement is expected to arrive and thepacket,time at whichtriggeredthegratuitous Route Reply,next retransmission attempt (if necessary) willpreventoccur are controlled by theduplication of this packet that would otherwise occur. 6.1.5. ProcessingMAC protocol implementation. When aReceived Source Route Option Ifnode receives areceivedlink-layer acknowledgement for any packetcontains a DSR header with a DSR Source Route option, the Source Route option MUST be examined and processed (even though thisin its Retransmission Buffer, that nodeisSHOULD remove that packet from its Retransmission Buffer, stopping Route Maintenance retransmissions for that packet. 6.3.2. Using Passive Acknowledgments When link-layer acknowledgements are notindicated inavailable, but passive acknowledgements [16] are available, passive acknowledgements SHOULD be used for Route Maintenance when originating or forwarding a packet along any hop other than the last hop (the hop leading to the IP Destination Addressfieldnode of thepacket's IP header). If, after processing a Sourcepacket). In particular, passive acknowledgements SHOULD be used for RouteoptionMaintenance ina received packet, an intermediatesuch cases if the nodedetermines thatcan place its network interface into "promiscuous" receive mode, and network links used for data packets generally operate bi-directionally (such as when thepacket isMAC protocol requires this, as with IEEE 802.11). A node MUST NOT attempt tobe forwarded ontouse passive acknowledgements for Route Maintenance for alink whose link MTU is less thanpacket originated or forwarded over its last hop (the hop leading to thesizeIP Destination Address node of thepacket,packet), since the receiving nodeMUST discardwill not be forwarding the packet andsend an ICMP Packet Too Big messagethus no passive acknowledgement will be available tothe packet's Source Address [23]. A Source Route option inbe heard by this node. Beyond this restriction, aDSR header for IPv4 is processed according to the following sequence of steps: - If the valuenode MAY utilize a variety ofthe Segments Left fieldstrategies inthe Source Route option equals 0, then remove the Sourceusing passive acknowledgements for Routeoption from the DSR header. - Else, let n equal (Opt Data Len - 2) / 4. This is the numberMaintenance ofaddresses ina packet that it originates or forwards. For example, theSource Route option.following two strategies are possible: -If the value of the Segments Left field is greater than n, then send an ICMP Parameter Problem, Code 0, message [23]Each time a node receives a packet to be forwarded to a node other than the final destination (the IPSource Address, pointing toDestination Address of theSegments Left field, and discardpacket), that node sends thepacket. Do not processoriginal transmission of that packet without requesting a network-layer acknowledgement for it. If no passive acknowledgement is received within PassiveAckTimeout after this transmission, theSource Route option further. - Else, decrementnode retransmits thevalue ofpacket, again without requesting a network-layer acknowledgement for it; theSegments Left field by 1. Let i equal n minus Segments Left. Thissame PassiveAckTimeout timeout value isthe indexused for each such attempt. If no acknowledgement has been received after a total of TryPassiveAcks retransmissions of thenext address to be visitedpacket, network-layer acknowledgements (as described inthe Address vector.Johnson, et al Expires2 September 200121 May 2002 [Page38]58] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 Section 6.3.3) are used for all remaining attempts for that packet. -If Address[i]Each node keeps a table of possible next-hop destination nodes, noting whether or not passive acknowledgements can typically be expected from transmission to that node, and theIP Destination Address isexpected latency and jitter of amulticast address, then discardpassive acknowledgement from that node. Each time a node receives a packet to be forwarded to a node other than thepacket. Do not processIP Destination Address, theSource Route option further. - Forwardnode checks its table of next-hop destination nodes to determine whether to use a passive acknowledgement or a network-layer acknowledgement for that transmission to that node. The timeout for this packet can also be derived from this table. A node using this method SHOULD prefer using passive acknowledgements to network-layer acknowledgements. In using passive acknowledgements for a packet that it originates or forwards, a node considers the later receipt of a new packet (e.g., with promiscuous receive mode enabled on its network interface) tothe IP address specified in the Address[i] fieldbe an acknowledgement of this first packet if both of theIP header,followingnormal IP forwarding procedures, including checkingtwo tests succeed: - The Source Address, Destination Address, Protocol, Identification, anddecrementing the Time-to-Live (TTL) fieldFragment Offset fields in thepacket'sIP header[24, 3]. In this forwardingof thepacket, the next hop node (identified by Address[i]) MUST be treated as a direct neighbor node; the transmission to that next nodetwo packets MUSTbe done inmatch [27], and - If either packet contains asingle IP forwarding hop, withoutDSR Source RouteDiscoveryheader, both packets MUST contain one, andwithout searchingtheRoute Cache. - In forwardingvalue in thepacket, perform Route Maintenance forSegments Left field in thenext hopDSR Source Route header of thepacket, by verifying that thenew packetwas received by that next hop, as described in Section 6.3. Multicast addressesMUSTNOT appearbe less than that in the first packet. When aSourcenode hears such a passive acknowledgement for any packet in its Retransmission Buffer, that node SHOULD remove that packet from its Retransmission Buffer, stopping RouteoptionMaintenance retransmissions for that packet. 6.3.3. Using Network-Layer Acknowledgments When a node originates orin the IP Destination Address field offorwards a packetcarrying a Sourceand has no other mechanism of acknowledgement available to determine successful delivery of the packet to the next-hop node in the source route for Route Maintenance, that node SHOULD request a network-layer acknowledgement from that next-hop node. To do so, the node inserts an Acknowledgement Request option inathe DSRheader.header in the packet. The Identification field in that Acknowledgement Request option MUST be set to a value unique over all packets transmitted by this node to the same next-hop node that are either unacknowledged or recently acknowledged. Johnson, et al Expires2 September 200121 May 2002 [Page39]59] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 20016.2. Route Discovery Processing Route Discovery is the mechanism by which a node S wishing to send a packet toWhen adestinationnodeD obtains a source route to D. Route Discovery is used only when S attempts to sendreceives a packetto D and does not already know a route to D. The node initiating a Route Discovery is known as the "initiator" of the Route Discovery, and the destinationcontaining an Acknowledgement Request option, then that nodefor whichperforms theRoute Discovery is initiated is known asfollowing tests on the"target" ofpacket: - If theRoute Discovery. Route Discovery operates entirely on demand, with aindicated next-hop nodeinitiating Route Discovery based on its own origination of new packets for some destinationaddressto which it does not currently know a route. Route Discoveryfor this packet does notdepend onmatch anyperiodic or background exchangeofrouting information or neighborthis node's own IP addresses, then this nodedetection at any layer inMUST NOT process thenetwork protocol stack at any node. The Route Discovery procedure utilizes two types of messages, a RouteAcknowledgement Request(Section 5.2) and a Route Reply (Section 5.3), to actively searchoption. The indicated next-hop node address is thead hoc network for a route tonext Address[i] field in thedesired destination. TheseDSRmessages MAY be carriedSource Route option inany type of IP packet, through use ofthe DSR headeras describedinSection 5. A Route Discovery for a destination address SHOULD NOT be initiated unlesstheinitiating node has a packetpacket, or is the IP Destination Address inits Send Buffer requiring delivery to that destination. A Route Discovery forthe packet if the packet does not contain agiven targetDSR Source Route option or the Segments Left there is zero. - If the packet contains an Acknowledgement option, then this node MUST NOTbe initiated unless permitted by the rate-limiting information contained inprocess theRouteAcknowledgement RequestTable. After each Route Discovery attempt,option. If neither of theinterval between successive Route Discoveries fortests above fails, then thistargetnode MUSTbe doubled, up to a maximum of MAX_REQUEST_PERIOD, until a valid Route Reply is received for this target. 6.2.1. Originating a Routeprocess the Acknowledgement RequestAoption by sending an Acknowledgement option to the previous-hop node; to do so, the nodeinitiatingperforms the following sequence of steps: - Create aRoute Discovery for some target createspacket andinitializes a Route Request option inset the IP Protocol field to the protocol number assigned for a DSR headerin some IP packet. This MAY be a separate(TBA???). - Set the IPpacket, used onlySource Address field in this packet tocarrythe IP address of this node, copied from the source route in the DSR Source RouteRequest option, oroption in that packet (or from thenode MAY includeIP Destination Address field of the packet, if the packet does not contain a DSR Source RouteRequest optionoption). - Set the IP Destination Address field insome existingthis packetit needs to sendto thetarget node (e.g., theIPpacket originated by thisaddress of the previous-hop node,that causedcopied from thenode to attemptsource route in the DSR Source RouteDiscovery foroption in that packet (or from thedestination addressIP Source Address field of thepacket). Thepacket, if the packet does not contain a DSR Source RouteRequest option MUST be included inoption). - Add a DSR headerin the packet. To initializeto theRoute Request option,packet, and set thenode performsDSR header's Next Header field to thefollowing sequence of steps:"No Next Header" value. -The Option Type in theAdd an Acknowledgement optionMUST be setto thevalue 2. Johnson, et al Expires 2 September 2001 [Page 40] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 - The Opt Data Len fieldDSR header in theoption MUST bepacket; setto the value 6. The total size of the Route Request option when initiated is 8 octets; the Opt Data Len field excludes the size ofthe Acknowledgement option's Option Type field to 6 and the Opt Data Lenfields themselves.field to 10. -TheCopy the Identification fieldinfrom the received Acknowledgement Request optionMUST be set to a new value, different from that used for other Route Requests recently initiated by this node. For example, each node MAY maintain a single counter value for generating a newinto the Identificationvalue for each Route Request it initiates. - The Target Addressfield in theoption MUST be set to the IP address that is the target of this Route Discovery. TheAcknowledgement option. - Set the ACK Source Address field in the Acknowledgement option to be the IPheaderSource Address of this new packetMUST(set above to be thenode's ownIPaddress.address of this node). Johnson, et al Expires 21 May 2002 [Page 60] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 - Set the ACK Destination Address field in the Acknowledgement option to be the IPheaderDestination Address of this new packetMUST(set above to be the IP"limited broadcast"address(255.255.255.255). A node MUST maintainof the previous-hop node). - Send the packet as described inits Route Request Table, information aboutSection 6.1.1. Packets containing an Acknowledgement option SHOULD NOT be retransmitted by intermediate nodes for RouteRequests that it initiates.Maintenance, and SHOULD NOT expect a link-layer acknowledgement or passive acknowledgment. Wheninitiatinganew Route Request, thenodeMUST usereceives a packet with both an Acknowledgement option and an Acknowledgement Request option, if that node is not theinformation recorded indestination of theRouteAcknowledgement option (the IP Destination Address of the packet), then the Acknowledgement RequestTable entry foroption MUST be ignored. Otherwise (that node is thetargetdestination of the Acknowledgement option), thatRoute Request, and itnode MUSTupdate that information inprocess thetable entryAcknowledgement Request option by returning an Acknowledgement option according to the following sequence of steps: - Create a packet and set the IP Protocol field to the protocol number assigned forusea DSR header (TBA???). - Set the IP Source Address field in this packet to thenextIP address of this node, copied from the source route in the DSR Source Route option in that packet (or from the IP Destination Address field of the packet, if the packet does not contain a DSR Source RouteRequest initiated for this target. In particular:option). -The Route Request Table entry for a target node recordsSet theTime-to-Live (TTL)IP Destination Address fieldusedin this packet to the IPheaderaddress of thelast Route Request initiated by thisnodefor that target node. This value allowsoriginating thenode to implementAcknowledgement option. - Add avariety of algorithms for controllingDSR header to thespread of its Route Request on each Route Discovery initiated for a target. As examples, two possible algorithms for this use ofpacket, and set theTTLDSR header's Next Header fieldare described in Section 3.3.4.to the "No Next Header" value. -The Route Request Table entry for a target node recordsAdd an Acknowledgement option to thenumber of consecutive Route Requests initiated forDSR header in thistarget since receiving a valid Route Reply giving a routepacket; set the Acknowledgement option's Option Type field tothat target node,6 and theremaining amount of time before which this node MAY next attempt at a Route Discovery for that target node. These values MUST be usedOpt Data Len field toimplement an exponential back-off algorithm10. - Copy the Identification field from the received Acknowledgement Request option into the Identification field in the Acknowledgement option. - Set the ACK Source Address field in the option tolimitbe therate at whichIP Source Address of thisnode initiatesnewRoute Discoveries forpacket (set above to be thesame target address. Until a valid Route Reply is received forIP address of thistarget node address,node). - Set the ACK Destination Address field in the option to be thetimeout between consecutive Route Discovery initiations forIP Destination Address of thistarget node SHOULD increase by doubling the timeout value on eachnewinitiation. The behaviorpacket (set above to be the IP address ofathe nodeprocessing a packet containing DSR header with both a Source Route option and a Route Request option is unspecified.originating the Acknowledgement option.) Johnson, et al Expires2 September 200121 May 2002 [Page41]61] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001Packets SHOULD NOT contain both- Send the packet directly to the destination. The IP Destination Address MUST be treated as aSource Route option anddirect neighbor node: the transmission to that node MUST be done in a single IP forwarding hop, without RouteRequest option. Packets containing aDiscovery and without searching the RouteRequest option SHOULD NOT be retransmitted, SHOULDCache. In addition, this packet MUST NOTrequestcontain a DSRacknowledgment by including anAcknowledgementRequest option, SHOULDRequest, MUST NOT be retransmitted for Route Maintenance, and MUST NOT expect a link-layer acknowledgement or passiveacknowledgment, andacknowledgment. When using network-layer acknowledgements for Route Maintenance, a node SHOULDNOT be placeduse an adaptive algorithm in determining theRetransmission Buffer. The repeatedretransmission timeout for each transmission attempt ofpackets containingaRoute Request option is controlled solely by the logic describedpacket. For example, a node SHOULD maintain a separate round-trip time (RTT) estimate for each to which it has recently attempted to transmit packets, and it SHOULD use this RTT estimate in setting the timeout for each retransmission attempt for Route Maintenance. The TCP RTT estimation algorithm has been shown to work well for thissection. 6.2.2. Processingpurpose in implementation and testbed experiments with DSR [20, 22]. 6.3.4. Originating aReceivedRouteRequest OptionError When a nodereceivesis unable to verify successful delivery of a packetcontaining a Route Request option, the node MUST process the option accordingto thefollowing sequencenext-hop node after reaching a maximum number ofsteps: - If the Target Address field in the Route Request matches this node's own IP address, then theretransmission attempts, a node SHOULDreturnsend a RouteReplyError to theinitiator of this Route Request (theIP Source Addressin the IP headerof thepacket), as described in Section 6.2.4. The source routepacket. When sending a Route Error forthis reply is the sequence of hops initiator, Address[1], Address[2], ..., Address[n], target where initiator is the address of the initiator of thisa packet containing either a RouteRequest, each Address[i] isError option or anaddress from the Route Request, and target is the target of the Route Request (the Target Address field in the Route Request). The node MUST then continue processing the rest of the packet normally. TheAcknowledgement option, a nodein this case MUST NOT retransmit the Route Request to propagate itSHOULD add these existing options toother nodes. Do not process theits RouteRequest option further. - Else,Error, subject to the limit described below. A node transmitting a Route Error MUSTexamine the route recorded inperform theRoute Request option (thefollowing steps: - Create an IP packet and set the Source Address fieldand the sequence of Address[i] fields) to determine ifin thisnode's ownpacket's IP header to the addressalready appears in this listofaddresses.this node. - Ifso, the node MUST discardtheentire packet carryingSalvage field in the DSR Source RouteRequest option. - Else,option in the packet triggering thenode MUST search itsRouteRequest Table for an entry forError is zero, then copy theinitiatorSource Address field ofthisthe packet triggering the RouteRequest (the IP SourceError into the Destination Addressfield). If such an entry is foundfield in thetable,new packet's IP header; otherwise, copy thenode MUST searchAddress[1] field from thecache of Identification valuesDSR Source Route option ofrecently receivedthe packet triggering the RouteRequestsError into the Destination Address field inthat table entry,the new packet's IP header - Insert a DSR header into the new packet. - Add a Route Error Option todetermine if an entry is present inthecache matchingnew packet, setting theIdentificationError Type to NODE_UNREACHABLE, the Salvage value to the Salvage value from the DSR Source Route option of the packet triggering the Route Error, andtarget nodethe Unreachable Node Address field to the addressin this Route Request. If such an (Identification, target address) entry is found in this cache inof the next-hop node from the original source Johnson, et al Expires2 September 200121 May 2002 [Page42]62] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 route. Set the Error Source Address field to thisentry innode's IP address, and theRoute Request Table, thenError Destination field to thenode MUST discardnew packet's IP Destination Address. - If theentirepacketcarryingtriggering the RouteRequest option. - Else, this node SHOULD further process theError contains any RouteRequest according toError or Acknowledgement options, thefollowing sequence of steps: * Add an entry for this Route Request innode MAY append to itscache of (Identification, target address) values of recently receivedRouteRequests. * Create a copyError each ofthis entire packet and performthese options, with the followingsteps onconstraints: o The node MUST NOT include any Route Error option from thecopy ofpacket triggering thepacket. * Append this node's own IP address tonew Route Error, for which thelisttotal salvage count (Section 5.4) ofAddress[i] valuesthat included Route Error would be greater than MAX_SALVAGE_COUNT in the new packet. o If any RouteRequest, and increaseError option from thevalue ofpacket triggering theOpt Data Len fieldnew Route Error is not included in theRoute Request by 4 (the size of an IP address). * Thispacket, the nodeSHOULD search its ownMUST NOT include any following RouteCache for a route (from itself, as if it wereError or Acknowledgement options from thesource of a packet) topacket triggering thetarget of thisnew RouteRequest. If such a route is found in itsError. o Any appended options from the packet triggering the RouteCache, then this node SHOULDError MUST follow theprocedure outlined in Section 6.2.3 to return a "cachednew RouteReply"Error in the packet. o In appending these options to theinitiator of thisnew RouteRequest, if permitted by the restrictions specified there. * IfError, thenode does not return a cached Route Reply, then this node SHOULD link-layer re-broadcast this copyorder of these options from thepacket, with a short jitter delay beforepacket triggering thebroadcast is sent. The jitter period SHOULD be chosen as a random period, uniformly distributed between 0 and BROADCAST_JITTER. 6.2.3. GeneratingRouteReplies usingError MUST be preserved. - Send theRoute Cache Aspacket as describedin Section 3.3.2, it is possible forin Section 6.1.1. 6.3.5. Processing a Received Route Error Option When a nodeprocessingreceives a packet containing areceivedRouteRequest to avoid propagatingError option, that node MUST process the RouteRequest further towardError option according to thetargetfollowing sequence ofthe Request, if thissteps: - The nodehas inMUST remove from its Route Cachea routethe link fromitself to this target. Such a Route Reply generated by athe nodefrom its own cached routeidentified by the Error Source Address field to thetarget of a Route Request is called a "cached Route Reply", and this mechanism can greatly reducenode identified by theoverall overhead ofUnreachable Node Address field (if this link is present in its RouteDiscovery on the network by reducingCache). If theflood ofnode implements its RouteRequests. The general processing ofCache as areceived Route Request islink cache, as described in Section6.2.2;4.1, only thissection specifiessingle link is removed; if theadditional requirements that MUST be met before a cachednode implements its RouteReply may be generated and returned and specifies the procedure for returning suchCache as acachedpath cache, however, all routes (paths) that use this link are removed. - If the option following the RouteReply. While processing a receivedError is an Acknowledgement or RouteRequest, for aError option sent by this node (that is, with Acknowledgement or Error Source Address equal topossibly return a cached Route Reply, it MUST have in itsthis node's address), copy the DSR options following the current RouteCacheError into aroutenew packet with IP Source Address equal to this node's own IP address and IP Destination Address equal to the Acknowledgement or Error Destination Address. Transmit this Johnson, et al Expires2 September 200121 May 2002 [Page43]63] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001from itselfpacket as described in Section 6.1.1, with the salvage count in the DSR Source Route option set to thetargetSalvage value ofthisthe RouteRequest. However, before generatingError. In addition, after processing the Route Error as described above, the node MAY initiate acachednew RouteReplyDiscovery for any destination node for which it then has no route in its Route Cache as a result of processing this RouteRequest,Error, if the nodeMUST verifyhas indication thatthere are no duplicate addresses listed in thea routeaccumulated into that destination is needed. For example, if the node has an open TCP connection to some destination node, then if the processing of this RouteRequest together withError removed the only route to that destination from this node's RouteCache. Specifically, thereCache, then this node MAY initiate a new Route Discovery for that destination node. Any node, however, MUSTbe no duplicates amonglimit thefollowing addresses: - The IP Source Addressrate at which it initiates new Route Discoveries for any single destination address, and any new Route Discovery initiated in this way as part of processing this Route Error MUST conform to this limit. 6.3.6. Salvaging a Packet When an intermediate node forwarding a packet detects through Route Maintenance that the next-hop link along the route for that packetcontainingis broken (Section 6.3), if theRoute Request, - The Address[i] fields innode has another route to theRoute Request, and - The nodes listedpacket's IP Destination Address in its Route Cache, the node SHOULD "salvage" the packet rather than discarding it. To do so using the routeobtained from this node'sfound in its Route Cache,excluding the address ofthis nodeitself (this node itself isprocesses thecommon point betweenpacket as follows: - If theroute accumulatedMAC protocol in use in the network is not capable of transmitting unicast packets over uni-directional links, as discussed in Section 3.3.1, then if this packet contains a RouteRequestReply option, remove andthe route obtained fromdiscard the RouteCache). If any duplicates exist among these addresses, thenReply option in thenode MUST NOT send a cached Route Reply. The node SHOULD continue to processpacket; if theRoute Request as describedDSR header inSection 6.2.2. IftheRoute Request andpacket then contains no DSR options, remove therouteDSR header from theRoute Cache meetpacket. If therestriction above,resulting packet then contains only an IP header, the node SHOULDconstructNOT salvage the packet andreturn a cachedinstead SHOULD discard the entire packet. When returning any Route Replyas follows: - The source route for this reply is the sequence of hops initiator, Address[1], Address[2], ..., Address[n], c-route where initiator isin theaddress ofcase in which theinitiator of this Route Request, each Address[i] is an address fromMAC protocol in use in theRoute Request, and c-routenetwork isthe sequencenot capable ofhops in the source route to this target node, obtained from the node's Route Cache. In appending this cached route totransmitting unicast packets over uni-directional links, the source route used for routing thereply, the address of this node itself MUST be excluded, since it is already listed as Address[n]. - Send aRoute Replyto the initiator of the Route Request, usingpacket MUST be obtained by reversing theprocedure defined in Section 6.2.4. The initiatorsequence of hops in the Route Request packet (the source route that isindicated in the Source Address fieldthen returned in thepacket's IP header. 6.2.4. Originating aRouteReply A node originatesReply). This restriction on returning a Route Replyin order to reply to a received and processed Route Request, according to the procedures described in Sections 6.2.2and6.2.3. The Route Reply is returned inon salvaging a packet that contains a Route Reply option(Section 5.3). Theenables the Route Replyoption MAY be returnedto test this sequence of hops for bi-directionality, preventing the Route Reply from being received by the initiator of the RouteRequestDiscovery unless each of the hops over which the Route Reply is returned (and thus each of the hops ina separate IP packet, usedthe source route being returned in the Reply) is bi-directional. Johnson, et al Expires2 September 200121 May 2002 [Page44]64] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001only to carry this- Modify the existing DSR Source RouteReply option, or it MAY be includedoption inany other IPthe packetbeing sent toso that the Address[i] fields represent the source route found in thisaddress. Thenode's RouteReply option MUST be includedCache to this packet's IP Destination Address. Specifically, the node copies the hop addresses of the source route into sequential Address[i] fields inathe DSRheaderSource Route option, for i = 1, 2, ..., n. Address[1] here is the address of the salvaging node itself (the first address in thepacket returnedsource route found from this node to theinitiator. To initializeIP Destination Address of the packet). The value n here is the number of hop addresses in this source route, excluding theRoute Reply option,destination of thenode performspacket (which is instead already represented in thefollowing sequence of steps:Destination Address field in the packet's IP header). -The Option TypeInitialize the Segments Left field in the DSR Source Route optionMUST be settothe value 3.n as defined above. - TheOpt Data Len fieldFirst Hop External (F) bit in the DSR Source Route optionMUST be set to the value (n * 4) + 3, where nis copied from thenumber of addressesExternal bit flagging the first hop in the source routebeing returned (excludingfor the packet, as indicated in the RouteDiscovery initiator node's address).Cache. - The Last Hop External (L) bit in theoption MUST be initialized to 0. - The Reserved field in the option MUST be initialized to 0. - TheDSR Source RouteRequest Identifier MUST be initialized tooption is copied from theIdentifier field ofExternal bit flagging theRoute Request that this reply is sentlast hop inresponse to. - The sequence of addresses ofthe source routeare copied intofor theAddress[i] fields ofpacket, as indicated in theoption. Address[1] MUST beRoute Cache. - The Salvage field in the DSR Source Route option is set to 1 plus thefirst hopvalue of theroute after the initiator ofSalvage field in the DSR Source RouteDiscovery, Address[n] MUST be set to the last hopoption of thesource route (the address ofpacket that caused thetarget node), and each other Address[i] MUST be seterror. - Transmit the packet to thenext address in sequence innext-hop node on the new source routebeing returned. The Destination Address fieldin theIP header ofpacket, using thepacket carryingforwarding procedure described in Section 6.1.5. As described in Section 6.3.4, the node in this case also SHOULD return a RouteReply option MUST be setError to theaddressoriginal sender of theinitiator ofpacket. If theRoute Discovery (i.e., for a Route Reply being returned in responsenode chooses tosome Route Request,salvage theIP Source Address ofpacket, it SHOULD do so after originating the RouteRequest). After creatingError. Johnson, et al Expires 21 May 2002 [Page 65] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 7. Protocol Constants andinitializingConfiguration Variables Any DSR implementation MUST support theRoute Reply optionfollowing configuration variables and MUST support a mechanism enabling theIP packet containing it, sendvalue of these variables to be modified by system management. The specific variable names are used for demonstration purposes only, and an implementation is not required to use these names for theRoute Reply. In sendingconfiguration variables, so long as theRoute Reply from this node (but not from nodes forwardingexternal behavior of theRoute Reply),implementation is consistent with that described in thisnode SHOULD delaydocument. For each configuration variable below, therely by a small jitter perioddefault value is specified to simplify configuration. In particular, the default values given below are chosenrandomly between 0 and BROADCAST_JITTER milliseconds. Iffor a DSR network running over 2 Mbps IEEE 802.11 network network interfaces using the Distributed Coordination Function (DCF) MAClayer above which DSR is operating requires bidirectionality for unidirectional transmissions,with RTS and CTS [11, 5]. BroadcastJitter 10 milliseconds RouteCacheTimeout 300 seconds SendBufferTimeout 30 seconds RequestTableSize 64 nodes RequestTableIds 16 identifiers MaxRequestRexmt 16 retransmissions MaxRequestPeriod 10 seconds RequestPeriod 500 milliseconds NonpropRequestTimeout 30 milliseconds RexmtBufferSize 50 packets MaxMaintRexmt 2 retransmissions TryPassiveAcks 1 attempt PassiveAckTimeout 100 milliseconds GratReplyHoldoff 1 second In addition, theRoute Replyfollowing protocol constant MUST besentsupported byreversingany implementation of the DSR protocol: MAX_SALVAGE_COUNT 15 salvages Johnson, et al Expires 21 May 2002 [Page 66] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 8. IANA Considerations This document proposes thesequenceuse ofhops that are stored in it. If sendingaRoute Reply to the originatorDSR header, which requires an IP Protocol number. In addition, this document proposes use of theRoute Request requires performingvalue "No Next Header" (originally defined for use in IPv6) within an IPv4 packet, to indicate that no further header follows aRoute Discovery, the Route Reply Option MUSTDSR header. Johnson, et al Expires2 September 200121 May 2002 [Page45]67] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001be piggybacked on the packet9. Security Considerations This document does not specifically address security concerns. This document does assume thatcontainsall nodes participating in theRoute Request. This piggybacking prevents a loop whereinDSR protocol do so in good faith and without malicious intent to corrupt thetargetrouting ability of thenew Route Request (which was itselfnetwork. In mission-oriented environments where all theoriginator ofnodes participating in theoriginal Route Request) must do another Route RequestDSR protocol share a common goal that motivates their participation inorder to return its Route Reply. If sendingtheRoute Reply toprotocol, theoriginator ofcommunications between theRoute Request does not require performing Route Discovery, a node SHOULD send a unicast Route Reply in response to every received Route Request targetednodes can be encrypted atit. 6.2.5. Processing a Route Reply Option Upon receiving a Route Reply, a node SHOULD extractthesource route fromphysical channel or link layer to prevent attack by outsiders. Johnson, et al Expires 21 May 2002 [Page 68] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 Appendix A. Link-MaxLife Cache Description As guidance to implementors of DSR, the description below outlines the operation of a possible implementation of a RouteReply and add this routing informationCache for DSR that has been shown toits Route Cache. The source route fromoutperform other other caches studied in detailed simulations. Use of this design for the RouteReplyCache isthe sequencerecommended in implementations ofhops initiator, Address[1], Address[2], ..., Address[n] where initiatorDSR. This cache, called "Link-MaxLife" [9], isthe value of the Destination Address fielda link cache, in that each individual link (hop) in theIP header of the packet carrying theroutes returned in Route Reply(the address ofpackets (or otherwise learned from theinitiatorheader ofthe Route Discovery), and each Address[i]overhead packets) is added to anode through whichunified graph data structure of this node's current view of thesource route passes,network topology, as described inturn, on theSection 4.1. To search for a route in this cache to some destination node, thetarget ofsending node uses a graph search algorithm, such as theRoute Discovery. Address[n] iswell-known Dijkstra's shortest-path algorithm, to find theaddress ofcurrent best path through thetarget. Ifgraph to theLast Hop External (L) bitdestination node. The Link-MaxLife form of link cache issetadaptive in that each link in theRoute Reply,cache has a timeout that is determined dynamically by the caching nodeMUST flagaccording to its observed past behavior of thehop Address[n]two nodes at the ends of the link; inits Route Cache as External. Eachaddition, when selecting a route for a packetin the Send Buffer SHOULD then be checkedbeing sent tosee whethersome destination, among cached routes of equal length (number of hops) to that destination, Link-MaxLife selects theinformationroute with the longest expected lifetime (highest minimum timeout of any link in theRoute Reply and nowroute). Specifically, in Link-MaxLife, a link's timeout in the Route Cacheallows it to be sent immediately. Johnson, et al Expires 2 September 2001 [Page 46] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 6.3. Route Maintenance Processing Route Maintenanceisthe mechanismchosen according to a "Stability Table" maintained bywhichthe caching node. Each entry in a node's Stability Table records the address of another nodeS is able to detect, while usingand asource route to D, iffactor representing thenetwork topology has changed such that it can no longer use its routeperceived "stability" of this node. The stability of each other node in a node's Stability Table is initialized toD becauseInitStability. When a linkalongfrom theroute no longer works. WhenRouteMaintenance indicatesCache is used in routing asource routepacket originated or salvaged by that node, the stability metric for each of the two endpoint nodes of that link isbroken, S can attempt to use any other route it happens to knowincremented by the amount of time since that link was last used, multiplied by StabilityIncrFactor (StabilityIncrFactor >= 1); when a link is observed toD, or can invokebreak and the link is thus removed from the RouteDiscovery again to findCache (either due the receipt of anew routeRoute Error forsubsequent packetsthis link or due toD.exceeding the maximum number of retransmission attempts for Route Maintenance forthis route is used only when S is actually sending packets to D. When forwardingapacket, a node MUST attempt to receive an acknowledgement for thepacketfrombeing originated or forwarded by this node), thenext hop. If no acknowledgementstability metric for each of the two endpoint nodes of that link isreceived, themultiplied by StabilityDecrFactor (StabilityDecrFactor < 1). When a nodeSHOULD returnadds a new link to its RouteErrorCache, the node assigns a lifetime for that link in the Cache equal to theIP Source Addressstability of thepacket, as described in Section 6.3.3. A node's algorithmless "stable" of the two endpoint nodes fordeciding whether orthe link, except that a link is not allowed toreturnbe given aRoute Error MUST NOT allow any node to attempt to send an unbounded number of packets alonglifetime less than MinLifetime. When abrokenlinkwithout receivingis used in a route chosen for a packet originated or Johnson, et al Expires 21 May 2002 [Page 69] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 salvaged by this node, the link's lifetime is set to be at least UseExtends into the future; if the lifetime of that link in the RouteError. 6.3.1. Using Network-Layer AcknowledgmentsCache is already further into the future, the lifetime remains unchanged. When a noderetransmitsusing Link-MaxLife selects a route from its Route Cache for a packet being originated or salvaged by this node, it selects the shortest-length route that hasno other waythe longest expected lifetime (highest minimum timeout of any link in the route), as opposed toensure successful deliverysimply selecting an arbitrary route of shortest length. The following configuration variables are used in the description of Link-MaxLife above. The specific variable names are used for demonstration purposes only, and an implementation is not required to use these names for these configuration variables. For each configuration variable below, the default value is specified to simplify configuration. In particular, the default values given below are chosen for a DSR network where nodes move at relative velocities between 12 and 25 seconds per transmission radius. InitStability 25 seconds StabilityIncrFactor 4 StabilityDecrFactor 2 MinLifetime 1 second UseExtends 120 seconds Johnson, et al Expires 21 May 2002 [Page 70] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 Appendix B. Location ofa packet to the next hop, it MUST request a network-layer acknowledgement by placing inserting an Acknowledgement Request theDSRheader. The Identification value containedinthat header MUST be unique over all packets delivered tothesame next hop which are either unacknowledged or recently acknowledged. A node receiving an Acknowledgement Request MUST send an acknowledgementISO Network Reference Model When designing DSR, we had to determine at what layer within theprevious hop by performingprotocol hierarchy to implement ad hoc network routing. We considered two different options: routing at thefollowing sequence of steps: - Create a packetlink layer (ISO layer 2) andsetrouting at theIP Source Addressnetwork layer (ISO layer 3). Originally, we opted to route at theaddress of this node,link layer for several reasons: - Pragmatically, running theIP Destination Address toDSR protocol at theaddresslink layer maximizes the number of mobile nodes that can participate in ad hoc networks. For example, theprevious hop,protocol can route equally well between IPv4 [27], IPv6 [6], and IPX [32] nodes. - Historically [13, 14], DSR grew from our contemplation of a multi-hop propagating version of theIPInternet's Address Resolution Protocolfield(ARP) [25], as well as from the routing mechanism used in IEEE 802 source routing bridges [24]. These are layer 2 protocols. - Technically, we designed DSR to be simple enough that it could be implemented directly in theprotocol number reservedfirmware inside wireless network interface cards [13, 14], well below the layer 3 software within a mobile node. We see great potential in this for DSRheaders. - Setrunning inside a cloud of mobile nodes around a fixed base station, where DSR would act to transparently extend theDSR header's Next Header fieldcoverage range to these nodes. Mobile nodes that would otherwise bethe "No Next Header" value. - Set the Acknowledgement option's Option Type fieldunable to6, andcommunicate with theOpt Data Len fieldbase station due to10. - Copy the Identification field from the Acknowledgement Request option into the Identification field in the Acknowledgement option. Set the ACK Source Address field infactors such as distance, fading, or local interference sources could then reach theoptionbase station through their peers. Ultimately, however, we decided tobe the IP Source Addressspecify andthe ACK Destination Address fieldto implement [20] DSR as a layer 3 protocol, since this is theIP Destination Address.only layer at which we could realistically support nodes with multiple network interfaces of different types forming an ad hoc network. Johnson, et al Expires2 September 200121 May 2002 [Page47]71] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001- Send the packet as described in Section 6.1.1. 6.3.2. Using Link Layer Acknowledgments If explicit failure notifications are provided by the link layer, then all packets are assumed to be correctly received byAppendix C. Implementation and Evaluation Status The initial design of thenext hop,DSR protocol, including DSR's basic Route Discovery andaRouteError is sent only when an explicit failure notification is made from the link layer. Nodes receiving a packet without an Acknowledgement Request Option do not need to send an explicit Acknowledgment to the packet's originator,Maintenance mechanisms, was first published in December 1994 [13], with significant additional design details and initial simulation results published in early 1996 [14]. The DSR protocol has been extensively studied since then through additional detailed simulations. In particular, we have implemented DSR in thelink layer will notifyns-2 network simulator [23, 5] and performed extensive simulations of DSR using ns-2 (e.g., [5, 19]). We have also conducted evaluations of different caching strategies documented in this draft [9]. We have also implemented theoriginator ifDSR protocol under thepacket was not received properly. 6.3.3. Originating a Route Error When a nodeFreeBSD 2.2.7 operating system running on Intel x86 platforms. FreeBSD [8] isunable to verify successful delivery of a packet to the next hop afterbased on amaximum numbervariety ofretransmission attempts, a node SHOULD send a Route Error tofree software, including 4.4 BSD Lite from theIP Source AddressUniversity of California, Berkeley. For thepacket. In addition, a node's algorithm for deciding whether or not to return a Route Error MUST NOT allow any node to attempt to send an unbounded number of packets along a broken link without receiving a Route Error. When sending a Route Error for a packet containing either a Route Error option or an Acknowledgement option, a node SHOULD add these options to its Route Error, subject to some limit on lifetime. Specifically,environments in which wedefine the "salvage count" of an optionused it, this implementation is functionally equivalent tobethesumversion ofone plusthesalvage count recordedDSR protocol specified in this draft. During theSource Route option plus the sum of7 months from August 1998 to February 1999, we designed and implemented a full-scale physical testbed to enable thesalvage countsevaluation ofany Route Errors preceding that option. A node transmitting a Route Error MUST followad hoc network performance in thefollowing steps: - Create a packetfield, in an actively mobile ad hoc network under realistic communication workloads. The last week of February andset the IP Source Address totheaddressfirst week of March of 1999 included demonstrations of thisnode, the IP Destination Addresstestbed tothe address IP Source Addressa number of our sponsors and partners, including Lucent Technologies, Bell Atlantic, and DARPA. A complete description of thepacket experiencing the error. - Inserttestbed is available as a Technical Report [20]. We have since ported this implementation of DSRheader into the packet. - Add a Route Error Option, setting the Error Type to NODE_UNREACHABLE, the Reserved bits to 0, the Salvage valuetoone plus the Salvage value from theFreeBSD 3.3, and we have also added a preliminary version of Quality of Service (QoS) support for DSR. A demonstration of this modified version of DSRSource Route option,was presented in July 2000. These QoS features are not included in this draft, andthe Unreachable Node Address to the addresswill be added later in a separate draft on top of thenext hop. Setbase protocol specified here. DSR has also been implemented under Linux by Alex Song at theError Source Address toUniversity of Queensland, Australia [31]. This implementation supports theIP Source AddressIntel x86 PC platform and theError Destination to the IP Destination Address. - The node MAY append each Route ErrorCompaq iPAQ. Several other independent groups have also used DSR as a platform for their own research, or andAcknowledgement option, in order, from the packet experiencing the error,as a basis of comparison between ad hoc network routing protocols. Johnson, et alExpires 2 September 2001Expires 21 May 2002 [Page48]72] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001though it MUST exclude options with salvage counts greater than MAX_SALVAGE_TIMES. - Send the packet as described in Section 6.1.1. 6.3.4. Processing a Route Error Option A node receiving a Route Error MUST process it as follows: - Delete all routesChanges from Previous Version of theRoute Cache that have a link fromDraft This appendix briefly lists some of theRoute Error Source Addressmajor changes in this draft relative to theUnreachable Node Address.previous version of this same draft, draft-ietf-manet-dsr-05.txt: -If the option following theClarified how to handle RouteErrorMaintenance at the original sender of a packet, which is slightly different than at anAcknowledgement or Route Error option sent by thisintermediate node(that is, with Acknowledgement or Error Source Address equal to this node's address), copyforwarding theDSR options followingpacket. - In the definition of thecurrentRouteError into a new packet with IP Source Address equal to this node's own IP address and IP Destination Address equalCache in Section 4.1, if there are multiple cached routes to a destination, a node MUST prefer routes that do not have theAcknowledgement or Error Destination Address. TransmitExternal flag set on any link; thispacketrestriction was previously specified asdescribed in Section 6.1.1, with the salvage count ina "SHOULD". This change does not affect theSource Route option setoperation of DSR with respect to this draft, since theSalvage valueuse ofthe Route Error. 6.3.5. Salvaging a Packet When a nodeexternal links isunable to verify successful deliveryoutside the scope ofa packet tothis draft. - Clarified that thenext hop after a maximum numberRetransmission Buffer MAY be ofretransmission attemptslimited size, andhas transmittedthat when adding aRoute Errornew packet to thesender, it MAY attemptRetransmission Buffer, if the buffer size is insufficient tosalvagehold the new packet, the new packetby examining its route cache. IfSHOULD be silently discarded. - Changed thenode can find a route tocalculation of thepacket's IP Destination AddressSalvage field inits owna RouteCache, then this node replacesError option and thepacket'stotal salvage count of an option to not explicitely increment the count when the count is copied from a DSR Source Route optionwithinto a newSourceRouteoption inError option. Instead, thesame way as describedincrement is implicit inSection 6.1.3, except that Address[1] MUST be set to the address of this node and the Salvage field MUST be set to 1 plusthe value of the Salvage field and is added in when theSource Routetotal salvage count of an optionthat causedis calculated. - In Section 5.2, corrected theerror. Johnson, et al Expires 2 September 2001 [Page 49] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 7. Constants BROADCAST_JITTER 10 milliseconds MAX_ROUTE_LEN 15 nodes MAX_SALVAGE_TIMES 15 salvages Route Cache ROUTE_CACHE_TIMEOUT 300 seconds Send Buffer SEND_BUFFER_TIMEOUT 30 secondsspecification of the number of Address[i] fields present in a Route RequestTable REQUEST_TABLE_SIZE 64 nodes REQUEST_TABLE_IDS 16 identifiers MAX_REQUEST_REXMT 16 retransmissions MAX_REQUEST_PERIOD 10 seconds REQUEST_PERIOD 500 milliseconds NONPROP_REQUEST_TIMEOUT 30 milliseconds Retransmission Buffer DSR_RXMT_BUFFER_SIZE 50 packets Retransmission Timer DSR_MAXRXTSHIFT 2 Johnson, et al Expires 2 September 2001 [Page 50] INTERNET-DRAFToption. TheDynamic Source Routing Protocol 2 March 2001 8. IANA Considerations This document proposes the usenumber ofa DSR header, which requires an IP Protocol number.addresses present is indicated by the Opt Data Len field in the option as n = (Opt Data Len - 6) / 4. - Inaddition, this document proposes useSection 6.1.3, corrected the specification of thevalue "No Next Header" (originally definedsteps foruse in IPv6) within an IPv4 packet, to indicate that no further header followsadding a DSRheader. Johnson, et al Expires 2 September 2001 [Page 51] INTERNET-DRAFT The DynamicSourceRouting Protocol 2 March 2001 9. Security Considerations This document does not specifically address security concerns. This document does assume that all nodes participatingRoute option to a packet. As described elsewhere in theDSR protocol do so in good faith and without malicious intent to corruptdraft, therouting abilityentire source route (excluding the address of thenetwork. In mission-oriented environments where alloriginating node and thenodes participating infinal destination address of the packet) is copied into the DSRprotocol shareSource Route option, and the IP Destination Address of the packet is not changed when inserting the source route. - Added acommon goal that motivates their participationspecific statement in theprotocol, the communications betweenabstract and introduction that this document specifies thenodes canoperation of DSR only for IPv4. Operation of DSR with IPv6 [6] will beencrypted at the physical channel or link layer to prevent attack by outsiders.covered in other documents. Johnson, et al Expires2 September 200121 May 2002 [Page52]73] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001Appendix A. Location of DSR in the ISO Network Reference Model When designing DSR, we had to determine at what layer within the protocol hierarchy to implement ad hoc network routing. We considered two different options: routing at the link layer (ISO layer 2) and routing at the network layer (ISO layer 3). Originally, we opted to route at the link layer for several reasons:-Pragmatically, running the DSR protocol atRemoved thelink layer maximizesACK Request Source Address field from thenumber of mobile nodes that can participateAcknowledgement Request option, as this field was not used inad hoc networks. For example,standard DSR; instead, theprotocol can route equally well between IPv4 [24], IPv6 [7], and IPX [27] nodes. - Historically [12, 13], DSR grew from our contemplationaddress of the node requesting amulti-hop propagating versionDSR Acknowledgement is obtained as the previous-hop address of theInternet's Address Resolution Protocol (ARP) [22], as well as fromsource route in therouting mechanismpacket. This field is, however, used inIEEE 802 source routing bridges [21]. These are layer 2 protocols. - Technically, we designed DSRthe "flow state" enhancement to DSR [10] and will besimple enoughspecified in thatit coulddraft. - The DSR header was previously specified to always beimplemented directly in the firmware inside wireless network interface cards [12, 13], well below the layer 3 software withinamobile node. We see great potentialmultiple of 4 octet in size; thisfor DSR running inside a cloud of mobile nodes around a fixed base station, whereis now only required if any other headers follow the DSRwould act to transparently extendheader in thecoverage rangepacket. - Clarified the definition of salvaging tothese nodes. Mobile nodes that would otherwisebeunable to communicate witha "SHOULD" rather than a "MAY". - Added thebase station due to factors suchdefinition of the Gratuitous Route Reply Table asdistance, fading, or local interference sources could then reacha new conceptual data structure in Section 4.4, and added corresponding uses of it in thebase station through their peers. Ultimately, however, we decided to specifydetailed operation. This data structure andto implement [19]its use have always been a part of the DSRassimulation but had not previously been documented in the draft. - Removed the Identification field from the definition of alayer 3 protocol,Route Reply option sincethis isit was not used in theonly layer at which we could realistically support nodes with multiple network interfacesprotocol. - Removed the restriction that the value ofdifferent types formingthe Identification field in anad hoc network. Johnson, et al Expires 2 September 2001 [Page 53] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 Appendix B. Implementation and Evaluation Status The DSR protocol has been implemented underAcknowledgement Request option needed to be nonzero; theFreeBSD 2.2.7 operating system running on Intel x86 platforms. FreeBSDvalue zero at one time had a special meaning in the protocol but no longer isbased onused for this purpose. - Added avarietydescription offree software, including 4.4 BSD Lite from the Universitya specific possible implementation ofCalifornia, Berkeley. FortheenvironmentsRoute Cache data structure, called "Link-MaxLife", inwhich we used it, thisAppendix A. The actual choice of data structure implementationis functionally equivalentto use for theprotocol specifiedRoute Cache inthis draft. Duringany DSR implementation is a local matter for each node and affects only performance, not correctness or interoperability; the7 months from August 1998Link-MaxLife cache, however, has been studied extensively and been shown toFebruary 1999, we designedoutperform other types of cache implementations studied in detailed simulation [9], andimplemented a full-scale physical testbedits use in DSR implementations is recommended. - Changed most of the protocol constants toenablenow be configuration variables, which MUST support a mechanism enabling theevaluationvalue ofad hoc network performancethese variables to be modified by system management. Also, to be clear in thefield, in a actively mobile ad hoc network under realistic communication workloads. The last week of Februaryspecification which values are variables now and which are constants, changed thefirst week of March included demonstrationsnames ofthis testbedall variables toa numberbe in MixedCase instead ofour sponsors and partners, including Lucent Technologies, Bell Atlantic, and DARPA. A complete descriptionALL_CAPS. - Changed name of thetestbed is available as a Technical Report [19]. The software was portedconstant MAX_SALVAGE_TIMES toFreeBSD 3.3, and a preliminary version of QualityMAX_SALVAGE_COUNT. Johnson, et al Expires 21 May 2002 [Page 74] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 - Changed the name ofService (QoS) support was added. A demonstrationthe variable DsrMaxRxtShift to now be MaxMaintRexmt. Also changed the name ofthis modified versionthe variable DsrRxmtBufferSize to now be RexmtBufferSize. - Clarified the description ofDSR was presentedwhat to add to a node's Route Cache inJuly 2000. Those QoS features are not includedresponse to different options inthis draft,the DSR header of a received packet, andwill becoalesced this description into Section 6.1.4. - In Section 6.3.5, addedlatera suggestion that a node, after processing a Route Error, MAY initiate a new Route Discovery for any destination node for which it then has no route in its Route Cache as aseparate draft on topresult of processing this Route Error, if thebase protocol specified here. The DSR protocolnode hasbeen extensively studied using simulation; we have implemented DSRindication that a route to that destination is needed (e.g., an open TCP connection). Such Route Discoveries MUST conform to the standard rate limiting for Route Discoveries. - Clarified the retransmission timing for Route Maintenance retransmissions, in Section 6.3. - Updated thens-2 simulator [5, 18]implementation andconducted evaluations of different caching strategies documentedevaluation description inthis draft [9]. Several independent groups have also usedAppendix C to include mention of the implementation of DSRas aunder Linux by Alex Song at the University of Queensland, Australia. This implementation supports the Intel x86 PC platformfor their own research, orandas a basisthe Compaq iPAQ. - Changed the status ofcomparison between ad hoc network routing protocols.the document to indicate full conformance with all provisions of Section 10 of RFC 2026. Johnson, et al Expires2 September 200121 May 2002 [Page54]75] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 Acknowledgements The protocol described in this draft has been designed and developed within the Monarch Project, a research project at Rice Universityand(previously at Carnegie MellonUniversity whichUniversity) that is developing adaptive networking protocols and protocol interfaces to allow truly seamless wireless and mobile node networking[14, 6].[15, 30]. The authors would like to acknowledge the substantial contributions of Josh Broch in helping to design, simulate, and implement the DSR protocol. Josh is currently on leave of absence from Carnegie Mellon University at AON Networks. We thank him for his contributions to earlier versions of this draft. We would also like to acknowledge the assistance of Robert V. Barron at Carnegie Mellon University. Bob ported our DSR implementation from FreeBSD 2.2.7 into FreeBSD 3.3. Johnson, et al Expires2 September 200121 May 2002 [Page55]76] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 References [1] David F. Bantz and Frederic J. Bauchot. Wireless LANdesign alternatives.Design Alternatives. IEEE Network, 8(2):43--53, March/April 1994. [2] Vaduvur Bharghavan, Alan Demers, Scott Shenker, and Lixia Zhang. MACAW: Amedia access protocolMedia Access Protocol forwirelessWireless LAN's. In Proceedings of the ACM SIGCOMM '94 Conference, pages 212--225, August 1994. [3] Robert T. Braden, editor. Requirements for Internethosts---communication layers.Hosts---Communication Layers. RFC 1122, October 1989. [4] Scott Bradner. Key words for use in RFCs toindicate requirement levels.Indicate Requirement Levels. RFC 2119, March 1997. [5] Josh Broch, David A. Maltz, David B. Johnson, Yih-Chun Hu, and Jorjeta Jetcheva. Aperformance comparisonPerformance Comparison ofmulti-hop wireless ad hoc network routing protocols.Multi-Hop Wireless Ad Hoc Network Routing Protocols. In Proceedings of the Fourth Annual ACM/IEEE International Conference on Mobile Computing and Networking, pages 85--97, October 1998. [6]Carnegie Mellon University Monarch Project. CMU Monarch Project Home Page. Available at http://www.monarch.cs.cmu.edu/. [7]Stephen E. Deering and Robert M. Hinden. Internet ProtocolversionVersion 6 (IPv6)specification.Specification. RFC 2460, December 1998.[8][7] Ralph Droms. Dynamic Host Configuration Protocol. RFC 2131, March 1997. [8] The FreeBSD Project. Project web page available at http://www.freebsd.org/. [9] Yih-Chun Hu and David B. Johnson. CachingstrategiesStrategies inon-demand routing protocolsOn-Demand Routing Protocols forwireless ad hoc networks.Wireless Ad Hoc Networks. In Proceedings of the Sixth Annual ACM International Conference on Mobile Computing and Networking, August 2000. [10] Yih-Chun Hu, David B. Johnson, and David A. Maltz. Flow State in the Dynamic Source Routing Protocol for Mobile Ad Hoc Networks. Internet-Draft, draft-ietf-manet-dsrflow-00.txt, February 2001. Work in progress. [11] IEEE Computer Society LAN MAN Standards Committee. Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications, IEEE Std 802.11-1997. The Institute of Electrical and Electronics Engineers, New York, New York, 1997.[11][12] Per Johansson, Tony Larsson, Nicklas Hedman, Bartosz Mielczarek, and Mikael Degermark. Scenario-basedperformance analysisPerformance Analysis ofrouting protocolsRouting Protocols formobile ad-hoc networks.Mobile Ad-hoc Networks. In Proceedings Johnson, et al Expires 21 May 2002 [Page 77] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 of the Fifth Annual ACM/IEEE International Conference on Mobile Computing and Networking, pages 195--206, August 1999.[12][13] David B. Johnson. Routing inad hoc networksAd Hoc Networks ofmobile hosts.Mobile Hosts. In Proceedings ofthe IEEE Workshop on Mobile Computing Systems and Applications, pages 158--163, December 1994. Johnson, et al Expires 2 September 2001 [Page 56] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 [13]the IEEE Workshop on Mobile Computing Systems and Applications, pages 158--163, December 1994. [14] David B. Johnson and David A. Maltz. Dynamic Source Routing inad hoc wireless networks.Ad Hoc Wireless Networks. In Mobile Computing, edited by Tomasz Imielinski and Hank Korth, chapter 5, pages 153--181. Kluwer Academic Publishers, 1996.[14][15] David B. Johnson and David A. Maltz. Protocols foradaptive wirelessAdaptive Wireless andmobile networking.Mobile Networking. IEEE Personal Communications, 3(1):34--42, February 1996.[15][16] John Jubin and Janet D. Tornow. The DARPA Packet Radio Network Protocols. Proceedings of the IEEE, 75(1):21--32, January 1987.[16][17] Phil Karn. MACA---Anew channel access methodNew Channel Access Method forpacket radio.Packet Radio. In ARRL/CRRL Amateur Radio 9th Computer Networking Conference, pages 134--140, September 1990.[17][18] Gregory S. Lauer.Packet-radio routing.Packet-Radio Routing. In Routing in Communications Networks, edited by Martha E. Steenstrup, chapter 11, pages 351--396. Prentice-Hall, Englewood Cliffs, New Jersey, 1995.[18][19] David A. Maltz, Josh Broch, Jorjeta Jetcheva, and David B. Johnson. TheeffectsEffects ofon-demand behaviorOn-Demand Behavior inrouting protocolsRouting Protocols formulti-hop wireless ad hoc networks.Multi-Hop Wireless Ad Hoc Networks. IEEE Journal on Selected Areas of Communications, 17(8):1439--1453, August 1999.[19][20] David A. Maltz, Josh Broch, and David B. Johnson. ExperiencesdesigningDesigning andbuildingBuilding amulti-hop wireless ad hoc network testbed.Multi-Hop Wireless Ad Hoc Network Testbed. Technical Report CMU-CS-99-116, School of Computer Science, Carnegie Mellon University, Pittsburgh, Pennsylvania, March 1999.[20][21] David A. Maltz, Josh Broch, and David B. Johnson. Quantitative LessonsfromFrom afull-scale multihop wireless ad hoc network testbed.Full-Scale Multi-Hop Wireless Ad Hoc Network Testbed. In Proceedings of the IEEE Wireless Communications and Networking Conference, September 2000. [22] David A. Maltz, Josh Broch, and David B. Johnson. Lessons From a Full-Scale MultiHop Wireless Ad Hoc Network Testbed. IEEE Personal Communications, 8(1):8--15, February 2001.[21][23] The Network Simulator -- ns-2. Project web page available at http://www.isi.edu/nsnam/ns/. Johnson, et al Expires 21 May 2002 [Page 78] INTERNET-DRAFT The Dynamic Source Routing Protocol 21 November 2001 [24] Radia Perlman. Interconnections: Bridges and Routers. Addison-Wesley, Reading, Massachusetts, 1992.[22][25] David C. Plummer. An Ethernetaddress resolution protocol:Address Resolution Protocol: Orconverting network protocol addressesConverting Network Protocol Addresses to 48.bit EthernetaddressesAddresses fortransmissionTransmission on Ethernethardware.Hardware. RFC 826, November 1982.[23][26] J. B. Postel, editor. Internet Control Message Protocol. RFC 792, September 1981.[24][27] J. B. Postel, editor. Internet Protocol. RFC 791, September 1981.Johnson, et al Expires 2 September 2001 [Page 57] INTERNET-DRAFT The Dynamic Source Routing Protocol 2 March 2001 [25][28] J. B. Postel, editor. Transmission Control Protocol. RFC 793, September 1981.[26][29] Joyce K. Reynolds and Jon Postel. Assignednumbers.Numbers. RFC 1700, October 1994. See also http://www.iana.org/numbers.html.[27][30] Rice University Monarch Project. Monarch Project Home Page. Available at http://www.monarch.cs.rice.edu/. [31] Alex Song. picoNet II: A Wireless Ad Hoc Network for Mobile Handheld Devices. Submitted for the degree of Bachelor of Engineering (Honours) in the division of Electrical Engineering, Department of Information Technology and Electrical Engineering, University of Queensland, Australia, October 2001. Available at http://student.uq.edu.au/~s369677/main.html. [32] Paul Turner. NetWarecommunications processes.Communications Processes. NetWare Application Notes, Novell Research, pages 25--91, September 1990. [33] Gary R. Wright and W. Richard Stevens. TCP/IP Illustrated, Volume 2: The Implementation. Addison-Wesley, Reading, Massachusetts, 1995. Johnson, et al Expires2 September 200121 May 2002 [Page58]79] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 Chair's Address The MANET Working Group can be contacted via its current chairs: M. Scott Corson Phone: +1301 405-6630 Institute for Systems Research908 947-7033 Flarion Technologies, Inc. Email:corson@isr.umd.edu University of Maryland College Park, MD 20742corson@flarion.com Bedminster One 135 Route 202/206 South Bedminster, NJ 07921 USA Joseph Macker Phone: +1 202 767-2001 Information Technology Division Email: macker@itd.nrl.navy.mil Naval Research Laboratory Washington, DC 20375 USA Johnson, et al Expires2 September 200121 May 2002 [Page59]80] INTERNET-DRAFT The Dynamic Source Routing Protocol2 March21 November 2001 Authors' Addresses Questions about this document can also be directed to the authors: David B. Johnson Phone: +1 713 348-3063 Rice University Fax: +1 713 348-5930 Computer Science Department, MS 132 Email: dbj@cs.rice.edu 6100 Main Street Houston, TX 77005-1892 USA David A. Maltz Phone: +1 650 688-3128 AON Networks Fax: +1 650 688-3119 3045 Park Blvd. Email: dmaltz@cs.cmu.edu Palo Alto, CA 94306 USA Yih-Chun Hu Phone: +1 412 268-3075 Rice University Fax: +1 412 268-5576 Computer Science Department, MS 132 Email: yihchun@cs.cmu.edu 6100 Main Street Houston, TX 77005-1892 USA Jorjeta G. Jetcheva Phone: +1 412 268-3053 Carnegie Mellon University Fax: +1 412 268-5576 Computer Science Department Email: jorjeta@cs.cmu.edu 5000 Forbes Avenue Pittsburgh, PA 15213-3891 USA Johnson, et al Expires2 September 200121 May 2002 [Page60]81] ----