IETF MANET Working GroupJosh Broch INTERNET-DRAFTDavid B.JohnsonJohnson, Rice University INTERNET-DRAFT David A.MaltzMaltz, AON Networks 17 November 2000 Yih-Chun Hu, Carnegie Mellon University Jorjeta G. Jetcheva, Carnegie Mellon University22 October 1999The Dynamic Source Routing Protocol for Mobile Ad Hoc Networks<draft-ietf-manet-dsr-03.txt><draft-ietf-manet-dsr-04.txt> Status of This Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC 2026 except that the right to produce derivative works is not granted. 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 inprogress."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. Abstract The Dynamic Source Routing protocol (DSR) is a simple and efficient routing protocol designed specifically for use inmobilemulti-hop wireless ad hocnetworks.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 protocolallowsis composed of the two mechanisms of "Route Discovery" and "Route Maintenance", which work together to allow nodes todynamicallydiscoveraand maintain sourceroute across multiple network hopsroutes toany destinationarbitrary destinations in the ad hoc network.When usingThe use of sourcerouting, eachrouting allows packet routing to berouted carriestrivially loop-free, avoids the need for up-to-date routing information inits headerthecomplete, ordered list ofintermediate nodes through whichthe packet must pass. A key advantage of source routing is that intermediate hops do not needpackets are forwarded, and allows nodes forwarding or overhearing packets tomaintaincache the routing information inorder to route the packets they receive, since the packets themselves already contain allthem for their own future use. All aspects of thenecessary routing information. This, coupled withprotocol operate entirely on-demand, allowing thedynamic, on-demand naturerouting packet overhead ofDSR's Route Discovery, completely eliminatesDSR to scale automatically to only that needed to react to changes in theneed for periodic router advertisements and link status packets, significantly reducingroutes currently in use. This document specifies theoverheadoperation ofDSR, especially during periods whenthenetwork topology is stable and theseDSR protocol for routing unicast IP packetsserve only as keep-alives.in multi-hop wireless ad hoc networks. Contents Status of This Memo i Abstractiii 1. Introduction 1 2.Changes 1 3.Assumptions1 4. Terminology 2 4.1. General Terms . . .3 3. DSR Protocol Overview 5 3.1. Basic DSR Route Discovery . . . . . . . . . . . . . . . . 5 3.2. Basic DSR Route Maintenance . . .2 4.2. Specification Language. . . . . . . . . . . . 7 3.3. Additional Route Discovery Features . . . . .4 5. Protocol Overview 5 5.1.. . . . . . 8 3.3.1. Caching Overheard Routing Information . . . . . . 8 3.3.2. Replying to RouteDiscovery andRequests using Cached Routes . 9 3.3.3. Preventing RouteMaintenanceReply Storms . . . . . . . . . .5 5.2. Packet Forwarding10 3.3.4. Route Request Hop Limits . . . . . . . . . . . . 12 3.4. Additional Route Maintenance Features . . . . . . . . . .6 5.3. Multicast Routing12 3.4.1. Packet Salvaging . . . . . . . . . . . . . . . . 12 3.4.2. Automatic Route Shortening . . . . . .7 6.. . . . . 13 3.4.3. Increased Spreading of Route Error Messages . . . 14 4. Conceptual Data Structures7 6.1.15 4.1. Route Cache . . . . . . . . . . . . . . . . . . . . . . .7 6.2.15 4.2. Route Request Table . . . . . . . . . . . . . . . . . . .9 6.3.17 4.3. Send Buffer . . . . . . . . . . . . . . . . . . . . . . .9 6.4.18 4.4. Retransmission Buffer . . . . . . . . . . . . . . . . . .9 7.19 5. Packet Formats11 7.1.20 5.1. Destination OptionsHeadersHeader . . . . . . . . . . . . . . .11 7.1.1.21 5.1.1. DSR Route Request Option . . . . . . . . . . . .12 7.2.22 5.2. Hop-by-Hop OptionsHeadersHeader . . . . . . . . . . . . . . .14 7.2.1.. 24 5.2.1. DSR Route Reply Option . . . . . . . . . . . . .15 7.2.2.25 5.2.2. DSR Route Error Option . . . . . . . . . . . . .17 7.2.3.27 5.2.3. DSR Acknowledgment Option . . . . . . . . . . . .18 7.3.29 5.3. DSR Routing Header . . . . . . . . . . . . . . . . . . .20 8.30 6. Detailed Operation23 8.1. Originating a Data33 6.1. General Packet Processing . . . . . . . . . . . . . . . .23 8.2.33 6.1.1. Originating a Packetwith a DSR Routing Header. . . . .23 8.3. Processing. . . . . . . . . 33 6.1.2. Adding a DSR Routing Header to a Packet . . . . . 34 6.1.3. Receiving a Packet . . . . . . . . . .24 8.4. Route Discovery .. . . . . 36 6.1.4. Processing a Routing Header in a Received Packet 38 6.2. Route Discovery Processing . . . . . . . . . . . . . . .25 8.4.1.40 6.2.1. Originating a Route Request . . . . . . . . . . .25 8.4.2.40 6.2.2. Processing a Received Route Request Option . . .. . . . . 26 8.4.3.42 6.2.3. Generating Route Replies using the Route Cache .27 8.4.4.43 6.2.4. Originating a Route Reply . . . . . . . . . . . .28 8.4.5.45 6.2.5. Processing a Route Reply Option . . . . . . . . .29 8.5.46 6.3. Route Maintenance Processing . . . . . . . . . . . . . .. . . . . . 30 8.5.1.47 6.3.1. Using Network-Layer Acknowledgments . . . . . . .30 8.5.2.47 6.3.2. Using Link Layer Acknowledgments . . . . . . . .32 8.5.3.48 6.3.3. Originating a Route Error . . . . . . . . . . . .32 8.5.4.48 6.3.4. Processing a Route Error Option . . . . . . . . .33 8.5.5.49 6.3.5. Salvaging a Packet . . . . . . . . . . . . . . .3349 7. Constants 50 8. IANA Considerations 51 9.Optimizations 35 9.1. Leveraging the Route Cache . . . . . . . . . . . . . . . 35 9.1.1. Promiscuous LearningSecurity Considerations 52 Appendix A. Location of DSR in the ISO Network Reference Model 53 Appendix B. Implementation and Evaluation Status 54 Acknowledgements 55 References 56 Chair's Address 59 Authors' Addresses 60 1. Introduction The Dynamic SourceRoutes . . . . . . 35 9.2. Preventing Route Reply Storms . . . . . . . . . . . . . . 36 9.3. Piggybacking on Route Discoveries . . . . . . . . . . . . 37 9.4. Discovering Shorter Routes . . . . . . . . . . . . . . . 37 9.5. Rate Limiting the Route Discovery Process . . . . . . . . 38 9.6. Improved Handling of Route Errors . . . . . . . . . . . . 39 9.7. Increasing Scalability . . . . . . . . . . . . . . . . . 39 10. Path-State and Flow-State Mechanisms 40 10.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 40 10.2. Path-State and Flow-State Identifiers . . . . . . . . . . 41 10.3. Path-State Creation, Use, and Maintenance . . . . . . . . 42 10.3.1. Creating Path-State for Routing . . . . . . . . . 42 10.3.2. Monitoring Characteristics of the Path . . . . . 43 10.3.3. Candidate Metrics . . . . . . . . . . . . . . . . 45 10.4. Flow-State Creation, Use, and Maintenance . . . . . . . . 46 10.4.1. Requesting Promises along Existing Paths . . . . 46 10.4.2. Requesting Promises as Part of Route Discovery . 48 10.4.3. Providing Notifications of Changing Path Metrics 49 10.5. Expiration of State from Intermediate Nodes . . . . . . . 50 10.6. Packet Formats . . . . . . . . . . . . . . . . . . . . . 51 10.6.1. Identifier Option . . . . . . . . . . . . . . . . 51 10.6.2. Path-Metrics Option . . . . . . . . . . . . . . . 52 10.6.3. Flow Request Option . . . . . . . . . . . . . . . 54 10.6.4. Encoding Path-Metrics . . . . . . . . . . . . . . 55 11. Constants 58 12. IANA Considerations 59 13. Security Considerations 60 Location of DSR Functions in the ISO Model 61 Implementation Status 62 Acknowledgments 63 References 64 Chair's Address 66 Authors' Addresses 67 1. Introduction This document describes Dynamic Source Routing (DSR) [8, 9], a protocol developed by the Monarch Project [10, 19] at Carnegie Mellon University for routing packets in a mobile ad hoc network [5]. Source routing is a routing technique in which the sender of a packet determines the complete sequence of nodes through which to forward the packet; the sender explicitly lists this route in the packet's header, identifying each forwarding "hop" by the address of the next node to which to transmit the packet on its way to the destination node. DSR offers a number of potential advantages over other routing protocols for mobile ad hoc networks. First, DSR uses no periodic routing messages of any kind (e.g., no router advertisements and no link-level neighbor status messages), thereby significantly reducing network bandwidth overhead, conserving battery power, reducing the probability of packet collision, and avoiding the propagation of potentially large routing updates throughout the ad hoc network. Our Dynamic Source Routing protocol is able to adapt quickly to changes such as node movement, yet requires no routing protocol overhead during periods in which no such changes occur. In addition, DSR has been designed to compute correct routes in the presence of asymmetric (uni-directional) links. In wireless networks, links may at times operate asymmetrically due to sources of interference, differing radio or antenna capabilities, or the intentional use of asymmetric communication technology such as satellites. Due to the existence of asymmetric links, traditional link-state or distance vector protocols may compute routes that do not work. DSR, however, will always find a correct route even in the presence of asymmetric links. 2. Changes Changes from version 02 to version 03 (10/1999) - Added description of path-state and flow-state maintenance (Section 10). These extensions remove the need for every data packet to carry a source route, thereby decreasing the byte-overhead of DSR. They also provide a framework for supporting QoS inside DSR networks. 3. Assumptions We assume 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 network should also be willing to forward packets for other nodes in the network. We refer to the minimum number of hops necessary for a packet to reach from any node located at one extreme edge of the network to another node located at the opposite extreme, as the diameter of the network. We assume that the diameter of an ad hoc network will 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. A node receiving a corrupted packet can detect the error and discard the packet. We assume that nodes can enable promiscuous receive mode on their wireless network interface hardware, causing 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, it is for example common in current LAN hardware for broadcast media including wireless, and some of our optimizations 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 also suitable for implementation directly within a programmable network interface unit to avoid this overhead on the CPU. 4. Terminology 4.1. General Terms link A communication facility or medium over which nodes can communicate at the link layer, such as an Ethernet (simple or bridged). A link is the layer immediately below IP. interface A node's attachment to a link. prefix A bit string that consists of some number of initial bits of an address. interface index An 7-bit quantity which uniquely identifies an interface among a given node's interfaces. Each node can assign interface indices to its interfaces using any scheme it wishes. The index IF_INDEX_MA is reserved for use by Mobile IP [14] mobility agents (home or foreign agents) to indicate that they believe they can reach a destination via a connected internet infrastructure. The index IF_INDEX_ROUTER is reserved for use by routers not acting as Mobile IP mobility agents to indicate that they believe they can reach the destination via a connected internet infrastructure. The distinction between the index for mobility agents and the index for routers, allows mobility agents to advertise their existence ``for free''. A node that processes a routing header listing the interface index IF_INDEX_MA, can then send a unicast Agent Solicitation to the corresponding address in the routing header to obtain complete information about the mobility services being provided. link-layer address A link-layer identifier for an interface, such as IEEE 802 addresses on Ethernet links. packet An IP header plus payload. piggybacking Including two or more conceptually different types of data in the same packet so that all data elements move through the network together. home address An IP address that is assigned for an extended period of time to a mobile node. It remains unchanged regardless of where the node is attached to the Internet [14]. If a node has more than one home address, it SHOULD select and use a single home address when participating in the ad hoc network. source route A source route from a node S to some node D is an ordered list of home addresses and interface indexes that contains all the information that would be needed to forward a packet through the ad hoc network. For each node that will transmit the packet, the source route provides the index of the interface over which the packet should be transmitted, and the address of the node which is intended to receive the packet. DSR Routing Headers as described in Section 7.3 use a more compact encoding of the source route and do not explicitly list address S in the Routing Header`, since it is carried as the IP Source Address of the packet. A source route is described as ``broken'' when the specific path it describes through the network is not actually viable. Route Discovery The method in DSR by which a node S dynamically obtains a source route to some node D that will be used by S to route packets through the network to D. Performing a Route Discovery involves sending one or more Route Request packets. Route Maintenance The process in DSR of monitoring the status of a source route while in use, so that any link-failures along the source route can be detected and the broken link removed from use. 4.2. Specification Language 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 [3]. 5. Protocol Overview 5.1. Route Discovery and Route Maintenance A source routingRouting protocolmust solve two challenges, which DSR terms Route Discovery and Route Maintenance. Route Discovery is the mechanism whereby a node S wishing to send a packet to a destination D obtains a source route to D. Route Maintenance is the mechanism whereby S(DSR) [12, 13] isable to detect, while usingasource route to D, if the network topology has changed such that it can no longersimple and efficient routing protocol designed specifically for useits route to D because a link alongin multi-hop wireless ad hoc networks of mobile nodes. Using DSR, theroute no longer works. When Route Maintenance indicates a source routenetwork isbroken, S can attemptcompletely self-organizing and self-configuring, requiring no existing network infrastructure or administration. Network nodes cooperate touse anyforward packets for each otherroute it happens to know to D, or can invoke Route Discovery againtofind a new route. To perform Route Discovery, the source node S link-layer broadcasts a Route Request packet. Here, node S is termed the initiatorallow communication over multiple "hops" between nodes not directly within wireless transmission range of one another. As nodes in theRoute Discovery, and the node to which S is attempting to discover a source route, say D, is termednetwork move about or join or leave thetargetnetwork, and as wireless transmission conditions such as sources of interference change, all routing is automatically determined and maintained by theDiscovery. Each node that hearsDSR routing protocol. Since theRoute Request packet forwards a copynumber or sequence of intermediate hops needed to reach any destination may change at any time, theRequest, if appropriate, by adding its own addressresulting network topology may be quite rich and rapidly changing. The DSR protocol allows nodes to dynamically discover a source routebeing recordedacross multiple network hops to any destination in theRequestad hoc network. Each data packetandsent thenrebroadcasting the Route Request. The forwarding of Route Requests is constructed so that copies of the Request propagate hop-by-hop outward from the node initiating the Route Discovery, until eithercarries in its header thetargetcomplete, ordered list of nodes through which theRequest is found or until another node is found that can supply a routepacket will pass, allowing packet routing to be trivially loop-free and avoiding thetarget. The basic mechanism of forwarding Route Requests forwards the Request if the node (1) is notneed for up-to-date routing information in thetarget ofintermediate nodes through which theRequest, (2)packet isnot already listed in the recordedforwarded. By including this source route inthis copy oftheRequest, and (3) has not recently seen another Route Request packet belonging to this same Route Discovery. A node can determine if it has recently seen such a Route Request, sinceheader of eachRoute Request packet contains a unique identifier for this Route Discovery, generated by the initiatordata packet, other nodes forwarding or overhearing any ofthe Discovery. Each node maintains an LRUthese packets may also easily cacheofthis 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 quickly to changes in theunique identifier from each recently received Route Request. By not propagating any copiesnetwork. The DSR protocol provides highly reactive service to help ensure successful delivery ofa Request after the first, the overheaddata packets in spite offorwarding additional copies that reach thisnodealong different pathsmovement or other changes in network conditions. The DSR protocol isavoided. In addition,composed of two mechanisms that work together to allow theTime-to-Live fielddiscovery and maintenance of source routes in theIP header ofad hoc network: - Route Discovery is the mechanism by which a node S wishing to send a packetcarrying theto a destination node D obtains a source route to D. RouteRequest MAY beDiscovery is used only when S attempts tolimitsend a packet to D and does not already know a route to D. - Route Maintenance is thescope overmechanism by whichthe Request will propagate,node S is able to detect, while using a source route to D, if thenormal behavior of Time-to-Live defined by IP [17, 2]. Additional optimizations onnetwork topology has changed such that it can no longer use its route to D because a link along thehandling and forwarding ofroute no longer works. When RouteRequests are alsoMaintenance 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. Route Maintenance for this route is used only when S is actually sending packets tofurther reduce theD. In DSR, Route Discoveryoverhead. When the target of the Request (e.g., node D) receives theand RouteRequest,Maintenance each operate entirely "on demand". In particular, unlike other protocols, DSR requires no periodic packets of any kind at any level within therecorded source routenetwork. 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 theRequest identifies the sequencenetwork. This entirely on-demand behavior and lack ofhops over which this copyperiodic activity allows the number of overhead packets caused by DSR to scale all theRequest reached D. Node D copies this recorded source route into a Route Reply packetway down to zero, when all nodes are approximately stationary with respect to each other andsends this Route Reply backall routes needed for current communication have already been discovered. As nodes begin to move more or as communication patterns change, theinitiatorrouting packet overhead of DSR automatically scales to only that needed to track theRoute Request (e.g., node S). All sourcerouteslearned by a node are keptcurrently ina Route Cache, which is used to further reduceuse. Network topology changes not affecting routes currently in use are ignored and do not cause reaction from thecost of Route Discovery. When a node wishesprotocol. In response tosendapacket, it examines its own Route Cache and performssingle Route Discoveryonly if no suitable source route is found in its Cache. Further, when some intermediate node B receives a Route Request(as well as through routing information fromS for some target node D, B not equal D, B searches its own Route Cache for a route to D. If B finds suchother packets overheard), aroute, it might not havenode may learn and cache multiple routes topropagateany destination. This allows theRoute Request, but instead return a Route Replyreaction to routing changes to be much more rapid, since a nodeS based onwith multiple routes to a destination can try another cached route if theconcatenationone it has been using should fail. This caching of multiple routes also avoids therecorded source route from Soverhead of needing toB in theperform a new RouteRequest and the cachedDiscovery each time a routefrom B to D.in use breaks. Thedetailsoperation ofreplying from aboth RouteCacheDiscovery and Route Maintenance inthis wayDSR arediscusseddesigned to allow uni-directional links and asymmetric routes to be easily supported. In particular, as noted in Section9.1. As2, in wireless networks, it is possible that anode overhears routes being used by others, either on data packetslink between two nodes may not work equally well in both directions, due to differing antenna oron control packets used by Route Discoverypropagation patterns orRoute Maintenance,sources of interference. DSR allows such uni-directional links to be used when necessary, improving overall performance and network connectivity in thenode MAY insert those routes into its Route Cache, leveragingsystem. This document specifies theRoute Discovery operationsoperation of the DSR protocol for routing unicast IP packets in multi-hop wireless ad hoc networks. Advanced, optional features, such as Quality of Service (QoS) support and efficient multicast routing, are covered in othernodesdocuments. The specification of DSR inthe network. Such route information MAYthis document provides a compatible base on which such features can belearnedadded, eitherby promiscuously snooping on packetsindependently orwhen forwarding packets. 5.2. Packet Forwarding To represent a source route within a packet's header,by integration with the DSRuses a Routing Header similaroperation 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]. 2. Assumptions We assume that all nodes wishing to communicate with other nodes within theRouting Header format specified for IPv6, adaptedad hoc network are willing to participate fully in theneedsprotocols ofDSR and totheuse of DSR in IPv4 (or in IPv6network. In particular, each node participating in thefuture). The DSR Routing Header uses a unique Routing Type field valuenetwork SHOULD also be willing todistinguish it from the existing Type 0 Routing Header defined within IPv6 [6]. Toforwarda packet, a receiving node N simply processes the Routing Header as specifiedpackets for other nodes inSection 8.3 and transmitsthepacket tonetwork. The diameter of an ad hoc network is thenext hop. Ifminimum number of hops necessary for aforwarding error occurs along the linkpacket tothe next hop in the route, thisreach from any nodeN sends a Route Error backlocated at one extreme edge of the ad hoc network to another node located at theoriginator S of this packet informing Sopposite extreme. We assume that thislink is "broken". Ifdiameter 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 nodeN's Route Cache containsreceiving adifferent route to the destination of the original packet, then thecorrupted packetis salvaged usingcan detect thenew source route (Section 8.5.5). Otherwise,error and discard thepacket is dropped. Each node overhearing or forwarding a Route Error packet also removes from its Route Cachepacket. Nodes within the ad hoc network MAY move at any time without notice, and MAY even move continuously, but we assume that thelink indicatedspeed with which nodes move is moderate with respect tobe broken, thereby cleaningthestale cache data frompacket transmission latency and wireless transmission range of thenetwork. 5.3. Multicast Routing At this timeparticular underlying network hardware in use. In particular, DSRdoes not support true multicasting. However, it doescan support very rapid rates of arbitrary node mobility, but we assume that nodes do not continuously move so rapidly as to make thecontrolledflooding ofaevery 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 toall nodesoperate the network interface in "promiscuous" receive mode. This mode causes the hardware to deliver every received packet to the networkthat are withindriver software without filtering based on link-layer destination address. Although we do not require this facility, somenumberofhopsour optimizations can take advantage ofthe originator. While this mechanism does not support pruningits availability. Use of promiscuous mode does increase thebroadcast tree to conservesoftware overhead on the CPU, but we believe that wireless networkresources, it can be used to distribute informationspeeds are more the inherent limiting factor tonodesperformance in current and future systems; we also believe that portions of thenetwork. When an application on a DSR node sendsprotocol are suitable for implementation directly within apacketprogrammable network interface unit toa multicast address, DSR piggybacks the data from the packet inside a Route Request packet targeted at the multicast address. The normal Route Request distribution scheme described in Sections 5.1 and 8.4.2 will result inavoid thispacket being efficiently distributed to all nodes inoverhead on thenetwork withinCPU [13]. Use of promiscuous mode may also increase thespecified TTLpower consumption of theoriginator. The receiving nodes can then do destination address filteringnetwork interface hardware, depending on thepacket, discarding it if they do not wish to receive multicast packets destined to this multicast address. 6. Conceptual Data Structures In order to participate indesign of theDynamic Source Routing Protocol, a node needs four conceptual data structures: a Route Cache, a Route Request Table, a Send Buffer,receiver hardware, anda Retransmission Buffer. These data structures MAY be implemented in any manner consistent with the external behavior described in this document. 6.1. Route Cache All routing information needed by a node participatinginan ad hoc network usingsuch cases, DSRis stored in a Route Cache. Each node incan easily be used without thenetwork maintains its own Route Cache. The node adds informationoptimizations that depend on promiscuous receive mode, or can be programmed to only periodically switch theCache as it learnsinterface into promiscuous mode. Use ofnew linkspromiscuous receive mode is entirely optional. Wireless communication ability between any pair of nodes can at times not work equally well inthe ad hoc network,both directions, due for examplethrough packets carrying either a Route Replyto differing antenna ora Routing Header. Likewise, the node removes information from the cache as it learns existing links in the ad hoc network have broken, for example through packets carrying a Route Errorpropagation patterns orthroughsources of interference around thelink-layer retransmission mechanism reporting a failuretwo nodes [1, 17]. That is, wireless communications between each pair of nodes will inforwarding a packet to its next-hop destination. The Route Cache is indexed logically by destination node address, and supports the following operations: void Insert(Route RT) Inserts information extracted from source route RT intomany cases be able to operate bi-directionally, but at times theRoute Cache. Route Get(Node DEST) Returns a source route from thiswireless link between two nodes may be only uni-directional, allowing one node toDEST (if onesuccessfully send packets to the other while no communication isknown). void Delete(Node FROM, Interface INDEX, Node TO) Removes frompossible in theroute cache any routes which assume that a packet transmitted by node FROMreverse direction. Although many routing protocols operate correctly only overits interface with the given INDEX will be received by node TO. Each implementation MAY choose the cache replacementbi-directional links, DSR can successfully discover andcache search strategies for its Route Cacheforward packets over paths thatare most appropriate for its particular network environment. For example, some environments may choosecontain uni-directional links. Some MAC protocols, however, such as MACA [16], MACAW [2], or IEEE 802.11 [10], limit unicast data packet transmission to bi-directional links, due toreturntheshortest routerequired bi-directional exchange of RTS and CTS packets in these protocols and due toa node (the shortest sequencethe link-level acknowledgement feature in IEEE 802.11; when used on top ofhops), while others may select an alternate metric forMAC protocols such as these, DSR can take advantage of additional optimizations, such as theGet() operation. The Route Cache SHOULD support storing more than oneeasy ability to reverse a source routefor each destination. If there are multiple cached routesto obtain adestination,route back to theRoute Get() operation SHOULD prefer routes that do not traverse a hop with an interface indexorigin ofIF_INDEX_MA or IF_INDEX_ROUTER. This will prefer routes that lead directly tothetargetoriginal route. The IP address used by a nodeover routes that attempt to reachusing thetarget viaDSR protocol MAY be assigned by anyinternet infrastructure connected tomechanism (e.g., static assignment or use of DHCP for dynamic assignment [8]), although the method of such assignment is outside thead hoc network. If ascope of this specification. 3. DSR Protocol Overview 3.1. Basic DSR Route Discovery When some node Sis usingoriginates asource routenew packet destined to somedestination D that includes intermediateother nodeN, S SHOULD shorten the route to destination D whenD, itlearnsplaces in the header of the packet ashortersource routeto node N thangiving theonesequence of hops thatis listed astheprefix ofpacket is to follow on itscurrent routeway to D.A nodeNormally, Susingwill obtain a suitable source routeto destination D through intermediate node N, MAY shorten the source routeby searching its "Route Cache" of routes previously learned, but if no route is found in its cache, itlearns of a shorter path from node N to node D. Thewill initiate the RouteCache replacement policy SHOULD allow routesDiscovery protocol tobe categorized based upon "preference", where routes withdynamically find ahigher preferences are less likelynew route tobe removed fromD. In this case, we call S thecache."initiator" and D the "target" of the Route Discovery. For example, suppose a nodecould prefer routes for which it initiatedA is attempting to discover a route to node E. The Route Discoveryover routes that it learnedinitiated 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 theresult of promiscuous snooping on other packets. In particular, aRoute Discovery, nodeSHOULD prefer routes that it is presently using over those that itA transmits a "Route Request" message as a single local broadcast packet, which isnot. 6.2.received by (approximately) all nodes currently within wireless transmission range of A, including node B in this example. Each Route RequestTable Themessage identifies the initiator and target of the RouteRequest Table isDiscovery, and also contains acollectionunique request identification (2, in this example), determined by the initiator ofrecords aboutthe Request. Each Route Requestpackets that were recently originated or forwarded byalso contains a record listing the address of each intermediate node through which thisnode. The tableparticular copy of the Route Request message has been forwarded. This route record isindexedinitialized to an empty list by thehome addressinitiator of thetarget ofRoute Discovery. In this example, the routediscovery. Arecordmaintained oninitially lists only nodeS forA. When another nodeD contains the following: - The time that S last originatedreceives a RouteDiscovery for D. - The remaining amountRequest (such as node B in this example), if it is the target oftime that S must wait beforethenext attempt at aRouteDiscovery for D. - The Time-to-live (TTL) field inDiscovery, it returns a "Route Reply" message to theIP headerinitiator oflastthe RouteRequest originated by S for D. - A FIFO cacheDiscovery, giving a copy of thelast ID_FIFO_SIZE Identification valuesaccumulated route record from the RouteRequest packets targeted at node D that were forwarded byRequest; when the initiator receives thisnode. Nodes SHOULDRoute Reply, it caches this route in its Route Cache for usean LRU policyin sending subsequent packets tomanagethis destination. Otherwise, if this node receiving theentries of in theirRoute RequestTable. ID_FIFO_SIZE MUST NOT be set to an unlimited value, since,has recently seen another Route Request message from this initiator bearing this same request identification and target address, or if it finds that its own address is already listed in theworst case, when a node crashes and rebootsroute record in thefirst ID_FIFO_SIZERoute Requestpacketsmessage, itsends may appear to be duplicatesdiscards the Request. Otherwise, this node appends its own address to theother nodesroute record in thenetwork. 6.3. Send Buffer The Send Buffer of some node is a queue of packets that cannot be transmittedRoute Request message and propagates it bythat node becausetransmitting itdoes not yet haveas asource route to each respective packet's destination. Eachlocal broadcast packetin(with theSend Buffer is stamped withsame request identification). In this example, node B broadcast thetime that itRoute Request, which isplaced into the Buffer,received by node C; nodes C andSHOULD be removed fromD each also broadcast theSend Buffer and discarded SEND_BUFFER_TIMEOUT seconds after initially being placedRequest in turn, resulting inthe Buffer. If necessary,aFIFO strategy SHOULD be used to evict packets before they timeout to preventcopy of thebuffer from overflowing. SubjectRequest being received by node E. In returning the Route Reply to therate limiting defined in Section 8.4, ainitiator of the RouteDiscovery SHOULD be initiated as oftenDiscovery, such aspossiblenode E replying back to A in this example, node E will typically examine its own Route Cache for a route back to A, and if found, will use it for thedestination addresssource route for delivery ofany packets residing intheSend Buffer. 6.4. Retransmission Buffer The Retransmission Buffer of apacket 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 its own Route Request message for A. It is also possible to piggyback other small data packets, such as aqueue of packets sent byTCP SYN packet [26], on a Route Request using thisnode that are awaitingsame mechanism. Node E could also simply reverse thereceiptsequence ofan acknowledgment fromhops in thenext hoproute record that it is trying to send in the Route Reply, and use this as the source route(Section 7.3). For eachon the packetincarrying theRetransmission Buffer, a node maintains (1)Route Reply itself. For MAC protocols such as IEEE 802.11 that require acountbi-directional frame exchange as part of thenumberMAC protocol [10], this route reversal is preferred as it avoids the overhead ofretransmissionsa possible second Route Discovery, and(2)it tests thetime ofdiscovered route to ensure it is bi-directional before thelast retransmission. Packets are removed fromRoute Discovery initiator begins using thebuffer when an acknowledgment is received, or whenroute. However, this technique will prevent thenumberdiscovery ofretransmissions exceeds DSR_MAXRXTSHIFT.routes using uni-directional links. In wireless environments where thelater case, the removaluse 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 thepacket fromonly way to achieve connectivity to theRetransmission Buffer SHOULD result intarget node. When initiating a RouteError being returned toDiscovery, theinitial sourcesending node saves a copy of the original packet(Section 8.5). 7. Packet Formats Dynamic Source Routing makes usein a local buffer called the "Send Buffer". The Send Buffer contains a copy offour options carrying control informationeach packet thatcancannot bepiggybackedtransmitted by this node because it does not yet have a source route to the packet's destination. Each packet inany existing IP packet. The mechanism used for these optionsthe Send Buffer isbased onstamped with thedesign oftime that it was placed into theHop-by-HopBuffer andDestination Options mechanismsis discarded after residing inIPv6 [6]. The ability to generate and process such options must be added to an IPv4 protocol stack. Specifically,theProtocol field inSend Buffer for some timeout period; if necessary for preventing theIP header isSend Buffer from overflowing, a FIFO or other replacement strategy MAY also be used toindicate thatevict packets before they expire. While aHop-by-Hop Options or Destination Options extension header exists betweenpacket remains in theIP header andSend Buffer, theremaining portion ofnode SHOULD occasionally initiate a new Route Discovery for the packet'spayload (such as a transport layer header). The Next Header field in each extension header will then indicatedestination address. However, thetype of header that followsnode MUST limit the rate at which such new Route Discoveries for the same address are initiated, since itin a packet. 7.1. Destination Options Headers The Destination Options headerisused to carry optional informationpossible thatneed be examined only by a packet'sthe destinationnode(s). The Destination Options headernode isidentified by a Next Header (or Protocol) value of 60 innot currently reachable. In particular, due to theimmediately preceding header,limited wireless transmission range andhasthefollowing format: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Hdr Ext Len | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | . . . Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Next Header 8-bit selector. Identifiesmovement of thetypenodes in the network, the network may at times become partitioned, meaning that there is currently no sequence ofheader immediately followingnodes through which a packet could be forwarded to reach theDestination Options header. Usesdestination. Depending on thesame values asmovement pattern and theIPv4 Protocol field [20]. Hdr Ext Len 8-bit unsigned integer. Lengthdensity ofthe Destination Options headernodes in4-octet units, not includingthefirst 8 octets. Options Variable-length field, of lengthnetwork, suchthat the complete Destination Options header is an integer multiple of 4 octets long. Contains onenetwork partitions may be rare ormore TLV-encoded options. The following destination option is used by the Dynamic Source Routing protocol: - DSRmay be common. If a new RouteRequest option (Section 7.1.1) This destination option MUST NOT appear multiple times withinDiscovery was initiated for each packet sent by asingle Destination Options header. 7.1.1. DSRnode in such a situation, a large number of unproductive Route RequestOption The DSRpackets would be propagated throughout the subset of the ad hoc network reachable from this node. In order to reduce the overhead from such RouteRequest destination option is encoded in type-length-value (TLV) format 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 | Option Length | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Target Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C| IN Index[1] |C| IN Index[2] |C| IN Index[3] |C| IN Index[4] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C|OUT Index[1] |C|OUT Index[2] |C|OUT Index[3] |C|OUT Index[4] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[3] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[4] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C| IN Index[5] |C| IN Index[6] |C| IN Index[7] |C| IN Index[8]| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C|OUT Index[5] |C|OUT Index[6] |C| OUT Index[7] |C|OUT Index[8]| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[5] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IP fields: Source AddressDiscoveries, a node MUSTbeuse an exponential back-off algorithm to limit thehome address ofrate at which it initiates new Route Discoveries for the same target. If the nodeoriginatingattempts to send additional data packets to thispacket. Intermediate nodes that repropagate the request do not changesame node more frequently than thisfield. Destination Address MUST belimit, thelimited broadcast address (255.255.255.255). Hop Limit (TTL) Cansubsequent packets SHOULD bevaried from 1buffered in the Send Buffer until a Route Reply is received giving a route to255,this destination, but the node MUST NOT initiate a new Route Discovery until the minimum allowable interval between new Route Discoveries forexamplethis target has been reached. This limitation on the maximum rate of Route Discoveries for the same target is similar toimplement expanding-ring searches.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 RouteRequest fields: Option Type ???. AMaintenance When originating or forwarding a packet using a source route, each node transmitting the packet is responsible for confirming thatdoes not understandthe packet has been received by the next hop along the source route; the packet SHOULD be retransmitted (up to a maximum number of attempts) until thisoption MUST discardconfirmation 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 |-- | 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 theOption Datadestination E. This confirmation of receipt in many cases maychange en-route (the top three bits are 011). Option Length 8-bit unsigned integer. Lengthbe provided at no cost to DSR, either as an existing standard part of theoption,MAC protocol inoctets, excludinguse (such as theOption Type and Option Length fields. Identification A unique value generatedlink-level acknowledgement frame defined by IEEE 802.11 [10]), or bythe initiator (original sender) of the Route Request. This value allowsarecipient"passive acknowledgement" [15] (in which, for example, B confirms receipt at C by overhearing C transmit the packet todetermine whether or notforward ithas recently seen this a copyon to D). If neither ofthis Request; if it has,these confirmation mechanisms are available, the node transmitting the packetis simply discarded. When propagatingcan explicitly request aRoute Request, this field MUSTDSR-specific software acknowledgement becopied fromreturned by thereceived copy ofnext hop; this software acknowledgement will normally be transmitted directly to theRequest being forwarded. Target Address The home address ofsending node, but if thenode thatlink between these two nodes isthe target of the Route Request. Change Interface (C) bit[1..n] A flag associated with each interface index that indicates whether or not the corresponding node repropagated the Requestuni-directional, this software acknowledgement may travel over adifferent physical interface type than over which itdifferent, multi-hop path. If no receipt confirmation is received after theRequest. IN Index[1..n] IN Index[i] ispacket has been retransmitted theindexmaximum number ofthe interface over which the node indicatedattempts byAddress[i] received the Route Request option. These are used to recordsome hop, this node SHOULD return areverse route from"Route Error" message to thetargetoriginal sender of therequest topacket, identifying theoriginator,link over whicha Route Reply MAY be sent. OUT Index[1..n] OUT Index[i] is the interface index thatthenode indicated by Address[i-1] used when rebroadcastingpacket could not be forwarded. For example, in theRoute Request option. Address[1..n] Address[i]example shown above, if C is unable to deliver thehome address ofpacket to theithnext hoprecorded in theD, then C returns a RouteRequest option. 7.2. Hop-by-Hop Options Headers The Hop-by-Hop Options header is usedError tocarry optional informationA, stating thatmust be examined by every node along a packet's delivery path. The Hop-by-Hop Options headerthe link from C to D isidentified by a Next Header (or Protocol) valuecurrently "broken". Node A then removes this broken link from its cache; any retransmission of??? intheIP header, andoriginal 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 Replys from its earlier Route Discovery, or from having overheard sufficient routing information from other packets), it can send thefollowing format: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Hdr Ext Len | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | . . . Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Next Header 8-bit selector. Identifies the type of header immediately following the Hop-by-Hop Options header. Uses the same values aspacket using theIPv4 Protocol field [20]. Hdr Ext Len 8-bit unsigned integer. Length ofnew route immediately. Otherwise, it SHOULD perform a new Route Discovery for this target (subject to theHop-by-Hop Options headerexponential back-off described in4-octet units, not includingSection 3.1). 3.3. Additional Route Discovery Features 3.3.1. Caching Overheard Routing Information A node forwarding or otherwise overhearing any packet MAY add thefirst 8 octets. Options Variable-length field, of length suchrouting information from that packet to its own Route Cache. In particular, thecomplete Hop-by-Hop Options header is an integer multiple of 4 octets long. Contains one or more TLV-encoded options. The following hop-by-hop options aresource route usedbyin a data packet, theDynamic Source Routing protocol: - DSR Route Reply option (Section 7.2.1) - DSRaccumulated route record in a RouteError option (Section 7.2.2) - DSR Acknowledgment option (Section 7.2.3) All of these destination options MAY appear oneRequest, ormore times withinthe route being returned in asingle Hop-by-Hop Options header. 7.2.1. DSR Route Reply Option The DSRRoute Replyhop-by-hop optionMAY all be cached by any node. Routing information from any of these packets received can be cached, whether the packet was addressed to this node, sent to a broadcast (or multicast) MAC address, or received while the node's network interface isencodedintype-length-value (TLV) format 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 | Option Length | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Target Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C|OUT Index[1] |C|OUT Index[2] |C|OUT Index[3] |C|OUT Index[4] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[3] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[4] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C|OUT Index[5] |C|OUT Index[6] |C|OUT Index[7] |C|OUT Index[8] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+promiscuous mode. One limitation, however, on caching of such overheard routing information is the possible presence of uni-directional links in the ad hoc network (Section 2). For example, in the situation shown below, node A is using a source route to communicate with node E: +-----+ +-----+ +-----+ +-----+ +-----+ |Address[5]A |---->| B |---->| C |---->| D |---->| E |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-----+ +-----+ +-----+ +-----+ +-----+ ^ | +-----+ +-----+ +-----+ +-----+ +-----+ |...V |---->| W |---->| X |---->| Y |---->| Z |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. A+-----+ +-----+ +-----+ +-----+ +-----+ As node C forwards a data packet along the route from A to E, it can always add to its cache the presence of the "forward" direction links thatdoes not understand this option should ignore this option and continue processingit learns from thepacket,headers of these packets, from itself to D and from D to E. However, theOption Data does"reverse" direction of the links identified in the packet headers, from itself back to B and from B to A, may notchange en-route (the top three bitswork for it since these links might be uni-directional. If C knows that the links are000). Option Length 8-bit unsigned integer. Length ofin fact bi-directional, for example due to theoption,MAC protocol in use, it could cache them but otherwise SHOULD not. Likewise, node V inoctets, excludingtheOption Typeexample above is using a different source route to communicate with node Z. If node C overhears node X transmitting a data packet to forward it to Y (from V), node C SHOULD consider whether the links involved can be known to be bi-directional or not before caching them. If the link from X to C (over which this data packet was received) can be known to be bi-directional, then C could cache the link from itself to X, the link from X to Y, andOption Length fields. Reserved Sent as 0; ignored on reception. Target Address The home address ofthenodelink from Y to Z. If all links can be assumed to be bi-directional, C could also cache the links from X to W and from W to V. Similar considerations apply towhichthe routing information that might be learned from forwarded or otherwise overheard Route Request or Route Replymust be delivered. Change Interface (C) bit[1..n] If the C bit associated with apackets. 3.3.2. Replying to Route Requests using Cached Routes A nodeN is set, it implies N will be forwarding the packet outreceiving adifferent interface than the one overRoute Request for which itwas received (i.e., the node sending the packet to N should not expect a passive acknowledgment). OUT Index[1..n] OUT Index[i]is not theinterface index of the ith hop listed in thetarget, searches its own RouteReply option. It denotes the interface that should be used by Address[i-1]Cache for a route toreach Address[i] when using the specified source route. Address[1..n] Address[i] isthehome addresstarget of theith hop listed inRequest. If found, the node generally returns a Route Replyoption. 7.2.2. DSR Route Error Option The DSR Route Error hop-by-hop option is encoded in type-length-value (TLV) format 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 | Option Length | Index | Error Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Error Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unreachable Node Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. A node that does not understand this option should ignore the option and continue processing the packet, andto theOption Data does not change en-route (the top three bits are 000). Option Length 8-bit unsigned integer. Length ofinitiator itself rather than forwarding theoption, in octets, excludingRoute Request. In theOption Type and Option Length fields. Index The interface index ofRoute Reply, it sets thenetwork interfaceroute record to list the sequence of hops over which this copy of thenode designated by Error Source Address triedRoute Request was forwarded toforward a packetit, concatenated with its own idea of the route from itself to the target from its Route Cache. However, before transmitting a Route Reply packet that was generated using information from its Route Cache in this way, a nodedesignatedMUST verify that the resulting route being returned in the Route Reply, after this concatenation, contains no duplicate nodes listed in the route record. For example, the figure below illustrates a case in which a Route Request for target E has been received byUnreachable Node Address. Error Type The type of error encountered. Values between 0node F, and127 inclusive indicatenode F already has in its Route Cache ahard failureroute from itself to E: +-----+ +-----+ +-----+ +-----+ | A |---->| B |- >| D |---->| E | +-----+ +-----+ \ / +-----+ +-----+ \ / \ +-----+ / >| C |- +-----+ | ^ v | Route Request +-----+ Route: A - B - C - F | F | Cache: C - D - E +-----+ The concatenation ofconnectivity betweentheError Source Addressaccumulated route from the Route Request and theUnreachable Node Address. Values between 128cached route from F's Route Cache would include a duplicate node in passing from C to F and255 inclusive indicateback to C. Node F in this case could attempt to edit the route to eliminate the duplication, resulting in asoft failure. NODE_UNREACHABLE 1 PATH_STATE_NOT_FOUND 129 Error Source Address The home address ofroute 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 nodeoriginating theF from returning such a RouteError (e.g.,Reply from its cache for two reasons. First, this limitation increases thenodeprobability thatattempted to forward a packet and discoveredthelink failure).resulting route is valid, since F in this case should have received a Route ErrorDestination Address The home address of the node to whichif the route had previously stopped working. Second, this limitation means that a Route Errormust be delivered (e.g,traversing the route is very likely to pass through any node thatgenerated the routing information claiming thatsent thehop Error Source Address to Unreachable Node Address was a valid hop). Unreachable Node Address The home address ofRoute Reply for thenode that was found to be unreachable (the next hop neighbor toroute (including F), whichthe node at ``Error Source Address'' was attemptinghelps totransmit the packet). 7.2.3. DSR Acknowledgment Option The DSR Acknowledgment hop-by-hop optionensure that stale data isencoded in type-length-value (TLV) formatremoved from caches (such asfollows: 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 | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. A node that does not understand this option should ignore the option and continue processingat F) in a timely manner. Otherwise, thepacket, andnext Route Discovery initiated by A might also be contaminated by a Route Reply from F containing theOption Datasame stale route. If the Route Request does notchange en-route (the top three bits are 000). Option Length 8-bit unsigned integer. Length of the option, in octets, excludingmeet these restrictions, theOption Type and Option Length fields. Identification A 32-bit value that when takennode (node F inconjunction with Data Source Address, uniquely identifiesthis example) discards thepacket being acknowledged.Route Request rather than replying to it or propagating it. 3.3.3. Preventing Route Reply Storms TheIdentification value is computedability for nodes to reply to a Route Request based on information in their Route Caches, as((ip_id << 16) | ip_off) where ip_id is the value ofdescribed 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 the16-bit Identification fieldnode's neighbors have a route in their Route Caches, each neighbor may attempt to send a Route Reply, thereby wasting bandwidth and possibly increasing theIP headernumber of network collisions in thepacket being acknowledged,area. For example, the figure below shows a situation in which nodes B, C, D, E, andip_off isF all receive A's Route Request for target G, and each have thevalue ofindicated 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, they would all attempt to reply from their own Route Caches, and would all send their Replys at about the same time since they all received the13-bit Fragment Offset field inbroadcast Route Request at about theIP header ofsame time. Such simultaneous replies from different nodes all receiving the Route Request may create packetbeing acknowledged. When constructing the Identification, ip_idcollisions among some or all of these Replies andip_off MUST be in host byte-order. The entire Identification value MUST then be converted to network byte-order before being placedmay cause local congestion in theAcknowledgment option. ACK Source Address The home address ofwireless network. In addition, it will often be thenode originatingcase that theAcknowledgment. ACK Destination Address The home addressdifferent replies will indicate routes ofthedifferent lengths, as shown in this example. If a nodeto which the Acknowledgment must be delivered. Data Source Address The IP Source Address of the packet being acknowledged. 7.3. DSR Routing Header As specifiedcan put its network interface into promiscuous receive mode, it SHOULD delay sending its own Route Reply forIPv6 [6], a Routing header is used byasource to list one or more intermediate nodesshort period, while listening tobe ``visited'' onsee if theway toinitiating node begins using apacket's destination. This function is similar to IPv4's Loose Source and Recordshorter route first. That is, this node SHOULD delay sending its own Routeoption, butReply for a random period d = H * (h - 1 + r), where h is theRouting header does not recordlength in number of network hops for the routetaken as the packet is forwarded. The specific processing steps requiredtoimplement the Routing header mustbeadded to an IPv4 protocol stack. The Routing headerreturned in this node's Route Reply, r is a random number between 0 and 1, and H isidentified byaNext Header value of 43 insmall constant delay (at least twice theimmediately preceding header,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 Replys giving routes of length less than h sending their Replys before this node, andhasall nodes sending Route Replys giving routes of length greater than h sending their Replys after this node. Within thefollowing format: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Next Header | Hdr Ext Len | Routing Type | Segments Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . type-specific data . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The type specificdelay 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 aRouting Header carrying a DSR Source Route is: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |R|S| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C|OUT Index[1] |C|OUT Index[2] |C|OUT Index[3] |C|OUT Index[4] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[3] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[4] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |C|OUT Index[5] |C|OUT Index[6] |C|OUT Index[7] |C|OUT Index[8] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[5] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Routing Header Fields: Next Header 8-bit selector. Identifiesdata packet received by this node during thetypedelay period uses a source route ofheader immediately followinglength less than or equal to h, this node may infer that theRouting header. Hdr Ext Len 8-bit unsigned integer. Lengthinitiator of theRouting header in 4-octet units, not includingRoute 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 thefirst 8 octets. Routing Type ??? Segments Left Number of route segments remaining, i.e.,number ofexplicitly listedintermediate nodesstillallowed tobe visited before reachingforward that copy of thefinal destination. Type Specific Fields: Acknowledgment Request (R) The Acknowledgment Request (R) bitRoute Request. This hop limit isset to request an explicit acknowledgment fromimplemented using thenext hop. After processingTime-to-Live (TTL) field in theRouting Header, TheIPDestination Address lists the addressheader of thenext hop. Salvaged Packet (S) The Salvaged Packet (S) bit indicates that thispackethas been salvaged by an intermediate node, and thus thatcarrying the Route Request. As the Request is forwarded, thisRouting Header was generated by Address[1]limit is decremented, andnottheIP Source Address (Section 8.5.5). Reserved Sent as 0; ignored on reception. Change Interface (C) bit[1..n] IfRequest packet is discarded if theC bit associated withlimit 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 MAY send its first Route Request attempt for some target node using a hop limit of 1, such that any nodeNreceiving the initial transmission of the Route Request will not forward it to other nodes by rebroadcasting it. This form of Route Request isset, it implies N will be forwarding the packet outcalled adifferent interface than"non-propagating" Route Request. It provides an inexpensive method for determining if theone over which it was received (i.e.,target is currently a neighbor of the initiator or if a neighbor nodesending the packet to N should not expecthas apassive acknowledgment and MAY wishroute tosettheR bit). OUT Index[1..n] Index[i] istarget cached (effectively using theinterface index thatneighbors' Route Caches as an extension of thenode indicated by Address[i-1] mustinitiator's own Route Cache). If no Route Reply is received after a short timeout, then a "propagating" Route Request (i.e., with no hop limit) MAY be sent. Another possible usewhen transmittingof thepackethop limit in a Route Request is toAddress[i]. Index[1] indicates which interfaceimplement an "expanding ring" search for the target [13]. For example, a nodeindicated by the IP Source Address uses to transmit the packet. Address[1..n] Address[i]could send an initial non-propagating Route Request as described above; if no Route Reply is received for it, thehome address of the ithnode could initiate another Route Request with a hopin the Routing header. Note that Address[1]limit of 2. For each Route Request initiated, if no Route Reply is received for it, the node could double thefirst intermediatehopalonglimit used on theroute. The address ofprevious attempt, to progressively explore for theoriginatingtarget nodeiswithout allowing theIP Source Address. The only exceptionRoute Request to propagate over the entire network. However, thisrule is for packets that are salvaged,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. 3.4. Additional Route Maintenance Features 3.4.1. Packet Salvaging After sending a Route Error message as part of Route Maintenance as described in Section8.5.5. A packet that has been salvaged has an alternate route placed on it by an intermediate3.2, a nodeinmay attempt to "salvage" thenetwork, and in this case,data packet that caused theaddress ofRoute Error rather than discarding it. To attempt to salvage a packet, theoriginatingnode(the salvaging node) is Address[1]. Salvaged packets are indicated by setting the S bit in the DSR Routing header. 8. Detailed Operation 8.1. Originatingsending aData Packet When node A originatesRoute Error searches its own Route Cache for apacket,route from itself to thefollowing steps MUST be taken before transmittingdestination of thepacket: 1. Ifpacket causing thedestination address isError. If such amulticast address, piggybackroute is found, the node may salvage thedatapacketon aafter returning the RouteRequest targetingError by replacing themulticast address.original source route on the packet with the route from its Route Cache. Thefollowing fields MUST be initialized as specified: IP.Source_Address = Home address ofnodeA IP.Destination_Address = 255.255.255.255 Request.Target_Address = Multicast destination address DONE. 2. Otherwise, call Route_Cache.Get()then forwards the packet todetermine if there is a cachedthe next node indicated along this sourceroute toroute. For example, in thedestination. 3. Ifsituation shown in thecachedexample of Section 3.2, if node C has another routeindicates thatcached to node E, it can salvage thedestination is directly reachable over one hop, no Routing Header should be addedpacket by applying this route to the packet rather than discarding the packet.InitializeWhen salvaging a packet in this way, a count is maintained in thefollowing fields: IP.Source_Address = Home address of node A IP.Destination_Address = Home addresspacket of theDestination DONE. 4. Otherwise, if the cached route indicatesnumber of times thatmultiple hops are requiredit has been salvaged, toreach the destination, insertprevent aRouting Header into thesingle packetas described in Section 8.2. DONE. 5.from being salvaged endlessly. Otherwise,if no cached route to the destination is found, insertit could be possible for the packetintoto enter a routing loop, as different nodes repeatedly salvage theSend Bufferpacket andinitiatereplace the source route on the packet with routes to each other. 3.4.2. Automatic RouteDiscovery as describedShortening Source routes inSection 8.4. 8.2. Originating a Packet with a DSR Routing Header Whenuse may be automatically shortened if one or more intermediate hops in the route become no longer necessary. This mechanism of automatically shortening routes in use is somewhat similar to the use of passive acknowledgements. In particular, if a nodeoriginatesis able to overhear a packetwithcarrying aRouting Header,source route (e.g., by operating its network interface in promiscuous receive mode), then this node examines theaddressunused portion of that source route. If this node is not thefirstintended next hop for the packet but is named in the later unused portion of the packet's source route, then it can infer that the intermediate nodes before itself in the source routeMUST be listed asare no longer needed in theIP Destination Address as well as Address[1]route. For example, the figure below illustrates an example in which node D has overheard a data packet being transmitted from B to C, for later forwarding to D and to E: +-----+ +-----+ +-----+ +-----+ +-----+ | A |---->| B |---->| C | | D | | E | +-----+ +-----+ +-----+ +-----+ +-----+ \ ^ \ / --------------------- In this case, this node (node D) returns a "gratuitous" Route Reply message to theRouting Header. The final destinationoriginal sender of the packetis listed(node A). The Route Reply gives the shorter route as thelast hop inconcatenation of theRouting Header (Address[n]). At each intermediate hop i, Address[i] is copied intoportion of theIP Destination Address andoriginal source route up through thepacket is retransmitted. For example, suppose node A originates a packet destined fornodeDthatshould pass through intermediate hops B and C. Thetransmitted the overheard packetMUST be initialized as follows: IP.Source_Address = Home address(node B), plus the suffix of the original source route beginning with the node returning the gratuitous Route Reply (node D). In this example, the route returned in the gratuitous Route Reply message sent from D to AIP.Destination_Address = Home addressgives the new route as the sequence ofnode B RT.Segments_Left = 2 RT.Out_Index[1] = Interface index used byhops from A toreach B RT.Out_Index[2] = Interface index used byB toreach C RT.Out_Index[3] = Interface index used by C to reachDRT.Address[1] = Home address of node B RT.Address[2] = Home address of node C RT.Address[3] = Home addressto E. 3.4.3. Increased Spreading ofnode D 8.3. ProcessingRoute Error Messages When aRouting Header Excluding the exceptions listed here,source node receives aDSR Routing Header is processed using the same rules as outlinedRoute Error forType 0 Routing Headers in IPv6 [6]. The Routing Header is only processed by thea data packet that it originated, this source nodewhose address appears as the IP destination of the packet. The following additional rules applypropagates this Route Error toprocessing the type specific data of a DSR Source Route: Let SegLft =its neighbors by piggybacking it on its next Route Request. In this way, stale information in thevaluecaches ofSegments Left when the packet wasnodes around this source node will not generate Route Replys that contain the same invalid link for which this source node receivedNumAddrs =thetotal number of addressesRoute Error. For example, in theRouting Header 1. The address of the next hop, Address[NumAddrs - SegLft + 1], is copied intosituation shown in theIP.Destination_Addressexample of Section 3.2, node A learns from thepacket. The existing IP.Destination_Address is NOT copied back into the Address list ofRoute Error message from C, that theRouting Header. 2. The interface usedlink from C totransmit the packetD is currently broken. It thus removes this link from its own Route Cache and initiates a new Route Discovery (if it doesn't have another route to E in itsnext hop from this node MUST be the interface denoted by Index[NumAddrs - SegLft + 1]. 3. IfRoute Cache). On theAcknowledgmentRoute Request(R) bit is set, thepacket initiating this Route Discovery, nodeMUST transmitA piggybacks apacket containingcopy of this Route Error message, ensuring that theDSR Acknowledgment optionRoute Error message spreads well tothe previous hop, Address[NumAddrs - SegLft - 1], performingother nodes, and guaranteeing that any RouteDiscovery if necessary. (Address[0] is taken as the IP.Source_Address) 4. PerformReply that it receives (including those from other node's RouteMaintenance by verifyingCaches) in response to this Route Request does not contain a route that assumes thepacket was received byexistence of this broken link. 4. Conceptual Data Structures This document describes thenext hop as describedDSR protocol inSection 8.5. 8.4. Route Discovery Route Discovery is the on-demand process by which nodes actively obtain source routes to destinations to which they are actively attempting to send packets. The destination node for whichterms of aRoute Discovery is initiated is known asnumber of conceptual data structures. This section describes each of these data structures and provides an overview of its use in the"target"protocol. In an implementation of theRoute Discovery. A Route Discovery for a destination SHOULD NOTprotocol, these data structures MAY beinitiated unless the initiating node has a packetimplemented in any manner consistent with theSend Buffer requiring delivery to that destination. Aexternal behavior described in this document. 4.1. RouteDiscovery forCache All routing information needed by agiven targetnodeMUST NOT be initiated unless permitted by the rate-limiting information containedparticipating in an ad hoc network using DSR is stored in a Route Cache. Each node in the network maintains its own RouteRequest Table. After eachCache. A node adds information to its RouteDiscovery attempt, the intervalCache as it learns of new links betweensuccessive Route Discoveriesnodes in the ad hoc network; forthis target must be doubled, up toexample, amaximumnode may learn ofMAX_REQUEST_PERIOD. Route Discoveries fornew links when it receives amulticast address SHOULD NOT be rate limited, and SHOULD always be permitted. 8.4.1. Originatingpacket carrying either a RouteRequest The basic Route Discovery algorithm forReply or aunicast destination is as follows: 1. OriginateDSR Routing header. Likewise, a node removes information from its RouteRequest packet withCache as it learns that existing links in theIP header Time-to-Live field initialized to 1. This typead hoc network have broken; for example, a node may learn ofRoute Request is calledanon-propagatingbroken link when it receives a packet carrying a RouteRequest and allows the originator of the Request to inexpensively queryError or through theroute caches of each of its neighbors forlink-layer retransmission mechanism reporting aroutefailure in forwarding a packet totheits next-hop destination.2. If a Route ReplyIt isreceived in responsepossible tothe non-propagating Request, use the returned source routeinterface a DSR network with other networks, external totransmit all packetsthis DSR network. Such external networks may, for example, be thedestinationInternet, 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 networks inthe Send Buffer. DONE. 3. Otherwise, if no Route Reply is received within RING0_REQUEST_TIMEOUT seconds, transmit a Route Request with the IP header Time-to-Live field initializedorder toMAX_ROUTE_LEN. This typeimprove scalability. The complete handling ofRoute Requestsuch external networks iscalled a propagating Route Request. Update the information in the Route Request Table, to doublebeyond theamountscope oftime before any subsequent Route Discovery attemptthis document. However, this document specifies a minimal set of requirements and features necessary to allow nodes only implementing thistarget. 4. If no Route Reply is received within the time interval indicated by the Route Request Table, GOTO step 1. The Route Request option SHOULD be initialized as follows: IP.Source_Address =specification to interoperate correctly with nodes implementing interfaces to such external networks. Thisnode's home address IP.Destination_Address = 255.255.255.255 Request.Target = Home address of intended destination Request.OUT_Index[1] = Indexminimal set ofinterface used to transmitrequirements and features involve theRequest The behavior of a node processing a packet containing both a Routing HeaderFirst Hop External (F) and Last Hop External (L) bits in aRoute Request Destination option is unspecified. Packets SHOULD NOT contain both aDSR Routing Header and a DSR RouteRequest Destination option. [This is not exactly true: A Route Request option appearingReply option, and the addition of an External flag bit tagging each node in thesecond Destination Options header that IPv6 allows afterRoute Cache, copied from the First Hop External (F) and Last Hop External (L) bits in the RoutingHeader would probably do-what-you-mean, though we have not triple-checked it yet. Namely, it would allowheader or Route Reply from which theoriginator of alink to this node was learned. The Route Cache SHOULD support storing more than one routediscoverytounicasteach destination. In searching therequestRoute Cache for a route to someotherdestination node,where it would be releasedthe Route Cache is indexed by destination node address. - Each implementation of DSR at any node MAY choose any appropriate strategy andbeginalgorithm for searching its Route Cache and selecting a "best" route to theflood fill. We call thisdestination from among those found. For example, aRoute Request Blossom sincenode MAY choose to select theunicast portionshortest route to the destination (the shortest sequence of hops), or it MAY use an alternate metric to select thepath looks likeroute from the Cache. - However, if there are multiple cached routes to astem ondestination, theblossoming flood-fillselection of routes when searching therequest.] Packets containing aRouteRequest Destination option SHOULD NOT be retransmitted,Cache SHOULDNOT request an explicitprefer routes that do not have the External flag set on any node. This will prefer routes that lead directly to the target node instead of routes that attempt to reach the target via any external networks connected to the DSRAcknowledgment by settingad hoc network. - In addition, any route selected when searching theR bit, SHOULDRoute Cache MUST NOTexpect a passive acknowledgment, and SHOULDhave the External bit set for any nodes other than possibly the first node, the last node, or both; the External bit MUST NOT beplacedset for any intermediate hops in theRetransmission Buffer. The repeated transmissionroute selected. An implementation ofpackets containing a Route Request Destination option is controlled solely by the logic described in this section. 8.4.2. Processinga RouteRequest Option WhenCache MAY provide a fixed capacity for the cache, or the cache size MAY be variable. - Each implementation of DSR at each nodeA receives a packet containing a Route Request option,MAY choose any appropriate policy for managing the entries in its RouteRequest option is processedCache, such asfollows: 1. If Request.Target_Address matches the home addresswhen limited cache capacity requires a choice ofthis node, thenwhich entries to retain in theRoute Request option containscache. For example, acomplete source route describingnode MAY chose a "least recently used" (LRU) cache replacement policy, in which thepathentry last used longest ago is discarded from theinitiator ofcache if a decision needs to be made to allow space in the cache for some new entry being added. - However, the RouteRequestCache replacement policy SHOULD allow routes tothis node. (a) Sendbe categorized based upon "preference", where routes with a higher preferences are less likely to be removed from the cache. For example, a node could prefer routes for which it initiated a RouteReplyDiscovery over routes that it learned asdescribed in Section 8.4.4. (b) Continue processingthepacket in accordanceresult of promiscuous snooping on other packets. In particular, a node SHOULD prefer routes that it is presently using over those that it is not. Any suitable data structure organization, consistent with this specification, MAY be used to implement theNext Header value contained in the Destination Option extension header. DONE. 2. Otherwise, if the combination (IP.Source_Address, Request.Identification) is foundRoute Cache in any node. For example, theRoute Request Table, then discardfollowing two types of organization are possible: - In DSR, thepacket, since thisroute returned in each Route Reply that isa copyreceived by the initiator of arecently seenRouteRequest. DONE. 3. Otherwise, if Request.Target_Address is a multicast address then: (a) If node ADiscovery (or that isa member of the multicast group indicated by Request.Target_Address, then create a copy of the packet, setting IP.Destination_Address = REQUEST.Target_Address, and continue processinglearned from thecopyheader ofthe packetoverhead packets, as described inaccordance with the Next Header fieldSection 6.1.3) represents a complete path (a sequence of links) leading to theDestination option. (b) If IP.TTL is non-zero, decrement IP.TTL, and retransmit the packet. DONE. (c) Otherwise, discard the packet. DONE. 4. Otherwise, if the home addressdestination node. By caching each ofnodethese paths separately, a "path cache" organization for the Route Cache can be formed. A path cache isalready listed in thevery simple to implement and easily guarantees that all routes are loop-free, since each individual route from a RouteRequest (IP.Source_AddressReply orRequest.Address[]), then discard the packet. DONE. 5. Let m = number of addresses currently in theRoute Requestoption n = m + 1 6. Otherwise, appendor used in a packet is loop-free. To search for a route in a path cache data structure, thehome address ofsending nodeA to thecan simply search its RouteRequest option (Request.Address[n]). 7. Set Request.IN_Index[n] = indexCache for any path (or prefix ofinterface packet was received on. 8. Ifasource routepath) that leads toRequest.Target_Address is found in ourthe intended destination node. This type of organization for the Route Cache in DSR has been extensively studied through simulation [5, 11, 19] andthe rulesthrough implementation ofSection 8.4.3 permit it, returnDSR in aCachedmobile outdoor testbed under significant workload [20, 21]. - Alternatively, a "link cache" organization could be used for the RouteReply as describedCache, inSection 8.4.3. DONE. 9. Otherwise, for each interface onwhich each individual link in thenoderoutes returned in Route Reply packets (or otherwise learned from the header of overhead packets) isconfiguredadded toparticipate in a DSR ad hoc network: (a) Makeacopyunified graph data structure ofthe packet containing the Route Request. (b) Set Request.OUT_Index[n+1] = indexthis node's current view of theinterface. (c) If the outgoing interface is different fromnetwork topology. To search for a route in link cache, theincoming interface, then setsending node must use a more complex graph search algorithm, such as theC bit on both Request.OUT_Index[n+1] and Request.IN_Index[n] (d) Link-layer re-broadcastwell-known Dijkstra's shortest-path algorithm, to find thepacket containingcurrent best path through theRoute Request ongraph to theinterface jittered by T milliseconds, where Tdestination node. Such an algorithm isa uniformly distributed, random number between 0more difficult to implement andBROADCAST_JITTER. DONE. 8.4.3. Generating Route Replies using the Route Cache A node SHOULD use its Route Cachemay require significantly more CPU time toavoid propagating a Route Request packet received from another node. In particular, suppose a node receivesexecute. However, aRoute Request packet for which itlink cache organization isnotmore powerful than a path cache organization, in its ability to effectively utilize all of thetarget and which it does not discard based onpotential information that a node might learn about thelogicstate ofSection 8.4.2. Ifthenode has anetwork: links learned from different RouteCache entry forDiscoveries or from thetargetheader of any overheard packets can be merged together to form new routes in theRequest, it SHOULD appendnetwork, but thiscached routeis not possible in a path cache due to theaccumulated route recordseparation of each individual path in thepacket and return this routecache. This type of organization for the Route Cache in DSR, including the effect of aRoute Reply packetrange of implementation choices, has been studied through detailed simulation [9]. The choice of data structure organization tothe initiator without propagating (re-broadcasting) the Route Request. Thus,use forexample, if node F intheexample network shownRoute Cache inFigure 8.4.3 needs to sendany DSR implementation is apacket tolocal matter for each nodeD, it will initiate a Route Discoveryandbroadcast aaffects only performance; any reasonable choice of organization for the Route Cache does not affect either correctness or interoperability. 4.2. Route Requestpacket. IfTable The Route Request Table records information about Route Requests that were recently originated or forwarded by thisbroadcastnode. The table isreceivedindexed bynode A, node A can simply return aIP address. The RouteReply packet to F containingRequest Table on a node records thecomplete routefollowing information about nodes toD consisting of the sequence of hops: A, B, C, and D. Before transmittingwhich this node has initiated a RouteReply packet that was generated using information from its Route Cache, a node MUST verify that: 1. The resulting route contains no loops. 2.Request: - Thenode issuing the Route Reply is listed in the route that it specifies in its Reply. This increases the probabilitytime thatthe route is valid, since thethis nodein question should have receivedlast originated a RouteError if this route stopped working. Additionally, this requirement meansDiscovery for that target node. - The number of consecutive Route Requests initiated for this target since receiving a valid RouteError traversing the route will pass through the node that issued theReplybased on stale cache data, which is critical for ensuring stale data is removed from caches ingiving atimely manner. Withoutroute to that target node. - The remaining amount of time before which thisrequirement, thenode MAY next attempt at a Route Discovery for that target node. - The Time-to-Live (TTL) field used in the IP header of last Route Request initiated by this node for that target node. In addition, theoriginal requester might also be contaminated by aRouteReplyRequest 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 REQUEST_TABLE_IDS entries containing thesame stale route. 8.4.4. Originating aIdentification value and target address from the most recent RouteReply Let REQPacket denote a packetRequests received by this nodeAfrom thatcontains ainitiator node. Nodes SHOULD use an LRU policy to manage the entries in their Route Requestoption which lists node A as the REQPacket.Request.Target_Address. Let REPPacketTable. The number of Identification values to retain in each Route Request Table entry, REQUEST_TABLE_IDS, MUST NOT be unlimited, since, in the worst case, when apacket transmitted bynodeA that contains a corresponding Route Reply. Thecrashes and reboots, the first REQUEST_TABLE_IDS RouteReply option transmitted in responseRequests it initiates could appear to be duplicates to the other nodes in the network. 4.3. Send Buffer The Send Buffer of some node is aRoute Request MUSTqueue of packets that cannot beinitialized as follows: B->C->D +---+ +---+ +---+ +---+ | A |---->| B |---->| C |---->| D | +---+ +---+ +---+ +---+ +---+ | F | +---+ +---+ | E | +---+ Figure 1: An example network where A knowstransmitted by that node because it does not yet have a source route toD via Beach respective packet's destination. Each packet in the Send Buffer is stamped with the time that it is placed into the Buffer, andC. 1.SHOULD be removed from the Send Buffer and discarded SEND_BUFFER_TIMEOUT seconds after initially being placed in the Buffer. IfREQPacket.Request.Address[] does not contain any hops, then node A is onlynecessary, asingle hop fromFIFO strategy SHOULD be used to evict packets before they timeout to prevent theoriginator ofbuffer from overflowing. Subject to theRoute Request. Buildrate limiting defined in Section 6.2, a RouteReply packetDiscovery SHOULD be initiated asfollows: REPPacket.IP.Source_Address = REQPacket.Request.Target_Address REPPacket.Reply.Target = REQPacket.IP.Source_Address REPPacket.Reply.OUT_Index[1] = REQPacket.Request.OUT_index[1] REPPacket.Reply.OUT_C_bit[1] = REQPacket.Request.OUT_C_bit[1] REPPacket.Reply.Address[1] = The homeoften as possible for the destination address ofnode A GOTO step 3. 2. Otherwise, build a Route Reply packet as follows: REPPacket.IP.Source_Address =any packets residing in the Send Buffer. 4.4. Retransmission Buffer Thehome addressRetransmission Buffer of a nodeA REPPacket.Reply.Target = REQPacket.IP.Source_Address REPPacket.Reply.OUT_Index[1..n]= REQPacket.Request.OUT_index[1..n] REPPacket.Reply.OUT_C_bit[1..n]= REQPacket.Request.OUT_C_bit[1..n] REPPacket.Reply.Address[1..n] = REQPacket.Request.Address[1..n] 3. Send the Route Reply jittered by T milliseconds, where Tis auniformly distributed random number between 0 and BROADCAST_JITTER. DONE. If sending a Route Reply packet to the originatorqueue of packets sent by this node that are awaiting theRoute Request requires performing a Route Discovery,receipt of an acknowledgment from theRoute Reply hop-by-hop option MUST be piggybacked onnext hop in the source route (Section 5.3). For each packetthat containsin theRoute Request. This preventsRetransmission Buffer, aloop wherein the targetnode maintains (1) a count of thenew Route Request (which was itselfnumber of retransmissions and (2) theoriginatortime of theoriginal Route Request) must do another Route Request in order to return its Route Reply. If sendinglast retransmission. Packets are removed from theRoute Reply tobuffer when an acknowledgment is received, or when theoriginatornumber of retransmissions exceeds DSR_MAXRXTSHIFT. In theRoute Request does not require performing Route Discovery, a nodelater case, the removal of the packet from the Retransmission Buffer SHOULDsendresult in aunicastRouteReplyError being returned to the original source of the packet (Section 6.3). 5. Packet Formats Dynamic Source Routing makes use of four options carrying control information that can be piggybacked inresponseany existing IP packet. The mechanism used toevery Route Request targeted at it. 8.4.5. Processingrepresent these options in aRoute Reply Option Upon receiptpacket is based on the design ofa Route Reply, a node should extractthesource route (Target_Address, OUT_Index[1]:Address[1], .. OUT_Index[n]:Address[n] )Hop-by-Hop andinsert this route into its Route Cache. All the packetsDestination Options mechanisms inthe Send Buffer SHOULDIPv6 [7]. The ability to generate and process such options must becheckedadded tosee whetheran IPv4 protocol stack. Specifically, theinformationProtocol field in theReply allows themIP header is used tobe sent immediately. 8.5. Route Maintenance Route Maintenance requiresindicate thatwhenever a node transmits a data packet,aRoute Reply,Hop-by-Hop Options extension header ora Route Error, it must verify that the next hop (indicated by theDestination Options extension header follows the IPAddress) correctly receivesheader, and the Next Header field in the extension header is used to indicate the type of protocol header (such as a transport layer header) following the extension header. In addition, DSR makes use of one additional header type, to carry the source route for a packet.IfThis DSR Routing header is based on thesender cannot verify thatdesign of thenext hop receivedRouting header defined for IPv6 [7]. DSR defines a new value for thepacket, itRouting Type field to distinguish a DSR Routing header from other types of Routing headers. For IPv6, all extension headers are a multiple of 8 bytes in length. However, for use in IPv4 packets, all extension headers only MUSTdecide that its link tobe a multiple of 4 bytes long. This requirement preserves thenext hop is brokenalignment of any following extension headers andMUST sendof any additional header (e.g., aRoute Error to the node responsible for generatingTCP header [26]) following theRoutinglast extension header. 5.1. Destination Options Headerthat contains the broken link (Section 8.5.3).Thefollowing ways may beDestination Options extension header is used toverifycarry optional information thatthe next hop correctly receivedneeds to be examined only by apacket: -packet's destination node(s). Thereceipt ofDestination Options extension header is identified by apassive acknowledgment (Section 8.5.1). - The receipt of an explicitly requested acknowledgment (Section 8.5.1). - By the presenceNext Header (or Protocol) value ofpositive feedback from the link layer indicating that the packet was acknowledged by the next hop (Section 8.5.2). - By60 in theabsence of explicit failure notification fromimmediately preceding header [7], and has thelink layer that provides reliable hop-by-hop delivery such as MACAW or 802.11 (Section 8.5.2). Nodes MUST NOT perform Route Maintenance for packets containing a Route Request option or packets containing only an Acknowledgment option. Sending Acknowledgments for packets containing only an Acknowledgment option would create an infinite loop whereby acknowledgments would be sent for acknowledgments. Acknowledgments should be always sent for packets containing a Routingfollowing 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 | Hdr Ext Len | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | . . . Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Next Headerwith8-bit selector. Identifies theR bit set (e.g., packets which contain only an Acknowledgment and a Routing Header for whichtype of header immediately following thelast forwarding hop requires an explicit acknowledgmentDestination Options header. Uses the same values as the IPv4 Protocol field [27]. Hdr Ext Len 8-bit unsigned integer. Length ofreceipt bythefinal destination). 8.5.1. Using Network-Layer Acknowledgments For link layers that doDestination Options header in 4-octet units, notprovide explicit failure notification,including the first 8 octets. Options Variable-length field, of length such that the complete Destination Options header is an integer multiple of 4 octets long. Contains one or more TLV-encoded options. The followingsteps SHOULD bedestination option type is used bya node A to perform Route Maintenance. When receiving a packet: - Ifthepacket contains a Routing Header with the R bit set, send an explicit acknowledgment as described in Section 8.3.DSR protocol: -If the packet does not contain a Routing Header, the nodeDSR Route Request option (Section 5.1.1) 5.1.1. DSR Route Request Option The DSR Route Request destination option is encoded in type-length-value (TLV) format 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 | Option Length | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Target Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ IP fields: Source Address MUSTtransmit a packet containing the DSR Acknowledgment option to the previous hop as indicated by the IP.Source_Address. Since the receiving node is the final destination, there willbeno opportunity for the originatorset toobtain a passive acknowledgment, and the receiving node must infertheoriginator's request for an explicit acknowledgment. When sending a packet: 1. Before sending a packet, insert a copyaddress of thepacket into the Retransmission Buffer and update the information maintained about this packet in the Retransmission Buffer. 2. If after processing the Routing Header, RH.Segments_Left is equal to 0, thennodeA MUST setoriginating this packet. Intermediate nodes that repropagate theAcknowledgmentRoute Request(R) bit in the Routing Header before transmitting the packet over its final hop. 3. If after processing the Routing Header and copying RH.Address[n] to IP.Destination_Address, node A determines that RH.OUT_C_bit[n+1] is set, then node AMUST not change this field. Destination Address MUST be set to theAcknowledgmentlimited broadcast address (255.255.255.255). Hop Limit (TTL) Can be varied from 1 to 255, for example to implement non-propagating Route Requests and Route Request(R) bit in the Routing Header before transmitting the packet (since the C bit was set duringexpanding-ring searches (Section 3.3.4). RouteDiscovery by the node now listed as the IP.Destination_AddressRequest fields: Option Type ???. The top three bits of this Option Type value are equal toindicate011, meaning thatit will propagate the packet outadifferent interface, and thatnodeA will not receive a passive acknowledgment). 4. Set the retransmission timer for the packet in the Retransmission Buffer. 5. Transmit the packet. 6. If a passive or explicit acknowledgment is received before the retransmission timer expires, then remove the packet fromthat does not understand this option MUST discard theRetransmission Bufferpacket, anddisablethat theretransmission timer. DONE. 7. Otherwise, whenOption Data may change en-route [7]. Option Length 8-bit unsigned integer. Length of theRetransmission Timer expires, removeoption, in octets, excluding thepacket fromOption Type and Option Length fields. Identification A unique value generated by theRetransmission Buffer. 8. If DSR_MAXRXTSHIFT transmissions have been done, then attempt to salvageinitiator (original sender) of thepacket (Section 8.5.5). Also,Route Request. Nodes initiating a Route Request generate a new Identification value for each RouteError. DONE. 9. GOTO step 1. 8.5.2. Using Link Layer Acknowledgments If explicit failure notifications are provided by the link layer, thenRequest, for example based on a sequence number counter of allpackets are assumed to be correctly receivedRoute Requests initiated by thenext hop and a Route Error is sent only whennode. This value allows aexplicit failure notification is made from the link layer. Nodesreceivinga packet without a Routing Header do not need to send an explicit Acknowledgmentnode tothe packet's originator, since the link layer will notify the originator if the packet was not received properly. 8.5.3. Originatingdetermine whether it has recently seen aRoute Error If the next hopcopy ofa packetthis Route Request: if this Identification value is foundto be unreachable as describedby this receiving node inSection 8.5, aits RouteError packet (Section 7.2.2) MUST be returned toRequest Table (in thenode whosecachegeneratedof Identification values in theinformation used to routeentry there for this initiating node), this receiving node MUST discard thepacket.Route Request. Whena node A generatespropagating a RouteError for packet P, itRequest, this field MUSTinitializebe copied from thefields inreceived copy of the RouteError as follows: Error.Source_Address = Home address of node A Error.Unreachable_Address = HomeRequest being forwarded. Target Address The address of theunreachablenode- If the packet contains a DSR Routing Header and the S bitthat isNOT set,thepacket has been forwarded withouttarget of theneed for salvaging up to this point. Error.Destination_Address = P.IP.Source_Address - Otherwise, ifRoute Request. Address[1..n] Address[i] is thepacket contains a DSR Routing Header andaddress of theS bit IS set,i-th hop recorded in thepacket has been salvaged by an intermediate node, and thusRoute Request option. The number of addresses present in thisRouting Header was placed therefield is indicated by thesalvaging node. Error.Destination_Address = P.RoutingHeader.Address[1] - Otherwise, if the packet does not contain a DSR Routing Header,Option Length field in thepacket must have been originated by this node A. Error.Destination_Addressoption (n =Home address of(Option Length - 6) / 4). Each nodeA Send the packet containingrepropagating the RouteError to Error.Destination_Address, performing Route Discovery if necessary. As an optimization, Route Errors that are discovered by the packet's originator (such that Error.Source_Address is equalRequest adds its own address toError.Destination_Address) SHOULD be processed internally. Such processing should invoke allthis list, increasing thesteps that would be taken if a Route Error option was created, transmitted, received, and processed, but an actual packet containing aOption Length value by 4. The DSR RouteErrorRequest destination optionSHOULDMUST NOTbe transmitted. 8.5.4. Processing a Route Error Option Upon receipt of a Route Error via any mechanism, a node SHOULD removeappear more than once within anyroute from its Route Cache that uses the hop (Error.Source_Address, Error.Index to Error.Unreachable_Address). This includes all Route Errors overheard, and those processed internally as described in Section 8.5.3. When thesingle Destination Options extension header. 5.2. Hop-by-Hop Options Header The Hop-by-Hop Options extension header is used to carry optional information that must be examined by every node along a packet's delivery path. The Hop-by-Hop Options extension header is identified byError.Destination_Address receivesa Protocol value of 0 in theRoute Error, it SHOULD verify thatIP header [7], and has thesource route responsible for deliveringfollowing 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 | Hdr Ext Len | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | | . . . Options . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Next Header 8-bit selector. Identifies theRoute Error includestype of header immediately following the Hop-by-Hop Options header. Uses the samehopsvalues as theworking prefixIPv4 Protocol field [27]. Hdr Ext Len 8-bit unsigned integer. Length of theoriginal packet's source route (Error.Destination_Address to Error.Source_Address). If any hop listedHop-by-Hop Options header inthe working prefix is4-octet units, notincluded in the Route Error's source route, then the originator SHOULD forward the Route Error back alongincluding theworking prefix (Error.Destination_Address to Error.Source_Address) sofirst 8 octets. Options Variable-length field, of length such thateach node along the working prefix will removetheinvalid route from its Route Cache.complete Hop-by-Hop Options header is an integer multiple of 4 octets long. Contains one or more TLV-encoded options. If present in an IP packet, thenode processing a Route Error option discovers its home address is Error.Destination_Address andHop-by-Hop Options extension header MUST appear in the packetcontains additional Route Error option(s) later on the inside ofimmediately following theHopIP header. The following hop-by-hop option types are used byHop options header, we calltheadditional Route Errors nestedDSR protocol: - DSR RouteErrors. The node MUST deliver the first nestedReply option (Section 5.2.1) - DSR Route Errorto Nested_Error.Destination_Address, performingoption (Section 5.2.2) - DSR Acknowledgment option (Section 5.2.3) 5.2.1. DSR RouteDiscovery if needed. It does this by removing theReply Option The DSR RouteErrorReply hop-by-hop optionlisting itselfis encoded in type-length-value (TLV) format asthe Error.Destination_Address, finding the first nested Route Error option, and originating the remaining packet to Nested_Error.Destination_Address. This mechanism allows for the proper handlingfollows: 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 | Option Length |L| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. The top three bits ofRoute Errors thatthis Option Type value arediscovered while delivering a Route Error. 8.5.5. Salvaging a Packet When node A attemptsequal tosalvage000, meaning that apacket originated atnodeSthat does not understand this option SHOULD ignore this option anddestined for node D, it MUST performcontinue processing thefollowing steps: 1. Generatepacket, andsend a Route Error to S as explainedthat the Option Data does not change en-route [7]. Option Length 8-bit unsigned integer. Length of the option, inSection 8.5.3. 2. Call Route_Cache.Get() to determine if it has a cached source route tooctets, excluding thepacket's ultimate destination D (which isOption Type and Option Length fields. Last Hop External (L) Set to indicate that the lastAddress listed in the Routing Header). 3. IfnodeA does not haveindicated by the Route Reply is actually in acached route for node D, it MUST discardnetwork external to thepacket. DONE. 4. Otherwise, let Salvage_Address[1] through Salvage_Address[m] beDSR network; the exact sequence of hopsreturned from the Route Cache. Initializeleading to it outside thefollowing fieldsDSR network are not represented in thepacket's header: RT.Segments_Left = m - 2; RT.S = 1 RT.Address[1] = Home address of Node A RT.Address[2] = Salvage.Address[1] ... RT.Address[n] = Salvage.Address[m] The IP Source Address of the packet MUST remain unchanged. When the Routing HeaderRoute Reply. Nodes caching this hop in their Route Cache MUST flag theoutgoing packet is processed, RT.Address[2], will be copied tocached hop with theIP Destination Address field. 9. Optimizations A number of optimizations canExternal flag. Such hops MUST NOT beadded to the basic operation ofreturned in a cached RouteDiscovery andReply generated from this RouteMaintenance as described in Sections 8.4 and 8.5 that can reduce the number of overhead packetsCache entry, andimprove the average efficiencyselection oftheroutesused on data packets. This section discusses some of those optimizations. 9.1. Leveragingfrom the Route CacheThe data into route anode's Route Cache may be stored in any format, but the activepacket being sent SHOULD prefer routesin its cache form a tree of routes, rooted at this node, to otherthat contain no nodesinflagged as External. Reserved Sent as 0; ignored on reception. Address[1..n] The source route being returned by thead hoc network. For example,Route Reply, indicating a route from theillustration below shows an ad hoc networknode with address Address[1] to the node with address Address[n]. The number ofsix mobile nodes,addresses present inwhich mobile nodethis field is indicated by the Option Length field in the option (n = (Option Length - 1) / 4). Ahas earlier completed aDSR RouteDiscovery for mobile node D and has cachedReply destination option MAY appear one or more times within aroute to D through B and C: B->C->D +---+ +---+ +---+ +---+single Hop-by-Hop Options extension header. 5.2.2. DSR Route Error Option The DSR Route Error hop-by-hop option is encoded in type-length-value (TLV) format 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |A |---->| B |---->| C |---->| DOption Type |+---+ +---+ +---+ +---+ +---+Option Length |FError Type |Reservd|Salvage| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |+---+ +---+Error Source Address |E+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |+---+ Since nodes B and CError Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Unreachable Node Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. The top three bits of this Option Type value areon the route to D, node A also learns the routeequal toboth of these nodes from its Route Discovery for D. If A later performs000, meaning that aRoute Discoverynode that does not understand this option SHOULD ignore this option andlearnscontinue processing theroute to E through Bpacket, andC, it can represent this in its Route Cache withthat theadditionOption Data does not change en-route [7]. Option Length 8-bit unsigned integer. Length of thesingle new hop from C to E. If A then learns it can reach Coption, ina single hop (without needing to go through B), A SHOULD use this new routeoctets, excluding the Option Type and Option Length fields. For the current definition of the DSR Route Error option, this field MUST be set toC13. Extensions toalso shortentheroutes to D and E in itsDSR RouteCache. 9.1.1. Promiscuous LearningError option format may be included after the fixed portion ofSource Routes A node can add entries to itsthe DSR RouteCache any time it learns a new route. In particular, when a node forwards a data packet as an intermediate hop onError option specified above. The presence of such extensions will be indicated by theroute in that packet,Option Length field. When theforwarding nodeOption Length isable to observegreater than 13 octets, theentire route inremaining octets are interpreted as extensions. Currently, no extensions have been defined. Error Type The type of error encountered. Currently, thepacket. Thus,following type value is defined: NODE_UNREACHABLE 1 Other values of the Error Type field are reserved forexample, when any intermediate node B forwards packets fromfuture use. Reservd Reserved. Sent as 0; ignored on reception. Salvage Ato D, B SHOULD add the source route information4-bit unsigned integer. Copied fromthat packet'sthe Salvage field in the DSR RoutingHeader to its ownheader of the packet triggering the RouteCache. If aError, incremented by the nodeforwards a Route Reply packet, it SHOULD also addreturning thesource route information fromRoute Error. Error Source Address The address of theroute record being returned innode originating the RouteReply, to its own Route Cache. In addition, since all wireless network transmissions atError (e.g., thephysical layer are inherently broadcast, it may be possible for anodeto configure its network interface into promiscuous receive mode, suchthatthe node is ableattempted toreceive all packets withoutforward a packet and discovered the linklayerfailure). Error Destination Address The addressfiltering. In this case,of the nodeMAY addtoitswhich the RouteCacheError must be delivered (e.g., theroutenode that generated the routing informationfrom any packet it can overhear. 9.2. Preventing Route Reply Stormsclaiming that the hop Error Source Address to Unreachable Node Address was a valid hop). Unreachable Node Address Theability for nodesaddress of the node that was found toreplybe unreachable (the next hop neighbor toa Route Request not targeted at them by using their Route Caches can result in a Route Reply storm. If awhich the nodebroadcasts awith address Error Source Address was attempting to transmit the packet). A DSR RouteRequest forError destination option MAY appear one or more times within anode that its neighbors havesingle Hop-by-Hop Options extension header. 5.2.3. DSR Acknowledgment Option The DSR Acknowledgment hop-by-hop option is encoded intheir Route Caches, each neighbor may attempttype-length-value (TLV) format 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 | Option Length | Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. The top three bits of this Option Type value are equal tosend000, meaning that aRoute Reply, thereby wasting bandwidthnode that does not understand this option SHOULD ignore this option andincreasingcontinue processing theratepacket, and that the Option Data does not change en-route [7]. Option Length 8-bit unsigned integer. Length ofcollisions inthearea. For example,option, in octets, excluding thenetwork shown in Section 9.1, if both node AOption Type andnode B receive F's Route Request, they will both attempt to replyOption Length fields. Identification Copied fromtheir Route Caches. Both will send their Replies at about the same time since they receive the broadcast at about the same time. Particularly when more thanthetwo mobile nodes in this example are involved, these simultaneous replies fromIdentification field of themobile nodes receivingDSR Routing header of thebroadcast may createpacketcollisions among some or allbeing acknowledged. ACK Source Address The address ofthese replies and may cause local congestion in the wireless network. In addition, it will often bethecase thatnode originating thedifferent replies will indicate routesDSR Acknowledgment. ACK Destination Address The address ofdifferent lengths. For example, A's Route Reply will indicate a route to D that is one hop longer than that in B's reply. For interfaces which can promiscuously listen to the channel, mobile nodes SHOULD usethefollowing algorithmnode toreducewhich thenumber of simultaneous replies by slightly delaying their Route Reply: 1. Pick a delay period d = H * (h - 1 + r) where hDSR Acknowledgment isthe length in number of network hops for the routeto bereturned in this node's Route Reply, r is a random number between 0 and 1, and H isdelivered. A DSR Acknowledgement destination option MAY appear one or more times within asmall constant delay to be introduced per hop. 2. Delay transmitting the Route Reply from this nodesingle Hop-by-Hop Options extension header. 5.3. DSR Routing Header As specified for IPv6 [7], aperiod of d. 3. WithinRouting header is used by a source to list one or more intermediate nodes to be "visited" on thedelay period, promiscuously receive all packets at this node. Ifway to apacketpacket's destination. This function isreceived by this node duringsimilar to IPv4's Loose Source and Record Route option, but thedelay period thatRouting header does not record the route taken as the packet isaddressedforwarded. The specific processing steps required to implement thetarget of this Route Discovery (the targetRouting header must be added to an IPv4 protocol stack. The Routing header is identified by a Next Header value of 43 in thefinal destination addressimmediately preceding header, and 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 | Hdr Ext Len | Routing Type | Segments Left | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | . . . type-specific data . . . | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The type-specific data for a Routing Header carrying a DSR Source Route is: 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |F|L| Reserved |Salvage| Identification | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[1] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[2] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address[n] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Routing header fields: Next Header 8-bit selector. Identifies thepacket, through any sequencetype ofintermediate hops), and ifheader immediately following thelengthRouting header. Hdr Ext Len 8-bit unsigned integer. Length of theroute on this packet is less than h, then cancel the delay timer and doRouting header in 4-octet units, nottransmit the Route Reply from this node; this node may infer thatincluding theinitiatorfirst 8 octets. Routing Type ??? Segments Left Number ofthis Route Discovery has already received a Route Reply, giving an equally good or better route. 9.3. Piggybacking on Route Discoveries As described in Section 5.1, when one node needs to send a packet to another, if the sender does not have aroutecached to the destination node, it must initiate a Route Discovery, buffering the original packet until the Route Reply is returned. The delay for Route Discovery and the totalsegments remaining, i.e., number ofpackets transmitted can be reduced by allowing data to be piggybacked on Route Request packets. Since some Route Requests may be propagated widely within the ad hoc network, though, the amount of data piggybacked must be limited. We currently use piggybacking when sending a Route Reply or a Route Error packet, since both are naturally small in size. Small data packets such as the initial SYN packet opening a TCP connection [18] could easily be piggybacked. One problem, however, arises when piggybacking on Route Request packets. If a Route Request is received by a node that replies to the request based on its Route Cache without propagating the Request (Section 9.1), the piggybacked data will be lost if the node simply discards the Route Request. In this case,explicitly listed intermediate nodes still to be visited beforediscardingreaching thepacket,final destination. Type-specific fields: First Hop External (F) Set to indicate that the first nodemust constructindicated by the Routing header is actually in anew packet containingnetwork external to thepiggybacked dataDSR network; the exact sequence of hops leading from it outside theRoute Request packet. The source routeDSR network are not represented in the Routing header. Nodes caching thispackethop in their Route Cache MUSTbe constructed to appear as if the new packet had been sent byflag theinitiator ofcached hop with the External flag. Such hops MUST NOT be returned in a RouteDiscovery and had been forwarded normally toReply generated from thisnode. Hence, the first portionRoute Cache entry, and selection ofthe route is takenroutes from theaccumulated route record in theRouteRequestCache to route a packetandbeing sent SHOULD prefer routes that contain no hops flagged as External. Last Hop External (L) Set to indicate that theremainder oflast hop indicated by therouteRouting header istaken from this node's Route Cache. The sender addressactually inthe packet MUST also be seta network external to theinitiatorDSR network; the exact sequence of hops leading to it outside the DSR network are not represented in the Routing header. Nodes caching this hop in their RouteDiscovery. SinceCache MUST flag thereplying node will be unable to correctly recompute an Authentication header forcached hop with thesplit off piggybacked data, data covered by an Authentication header SHOULDExternal flag. Such hops MUST NOT bepiggybacked on Route Request packets. 9.4. Discovering Shorter Routes Oncereturned in a Route Reply generated from this Route Cache entry, and selection of routes from the Route Cache to routebetweena packetsource and a destinationbeing 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 beendiscovered, the basicsalvaged as a part of DSRprotocol MAY continuerouting (Section 3.4.1). Identification Used touserequest thatroute for all traffic from the source to the destination as long as it continuesa DSR Acknowledgement option be returned towork, even if the nodes move suchthis transmitting node for this hop. The special value of 0 indicates thata shorter route becomes possible. In many cases, the basic Route Maintenance procedure will discoverno DSR Acknowledgement is requested. Otherwise, theshorter route, since if a node moves enoughIdentification field is set tocreateashorter route, it will likely also move out of transmission range of at least one hop onunique nonzero number by this node transmitting theexisting route. Furthermore, when a datapacket and isreceived ascopied into theresultIdentification field ofoperating in promiscuous receive mode,the DSR Acknowledgement option when returned by the nodechecks ifreceiving theRouting Headerpacketcontains its address in the unprocessed portionover this hop. Address[1..n] The sequence of addresses ofthe source route (Address[NumAddrs - SegLft] to Address[NumAddrs]). If so, the node knows that packet could bypass the unprocessed hops preceding it inthe source route.The node then sends what is called a gratuitous Route Reply message toIn routing and forwarding thepacket's source, giving itpacket, theshortersource routewithout these hops. The following algorithm describes how a node A should process packets with an IP.Destination_Address not addressed to A or the IP broadcast address or a multicast address that are receivedis processed asa result of A beingdescribed inpromiscuous receive mode: 1. If the packet is notSections 6.1.2 and 6.1.4. 6. Detailed Operation 6.1. General Packet Processing 6.1.1. Originating adata packet containingPacket When originating any packet, aRouting Header, drop the packet. DONE. 2. If the home address of thisnodedoes not appear inusing DSR routing MUST perform theportionfollowing sequence of steps: - Search thesourcenode's Route Cache for a routethat has not yet been processed (indicated by Segments Left), then dropto thepacket. DONE. 3. Otherwise,address given in thenode B that just transmittedIP Destination Address field in thepacket (indicated by Address[NumAddrs - SegLftpacket's header. -1]) can communicate directly with this node A. Create aIf no such route is found in the RouteReply. TheCache, then perform RouteReply MUST listDiscovery for theentire source route containedDestination Address, as described in Section 6.2. - If thereceivedpacket contains a Route Request option, then replace the IP Destination Address field with theexceptionIP "limited broadcast" address (255.255.255.255) [3]. - Else, this node must have a route to the Destination Address of theintermediate nodes between node B and node A. 4. Send this gratuitouspacket (since otherwise a RouteReplyRequest would have been added to thenode listed aspacket). If theIP.Source_Addresslength ofthe received packet. If Route Discoverythis route isrequired it MAY be initiated,greater than 1 hop, or if thegratuitous Route Reply packet MAY be dropped. 9.5. Rate Limitingnode determines to request a DSR network-layer acknowledgement from theRoute Discovery Process One common error condition that must be handled in an ad hoc network isfirst hop of thecaseroute, then insert a DSR Routing header into the packet, as described in Section 6.1.2. The source route inwhichthenetwork effectively becomes partitioned. That is, two nodes that wishpacket is initialized from the route tocommunicate are not within transmission range of each other, and there are not enough other mobile nodes between themthe Destination Address found in the Route Cache. - Transmit the packet toform a sequence of hops through which they can forward packets. If a newthe address given in the IP Destination Address, using RouteDiscovery was initiated for eachMaintenance to retransmit the packetsent by a nodeif necessary, as described inthis situation,Section 6.3. 6.1.2. Adding alarge numberDSR Routing Header to a Packet The design ofunproductive Route Request packets would be propagated throughoutthesubsetDSR Routing header is based on the design of a Routing header in IPv6 [7]. A node originating a packet adds a DSR Routing header to thead hoc network reachable from this node. Inpacket, if necessary, in order toreducecarry theoverheadsource route of hops fromsuch Route Discoveries, we use exponential back-offthis originating node tolimittherate at which new Route Discoveries may be initiated from any node forfinal destination address of thesame target. Ifpacket. Specifically, the nodeattemptsadding the DSR Routing header constructs the Routing header and modifies the IP packet according tosend additional data packetsthe following sequence of steps: - A DSR Routing header, as described in Section 5.3, is created and added tothis same node more frequently than this limit,thesubsequent packets SHOULDpacket after the IP header and any Hop-by-Hop Options header that may already bebufferedin theSend Buffer until a Route Reply is received,packet, butit MUST NOT initiatebefore any Destination Options header (e.g., containing anew Route Discovery until the minimum allowable interval between newDSR RouteDiscoveries for this target has been reached. This limitation on the maximum rateReply option) that may be present. - The number ofRoute Discoveries for the same target is similarAddress fields to include in themechanism required by Internet nodes to limitDSR Routing header (n) is therate at which ARP requests are sent to any single IP address [2]. 9.6. Improved Handlingnumber ofRoute Errors Allintermediate nodesSHOULD process all ofin theRoute Error messages they receive, regardlesssource route for the packet (i.e., excluding address ofwhetherthe originating nodeisand the final destination address of theRoute Error,packet). The Segments Left field in the DSR Routing header isforwardinginitialized equal to n. - The Source Address from theRoute Error, or promiscuously overhearsIP header is copied into Address[n] in theRoute Error. Since a Route Error packet names both endsDSR Routing header. - The first hop of thehop thatsource route for the packet isno longer valid, anycopied into the Source Address field in the IP header. - The remaining hops of thenodes receivingsource route for theerrorpacketmay update their Route Caches to reflectare copied into sequential Address[i] fields in thefact thatDSR routing header, for i = 1, 2, ..., n-1. - The First Hop External (F) bit in thetwo nodesRouting header is copied from the External bit flagging the first hop node in the source route for the packet, as indicated in thepacket can no longer directly communicate. A node receiving a Route Error packet simply searches itsRouteCache for any routes using this hop. For each such route found,Cache. - The Last Hop External (L) bit in therouteRouting header iseffectively truncated at this hop. All nodes oncopied from theroute before this hop are still reachable on this route, but subsequent nodes are not. An experimental optimization to improveExternal bit flagging thehandling of errors is to supportlast hop node in thecaching of "negative" informationsource route for the packet, as indicated ina node'sthe Route Cache. - All other fields in the type-specific data in the DSR Routing header are initialized to 0. - Thegoal of negative informationRouting Type field in the DSR Routing header is initialized torecord that a given route was tried and found not to work, so that if???. - The Hdr Ext Len field in thesame routeDSR Routing header isdiscovered again shortly after the failure,initialized to 4. - Next Header field in theRoute Cache can ignore or downgradeDSR Routing header is set equal to themetric ofcurrent value in thefailed route. We have not currently included this caching of negative informationProtocol field inour simulations, since it appears to be unnecessary if nodes also promiscuously receive Route Error packets. 9.7. Increasing Scalability We recently designed and began experimenting with ways to integrate ad hoc networks withtheInternet and with MobileIP[14]. In addition to this, we are also exploring ways to increaseheader (or thescalability of ad hoc networks by taking advantage of their cooperative natureNext Header field in the preceding extension header), and thefact that some hierarchy can be imposed on an ad hoc network, just be assigning addressesProtocol field (or preceding Next Header field) is set equal tothe nodes in43 to indicate areasonable way. These ideas are described inRouting header extension header [7]. 6.1.3. Receiving aworkshop paper [4]. 10. Path-State and Flow-State Mechanisms This section describesPacket When a node receives any packet, it MUST process thecurrent design of our framework for supporting better-than-best-effort Qualitypacket according to the following sequence ofService in DSR networks. The framework dovetails into DSR's existing mechanisms, and, like DSR itself, is completely on-demandsteps: - If the Destination Address innature --- no packets are sent unless there is user data to transfer. The framework is based ontheintroductionpacket's IP header does not match any oftwo kindsthis receiving node's own IP address(s), then the processing ofsoft-state, called path-state and flow-state, atthis packet depends on whether theintermediate nodes alongpacket contains a DSR Routing header: * If thepath between senders and destinations. Taken together,packet contains a DSR Routing header, then discard the packet. * Else, if the packet contains a Hop-by-Hop Options extension header (if present, this MUST immediately follow the packet's IP header), then process thepath-stateoptions contained in the Hop-by-Hop Options extension header. Forward the packet using normal IP forwarding proceedures andflow-state extensions extenddo not process theQualitypacket further. - Examine and process each ofService provided by DSR networksthe extension headers (if any) in thefollowing ways: - They eliminatepacket in theneed for all data packets to carry a source route, increasingorder in which they occur in theefficiency ofpacket. By dispatching on theprotocolProtocol field ingeneral. - They provide accurate measurements ofthestatepacket's IP header, and subsequently dispatching on the Next Header field of each encountered extension header, thenetwork to higher layers protocolsappropriate protocol module is executed by the receiving node foruse in adaptation.each extension header. -They enable senders to explicitly manageIf a Hop-by-Hop Options extension header or Destination Options extension headers is encountered in processing theconsumption of resources acrosspacket, thenetwork. - They enablereceiving node MUST process any options given in this header in thenetwork to provide better-than-best-effort service via admission control and per-flow resource management. 10.1. Overview Path-state allows intermediate nodes to forward packets according to a predetermined source route, even when most packets do not includeorder in which they occur in thefull source route. Conceptually,Options field within theoriginator of each data packet initially includes bothoption. Any DSR routing information carried in asource routepacket SHOULD be examined anda unique path identifierreflected ineachthe node's Route Cache, even if the options in the packetit sends. As intermediate nodes forwardare not otherwise processed as described above. In particular, thepacket, they cachefollowing routing information SHOULD be handled in this way: - In a DSR Route Request option, thesourceaccumulated routefromrecord, represented by thepacket, indexedIP Source Address of the packet and by thepath identifier. The source can then send subsequent packets carrying onlysequence of Address[i] entries in thepath identifier, since intermediate nodes willRoute Request option SHOULD beableadded toforwardthepacket based onnode's Route Cache. - In a DSR Route Reply option, thesourceroutefor the path that they have cached. While path-state allowsrecord being returned, represented by theeliminationsequence of Address[i] entries in thesource route from each packet, thereby reducingRoute Request option and by theoverhead ofDestination Address in theDSR protocol, it also provides a way for sourcespacket's IP header SHOULD be added tomonitor the state of each path throughthenetwork. Whennode's Route Cache. - In asource wishesDSR Acknowledgement option, the single link from the ACK Source Address toknowthecharacteristics of a path throughACK Destination Address SHOULD be added to thenetwork, it piggybacksnode's Route Cache. - In apath-metrics header onto any data or control packet traversing the path. AsDSR Route Error option, thepacket propagates throughsingle link from thenetwork, each intermediate node updatesError Source Address to theset of path-metrics carried byUnreachable Node Address MUST be removed from thepacket to reflectnode's Route Cache. - In a DSR Routing header, thelocal network conditions seen atindicated source route SHOULD be added to thenode. These metrics are reflected backnode's Route Cache, subject to thesender byconditions identified in Section 3.3.1. The full sequence of hops in thedestination, along withDSR Routing header is as follows: * The Source Address in thepath identifier, and enablepacket's IP header is the first hop (the senderto track the value of these metrics for eachof thesource routes itpacket). * Let n equal Hdr Ext Len. This iscurrently using. We are currently experimenting with metrics that are easy for nodes to measure, that require constant size to represent regardless of source route length, and that would enablethesender's network layer to provide useful feedback to higher layers onnumber of addresses in thestateRouting header. Let i equal n minus Segments Left. * The sequence of hops Address[1], Address[2], ..., Address[i] follow immediately after thenetwork. For example, by including ``available bandwidth'' or ``battery level'' as a metric, senders can load balanceIP Source Address in theconsumption of resources acrosssource route. * The Destination Address in thenetwork. We have also consideredpacket's IP header follows immediately next in thepossibilitysource route. * The sequence ofreplacinghops Address[i+1], Address[i+2], ..., Address[n] follow next in theTCP congestion control algorithm with a ``leaky-bucket'' system controlled bysource route. The address Address[n] above is thereflected path-metrics --- our measured performance results show this could dramatically improve TCP throughputfinal hop inenvironments where many packets are lost due to packet corruption. The feedback could also be used as inputsthe source route. In addition toother researcher's systems for improvingthetransport layer, such as Liu and Singh's ATCP [11], or for adaptation at higher layers, as in Odyssey [13]. Flow-state allowsprocessing of received packets described above, asourcenode SHOULD examine the packet todifferentiate its traffic into flows, and then request better-than-best-effort handlingdetermine if the receipt of this packet indicates an opportunity forthese flows. Withautomatic route shortening, as described in Section 3.4.2. If theadditional information provided byreceived packet satisfies theflow-state,tests described there, then this node SHOULD perform thenetwork can provide admission control and promise a specific Qualityfollowing sequence ofService (QoS)steps: - Return a gratuitous Route Reply toeach flow. Sincethead hoc network may frequently change topology,IP Source Address of theflow-state mechanisms are directly integrated intopacket, as described in Section 3.4.2. - Discard therouting protocol to minimize their reaction time and provide notifications to a flow whenreceived packet, since thenetwork must breakpacket has been received before itspromise for a specific levelnormal traversal ofQoS. 10.2. Path-State and Flow-State Identifiers The metadata that intermediate nodes in the network must process is divided into path-state and flow-state, where path-state isthefundamental unitpacket's source route would have caused it to reach this receiving node. Another copy ofrouting information and flow-state isthefundamental unitpacket will normally arrive at this node as indicated in the packet's source route; discarding this initial copy ofQualitythe packet, which triggered the gratuitous Route Reply, will prevent the duplication ofService information. Path-state is associated withthis packet that would otherwise occur. 6.1.4. Processing aparticular set of hops through the network from some source S toRouting Header in adestination D (i.e.,Received Packet A Routing header in aparticular source routepacket is not examined or processed until the packet reaches the node identified in thenetwork). It consists ofDestination Address field in theinformation needed to route packets alongpacket's IP header. In that node, dispatching on thepath, and information aboutProtocol field in thecarrying capacity ofpacket's IP header (or thepath, such asNext Header field in theunused bandwidth alongpreceding extension header) causes thepath orRouting header module in that node's IP implementation to be invoked. The node then examines the Routing Type field in theminimum latency ofRouting header to determine thepath. Flow-state isspecificto a particular classtype ofpackets flowing between S and Dprocessing for thatis routed over a given path. Flow-state is used to record Qualitytype ofService promises that have been madeRouting header. The processing for aparticular flow, and allows packets from S to D that take the same path through the network to be treated differently by intermediate nodes. For example, allRouting header here in general follows theTCP connections between Sprocedures specified for IPv6 Routing headers, andD that take the same path will sharethesame path-state, but may have independent flow-state. At any point in time, S may use multiple pathsprocessing specifically forits traffic to D and each of these paths may be comprised of many flows. However,asingle network layer flow may not be multiplexed over different paths. To represent paths and flows insideDSR Routing header in general follows thenetwork, we usegeneral procedures specified for ascheme inspired byType 0 Routing header in IPv6 [7]. If, while processing a received packet, a node encounters a Routing header with an unrecognized Routing Type value, theVirtual Path Index and Virtual Circuit Indexrequired behavior ofATM networks [23, p. 451]. Paths are identified bythelogical concatenationnode depends on the value of thesourceSegments Left field, as follows: - If Segments Left is 0, the nodeaddressMUST ignore the Routing header anda 16-bit path identifier whereproceed to process thelow 5 bits are 0. Flows arenext header in the packet, whose type is identified bya path identifier wherethelow 5 bits are used to distinguish betweenNext Header field in thedifferent flows that useRouting header. - If Segments Left is non-zero, thesame path. This scheme has two main advantages. First, each sourcenodecan independently generate globally unique path-MUST discard the packet andflow-identifiers. Second,send an ICMP Parameter Problem, Code 0, message [24] to thehierarchical relation of flow-identifierspacket's Source Address, pointing topath-identifiers means that many flows fromthesame sourceunrecognized Routing Type. If, after processing a Routing header in a received packet, an intermediate nodecan share the same path-state, which reduces the overhead of maintainingdetermines that therouting information. The drawbackpacket isthat if a flow mustto bererouted, its flow identifier will change. However, whenforwarded onto aflowlink whose link MTU isrerouted the QoS metadata must be renegotiated anyway, so changing flow identifiers will not create needless additional work inless than thenetwork. 10.3. Path-State Creation, Use, and Maintenance The path-state portionsize of theprotocol has two major goals. The first goal is to ensure sufficient state exists atpacket, thenodes along a path from a source Snode MUST discard the packet and send an ICMP Packet Too Big message to the packet's Source Address [24]. A DSR Routing header is identified by adestination D so that packets from S to D do not need to carryRouting Type value of ??? in thecomplete source route. The second goalRouting header. A DSR Routing header for IPv4 is processed according toallow S to discoverthecharacteristicsfollowing sequence ofa particular path to D so that it can adapt its sending pattern tosteps: - If thecapabilitiesvalue of thepath, or even choose a different path entirely. TheSegments Left field in the Routing header equals 0, then proceed to process the nextsections describe howheader in the packet, whose type is identified by the Next Header field in the Routing header. Do not process thepath-stateRouting header further. - Else, let n equal Hdr Ext Len. This iscreated, howthecharacteristicsnumber of addresses in the Routing header. - If the value of thepath are discovered, and what metrics can be usedSegments Left field is greater than n, then send an ICMP Parameter Problem, Code 0, message [24] to the IP Source Address, pointing tocharacterizethepath. 10.3.1. Creating Path-State forSegments Left field, and discard the packet. Do not process the RoutingTo createheader further. - Else, decrement thepath-state, we assume that Route Discovery proceeds as normal in DSR. Oncevalue of thesource node S has obtained a source route toSegments Left field by 1. Let i equal n minus Segments Left. This is thedestination D, it begins sending data packetsindex of the next address toD as normally donebe visited inDSR, with each packet carrying a full source route header. Internally, S assigns a path-identifier to that particular source route and storesthepath-identifier in its route cache along withAddress vector. - If Address[i] or thesource route. SIP Destination Address is a multicast address, thenincludesdiscard thepath-identifier as part ofpacket. Do not process theA -----------------> B -----------------> C -----------------> D +-------------+ +-------------+ +-------------+ |src: A | |src: A | |src: A | |dst: D | |dst: D | |dst: D | |path-id: 15 | |path-id: 15 | |path-id: 15 | |rt: A,(B),C,D| |rt: A,B,(C),D| |rt: A,B,C,(D)| +-------------+ +-------------+ +-------------+ | payload | | payload | | payload | (a) Packet with path identifierRouting header further. - Else, swap the IP Destination Address andsource route. A -----------------> B -----------------> C -----------------> D +-------------+ +-------------+ +-------------+ |src: A | |src: A | |src: A | |dst: D | |dst: D | |dst: D | |path-id: 15 | |path-id: 15 | |path-id: 15 | +-------------+ +-------------+ +-------------+ | payload | | payload | | payload | (b) Packet with path identifier only. Figure 2: Path identifiers assigned to a source route byAddress[i]. - Forward theoriginating node A enable later packetspacket toomitthesource route. source route header as shownIP address specified inFigure 2(a). As each intermediate node processes the source route to forward the packet, it also storesthesource route in its route cache, indexed byDestination Address field of thesourceIP header, following normal IP forwarding procedures, including checking andpath-identifier. After sending a packet containing bothdecrementing the Time-to-Live (TTL) field in thesource route andpacket's IP header [25, 3]. In this forwarding of thepath-identifier intopacket, thenetwork, S can begin sending subsequent packets to D without a full source route --- carrying onlynext hop node (identified by thepath-identifierDestination Address) MUST be treated asshown in Figure 2(b). Each intermediate node receiving suchapacket queries its route cache to find the routedirect neighbor node; thepacket is supposedtransmission totake, and determines itsthat nexthop. As explainednode MUST be done inSection 10.5, if the cached source route is not available at some intermediate node, S will receivea single IP forwarding hop, without RouteErrorDiscovery andcan then correct the situation. 10.3.2. Monitoring Characteristics ofwithout searching thePathRoute Cache. - Inorder to support network layer services such as balancing the traffic load acrossforwarding thenetwork, end-systems must have a methodpacket, perform Route Maintenance fordeterminingthecharacteristicsnext hop of thepaths through the network that they could use. While many schemes have been proposedpacket, bywhich the end-systems themselves can measureverifying that thecharacteristics of a path (e.g., TCP congestion window and RTT calculations [1, 22, 24] and SPAND [21]), we hypothesize that, particularlypacket was received by that next hop, as described intheSection 6.3. Multicast addresses must not appear in a DSR Routing header or in thedynamic environmentIP Destination Address field ofan ad hoc network, more useful, more accurate, and more timely information can be developeda packet carrying a DSR Routing header. 6.2. Route Discovery Processing Route Discovery is the mechanism byenlistingwhich 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. The node initiating a Route Discovery is known as theaid"initiator" of thenodes along the path to measure the path characteristics. We propose that each node can measure the activity around itself,Route Discovery, andthereby determine information such as:themean latency it adds todestination node for which thepackets it forwards andRoute Discovery is initiated is known as thelatency variation (jitter);"target" of thenumberRoute Discovery. Route Discovery operates entirely on demand, with a node initiating Route Discovery based on its own origination ofadditionalnew packetsper second it believesfor some destination address to which itcan process;does not currently know a route. Route Discovery does not depend on any periodic orthe unused amountbackground exchange ofwireless media capacityrouting information or neighbor node detection at any layer in theair around thenetwork protocol stack at any node.Experimentation will be required to discover exactly which metrics will prove to be accurately measurableThe Route Discovery procedure utilizes two types of messages, a DSR Route Request (Section 5.1.1) anduseful, though Section 10.3.3 provides several proposals. Ifa DSR Route Reply (Section 5.2.1), to actively search themetrics kept by each node onad hoc network for apath are combined,route to theresult shoulddesired destination. These DSR messages MAY bea characterizationcarried in any type ofthe path that the packet sender canIP packet, through useto organize or adapt its offered load. To implement this scheme, we first define a new typeof extensionheader for DSR than can be piggybacked ontoheaders as described in Section 5: apacketRoute Request is carried inthe same way as the existing DSR headers. This new headera Destination options extension header, and a Route Reply iscalledcarried in a Hop-by-Hop options extension header. A Route Discovery for a destination SHOULD NOT be initiated unless thepath metrics header (written as Measure) and conceptually consists ofinitiating node has a packet in thepath-identifier ofSend Buffer requiring delivery to that destination. A Route Discovery for a given target node MUST NOT be initiated unless permitted by thepath along whichrate-limiting information contained in themetrics are measured,Route Request Table. After each Route Discovery attempt, thetypeinterval between successive Route Discoveries for this target must be doubled, up to a maximum ofthe Measure,MAX_REQUEST_PERIOD. 6.2.1. Originating a Route Request A node initiating a Route Discovery for some target creates andthe metrics themselves encoded ininitializes aTLV format (Section 10.6.2). WheneverDSR Route Request option in some IP packet. This MAY be asender S wishesseparate IP packet, used only tomeasurecarry this Route Request option, or thecharacteristics of a path it is using, it includesnode MAY include theMeasure headerRoute Request option inanysome existing packet itsends along that path, setting the type of the headerneeds torecord. As eachsend to the target nodealong(e.g., thepath forwardsIP packet originated by this node, that caused thepacket, it updatesnode to attempt Route Discovery for thevariables insidedestination address of theMeasurepacket). The Route Request option MUST be included in a Destination Options extension headerwithin themetrics it has measured locally. Whenpacket. To initialize theheader reachesRoute Request option, thefinal destination D, D setsnode performs thetypefollowing sequence of steps: - The Option Type in theMeasure headeroption MUST be set toreturn and piggybackstheheader into any packet headed back to S. Sincevalue ???. - The Option Length field in thepath metrics header includesoption MUST be set to thepath-identifiervalue 6. The total size of thepath along which it was measured, S can include the data into its route cache for future use, and can treatRoute Request option when initiated is 8 octets; thereceipt ofOption Length field excludes thepath metrics header as a positive acknowledgment thatsize of thepath-state between SOption Type andD forOption Length fields themselves. - The Identification field in thegiven path-identifier is correctlyoption MUST be setup. This could lead Stocease including source routes in the packets it sends along the path, as described in Section 10.3.1. If we finda new value, different from thatit is valuable to immediately provide S with the path metrics of every discovered route, we could alterused for other RouteDiscovery slightly to generateRequests recently initiated by thisinformation. Currently, if an intermediatenode. For example, each nodehas a cached route that it can use to answerMAY maintain aRoute Request, it generatessingle counter value for generating aRoute Reply itself. Instead, we could require it to place its proposed route on thenew Identification value for each Route Request(turningitfrom a flood-fill broadcast into a unicast packet) and sendinitiates. - The Target Address field in thepacketoption MUST be set to thedestination so it will measureIP address that is themetricstarget ofthe complete path.this Route Discovery. Thedestination will then returnSource Address in themetrics toIP header of this packet MUST be thesource along withnode's own IP address. The Destination Address in theRoute Reply as described above. We have been intending to experiment withIP header of thisalteration topacket MUST be the IP "limited broadcast" address (255.255.255.255). A node MUST maintain in its RouteDiscovery for some time, sinceRequest Table, information about Route Requests that itoffers two benefits, even without path-state metrics. It should decreaseinitiates. When initiating a new Route Request, the node MUST use the information recorded in the Route Request Table entry for thenumbertarget ofbroken routes returned bythat RouteDiscovery since each cached route is tested before being returned,Request, and itshould save us from jeopardizing one data packetMUST update that information in the table entry forevery bad routeuse insomeone's cache. The cost is some extra latency onthe next RouteDiscovery. 10.3.3. Candidate MetricsRequest initiated for this target. Inorder to limit the additional overhead that collecting and distributing path-state metrics will place onparticular: - The Route Request Table entry for a target node records thenetwork, allTime-to-Live (TTL) field used in themetrics must haveIP header of thepropertylast Route Request initiated by this node for that target node. This value allows theamount of space requirednode toexpress the metric does not increase as the numberimplement a variety ofhops onalgorithms for controlling thepath increases. Experimentation will be required to determine which metrics are most accurately measured and most useful, but our initial setspread ofcandidates includes the following: - Interface queue length --- Our previous work [12] has shown that this isits Route Request on each Route Discovery initiated for agood estimator of local congestion. - Ratetarget. As examples, two possible algorithms for this use ofinterface queue draining --- When an interface is backlogged, the rate at which packets leave the queue directly measurestheusable capacity of that interface.TTL field are described in Section 3.3.4. -Quiet time fraction --- When an interface is not backlogged,The Route Request Table entry for a target node records theusable capacitynumber ofthe interface can be estimated by promiscuously listeningconsecutive Route Requests initiated for this target since receiving a valid Route Reply giving a route tothe mediathat target node, andmeasuringthefractionremaining amount of timeduringbefore whichit is not in use (thoughthiswill overestimate the capacity). - Fraction Free Air Time --- The fraction of time our interface wouldnode MAY next attempt at a Route Discovery for that target node. These values MUST beableused tosend a packet. That is,implement an exponential back-off algorithm to limit thefraction of timerate at which this node initiates new Route Discoveries for theinterface does not sense carrier, is not deferring, andsame target address. Until a valid Route Reply isnot backed off. Current experiments showreceived for thisis an excellent predictor of congestion and available capacity. - Forwarding latency and variation --- This can be measured astarget node address, thetimetimeout betweenwhenconsecutive Route Discovery initiations for this target node SHOULD increase by doubling the timeout value on each new initiation. The behavior of a node processing a packet containing both a Routing Header and a Route Request Destination option isreceivedunspecified. Packets SHOULD NOT contain both a Routing Header andwhen ita Route Request Destination option. [This isacknowledged by the next hop. - Unidirectional links --- Paths containing unidirectional links are usable, but undesirable as they increase the overhead ofnot exactly true: A RouteMaintenance. - Packet loss rate --- Signal quality information fromRequest option appearing in theinterface itself, orsecond Destination Options header that IPv6 allows after thefrequency of hop-by-hop retransmission, can be used to estimateRouting Header would probably do-what-you-mean, though we have not triple-checked it yet. Namely, it would allow theloss rate of each link. - Likelihood of path breakage --- Intermediate nodes may know aheadoriginator oftime that they intenda route discovery toshutdown or move such that paths through them will no longer work. These metrics all haveunicast theproperty that they canrequest to some other node, where it would beexpressed in a single value that each node can measure locally. As a packet withreleased and begin the flood fill. We call this a Route Request Blossom since the unicast portion of the pathmetrics header passes throughlooks like anode,stem on themetrics inblossoming flood-fill of theheader canrequest.] Packets containing a Route Request Destination option SHOULD NOT beupdated to reflectretransmitted, SHOULD NOT request an explicit DSR Acknowledgment by setting thenode's metrics usingR bit, SHOULD NOT expect acombination function like minimum, maximum, sum, or weighted average that produces another single value to replace the one already in the header. This updating willpassive acknowledgment, and SHOULD NOT bedone at the last possible moment before the packet is forwarded,placed inorder to assure the packet hasthemost current metrics on it when it leaves. 10.4. Flow-State Creation, Use, and MaintenanceRetransmission Buffer. Theflow-state portionrepeated transmission of packets containing a Route Request Destination option is controlled solely by theprotocol enableslogic described in this section. 6.2.2. Processing asender to obtain promises from all nodes alongReceived Route Request Option When apath tonode receives adestination thatpacket containing acertain set of resources are available alongRoute Request option, thepath, and thatnode MUST process theintermediate nodes are committedoption according tomaking these resources available fortheparticular flow. This allowsfollowing sequence of steps: - If the Target Address field in the Route Request matches this node's own IP address, then the node SHOULD return asenderRoute Reply toobtain better-than-best-effort Qualitythe initiator ofService for a flow by obtaining promises fromthis Route Request (the Source Address in theintermediate nodes to reserveIP header of theresources needed to provide that QoS. Unlike prior QoS workpacket), as described inwired networks, atSection 6.2.4. The source route for thispoint we cannot formally characterize or bound exactly what typereply is the sequence ofserviceshops initiator, Address[1], Address[2], ..., Address[n], target where initiator is theflow-state protocol will be able to offer. The goaladdress of the initiator of this Route Request, each Address[i] isto provide CBR and TCP streams withan address from theability to specify and obtain a minimum bandwidthRoute Request, anddelay/jitter bound. If the environment is particularly harsh, it is possible that only best-effort service will be offerable. Ittarget isthis intuition that leads us tothesystemtarget ofpromises and notifications. Experimentally, we hope to determine how stable and effective this system will bethe Route Request (the Target Address field ina multi-hop ad hoc network environment. 10.4.1. Requesting Promises along Existing Paths Similar totheuse ofRoute Request). The node MUST then continue processing thepath metrics header, atpacket normally, including anytime a promise can be requestedfollowing options orchanged along any path an originator is currently using. Once an originatingextension headers in the packet. The nodehas created a path-identifier for a route throughMUST NOT retransmit thenetwork,Route Request to propagate itcan request a promise of network resources along that route by first generating a new flow-identifiertoidentifyother nodes. Do not process thepromise. The originator then fills out a flow-request header (written as Flow Request)Route Request option further. - Else, the node MUST examine the route recorded in the Route Request option (the IP Source Address field andinserts it into any packet sent along that path. Figure 3 showstheconceptual layoutsequence ofa Flow Request, which containsAddress[i] fields) to determine if this node's own IP address already appears in this list of addresses. If so, thenew path-identifier assigned bynode MUST discard theoriginator,entire packet carrying theflow-identifier ofRoute Request option. - Else, thepromise that this request supersedes (if any),node MUST search its Route Request Table for an entry for therequested lifetimeinitiator of this Route Request (the IP Source Address field). If such an entry is found in thepromise, andtable, theQoS parameters that describenode MUST search therequested promise itself. Section 10.6.3 providescache of Identification values of recently received Route Requests in that table entry, to determine if an entry is present in thedetailed packet format. The use ofcache matching theminimumIdentification value andrequested fields for the QoS parameters differs depending on whether the Flow Requesttarget node address in this Route Request. If such an (Identification, target address) entry ispiggybacked on afound in this cache in this entry in the Route Requestor not, as described below. When a Flow Request piggybacked on a unicast packet is received by a node,Table, then the nodeperformsMUST discard thefollowing steps:entire packet carrying the Route Request option. - Else, this node SHOULD repropagate this Route Request. If it does so, the nodeisMUST do so according to thedestinationfollowing sequence ofthe packet, it converts the Flowsteps: * Add an entry for this Route Requestintoin its cache of (Identification, target address) values of recently received Route Requests. * Create aMeasure with type returncopy of this entire packet andusesperform thecurrent values infollowing steps on thedesired fieldscopy of theFlow Requestpacket. * Append this node's own IP address topopulatethefieldslist ofthe Measure. It then piggybacks the Measure onto any packet being returned to the originator. - Else if the intermediate node has available enough resources to meet the minimum requested promiseAddress[i] values in theFlowRoute Request,it: * Sets asideand increase themaximumvalue ofits available resources andthedesired resources. The set aside resources are heldOption Length field ina tentative promise pool until the promise is confirmed, or a relatively short timeout expires. * Nodes can recycle resources from listed old flow-id +--------------------------------------+ | flow-id | old flow-id | +--------------------------------------+ | lifetime | +--------------------------------------+ | capacity | min | desired | | latency | min | desired | |variation | min | desired | | loss | min | desired | +--------------------------------------+ Figure 3: Conceptual layout oftheFlowRoute Requestheader.by 4 (the size of an IP address). *UpdatesThis node SHOULD search its own Route Cache for a route (from itself, as if it were thedesired fieldssource ofthe Flow Requesta packet) toreflecttheresources set aside (theretarget of this Route Request. If such a route isquestionable valuefound ina down streamits Route Cache, then this nodeallocating more resourcesSHOULD follow the procedure outlined in Section 6.2.3 to return aflow than an upstream node can currently handle). * Forward the packet and piggybacked Flow Request"cached Route Reply" to thenext node oninitiator of this Route Request, if permitted by thepath. - Else,restrictions specified there. * If the node does nothave enough resources to meet the minimum requested promise, so it sends the originatorreturn a cached RouteError piggybacked with a Measure reflecting the minimum of the current valuesReply, then this node SHOULD link-layer re-broadcast this copy of thedesired fields inpacket, with a short jitter delay before theFlow Requestbroadcast is sent. The jitter period SHOULD be chosen as a random period, uniformly distributed between 0 and BROADCAST_JITTER. 6.2.3. Generating Route Replies using theavailable resources. The type fieldRoute Cache As described in Section 3.3.2, it isset to refused. Suchpossible for aMeasure enables the originatornode processing a received Route Request tolearn three things: that its requested cannot be satisfied alongavoid propagating thegiven path;Route Request further toward theidentitytarget of thebottleneck node; and the available resources up to and through the bottleneck node. When the originatingRequest, if this nodereceives a Measure header of type return for a flow on which ithasan outstanding Flow Request, it accepts the promised level of service by changing the type of the Measure header to confirm and piggybacking the header on any packet going along the flow. This informs the intermediate nodes to move the set aside resources from the tentative promise pool to the allocated pool, and enables upstream nodes to free any set aside resourcesinexcess of the capacity ofits Route Cache abottleneck downstream node. The use of the old flow-id to recycle resources is important for two reasons. First, it enables an originatorroute from itself toattemptthis target. Such a Route Reply generated by a node from its own cached route toincrease or decreasetheamounttarget of acurrent promise without losing the resources it already has promised. Second, both packet lossRoute Request is called a "cached Route Reply", and this mechanism can greatly reduce theexpanding ring searchoverall overhead of Route Discoverymay result in several Flow Requests being sent for the same flow. If subsequent Flow Requests for a flow were not able to notify intermediate nodes that they can reuse resources set aside while processing earlier Flow Requests,on the networkcould quickly reach a state where admissible flows are being needlessly rejected. 10.4.2. Requesting Promises as Partby reducing the flood of RouteDiscoveryRequests. Thescheme for requesting promisesgeneral processing of a received Route Request is described inthe previousSection 6.2.2; this sectionhasspecifies theadvantageadditional requirements thatit enables an originator to request or updateMUST be met before apromisecached Route Reply may be generated and returned and specifies the procedure for returning such aflow along any route currently in its route cache, regardless of how it obtained the route. For the common case in whichcached Route Reply. While processing a received Route Request, for a nodewishestoobtainpossibly return aresource promise forcached Route Reply, it MUST have in its Route Cache anew flowroute from itself toa previously unknown destination, we can integrate the flow request withthe target of this RouteDiscoveryRequest. However, before generating a cached Route Reply forthe destination. Integrating the flow request withthis RouteDiscovery enables us to avoidRequest, theinefficiency of discovering routesnode MUST verify thatwill not be usable bythere are no duplicate addresses listed in the route accumulated in theflow due to insufficient resources. The integration of flow requests withRouteDiscovery also allows us to avoid a common pitfall of QoS schemes that layer a reservation signaling protocol on top of a unicast routing algorithm --- schemes without tight integration will refuse admissible flows wheneverRequest together with theunicast routing algorithm directsroute from this node's Route Cache. Specifically, there MUST be no duplicates among therequest packets into a congested areafollowing addresses: - The IP Source Address of thenetwork, unlesspacket containing thesignaling protocol also provides a method to backtrackRoute Request, - The Address[i] fields in therequestRoute Request, and - The nodes listed in the routearoundobtained from this node's Route Cache, excluding thecongested area. Utilizingaddress of this node itself (this node itself is thesame mechanisms currently usedcommon point between the route accumulated in the RouteDiscovery, we can avoidRequest and theneed for backtracking. We callroute obtained from thecombination of flow requests with Route Discovery QoS-guidedRouteDiscovery, which originating nodes can invoke simply by piggybacking a Flow Request onCache). If any duplicates exist among these addresses, then the node MUST NOT send a cached RouteRequest. EachReply. The nodereceivingSHOULD continue to process theFlowRoute Requestuses the same algorithmas described in Section10.4.1, with two exceptions: - Nodes silently discard6.2.2. If the Route Requestif they can notand the route from the Route Cache meetminimum requirementsthe restriction above, then the node SHOULD construct and return a cached Route Reply as follows: -UnlessThe source route for this reply is the sequence of hops initiator, Address[1], Address[2], ..., Address[n], c-route where initiator is the address of the initiator of this RouteRequest indicates that replyingRequest, each Address[i] is an address fromcachethe Route Request, and c-route isforbidden, nodes with athe sequence of hops in the source route to this target node, obtained from the node's Route Cache. In appending this cached route todestination unicastthe source route for the reply, the address of this node itself MUST be excluded, since it is already listed as Address[n]. - Send a Route Reply to the initiator of the Route Request, using the procedure defined in Section 6.2.4. The initiator of the Route Requestalongis indicated in thecached route.Source Address field in the packet's IP header. 6.2.4. Originating a Route Reply A noderequiring a route with a QoS promise uses the following algorithm. First, it sendsoriginates a RouteRequest that permits intermediate nodesReply in order to replyfrom cache. If the network is uncongested, this should frequentlyto a received andquickly succeedprocessed Route Request, according to the procedures described inreturning both aSections 6.2.2 and 6.2.3. The Route Replyand a Measure describing the available QoS along the discovered path. If after a timeout, the originating node has not receivedis returned in a DSR RouteReply, it begins anotherReply option (Section 5.2.1). The RouteDiscovery, this time forbidding replies from cache, which will force an exploration of all feasible pathsReply option MAY be returned to thedestination. This scheme does risk an implosion of unicast Requests at the targetinitiator of the RouteDiscovery (e.g., if target isRequest in apopular serverseparate IP packet, used only towhich many nodes have cached routes). At the cost of additional complexity and soft-state,carry this Route Reply option, or itwouldMAY bepossibleincluded in any other IP packet being sent toadd hold-downs at the nodes surrounding the target so that only the first few Requests are forwarded towards the target. 10.4.3. Providing Notifications of Changing Path Metrics When a node detects that it must breakthis address. The Route Reply option MUST be included in apromise, it must notifyHop-by-Hop Options extension header in thenodepacket returned towhich it made that promise. It is an open question howthenow reduced resources should be distributed amonginitiator. To initialize theflows. We currently pickRoute Reply option, theminimum set of promises to break that leavenode performs theother promises unchanged. The difficulty in providing notificationfollowing sequence ofa changed path metric is getting this information back tosteps: - The Option Type in thesource. When promise mustoption MUST bebroken at a node B, it sends a Measureset to theoriginator indicating what resources are now available.value ???. - Theuse of Measure headersOption Length field in the option MUST be set todeterminethecurrently available resources along a pathvalue (n * 4) + 1, where n ismore problematic, however, as for every Measure sent bytheoriginator,number of addresses in thedestination must send a response containingsource route being returned (excluding themeasured metrics. IfRoute Discovery initiator node's address). - The Last Hop External (L) bit in thetraffic is TCP,option MUST be initialized to 0. - The Reserved field in theoverheadoption MUST be initialized to 0. - The sequence of addresses of theresponsessource route arelow, as they can be piggybacked on the ACK stream. For one-way CBR traffic though, introducingcopied into theoverheadAddress[i] fields ofa reverse stream to carrythechanging metrics couldoption. Address[1] MUST besevere. Ifset to theoverheadfirst hop of theresponses becomes a problem, it may be possible to implement a enhanced piggyback mechanism. The approach is based onroute after thefact that although no work has been exerted to create hop-by-hop routing information at each node, chances are good that each node can determine a next-hop for packets headedinitiator of the Route Discovery, Address[n] MUST be set toany known destination by simply examining its route cache. By piggybackingtheMeasure header for onelast hoponto any packet that is headed to that next-hop, we can cheaply create a reverse flowofinformation that will eventually reachtheoriginatorsource route (the address of theMeasure. Each node who receives a Measure with a typetarget node), and each other Address[i] MUST be set to the next address in sequence in the source route being returned. The Destination Address field in the IP header ofreturn simply piggybackstheMeasure for one-hop on packets that seem to be flowingpacket carrying theright direction backRoute Reply option MUST be set to thesource. To insureaddress of thetimelinessinitiator of theinformation, each MeasureRoute Discovery (i.e., for a Route Reply being returned in response toan originator could include a deadline by whichsome Route Request, theinformation is supposed to reachIP Source Address of theoriginator. If it appears that hop-by-hop propagation will result in missingRoute Request). After creating and initializing thedeadline,DSR Route Reply option and theMeasure can be unicast as a first-classIP packettocontaining it, send theoriginator. 10.5. Expiration of State from Intermediate Nodes Since thereRoute Reply, jittered by T milliseconds, where T isno guarantee that either the source or destination ofapacket flow will be ableuniformly distributed random number between 0 and BROADCAST_JITTER. If sending a Route Reply tocommunicate with all ofthenodes that carriedoriginator of theflow when they wish to terminateRoute Request requires performing a Route Discovery, theflow, there mustRoute Reply hop-by-hop option MUST betime-based expiration mechanism by which intermediate nodes can purgepiggybacked on thepath-state and flow-state from their caches and reclaimpacket that contains theresources set aside to maintain it. However, if intermediate nodes were to purgeRoute Request. This piggybacking prevents a loop wherein thestatetarget ofan active flow,theintermediate nodes would find themselves with packets to forward that do not contain a source route, but only contain a flow-identifier that references state they no longer hold. Since intermediate nodes do not necessarily knownew Route Request (which was itself thetiming with whichoriginator of thesender originates packets, an inactivity timer alone would have to be set very conservativelyoriginal Route Request) must do another Route Request in order toprevent purging the path-state of low bit-rate connections. To solvereturn its Route Reply. If sending theexpiration problem, we take advantage ofRoute Reply to therelatively ``soft'' natureoriginator of thepath-state and flow-state. When the state is created, the source node specifies a time after which it should be discarded (This time will typically be on the order ofRoute Request does not require performing Route Discovery, ahundred seconds). The sourcenodecan thereby estimate how often it must refresh the state, for example, by sending packets that containSHOULD send afull source route on them. Should the state have somehow expiredunicast Route Reply in response to every received Route Request targeted atan intermediate node when a packet labeled withit. 6.2.5. Processing aflow or path identifier arrives, the intermediate node can returnRoute Reply Option Upon receiving a RouteError to the sourceReply, a nodespecifying ``missing state information'' asSHOULD extract thecause ofsource route from theErrorRoute Reply andelicit the sender to refresh the missing state. Since all path-stateadd this routing informationis guaranteedtohave expiredits Route Cache. The source route from thenetwork after a bounded amountRoute Reply is the sequence oftime, nodes can safely and unambiguously reuse path- and flow-identifiers after that period. 10.6. Packet Formats 10.6.1. Identifier Option Path and flow identifiers are carried as an option insidehops initiator, Address[1], Address[2], ..., Address[n] where initiator is theHop-by-Hop options header. This option MAY NOT appear more than oncevalue of the Destination Address field ina single Hop-by-Hop Options header. 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 | Option Length | Path-ID | Flow-ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. A node that does not understand this option should ignore this option and continue processingthepacket, andIP header of theOption Data does not change en-routepacket carrying the Route Reply (thetop three bits are 000). Option Length 8-bit unsigned integer. Lengthaddress of theoption, in octets, excludinginitiator of theOption TypeRoute Discovery), andOption Length fields. Path-ID The identifier assignedeach Address[i] is a node through which the source route passes, in turn, on the route tothis path bythe 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 nodelistedMUST flag the hop Address[n] in its Route Cache as External. Each packet in theIP Source Address (Section 10.2). Flow-ID The identifier assigned bySend Buffer SHOULD then be checked to see whether the information in the Route Reply and now in the Route Cache allows it to be sent immediately. 6.3. Route Maintenance Processing Route Maintenance is the mechanism by which nodelisted asS is able to detect, while using a source route to D, if theIP Source Addressnetwork topology has changed such that it can no longer use its route to D because aparticular flowlink along thepath identified byroute 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. Route Maintenance for this route is used only when S is actually sending packets to D. When forwarding a packet, a node MUST attempt to receive an acknowledgement for thePath-ID.packet from the next hop. Ifthis portionno acknowledgement is0,received, theoption names a path, but notnode SHOULD return aparticular flow. Discussion: This encoding ofRoute Error to thepath and flow identifiers will cost 8 bytesIP Source Address ofadditional header overheadthe packet, as described in Section 6.3.3 6.3.1. Using Network-Layer Acknowledgments When a node retransmits adatapacketwithor has no otherextensions or options (4 bytes for the Hop-by-Hop options header, and 4 bytes for the identifier option). A more compact encoding would beway todefine that, inensure successful delivery of aDSR network, an IP destination address withpacket to the next hop, it SHOULD request afirst octet of 127 actually encodesnetwork-layer acknowledgement by placing a non-zero value in thepath and flow identifiers 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0 1 1 1 1 1 1 1| reserved | Path-ID | Flow-ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ The DSR moduleIdentification field of thefinal destination would replaceDSR Routing header. Such a value MUST be unique over all packets delivered to theIP destination addresssame next hop which are either unacknowledged or recently acknowledged. A node receiving a DSR Routing header withits actuala non-zero valuebefore passingin thepacket upIdentification field MUST send an acknowledgement to thestack for further processing. This encoding hasprevious hop by performing theadvantage that it requires no additional overhead infollowing sequence of steps: - Create adata packet. The disadvantage is that if thepacketwas somehow received by a DSR-unaware node without first being processed by a DSR gateway node [4],and set theDSR-unaware node will either dropIP Source Address to thepacket or will attemptaddress of this node, the IP Destination Address toreceive it locally (sincetheIP destinationaddressbelongsof the previous hop, and the IP Protocol field to theloopback subnet). 10.6.2. Path-Metrics Option Path-metrics are carried as an option insideprotocol number reserved for Hop-by-Hop Options extension headers. - Set the Hop-by-Hopoptions header. 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 | Option Length | Path-ID | Flow-ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Metrics... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. A node that does not understand this option should ignore this option and continue processingOptions extension header's Next Header field to be thepacket, and"No Next Header" value. Set theOption Data does change en-route (the top three bits are 001). Option Length 8-bit unsigned integer.Header Extension Lengthofto theoption, in octets, excludingsize of a DSR Acknowledgement Option. - Set the DSR Acknowledgement option's Option Typeand Option Length fields. Path-ID and Flow-ID The path identifier of the path that the metrics correspond to. Iffield to thePath-MetricsOption Typeequals Measure, then the Path-IDreserved for DSR Acknowledgements, andFlow-ID fields MUST equal those in any Identifier Option carried intheHop-by-Hop Options Header. Type One of Measure Each node processingOption Length field to 10. - Copy theoption should updateIdentification field from themetrics to reflectRouting Header into theconditions at that node. Reply The metricsIdentification field inthis option SHOULD NOT be modified by any intermediate node. They representthemetrics measured alongDSR Acknowledgement Option. Set theidentified path. Confirm The metricsACK Source Address field inthisthe optionMUST NOTto bemodified by any intermediate node. They represent a confirmation bythesender that will transmit traffic conformingIP Source Address and the ACK Destination Address field to thelisted Quality of Service metrics alongIP Destination Address. - Send theidentified flow. Metrics The individual path-metrics, encodedpacket as described in Section10.6.4. Unknown metrics SHOULD be ignored. If a single value is provide for the metric, it MUST be interpreted as the metrics value.6.1.1. 6.3.2. Using Link Layer Acknowledgments Iftwo valuesexplicit failure notifications are providedforby themetric, they MUSTlink layer, then all packets are assumed to beinterpreted as the range of values takencorrectly received by themetric (low value first). Itnext hop, and a Route Error isundefined for there to be more than two values forsent only when an explicit failure notification is made from themetric. 10.6.3. Flow Request Option Flow-requests are carried aslink layer. Nodes receiving a packet without a Routing Header do not need to send anoption insideexplicit Acknowledgment to theHop-by-Hop options header. They allowpacket's originator, since the link layer will notify the originator if the packet was not received properly. 6.3.3. Originating asenderRoute Error When a node is unable torequest that intermediate nodes reserve sufficient resources forverify successful delivery of aflowpacket toprovide that flow withtheQoS characteristics described by the metrics. 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 | Option Length | Lifetime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | old | old | new | new | | Path-ID | Flow-ID | Path-ID | Flow-ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Metrics ... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Option Type ???. Anext hop after a maximum number of retransmission attempts, a nodethat does not understand this option should ignore thisSHOULD send a Route Error to the IP Source Address of the packet. When sending a Route Error for a packet containing either a DSR Route Error optionand continue processingor a DSR Acknowledgement option, a node SHOULD add these options to it's Route Error, subject to some limit on lifetime. Specifically, we define thepacket, and"salvage count" of an option to be theOption Data does change en-route (the top three bits are 001). Option Length 8-bit unsigned integer. Lengthsum of one plus theoption,salvage count recorded inoctets, excludingtheOption Type and Option Length fields. old Path-ID and old Flow-ID The flow identifier provide inDSR Routing header plus the sum of the salvage counts of any DSR Route Errors preceding that option. A node transmitting aprevious request which this request supersedes. new Path-IDRoute Error MUST follow the following steps: - Create a packet andnew Flow-ID The flow identifier that will be used with to identifyset thepackets that should receiveIP Source Address to theQoS described byaddress of this node, theincluded metrics. Metrics The metrics that characterizeIP Destination Address to thedesired QoS, encoded as described in Section 10.6.4. Unknown metrics SHOULD be ignored. If a rangeaddress IP Source Address ofvalues are provided for a metric, they MUST be interpreted astheminimum acceptable value andpacket experiencing thedesired value. 10.6.4. Encoding Path-Metrics Each path-metric is encoded inerror. - Insert amodified Type-Length-Value form as 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type |R| Length | Data... +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Type The type of metric R bit If 0,Hop-by-Hop Options Header into thedata ispacket. - Add alist of discrete valuesRoute Error Option, setting themetric can or did take. If 1,Error Type to NODE_UNREACHABLE, the Reserved bits to 0, thedata represent a range of valuesSalvage value to one plus themetric can or did take. If a single metricSalvage valueis supplied,from therange is assumed to be 0 <= metric <= value. If two metric values are supplied,DSR Routing header, and therange is assumedUnreachable Node Address tobe value1 <= metric <= value2. Option Length 8-bit unsigned integer. Lengththe address of themetric, in octets, excludingnext hop. Set theTypeError Source Address to the IP Source Address andLength fields. The currently defined metric types follow: Padding Type: 0the Error Destination to the IP Destination Address. - Thepadding metric is specialnode MAY append each DSR Route Error and DSR Acknowledgement, inthatorder, from the packet experiencing the error, though itcontains no length field and no data. Available Capacity Type: 1 Data encodedMUST exclude options with salvage counts greater than 15. - Send the packet as0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Mantissa | Shift | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ wheredescribed 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 routes from thevalueRoute Cache that have a link from the Route Error Source Address to the Unreachable Node Address. - If the Hop-by-Hop option following the Route Error is(Mantissa << Shift) bits per second. Delaya DSR Acknowledgement or DSR Route Error option sent by this node (that is, with Acknowledgement or Error Source Address equal to this node's address), copy the Hop-by-Hop options following the current Route Error into a new packet with IP Source Address equal to this node's own IP address andDelay Variation Data encodedIP Destination Address equal to the Acknowledgement or Error Destination Address. Transmit this packet as0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Delay | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Type: 2 - Delay The value is Delay milliseconds. Type: 3 - Delay Variation The value isdescribed in Section 6.1.1, with thestandard deviation of Delay,salvage count inmilliseconds. Link Bidirectionality Type: 16 - Link Bidirectionality Data encoded as 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | # Uni-links | #Explicit ACK | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ where # Uni-links isthenumberDSR Routing header set to the Salvage value ofuni-directional links onthepath, and # Explicit ACKRoute Error. 6.3.5. Salvaging a Packet When a node is unable to verify successful delivery of a packet to the next hop after a maximum number ofhops which require explicit acknowledgments. Packet Loss Rate Data encoded as 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | # Packets Lost | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ whereretransmission attempts and has transmitted a Route Error to theloss rate is (# Packets Lost / 2 ** 16). Type: 17 - Path Packet Loss Rate The value issender, it MAY attempt to salvage theexpectedpacketloss rateby examining its route cache. If the node can find a route to the packet's IP Destination Address in its own Route Cache, then this node replaces the packet's Routing header with a new Routing Header in the same way as described in Section 6.1.2, except that Address[1] MUST be set to the address of this node and theentire path Type: 18 - Worst Loss Rate The value isSalvage field MUST be set to 1 plus theexpected packet loss ratevalue of thesingle worst linkSalvage field in thepath. 11.Routing Header that caused the error. 7. Constants BROADCAST_JITTER 10 milliseconds MAX_ROUTE_LEN 15 nodesInterface Indexes IF_INDEX_INVALID 0x7F IF_INDEX_MA 0x7E IF_INDEX_ROUTER 0x7DRoute Cache ROUTE_CACHE_TIMEOUT 300 seconds Send Buffer SEND_BUFFER_TIMEOUT 30 seconds Route Request TableMAX_REQUEST_ENTRIES 32REQUEST_TABLE_SIZE 64 nodesMAX_REQUEST_IDS 8REQUEST_TABLE_IDS 16 identifiers MAX_REQUEST_REXMT 16 retransmissions MAX_REQUEST_PERIOD 10 seconds REQUEST_PERIOD 500 millisecondsRING0_REQUEST_TIMEOUTNONPROP_REQUEST_TIMEOUT 30 milliseconds Retransmission Buffer DSR_RXMT_BUFFER_SIZE 50 packets Retransmission Timer DSR_MAXRXTSHIFT 212.8. IANA Considerations This document proposes the use in IPv4 of the Destination Optionsheader andextension header, the Hop-by-Hop Options extension header, and Routing header, which were originally defined forIPv6, in IPv4.IPv6 [7]. The Next Header values indicating thesetwothree extensionheaders thusheader types (60, 0, and 43, respectively) must therefore be reserved within the IPv4 Protocol number space.Furthermore,In addition, the "No Next Header" type value of 69, defined for IPv6, must also be defined for use in IPv4. Other protocols in IPv4 wishing to use these IPv6-style extension headers can also make use of these Protocol number assignments. For use within a Destination Options extension header, this document definesfourone newtypestype of destinationoptions, each ofoption, which must be assigned an Option Type value: -TheDSR Route Request option, described in Section7.1.1 -5.1.1. The top three bits of this Option Type value MUST be 011. For use within a Hop-by-Hop Options extension header, this document defines three new types of hop-by-hop options, each of which must be assigned an Option Type value: - DSR Route Reply option, described in Section7.2.1 -5.2.1. The top three bits of this Option Type value MUST be 000. - DSR Route Error option, described in Section7.2.2 -5.2.2. The top three bits of this Option Type value MUST be 000. - DSR Acknowledgment option, described in Section7.2.3 DSR also requires5.2.3. The top three bits of this Option Type value MUST be 000. For use within a Routing header, this document defines one new type of routingheaderheader, which must be assigned an Routing Typebe allocated for thevalue: - DSRSource RouteRouting Header, defined in Section7.3. In IPv4, we require two new protocol numbers be issued to identify the next header as either an IPv6-style destination option, or an IPv6-style routing header. Other protocols can make use of these protocol numbers as nodes that support them will processes any included destination options or routing headers according to the normal IPv6 semantics. 13.5.3. 9. Security Considerations This document does not specifically address security concerns. This document does assume that all nodes participating in the DSR protocol do so in good faith andwith outwithout malicious intent to corrupt the routing ability of the network. In mission-oriented environments where all the nodes participating in the DSR protocol share a common goal that motivates their participation in the protocol, the communications between the nodes can be encrypted at the physical channel or link layer to prevent attack by outsiders. Appendix A. Location of DSRFunctionsin the ISO Network Reference Model When designing DSR, we had to determine at whatlevellayer within the protocol hierarchy to implementsourcead 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 forthe followingseveral reasons: - Pragmatically, running the DSR protocol at the link layer maximizes the number of mobile nodes that can participate in ad hoc networks. For example, the protocol can route equally well between IPv4[17],[25], IPv6[6],[7], and IPX[7][28] nodes. -Historically,Historically [12, 13], DSR grew from our contemplation of a multi-hopARP protocol [8, 9] andpropagating version of the Internet's Address Resolution Protocol (ARP) [23], as well as from the routing mechanism used in IEEE 802 source routing bridges[15]. ARP [16] is a[22]. These are layer 2protocol.protocols. - Technically, we designed DSR to be simple enough thatthatit could be implemented directly in the firmware inside wireless network interfacecards,cards [12, 13], well below the layer 3 software within a mobile node. We see great potential in this for DSR runningbetween cloudsinside a cloud of mobile nodes around a fixed basestations.station, where DSR would act to transparentlyfill inextend the coveragegaps between base stations.range to these nodes. Mobile nodes that would otherwise be unable to communicate with the base station due to factors such as distance, fading, or local interference sources could then reach the base station through their peers. Ultimately, however, we decided to specify and to implement [20] DSR as a layer 3protocolprotocol, since this is the only layer at which we could realistically support nodes with multiple network interfaces of differenttypes.types forming an ad hoc network. Appendix B. Implementation and Evaluation StatusWe haveThe DSR protocol has been implementedDynamic Source Routing (DSR)under the FreeBSD 2.2.7 operating system running on Intel x86 platforms. FreeBSD is based on a variety of free software, including 4.4 BSD Lite from the University of California, Berkeley. For the environments in which we used it, this implementation is functionally equivalent to the protocol specified in this draft. During the 7 months from August 1998 to February 1999, we designed and implemented a full-scale physical testbed to enable the evaluation of ad hoc network performance in thefield.field, in a actively mobile ad hoc network under realistic communication workloads. The last week of February and the first week of March included demonstrations of this testbed to a number of our sponsors and partners, including Lucent Technologies, Bell Atlantic, and DARPA. A complete description of the testbed is available as a Technical Report[12].[20]. The softwareis currently beingwas ported to FreeBSD3.3. Implementors notes: - Added field to Route Error Acknowledgments3.3, and a preliminary version of Quality of Service (QoS) support was added. A demonstration of this modified version of DSR was presented in July 2000. Those QoS features are not included in this draft, and will be added later in a seprate draft on top of the base protocol specified here. The DSR protocol has been extensively studied using simulation; we have implemented DSR in the ns-2 simulator [5, 19] and conducted evaluations of different caching strategies documented in this draft [9]. Several independant groups have also used DSR as a platform for their own research, or and as a basis of comparison between ad hoc network routing protocols. Acknowledgements The protocol described in this draft has been designed and developed within theCMUMonarch Project, a research project at Rice University and Carnegie Mellon University which is developing adaptive networking protocols and protocol interfaces to allow truly seamless wireless and mobile node networking[10, 19].[14, 6]. Thecurrent membersauthors would like to acknowledge the substantial contributions of Josh Broch in helping to design, simulate, and implement theCMU Monarch Project include: -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- Josh Broch - Yih-Chun Hu - Jorjeta Jetcheva - David B. Johnson - Qifa Ke - David A. Maltzat Carnegie Mellon University. Bob ported our DSR implementation from FreeBSD 2.2.7 into FreeBSD 3.3. References [1]M. Allman, V. Paxson,David F. Bantz andW. Stevens. Tcp congestion control. Internet Request For Comments RFC 2581, April 1999.Frederic J. Bauchot. Wireless LAN design alternatives. IEEE Network, 8(2):43--53, March/April 1994. [2]R.Vaduvur Bharghavan, Alan Demers, Scott Shenker, and Lixia Zhang. MACAW: A media access protocol for wireless 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.[3][4] Scott Bradner. Key words for use in RFCs toIndicate Requirement Levels.indicate requirement levels. RFC 2119, March 1997.[4][5] Josh Broch, David A. Maltz,andDavid B.Johnson. Supporting HierarchyJohnson, Yih-Chun Hu, andHeterogeneous Interfaces in Multi-Hop Wireless Ad Hoc Networks.Jorjeta Jetcheva. A performance comparison of multi-hop wireless ad hoc network routing protocols. In Proceedings of theWorkshopFourth Annual ACM/IEEE International Conference on Mobile Computingheld in conjunction with the International Symposium on Parallel Architectures, Algorithms,andNetworks,Networking, pages370--375, Perth, Australia, June 1999. [5] M. Scott Corson and Joe Macker. Mobile Ad hoc Networking (MANET): Routing Protocol Performance Issues and Evaluation Considerations howpublished = RFC 2501, month = jan, year = 1999.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. InternetProtocol,Protocol version 6 (IPv6)Specification.specification. RFC 2460, December 1998.[7] IPX Router Specification. Novell Part Number 107-000029-001, Document Version 1.30, March 1996.[8] Ralph Droms. Dynamic Host Configuration Protocol. RFC 2131, March 1997. [9] Yih-Chun Hu and David B. Johnson.RoutingCaching strategies inAd Hoc Networkson-demand routing protocols for wireless ad hoc networks. In Proceedings of the Sixth Annual ACM International Conference on Mobile Computing and Networking, August 2000. [10] 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] Per Johansson, Tony Larsson, Nicklas Hedman, Bartosz Mielczarek, and Mikael Degermark. Scenario-based performance analysis of routing protocols for mobile ad-hoc networks. In Proceedings of the Fifth Annual ACM/IEEE International Conference on MobileHosts.Computing and Networking, pages 195--206, August 1999. [12] David B. Johnson. Routing in ad hoc networks of mobile hosts. In Proceedings of the IEEE Workshop on Mobile Computing Systems and Applications, pages 158--163, December 1994.[9][13] 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.[10][14] David B. Johnson and David A.Maltz. ProtocolsMaltz. Protocols for adaptive wireless and mobile networking. IEEE Personal Communications, 3(1):34--42, February 1996. [15] John Jubin and Janet D. Tornow. The DARPA Packet Radio Network Protocols. Proceedings of the IEEE, 75(1):21--32, January 1987. [16] Phil Karn. MACA---A new channel access method for packet radio. In ARRL/CRRL Amateur Radio 9th Computer Networking Conference, pages 134--140, September 1990. [17] Gregory S. Lauer. 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] S.B. Lee, A. Gahng-Seop, X. Zhang, and A.T. Campbell. INSIGNIA: An IP-Based Quality of Service Framework forAdaptive Wireless andMobileNetworking. IEEE Personal Communications, 3(1):34--42, February 1996. [11] Jian LiuAd Hoc Networks. Journal of Parallel and Distributed Computing, 60(4):374--406, April 2000. [19] David A. Maltz, Josh Broch, Jorjeta Jetcheva, andSuresh Singh. Atcp: TcpDavid B. Johnson. The effects of on-demand behavior in routing protocols formobilemulti-hop wireless ad hoc networks.Available from web page??? Personal Communication, JuneIEEE Journal on Selected Areas of Communications, 17(8):1439--1453, August 1999.[12][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 Report99-116,CMU-CS-99-116, School of Computer Science, Carnegie Mellon University, Pittsburgh, Pennsylvania, March 1999.[13] Brian D. Noble, M. Satyanarayanan, Dushyanth Narayanan, Eric J. Tilton, Jason Flinn, and Kevin R. Walker. Agile Application-Aware Adaptation for Mobility.[21] David A. Maltz, Josh Broch, and David B. Johnson. Quantitative lessons from a full-scale multi-hop wireless ad hoc network testbed. In Proceedings of the16th ACM Symposium on Operating System Principles, pages 276--287, St. Malo, France, October 1997. [14] Charles Perkins, editor. IP Mobility Support. RFC 2002, October 1996. [15]IEEE Wireless Communications and Networking Conference, September 2000. [22] Radia Perlman. Interconnections: Bridges and Routers. Addison-Wesley, Reading, Massachusetts, 1992.[16][23] David C. Plummer. An Ethernet address resolution protocol: Or converting network protocol addresses to 48.bit Ethernet addresses for transmission on Ethernet hardware. RFC 826, November 1982.[17][24] J.Postel.B. Postel, editor. Internet Control Message Protocol. RFC 792, September 1981. [25] J. B. Postel, editor. Internet Protocol. RFC 791, September 1981.[18][26] J.Postel.B. Postel, editor. Transmission Control Protocol. RFC 793, September 1981.[19] The CMU Monarch Project. http://www.monarch.cs.cmu.edu/. Computer Science Department, Carnegie Mellon University. [20] J.[27] Joyce K. Reynolds andJ.Jon Postel. AssignedNumbers.numbers. RFC 1700, October 1994.[21] Srinivasan Seshan, Mark Stemm, and Randy H. Katz. Spand: Shared passive network performance discovery. In Proceedings of the USENIX Symposium on Internet Technologies and Systems,See also http://www.iana.org/numbers.html. [28] Paul Turner. NetWare communications processes. NetWare Application Notes, Novell Research, pages135--146, dec 1997. [22] W. Richard Stevens. TCP/IP IIlustrated, The Protocols, volume 1. Addison-Welsley, 1994. [23] Andrew S. Tannenbaum. Computer Networks. Prentice Hall, third edition, 1996. [24] Gary R. Wright and W. Richard Stevens. TCP/IP IIlustrated, The Implementation, volume 2. Addison-Welsley, 1995.25--91, September 1990. Chair's Address The MANET Working Group can be contacted via its current chairs: M. Scott Corson Phone: +1 301 405-6630 Institute for Systems Research Email: corson@isr.umd.edu University of Maryland College Park, MD 20742 USAPhone: +1 301 405-6630 Email: corson@isr.umd.eduJoseph Macker Phone: +1 202 767-2001 Information Technology Division Email: macker@itd.nrl.navy.mil Naval Research Laboratory Washington, DC 20375 USAPhone: +1 202 767-2001 Email: macker@itd.nrl.navy.milAuthors' Addresses Questions about this document can also be directed to the authors:Josh Broch Carnegie MellonDavid B. Johnson Phone: +1 713 348-3063 Rice UniversityElectrical andFax: +1 713 348-5930 ComputerEngineering 5000 Forbes Avenue Pittsburgh, PA 15213-3890Science Department, MS 132 Email: dbj@cs.rice.edu 6100 Main Street Houston, TX 77005-1892 USA David A. Maltz Phone: +1412 268-3056650 688-3128 AON Networks Fax: +1412 268-7196650 688-3119 3045 Park Blvd. Email:broch@cs.cmu.edu David B. Johnsondmaltz@cs.cmu.com Palo Alto, CA 94306 USA Yih-Chun Hu Phone: +1 412 268-3075 Carnegie Mellon University Fax: +1 412 268-5576 Computer Science Department Email: yihchun@cs.cmu.edu 5000 Forbes Avenue Pittsburgh, PA 15213-3891 USA Jorjeta G. Jetcheva Phone: +1 412268-7399268-3053 Carnegie Mellon University Fax: +1 412 268-5576Email: dbj@cs.cmu.edu David A. Maltz Carnegie Mellon UniversityComputer Science Department Email: jorjeta@cs.cmu.edu 5000 Forbes Avenue Pittsburgh, PA 15213-3891 USAPhone: +1 412 268-3621 Fax: +1 412 268-5576 Email: dmaltz@cs.cmu.edu