draft-ietf-manet-dsr-10.txt   rfc4728.txt 
IETF MANET Working Group David B. Johnson, Rice University
INTERNET-DRAFT David A. Maltz, Carnegie Mellon University
19 July 2004 Yih-Chun Hu, Rice University
The Dynamic Source Routing Protocol Network Working Group D. Johnson
for Mobile Ad Hoc Networks (DSR) Request for Comments: 4728 Rice University
Category: Experimental Y. Hu
UIUC
D. Maltz
Microsoft Research
February 2007
<draft-ietf-manet-dsr-10.txt> The Dynamic Source Routing Protocol (DSR)
for Mobile Ad Hoc Networks for IPv4
Status of This Memo Status of This Memo
This document is an Internet-Draft and is subject to all provisions This memo defines an Experimental Protocol for the Internet
of Section 10 of RFC 2026. community. It does not specify an Internet standard of any kind.
Discussion and suggestions for improvement are requested.
Internet-Drafts are working documents of the Internet Engineering Distribution of this memo is unlimited.
Task Force (IETF), its areas, and its working groups. Note
that other groups may also distribute working documents as
Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at
any time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress".
The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt
The list of Internet-Draft Shadow Directories can be accessed at Copyright Notice
http://www.ietf.org/shadow.html.
This Internet-Draft is a submission to the IETF Mobile Ad Hoc Copyright (C) The IETF Trust (2007).
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 Abstract
The Dynamic Source Routing protocol (DSR) is a simple and efficient The Dynamic Source Routing protocol (DSR) is a simple and efficient
routing protocol designed specifically for use in multi-hop wireless routing protocol designed specifically for use in multi-hop wireless
ad hoc networks of mobile nodes. DSR allows the network to be ad hoc networks of mobile nodes. DSR allows the network to be
completely self-organizing and self-configuring, without the need for completely self-organizing and self-configuring, without the need for
any existing network infrastructure or administration. The protocol any existing network infrastructure or administration. The protocol
is composed of the two main mechanisms of "Route Discovery" and is composed of the two main mechanisms of "Route Discovery" and
"Route Maintenance", which work together to allow nodes to discover "Route Maintenance", which work together to allow nodes to discover
and maintain routes to arbitrary destinations in the ad hoc network. and maintain routes to arbitrary destinations in the ad hoc network.
All aspects of the protocol operate entirely on-demand, allowing All aspects of the protocol operate entirely on demand, allowing the
the routing packet overhead of DSR to scale automatically to only routing packet overhead of DSR to scale automatically to only what is
that needed to react to changes in the routes currently in use. The needed to react to changes in the routes currently in use. The
protocol allows multiple routes to any destination and allows each protocol allows multiple routes to any destination and allows each
sender to select and control the routes used in routing its packets, sender to select and control the routes used in routing its packets,
for example for use in load balancing or for increased robustness. for example, for use in load balancing or for increased robustness.
Other advantages of the DSR protocol include easily guaranteed Other advantages of the DSR protocol include easily guaranteed loop-
loop-free routing, operation in networks containing unidirectional free routing, operation in networks containing unidirectional links,
links, use of only "soft state" in routing, and very rapid recovery use of only "soft state" in routing, and very rapid recovery when
when routes in the network change. The DSR protocol is designed routes in the network change. The DSR protocol is designed mainly
mainly for mobile ad hoc networks of up to about two hundred nodes, for mobile ad hoc networks of up to about two hundred nodes and is
and is designed to work well with even very high rates of mobility. designed to work well even with very high rates of mobility. This
This document specifies the operation of the DSR protocol for routing document specifies the operation of the DSR protocol for routing
unicast IPv4 packets. unicast IPv4 packets.
Contents Table of Contents
Status of This Memo i
Abstract ii
1. Introduction 1
2. Assumptions 4
3. DSR Protocol Overview 6
3.1. Basic DSR Route Discovery . . . . . . . . . . . . . . . . 6
3.2. Basic DSR Route Maintenance . . . . . . . . . . . . . . . 9
3.3. Additional Route Discovery Features . . . . . . . . . . . 11
3.3.1. Caching Overheard Routing Information . . . . . . 11
3.3.2. Replying to Route Requests using Cached Routes . 12
3.3.3. Route Request Hop Limits . . . . . . . . . . . . 13
3.4. Additional Route Maintenance Features . . . . . . . . . . 14
3.4.1. Packet Salvaging . . . . . . . . . . . . . . . . 14
3.4.2. Queued Packets Destined over a Broken Link . . . 15
3.4.3. Automatic Route Shortening . . . . . . . . . . . 16
3.4.4. Increased Spreading of Route Error Messages . . . 16
3.5. Optional DSR Flow State Extension . . . . . . . . . . . . 17
3.5.1. Flow Establishment . . . . . . . . . . . . . . . 17
3.5.2. Receiving and Forwarding Establishment Packets . 19
3.5.3. Sending Packets Along Established Flows . . . . . 19
3.5.4. Receiving and Forwarding Packets Sent Along
Established Flows . . . . . . . . . . . . 20
3.5.5. Processing Route Errors . . . . . . . . . . . . . 21
3.5.6. Interaction with Automatic Route Shortening . . . 21
3.5.7. Loop Detection . . . . . . . . . . . . . . . . . 21
3.5.8. Acknowledgement Destination . . . . . . . . . . . 22
3.5.9. Crash Recovery . . . . . . . . . . . . . . . . . 22
3.5.10. Rate Limiting . . . . . . . . . . . . . . . . . . 22
3.5.11. Interaction with Packet Salvaging . . . . . . . . 22
4. Conceptual Data Structures 23
4.1. Route Cache . . . . . . . . . . . . . . . . . . . . . . . 23
4.2. Send Buffer . . . . . . . . . . . . . . . . . . . . . . . 26
4.3. Route Request Table . . . . . . . . . . . . . . . . . . . 27
4.4. Gratuitous Route Reply Table . . . . . . . . . . . . . . 28
4.5. Network Interface Queue and Maintenance Buffer . . . . . 29
4.6. Blacklist . . . . . . . . . . . . . . . . . . . . . . . . 30
5. Additional Conceptual Data Structures for Flow State Extension 31
5.1. Flow Table . . . . . . . . . . . . . . . . . . . . . . . 31
5.2. Automatic Route Shortening Table . . . . . . . . . . . . 32
5.3. Default Flow ID Table . . . . . . . . . . . . . . . . . . 32
6. DSR Options Header Format 34
6.1. Fixed Portion of DSR Options Header . . . . . . . . . . . 35
6.2. Route Request Option . . . . . . . . . . . . . . . . . . 38
6.3. Route Reply Option . . . . . . . . . . . . . . . . . . . 40
6.4. Route Error Option . . . . . . . . . . . . . . . . . . . 42
6.4.1. Node Unreachable Type-Specific Information . . . 44
6.4.2. Flow State Not Supported Type-Specific Information 44
6.4.3. Option Not Supported Type-Specific Information . 44
6.5. Acknowledgement Request Option . . . . . . . . . . . . . 45
6.6. Acknowledgement Option . . . . . . . . . . . . . . . . . 46
6.7. DSR Source Route Option . . . . . . . . . . . . . . . . . 47
6.8. Pad1 Option . . . . . . . . . . . . . . . . . . . . . . . 49
6.9. PadN Option . . . . . . . . . . . . . . . . . . . . . . . 50
7. Additional Header Formats and Options for Flow State Extension 51
7.1. DSR Flow State Header . . . . . . . . . . . . . . . . . . 52
7.2. New Options and Extensions in DSR Options Header . . . . 53
7.2.1. Timeout Option . . . . . . . . . . . . . . . . . 53
7.2.2. Destination and Flow ID Option . . . . . . . . . 54
7.3. New Error Types for Route Error Option . . . . . . . . . 55
7.3.1. Unknown Flow Type-Specific Information . . . . . 55
7.3.2. Default Flow Unknown Type-Specific Information . 56
7.4. New Acknowledgement Request Option Extension . . . . . . 57
7.4.1. Previous Hop Address Extension . . . . . . . . . 57
8. Detailed Operation 58
8.1. General Packet Processing . . . . . . . . . . . . . . . . 58
8.1.1. Originating a Packet . . . . . . . . . . . . . . 58
8.1.2. Adding a DSR Options Header to a Packet . . . . . 58
8.1.3. Adding a DSR Source Route Option to a Packet . . 59
8.1.4. Processing a Received Packet . . . . . . . . . . 60
8.1.5. Processing a Received DSR Source Route Option . . 62
8.1.6. Handling an Unknown DSR Option . . . . . . . . . 64
8.2. Route Discovery Processing . . . . . . . . . . . . . . . 66
8.2.1. Originating a Route Request . . . . . . . . . . . 66
8.2.2. Processing a Received Route Request Option . . . 68
8.2.3. Generating a Route Reply using the Route Cache . 70
8.2.4. Originating a Route Reply . . . . . . . . . . . . 72
8.2.5. Preventing Route Reply Storms . . . . . . . . . . 74
8.2.6. Processing a Received Route Reply Option . . . . 75
8.3. Route Maintenance Processing . . . . . . . . . . . . . . 77
8.3.1. Using Link-Layer Acknowledgements . . . . . . . . 77
8.3.2. Using Passive Acknowledgements . . . . . . . . . 78
8.3.3. Using Network-Layer Acknowledgements . . . . . . 79
8.3.4. Originating a Route Error . . . . . . . . . . . . 82
8.3.5. Processing a Received Route Error Option . . . . 83
8.3.6. Salvaging a Packet . . . . . . . . . . . . . . . 84
8.4. Multiple Network Interface Support . . . . . . . . . . . 86
8.5. IP Fragmentation and Reassembly . . . . . . . . . . . . . 87
8.6. Flow State Processing . . . . . . . . . . . . . . . . . . 88
8.6.1. Originating a Packet . . . . . . . . . . . . . . 88
8.6.2. Inserting a DSR Flow State Header . . . . . . . . 90
8.6.3. Receiving a Packet . . . . . . . . . . . . . . . 90
8.6.4. Forwarding a Packet Using Flow IDs . . . . . . . 95
8.6.5. Promiscuously Receiving a Packet . . . . . . . . 95
8.6.6. Operation where the Layer below DSR Decreases
the IP TTL Non-Uniformly . . . . . . . . . 96
8.6.7. Salvage Interactions with DSR . . . . . . . . . . 96
9. Protocol Constants and Configuration Variables 97
10. IANA Considerations 98
11. Security Considerations 99
Appendix A. Link-MaxLife Cache Description 100
Appendix B. Location of DSR in the ISO Network Reference Model 102
Appendix C. Implementation and Evaluation Status 103
Changes from Previous Version of the Draft 105
Acknowledgements 106
References 107
Chair's Address 111 1. Introduction ....................................................5
2. Assumptions .....................................................7
3. DSR Protocol Overview ...........................................9
3.1. Basic DSR Route Discovery .................................10
3.2. Basic DSR Route Maintenance ...............................12
3.3. Additional Route Discovery Features .......................14
3.3.1. Caching Overheard Routing Information ..............14
3.3.2. Replying to Route Requests Using Cached Routes .....15
3.3.3. Route Request Hop Limits ...........................16
3.4. Additional Route Maintenance Features .....................17
3.4.1. Packet Salvaging ...................................17
3.4.2. Queued Packets Destined over a Broken Link .........18
3.4.3. Automatic Route Shortening .........................19
3.4.4. Increased Spreading of Route Error Messages ........20
3.5. Optional DSR Flow State Extension .........................20
3.5.1. Flow Establishment .................................21
3.5.2. Receiving and Forwarding Establishment Packets .....22
3.5.3. Sending Packets along Established Flows ............22
3.5.4. Receiving and Forwarding Packets Sent along
Established Flows ..................................23
3.5.5. Processing Route Errors ............................24
3.5.6. Interaction with Automatic Route Shortening ........24
3.5.7. Loop Detection .....................................25
3.5.8. Acknowledgement Destination ........................25
3.5.9. Crash Recovery .....................................25
3.5.10. Rate Limiting .....................................25
3.5.11. Interaction with Packet Salvaging .................26
4. Conceptual Data Structures .....................................26
4.1. Route Cache ...............................................26
4.2. Send Buffer ...............................................30
4.3. Route Request Table .......................................30
4.4. Gratuitous Route Reply Table ..............................31
4.5. Network Interface Queue and Maintenance Buffer ............32
4.6. Blacklist .................................................33
5. Additional Conceptual Data Structures for Flow State
Extension ......................................................34
5.1. Flow Table ................................................34
5.2. Automatic Route Shortening Table ..........................35
5.3. Default Flow ID Table .....................................36
6. DSR Options Header Format ......................................36
6.1. Fixed Portion of DSR Options Header .......................37
6.2. Route Request Option ......................................40
6.3. Route Reply Option ........................................42
6.4. Route Error Option ........................................44
6.4.1. Node Unreachable Type-Specific Information .........46
6.4.2. Flow State Not Supported Type-Specific
Information ........................................46
6.4.3. Option Not Supported Type-Specific Information .....46
6.5. Acknowledgement Request Option ............................46
6.6. Acknowledgement Option ....................................47
6.7. DSR Source Route Option ...................................48
6.8. Pad1 Option ...............................................50
6.9. PadN Option ...............................................50
7. Additional Header Formats and Options for Flow State
Extension ......................................................51
7.1. DSR Flow State Header .....................................52
7.2. New Options and Extensions in DSR Options Header ..........52
7.2.1. Timeout Option .....................................52
7.2.2. Destination and Flow ID Option .....................53
7.3. New Error Types for Route Error Option ....................54
7.3.1. Unknown Flow Type-Specific Information .............54
7.3.2. Default Flow Unknown Type-Specific Information .....55
7.4. New Acknowledgement Request Option Extension ..............55
7.4.1. Previous Hop Address Extension .....................55
8. Detailed Operation .............................................56
8.1. General Packet Processing .................................56
8.1.1. Originating a Packet ...............................56
8.1.2. Adding a DSR Options Header to a Packet ............57
8.1.3. Adding a DSR Source Route Option to a Packet .......57
8.1.4. Processing a Received Packet .......................58
8.1.5. Processing a Received DSR Source Route Option ......60
8.1.6. Handling an Unknown DSR Option .....................63
8.2. Route Discovery Processing ................................64
8.2.1. Originating a Route Request ........................65
8.2.2. Processing a Received Route Request Option .........66
8.2.3. Generating a Route Reply Using the Route Cache .....68
8.2.4. Originating a Route Reply ..........................71
8.2.5. Preventing Route Reply Storms ......................72
8.2.6. Processing a Received Route Reply Option ...........74
8.3. Route Maintenance Processing ..............................74
8.3.1. Using Link-Layer Acknowledgements ..................75
8.3.2. Using Passive Acknowledgements .....................76
8.3.3. Using Network-Layer Acknowledgements ...............77
8.3.4. Originating a Route Error ..........................80
8.3.5. Processing a Received Route Error Option ...........81
8.3.6. Salvaging a Packet .................................82
8.4. Multiple Network Interface Support ........................84
8.5. IP Fragmentation and Reassembly ...........................84
8.6. Flow State Processing .....................................85
8.6.1. Originating a Packet ...............................85
8.6.2. Inserting a DSR Flow State Header ..................88
8.6.3. Receiving a Packet .................................88
8.6.4. Forwarding a Packet Using Flow IDs .................93
8.6.5. Promiscuously Receiving a Packet ...................93
8.6.6. Operation Where the Layer below DSR
Decreases the IP TTL ...............................94
8.6.7. Salvage Interactions with DSR ......................94
9. Protocol Constants and Configuration Variables .................95
10. IANA Considerations ...........................................96
11. Security Considerations .......................................96
Appendix A. Link-MaxLife Cache Description ........................97
Appendix B. Location of DSR in the ISO Network Reference Model ....99
Appendix C. Implementation and Evaluation Status .................100
Acknowledgements .................................................101
Normative References .............................................102
Informative References ...........................................102
Authors' Addresses 112 1. Introduction
1. Introduction
The Dynamic Source Routing protocol (DSR) [15, 16] is a simple and The Dynamic Source Routing protocol (DSR) [JOHNSON94, JOHNSON96a] is
efficient routing protocol designed specifically for use in multi-hop a simple and efficient routing protocol designed specifically for use
wireless ad hoc networks of mobile nodes. Using DSR, the network in multi-hop wireless ad hoc networks of mobile nodes. Using DSR,
is completely self-organizing and self-configuring, requiring no the network is completely self-organizing and self-configuring,
existing network infrastructure or administration. Network nodes requiring no existing network infrastructure or administration.
cooperate to forward packets for each other to allow communication Network nodes cooperate to forward packets for each other to allow
over multiple "hops" between nodes not directly within wireless communication over multiple "hops" between nodes not directly within
transmission range of one another. As nodes in the network move wireless transmission range of one another. As nodes in the network
about or join or leave the network, and as wireless transmission move about or join or leave the network, and as wireless transmission
conditions such as sources of interference change, all routing is conditions such as sources of interference change, all routing is
automatically determined and maintained by the DSR routing protocol. automatically determined and maintained by the DSR routing protocol.
Since the number or sequence of intermediate hops needed to reach any Since the number or sequence of intermediate hops needed to reach any
destination may change at any time, the resulting network topology destination may change at any time, the resulting network topology
may be quite rich and rapidly changing. may be quite rich and rapidly changing.
In designing DSR, we sought to create a routing protocol that had In designing DSR, we sought to create a routing protocol that had
very low overhead yet was able to react very quickly to changes in very low overhead yet was able to react very quickly to changes in
the network. The DSR protocol provides highly reactive service in the network. The DSR protocol provides highly reactive service in
order to help ensure successful delivery of data packets in spite of order to help ensure successful delivery of data packets in spite of
node movement or other changes in network conditions. node movement or other changes in network conditions.
The DSR protocol is composed of two main mechanisms that work The DSR protocol is composed of two main mechanisms that work
together to allow the discovery and maintenance of source routes in together to allow the discovery and maintenance of source routes in
the ad hoc network: the ad hoc network:
- Route Discovery is the mechanism by which a node S wishing to - Route Discovery is the mechanism by which a node S wishing to send
send a packet to a destination node D obtains a source route a packet to a destination node D obtains a source route to D.
to D. Route Discovery is used only when S attempts to send a Route Discovery is used only when S attempts to send a packet to D
packet to D and does not already know a route to D. and does not already know a route to D.
- Route Maintenance is the mechanism by which node S is able - Route Maintenance is the mechanism by which node S is able to
to detect, while using a source route to D, if the network detect, while using a source route to D, if the network topology
topology has changed such that it can no longer use its route has changed such that it can no longer use its route to D because
to D because a link along the route no longer works. When Route a link along the route no longer works. When Route Maintenance
Maintenance indicates a source route is broken, S can attempt to indicates a source route is broken, S can attempt to use any other
use any other route it happens to know to D, or can invoke Route route it happens to know to D, or it can invoke Route Discovery
Discovery again to find a new route for subsequent packets to D. again to find a new route for subsequent packets to D. Route
Route Maintenance for this route is used only when S is actually Maintenance for this route is used only when S is actually sending
sending packets to D. packets to D.
In DSR, Route Discovery and Route Maintenance each operate entirely In DSR, Route Discovery and Route Maintenance each operate entirely
"on demand". In particular, unlike other protocols, DSR requires no "on demand". In particular, unlike other protocols, DSR requires no
periodic packets of any kind at any layer within the network. For periodic packets of any kind at any layer within the network. For
example, DSR does not use any periodic routing advertisement, link example, DSR does not use any periodic routing advertisement, link
status sensing, or neighbor detection packets, and does not rely on status sensing, or neighbor detection packets and does not rely on
these functions from any underlying protocols in the network. This these functions from any underlying protocols in the network. This
entirely on-demand behavior and lack of periodic activity allows entirely on-demand behavior and lack of periodic activity allows the
the number of overhead packets caused by DSR to scale all the way number of overhead packets caused by DSR to scale all the way down to
down to zero, when all nodes are approximately stationary with zero, when all nodes are approximately stationary with respect to
respect to each other and all routes needed for current communication each other and all routes needed for current communication have
have already been discovered. As nodes begin to move more or already been discovered. As nodes begin to move more or as
as communication patterns change, the routing packet overhead of communication patterns change, the routing packet overhead of DSR
DSR automatically scales to only that needed to track the routes automatically scales to only what is needed to track the routes
currently in use. Network topology changes not affecting routes currently in use. Network topology changes not affecting routes
currently in use are ignored and do not cause reaction from the currently in use are ignored and do not cause reaction from the
protocol. protocol.
All state maintained by DSR is "soft state" [6], in that the loss All state maintained by DSR is "soft state" [CLARK88], in that the
of any state will not interfere with the correct operation of the loss of any state will not interfere with the correct operation of
protocol; all state is discovered as needed and can easily and the protocol; all state is discovered as needed and can easily and
quickly be rediscovered if needed after a failure without significant quickly be rediscovered if needed after a failure without significant
impact on the protocol. This use of only soft state allows the impact on the protocol. This use of only soft state allows the
routing protocol to be very robust to problems such as dropped or routing protocol to be very robust to problems such as dropped or
delayed routing packets or node failures. In particular, a node in delayed routing packets or node failures. In particular, a node in
DSR that fails and reboots can easily rejoin the network immediately DSR that fails and reboots can easily rejoin the network immediately
after rebooting; if the failed node was involved in forwarding after rebooting; if the failed node was involved in forwarding
packets for other nodes as an intermediate hop along one or more packets for other nodes as an intermediate hop along one or more
routes, it can also resume this forwarding quickly after rebooting, routes, it can also resume this forwarding quickly after rebooting,
with no or minimal interruption to the routing protocol. with no or minimal interruption to the routing protocol.
In response to a single Route Discovery (as well as through routing In response to a single Route Discovery (as well as through routing
information from other packets overheard), a node may learn and information from other packets overheard), a node may learn and cache
cache multiple routes to any destination. This support for multiple multiple routes to any destination. This support for multiple routes
routes allows the reaction to routing changes to be much more rapid, allows the reaction to routing changes to be much more rapid, since a
since a node with multiple routes to a destination can try another node with multiple routes to a destination can try another cached
cached route if the one it has been using should fail. This caching route if the one it has been using should fail. This caching of
of multiple routes also avoids the overhead of needing to perform a multiple routes also avoids the overhead of needing to perform a new
new Route Discovery each time a route in use breaks. The sender of Route Discovery each time a route in use breaks. The sender of a
a packet selects and controls the route used for its own packets, packet selects and controls the route used for its own packets,
which together with support for multiple routes also allows features which, together with support for multiple routes, also allows
such as load balancing to be defined. In addition, all routes used features such as load balancing to be defined. In addition, all
are easily guaranteed to be loop-free, since the sender can avoid routes used are easily guaranteed to be loop-free, since the sender
duplicate hops in the routes selected. can avoid duplicate hops in the routes selected.
The operation of both Route Discovery and Route Maintenance in DSR The operation of both Route Discovery and Route Maintenance in DSR
are designed to allow unidirectional links and asymmetric routes to are designed to allow unidirectional links and asymmetric routes to
be supported. In particular, as noted in Section 2, in wireless be supported. In particular, as noted in Section 2, in wireless
networks, it is possible that a link between two nodes may not networks, it is possible that a link between two nodes may not work
work equally well in both directions, due to differing antenna or equally well in both directions, due to differing transmit power
propagation patterns or sources of interference. levels or sources of interference.
This document specifies the operation of the DSR protocol for It is possible to interface a DSR network with other networks,
routing unicast IPv4 packets in multi-hop wireless ad hoc networks. external to this DSR network. Such external networks may, for
example, be the Internet or may be other ad hoc networks routed with
a routing protocol other than DSR. Such external networks may also
be other DSR networks that are treated as external networks in order
to improve scalability. The complete handling of such external
networks is beyond the scope of this document. However, this
document specifies a minimal set of requirements and features
necessary to allow nodes only implementing this specification to
interoperate correctly with nodes implementing interfaces to such
external networks.
This document specifies the operation of the DSR protocol for routing
unicast IPv4 packets in multi-hop wireless ad hoc networks.
Advanced, optional features, such as Quality of Service (QoS) support Advanced, optional features, such as Quality of Service (QoS) support
and efficient multicast routing, and operation of DSR with IPv6 [7], and efficient multicast routing, and operation of DSR with IPv6
are covered in other documents. The specification of DSR in this [RFC2460], will be covered in other documents. The specification of
document provides a compatible base on which such features can be DSR in this document provides a compatible base on which such
added, either independently or by integration with the DSR operation features can be added, either independently or by integration with
specified here. the DSR operation specified here. As described in Appendix C, the
design of DSR has been extensively studied through detailed
simulations and testbed implementation and demonstration; this
document encourages additional implementation and experimentation
with the protocol.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [4]. document are to be interpreted as described in RFC 2119 [RFC2119].
2. Assumptions 2. Assumptions
The DSR protocol as described here is designed mainly for mobile As described here, the DSR protocol is designed mainly for mobile ad
ad hoc networks of up to about two hundred nodes, and is designed hoc networks of up to about two hundred nodes and is designed to work
to work well with even very high rates of mobility. Other protocol well even with very high rates of mobility. Other protocol features
features and enhancements that may allow DSR to scale to larger and enhancements that may allow DSR to scale to larger networks are
networks are outside the scope of this document. outside the scope of this document.
We assume in this document that all nodes wishing to communicate with We assume in this document that all nodes wishing to communicate with
other nodes within the ad hoc network are willing to participate other nodes within the ad hoc network are willing to participate
fully in the protocols of the network. In particular, each node fully in the protocols of the network. In particular, each node
participating in the ad hoc network SHOULD also be willing to forward participating in the ad hoc network SHOULD also be willing to forward
packets for other nodes in the network. packets for other nodes in the network.
The diameter of an ad hoc network is the minimum number of hops The diameter of an ad hoc network is the minimum number of hops
necessary for a packet to reach from any node located at one extreme necessary for a packet to reach from any node located at one extreme
edge of the ad hoc network to another node located at the opposite edge of the ad hoc network to another node located at the opposite
extreme. We assume that this diameter will often be small (e.g., extreme. We assume that this diameter will often be small (e.g.,
perhaps 5 or 10 hops), but may often be greater than 1. perhaps 5 or 10 hops), but it may often be greater than 1.
Packets may be lost or corrupted in transmission on the wireless Packets may be lost or corrupted in transmission on the wireless
network. We assume that a node receiving a corrupted packet can network. We assume that a node receiving a corrupted packet can
detect the error and discard the packet. detect the error, such as through a standard link-layer checksum or
Cyclic Redundancy Check (CRC), and discard the packet.
Nodes within the ad hoc network MAY move at any time without notice, Nodes within the ad hoc network MAY move at any time without notice
and MAY even move continuously, but we assume that the speed with and MAY even move continuously, but we assume that the speed with
which nodes move is moderate with respect to the packet transmission which nodes move is moderate with respect to the packet transmission
latency and wireless transmission range of the particular underlying latency and wireless transmission range of the particular underlying
network hardware in use. In particular, DSR can support very network hardware in use. In particular, DSR can support very rapid
rapid rates of arbitrary node mobility, but we assume that nodes do rates of arbitrary node mobility, but we assume that nodes do not
not continuously move so rapidly as to make the flooding of every continuously move so rapidly as to make the flooding of every
individual data packet the only possible routing protocol. individual data packet the only possible routing protocol.
A common feature of many network interfaces, including most current A common feature of many network interfaces, including most current
LAN hardware for broadcast media such as wireless, is the ability LAN hardware for broadcast media such as wireless, is the ability to
to operate the network interface in "promiscuous" receive mode. operate the network interface in "promiscuous" receive mode. This
This mode causes the hardware to deliver every received packet to mode causes the hardware to deliver every received packet to the
the network driver software without filtering based on link-layer network driver software without filtering based on link-layer
destination address. Although we do not require this facility, some destination address. Although we do not require this facility, some
of our optimizations can take advantage of its availability. Use of our optimizations can take advantage of its availability. Use of
of promiscuous mode does increase the software overhead on the CPU, promiscuous mode does increase the software overhead on the CPU, but
but we believe that wireless network speeds are more the inherent we believe that wireless network speeds and capacity are more the
limiting factor to performance in current and future systems; we also inherent limiting factors to performance in current and future
believe that portions of the protocol are suitable for implementation systems; we also believe that portions of the protocol are suitable
directly within a programmable network interface unit to avoid this for implementation directly within a programmable network interface
overhead on the CPU [16]. Use of promiscuous mode may also increase unit to avoid this overhead on the CPU [JOHNSON96a]. Use of
the power consumption of the network interface hardware, depending promiscuous mode may also increase the power consumption of the
on the design of the receiver hardware, and in such cases, DSR can network interface hardware, depending on the design of the receiver
easily be used without the optimizations that depend on promiscuous hardware, and in such cases, DSR can easily be used without the
receive mode, or can be programmed to only periodically switch the optimizations that depend on promiscuous receive mode or can be
interface into promiscuous mode. Use of promiscuous receive mode is programmed to only periodically switch the interface into promiscuous
entirely optional. mode. Use of promiscuous receive mode is entirely optional.
Wireless communication ability between any pair of nodes may at Wireless communication ability between any pair of nodes may at times
times not work equally well in both directions, due for example to not work equally well in both directions, due, for example, to
differing antenna or propagation patterns or sources of interference transmit power levels or sources of interference around the two nodes
around the two nodes [1, 20]. That is, wireless communications [BANTZ94, LAUER95]. That is, wireless communications between each
between each pair of nodes will in many cases be able to operate pair of nodes will in many cases be able to operate bidirectionally,
bidirectionally, but at times the wireless link between two nodes but at times the wireless link between two nodes may be only
may be only unidirectional, allowing one node to successfully unidirectional, allowing one node to successfully send packets to the
send packets to the other while no communication is possible other while no communication is possible in the reverse direction.
in the reverse direction. Some MAC protocols, however, such as Some Medium Access Control (MAC) protocols, however, such as MACA
MACA [19], MACAW [2], or IEEE 802.11 [13], limit unicast data [KARN90], MACAW [BHARGHAVAN94], or IEEE 802.11 [IEEE80211], limit
packet transmission to bidirectional links, due to the required unicast data packet transmission to bidirectional links, due to the
bidirectional exchange of RTS and CTS packets in these protocols and required bidirectional exchange of request to send (RTS) and clear to
due to the link-layer acknowledgement feature in IEEE 802.11; when send (CTS) packets in these protocols and to the link-layer
used on top of MAC protocols such as these, DSR can take advantage acknowledgement feature in IEEE 802.11. When used on top of MAC
of additional optimizations, such as the ability to reverse a source protocols such as these, DSR can take advantage of additional
route to obtain a route back to the origin of the original route. optimizations, such as the ability to reverse a source route to
obtain a route back to the origin of the original route.
The IP address used by a node using the DSR protocol MAY be assigned The IP address used by a node using the DSR protocol MAY be assigned
by any mechanism (e.g., static assignment or use of DHCP for dynamic by any mechanism (e.g., static assignment or use of Dynamic Host
assignment [8]), although the method of such assignment is outside Configuration Protocol (DHCP) for dynamic assignment [RFC2131]),
the scope of this specification. although the method of such assignment is outside the scope of this
specification.
A routing protocol such as DSR chooses a next-hop for each packet A routing protocol such as DSR chooses a next-hop for each packet and
and provides the IP address of that next-hop. When the packet provides the IP address of that next-hop. When the packet is
is transmitted, however, the lower-layer protocol often has a transmitted, however, the lower-layer protocol often has a separate,
separate, MAC-layer address for the next-hop node. DSR uses the MAC-layer address for the next-hop node. DSR uses the Address
Address Resolution Protocol (ARP) [30] to translate from next-hop IP Resolution Protocol (ARP) [RFC826] to translate from next-hop IP
addresses to next-hop MAC addresses. In addition, a node MAY add addresses to next-hop MAC addresses. In addition, a node MAY add an
an entry to its ARP cache based on any received packet, when the IP entry to its ARP cache based on any received packet, when the IP
address and MAC address of the transmitting node are available in address and MAC address of the transmitting node are available in the
the packet; for example, the IP address of the transmitting node packet; for example, the IP address of the transmitting node is
is present in a Route Request option (in the Address list being present in a Route Request option (in the Address list being
accumulated) and any packets containing a source route. Adding accumulated) and any packets containing a source route. Adding
entries to the ARP cache in this way avoids the overhead of ARP in entries to the ARP cache in this way avoids the overhead of ARP in
most cases. most cases.
3. DSR Protocol Overview 3. DSR Protocol Overview
This section provides an overview of the operation of the DSR This section provides an overview of the operation of the DSR
protocol. The basic version of DSR uses explicit "source routing", protocol. The basic version of DSR uses explicit "source routing",
in which each data packet sent carries in its header the complete, in which each data packet sent carries in its header the complete,
ordered list of nodes through which the packet will pass. This use ordered list of nodes through which the packet will pass. This use
of explicit source routing allows the sender to select and control of explicit source routing allows the sender to select and control
the routes used for its own packets, supports the use of multiple the routes used for its own packets, supports the use of multiple
routes to any destination (for example, for load balancing), and routes to any destination (for example, for load balancing), and
allows a simple guarantee that the routes used are loop-free; by allows a simple guarantee that the routes used are loop-free. By
including this source route in the header of each data packet, other including this source route in the header of each data packet, other
nodes forwarding or overhearing any of these packets can also easily nodes forwarding or overhearing any of these packets can also easily
cache this routing information for future use. Section 3.1 describes cache this routing information for future use. Section 3.1 describes
this basic operation of Route Discovery, Section 3.2 describes basic this basic operation of Route Discovery, Section 3.2 describes basic
Route Maintenance, and Sections 3.3 and 3.4 describe additional Route Maintenance, and Sections 3.3 and 3.4 describe additional
features of these two parts of DSR's operation. Section 3.5 then features of these two parts of DSR's operation. Section 3.5 then
describes an optional, compatible extension to DSR, known as "flow describes an optional, compatible extension to DSR, known as "flow
state", that allows the routing of most packets without an explicit state", that allows the routing of most packets without an explicit
source route header in the packet, while still preserves the source route header in the packet, while the fundamental properties
fundamental properties of DSR's operation. of DSR's operation are preserved.
3.1. Basic DSR Route Discovery 3.1. Basic DSR Route Discovery
When some source node originates a new packet addressed to some When some source node originates a new packet addressed to some
destination node, the source node places in the header of the packet destination node, the source node places in the header of the packet
a "source route" giving the sequence of hops that the packet is to a "source route" giving the sequence of hops that the packet is to
follow on its way to the destination. Normally, the sender will follow on its way to the destination. Normally, the sender will
obtain a suitable source route by searching its "Route Cache" of obtain a suitable source route by searching its "Route Cache" of
routes previously learned; if no route is found in its cache, it will routes previously learned; if no route is found in its cache, it will
initiate the Route Discovery protocol to dynamically find a new route initiate the Route Discovery protocol to dynamically find a new route
to this destination node. In this case, we call the source node to this destination node. In this case, we call the source node the
the "initiator" and the destination node the "target" of the Route "initiator" and the destination node the "target" of the Route
Discovery. Discovery.
For example, suppose a node A is attempting to discover a route to For example, suppose a node A is attempting to discover a route to
node E. The Route Discovery initiated by node A in this example node E. The Route Discovery initiated by node A in this example
would proceed as follows: would proceed as follows:
^ "A" ^ "A,B" ^ "A,B,C" ^ "A,B,C,D" ^ "A" ^ "A,B" ^ "A,B,C" ^ "A,B,C,D"
| id=2 | id=2 | id=2 | id=2 | id=2 | id=2 | id=2 | id=2
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| A |---->| B |---->| C |---->| D |---->| E | | A |---->| B |---->| C |---->| D |---->| E |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| | | | | | | |
v v v v v v v v
To initiate the Route Discovery, node A transmits a "Route To initiate the Route Discovery, node A transmits a "Route Request"
Request" as a single local broadcast packet, which is received by as a single local broadcast packet, which is received by
(approximately) all nodes currently within wireless transmission (approximately) all nodes currently within wireless transmission
range of A, including node B in this example. Each Route Request range of A, including node B in this example. Each Route Request
identifies the initiator and target of the Route Discovery, and identifies the initiator and target of the Route Discovery, and also
also contains a unique request identification (2, in this example), contains a unique request identification (2, in this example),
determined by the initiator of the Request. Each Route Request also determined by the initiator of the Request. Each Route Request also
contains a record listing the address of each intermediate node contains a record listing the address of each intermediate node
through which this particular copy of the Route Request has been through which this particular copy of the Route Request has been
forwarded. This route record is initialized to an empty list by the forwarded. This route record is initialized to an empty list by the
initiator of the Route Discovery. In this example, the route record initiator of the Route Discovery. In this example, the route record
initially lists only node A. initially lists only node A.
When another node receives this Route Request (such as node B in this When another node receives this Route Request (such as node B in this
example), if it is the target of the Route Discovery, it returns example), if it is the target of the Route Discovery, it returns a
a "Route Reply" to the initiator of the Route Discovery, giving "Route Reply" to the initiator of the Route Discovery, giving a copy
a copy of the accumulated route record from the Route Request; of the accumulated route record from the Route Request; when the
when the initiator receives this Route Reply, it caches this route initiator receives this Route Reply, it caches this route in its
in its Route Cache for use in sending subsequent packets to this Route Cache for use in sending subsequent packets to this
destination. destination.
Otherwise, if this node receiving the Route Request has recently seen Otherwise, if this node receiving the Route Request has recently seen
another Route Request message from this initiator bearing this same another Route Request message from this initiator bearing this same
request identification and target address, or if this node's own request identification and target address, or if this node's own
address is already listed in the route record in the Route Request, address is already listed in the route record in the Route Request,
this node discards the Request. (A node considers a Request recently this node discards the Request. (A node considers a Request recently
seen if it still has information about that Request in its Route seen if it still has information about that Request in its Route
Request Table, which is described in Section 4.3.) Otherwise, this Request Table, which is described in Section 4.3.) Otherwise, this
node appends its own address to the route record in the Route Request node appends its own address to the route record in the Route Request
and propagates it by transmitting it as a local broadcast packet and propagates it by transmitting it as a local broadcast packet
(with the same request identification). In this example, node B (with the same request identification). In this example, node B
broadcast the Route Request, which is received by node C; nodes C broadcast the Route Request, which is received by node C; nodes C and
and D each also, in turn, broadcast the Request, resulting in a copy D each also, in turn, broadcast the Request, resulting in receipt of
of the Request being received by node E. a copy of the Request by node E.
In returning the Route Reply to the initiator of the Route Discovery, In returning the Route Reply to the initiator of the Route Discovery,
such as in this example, node E replying back to node A, node E will such as in this example, node E replying back to node A, node E will
typically examine its own Route Cache for a route back to A, and if typically examine its own Route Cache for a route back to A and, if
found, will use it for the source route for delivery of the packet one is found, will use it for the source route for delivery of the
containing the Route Reply. Otherwise, E SHOULD perform its own packet containing the Route Reply. Otherwise, E SHOULD perform its
Route Discovery for target node A, but to avoid possible infinite own Route Discovery for target node A, but to avoid possible infinite
recursion of Route Discoveries, it MUST piggyback this Route Reply recursion of Route Discoveries, it MUST in this case piggyback this
on the packet containing its own Route Request for A. It is also Route Reply on the packet containing its own Route Request for A. It
possible to piggyback other small data packets, such as a TCP SYN is also possible to piggyback other small data packets, such as a TCP
packet [33], on a Route Request using this same mechanism. SYN packet [RFC793], on a Route Request using this same mechanism.
Node E could instead simply reverse the sequence of hops in the route Node E could instead simply reverse the sequence of hops in the route
record that it is trying to send in the Route Reply, and use this as record that it is trying to send in the Route Reply and use this as
the source route on the packet carrying the Route Reply itself. For the source route on the packet carrying the Route Reply itself. For
MAC protocols such as IEEE 802.11 that require a bidirectional frame MAC protocols, such as IEEE 802.11, that require a bidirectional
exchange as part of the MAC protocol [13], the discovered source frame exchange for unicast packets as part of the MAC protocol
route MUST be reversed in this way to return the Route Reply since it [IEEE80211], the discovered source route MUST be reversed in this way
tests the discovered route to ensure it is bidirectional before the to return the Route Reply, since this route reversal tests the
Route Discovery initiator begins using the route; this route reversal discovered route to ensure that it is bidirectional before the Route
also avoids the overhead of a possible second Route Discovery. Discovery initiator begins using the route. This route reversal also
avoids the overhead of a possible second Route Discovery.
When initiating a Route Discovery, the sending node saves a copy of When initiating a Route Discovery, the sending node saves a copy of
the original packet (that triggered the Discovery) in a local buffer the original packet (that triggered the discovery) in a local buffer
called the "Send Buffer". The Send Buffer contains a copy of each called the "Send Buffer". The Send Buffer contains a copy of each
packet that cannot be transmitted by this node because it does not packet that cannot be transmitted by this node because it does not
yet have a source route to the packet's destination. Each packet in yet have a source route to the packet's destination. Each packet in
the Send Buffer is logically associated with the time that it was the Send Buffer is logically associated with the time that it was
placed into the Send Buffer and is discarded after residing in the placed into the Send Buffer and is discarded after residing in the
Send Buffer for some timeout period SendBufferTimeout; if necessary Send Buffer for some timeout period SendBufferTimeout; if necessary
for preventing the Send Buffer from overflowing, a FIFO or other for preventing the Send Buffer from overflowing, a FIFO or other
replacement strategy MAY also be used to evict packets even before replacement strategy MAY also be used to evict packets even before
they expire. they expire.
skipping to change at page 8, line 30 skipping to change at page 12, line 16
occasionally initiate a new Route Discovery for the packet's occasionally initiate a new Route Discovery for the packet's
destination address. However, the node MUST limit the rate at which destination address. However, the node MUST limit the rate at which
such new Route Discoveries for the same address are initiated (as such new Route Discoveries for the same address are initiated (as
described in Section 4.3), since it is possible that the destination described in Section 4.3), since it is possible that the destination
node is not currently reachable. In particular, due to the limited node is not currently reachable. In particular, due to the limited
wireless transmission range and the movement of the nodes in the wireless transmission range and the movement of the nodes in the
network, the network may at times become partitioned, meaning that network, the network may at times become partitioned, meaning that
there is currently no sequence of nodes through which a packet could there is currently no sequence of nodes through which a packet could
be forwarded to reach the destination. Depending on the movement be forwarded to reach the destination. Depending on the movement
pattern and the density of nodes in the network, such network pattern and the density of nodes in the network, such network
partitions may be rare or may be common. partitions may be rare or common.
If a new Route Discovery was initiated for each packet sent by a If a new Route Discovery was initiated for each packet sent by a node
node in such a partitioned network, a large number of unproductive in such a partitioned network, a large number of unproductive Route
Route Request packets would be propagated throughout the subset Request packets would be propagated throughout the subset of the ad
of the ad hoc network reachable from this node. In order to hoc network reachable from this node. In order to reduce the
reduce the overhead from such Route Discoveries, a node SHOULD use overhead from such Route Discoveries, a node SHOULD use an
an exponential back-off algorithm to limit the rate at which it exponential back-off algorithm to limit the rate at which it
initiates new Route Discoveries for the same target, doubling the initiates new Route Discoveries for the same target, doubling the
timeout between each successive Discovery initiated for the same timeout between each successive discovery initiated for the same
target. If the node attempts to send additional data packets to this target. If the node attempts to send additional data packets to this
same destination node more frequently than this limit, the subsequent same destination node more frequently than this limit, the subsequent
packets SHOULD be buffered in the Send Buffer until a Route Reply is packets SHOULD be buffered in the Send Buffer until a Route Reply is
received giving a route to this destination, but the node MUST NOT received giving a route to this destination, but the node MUST NOT
initiate a new Route Discovery until the minimum allowable interval initiate a new Route Discovery until the minimum allowable interval
between new Route Discoveries for this target has been reached. This between new Route Discoveries for this target has been reached. This
limitation on the maximum rate of Route Discoveries for the same limitation on the maximum rate of Route Discoveries for the same
target is similar to the mechanism required by Internet nodes to target is similar to the mechanism required by Internet nodes to
limit the rate at which ARP Requests are sent for any single target limit the rate at which ARP Requests are sent for any single target
IP address [3]. IP address [RFC1122].
3.2. Basic DSR Route Maintenance 3.2. Basic DSR Route Maintenance
When originating or forwarding a packet using a source route, each When originating or forwarding a packet using a source route, each
node transmitting the packet is responsible for confirming that data node transmitting the packet is responsible for confirming that data
can flow over the link from that node to the next hop. For example, can flow over the link from that node to the next hop. For example,
in the situation shown below, node A has originated a packet for in the situation shown below, node A has originated a packet for node
node E using a source route through intermediate nodes B, C, and D: E using a source route through intermediate nodes B, C, and D:
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| A |---->| B |---->| C |-->? | D | | E | | A |---->| B |---->| C |-->? | D | | E |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
In this case, node A is responsible for the link from A to B, node B In this case, node A is responsible for the link from A to B, node B
is responsible for the link from B to C, node C is responsible for is responsible for the link from B to C, node C is responsible for
the link from C to D, node D is responsible for the link from D to E. the link from C to D, and node D is responsible for the link from D
to E.
An acknowledgement can provide confirmation that a link is capable of An acknowledgement can provide confirmation that a link is capable of
carrying data, and in wireless networks, acknowledgements are often carrying data, and in wireless networks, acknowledgements are often
provided at no cost, either as an existing standard part of the MAC provided at no cost, either as an existing standard part of the MAC
protocol in use (such as the link-layer acknowledgement frame defined protocol in use (such as the link-layer acknowledgement frame defined
by IEEE 802.11 [13]), or by a "passive acknowledgement" [18] (in by IEEE 802.11 [IEEE80211]), or by a "passive acknowledgement"
which, for example, B confirms receipt at C by overhearing C transmit [JUBIN87] (in which, for example, B confirms receipt at C by
the packet when forwarding it on to D). overhearing C transmit the packet when forwarding it on to D).
If a built-in acknowledgement mechanism is not available, the If a built-in acknowledgement mechanism is not available, the node
node transmitting the packet can explicitly request a DSR-specific transmitting the packet can explicitly request that a DSR-specific
software acknowledgement be returned by the next node along the software acknowledgement be returned by the next node along the
route; this software acknowledgement will normally be transmitted route; this software acknowledgement will normally be transmitted
directly to the sending node, but if the link between these two nodes directly to the sending node, but if the link between these two nodes
is unidirectional (Section 4.6), this software acknowledgement could is unidirectional (Section 4.6), this software acknowledgement could
travel over a different, multi-hop path. travel over a different, multi-hop path.
After an acknowledgement has been received from some neighbor, a node After an acknowledgement has been received from some neighbor, a node
MAY choose to not require acknowledgements from that neighbor for a MAY choose not to require acknowledgements from that neighbor for a
brief period of time, unless the network interface connecting a node brief period of time, unless the network interface connecting a node
to that neighbor always receives an acknowledgement in response to to that neighbor always receives an acknowledgement in response to
unicast traffic. unicast traffic.
When a software acknowledgement is used, the acknowledgement When a software acknowledgement is used, the acknowledgement request
request SHOULD be retransmitted up to a maximum number of times. SHOULD be retransmitted up to a maximum number of times. A
A retransmission of the acknowledgement request can be sent as a retransmission of the acknowledgement request can be sent as a
separate packet, piggybacked on a retransmission of the original separate packet, piggybacked on a retransmission of the original data
data packet, or piggybacked on any packet with the same next-hop packet, or piggybacked on any packet with the same next-hop
destination that does not also contain a software acknowledgement. destination that does not also contain a software acknowledgement.
After the acknowledgement request has been retransmitted the maximum After the acknowledgement request has been retransmitted the maximum
number of times, if no acknowledgement has been received, then the number of times, if no acknowledgement has been received, then the
sender treats the link to this next-hop destination as currently sender treats the link to this next-hop destination as currently
"broken". It SHOULD remove this link from its Route Cache and "broken". It SHOULD remove this link from its Route Cache and SHOULD
SHOULD return a "Route Error" to each node that has sent a packet return a "Route Error" to each node that has sent a packet routed
routed over that link since an acknowledgement was last received. over that link since an acknowledgement was last received. For
For example, in the situation shown above, if C does not receive example, in the situation shown above, if C does not receive an
an acknowledgement from D after some number of requests, it would acknowledgement from D after some number of requests, it would return
return a Route Error to A, as well as any other node that may have a Route Error to A, as well as any other node that may have used the
used the link from C to D since C last received an acknowledgement link from C to D since C last received an acknowledgement from D.
from D. Node A then removes this broken link from its cache; any Node A then removes this broken link from its cache; any
retransmission of the original packet can be performed by upper retransmission of the original packet can be performed by upper layer
layer protocols such as TCP, if necessary. For sending such a protocols such as TCP, if necessary. For sending such a
retransmission or other packets to this same destination E, if A has retransmission or other packets to this same destination E, if A has
in its Route Cache another route to E (for example, from additional in its Route Cache another route to E (for example, from additional
Route Replies from its earlier Route Discovery, or from having Route Replies from its earlier Route Discovery, or from having
overheard sufficient routing information from other packets), it overheard sufficient routing information from other packets), it can
can send the packet using the new route immediately. Otherwise, it send the packet using the new route immediately. Otherwise, it
SHOULD perform a new Route Discovery for this target (subject to the SHOULD perform a new Route Discovery for this target (subject to the
back-off described in Section 3.1). back-off described in Section 3.1).
3.3. Additional Route Discovery Features 3.3. Additional Route Discovery Features
3.3.1. Caching Overheard Routing Information 3.3.1. Caching Overheard Routing Information
A node forwarding or otherwise overhearing any packet SHOULD add all A node forwarding or otherwise overhearing any packet SHOULD add all
usable routing information from that packet to its own Route Cache. usable routing information from that packet to its own Route Cache.
The usefulness of routing information in a packet depends on the The usefulness of routing information in a packet depends on the
directionality characteristics of the physical medium (Section 2), as directionality characteristics of the physical medium (Section 2), as
well as the MAC protocol being used. Specifically, three distinct well as on the MAC protocol being used. Specifically, three distinct
cases are possible: cases are possible:
- Links in the network frequently are capable of operating only - Links in the network frequently are capable of operating only
unidirectionally (not bidirectionally), and the MAC protocol in unidirectionally (not bidirectionally), and the MAC protocol in
use in the network is capable of transmitting unicast packets use in the network is capable of transmitting unicast packets over
over unidirectional links. unidirectional links.
- Links in the network occasionally are capable of operating only - Links in the network occasionally are capable of operating only
unidirectionally (not bidirectionally), but this unidirectional unidirectionally (not bidirectionally), but this unidirectional
restriction on any link is not persistent, almost all links restriction on any link is not persistent; almost all links are
are physically bidirectional, and the MAC protocol in use in physically bidirectional, and the MAC protocol in use in the
the network is capable of transmitting unicast packets over network is capable of transmitting unicast packets over
unidirectional links. unidirectional links.
- The MAC protocol in use in the network is not capable of - The MAC protocol in use in the network is not capable of
transmitting unicast packets over unidirectional links; transmitting unicast packets over unidirectional links; only
only bidirectional links can be used by the MAC protocol for bidirectional links can be used by the MAC protocol for
transmitting unicast packets. For example, the IEEE 802.11 transmitting unicast packets. For example, the IEEE 802.11
Distributed Coordination Function (DCF) MAC protocol [13] Distributed Coordination Function (DCF) MAC protocol [IEEE80211]
is capable of transmitting a unicast packet only over a is capable of transmitting a unicast packet only over a
bidirectional link, since the MAC protocol requires the return of bidirectional link, since the MAC protocol requires the return of
a link-level acknowledgement packet from the receiver and also a link-level acknowledgement packet from the receiver and also
optionally requires the bidirectional exchange of an RTS and CTS optionally requires the bidirectional exchange of an RTS and CTS
packet between the transmitter and receiver nodes. packet between the transmitter and receiver nodes.
In the first case above, for example, the source route used in a data In the first case above, for example, the source route used in a data
packet, the accumulated route record in a Route Request, or the route packet, the accumulated route record in a Route Request, or the route
being returned in a Route Reply SHOULD all be cached by any node in being returned in a Route Reply SHOULD all be cached by any node in
the "forward" direction; any node SHOULD cache this information from the "forward" direction. Any node SHOULD cache this information from
any such packet received, whether the packet was addressed to this any such packet received, whether the packet was addressed to this
node, sent to a broadcast (or multicast) MAC address, or overheard node, sent to a broadcast (or multicast) MAC address, or overheard
while the node's network interface is in promiscuous mode. However, while the node's network interface is in promiscuous mode. However,
the "reverse" direction of the links identified in such packet the "reverse" direction of the links identified in such packet
headers SHOULD NOT be cached. headers SHOULD NOT be cached.
For example, in the situation shown below, node A is using a source For example, in the situation shown below, node A is using a source
route to communicate with node E: route to communicate with node E:
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| A |---->| B |---->| C |---->| D |---->| E | | A |---->| B |---->| C |---->| D |---->| E |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
As node C forwards a data packet along the route from A to E, it As node C forwards a data packet along the route from A to E, it
SHOULD add to its cache the presence of the "forward" direction SHOULD add to its cache the presence of the "forward" direction links
links that it learns from the headers of these packets, from itself that it learns from the headers of these packets, from itself to D
to D and from D to E. Node C SHOULD NOT, in this case, cache the and from D to E. Node C SHOULD NOT, in this case, cache the
"reverse" direction of the links identified in these packet headers, "reverse" direction of the links identified in these packet headers,
from itself back to B and from B to A, since these links might be from itself back to B and from B to A, since these links might be
unidirectional. unidirectional.
In the second case above, in which links may occasionally operate In the second case above, in which links may occasionally operate
unidirectionally, the links described above SHOULD be cached in both unidirectionally, the links described above SHOULD be cached in both
directions. Furthermore, in this case, if node X overhears (e.g., directions. Furthermore, in this case, if node X overhears (e.g.,
through promiscuous mode) a packet transmitted by node C that is through promiscuous mode) a packet transmitted by node C that is
using a source route from node A to E, node X SHOULD cache all of using a source route from node A to E, node X SHOULD cache all of
these links as well, also including the link from C to X over which these links as well, also including the link from C to X over which
it overheard the packet. it overheard the packet.
In the final case, in which the MAC protocol requires physical In the final case, in which the MAC protocol requires physical
bidirectionality for unicast operation, links from a source route bidirectionality for unicast operation, links from a source route
SHOULD be cached in both directions, except when the packet also SHOULD be cached in both directions, except when the packet also
contains a Route Reply, in which case only the links already contains a Route Reply, in which case only the links already
traversed in this source route SHOULD be cached, but the links not traversed in this source route SHOULD be cached. However, the links
yet traversed in this route SHOULD NOT be cached. not yet traversed in this route SHOULD NOT be cached.
3.3.2. Replying to Route Requests using Cached Routes 3.3.2. Replying to Route Requests Using Cached Routes
A node receiving a Route Request for which it is not the target, A node receiving a Route Request for which it is not the target
searches its own Route Cache for a route to the target of the searches its own Route Cache for a route to the target of the
Request. If found, the node generally returns a Route Reply to the Request. If it is found, the node generally returns a Route Reply to
initiator itself rather than forwarding the Route Request. In the the initiator itself rather than forward the Route Request. In the
Route Reply, this node sets the route record to list the sequence of Route Reply, this node sets the route record to list the sequence of
hops over which this copy of the Route Request was forwarded to it, hops over which this copy of the Route Request was forwarded to it,
concatenated with the source route to this target obtained from its concatenated with the source route to this target obtained from its
own Route Cache. own Route Cache.
However, before transmitting a Route Reply packet that was generated However, before transmitting a Route Reply packet that was generated
using information from its Route Cache in this way, a node MUST using information from its Route Cache in this way, a node MUST
verify that the resulting route being returned in the Route Reply, verify that the resulting route being returned in the Route Reply,
after this concatenation, contains no duplicate nodes listed in the after this concatenation, contains no duplicate nodes listed in the
route record. For example, the figure below illustrates a case in route record. For example, the figure below illustrates a case in
skipping to change at page 13, line 27 skipping to change at page 16, line 25
Route: A - B - C - F | F | Cache: C - D - E Route: A - B - C - F | F | Cache: C - D - E
+-----+ +-----+
The concatenation of the accumulated route record from the Route The concatenation of the accumulated route record from the Route
Request and the cached route from F's Route Cache would include a Request and the cached route from F's Route Cache would include a
duplicate node in passing from C to F and back to C. duplicate node in passing from C to F and back to C.
Node F in this case could attempt to edit the route to eliminate the Node F in this case could attempt to edit the route to eliminate the
duplication, resulting in a route from A to B to C to D and on to E, duplication, resulting in a route from A to B to C to D and on to E,
but in this case, node F would not be on the route that it returned but in this case, node F would not be on the route that it returned
in its own Route Reply. DSR Route Discovery prohibits node F in its own Route Reply. DSR Route Discovery prohibits node F from
from returning such a Route Reply from its cache; this prohibition returning such a Route Reply from its cache; this prohibition
increases the probability that the resulting route is valid, since increases the probability that the resulting route is valid, since
node F in this case should have received a Route Error if the route node F in this case should have received a Route Error if the route
had previously stopped working. Furthermore, this prohibition had previously stopped working. Furthermore, this prohibition means
means that a future Route Error traversing the route is very likely that a future Route Error traversing the route is very likely to pass
to pass through any node that sent the Route Reply for the route through any node that sent the Route Reply for the route (including
(including node F), which helps to ensure that stale data is removed node F), which helps to ensure that stale data is removed from caches
from caches (such as at F) in a timely manner; otherwise, the next (such as at F) in a timely manner; otherwise, the next Route
Route Discovery initiated by A might also be contaminated by a Route Discovery initiated by A might also be contaminated by a Route Reply
Reply from F containing the same stale route. If node F, due to this from F containing the same stale route. If, due to this restriction
restriction on returning a Route Reply based on information from its on returning a Route Reply based on information from its Route Cache,
Route Cache, does not return such a Route Reply, node F propagates node F does not return such a Route Reply, it propagates the Route
the Route Request normally. Request normally.
3.3.3. Route Request Hop Limits 3.3.3. Route Request Hop Limits
Each Route Request message contains a "hop limit" that may be used Each Route Request message contains a "hop limit" that may be used to
to limit the number of intermediate nodes allowed to forward that limit the number of intermediate nodes allowed to forward that copy
copy of the Route Request. This hop limit is implemented using the of the Route Request. This hop limit is implemented using the Time-
Time-to-Live (TTL) field in the IP header of the packet carrying to-Live (TTL) field in the IP header of the packet carrying the Route
the Route Request. As the Request is forwarded, this limit is Request. As the Request is forwarded, this limit is decremented, and
decremented, and the Request packet is discarded if the limit reaches the Request packet is discarded if the limit reaches zero before
zero before finding the target. This Route Request hop limit can be finding the target. This Route Request hop limit can be used to
used to implement a variety of algorithms for controlling the spread implement a variety of algorithms for controlling the spread of a
of a Route Request during a Route Discovery attempt. Route Request during a Route Discovery attempt.
For example, a node MAY use this hop limit to implement a For example, a node MAY use this hop limit to implement a "non-
"non-propagating" Route Request as an initial phase of a Route propagating" Route Request as an initial phase of a Route Discovery.
Discovery. A node using this technique sends its first Route Request A node using this technique sends its first Route Request attempt for
attempt for some target node using a hop limit of 1, such that any some target node using a hop limit of 1, such that any node receiving
node receiving the initial transmission of the Route Request will the initial transmission of the Route Request will not forward the
not forward the Request to other nodes by re-broadcasting it. This Request to other nodes by re-broadcasting it. This form of Route
form of Route Request is called a "non-propagating" Route Request; Request is called a "non-propagating" Route Request; it provides an
it provides an inexpensive method for determining if the target is inexpensive method for determining if the target is currently a
currently a neighbor of the initiator or if a neighbor node has a neighbor of the initiator or if a neighbor node has a route to the
route to the target cached (effectively using the neighbors' Route target cached (effectively using the neighbors' Route Caches as an
Caches as an extension of the initiator's own Route Cache). If no extension of the initiator's own Route Cache). If no Route Reply is
Route Reply is received after a short timeout, then the node sends received after a short timeout, then the node sends a "propagating"
a "propagating" Route Request for the target node (i.e., with hop Route Request for the target node (i.e., with hop limit as defined by
limit as defined by the value of the DiscoveryHopLimit configuration the value of the DiscoveryHopLimit configuration variable).
variable).
As another example, a node MAY use this hop limit to implement an As another example, a node MAY use this hop limit to implement an
"expanding ring" search for the target [16]. A node using this "expanding ring" search for the target [JOHNSON96a]. A node using
technique sends an initial non-propagating Route Request as described this technique sends an initial non-propagating Route Request as
above; if no Route Reply is received for it, the node originates described above; if no Route Reply is received for it, the node
another Route Request with a hop limit of 2. For each Route Request originates another Route Request with a hop limit of 2. For each
originated, if no Route Reply is received for it, the node doubles Route Request originated, if no Route Reply is received for it, the
the hop limit used on the previous attempt, to progressively explore node doubles the hop limit used on the previous attempt, to
for the target node without allowing the Route Request to propagate progressively explore for the target node without allowing the Route
over the entire network. However, this expanding ring search Request to propagate over the entire network. However, this
approach could have the effect of increasing the average latency of expanding ring search approach could increase the average latency of
Route Discovery, since multiple Discovery attempts and timeouts may Route Discovery, since multiple Discovery attempts and timeouts may
be needed before discovering a route to the target node. be needed before discovering a route to the target node.
3.4. Additional Route Maintenance Features 3.4. Additional Route Maintenance Features
3.4.1. Packet Salvaging 3.4.1. Packet Salvaging
When an intermediate node forwarding a packet detects through Route When an intermediate node forwarding a packet detects through Route
Maintenance that the next hop along the route for that packet is Maintenance that the next hop along the route for that packet is
broken, if the node has another route to the packet's destination in broken, if the node has another route to the packet's destination in
its Route Cache, the node SHOULD "salvage" the packet rather than its Route Cache, the node SHOULD "salvage" the packet rather than
discarding it. To salvage a packet, the node replaces the original discard it. To salvage a packet, the node replaces the original
source route on the packet with the route from its Route Cache. The source route on the packet with a route from its Route Cache. The
node then forwards the packet to the next node indicated along this node then forwards the packet to the next node indicated along this
source route. For example, in the situation shown in the example of source route. For example, in the situation shown in the example of
Section 3.2, if node C has another route cached to node E, it can Section 3.2, if node C has another route cached to node E, it can
salvage the packet by replacing the original route in the packet with salvage the packet by replacing the original route in the packet with
this new route from its own Route Cache, rather than discarding the this new route from its own Route Cache rather than discarding the
packet. packet.
When salvaging a packet, a count is maintained in the packet of the When salvaging a packet, a count is maintained in the packet of the
number of times that it has been salvaged, to prevent a single packet number of times that it has been salvaged, to prevent a single packet
from being salvaged endlessly. Otherwise, since TTL is decremented from being salvaged endlessly. Otherwise, since the TTL is
only once by each node, a single node could salvage a packet an decremented only once by each node, a single node could salvage a
unbounded number of times. Even if we chose to require TTL to be packet an unbounded number of times. Even if we chose to require the
decremented on each salvage attempt, packet salvaging is an expensive TTL to be decremented on each salvage attempt, packet salvaging is an
operation, so it is desirable to bound the maximum number of times a expensive operation, so it is desirable to bound the maximum number
packet can be salvaged independently of the maximum number of hops a of times a packet can be salvaged independently of the maximum number
packet can traverse. of hops a packet can traverse.
As described in Section 3.2, an intermediate node, such as in this As described in Section 3.2, an intermediate node, such as in this
case, that detects through Route Maintenance that the next hop along case, that detects through Route Maintenance that the next hop along
the route for a packet that it is forwarding is broken, the node also the route for a packet that it is forwarding is broken, the node also
SHOULD return a Route Error to the original sender of the packet, SHOULD return a Route Error to the original sender of the packet,
identifying the link over which the packet could not be forwarded. identifying the link over which the packet could not be forwarded.
If the node sends this Route Error, it SHOULD originate the Route If the node sends this Route Error, it SHOULD originate the Route
Error before salvaging the packet. Error before salvaging the packet.
3.4.2. Queued Packets Destined over a Broken Link 3.4.2. Queued Packets Destined over a Broken Link
When an intermediate node forwarding a packet detects through Route When an intermediate node forwarding a packet detects through Route
Maintenance that the next-hop link along the route for that packet Maintenance that the next-hop link along the route for that packet is
is broken, in addition to handling that packet as defined for Route broken, in addition to handling that packet as defined for Route
Maintenance, the node SHOULD also handle in a similar way any pending Maintenance, the node SHOULD also handle in a similar way any pending
packets that it has queued that are destined over this new broken packets that it has queued that are destined over this new broken
link. Specifically, the node SHOULD search its Network Interface link. Specifically, the node SHOULD search its Network Interface
Queue and Maintenance Buffer (Section 4.5) for packets for which Queue and Maintenance Buffer (Section 4.5) for packets for which the
the next-hop link is this new broken link. For each such packet next-hop link is this new broken link. For each such packet
currently queued at this node, the node SHOULD process that packet as currently queued at this node, the node SHOULD process that packet as
follows: follows:
- Remove the packet from the node's Network Interface Queue and - Remove the packet from the node's Network Interface Queue and
Maintenance Buffer. Maintenance Buffer.
- Originate a Route Error for this packet to the original sender of - Originate a Route Error for this packet to the original sender of
the packet, using the procedure described in Section 8.3.4, as if the packet, using the procedure described in Section 8.3.4, as if
the node had already reached the maximum number of retransmission the node had already reached the maximum number of retransmission
attempts for that packet for Route Maintenance. However, in attempts for that packet for Route Maintenance. However, in
sending such Route Errors for queued packets in response to a sending such Route Errors for queued packets in response to
single new broken link detected, the node SHOULD send no more detection of a single, new broken link, the node SHOULD send no
than one Route Error to each original sender of any of these more than one Route Error to each original sender of any of these
packets. packets.
- If the node has another route to the packet's IP - If the node has another route to the packet's IP Destination
Destination Address in its Route Cache, the node SHOULD Address in its Route Cache, the node SHOULD salvage the packet as
salvage the packet as described in Section 8.3.6. Otherwise, the described in Section 8.3.6. Otherwise, the node SHOULD discard
node SHOULD discard the packet. the packet.
3.4.3. Automatic Route Shortening 3.4.3. Automatic Route Shortening
Source routes in use MAY be automatically shortened if one or more Source routes in use MAY be automatically shortened if one or more
intermediate nodes in the route become no longer necessary. This intermediate nodes in the route become no longer necessary. This
mechanism of automatically shortening routes in use is somewhat mechanism of automatically shortening routes in use is somewhat
similar to the use of passive acknowledgements [18]. In particular, similar to the use of passive acknowledgements [JUBIN87]. In
if a node is able to overhear a packet carrying a source route (e.g., particular, if a node is able to overhear a packet carrying a source
by operating its network interface in promiscuous receive mode), then route (e.g., by operating its network interface in promiscuous
this node examines the unexpended portion of that source route. If receive mode), then this node examines the unexpended portion of that
this node is not the intended next-hop destination for the packet source route. If this node is not the intended next-hop destination
but is named in the later unexpended portion of the packet's source for the packet but is named in the later unexpended portion of the
route, then it can infer that the intermediate nodes before itself in packet's source route, then it can infer that the intermediate nodes
the source route are no longer needed in the route. For example, the before itself in the source route are no longer needed in the route.
figure below illustrates an example in which node D has overheard a For example, the figure below illustrates an example in which node D
data packet being transmitted from B to C, for later forwarding to D has overheard a data packet being transmitted from B to C, for later
and to E: forwarding to D and to E:
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
| A |---->| B |---->| C | | D | | E | | A |---->| B |---->| C | | D | | E |
+-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+
\ ^ \ ^
\ / \ /
--------------------- ---------------------
In this case, this node (node D) SHOULD return a "gratuitous" Route In this case, this node (node D) SHOULD return a "gratuitous" Route
Reply to the original sender of the packet (node A). The Route Reply to the original sender of the packet (node A). The Route Reply
Reply gives the shorter route as the concatenation of the portion of gives the shorter route as the concatenation of the portion of the
the original source route up through the node that transmitted the original source route up through the node that transmitted the
overheard packet (node B), plus the suffix of the original source overheard packet (node B), plus the suffix of the original source
route beginning with the node returning the gratuitous Route Reply route beginning with the node returning the gratuitous Route Reply
(node D). In this example, the route returned in the gratuitous Route (node D). In this example, the route returned in the gratuitous
Reply message sent from D to A gives the new route as the sequence of Route Reply message sent from D to A gives the new route as the
hops from A to B to D to E. sequence of hops from A to B to D to E.
When deciding whether to return a gratuitous Route Reply in this way, When deciding whether to return a gratuitous Route Reply in this way,
a node MAY factor in additional information beyond the fact that it a node MAY factor in additional information beyond the fact that it
was able to overhear the packet. For example, the node MAY decide to was able to overhear the packet. For example, the node MAY decide to
return the gratuitous Route Reply only when the overheard packet is return the gratuitous Route Reply only when the overheard packet is
received with a signal strength or signal-to-noise ratio above some received with a signal strength or signal-to-noise ratio above some
specific threshold. In addition, each node maintains a Gratuitous specific threshold. In addition, each node maintains a Gratuitous
Route Reply Table, as described in Section 4.4, to limit the rate at Route Reply Table, as described in Section 4.4, to limit the rate at
which it originates gratuitous Route Replies for the same returned which it originates gratuitous Route Replies for the same returned
route. route.
3.4.4. Increased Spreading of Route Error Messages 3.4.4. Increased Spreading of Route Error Messages
When a source node receives a Route Error for a data packet that When a source node receives a Route Error for a data packet that it
it originated, this source node propagates this Route Error to its originated, this source node propagates this Route Error to its
neighbors by piggybacking it on its next Route Request. In this way, neighbors by piggybacking it on its next Route Request. In this way,
stale information in the caches of nodes around this source node will stale information in the caches of nodes around this source node will
not generate Route Replies that contain the same invalid link for not generate Route Replies that contain the same invalid link for
which this source node received the Route Error. which this source node received the Route Error.
For example, in the situation shown in the example of Section 3.2, For example, in the situation shown in the example of Section 3.2,
node A learns from the Route Error message from C, that the link node A learns from the Route Error message from C that the link from
from C to D is currently broken. It thus removes this link from C to D is currently broken. It thus removes this link from its own
its own Route Cache and initiates a new Route Discovery (if it has Route Cache and initiates a new Route Discovery (if it has no other
no other route to E in its Route Cache). On the Route Request route to E in its Route Cache). On the Route Request packet
packet initiating this Route Discovery, node A piggybacks a copy initiating this Route Discovery, node A piggybacks a copy of this
of this Route Error, ensuring that the Route Error spreads well to Route Error, ensuring that the Route Error spreads well to other
other nodes, and guaranteeing that any Route Reply that it receives nodes, and guaranteeing that any Route Reply that it receives
(including those from other node's Route Caches) in response to this (including those from other node's Route Caches) in response to this
Route Request does not contain a route that assumes the existence of Route Request does not contain a route that assumes the existence of
this broken link. this broken link.
3.5. Optional DSR Flow State Extension 3.5. Optional DSR Flow State Extension
This section describes an optional, compatible extension to the DSR This section describes an optional, compatible extension to the DSR
protocol, known as "flow state", that allows the routing of most protocol, known as "flow state", that allows the routing of most
packets without an explicit source route header in the packet. The packets without an explicit source route header in the packet. The
DSR flow state extension further reduces the overhead of the protocol DSR flow state extension further reduces the overhead of the protocol
yet still preserves the fundamental properties of DSR's operation. yet still preserves the fundamental properties of DSR's operation.
Once a sending node has discovered a source route such as through Once a sending node has discovered a source route such as through
DSR's Route Discovery mechanism, the flow state mechanism allows the DSR's Route Discovery mechanism, the flow state mechanism allows the
sending node to establish hop-by-hop forwarding state within the sending node to establish hop-by-hop forwarding state within the
network, based on this source route, to enable each node along the network, based on this source route, to enable each node along the
route to forward the packet to the next hop based on the node's own route to forward the packet to the next hop based on the node's own
local knowledge of the flow along which this packet is being routed. local knowledge of the flow along which this packet is being routed.
Flow state is dynamically initialized by the first packet using a Flow state is dynamically initialized by the first packet using a
source route and is then able to route subsequent packets along source route and is then able to route subsequent packets along the
the same flow without use of a source route header in the packet. same flow without use of a source route header in the packet. The
The state established at each hop along a flow is "soft state" and state established at each hop along a flow is "soft state" and thus
thus automatically expires when no longer needed and can be quickly automatically expires when no longer needed and can be quickly
recreated as necessary. Extending DSR's basic operation based on an recreated as necessary. Extending DSR's basic operation based on an
explicit source route in the header of each packet routed, the flow explicit source route in the header of each packet routed, the flow
state extension operates as a form of "implicit source routing" by state extension operates as a form of "implicit source routing" by
preserving DSR's basic operation but removing the explicit source preserving DSR's basic operation but removing the explicit source
route from packets. route from packets.
3.5.1. Flow Establishment 3.5.1. Flow Establishment
A source node sending packets to some destination node MAY use the A source node sending packets to some destination node MAY use the
DSR flow state extension described here to establish a route to DSR flow state extension described here to establish a route to that
that destination as a flow. A "flow" is a route from the source to destination as a flow. A "flow" is a route from the source to the
the destination represented by hop-by-hop forwarding state within destination represented by hop-by-hop forwarding state within the
the nodes along the route. Each flow is uniquely identified by a nodes along the route. Each flow is uniquely identified by a
combination of the source node address, the destination node address, combination of the source node address, the destination node address,
and a flow identifier (flow ID) chosen by the source node. and a flow identifier (flow ID) chosen by the source node.
Each flow ID is a 16-bit unsigned integer. Comparison between Each flow ID is a 16-bit unsigned integer. Comparison between
different flow IDs MUST be performed modulo 2**16. For example, different flow IDs MUST be performed modulo 2**16. For example,
using an implementation in the C programming language, a using an implementation in the C programming language, a flow ID
flow ID value (a) is greater than another flow ID value (b) if value (a) is greater than another flow ID value (b) if
((short)((a) - (b)) > 0), if a C language "short" data type is ((short)((a) - (b)) > 0), if a C language "short" data type is
implemented as a 16-bit signed integer. implemented as a 16-bit signed integer.
A DSR Flow State header in a packet identifies the flow ID to A DSR Flow State header in a packet identifies the flow ID to be
be followed in forwarding that packet. From a given source to followed in forwarding that packet. From a given source to some
some destination, any number of different flows MAY exist and destination, any number of different flows MAY exist and be in use,
be in use, for example following different sequences of hops to for example, following different sequences of hops to reach the
reach the destination. One of these flows may be considered to be destination. One of these flows MAY be considered the "default" flow
the "default" flow from that source to that destination. A node from that source to that destination. If a node receives a packet
receiving a packet with neither a DSR Options header specifying the with neither a DSR Options header specifying the route to be taken
route to be taken (with a Source Route option in the DSR Options (with a Source Route option in the DSR Options header) nor a DSR Flow
header) nor a DSR Flow State header specifying the flow ID to be State header specifying the flow ID to be followed, it is forwarded
followed, is forwarded along the default flow for the source and along the default flow for the source and destination addresses
destination addresses specified in the packet's IP header. specified in the packet's IP header.
In establishing a new flow, the source node generates a nonzero In establishing a new flow, the source node generates a nonzero
16-bit flow ID greater than any unexpired flow IDs for this 16-bit flow ID greater than any unexpired flow IDs for this (source,
(source, destination) pair. If the source wishes for this flow to destination) pair. If the source wishes for this flow to become the
become the default flow, the low bit of the flow ID MUST be set (the default flow, the low bit of the flow ID MUST be set (the flow ID is
flow ID is an odd number); otherwise, the low bit MUST NOT be set an odd number); otherwise, the low bit MUST NOT be set (the flow ID
(the flow ID is an even number). is an even number).
The source node establishing the new flow then transmits a packet The source node establishing the new flow then transmits a packet
containing a DSR Options header with a Source Route option; to containing a DSR Options header with a Source Route option. To
establish the flow, the source node also MUST include in the packet establish the flow, the source node also MUST include in the packet a
a DSR Flow State header, with the Flow ID field set to the chosen DSR Flow State header, with the Flow ID field set to the chosen flow
flow ID for the new flow, and MUST include a Timeout option in the ID for the new flow, and MUST include a Timeout option in the DSR
DSR Options header, giving the lifetime after which state information Options header, giving the lifetime after which state information
about this flow is to expire. This packet will generally be a normal about this flow is to expire. This packet will generally be a normal
data packet being sent from this sender to the receiver (for example, data packet being sent from this sender to the destination (for
the first packet sent after discovering the new route) but is also example, the first packet sent after discovering the new route) but
treated as a "flow establishment" packet. is also treated as a "flow establishment" packet.
The source node records this flow in its Flow Table for future use, The source node records this flow in its Flow Table for future use,
setting the TTL in this Flow Table entry to be the value used in the setting the TTL in this Flow Table entry to the value used in the TTL
TTL field in the packet's IP header and setting the Lifetime in this field in the packet's IP header and setting the Lifetime in this
entry to be the lifetime specified in the Timeout option in the DSR entry to the lifetime specified in the Timeout option in the DSR
Options header. The TTL field is used for Default Flow Forwarding, Options header. The TTL field is used for Default Flow Forwarding,
as described in Sections 3.5.3 and 3.5.4. as described in Sections 3.5.3 and 3.5.4.
Any further packets sent with this flow ID before the timeout that Any further packets sent with this flow ID before the timeout that
also contain a DSR Options header with a Source Route option MUST use also contain a DSR Options header with a Source Route option MUST use
this same source route in the Source Route option. this same source route in the Source Route option.
3.5.2. Receiving and Forwarding Establishment Packets 3.5.2. Receiving and Forwarding Establishment Packets
Packets intended to establish a flow, as described in Section 3.5.1, Packets intended to establish a flow, as described in Section 3.5.1,
contain a DSR Options header with a Source Route option, and are contain a DSR Options header with a Source Route option and are
forwarded along the indicated route. A node implementing the DSR forwarded along the indicated route. A node implementing the DSR
flow state extension, when receiving and forwarding such a DSR flow state extension, when receiving and forwarding such a DSR
packet, also keeps some state in its own Flow Table to enable it packet, also keeps some state in its own Flow Table to enable it to
to forward future packets that are sent along this flow with only forward future packets that are sent along this flow with only the
the flow ID specified. Specifically, if the packet also contains flow ID specified. Specifically, if the packet also contains a DSR
a DSR Flow State header, this packet SHOULD cause an entry to be Flow State header, this packet SHOULD cause an entry to be
established for this flow in the Flow Table of each node along the established for this flow in the Flow Table of each node along the
packet's route. packet's route.
The Hop Count field of the DSR Flow State header is also stored in The Hop Count field of the DSR Flow State header is also stored in
the Flow Table, as is Lifetime option specified in the DSR Options the Flow Table, as is the lifetime specified in the Timeout option
header. specified in the DSR Options header.
If the Flow ID is odd and there is no flow in the Flow Table with If the Flow ID is odd and there is no flow in the Flow Table with
Flow ID greater than the received Flow ID, set the default Flow ID Flow ID greater than the received Flow ID, set the default Flow ID
for this (IP Source Address, IP Destination Address) pair to the for this (IP Source Address, IP Destination Address) pair to the
received Flow ID, and the TTL of the packet is recorded. received Flow ID, and the TTL of the packet is recorded.
The Flow ID option is removed before final delivery of the packet. The Flow ID option is removed before final delivery of the packet.
3.5.3. Sending Packets Along Established Flows 3.5.3. Sending Packets along Established Flows
When a flow is established as described in Section 3.5.1, a packet When a flow is established as described in Section 3.5.1, a packet is
is sent which establishes state in each node along the route. sent that establishes state in each node along the route. This state
This state is soft; that is, the protocol contains mechanisms for is soft; that is, the protocol contains mechanisms for recovering
recovering from the loss of this state. However, the use of these from the loss of this state. However, the use of these mechanisms
mechanisms may result in reduced performance for packets sent may result in reduced performance for packets sent along flows with
along flows with forgotten state. As a result, it is desirable forgotten state. As a result, it is desirable to differentiate
to differentiate behavior based on whether or not the sender is behavior based on whether or not the sender is reasonably certain
reasonably certain that the flow state exists on each node along that the flow state exists on each node along the route. We define a
the route. We define a flow's state to be "established end-to-end" flow's state to be "established end-to-end" if the Flow Tables of all
if the Flow Tables of all nodes on the route contains forwarding nodes on the route contains forwarding information for that flow.
information for that flow. While it is impossible to detect whether While it is impossible to detect whether or not a flow's state has
or not a flow's state has been established end-to-end without sending been established end-to-end without sending packets, implementations
packets, implementations may make reasonable assumptions about the may make reasonable assumptions about the retention of flow state and
retention of flow state and the probability that an establishment the probability that an establishment packet has been seen by all
packet has been seen by all nodes on the route. nodes on the route.
A source wishing to send a packet along an established flow A source wishing to send a packet along an established flow
determines if the flow state has been established end-to-end. If determines if the flow state has been established end-to-end. If it
it has not, a DSR Options header with Source Route option with this has not, a DSR Options header with Source Route option with this
flow's route is added to the packet. The source SHOULD set the flow's route is added to the packet. The source SHOULD set the Flow
Flow ID field of the DSR Flow State header either to the flow ID ID field of the DSR Flow State header either to the flow ID
previously associated with this flow's route or to zero. If it sets previously associated with this flow's route or to zero. If it sets
the Flow ID field to any other value, it MUST follow the processing the Flow ID field to any other value, it MUST follow the processing
steps in Section 3.5.1 for establishing a new flow ID. If it sets the steps in Section 3.5.1 for establishing a new flow ID. If it sets
Flow ID field to a nonzero value, it MUST include a Timeout option the Flow ID field to a nonzero value, it MUST include a Timeout
with a value not greater than the timeout remaining in the node's option with a value not greater than the timeout remaining in the
Flow Table, and if its TTL is not equal to that specified in the Flow node's Flow Table, and if its TTL is not equal to that specified in
Table, the flow MUST NOT be used as a default flow in the future. the Flow Table, the flow MUST NOT be used as a default flow in the
future.
Once flow state has been established end-to-end for non-default Once flow state has been established end-to-end for non-default
flows, a source adds a DSR Flow State header to each packet it wishes flows, a source adds a DSR Flow State header to each packet it wishes
to send along that flow, setting the Flow ID field to the flow ID of to send along that flow, setting the Flow ID field to the flow ID of
that flow. A Source Route option SHOULD NOT be added to the packet, that flow. A Source Route option SHOULD NOT be added to the packet,
though if one is, then the steps for processing flows that have not though if one is, then the steps for processing flows that have not
been established end to end MUST be followed. been established end-to-end MUST be followed.
Once flow state has been established end-to-end for default flows, Once flow state has been established end-to-end for default flows,
sources sending packets with IP TTL equal to the TTL value in the sources sending packets with IP TTL equal to the TTL value in the
local Flow Table entry for this flow then transmit the packet to the local Flow Table entry for this flow then transmit the packet to the
next hop. In this case, a DSR Flow State header SHOULD NOT be added next hop. In this case, a DSR Flow State header SHOULD NOT be added
to the packet and a DSR Options header likewise SHOULD NOT be added to the packet and a DSR Options header likewise SHOULD NOT be added
to the packet; though if one is, the steps for sending packets along to the packet; though if one is, the steps for sending packets along
non-default flows MUST be followed. If the IP TTL is not equal to non-default flows MUST be followed. If the IP TTL is not equal to
the TTL value in the local Flow Table, then the steps for processing the TTL value in the local Flow Table, then the steps for processing
a non-default flow MUST be followed. a non-default flow MUST be followed.
3.5.4. Receiving and Forwarding Packets Sent Along Established Flows 3.5.4. Receiving and Forwarding Packets Sent along Established Flows
The handling of packets containing a DSR Options header with The handling of packets containing a DSR Options header with both a
both a nonzero Flow ID and a Source Route option is described in nonzero Flow ID and a Source Route option is described in Section
Section 3.5.2. The Flow ID is ignored when it is equal to zero. 3.5.2. The Flow ID is ignored when it is equal to zero. This
This section only describes handling of packets without a Source section only describes handling of packets without a Source Route
Route option. option.
If a node receives a packet with a Flow ID in the DSR Options If a node receives a packet with a Flow ID in the DSR Options header
header that indicates an unexpired flow in the node's Flow Table, it that indicates an unexpired flow in the node's Flow Table, it
increments the Hop Count in the DSR Options header and forwards the increments the Hop Count in the DSR Options header and forwards the
packet to the next hop indicated in the Flow Table. packet to the next hop indicated in the Flow Table.
If a node receives a packet with a Flow ID that indicates a flow not If a node receives a packet with a Flow ID that indicates a flow not
currently in the node's Flow Table, it returns a Route Error of type currently in the node's Flow Table, it returns a Route Error of type
UNKNOWN_FLOW with Error Destination and IP Destination addresses UNKNOWN_FLOW with Error Destination and IP Destination addresses
copied from the IP Source of the packet triggering the error. This copied from the IP Source of the packet triggering the error. This
error packet SHOULD be MAC-destined to the node from which it was error packet SHOULD be MAC-destined to the node from which the packet
received; if it cannot confirm reachability of the previous node was received; if it cannot confirm reachability of the previous node
using Route Maintenance, it MUST send the error as described in using Route Maintenance, it MUST send the error as described in
Section 8.1.1. The node sending the error SHOULD attempt to salvage Section 8.1.1. The node sending the error SHOULD attempt to salvage
the packet triggering the Route Error. If it does salvage the the packet triggering the Route Error. If it does salvage the
packet, it MUST zero the Flow ID. packet, it MUST zero the Flow ID in the packet.
If a node receives a packet with no DSR Options header and no DSR If a node receives a packet with no DSR Options header and no DSR
Flow State header, it checks the Default Flow Table. If there is Flow State header, it checks the Default Flow Table. If there is a
an entry, it forwards to the next hop indicated in the Flow Table matching entry, it forwards to the next hop indicated in the Flow
for the default flow. Otherwise, it returns a Route Error of type Table for the default flow. Otherwise, it returns a Route Error of
DEFAULT_FLOW_UNKNOWN with Error Destination and IP Destination type DEFAULT_FLOW_UNKNOWN with Error Destination and IP Destination
addresses copied from the IP Source of the packet triggering the addresses copied from the IP Source Address of the packet triggering
error. This error packet SHOULD be MAC-destined to the node from the error. This error packet SHOULD be MAC-destined to the node from
which it was received; if it cannot confirm reachability of the which it was received; if this node cannot confirm reachability of
previous node using Route Maintenance, it MUST send the error as the previous node using Route Maintenance, it MUST send the error as
described in Section 8.1.1. The node sending the error SHOULD described in Section 8.1.1. The node sending the error SHOULD
attempt to salvage the packet triggering the Route Error. If it does attempt to salvage the packet triggering the Route Error. If it does
salvage the packet, it MUST zero the Flow ID. salvage the packet, it MUST zero the Flow ID in the packet.
3.5.5. Processing Route Errors 3.5.5. Processing Route Errors
When a node receives a Route Error of type Unknown Flow, it marks When a node receives a Route Error of type UNKNOWN_FLOW, it marks the
the flow to indicate that it has not been established end-to-end. flow to indicate that it has not been established end-to-end. When a
When a node receives a Route Error of type Default Flow Unknown, it node receives a Route Error of type DEFAULT_FLOW_UNKNOWN, it marks
marks the default flow to indicate that it has not been established the default flow to indicate that it has not been established end-
end-to-end. to-end.
3.5.6. Interaction with Automatic Route Shortening 3.5.6. Interaction with Automatic Route Shortening
Because a full source route is not carried in every packet, an Because a full source route is not carried in every packet, an
alternative method for performing automatic route shortening is alternative method for performing automatic route shortening is
necessary for packets using the flow state extension. Instead, nodes necessary for packets using the flow state extension. Instead, nodes
promiscuously listen to packets, and if a node receives a packet with promiscuously listen to packets, and if a node receives a packet with
(IP Source, IP Destination, Flow ID) found in the Flow Table but the (IP Source, IP Destination, Flow ID) found in the Flow Table but the
MAC-layer (next hop) destination address of the packet is not this MAC-layer (next hop) destination address of the packet is not this
node, the node determines whether the packet was sent by an upstream node, the node determines whether the packet was sent by an upstream
or downstream node by examining the Hop Count field in the DSR Flow or downstream node by examining the Hop Count field in the DSR Flow
State header. If the Hop Count field is less than the expected State header. If the Hop Count field is less than the expected Hop
Hop Count at this node (that is, the expected Hop Count field in Count at this node (that is, the expected Hop Count field in the Flow
the Flow Table described in Section 5.1), the node assumes that the Table described in Section 5.1), the node assumes that the packet was
packet was sent by an upstream node, and adds an entry for the packet sent by an upstream node and adds an entry for the packet to its
to its Automatic Route Shortening Table, possibly evicting an earlier Automatic Route Shortening Table, possibly evicting an earlier entry
entry added to this table. When the packet is then sent to that node added to this table. When the packet is then sent to that node for
for forwarding, the node finds that it has previously received the forwarding, the node finds that it has previously received the packet
packet by checking its Automatic Route Shortening Table, and returns by checking its Automatic Route Shortening Table and returns a
a gratuitous Route Reply to the source of the packet. gratuitous Route Reply to the source of the packet.
3.5.7. Loop Detection 3.5.7. Loop Detection
If a node receives a packet for forwarding with TTL lower than If a node receives a packet for forwarding with TTL lower than
expected and default flow forwarding is being used, it sends a expected and default flow forwarding is being used, it sends a Route
Route Error of type Default Flow Unknown back to the IP source. It Error of type DEFAULT_FLOW_UNKNOWN back to the IP source. It can
can attempt delivery of the packet by normal salvaging (subject attempt delivery of the packet by normal salvaging (subject to
to constraints described in Section 8.6.7) or by inserting a constraints described in Section 8.6.7).
Flow ID option with Special TTL extension based on what that node's
understanding of the default Flow ID and TTL.
3.5.8. Acknowledgement Destination 3.5.8. Acknowledgement Destination
In packets sent using Flow State, the previous hop is not necessarily In packets sent using Flow State, the previous hop is not necessarily
known. In order to allow nodes that have lost flow state to known. In order to allow nodes that have lost flow state to
determine the previous hop, the address of the previous hop can determine the previous hop, the address of the previous hop can
optionally be stored in the Acknowledgement Request. This extension optionally be stored in the Acknowledgement Request. This extension
SHOULD NOT be used when a Source Route option is present, MAY be used SHOULD NOT be used when a Source Route option is present, MAY be used
when flow state routing is used without a Source Route option, and when flow state routing is used without a Source Route option, and
SHOULD be used before Route Maintenance determines that the next-hop SHOULD be used before Route Maintenance determines that the next-hop
destination is unreachable. destination is unreachable.
3.5.9. Crash Recovery 3.5.9. Crash Recovery
Each node has a maximum Timeout value that it can possibly generate. Each node has a maximum Timeout value that it can possibly generate.
This can be based on the largest number that can be set in a timeout This can be based on the largest number that can be set in a timeout
option (2**16 - 1 seconds) or set in system software. When a node option (2**16 - 1 seconds) or may be less than this, set in system
crashes, it does not establish new flows for a period equal to this software. When a node crashes, it does not establish new flows for a
maximum Timeout value, in order to avoid colliding with its old period equal to this maximum Timeout value, in order to avoid
Flow IDs. colliding with its old Flow IDs.
3.5.10. Rate Limiting 3.5.10. Rate Limiting
Flow IDs can be assigned with a counter. More specifically, the Flow IDs can be assigned with a counter. More specifically, the
"Current Flow ID" is kept. When a new default Flow ID needs to be "Current Flow ID" is kept. When a new default Flow ID needs to be
assigned, if the Current Flow ID is odd, the Current Flow ID is assigned, if the Current Flow ID is odd, the Current Flow ID is
assigned as the Flow ID and the Current Flow ID is incremented by assigned as the Flow ID and the Current Flow ID is incremented by
one; if the Current Flow ID is even, one plus the Current Flow ID is one; if the Current Flow ID is even, one plus the Current Flow ID is
assigned as the Flow ID and the Current Flow ID is incremented by assigned as the Flow ID and the Current Flow ID is incremented by
two. two.
If Flow IDs are assigned in this way, one algorithm for avoiding If Flow IDs are assigned in this way, one algorithm for avoiding
duplicate, unexpired Flow IDs is to rate limit new Flow IDs to an duplicate, unexpired Flow IDs is to rate limit new Flow IDs to an
average rate of n assignments per second, where n is 2**15 divided by average rate of n assignments per second, where n is 2**15 divided by
the maximum Timeout value. This can be averaged over any period not the maximum Timeout value. This can be averaged over any period not
exceeding the maximum Timeout value. exceeding the maximum Timeout value.
3.5.11. Interaction with Packet Salvaging 3.5.11. Interaction with Packet Salvaging
Salvaging is modified to zero the Flow ID field. Also, any time the Salvaging is modified to zero the Flow ID field in the packet. Also,
this document refers to the Salvage field in the Source Route option anytime this document refers to the Salvage field in the Source Route
in a DSR Options header, packets without a Source Route option are option in a DSR Options header, packets without a Source Route option
considered to have the value zero in the Salvage field. are considered to have the value zero in the Salvage field.
4. Conceptual Data Structures 4. Conceptual Data Structures
This document describes the operation of the DSR protocol in terms This document describes the operation of the DSR protocol in terms of
of a number of conceptual data structures. This section describes a number of conceptual data structures. This section describes each
each of these data structures and provides an overview of its use of these data structures and provides an overview of its use in the
in the protocol. In an implementation of the protocol, these data protocol. In an implementation of the protocol, these data
structures MAY be implemented in any manner consistent with the structures MUST be implemented in a manner consistent with the
external behavior described in this document. Additional conceptual external behavior described in this document, but the choice of
data structures are required for the optional flow state extensions implementation used is otherwise unconstrained. Additional
to DSR; these data structures are described in Section 5. conceptual data structures are required for the optional flow state
extensions to DSR; these data structures are described in Section 5.
4.1. Route Cache 4.1. Route Cache
Each node implementing DSR MUST maintain a Route Cache, containing Each node implementing DSR MUST maintain a Route Cache, containing
routing information needed by the node. A node adds information to routing information needed by the node. A node adds information to
its Route Cache as it learns of new links between nodes in the ad hoc its Route Cache as it learns of new links between nodes in the ad hoc
network; for example, a node may learn of new links when it receives network; for example, a node may learn of new links when it receives
a packet carrying a Route Request, Route Reply, or DSR source route. a packet carrying a Route Request, Route Reply, or DSR source route.
Likewise, a node removes information from its Route Cache as it Likewise, a node removes information from its Route Cache as it
learns that existing links in the ad hoc network have broken; for learns that existing links in the ad hoc network have broken. For
example, a node may learn of a broken link when it receives a packet example, a node may learn of a broken link when it receives a packet
carrying a Route Error or through the link-layer retransmission carrying a Route Error or through the link-layer retransmission
mechanism reporting a failure in forwarding a packet to its next-hop mechanism reporting a failure in forwarding a packet to its next-hop
destination. destination.
Anytime a node adds new information to its Route Cache, the node Anytime a node adds new information to its Route Cache, the node
SHOULD check each packet in its own Send Buffer (Section 4.2) to SHOULD check each packet in its own Send Buffer (Section 4.2) to
determine whether a route to that packet's IP Destination Address determine whether a route to that packet's IP Destination Address now
now exists in the node's Route Cache (including the information just exists in the node's Route Cache (including the information just
added to the Cache). If so, the packet SHOULD then be sent using added to the Cache). If so, the packet SHOULD then be sent using
that route and removed from the Send Buffer. that route and removed from the Send Buffer.
It is possible to interface a DSR network with other networks, It is possible to interface a DSR network with other networks,
external to this DSR network. Such external networks may, for external to this DSR network. Such external networks may, for
example, be the Internet, or may be other ad hoc networks routed example, be the Internet or may be other ad hoc networks routed with
with a routing protocol other than DSR. Such external networks may a routing protocol other than DSR. Such external networks may also
also be other DSR networks that are treated as external networks be other DSR networks that are treated as external networks in order
in order to improve scalability. The complete handling of such to improve scalability. The complete handling of such external
external networks is beyond the scope of this document. However, networks is beyond the scope of this document. However, this
this document specifies a minimal set of requirements and features document specifies a minimal set of requirements and features
necessary to allow nodes only implementing this specification to necessary to allow nodes only implementing this specification to
interoperate correctly with nodes implementing interfaces to such interoperate correctly with nodes implementing interfaces to such
external networks. This minimal set of requirements and features external networks. This minimal set of requirements and features
involve the First Hop External (F) and Last Hop External (L) bits involve the First Hop External (F) and Last Hop External (L) bits in
in a DSR Source Route option (Section 6.7) and a Route Reply option a DSR Source Route option (Section 6.7) and a Route Reply option
(Section 6.3) in a packet's DSR Options header (Section 6). These (Section 6.3) in a packet's DSR Options header (Section 6). These
requirements also include the addition of an External flag bit requirements also include the addition of an External flag bit
tagging each link in the Route Cache, copied from the First Hop tagging each link in the Route Cache, copied from the First Hop
External (F) and Last Hop External (L) bits in the DSR Source Route External (F) and Last Hop External (L) bits in the DSR Source Route
option or Route Reply option from which this link was learned. option or Route Reply option from which this link was learned.
The Route Cache SHOULD support storing more than one route to each The Route Cache SHOULD support storing more than one route to each
destination. In searching the Route Cache for a route to some destination. In searching the Route Cache for a route to some
destination node, the Route Cache is indexed by destination node destination node, the Route Cache is searched by destination node
address. The following properties describe this searching function address. The following properties describe this searching function
on a Route Cache: on a Route Cache:
- Each implementation of DSR at any node MAY choose any appropriate - Each implementation of DSR at any node MAY choose any appropriate
strategy and algorithm for searching its Route Cache and strategy and algorithm for searching its Route Cache and selecting
selecting a "best" route to the destination from among those a "best" route to the destination from among those found. For
found. For example, a node MAY choose to select the shortest example, a node MAY choose to select the shortest route to the
route to the destination (the shortest sequence of hops), or it destination (the shortest sequence of hops), or it MAY use an
MAY use an alternate metric to select the route from the Cache. alternate metric to select the route from the Cache.
- However, if there are multiple cached routes to a destination, - However, if there are multiple cached routes to a destination, the
the selection of routes when searching the Route Cache MUST selection of routes when searching the Route Cache SHOULD prefer
prefer routes that do not have the External flag set on any link. routes that do not have the External flag set on any link. This
This preference will select routes that lead directly to the preference will select routes that lead directly to the target
target node over routes that attempt to reach the target via any node over routes that attempt to reach the target via any external
external networks connected to the DSR ad hoc network. networks connected to the DSR ad hoc network.
- In addition, any route selected when searching the Route Cache - In addition, any route selected when searching the Route Cache
MUST NOT have the External bit set for any links other than MUST NOT have the External bit set for any links other than
possibly the first link, the last link, or both; the External bit possibly the first link, the last link, or both; the External bit
MUST NOT be set for any intermediate hops in the route selected. MUST NOT be set for any intermediate hops in the route selected.
An implementation of a Route Cache MAY provide a fixed capacity An implementation of a Route Cache MAY provide a fixed capacity for
for the cache, or the cache size MAY be variable. The following the cache, or the cache size MAY be variable. The following
properties describe the management of available space within a node's properties describe the management of available space within a node's
Route Cache: Route Cache:
- Each implementation of DSR at each node MAY choose any - Each implementation of DSR at each node MAY choose any appropriate
appropriate policy for managing the entries in its Route Cache, policy for managing the entries in its Route Cache, such as when
such as when limited cache capacity requires a choice of which limited cache capacity requires a choice of which entries to
entries to retain in the Cache. For example, a node MAY chose a retain in the Cache. For example, a node MAY chose a "least
"least recently used" (LRU) cache replacement policy, in which recently used" (LRU) cache replacement policy, in which the entry
the entry last used longest ago is discarded from the cache if a last used longest ago is discarded from the cache if a decision
decision needs to be made to allow space in the cache for some needs to be made to allow space in the cache for some new entry
new entry being added. being added.
- However, the Route Cache replacement policy SHOULD allow routes - However, the Route Cache replacement policy SHOULD allow routes to
to be categorized based upon "preference", where routes with a be categorized based upon "preference", where routes with a higher
higher preferences are less likely to be removed from the cache. preferences are less likely to be removed from the cache. For
For example, a node could prefer routes for which it initiated example, a node could prefer routes for which it initiated a Route
a Route Discovery over routes that it learned as the result of Discovery over routes that it learned as the result of promiscuous
promiscuous snooping on other packets. In particular, a node snooping on other packets. In particular, a node SHOULD prefer
SHOULD prefer routes that it is presently using over those that routes that it is presently using over those that it is not.
it is not.
Any suitable data structure organization, consistent with this Any suitable data structure organization, consistent with this
specification, MAY be used to implement the Route Cache in any node. specification, MAY be used to implement the Route Cache in any node.
For example, the following two types of organization are possible: For example, the following two types of organization are possible:
- In DSR, the route returned in each Route Reply that is received - In DSR, the route returned in each Route Reply that is received by
by the initiator of a Route Discovery (or that is learned from the initiator of a Route Discovery (or that is learned from the
the header of overhead packets, as described in Section 8.1.4) header of overhead packets, as described in Section 8.1.4)
represents a complete path (a sequence of links) leading to the represents a complete path (a sequence of links) leading to the
destination node. By caching each of these paths separately, destination node. By caching each of these paths separately, a
a "path cache" organization for the Route Cache can be formed. "path cache" organization for the Route Cache can be formed. A
A path cache is very simple to implement and easily guarantees path cache is very simple to implement and easily guarantees that
that all routes are loop-free, since each individual route from all routes are loop-free, since each individual route from a Route
a Route Reply or Route Request or used in a packet is loop-free. Reply or Route Request or used in a packet is loop-free. To
To search for a route in a path cache data structure, the sending search for a route in a path cache data structure, the sending
node can simply search its Route Cache for any path (or prefix of node can simply search its Route Cache for any path (or prefix of
a path) that leads to the intended destination node. a path) that leads to the intended destination node.
This type of organization for the Route Cache in DSR has been This type of organization for the Route Cache in DSR has been
extensively studied through simulation [5, 10, 14, 21] and extensively studied through simulation [BROCH98, HU00,
through implementation of DSR in a mobile outdoor testbed under JOHANSSON99, MALTZ99a] and through implementation of DSR in a
significant workload [22, 23, 24]. mobile outdoor testbed under significant workload [MALTZ99b,
MALTZ00, MALTZ01].
- Alternatively, a "link cache" organization could be used for the - Alternatively, a "link cache" organization could be used for the
Route Cache, in which each individual link (hop) in the routes Route Cache, in which each individual link (hop) in the routes
returned in Route Reply packets (or otherwise learned from the returned in Route Reply packets (or otherwise learned from the
header of overhead packets) is added to a unified graph data header of overhead packets) is added to a unified graph data
structure of this node's current view of the network topology. structure of this node's current view of the network topology. To
To search for a route in link cache, the sending node must use search for a route in link cache, the sending node must use a more
a more complex graph search algorithm, such as the well-known complex graph search algorithm, such as the well-known Dijkstra's
Dijkstra's shortest-path algorithm, to find the current best path shortest-path algorithm, to find the current best path through the
through the graph to the destination node. Such an algorithm is graph to the destination node. Such an algorithm is more
more difficult to implement and may require significantly more difficult to implement and may require significantly more CPU time
CPU time to execute. to execute.
However, a link cache organization is more powerful than a path However, a link cache organization is more powerful than a path
cache organization, in its ability to effectively utilize all of cache organization, in its ability to effectively utilize all of
the potential information that a node might learn about the state the potential information that a node might learn about the state
of the network. In particular, links learned from different of the network. In particular, links learned from different Route
Route Discoveries or from the header of any overheard packets can Discoveries or from the header of any overheard packets can be
be merged together to form new routes in the network, but this merged together to form new routes in the network, but this is not
is not possible in a path cache due to the separation of each possible in a path cache due to the separation of each individual
individual path in the cache. path in the cache.
This type of organization for the Route Cache in DSR, including This type of organization for the Route Cache in DSR, including
the effect of a range of implementation choices, has been studied the effect of a range of implementation choices, has been studied
through detailed simulation [10]. through detailed simulation [HU00].
The choice of data structure organization to use for the Route Cache The choice of data structure organization to use for the Route Cache
in any DSR implementation is a local matter for each node and affects in any DSR implementation is a local matter for each node and affects
only performance; any reasonable choice of organization for the Route only performance; any reasonable choice of organization for the Route
Cache does not affect either correctness or interoperability. Cache does not affect either correctness or interoperability.
Each entry in the Route Cache SHOULD have a timeout associated Each entry in the Route Cache SHOULD have a timeout associated with
with it, to allow that entry to be deleted if not used within some it, to allow that entry to be deleted if not used within some time.
time. The particular choice of algorithm and data structure used The particular choice of algorithm and data structure used to
to implement the Route Cache SHOULD be considered in choosing the implement the Route Cache SHOULD be considered in choosing the
timeout for entries in the Route Cache. The configuration variable timeout for entries in the Route Cache. The configuration variable
RouteCacheTimeout defined in Section 9 specifies the timeout to be RouteCacheTimeout defined in Section 9 specifies the timeout to be
applied to entries in the Route Cache, although it is also possible applied to entries in the Route Cache, although it is also possible
to instead use an adaptive policy in choosing timeout values rather to instead use an adaptive policy in choosing timeout values rather
than using a single timeout setting for all entries; for example, the than using a single timeout setting for all entries. For example,
Link-MaxLife cache design (below) uses an adaptive timeout algorithm the Link-MaxLife cache design (below) uses an adaptive timeout
and does not use the RouteCacheTimeout configuration variable. algorithm and does not use the RouteCacheTimeout configuration
variable.
As guidance to implementors, Appendix A describes a type of link As guidance to implementers, Appendix A describes a type of link
cache known as "Link-MaxLife" that has been shown to outperform cache known as "Link-MaxLife" that has been shown to outperform other
other types of link caches and path caches studied in detailed types of link caches and path caches studied in detailed simulation
simulation [10]. Link-MaxLife is an adaptive link cache in which [HU00]. Link-MaxLife is an adaptive link cache in which each link in
each link in the cache has a timeout that is determined dynamically the cache has a timeout that is determined dynamically by the caching
by the caching node according to its observed past behavior of the node according to its observed past behavior of the two nodes at the
two nodes at the ends of the link; in addition, when selecting a ends of the link. In addition, when selecting a route for a packet
route for a packet being sent to some destination, among cached being sent to some destination, among cached routes of equal length
routes of equal length (number of hops) to that destination, (number of hops) to that destination, Link-MaxLife selects the route
Link-MaxLife selects the route with the longest expected lifetime with the longest expected lifetime (highest minimum timeout of any
(highest minimum timeout of any link in the route). Use of link in the route). Use of the Link-MaxLife design for the Route
the Link-MaxLife design for the Route Cache is recommended in Cache is recommended in implementations of DSR.
implementations of DSR.
4.2. Send Buffer 4.2. Send Buffer
The Send Buffer of a node implementing DSR is a queue of packets that The Send Buffer of a node implementing DSR is a queue of packets that
cannot be sent by that node because it does not yet have a source cannot be sent by that node because it does not yet have a source
route to each such packet's destination. Each packet in the Send route to each such packet's destination. Each packet in the Send
Buffer is logically associated with the time that it was placed into Buffer is logically associated with the time that it was placed into
the Buffer, and SHOULD be removed from the Send Buffer and silently the buffer and SHOULD be removed from the Send Buffer and silently
discarded after a period of SendBufferTimeout after initially being discarded after a period of SendBufferTimeout after initially being
placed in the Buffer. If necessary, a FIFO strategy SHOULD be used placed in the buffer. If necessary, a FIFO strategy SHOULD be used
to evict packets before they timeout to prevent the buffer from to evict packets before they time out to prevent the buffer from
overflowing. overflowing.
Subject to the rate limiting defined in Section 4.3, a Route Subject to the rate limiting defined in Section 4.3, a Route
Discovery SHOULD be initiated as often as possible for the Discovery SHOULD be initiated as often as allowed for the destination
destination address of any packets residing in the Send Buffer. address of any packets residing in the Send Buffer.
4.3. Route Request Table 4.3. Route Request Table
The Route Request Table of a node implementing DSR records The Route Request Table of a node implementing DSR records
information about Route Requests that have been recently originated information about Route Requests that have been recently originated
or forwarded by this node. The table is indexed by IP address. or forwarded by this node. The table is indexed by IP address.
The Route Request Table on a node records the following information The Route Request Table on a node records the following information
about nodes to which this node has initiated a Route Request: about nodes to which this node has initiated a Route Request:
- The Time-to-Live (TTL) field used in the IP header of the Route - The Time-to-Live (TTL) field used in the IP header of the Route
Request for the last Route Discovery initiated by this node for Request for the last Route Discovery initiated by this node for
that target node. This value allows the node to implement a that target node. This value allows the node to implement a
variety of algorithms for controlling the spread of its Route variety of algorithms for controlling the spread of its Route
Request on each Route Discovery initiated for a target. As Request on each Route Discovery initiated for a target. As
examples, two possible algorithms for this use of the TTL field examples, two possible algorithms for this use of the TTL field
are described in Section 3.3.3. are described in Section 3.3.3.
- The time that this node last originated a Route Request for that - The time that this node last originated a Route Request for that
target node. target node.
- The number of consecutive Route Discoveries initiated for this - The number of consecutive Route Discoveries initiated for this
target since receiving a valid Route Reply giving a route to that target since receiving a valid Route Reply giving a route to that
target node. target node.
- The remaining amount of time before which this node MAY next - The remaining amount of time before which this node MAY next
attempt at a Route Discovery for that target node. When the attempt at a Route Discovery for that target node. When the node
node initiates a new Route Discovery for this target node, this initiates a new Route Discovery for this target node, this field
field in the Route Request Table entry for that target node is in the Route Request Table entry for that target node is
initialized to the timeout for that Route Discovery, after which initialized to the timeout for that Route Discovery, after which
the node MAY initiate a new Discovery for that target. Until the node MAY initiate a new Discovery for that target. Until a
a valid Route Reply is received for this target node address, valid Route Reply is received for this target node address, a node
a node MUST implement a back-off algorithm in determining this MUST implement a back-off algorithm in determining this timeout
timeout value for each successive Route Discovery initiated value for each successive Route Discovery initiated for this
for this target using the same Time-to-Live (TTL) value in the target using the same Time-to-Live (TTL) value in the IP header of
IP header of the Route Request packet. The timeout between the Route Request packet. The timeout between such consecutive
such consecutive Route Discovery initiations SHOULD increase by Route Discovery initiations SHOULD increase by doubling the
doubling the timeout value on each new initiation. timeout value on each new initiation.
In addition, the Route Request Table on a node also records the In addition, the Route Request Table on a node also records the
following information about initiator nodes from which this node has following information about initiator nodes from which this node has
received a Route Request: received a Route Request:
- A FIFO cache of size RequestTableIds entries containing the - A FIFO cache of size RequestTableIds entries containing the
Identification value and target address from the most recent Identification value and target address from the most recent Route
Route Requests received by this node from that initiator node. Requests received by this node from that initiator node.
Nodes SHOULD use an LRU policy to manage the entries in their Route Nodes SHOULD use an LRU policy to manage the entries in their Route
Request Table. Request Table.
The number of Identification values to retain in each Route The number of Identification values to retain in each Route Request
Request Table entry, RequestTableIds, MUST NOT be unlimited, since, Table entry, RequestTableIds, MUST NOT be unlimited, since, in the
in the worst case, when a node crashes and reboots, the first worst case, when a node crashes and reboots, the first
RequestTableIds Route Discoveries it initiates after rebooting RequestTableIds Route Discoveries it initiates after rebooting could
could appear to be duplicates to the other nodes in the network. appear to be duplicates to the other nodes in the network. In
In addition, a node SHOULD base its initial Identification value, addition, a node SHOULD base its initial Identification value, used
used for Route Discoveries after rebooting, on a battery backed-up for Route Discoveries after rebooting, on a battery backed-up clock
clock or other persistent memory device, in order to help avoid or other persistent memory device, if available, in order to help
any possible such delay in successfully discovering new routes avoid any possible such delay in successfully discovering new routes
after rebooting; if no such source of initial Identification after rebooting; if no such source of initial Identification value is
value is available, a node after rebooting SHOULD base its initial available, a node after rebooting SHOULD base its initial
Identification value on a random number. Identification value on a random number.
4.4. Gratuitous Route Reply Table 4.4. Gratuitous Route Reply Table
The Gratuitous Route Reply Table of a node implementing DSR records The Gratuitous Route Reply Table of a node implementing DSR records
information about "gratuitous" Route Replies sent by this node as information about "gratuitous" Route Replies sent by this node as
part of automatic route shortening. As described in Section 3.4.3, part of automatic route shortening. As described in Section 3.4.3, a
a node returns a gratuitous Route Reply when it overhears a packet node returns a gratuitous Route Reply when it overhears a packet
transmitted by some node, for which the node overhearing the transmitted by some node, for which the node overhearing the packet
packet was not the intended next-hop node but was named later in was not the intended next-hop node but was named later in the
the unexpended hops of the source route in that packet; the node unexpended hops of the source route in that packet; the node
overhearing the packet returns a gratuitous Route Reply to the overhearing the packet returns a gratuitous Route Reply to the
original sender of the packet, listing the shorter route (not original sender of the packet, listing the shorter route (not
including the hops of the source route "skipped over" by this including the hops of the source route "skipped over" by this
packet). A node uses its Gratuitous Route Reply Table to limit the packet). A node uses its Gratuitous Route Reply Table to limit the
rate at which it originates gratuitous Route Replies to the same rate at which it originates gratuitous Route Replies to the same
original sender for the same node from which it overheard a packet to original sender for the same node from which it overheard a packet to
trigger the gratuitous Route Reply. trigger the gratuitous Route Reply.
Each entry in the Gratuitous Route Reply Table of a node contains the Each entry in the Gratuitous Route Reply Table of a node contains the
following fields: following fields:
- The address of the node to which this node originated a - The address of the node to which this node originated a gratuitous
gratuitous Route Reply. Route Reply.
- The address of the node from which this node overheard the packet - The address of the node from which this node overheard the packet
triggering that gratuitous Route Reply. triggering that gratuitous Route Reply.
- The remaining time before which this entry in the Gratuitous - The remaining time before which this entry in the Gratuitous Route
Route Reply Table expires and SHOULD be deleted by the node. Reply Table expires and SHOULD be deleted by the node. When a
When a node creates a new entry in its Gratuitous Route Reply node creates a new entry in its Gratuitous Route Reply Table, the
Table, the timeout value for that entry should be initialized to timeout value for that entry SHOULD be initialized to the value
the value GratReplyHoldoff. GratReplyHoldoff.
When a node overhears a packet that would trigger a gratuitous When a node overhears a packet that would trigger a gratuitous Route
Route Reply, if a corresponding entry already exists in the node's Reply, if a corresponding entry already exists in the node's
Gratuitous Route Reply Table, then the node SHOULD NOT send a Gratuitous Route Reply Table, then the node SHOULD NOT send a
gratuitous Route Reply for that packet. Otherwise (no corresponding gratuitous Route Reply for that packet. Otherwise (i.e., if no
entry already exists), the node SHOULD create a new entry in its corresponding entry already exists), the node SHOULD create a new
Gratuitous Route Reply Table to record that gratuitous Route Reply, entry in its Gratuitous Route Reply Table to record that gratuitous
with a timeout value of GratReplyHoldoff. Route Reply, with a timeout value of GratReplyHoldoff.
4.5. Network Interface Queue and Maintenance Buffer 4.5. Network Interface Queue and Maintenance Buffer
Depending on factors such as the structure and organization of Depending on factors such as the structure and organization of the
the operating system, protocol stack implementation, network operating system, protocol stack implementation, network interface
interface device driver, and network interface hardware, a packet device driver, and network interface hardware, a packet being
being transmitted could be queued in a variety of ways. For transmitted could be queued in a variety of ways. For example,
example, outgoing packets from the network protocol stack might be outgoing packets from the network protocol stack might be queued at
queued at the operating system or link layer, before transmission the operating system or link layer, before transmission by the
by the network interface. The network interface might also network interface. The network interface might also provide a
provide a retransmission mechanism for packets, such as occurs in retransmission mechanism for packets, such as occurs in IEEE 802.11
IEEE 802.11 [13]; the DSR protocol, as part of Route Maintenance, [IEEE80211]; the DSR protocol, as part of Route Maintenance, requires
requires limited buffering of packets already transmitted for limited buffering of packets already transmitted for which the
which the reachability of the next-hop destination has not yet been reachability of the next-hop destination has not yet been determined.
determined. The operation of DSR is defined here in terms of two The operation of DSR is defined here in terms of two conceptual data
conceptual data structures that together incorporate this queuing structures that, together, incorporate this queuing behavior.
behavior.
The Network Interface Queue of a node implementing DSR is an output The Network Interface Queue of a node implementing DSR is an output
queue of packets from the network protocol stack waiting to be queue of packets from the network protocol stack waiting to be
transmitted by the network interface; for example, in the 4.4BSD transmitted by the network interface; for example, in the 4.4BSD Unix
Unix network protocol stack implementation, this queue for a network network protocol stack implementation, this queue for a network
interface is represented as a "struct ifqueue" [38]. This queue is interface is represented as a "struct ifqueue" [WRIGHT95]. This
used to hold packets while the network interface is in the process of queue is used to hold packets while the network interface is in the
transmitting another packet. process of transmitting another packet.
The Maintenance Buffer of a node implementing DSR is a queue of The Maintenance Buffer of a node implementing DSR is a queue of
packets sent by this node that are awaiting next-hop reachability packets sent by this node that are awaiting next-hop reachability
confirmation as part of Route Maintenance. For each packet in confirmation as part of Route Maintenance. For each packet in the
the Maintenance Buffer, a node maintains a count of the number Maintenance Buffer, a node maintains a count of the number of
of retransmissions and the time of the last retransmission. The retransmissions and the time of the last retransmission. Packets are
Maintenance Buffer MAY be of limited size; when adding a new packet added to the Maintenance buffer after the first transmission attempt
to the Maintenance Buffer, if the buffer size is insufficient to hold is made. The Maintenance Buffer MAY be of limited size; when adding
the new packet, the new packet SHOULD be silently discarded. If, a new packet to the Maintenance Buffer, if the buffer size is
after MaxMaintRexmt attempts to confirm next-hop reachability of insufficient to hold the new packet, the new packet SHOULD be
some node, no confirmation is received, all packets in this node's silently discarded. If, after MaxMaintRexmt attempts to confirm
Maintenance Buffer with this next-hop destination SHOULD be removed next-hop reachability of some node, no confirmation is received, all
from the Maintenance Buffer; in this case, the node also SHOULD packets in this node's Maintenance Buffer with this next-hop
originate a Route Error for this packet to each original source of destination SHOULD be removed from the Maintenance Buffer. In this
a packet removed in this way (Section 8.3) and SHOULD salvage each case, the node also SHOULD originate a Route Error for this packet to
packet removed in this way (Section 8.3.6) if it has another route each original source of a packet removed in this way (Section 8.3)
to that packet's IP Destination Address in its Route Cache. The and SHOULD salvage each packet removed in this way (Section 8.3.6) if
definition of MaxMaintRexmt conceptually includes any retransmissions it has another route to that packet's IP Destination Address in its
that might be attempted for a packet at the link layer or within Route Cache. The definition of MaxMaintRexmt conceptually includes
the network interface hardware. The timeout value to use for each any retransmissions that might be attempted for a packet at the link
transmission attempt for an acknowledgement request depends on the layer or within the network interface hardware. The timeout value to
type of acknowledgement mechanism used by Route Maintenance for that use for each transmission attempt for an acknowledgement request
attempt, as described in Section 8.3. depends on the type of acknowledgement mechanism used by Route
Maintenance for that attempt, as described in Section 8.3.
4.6. Blacklist 4.6. Blacklist
When a node using the DSR protocol is connected through an When a node using the DSR protocol is connected through a network
interface that requires physically bidirectional links for unicast interface that requires physically bidirectional links for unicast
transmission, it MUST maintain a Blacklist. The Blacklist is a transmission, the node MUST maintain a blacklist. The blacklist is a
table, indexed by neighbor node address, that indicates that the table, indexed by neighbor node address, that indicates that the link
link between this node and the specified neighbor node may not be between this node and the specified neighbor node may not be
bidirectional. A node places another node's address in this list bidirectional. A node places another node's address in this list
when it believes that broadcast packets from that other node reach when it believes that broadcast packets from that other node reach
this node, but that unicast transmission between the two nodes is not this node, but that unicast transmission between the two nodes is not
possible. For example, if a node forwarding a Route Reply discovers possible. For example, if a node forwarding a Route Reply discovers
that the next hop is unreachable, it places that next hop in the that the next hop is unreachable, it places that next hop in the
node's Blacklist. node's blacklist.
Once a node discovers that it can communicate bidirectionally with Once a node discovers that it can communicate bidirectionally with
one of the nodes listed in the Blacklist, it SHOULD remove that one of the nodes listed in the blacklist, it SHOULD remove that node
node from the Blacklist. For example, if node A has node B listed from the blacklist. For example, if node A has node B listed in its
in its Blacklist, but after transmitting a Route Request, node A blacklist, but after transmitting a Route Request, node A hears B
hears B forward the Route Request with a hop list indicating that the forward the Route Request with a route record indicating that the
broadcast from A to B was successful, then A SHOULD remove the entry broadcast from A to B was successful, then A SHOULD remove the entry
for node B from its Blacklist. for node B from its blacklist.
A node MUST associate a state with each node listed in its Blacklist, A node MUST associate a state with each node listed in its blacklist,
specifying whether the unidirectionality of the link to that node specifying whether the unidirectionality of the link to that node is
is "questionable" or "probable". Each time the unreachability is "questionable" or "probable". Each time the unreachability is
positively determined, the node SHOULD set the state to "probable". positively determined, the node SHOULD set the state to "probable".
After the unreachability has not been positively determined for some After the unreachability has not been positively determined for some
amount of time, the state SHOULD revert to "questionable". A node amount of time, the state SHOULD revert to "questionable". A node
MAY expire entries for nodes from its Blacklist after a reasonable MAY expire entries for nodes from its blacklist after a reasonable
amount of time. amount of time.
5. Additional Conceptual Data Structures for Flow State Extension 5. Additional Conceptual Data Structures for Flow State Extension
This section defines additional conceptual data structures used by This section defines additional conceptual data structures used by
the optional "flow state" extension to DSR. In an implementation of the optional "flow state" extension to DSR. In an implementation of
the protocol, these data structures MAY be implemented in any manner the protocol, these data structures MUST be implemented in a manner
consistent with the external behavior described in this document. consistent with the external behavior described in this document, but
the choice of implementation used is otherwise unconstrained.
5.1. Flow Table 5.1. Flow Table
A node implementing the flow state extension MUST implement a Flow A node implementing the flow state extension MUST implement a Flow
Table or other data structure consistent with the external behavior Table or other data structure consistent with the external behavior
described in this section. A node not implementing the flow state described in this section. A node not implementing the flow state
extension SHOULD NOT implement a Flow Table. extension SHOULD NOT implement a Flow Table.
The Flow Table records information about flows from which packets The Flow Table records information about flows from which packets
recently have been sent or forwarded by this node. The table is recently have been sent or forwarded by this node. The table is
indexed by a triple (IP Source Address, IP Destination Address, indexed by a triple (IP Source Address, IP Destination Address, Flow
Flow ID), where Flow ID is a 16-bit token assigned by the source as ID), where Flow ID is a 16-bit number assigned by the source as
described in Section 3.5.1. Each entry in the Flow Table contains described in Section 3.5.1. Each entry in the Flow Table contains
the following fields: the following fields:
- The MAC address of the next-hop node along this flow. - The MAC address of the next-hop node along this flow.
- An indication of the outgoing network interface on this node to - An indication of the outgoing network interface on this node to be
be used in transmitting packets along this flow. used in transmitting packets along this flow.
- The MAC address of the previous-hop node along this flow. - The MAC address of the previous-hop node along this flow.
- An indication of the network interface on this node from which - An indication of the network interface on this node from which
packets from that previous-hop node are received. packets from that previous-hop node are received.
- A timeout after which this entry in the Flow Table MUST be - A timeout after which this entry in the Flow Table MUST be
deleted. deleted.
- The expected value of the Hop Count field in the DSR Flow State - The expected value of the Hop Count field in the DSR Flow State
header for packets received for forwarding along this field (for header for packets received for forwarding along this field (for
use with packets containing a DSR Flow State header). use with packets containing a DSR Flow State header).
- An indication of whether or not this flow can be used as a - An indication of whether or not this flow can be used as a default
default flow for packets originated by this node (the flow IP flow for packets originated by this node (the Flow ID of a default
MUST be odd). flow MUST be odd).
- The entry SHOULD record the complete source route for the flow. - The entry SHOULD record the complete source route for the flow.
(Nodes not recording the complete source route cannot participate (Nodes not recording the complete source route cannot participate
in Automatic Route Shortening.) in Automatic Route Shortening.)
- The entry MAY contain a field recording the time this entry was - The entry MAY contain a field recording the time this entry was
last used. last used.
The entry MUST be deleted when its timeout expires. The entry MUST be deleted when its timeout expires.
5.2. Automatic Route Shortening Table 5.2. Automatic Route Shortening Table
A node implementing the flow state extension SHOULD implement an A node implementing the flow state extension SHOULD implement an
Automatic Route Shortening Table or other data structure consistent Automatic Route Shortening Table or other data structure consistent
with the external behavior described in this section. A node with the external behavior described in this section. A node not
not implementing the flow state extension SHOULD NOT implement an implementing the flow state extension SHOULD NOT implement an
Automatic Route Shortening Table. Automatic Route Shortening Table.
The Automatic Route Shortening Table records information about The Automatic Route Shortening Table records information about
received packets for which Automatic Route Shortening may be received packets for which Automatic Route Shortening may be
possible. The table is indexed by a triple (IP Source Address, IP possible. The table is indexed by a triple (IP Source Address, IP
Destination Address, Flow ID). Each entry in the Automatic Route Destination Address, Flow ID). Each entry in the Automatic Route
Shortening Table contains a list of (packet identifier, Hop Count) Shortening Table contains a list of (packet identifier, Hop Count)
pairs for that flow. The packet identifier in the list may be any pairs for that flow. The packet identifier in the list may be any
unique identifier for the received packet; for example, for IPv4 unique identifier for the received packet; for example, for IPv4
packets, the combination of the following fields from the packet's packets, the combination of the following fields from the packet's IP
IP header MAY be used as a unique identifier for the packet: Source header MAY be used as a unique identifier for the packet: Source
Address, Destination Address, Identification, Protocol, Fragment, Address, Destination Address, Identification, Protocol, Fragment
and Total Length. The Hop Count in the list in the entry is copied Offset, and Total Length. The Hop Count in the list in the entry is
from the Hop Count field in the DSR Flow State header of the received copied from the Hop Count field in the DSR Flow State header of the
packet for which this table entry was created. Any packet identifier received packet for which this table entry was created. Any packet
SHOULD appear at most once in the list in an entry, and this list identifier SHOULD appear at most once in an entry's list, and this
item SHOULD record the minimum Hop Count value received for that list item SHOULD record the minimum Hop Count value received for that
packet (if the wireless signal strength or signal-to-noise ratio at packet (if the wireless signal strength or signal-to-noise ratio at
which a packet is received is available to the DSR implementation which a packet is received is available to the DSR implementation in
in a node, the node MAY, for example, remember instead in this list a node, the node MAY, for example, remember instead in this list the
the minimum Hop Count value for which the received packet's signal minimum Hop Count value for which the received packet's signal
strength or signal-to-noise ratio exceeded some threshold). strength or signal-to-noise ratio exceeded some threshold).
Space in the Automatic Route Shortening Table of a node MAY be Space in the Automatic Route Shortening Table of a node MAY be
dynamically managed by any local algorithm at the node. For example, dynamically managed by any local algorithm at the node. For example,
in order to limit the amount of memory used to store the table, any in order to limit the amount of memory used to store the table, any
existing entry MAY be deleted at any time, and the number of packets existing entry MAY be deleted at any time, and the number of packets
listed in each entry MAY be limited. However, when reclaiming space listed in each entry MAY be limited. However, when reclaiming space
in the table, nodes SHOULD favor retaining information about more in the table, nodes SHOULD favor retaining information about more
flows in the table rather than more packets listed in each entry flows in the table rather than about more packets listed in each
in the table, as long as at least the listing of some small number entry in the table, as long as at least the listing of some small
of packets (e.g., 3) can be retained in each entry. In addition, number of packets (e.g., 3) can be retained in each entry.
subject to any implementation limit on the number of packets listed
in each entry in the table, information about a packet listed in an
entry SHOULD be retained until the expiration of the packet's IP TTL.
5.3. Default Flow ID Table 5.3. Default Flow ID Table
A node implementing the flow state extension MUST implement a Default A node implementing the flow state extension MUST implement a Default
Flow Table or other data structure consistent with the external Flow Table or other data structure consistent with the external
behavior described in this section. A node not implementing the flow behavior described in this section. A node not implementing the flow
state extension SHOULD NOT implement a Default Flow Table. state extension SHOULD NOT implement a Default Flow Table.
For each (source, destination) pair for which a node forwards For each (IP Source Address, IP Destination Address) pair for which a
packets, the node MUST record: node forwards packets, the node MUST record:
- the largest odd Flow ID value seen - The largest odd Flow ID value seen.
- the time at which all of this (source, destination) pair's flows - The time at which all the corresponding flows that are forwarded
that are forwarded by this node expire by this node expire.
- the current default Flow ID - The current default Flow ID.
- a flag indicating whether or not the current default Flow ID is - A flag indicating whether or not the current default Flow ID is
valid valid.
If a node deletes this record for a (source, destination) pair, If a node deletes this record for an (IP Source Address, IP
it MUST also delete all Flow Table entries for that (source, Destination Address) pair, it MUST also delete all Flow Table entries
destination) pair. Nodes MUST delete table entries if all of this for that pair. Nodes MUST delete table entries if all of this (IP
(source, destination) pair's flows that are forwarded by this node Source Address, IP Destination Address) pair's flows that are
expire. forwarded by this node expire.
6. DSR Options Header Format 6. DSR Options Header Format
The Dynamic Source Routing protocol makes use of a special header The Dynamic Source Routing protocol makes use of a special header
carrying control information that can be included in any existing carrying control information that can be included in any existing IP
IP packet. This DSR Options header in a packet contains a small packet. This DSR Options header in a packet contains a small fixed-
fixed-sized, 4-octet portion, followed by a sequence of zero or more sized, 4-octet portion, followed by a sequence of zero or more DSR
DSR options carrying optional information. The end of the sequence options carrying optional information. The end of the sequence of
of DSR options in the DSR Options header is implied by total length DSR options in the DSR Options header is implied by the total length
of the DSR Options header. of the DSR Options header.
For IPv4, the DSR Options header MUST immediately follow the IP For IPv4, the DSR Options header MUST immediately follow the IP
header in the packet. (If a Hop-by-Hop Options extension header, as header in the packet. (If a Hop-by-Hop Options extension header, as
defined in IPv6 [7], becomes defined for IPv4, the DSR Options header defined in IPv6 [RFC2460], becomes defined for IPv4, the DSR Options
MUST immediately follow the Hop-by-Hop Options extension header, if header MUST immediately follow the Hop-by-Hop Options extension
one is present in the packet, and MUST otherwise immediately follow header, if one is present in the packet, and MUST otherwise
the IP header.) immediately follow the IP header.)
To add a DSR Options header to a packet, the DSR Options header is To add a DSR Options header to a packet, the DSR Options header is
inserted following the packet's IP header, before any following inserted following the packet's IP header, before any following
header such as a traditional (e.g., TCP or UDP) transport layer header such as a traditional (e.g., TCP or UDP) transport layer
header. Specifically, the Protocol field in the IP header is used header. Specifically, the Protocol field in the IP header is used to
to indicate that a DSR Options header follows the IP header, and the indicate that a DSR Options header follows the IP header, and the
Next Header field in the DSR Options header is used to indicate the Next Header field in the DSR Options header is used to indicate the
type of protocol header (such as a transport layer header) following type of protocol header (such as a transport layer header) following
the DSR Options header. the DSR Options header.
If any headers follow the DSR Options header in a packet, the total If any headers follow the DSR Options header in a packet, the total
length of the DSR Options header (and thus the total, combined length length of the DSR Options header (and thus the total, combined length
of all DSR options present) MUST be a multiple of 4 octets. This of all DSR options present) MUST be a multiple of 4 octets. This
requirement preserves the alignment of these following headers in the requirement preserves the alignment of these following headers in the
packet. packet.
6.1. Fixed Portion of DSR Options Header 6.1. Fixed Portion of DSR Options Header
The fixed portion of the DSR Options header is used to carry The fixed portion of the DSR Options header is used to carry
information that must be present in any DSR Options header. This information that must be present in any DSR Options header. This
fixed portion of the DSR Options header has the following format: fixed portion of the DSR Options header has the following format:
0 1 2 3 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 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 |F| Reserved | Payload Length | | Next Header |F| Reserved | Payload Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. . . .
. Options . . Options .
. . . .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Next Header Next Header
8-bit selector. Identifies the type of header immediately 8-bit selector. Identifies the type of header immediately
following the DSR Options header. Uses the same values as the following the DSR Options header. Uses the same values as the
IPv4 Protocol field [34]. IPv4 Protocol field [RFC1700]. If no header follows, then Next
Header MUST have the value 59, "No Next Header" [RFC2460].
Flow State Header (F) Flow State Header (F)
Flag bit. MUST be set to 0. This bit is set in a DSR Flow Flag bit. MUST be set to 0. This bit is set in a DSR Flow
State header (Section 7.1) and clear in a DSR Options header. State header (Section 7.1) and clear in a DSR Options header.
Reserved Reserved
MUST be sent as 0 and ignored on reception. MUST be sent as 0 and ignored on reception.
skipping to change at page 35, line 49 skipping to change at page 38, line 18
fixed portion. The value of the Payload Length field defines fixed portion. The value of the Payload Length field defines
the total length of all options carried in the DSR Options the total length of all options carried in the DSR Options
header. header.
Options Options
Variable-length field; the length of the Options field is Variable-length field; the length of the Options field is
specified by the Payload Length field in this DSR Options specified by the Payload Length field in this DSR Options
header. Contains one or more pieces of optional information header. Contains one or more pieces of optional information
(DSR options), encoded in type-length-value (TLV) format (with (DSR options), encoded in type-length-value (TLV) format (with
the exception of the Pad1 option, described in Section 6.8). the exception of the Pad1 option described in Section 6.8).
The placement of DSR options following the fixed portion of the DSR The placement of DSR options following the fixed portion of the DSR
Options header MAY be padded for alignment. However, due to the Options header MAY be padded for alignment. However, due to the
typically limited available wireless bandwidth in ad hoc networks, typically limited available wireless bandwidth in ad hoc networks,
this padding is not required, and receiving nodes MUST NOT expect this padding is not required, and receiving nodes MUST NOT expect
options within a DSR Options header to be aligned. options within a DSR Options header to be aligned.
Each DSR option is assigned a unique Option Type code. The most Each DSR option is assigned a unique Option Type code. The most
significant 3 bits (that is, Option Type & 0xE0) allow a node not significant 3 bits (that is, Option Type & 0xE0) allow a node not
implementing processing for this Option Type value to behave in the implementing processing for this Option Type value to behave in the
manner closest to correct for that type: manner closest to correct for that type:
- The most significant bit in the Option Type value (that is, - The most significant bit in the Option Type value (that is, Option
Option Type & 0x80) represents whether or not a node receiving Type & 0x80) represents whether or not a node receiving this
this Option Type SHOULD respond to such a DSR option with a Route Option Type (when the node does not implement processing for this
Error of type OPTION_NOT_SUPPORTED, except that such a Route Option Type) SHOULD respond to such a DSR option with a Route
Error SHOULD never be sent in response to a packet containing a Error of type OPTION_NOT_SUPPORTED, except that such a Route Error
Route Request option. SHOULD never be sent in response to a packet containing a Route
Request option.
- The two follow bits in the Option Type value (that is, - The two following bits in the Option Type value (that is, Option
Option Type & 0x60) are a two-bit field indicating how such a Type & 0x60) are a two-bit field indicating how such a node that
node that does not support this Option Type MUST process the does not support this Option Type MUST process the packet:
packet:
00 = Ignore Option 00 = Ignore Option
01 = Remove Option 01 = Remove Option
10 = Mark Option 10 = Mark Option
11 = Drop Packet 11 = Drop Packet
When these two bits are zero (that is, Option Type & 0x60 == 0), When these 2 bits are 00 (that is, Option Type & 0x60 == 0), a
a node not implementing processing for that Option Type node not implementing processing for that Option Type MUST use the
MUST use the Opt Data Len field to skip over the option and Opt Data Len field to skip over the option and continue
continue processing. When these two bits are 01 (that is, processing. When these 2 bits are 01 (that is, Option Type & 0x60
Option Type & 0x60 == 0x20), a node not implementing processing == 0x20), a node not implementing processing for that Option Type
for that Option Type MUST use the Opt Data Len field to remove MUST use the Opt Data Len field to remove the option from the
the option from the packet and continue processing as if the packet and continue processing as if the option had not been
option had not been included in the received packet. When these included in the received packet. When these 2 bits are 10 (that
two bits are 10 (that is, Option Type & 0x60 == 0x40), a node not is, Option Type & 0x60 == 0x40), a node not implementing
implementing processing for that Option Type MUST set the most processing for that Option Type MUST set the most significant bit
significant bit following the Opt Data Len field, MUST ignore the following the Opt Data Len field, MUST ignore the contents of the
contents of the option using the Opt Data Len field, and MUST option using the Opt Data Len field, and MUST continue processing
continue processing the packet. Finally, when these two bits are the packet. Finally, when these 2 bits are 11 (that is, Option
11 (that is, Option Type & 0x60 == 0x60), a node not implementing Type & 0x60 == 0x60), a node not implementing processing for that
processing for that Option Type MUST drop the packet. Option Type MUST drop the packet.
The following types of DSR options are defined in this document for The following types of DSR options are defined in this document for
use within a DSR Options header: use within a DSR Options header:
- Route Request option (Section 6.2) - Route Request option (Section 6.2)
- Route Reply option (Section 6.3) - Route Reply option (Section 6.3)
- Route Error option (Section 6.4) - Route Error option (Section 6.4)
- Acknowledgement Request option (Section 6.5) - Acknowledgement Request option (Section 6.5)
- Acknowledgement option (Section 6.6) - Acknowledgement option (Section 6.6)
- DSR Source Route option (Section 6.7) - DSR Source Route option (Section 6.7)
- Pad1 option (Section 6.8) - Pad1 option (Section 6.8)
- PadN option (Section 6.9) - PadN option (Section 6.9)
In addition, Section 7 specifies further DSR options for use with the In addition, Section 7 specifies further DSR options for use with the
optional DSR flow state extension. optional DSR flow state extension.
6.2. Route Request Option 6.2. Route Request Option
The Route Request option in a DSR Options header is encoded as The Route Request option in a DSR Options header is encoded as
follows: follows:
0 1 2 3 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 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type | Opt Data Len | Identification | | Option Type | Opt Data Len | Identification |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Target Address | | Target Address |
skipping to change at page 38, line 41 skipping to change at page 40, line 41
Intermediate nodes that retransmit the packet to propagate the Intermediate nodes that retransmit the packet to propagate the
Route Request MUST NOT change this field. Route Request MUST NOT change this field.
Destination Address Destination Address
MUST be set to the IP limited broadcast address MUST be set to the IP limited broadcast address
(255.255.255.255). (255.255.255.255).
Hop Limit (TTL) Hop Limit (TTL)
MAY be varied from 1 to 255, for example to implement MAY be varied from 1 to 255, for example, to implement non-
non-propagating Route Requests and Route Request expanding-ring propagating Route Requests and Route Request expanding-ring
searches (Section 3.3.3). searches (Section 3.3.3).
Route Request fields: Route Request fields:
Option Type Option Type
1. Nodes not understanding this option will ignore this 1. Nodes not understanding this option will ignore this
option. option.
Opt Data Len Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
excluding the Option Type and Opt Data Len fields. excluding the Option Type and Opt Data Len fields. MUST be set
equal to (4 * n) + 6, where n is the number of addresses in the
Route Request Option.
Identification Identification
A unique value generated by the initiator (original sender) of A unique value generated by the initiator (original sender) of
the Route Request. Nodes initiating a Route Request generate the Route Request. Nodes initiating a Route Request generate a
a new Identification value for each Route Request, for example new Identification value for each Route Request, for example
based on a sequence number counter of all Route Requests based on a sequence number counter of all Route Requests
initiated by the node. initiated by the node.
This value allows a receiving node to determine whether it This value allows a receiving node to determine whether it has
has recently seen a copy of this Route Request: if this recently seen a copy of this Route Request. If this
Identification value is found by this receiving node in its Identification value (for this IP Source address and Target
Route Request Table (in the cache of Identification values Address) is found by this receiving node in its Route Request
in the entry there for this initiating node), this receiving Table (in the cache of Identification values in the entry there
node MUST discard the Route Request. When propagating a Route for this initiating node), this receiving node MUST discard the
Request, this field MUST be copied from the received copy of Route Request. When a Route Request is propagated, this field
the Route Request being propagated. MUST be copied from the received copy of the Route Request
being propagated.
Target Address Target Address
The address of the node that is the target of the Route The address of the node that is the target of the Route
Request. Request.
Address[1..n] Address[1..n]
Address[i] is the address of the i-th node recorded in the Address[i] is the IPv4 address of the i-th node recorded in the
Route Request option. The address given in the Source Address Route Request option. The address given in the Source Address
field in the IP header is the address of the initiator of field in the IP header is the address of the initiator of the
the Route Discovery and MUST NOT be listed in the Address[i] Route Discovery and MUST NOT be listed in the Address[i]
fields; the address given in Address[1] is thus the address fields; the address given in Address[1] is thus the IPv4
of the first node on the path after the initiator. The address of the first node on the path after the initiator. The
number of addresses present in this field is indicated by the number of addresses present in this field is indicated by the
Opt Data Len field in the option (n = (Opt Data Len - 6) / 4). Opt Data Len field in the option (n = (Opt Data Len - 6) / 4).
Each node propagating the Route Request adds its own address to Each node propagating the Route Request adds its own address to
this list, increasing the Opt Data Len value by 4 octets. this list, increasing the Opt Data Len value by 4 octets.
The Route Request option MUST NOT appear more than once within a DSR The Route Request option MUST NOT appear more than once within a DSR
Options header. Options header.
6.3. Route Reply Option 6.3. Route Reply Option
The Route Reply option in a DSR Options header is encoded as follows: The Route Reply option in a DSR Options header is encoded as follows:
0 1 2 3 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 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type | Opt Data Len |L| Reserved | | Option Type | Opt Data Len |L| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address[1] | | Address[1] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 40, line 27 skipping to change at page 42, line 27
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... | | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address[n] | | Address[n] |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP fields: IP fields:
Source Address Source Address
Set to the address of the node sending the Route Reply. Set to the address of the node sending the Route Reply. In the
In the case of a node sending a reply from its Route case of a node sending a reply from its Route Cache (Section
Cache (Section 3.3.2) or sending a gratuitous Route Reply 3.3.2) or sending a gratuitous Route Reply (Section 3.4.3),
(Section 3.4.3), this address can differ from the address that this address can differ from the address that was the target of
was the target of the Route Discovery. the Route Discovery.
Destination Address Destination Address
MUST be set to the address of the source node of the route MUST be set to the address of the source node of the route
being returned. Copied from the Source Address field of the being returned. Copied from the Source Address field of the
Route Request generating the Route Reply, or in the case of a Route Request generating the Route Reply or, in the case of a
gratuitous Route Reply, copied from the Source Address field of gratuitous Route Reply, copied from the Source Address field of
the data packet triggering the gratuitous Reply. the data packet triggering the gratuitous Reply.
Route Reply fields: Route Reply fields:
Option Type Option Type
2. Nodes not understanding this option will ignore this 2. Nodes not understanding this option will ignore this
option. option.
Opt Data Len Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
excluding the Option Type and Opt Data Len fields. excluding the Option Type and Opt Data Len fields. MUST be set
equal to (4 * n) + 1, where n is the number of addresses in the
Route Reply Option.
Last Hop External (L) Last Hop External (L)
Set to indicate that the last hop given by the Route Reply Set to indicate that the last hop given by the Route Reply (the
(the link from Address[n-1] to Address[n]) is actually an link from Address[n-1] to Address[n]) is actually an arbitrary
arbitrary path in a network external to the DSR network; the path in a network external to the DSR network; the exact route
exact route outside the DSR network is not represented in the outside the DSR network is not represented in the Route Reply.
Route Reply. Nodes caching this hop in their Route Cache MUST Nodes caching this hop in their Route Cache MUST flag the
flag the cached hop with the External flag. Such hops MUST NOT cached hop with the External flag. Such hops MUST NOT be
be returned in a cached Route Reply generated from this Route returned in a cached Route Reply generated from this Route
Cache entry, and selection of routes from the Route Cache to Cache entry, and selection of routes from the Route Cache to
route a packet being sent MUST prefer routes that contain no route a packet being sent SHOULD prefer routes that contain no
hops flagged as External. hops flagged as External.
Reserved Reserved
MUST be sent as 0 and ignored on reception. MUST be sent as 0 and ignored on reception.
Address[1..n] Address[1..n]
The source route being returned by the Route Reply. The route The source route being returned by the Route Reply. The route
indicates a sequence of hops, originating at the source node indicates a sequence of hops, originating at the source node
specified in the Destination Address field of the IP header specified in the Destination Address field of the IP header of
of the packet carrying the Route Reply, through each of the the packet carrying the Route Reply, through each of the
Address[i] nodes in the order listed in the Route Reply, Address[i] nodes in the order listed in the Route Reply, ending
ending with the destination node indicated by Address[n]. at the node indicated by Address[n]. The number of addresses
The number of addresses present in the Address[1..n] present in the Address[1..n] field is indicated by the Opt Data
field is indicated by the Opt Data Len field in the option Len field in the option (n = (Opt Data Len - 1) / 4).
(n = (Opt Data Len - 1) / 4).
A Route Reply option MAY appear one or more times within a DSR A Route Reply option MAY appear one or more times within a DSR
Options header. Options header.
6.4. Route Error Option 6.4. Route Error Option
The Route Error option in a DSR Options header is encoded as follows: The Route Error option in a DSR Options header is encoded as follows:
0 1 2 3 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 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type | Opt Data Len | Error Type |Reservd|Salvage| | Option Type | Opt Data Len | Error Type |Reservd|Salvage|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Source Address | | Error Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at page 42, line 52 skipping to change at page 45, line 5
Type-Specific Information as indicated by the Option Type Type-Specific Information as indicated by the Option Type
value in the option, the remaining octets are interpreted as value in the option, the remaining octets are interpreted as
extensions. Currently, no such further extensions have been extensions. Currently, no such further extensions have been
defined. defined.
Error Type Error Type
The type of error encountered. Currently, the following type The type of error encountered. Currently, the following type
values are defined: values are defined:
1 = NODE_UNREACHABLE 1 = NODE_UNREACHABLE
2 = FLOW_STATE_NOT_SUPPORTED 2 = FLOW_STATE_NOT_SUPPORTED
3 = OPTION_NOT_SUPPORTED 3 = OPTION_NOT_SUPPORTED
Other values of the Error Type field are reserved for future Other values of the Error Type field are reserved for future
use. use.
Reservd Reservd
Reserved. MUST be sent as 0 and ignored on reception. Reserved. MUST be sent as 0 and ignored on reception.
Salvage Salvage
A 4-bit unsigned integer. Copied from the Salvage field in A 4-bit unsigned integer. Copied from the Salvage field in the
the DSR Source Route option of the packet triggering the Route DSR Source Route option of the packet triggering the Route
Error. Error.
The "total salvage count" of the Route Error option is derived The "total salvage count" of the Route Error option is derived
from the value in the Salvage field of this Route Error option from the value in the Salvage field of this Route Error option
and all preceding Route Error options in the packet as follows: and all preceding Route Error options in the packet as follows:
the total salvage count is the sum of, for each such Route the total salvage count is the sum of, for each such Route
Error option, one plus the value in the Salvage field of that Error option, one plus the value in the Salvage field of that
Route Error option. Route Error option.
Error Source Address Error Source Address
The address of the node originating the Route Error (e.g., the The address of the node originating the Route Error (e.g., the
node that attempted to forward a packet and discovered the link node that attempted to forward a packet and discovered the link
failure). failure).
Error Destination Address Error Destination Address
The address of the node to which the Route Error must be The address of the node to which the Route Error must be
delivered For example, when the Error Type field is set to delivered. For example, when the Error Type field is set to
NODE_UNREACHABLE, this field will be set to the address of the NODE_UNREACHABLE, this field will be set to the address of the
node that generated the routing information claiming that the node that generated the routing information claiming that the
hop from the Error Source Address to Unreachable Node Address hop from the Error Source Address to Unreachable Node Address
(specified in the Type-Specific Information) was a valid hop. (specified in the Type-Specific Information) was a valid hop.
Type-Specific Information Type-Specific Information
Information specific to the Error Type of this Route Error Information specific to the Error Type of this Route Error
message. message.
A Route Error option MAY appear one or more times within a DSR A Route Error option MAY appear one or more times within a DSR
Options header. Options header.
6.4.1. Node Unreachable Type-Specific Information 6.4.1. Node Unreachable Type-Specific Information
When the Route Error is of type NODE_UNREACHABLE, the When the Route Error is of type NODE_UNREACHABLE, the Type-Specific
Type-Specific Information field is defined as follows: Information field is defined as follows:
0 1 2 3 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 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Unreachable Node Address | | Unreachable Node Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Unreachable Node Address Unreachable Node Address
The address of the node that was found to be unreachable The IP address of the node that was found to be unreachable
(the next-hop neighbor to which the node with address (the next-hop neighbor to which the node with address
Error Source Address was attempting to transmit the packet). Error Source Address was attempting to transmit the packet).
6.4.2. Flow State Not Supported Type-Specific Information 6.4.2. Flow State Not Supported Type-Specific Information
When the Route Error is of type FLOW_STATE_NOT_SUPPORTED, the When the Route Error is of type FLOW_STATE_NOT_SUPPORTED, the
Type-Specific Information field is empty. Type-Specific Information field is empty.
6.4.3. Option Not Supported Type-Specific Information 6.4.3. Option Not Supported Type-Specific Information
When the Route Error is of type OPTION_NOT_SUPPORTED, the When the Route Error is of type OPTION_NOT_SUPPORTED, the
Type-Specific Information field is defined as follows: Type-Specific Information field is defined as follows:
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
|Unsupported Opt| |Unsupported Opt|
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
Unsupported Opt Unsupported Opt
The type of option triggering the Route Error. The Option Type of option triggering the Route Error.
6.5. Acknowledgement Request Option 6.5. Acknowledgement Request Option
The Acknowledgement Request option in a DSR Options header is encoded The Acknowledgement Request option in a DSR Options header is encoded
as follows: as follows:
0 1 2 3 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 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type | Opt Data Len | Identification | | Option Type | Opt Data Len | Identification |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Option Type Option Type
160. Nodes not understanding this option will remove the 160. Nodes not understanding this option will remove the
option and return a Route Error. option and return a Route Error.
Opt Data Len Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
excluding the Option Type and Opt Data Len fields. excluding the Option Type and Opt Data Len fields.
skipping to change at page 46, line 5 skipping to change at page 47, line 23
Identification Identification
The Identification field is set to a unique value and is copied The Identification field is set to a unique value and is copied
into the Identification field of the Acknowledgement option into the Identification field of the Acknowledgement option
when returned by the node receiving the packet over this hop. when returned by the node receiving the packet over this hop.
An Acknowledgement Request option MUST NOT appear more than once An Acknowledgement Request option MUST NOT appear more than once
within a DSR Options header. within a DSR Options header.
6.6. Acknowledgement Option 6.6. Acknowledgement Option
The Acknowledgement option in a DSR Options header is encoded as The Acknowledgement option in a DSR Options header is encoded as
follows: follows:
0 1 2 3 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 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type | Opt Data Len | Identification | | Option Type | Opt Data Len | Identification |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ACK Source Address | | ACK Source Address |
skipping to change at page 47, line 5 skipping to change at page 48, line 17
The address of the node originating the acknowledgement. The address of the node originating the acknowledgement.
ACK Destination Address ACK Destination Address
The address of the node to which the acknowledgement is to be The address of the node to which the acknowledgement is to be
delivered. delivered.
An Acknowledgement option MAY appear one or more times within a DSR An Acknowledgement option MAY appear one or more times within a DSR
Options header. Options header.
6.7. DSR Source Route Option 6.7. DSR Source Route Option
The DSR Source Route option in a DSR Options header is encoded as The DSR Source Route option in a DSR Options header is encoded as
follows: follows:
0 1 2 3 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 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Option Type | Opt Data Len |F|L|Reservd|Salvage| Segs Left | | Option Type | Opt Data Len |F|L|Reservd|Salvage| Segs Left |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address[1] | | Address[1] |
skipping to change at page 47, line 38 skipping to change at page 48, line 50
Opt Data Len Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
excluding the Option Type and Opt Data Len fields. For the excluding the Option Type and Opt Data Len fields. For the
format of the DSR Source Route option defined here, this field format of the DSR Source Route option defined here, this field
MUST be set to the value (n * 4) + 2, where n is the number of MUST be set to the value (n * 4) + 2, where n is the number of
addresses present in the Address[i] fields. addresses present in the Address[i] fields.
First Hop External (F) First Hop External (F)
Set to indicate that the first hop indicated by the DSR Set to indicate that the first hop indicated by the DSR Source
Source Route option is actually an arbitrary path in a network Route option is actually an arbitrary path in a network
external to the DSR network; the exact route outside the DSR external to the DSR network; the exact route outside the DSR
network is not represented in the DSR Source Route option. network is not represented in the DSR Source Route option.
Nodes caching this hop in their Route Cache MUST flag the Nodes caching this hop in their Route Cache MUST flag the
cached hop with the External flag. Such hops MUST NOT be cached hop with the External flag. Such hops MUST NOT be
returned in a Route Reply generated from this Route Cache returned in a Route Reply generated from this Route Cache
entry, and selection of routes from the Route Cache to route entry, and selection of routes from the Route Cache to route a
a packet being sent MUST prefer routes that contain no hops packet being sent SHOULD prefer routes that contain no hops
flagged as External. flagged as External.
Last Hop External (L) Last Hop External (L)
Set to indicate that the last hop indicated by the DSR Source Set to indicate that the last hop indicated by the DSR Source
Route option is actually an arbitrary path in a network Route option is actually an arbitrary path in a network
external to the DSR network; the exact route outside the DSR external to the DSR network; the exact route outside the DSR
network is not represented in the DSR Source Route option. network is not represented in the DSR Source Route option.
Nodes caching this hop in their Route Cache MUST flag the Nodes caching this hop in their Route Cache MUST flag the
cached hop with the External flag. Such hops MUST NOT be cached hop with the External flag. Such hops MUST NOT be
returned in a Route Reply generated from this Route Cache returned in a Route Reply generated from this Route Cache
entry, and selection of routes from the Route Cache to route entry, and selection of routes from the Route Cache to route a
a packet being sent MUST prefer routes that contain no hops packet being sent SHOULD prefer routes that contain no hops
flagged as External. flagged as External.
Reserved Reserved
MUST be sent as 0 and ignored on reception. MUST be sent as 0 and ignored on reception.
Salvage Salvage
A 4-bit unsigned integer. Count of number of times that A 4-bit unsigned integer. Count of number of times that this
this packet has been salvaged as a part of DSR routing packet has been salvaged as a part of DSR routing (Section
(Section 3.4.1). 3.4.1).
Segments Left (Segs Left) Segments Left (Segs Left)
Number of route segments remaining, i.e., number of explicitly Number of route segments remaining, i.e., number of explicitly
listed intermediate nodes still to be visited before reaching listed intermediate nodes still to be visited before reaching
the final destination. the final destination.
Address[1..n] Address[1..n]
The sequence of addresses of the source route. In routing The sequence of addresses of the source route. In routing and
and forwarding the packet, the source route is processed as forwarding the packet, the source route is processed as
described in Sections 8.1.3 and 8.1.5. The number of addresses described in Sections 8.1.3 and 8.1.5. The number of addresses
present in the Address[1..n] field is indicated by the present in the Address[1..n] field is indicated by the Opt Data
Opt Data Len field in the option (n = (Opt Data Len - 2) / 4). Len field in the option (n = (Opt Data Len - 2) / 4).
When forwarding a packet along a DSR source route using a DSR Source When forwarding a packet along a DSR source route using a DSR Source
Route option in the packet's DSR Options header, the Destination Route option in the packet's DSR Options header, the Destination
Address field in the packet's IP header is always set to the address Address field in the packet's IP header is always set to the address
of the packet's ultimate destination. A node receiving a packet of the packet's ultimate destination. A node receiving a packet
containing a DSR Options header with a DSR Source Route option MUST containing a DSR Options header with a DSR Source Route option MUST
examine the indicated source route to determine if it is the intended examine the indicated source route to determine if it is the intended
next-hop node for the packet and determine how to forward the packet, next-hop node for the packet and how to forward the packet, as
as defined in Sections 8.1.4 and 8.1.5. defined in Sections 8.1.4 and 8.1.5.
6.8. Pad1 Option 6.8. Pad1 Option
The Pad1 option in a DSR Options header is encoded as follows: The Pad1 option in a DSR Options header is encoded as follows:
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
| Option Type | | Option Type |
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
Option Type Option Type
224. Nodes not understanding this option will drop the packet 224. Nodes not understanding this option will drop the packet
skipping to change at page 49, line 31 skipping to change at page 50, line 36
containing a DSR Options header. containing a DSR Options header.
If any headers follow the DSR Options header in a packet, the total If any headers follow the DSR Options header in a packet, the total
length of a DSR Options header, indicated by the Payload Length field length of a DSR Options header, indicated by the Payload Length field
in the DSR Options header MUST be a multiple of 4 octets. In this in the DSR Options header MUST be a multiple of 4 octets. In this
case, when building a DSR Options header in a packet, sufficient Pad1 case, when building a DSR Options header in a packet, sufficient Pad1
or PadN options MUST be included in the Options field of the DSR or PadN options MUST be included in the Options field of the DSR
Options header to make the total length a multiple of 4 octets. Options header to make the total length a multiple of 4 octets.
If more than one consecutive octet of padding is being inserted in If more than one consecutive octet of padding is being inserted in
the Options field of a DSR Options header, the PadN option, described the Options field of a DSR Options header, the PadN option described
next, SHOULD be used, rather than multiple Pad1 options. next, SHOULD be used, rather than multiple Pad1 options.
Note that the format of the Pad1 option is a special case; it does Note that the format of the Pad1 option is a special case; it does
not have an Opt Data Len or Option Data field. not have an Opt Data Len or Option Data field.
6.9. PadN Option 6.9. PadN Option
The PadN option in a DSR Options header is encoded as follows: The PadN option in a DSR Options header is encoded as follows:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
| Option Type | Opt Data Len | Option Data | Option Type | Opt Data Len | Option Data
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - -
Option Type Option Type
0. Nodes not understanding this option will ignore this 0. Nodes not understanding this option will ignore this
option. option.
Opt Data Len Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
excluding the Option Type and Opt Data Len fields. excluding the Option Type and Opt Data Len fields. The size of
the Option Data field.
Option Data Option Data
A number of zero-valued octets equal to the Opt Data Len. A number of zero-valued octets equal to the Opt Data Len.
A PadN option MAY be included in the Options field of a DSR Options A PadN option MAY be included in the Options field of a DSR Options
header in order to align subsequent DSR options, but such alignment header in order to align subsequent DSR options, but such alignment
is not required and MUST NOT be expected by a node receiving a packet is not required and MUST NOT be expected by a node receiving a packet
containing a DSR Options header. containing a DSR Options header.
If any headers follow the DSR Options header in a packet, the total If any headers follow the DSR Options header in a packet, the total
length of a DSR Options header, indicated by the Payload Length field length of a DSR Options header, indicated by the Payload Length field
in the DSR Options header MUST be a multiple of 4 octets. In this in the DSR Options header, MUST be a multiple of 4 octets. In this
case, when building a DSR Options header in a packet, sufficient Pad1 case, when building a DSR Options header in a packet, sufficient Pad1
or PadN options MUST be included in the Options field of the DSR or PadN options MUST be included in the Options field of the DSR
Options header to make the total length a multiple of 4 octets. Options header to make the total length a multiple of 4 octets.
7. Additional Header Formats and Options for Flow State Extension 7. Additional Header Formats and Options for Flow State Extension
The optional DSR flow state extension requires a new header type, the The optional DSR flow state extension requires a new header type, the
DSR Flow State header. DSR Flow State header.
In addition, the DSR flow state extension adds the following options In addition, the DSR flow state extension adds the following options
for the DSR Options header defined in Section 6: for the DSR Options header defined in Section 6:
- Timeout option (Section 7.2.1 - Timeout option (Section 7.2.1)
- Destination and Flow ID option (Section 7.2.2 - Destination and Flow ID option (Section 7.2.2)
Two new Error Type values are also defined for use in the Route Error Two new Error Type values are also defined for use in the Route Error
option in a DSR Options header: option in a DSR Options header:
- Unknown Flow - UNKNOWN_FLOW
- Default Flow Unknown - DEFAULT_FLOW_UNKNOWN
Finally, an extension to the Acknowledgement Request option in a DSR Finally, an extension to the Acknowledgement Request option in a DSR
Options header is also defined: Options header is also defined:
- Previous Hop Address - Previous Hop Address
This section defines each of these new header or option formats. This section defines each of these new header, option, or extension
formats.
7.1. DSR Flow State Header 7.1. DSR Flow State Header
The DSR Flow State header is a small 4-byte header optionally used The DSR Flow State header is a small 4-byte header optionally used to
to carry the flow ID and hop count for a packet being sent along a carry the flow ID and hop count for a packet being sent along a DSR
DSR flow. It is distinguished from the fixed DSR Options header flow. It is distinguished from the fixed DSR Options header (Section
(Section 6.1) in that the Flow State Header (F) bit is set in the DSR 6.1) in that the Flow State Header (F) bit is set in the DSR Flow
Flow State header and is clear in the fixed DSR Options header. State header and is clear in the fixed DSR Options header.
0 1 2 3 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 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 |F| Hop Count | Flow Identifier | | Next Header |F| Hop Count | Flow Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Next Header Next Header
8-bit selector. Identifies the type of header immediately 8-bit selector. Identifies the type of header immediately
following the DSR Flow State header. Uses the same values as following the DSR Flow State header. Uses the same values as
the IPv4 Protocol field [34]. the IPv4 Protocol field [RFC1700].
Flow State Header (F) Flow State Header (F)
Flag bit. MUST be set to 1. This bit is set in a DSR Flow Flag bit. MUST be set to 1. This bit is set in a DSR Flow
State header and clear in a DSR Options header (Section 6.1). State header and clear in a DSR Options header (Section 6.1).
Hop Count Hop Count
7-bit unsigned integer. The number of hops through which this 7-bit unsigned integer. The number of hops through which this
packet has been forwarded. packet has been forwarded.
Flow Identification Flow Identification
The flow ID for this flow, as described in Section 3.5.1. The flow ID for this flow, as described in Section 3.5.1.
7.2. New Options and Extensions in DSR Options Header 7.2. New Options and Extensions in DSR Options Header
7.2.1. Timeout Option 7.2.1. Timeout Option
The Timeout option is defined for use in a DSR Options header to The Timeout option is defined for use in a DSR Options header to
indicate the amount of time before the expiration of the flow ID indicate the amount of time before the expiration of the flow ID
along which the packet is being sent. along which the packet is being sent.
0 1 2 3 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 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 | Timeout | | Option Type | Opt Data Len | Timeout |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Option Type Option Type
128. Nodes not understanding this option will ignore the 128. Nodes not understanding this option will ignore the
option and return a Route Error. option and return a Route Error.
Opt Data Len Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
skipping to change at page 54, line 5 skipping to change at page 53, line 34
indicated by an Opt Data Len greater than 2. Currently, no indicated by an Opt Data Len greater than 2. Currently, no
such extensions have been defined. such extensions have been defined.
Timeout Timeout
The number of seconds for which this flow remains valid. The number of seconds for which this flow remains valid.
The Timeout option MUST NOT appear more than once within a DSR The Timeout option MUST NOT appear more than once within a DSR
Options header. Options header.
7.2.2. Destination and Flow ID Option 7.2.2. Destination and Flow ID Option
The Destination and Flow ID option is defined for use in a DSR The Destination and Flow ID option is defined for use in a DSR
Options header to send a packet to an intermediate host along one Options header to send a packet to an intermediate host along one
flow, for eventual forwarding to the final destination along a flow, for eventual forwarding to the final destination along a
different flow. This option enables the aggregation of the state of different flow. This option enables the aggregation of the state of
multiple flows. multiple flows.
0 1 2 3 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 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 | New Flow Identifier | | Option Type | Opt Data Len | New Flow Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| New IP Destination Address | | New IP Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Option Type Option Type
129. Nodes not understanding this option will ignore the 129. Nodes not understanding this option will ignore the
option and return a Route Error. option and return a Route Error.
Opt Data Len Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
excluding the Option Type and Opt Data Len fields. excluding the Option Type and Opt Data Len fields.
skipping to change at page 54, line 32 skipping to change at page 54, line 15
129. Nodes not understanding this option will ignore the 129. Nodes not understanding this option will ignore the
option and return a Route Error. option and return a Route Error.
Opt Data Len Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
excluding the Option Type and Opt Data Len fields. excluding the Option Type and Opt Data Len fields.
When no extensions are present, the Opt Data Len of a When no extensions are present, the Opt Data Len of a
Destination and Flow ID option is 6. Further extensions to Destination and Flow ID option is 6. Further extensions to DSR
DSR may include additional data in a Destination and Flow ID may include additional data in a Destination and Flow ID
option. The presence of such extensions is indicated by an option. The presence of such extensions is indicated by an Opt
Opt Data Len greater than 6. Currently, no such extensions Data Len greater than 6. Currently, no such extensions have
have been defined. been defined.
New Flow Identifier New Flow Identifier
Indicates the next identifier to store in the Flow ID field of Indicates the next identifier to store in the Flow ID field of
the DSR Options header. the DSR Options header.
New IP Destination Address New IP Destination Address
Indicates the next address to store in the Destination Address Indicates the next address to store in the Destination Address
field of the IP header. field of the IP header.
The Destination and Flow ID option MAY appear one or more times The Destination and Flow ID option MAY appear one or more times
within a DSR Options header. within a DSR Options header.
7.3. New Error Types for Route Error Option 7.3. New Error Types for Route Error Option
7.3.1. Unknown Flow Type-Specific Information 7.3.1. Unknown Flow Type-Specific Information
A new Error Type value of 129 (Unknown Flow) is defined for use in A new Error Type value of 129 (UNKNOWN_FLOW) is defined for use in a
a Route Error option in a DSR Options header. The Type-Specific Route Error option in a DSR Options header. The Type-Specific
Information for errors of this type is encoded as follows: Information for errors of this type is encoded as follows:
0 1 2 3 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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Original IP Destination Address | | Original IP Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Flow ID | | Flow ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Original IP Destination Address Original IP Destination Address
The IP Destination Address of the packet that caused the error. The IP Destination Address of the packet that caused the error.
Flow ID Flow ID
The Flow ID contained in the DSR Flow ID option that caused the The Flow ID contained in the DSR Flow ID option that caused the
error. error.
7.3.2. Default Flow Unknown Type-Specific Information 7.3.2. Default Flow Unknown Type-Specific Information
A new Error Type value of 130 (Default Flow Unknown) is defined A new Error Type value of 130 (DEFAULT_FLOW_UNKNOWN) is defined
for use in a Route Error option in a DSR Options header. The for use in a Route Error option in a DSR Options header. The
Type-Specific Information for errors of this type is encoded as Type-Specific Information for errors of this type is encoded as
follows: follows:
0 1 2 3 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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Original IP Destination Address | | Original IP Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Original IP Destination Address Original IP Destination Address
The IP Destination Address of the packet that caused the error. The IP Destination Address of the packet that caused the error.
7.4. New Acknowledgement Request Option Extension 7.4. New Acknowledgement Request Option Extension
7.4.1. Previous Hop Address Extension 7.4.1. Previous Hop Address Extension
When the Option Length field of an Acknowledgement Request option When the Opt Data Len field of an Acknowledgement Request option
in a DSR Options header is greater than or equal to 6, a Previous in a DSR Options header is greater than or equal to 6, the
Hop Address Extension is present. The option is then formatted as ACK Request Source Address field is present. The option is then
follows: formatted as follows:
0 1 2 3 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 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 | Packet Identifier | | Option Type | Opt Data Len | Packet Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ACK Request Source Address | | ACK Request Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Option Type Option Type
5 160. Nodes not understanding this option will remove the
option and return a Route Error.
Option Length Opt Data Len
8-bit unsigned integer. Length of the option, in octets, 8-bit unsigned integer. Length of the option, in octets,
excluding the Option Type and Option Length fields. excluding the Option Type and Opt Data Len fields.
When no extensions are presents, the Option Length of a When no extensions are presents, the Opt Data Len of an
Acknowledgement Request option is 2. Further extensions to Acknowledgement Request option is 2. Further extensions to DSR
DSR may include additional data in a Acknowledgement Request may include additional data in an Acknowledgement Request
option. The presence of such extensions is indicated by an option. The presence of such extensions is indicated by an Opt
Opt Data Len greater than 2. Data Len greater than 2.
Currently, one such extension has been defined. If the Currently, one such extension has been defined. If the Opt
Option Length is at least 6, then a ACK Request Source Address Data Len is at least 6, then an ACK Request Source Address is
is present. present.
Packet Identifier Packet Identifier
The Packet Identifier field is set to a unique number and is The Packet Identifier field is set to a unique number and is
copied into the Identification field of the DSR Acknowledgement copied into the Identification field of the DSR Acknowledgement
option when returned by the node receiving the packet over this option when returned by the node receiving the packet over this
hop. hop.
ACK Request Source Address ACK Request Source Address
The address of the node requesting the DSR Acknowledgement. The address of the node requesting the DSR Acknowledgement.
8. Detailed Operation 8. Detailed Operation
8.1. General Packet Processing 8.1. General Packet Processing
8.1.1. Originating a Packet 8.1.1. Originating a Packet
When originating any packet, a node using DSR routing MUST perform When originating any packet, a node using DSR routing MUST perform
the following sequence of steps: the following sequence of steps:
- Search the node's Route Cache for a route to the address given in - Search the node's Route Cache for a route to the address given in
the IP Destination Address field in the packet's header. the IP Destination Address field in the packet's header.
- If no such route is found in the Route Cache, then perform - If no such route is found in the Route Cache, then perform Route
Route Discovery for the Destination Address, as described in Discovery for the Destination Address, as described in Section
Section 8.2. Initiating a Route Discovery for this target node 8.2. Initiating a Route Discovery for this target node address
address results in the node adding a Route Request option in results in the node adding a Route Request option in a DSR Options
a DSR Options header in this existing packet, or saving this header in this existing packet, or saving this existing packet to
existing packet to its Send Buffer and initiating the Route its Send Buffer and initiating the Route Discovery by sending a
Discovery by sending a separate packet containing such a Route separate packet containing such a Route Request option. If the
Request option. If the node chooses to initiate the Route node chooses to initiate the Route Discovery by adding the Route
Discovery by adding the Route Request option to this existing Request option to this existing packet, it will replace the IP
packet, it will replace the IP Destination Address field with the Destination Address field with the IP "limited broadcast" address
IP "limited broadcast" address (255.255.255.255) [3], copying the (255.255.255.255) [RFC1122], copying the original IP Destination
original IP Destination Address to the Target Address field of Address to the Target Address field of the new Route Request
the new Route Request option added to the packet, as described in option added to the packet, as described in Section 8.2.1.
Section 8.2.1.
- If the packet now does not contain a Route Request option, - If the packet now does not contain a Route Request option, then
then this node must have a route to the Destination Address this node must have a route to the Destination Address of the
of the packet; if the node has more than one route to this packet; if the node has more than one route to this Destination
Destination Address, the node selects one to use for this packet. Address, the node selects one to use for this packet. If the
If the length of this route is greater than 1 hop, or if the length of this route is greater than 1 hop, or if the node
node determines to request a DSR network-layer acknowledgement determines to request a DSR network-layer acknowledgement from the
from the first-hop node in that route, then insert a DSR Options first-hop node in that route, then insert a DSR Options header
header into the packet, as described in Section 8.1.2, and insert into the packet, as described in Section 8.1.2, and insert a DSR
a DSR Source Route option, as described in Section 8.1.3. The Source Route option, as described in Section 8.1.3. The source
source route in the packet is initialized from the selected route route in the packet is initialized from the selected route to the
to the Destination Address of the packet. Destination Address of the packet.
- Transmit the packet to the first-hop node address given in - Transmit the packet to the first-hop node address given in
selected source route, using Route Maintenance to determine the selected source route, using Route Maintenance to determine the
reachability of the next hop, as described in Section 8.3. reachability of the next hop, as described in Section 8.3.
8.1.2. Adding a DSR Options Header to a Packet 8.1.2. Adding a DSR Options Header to a Packet
A node originating a packet adds a DSR Options header to the packet, A node originating a packet adds a DSR Options header to the packet,
if necessary, to carry information needed by the routing protocol. if necessary, to carry information needed by the routing protocol. A
A packet MUST NOT contain more than one DSR Options header. A DSR packet MUST NOT contain more than one DSR Options header. A DSR
Options header is added to a packet by performing the following Options header is added to a packet by performing the following
sequence of steps (these steps assume that the packet contains no sequence of steps (these steps assume that the packet contains no
other headers that MUST be located in the packet before the DSR other headers that MUST be located in the packet before the DSR
Options header): Options header):
- Insert a DSR Options header after the IP header but before any - Insert a DSR Options header after the IP header but before any
other header that may be present. other header that may be present.
- Set the Next Header field of the DSR Options header to the - Set the Next Header field of the DSR Options header to the
Protocol number field of the packet's IP header. Protocol number field of the packet's IP header.
- Set the Protocol field of the packet's IP header to the Protocol - Set the Protocol field of the packet's IP header to the protocol
number assigned for DSR (TBA???). number assigned for DSR (48).
8.1.3. Adding a DSR Source Route Option to a Packet 8.1.3. Adding a DSR Source Route Option to a Packet
A node originating a packet adds a DSR Source Route option to the A node originating a packet adds a DSR Source Route option to the
packet, if necessary, in order to carry the source route from this packet, if necessary, in order to carry the source route from this
originating node to the final destination address of the packet. originating node to the final destination address of the packet.
Specifically, the node adding the DSR Source Route option constructs Specifically, the node adding the DSR Source Route option constructs
the DSR Source Route option and modifies the IP packet according to the DSR Source Route option and modifies the IP packet according to
the following sequence of steps: the following sequence of steps:
- The node creates a DSR Source Route option, as described - The node creates a DSR Source Route option, as described in
in Section 6.7, and appends it to the DSR Options header in Section 6.7, and appends it to the DSR Options header in the
the packet. (A DSR Options header is added, as described in packet. (A DSR Options header is added, as described in Section
Section 8.1.2, if not already present.) 8.1.2, if not already present.)
- The number of Address[i] fields to include in the DSR Source - The number of Address[i] fields to include in the DSR Source Route
Route option (n) is the number of intermediate nodes in the option (n) is the number of intermediate nodes in the source route
source route for the packet (i.e., excluding address of the for the packet (i.e., excluding the address of the originating
originating node and the final destination address of the node and the final destination address of the packet). The
packet). The Segments Left field in the DSR Source Route option Segments Left field in the DSR Source Route option is initialized
is initialized equal to n. equal to n.
- The addresses within the source route for the packet are copied - The addresses within the source route for the packet are copied
into sequential Address[i] fields in the DSR Source Route option, into sequential Address[i] fields in the DSR Source Route option,
for i = 1, 2, ..., n. for i = 1, 2, ..., n.
- The First Hop External (F) bit in the DSR Source Route option is - The First Hop External (F) bit in the DSR Source Route option is
copied from the External bit flagging the first hop in the source copied from the External bit flagging the first hop in the source
route for the packet, as indicated in the Route Cache. route for the packet, as indicated in the Route Cache.
- The Last Hop External (L) bit in the DSR Source Route option is - The Last Hop External (L) bit in the DSR Source Route option is
copied from the External bit flagging the last hop in the source copied from the External bit flagging the last hop in the source
route for the packet, as indicated in the Route Cache. route for the packet, as indicated in the Route Cache.
- The Salvage field in the DSR Source Route option is - The Salvage field in the DSR Source Route option is initialized to
initialized to 0. 0.
8.1.4. Processing a Received Packet 8.1.4. Processing a Received Packet
When a node receives any packet (whether for forwarding, overheard, When a node receives any packet (whether for forwarding, overheard,
or as the final destination of the packet), if that packet contains or the final destination of the packet), if that packet contains a
a DSR Options header, then that node MUST process any options DSR Options header, then that node MUST process any options contained
contained in that DSR Options header, in the order contained there. in that DSR Options header, in the order contained there.
Specifically: Specifically:
- If the DSR Options header contains a Route Request option, the - If the DSR Options header contains a Route Request option, the
node SHOULD extract the source route from the Route Request and node SHOULD extract the source route from the Route Request and
add this routing information to its Route Cache, subject to the add this routing information to its Route Cache, subject to the
conditions identified in Section 3.3.1. The routing information conditions identified in Section 3.3.1. The routing information
from the Route Request is the sequence of hop addresses from the Route Request is the sequence of hop addresses
initiator, Address[1], Address[2], ..., Address[n] initiator, Address[1], Address[2], ..., Address[n]
where initiator is the value of the Source Address field in where initiator is the value of the Source Address field in the IP
the IP header of the packet carrying the Route Request (the header of the packet carrying the Route Request (the address of
address of the initiator of the Route Discovery), and each the initiator of the Route Discovery), and each Address[i] is a
Address[i] is a node through which this Route Request has passed, node through which this Route Request has passed, in turn, during
in turn, during this Route Discovery. The value n here is the this Route Discovery. The value n, here, is the number of
number of addresses recorded in the Route Request option, or addresses recorded in the Route Request option, or
(Opt Data Len - 6) / 4. (Opt Data Len - 6) / 4.
After possibly updating the node's Route Cache in response to After possibly updating the node's Route Cache in response to the
the routing information in the Route Request option, the node routing information in the Route Request option, the node MUST
MUST then process the Route Request option as described in then process the Route Request option as described in Section
Section 8.2.2. 8.2.2.
- If the DSR Options header contains a Route Reply option, the node - If the DSR Options header contains a Route Reply option, the node
SHOULD extract the source route from the Route Reply and add this SHOULD extract the source route from the Route Reply and add this
routing information to its Route Cache, subject to the conditions routing information to its Route Cache, subject to the conditions
identified in Section 3.3.1. The source route from the Route identified in Section 3.3.1. The source route from the Route
Reply is the sequence of hop addresses Reply is the sequence of hop addresses
initiator, Address[1], Address[2], ..., Address[n] initiator, Address[1], Address[2], ..., Address[n]
where initiator is the value of the Destination Address field in where initiator is the value of the Destination Address field in
the IP header of the packet carrying the Route Reply (the address the IP header of the packet carrying the Route Reply (the address
of the initiator of the Route Discovery), and each Address[i] of the initiator of the Route Discovery), and each Address[i] is a
is a node through which the source route passes, in turn, on node through which the source route passes, in turn, on the route
the route to the target of the Route Discovery. Address[n] is to the target of the Route Discovery. Address[n] is the address
the address of the target. If the Last Hop External (L) bit is of the target. If the Last Hop External (L) bit is set in the
set in the Route Reply, the node MUST flag the last hop from Route Reply, the node MUST flag the last hop from the Route Reply
the Route Reply (the link from Address[n-1] to Address[n]) in (the link from Address[n-1] to Address[n]) in its Route Cache as
its Route Cache as External. The value n here is the number of External. The value n here is the number of addresses in the
addresses in the source route being returned in the Route Reply source route being returned in the Route Reply option, or
option, or (Opt Data Len - 1) / 4. (Opt Data Len - 1) / 4.
After possibly updating the node's Route Cache in response to After possibly updating the node's Route Cache in response to the
the routing information in the Route Reply option, then if the routing information in the Route Reply option, then if the
packet's IP Destination Address matches one of this node's IP packet's IP Destination Address matches one of this node's IP
addresses, the node MUST then process the Route Reply option as addresses, the node MUST then process the Route Reply option as
described in Section 8.2.6. described in Section 8.2.6.
- If the DSR Options header contains a Route Error option, - If the DSR Options header contains a Route Error option, the node
the node MUST process the Route Error option as described in MUST process the Route Error option as described in Section 8.3.5.
Section 8.3.5.
- If the DSR Options header contains an Acknowledgement Request - If the DSR Options header contains an Acknowledgement Request
option, the node MUST process the Acknowledgement Request option option, the node MUST process the Acknowledgement Request option
as described in Section 8.3.3. as described in Section 8.3.3.
- If the DSR Options header contains an Acknowledgement option, - If the DSR Options header contains an Acknowledgement option, then
then subject to the conditions identified in Section 3.3.1, the subject to the conditions identified in Section 3.3.1, the node
node SHOULD add to its Route Cache the single link from the node SHOULD add to its Route Cache the single link from the node
identified by the ACK Source Address field to the node identified identified by the ACK Source Address field to the node identified
by the ACK Destination Address field. by the ACK Destination Address field.
After possibly updating the node's Route Cache in response to After possibly updating the node's Route Cache in response to the
the routing information in the Acknowledgement option, the node routing information in the Acknowledgement option, the node MUST
MUST then process the Acknowledgement option as described in then process the Acknowledgement option as described in Section
Section 8.3.3. 8.3.3.
- If the DSR Options header contains a DSR Source Route option, the - If the DSR Options header contains a DSR Source Route option, the
node SHOULD extract the source route from the DSR Source Route node SHOULD extract the source route from the DSR Source Route
and add this routing information to its Route Cache, subject to option and add this routing information to its Route Cache,
the conditions identified in Section 3.3.1. If the value of the subject to the conditions identified in Section 3.3.1. If the
Salvage field in the DSR Source Route option is zero, then the value of the Salvage field in the DSR Source Route option is zero,
routing information from the DSR Source Route is the sequence of then the routing information from the DSR Source Route is the
hop addresses sequence of hop addresses
source, Address[1], Address[2], ..., Address[n], destination source, Address[1], Address[2], ..., Address[n], destination
and otherwise (Salvage is nonzero), the routing information from Otherwise (i.e., if Salvage is nonzero), the routing information
the DSR Source Route is the sequence of hop addresses from the DSR Source Route is the sequence of hop addresses
Address[1], Address[2], ..., Address[n], destination Address[1], Address[2], ..., Address[n], destination
where source is the value of the Source Address field in the IP where source is the value of the Source Address field in the IP
header of the packet carrying the DSR Source Route option (the header of the packet carrying the DSR Source Route option (the
original sender of the packet), each Address[i] is the value in original sender of the packet), each Address[i] is the value in
the Address[i] field in the DSR Source Route, and destination is the Address[i] field in the DSR Source Route option, and
the value of the Destination Address field in the packet's IP destination is the value of the Destination Address field in the
header (the last-hop address of the source route). The value n packet's IP header (the last-hop address of the source route).
here is the number of addresses in source route in the DSR Source The value n here is the number of addresses in source route in the
Route option, or (Opt Data Len - 2) / 4. DSR Source Route option, or (Opt Data Len - 2) / 4.
After possibly updating the node's Route Cache in response to After possibly updating the node's Route Cache in response to the
the routing information in the DSR Source Route option, the node routing information in the DSR Source Route option, the node MUST
MUST then process the DSR Source Route option as described in then process the DSR Source Route option as described in Section
Section 8.1.5. 8.1.5.
- Any Pad1 or PadN options in the DSR Options header are ignored. - Any Pad1 or PadN options in the DSR Options header are ignored.
Finally, if the Destination Address in the packet's IP header matches - Finally, if the Destination Address in the packet's IP header
one of this receiving node's own IP address(es), remove the DSR matches one of this receiving node's own IP address(es), remove
Options header and all the included DSR options in the header, and the DSR Options header and all the included DSR options in the
pass the rest of the packet to the network layer. header, and pass the rest of the packet to the network layer.
8.1.5. Processing a Received DSR Source Route Option 8.1.5. Processing a Received DSR Source Route Option
When a node receives a packet containing a DSR Source Route option When a node receives a packet containing a DSR Source Route option
(whether for forwarding, overheard, or as the final destination of (whether for forwarding, overheard, or the final destination of the
the packet), that node SHOULD examine the packet to determine if packet), that node SHOULD examine the packet to determine if the
the receipt of that packet indicates an opportunity for automatic receipt of that packet indicates an opportunity for automatic route
route shortening, as described in Section 3.4.3. Specifically, if shortening, as described in Section 3.4.3. Specifically, if this
this node is not the intended next-hop destination for the packet node is not the intended next-hop destination for the packet but is
but is named in the later unexpended portion of the source route in named in the later unexpended portion of the source route in the
the packet's DSR Source Route option, then this packet indicates an packet's DSR Source Route option, then this packet indicates an
opportunity for automatic route shortening: the intermediate nodes opportunity for automatic route shortening: the intermediate nodes
after the node from which this node overheard the packet and before after the node from which this node overheard the packet and before
this node itself, are no longer necessary in the source route. In this node itself are no longer necessary in the source route. In
this case, this node SHOULD perform the following sequence of steps this case, this node SHOULD perform the following sequence of steps
as part of automatic route shortening: as part of automatic route shortening:
- The node searches its Gratuitous Route Reply Table for an entry - The node searches its Gratuitous Route Reply Table for an entry
describing a gratuitous Route Reply earlier sent by this node, describing a gratuitous Route Reply earlier sent by this node, for
for which the original sender of the packet triggering the which the original sender (of the packet triggering the gratuitous
gratuitous Route Reply and the transmitting node from which this Route Reply) and the transmitting node (from which this node
node overheard that packet in order to trigger the gratuitous overheard that packet in order to trigger the gratuitous Route
Route Reply, both match the respective node addresses for this Reply) both match the respective node addresses for this new
new received packet. If such an entry is found in the node's received packet. If such an entry is found in the node's
Gratuitous Route Reply Table, the node SHOULD NOT perform Gratuitous Route Reply Table, the node SHOULD NOT perform
automatic route shortening in response to this receipt of this automatic route shortening in response to this receipt of this
packet. packet.
- Otherwise, the node creates an entry for this overheard packet in - Otherwise, the node creates an entry for this overheard packet in
its Gratuitous Route Reply Table. The timeout value for this new its Gratuitous Route Reply Table. The timeout value for this new
entry SHOULD be initialized to the value GratReplyHoldoff. After entry SHOULD be initialized to the value GratReplyHoldoff. After
this timeout has expired, the node SHOULD delete this entry from this timeout has expired, the node SHOULD delete this entry from
its Gratuitous Route Reply Table. its Gratuitous Route Reply Table.
- After creating the new Gratuitous Route Reply Table entry - After creating the new Gratuitous Route Reply Table entry above,
above, the node originates a gratuitous Route Reply to the the node originates a gratuitous Route Reply to the IP Source
IP Source Address of this overheard packet, as described in Address of this overheard packet, as described in Section 3.4.3.
Section 3.4.3.
If the MAC protocol in use in the network is not capable of If the MAC protocol in use in the network is not capable of
transmitting unicast packets over unidirectional links, as transmitting unicast packets over unidirectional links, as
discussed in Section 3.3.1, then in originating this Route Reply, discussed in Section 3.3.1, then in originating this Route Reply,
the node MUST use a source route for routing the Route Reply the node MUST use a source route for routing the Route Reply
packet that is obtained by reversing the sequence of hops over packet that is obtained by reversing the sequence of hops over
which the packet triggering the gratuitous Route Reply was routed which the packet triggering the gratuitous Route Reply was routed
in reaching and being overheard by this node; this reversing of in reaching and being overheard by this node. This reversing of
the route uses the gratuitous Route Reply to test this sequence the route uses the gratuitous Route Reply to test this sequence of
of hops for bidirectionality, preventing the gratuitous Route hops for bidirectionality, preventing the gratuitous Route Reply
Reply from being received by the initiator of the Route Discovery from being received by the initiator of the Route Discovery unless
unless each of the hops over which the gratuitous Route Reply is each of the hops over which the gratuitous Route Reply is returned
returned is bidirectional. is bidirectional.
- Discard the overheard packet, since the packet has been received - Discard the overheard packet, since the packet has been received
before its normal traversal of the packet's source route would before its normal traversal of the packet's source route would
have caused it to reach this receiving node. Another copy of have caused it to reach this receiving node. Another copy of the
the packet will normally arrive at this node as indicated in packet will normally arrive at this node as indicated in the
the packet's source route; discarding this initial copy of the packet's source route; discarding this initial copy of the packet,
packet, which triggered the gratuitous Route Reply, will prevent which triggered the gratuitous Route Reply, will prevent the
the duplication of this packet that would otherwise occur. duplication of this packet that would otherwise occur.
If the packet is not discarded as part of automatic route shortening If the packet is not discarded as part of automatic route shortening
above, then the node MUST process the Source Route option according above, then the node MUST process the Source Route option according
to the following sequence of steps: to the following sequence of steps:
- If the value of the Segments Left field in the DSR Source Route - If the value of the Segments Left field in the DSR Source Route
option equals 0, then remove the DSR Source Route option from the option equals 0, then remove the DSR Source Route option from the
DSR Options header. DSR Options header.
- Else, let n equal (Opt Data Len - 2) / 4. This is the number of - Else, let n equal (Opt Data Len - 2) / 4. This is the number of
addresses in the DSR Source Route option. addresses in the DSR Source Route option.
- If the value of the Segments Left field is greater than n, then - If the value of the Segments Left field is greater than n, then
send an ICMP Parameter Problem, Code 0, message [31] to the IP send an ICMP Parameter Problem, Code 0, message [RFC792] to the IP
Source Address, pointing to the Segments Left field, and discard Source Address, pointing to the Segments Left field, and discard
the packet. Do not process the DSR Source Route option further. the packet. Do not process the DSR Source Route option further.
- Else, decrement the value of the Segments Left field by 1. Let i - Else, decrement the value of the Segments Left field by 1. Let i
equal n minus Segments Left. This is the index of the next equal n minus Segments Left. This is the index of the next
address to be visited in the Address vector. address to be visited in the Address vector.
- If Address[i] or the IP Destination Address is a multicast - If Address[i] or the IP Destination Address is a multicast
address, then discard the packet. Do not process the DSR Source address, then discard the packet. Do not process the DSR Source
Route option further. Route option further.
- If this node has more than one network interface and if - If this node has more than one network interface and if Address[i]
Address[i] is the address of one this node's network interfaces, is the address of one this node's network interfaces, then this
then this indicates a change in the network interface to use in indicates a change in the network interface to use in forwarding
forwarding the packet, as described in Section 8.4. In this the packet, as described in Section 8.4. In this case, decrement
case, decrement the value of the Segments Left field by 1 to the value of the Segments Left field by 1 to skip over this
skip over this address (that indicated the change of network address (that indicated the change of network interface) and go to
interface) and go to the first step above (checking the value of the first step above (checking the value of the Segments Left
the Segments Left field) to continue processing this Source Route field) to continue processing this Source Route option; in further
option; in further processing of this Source Route option, the processing of this Source Route option, the indicated new network
indicated new network interface MUST be used in forwarding the interface MUST be used in forwarding the packet.
packet.
- If the MTU of the link over which this node would transmit - If the MTU of the link over which this node would transmit the
the packet to forward it to the node Address[i] is less than packet to forward it to the node Address[i] is less than the size
the size of the packet, the node MUST either discard the of the packet, the node MUST either discard the packet and send an
packet and send an ICMP Packet Too Big message to the packet's ICMP Packet Too Big message to the packet's Source Address
Source Address [31] or fragment it as specified in Section 8.5. [RFC792] or fragment it as specified in Section 8.5.
- Forward the packet to the IP address specified in the Address[i] - Forward the packet to the IP address specified in the Address[i]
field of the IP header, following normal IP forwarding field of the IP header, following normal IP forwarding procedures,
procedures, including checking and decrementing the Time-to-Live including checking and decrementing the Time-to-Live (TTL) field
(TTL) field in the packet's IP header [32, 3]. In this in the packet's IP header [RFC791, RFC1122]. In this forwarding
forwarding of the packet, the next-hop node (identified by of the packet, the next-hop node (identified by Address[i]) MUST
Address[i]) MUST be treated as a direct neighbor node: the be treated as a direct neighbor node: the transmission to that
transmission to that next node MUST be done in a single IP next node MUST be done in a single IP forwarding hop, without
forwarding hop, without Route Discovery and without searching the Route Discovery and without searching the Route Cache.
Route Cache.
- In forwarding the packet, perform Route Maintenance for the - In forwarding the packet, perform Route Maintenance for the next
next hop of the packet, by verifying that the next-hop node is hop of the packet, by verifying that the next-hop node is
reachable, as described in Section 8.3. reachable, as described in Section 8.3.
Multicast addresses MUST NOT appear in a DSR Source Route option or Multicast addresses MUST NOT appear in a DSR Source Route option or
in the IP Destination Address field of a packet carrying a DSR Source in the IP Destination Address field of a packet carrying a DSR Source
Route option in a DSR Options header. Route option in a DSR Options header.
8.1.6. Handling an Unknown DSR Option 8.1.6. Handling an Unknown DSR Option
Nodes implementing DSR MUST handle all options specified in this Nodes implementing DSR MUST handle all options specified in this
document, except those options pertaining to the optional flow document, except those options pertaining to the optional flow state
state extension (Section 7). However, further extensions to extension (Section 7). However, further extensions to DSR may
DSR may include other option types that may not be understood by include other option types that may not be understood by
implementations conforming to this version of the DSR specification. implementations conforming to this version of the DSR specification.
In DSR, Option Type codes encode required behavior for nodes not In DSR, Option Type codes encode required behavior for nodes not
implementing that type of option. These behaviors are included in implementing that type of option. These behaviors are included in
the most significant three bits of the Option Type. the most significant 3 bits of the Option Type.
If the most significant bit of the Option Type is set (that is, If the most significant bit of the Option Type is set (that is,
Option Type & 0x80 is nonzero), and this packet does not contain Option Type & 0x80 is nonzero), and this packet does not contain a
a Route Request option, a node SHOULD return a Route Error to the Route Request option, a node SHOULD return a Route Error to the IP
IP Source Address, following the steps described in Section 8.3.4, Source Address, following the steps described in Section 8.3.4,
except that the Error Type MUST be set to OPTION_NOT_SUPPORTED and except that the Error Type MUST be set to OPTION_NOT_SUPPORTED and
the Unsupported Opt field MUST be set to the Option Type triggering the Unsupported Opt field MUST be set to the Option Type triggering
the Route Error. the Route Error.
Whether or not a Route Error is sent in response to this DSR option, Whether or not a Route Error is sent in response to this DSR option,
as described above, the node also MUST examine the next two most as described above, the node also MUST examine the next 2 most
significant bits (that is, Option Type & 0x60): significant bits (that is, Option Type & 0x60):
- When these two bits are zero (that is, Option Type & 0x60 == 0), - When these 2 bits are 00 (that is, Option Type & 0x60 == 0), a
a node not implementing processing for that Option Type MUST node not implementing processing for that Option Type MUST use the
use the Opt Data Len field to skip over the option and continue Opt Data Len field to skip over the option and continue
processing. processing.
- When these two bits are 01 (that is, Option Type & 0x60 == 0x20), - When these 2 bits are 01 (that is, Option Type & 0x60 == 0x20), a
a node not implementing processing for that Option Type MUST use node not implementing processing for that Option Type MUST use the
the Opt Data Len field to remove the option from the packet and Opt Data Len field to remove the option from the packet and
continue processing as if the option had not been included in the continue processing as if the option had not been included in the
received packet. received packet.
- When these two bits are 10 (that is, Option Type & 0x60 == 0x40), - When these 2 bits are 10 (that is, Option Type & 0x60 == 0x40), a
a node not implementing processing for that Option Type MUST set node not implementing processing for that Option Type MUST set the
the most significant bit following the Opt Data Len field; in most significant bit following the Opt Data Len field. In
addition, the node MUST then ignore the contents of the option addition, the node MUST then ignore and skip over the contents of
using the Opt Data Len field, and MUST continue processing the the option using the Opt Data Len field and MUST continue
packet. processing the packet.
- Finally, when these two bits are 11 (that is, - Finally, when these 2 bits are 11 (that is,
Option Type & 0x60 == 0x60), a node not implementing processing Option Type & 0x60 == 0x60), a node not implementing processing
for that Option Type MUST drop the packet. for that Option Type MUST drop the packet.
8.2. Route Discovery Processing 8.2. Route Discovery Processing
Route Discovery is the mechanism by which a node S wishing to send a Route Discovery is the mechanism by which a node S wishing to send a
packet to a destination node D obtains a source route to D. Route 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 Discovery SHOULD be used only when S attempts to send a packet to D
does not already know a route to D. The node initiating a Route and does not already know a route to D. The node initiating a Route
Discovery is known as the "initiator" of the Route Discovery, and the Discovery is known as the "initiator" of the Route Discovery, and the
destination node for which the Route Discovery is initiated is known destination node for which the Route Discovery is initiated is known
as the "target" of the Route Discovery. as the "target" of the Route Discovery.
Route Discovery operates entirely on demand, with a node initiating Route Discovery operates entirely on demand; a node initiates Route
Route Discovery based on its own origination of new packets for Discovery based on its own origination of new packets for some
some destination address to which it does not currently know a destination address to which it does not currently know a route.
route. Route Discovery does not depend on any periodic or background Route Discovery does not depend on any periodic or background
exchange of routing information or neighbor node detection at any exchange of routing information or neighbor node detection at any
layer in the network protocol stack at any node. layer in the network protocol stack at any node.
The Route Discovery procedure utilizes two types of messages, a Route The Route Discovery procedure utilizes two types of messages, a Route
Request (Section 6.2) and a Route Reply (Section 6.3), to actively Request (Section 6.2) and a Route Reply (Section 6.3), to actively
search the ad hoc network for a route to the desired destination. search the ad hoc network for a route to the desired target
These DSR messages MAY be carried in any type of IP packet, through destination. These DSR messages MAY be carried in any type of IP
use of the DSR Options header as described in Section 6. packet, through use of the DSR Options header as described in Section
6.
Except as discussed in Section 8.3.5, a Route Discovery for a Except as discussed in Section 8.3.5, a Route Discovery for a
destination address SHOULD NOT be initiated unless the initiating destination address SHOULD NOT be initiated unless the initiating
node has a packet in its Send Buffer requiring delivery to that node has a packet in its Send Buffer requiring delivery to that
destination. A Route Discovery for a given target node MUST NOT be destination. A Route Discovery for a given target node MUST NOT be
initiated unless permitted by the rate-limiting information contained initiated unless permitted by the rate-limiting information contained
in the Route Request Table. After each Route Discovery attempt, the in the Route Request Table. After each Route Discovery attempt, the
interval between successive Route Discoveries for this target SHOULD interval between successive Route Discoveries for this target SHOULD
be doubled, up to a maximum of MaxRequestPeriod, until a valid Route be doubled, up to a maximum of MaxRequestPeriod, until a valid Route
Reply is received for this target. Reply is received for this target.
8.2.1. Originating a Route Request 8.2.1. Originating a Route Request
A node initiating a Route Discovery for some target creates and A node initiating a Route Discovery for some target creates and
initializes a Route Request option in a DSR Options header in some initializes a Route Request option in a DSR Options header in some IP
IP packet. This MAY be a separate IP packet, used only to carry packet. This MAY be a separate IP packet, used only to carry this
this Route Request option, or the node MAY include the Route Request Route Request option, or the node MAY include the Route Request
option in some existing packet that it needs to send to the target option in some existing packet that it needs to send to the target
node (e.g., the IP packet originated by this node, that caused the node (e.g., the IP packet originated by this node that caused the
node to attempt Route Discovery for the destination address of the node to attempt Route Discovery for the destination address of the
packet). The Route Request option MUST be included in a DSR Options packet). The Route Request option MUST be included in a DSR Options
header in the packet. To initialize the Route Request option, the header in the packet. To initialize the Route Request option, the
node performs the following sequence of steps: node performs the following sequence of steps:
- The Option Type in the option MUST be set to the value 2. - The Option Type in the option MUST be set to the value 2.
- The Opt Data Len field in the option MUST be set to the value 6. - The Opt Data Len field in the option MUST be set to the value 6.
The total size of the Route Request option when initiated The total size of the Route Request option, when initiated, is 8
is 8 octets; the Opt Data Len field excludes the size of the octets; the Opt Data Len field excludes the size of the Option
Option Type and Opt Data Len fields themselves. Type and Opt Data Len fields themselves.
- The Identification field in the option MUST be set to a new - The Identification field in the option MUST be set to a new value,
value, different from that used for other Route Requests recently different from that used for other Route Requests recently
initiated by this node for this same target address. For initiated by this node for this same target address. For example,
example, each node MAY maintain a single counter value for each node MAY maintain a single counter value for generating a new
generating a new Identification value for each Route Request it Identification value for each Route Request it initiates.
initiates.
- The Target Address field in the option MUST be set to the IP - The Target Address field in the option MUST be set to the IP
address that is the target of this Route Discovery. address that is the target of this Route Discovery.
The Source Address in the IP header of this packet MUST be the node's The Source Address in the IP header of this packet MUST be the node's
own IP address. The Destination Address in the IP header of this own IP address. The Destination Address in the IP header of this
packet MUST be the IP "limited broadcast" address (255.255.255.255). packet MUST be the IP "limited broadcast" address (255.255.255.255).
A node MUST maintain in its Route Request Table, information about A node MUST maintain, in its Route Request Table, information about
Route Requests that it initiates. When initiating a new Route Route Requests that it initiates. When initiating a new Route
Request, the node MUST use the information recorded in the Route Request, the node MUST use the information recorded in the Route
Request Table entry for the target of that Route Request, and it MUST Request Table entry for the target of that Route Request, and it MUST
update that information in the table entry for use in the next Route update that information in the table entry for use in the next Route
Request initiated for this target. In particular: Request initiated for this target. In particular:
- The Route Request Table entry for a target node records the - The Route Request Table entry for a target node records the Time-
Time-to-Live (TTL) field used in the IP header of the Route to-Live (TTL) field used in the IP header of the Route Request for
Request for the last Route Discovery initiated by this node for the last Route Discovery initiated by this node for that target
that target node. This value allows the node to implement a node. This value allows the node to implement a variety of
variety of algorithms for controlling the spread of its Route algorithms for controlling the spread of its Route Request on each
Request on each Route Discovery initiated for a target. As Route Discovery initiated for a target. As examples, two possible
examples, two possible algorithms for this use of the TTL field algorithms for this use of the TTL field are described in Section
are described in Section 3.3.3. 3.3.3.
- The Route Request Table entry for a target node records the - The Route Request Table entry for a target node records the number
number of consecutive Route Requests initiated for this target of consecutive Route Requests initiated for this target since
since receiving a valid Route Reply giving a route to that target receiving a valid Route Reply giving a route to that target node,
node, and the remaining amount of time before which this node MAY and the remaining amount of time before which this node MAY next
next attempt at a Route Discovery for that target node. attempt at a Route Discovery for that target node.
A node MUST use these values to implement a back-off algorithm to A node MUST use these values to implement a back-off algorithm to
limit the rate at which this node initiates new Route Discoveries limit the rate at which this node initiates new Route Discoveries
for the same target address. In particular, until a valid Route for the same target address. In particular, until a valid Route
Reply is received for this target node address, the timeout Reply is received for this target node address, the timeout
between consecutive Route Discovery initiations for this target between consecutive Route Discovery initiations for this target
node with the same hop limit SHOULD increase by doubling the node with the same hop limit SHOULD increase by doubling the
timeout value on each new initiation. timeout value on each new initiation.
The behavior of a node processing a packet containing DSR Options The behavior of a node processing a packet containing DSR Options
header with both a DSR Source Route option and a Route Request option header with both a DSR Source Route option and a Route Request option
is unspecified. Packets SHOULD NOT contain both a DSR Source Route is unspecified. Packets SHOULD NOT contain both a DSR Source Route
option and a Route Request option. option and a Route Request option.
Packets containing a Route Request option SHOULD NOT include Packets containing a Route Request option SHOULD NOT include an
an Acknowledgement Request option, SHOULD NOT expect link-layer Acknowledgement Request option, SHOULD NOT expect link-layer
acknowledgement or passive acknowledgement, and SHOULD NOT be acknowledgement or passive acknowledgement, and SHOULD NOT be
retransmitted. The retransmission of packets containing a Route retransmitted. The retransmission of packets containing a Route
Request option is controlled solely by the logic described in this Request option is controlled solely by the logic described in this
section. section.
8.2.2. Processing a Received Route Request Option 8.2.2. Processing a Received Route Request Option
When a node receives a packet containing a Route Request option, that When a node receives a packet containing a Route Request option, that
node MUST process the option according to the following sequence of node MUST process the option according to the following sequence of
steps: steps:
- If the Target Address field in the Route Request matches this - If the Target Address field in the Route Request matches this
node's own IP address, then the node SHOULD return a Route Reply node's own IP address, then the node SHOULD return a Route Reply
to the initiator of this Route Request (the Source Address in the to the initiator of this Route Request (the Source Address in the
IP header of the packet), as described in Section 8.2.4. The IP header of the packet), as described in Section 8.2.4. The
source route for this Reply is the sequence of hop addresses source route for this Reply is the sequence of hop addresses
initiator, Address[1], Address[2], ..., Address[n], target initiator, Address[1], Address[2], ..., Address[n], target
where initiator is the address of the initiator of this where initiator is the address of the initiator of this Route
Route Request, each Address[i] is an address from the Route Request, each Address[i] is an address from the Route Request, and
Request, and target is the target of the Route Request (the target is the target of the Route Request (the Target Address
Target Address field in the Route Request). The value n here field in the Route Request). The value n here is the number of
is the number of addresses recorded in the Route Request, or addresses recorded in the Route Request, or
(Opt Data Len - 6) / 4. (Opt Data Len - 6) / 4.
The node then MUST replace the Destination Address field in The node then MUST replace the Destination Address field in the
the Route Request packet's IP header with the value in the Route Request packet's IP header with the value in the Target
Target Address field in the Route Request option, and continue Address field in the Route Request option, and continue processing
processing the rest of the Route Request packet normally. The the rest of the Route Request packet normally. The node MUST NOT
node MUST NOT process the Route Request option further and MUST process the Route Request option further and MUST NOT retransmit
NOT retransmit the Route Request to propagate it to other nodes the Route Request to propagate it to other nodes as part of the
as part of the Route Discovery. Route Discovery.
- Else, the node MUST examine the route recorded in the Route - Else, the node MUST examine the route recorded in the Route
Request option (the IP Source Address field and the sequence of Request option (the IP Source Address field and the sequence of
Address[i] fields) to determine if this node's own IP address Address[i] fields) to determine if this node's own IP address
already appears in this list of addresses. If so, the node MUST already appears in this list of addresses. If so, the node MUST
discard the entire packet carrying the Route Request option. discard the entire packet carrying the Route Request option.
- Else, if the Route Request was received through a network - Else, if the Route Request was received through a network
interface that requires physically bidirectional links for interface that requires physically bidirectional links for unicast
unicast transmission, the node MUST check if the Route Request transmission, the node MUST check if the Route Request was last
was last forwarded by a node on its Blacklist (Section 4.6). forwarded by a node on its blacklist (Section 4.6). If such an
If such an entry is found in the Blacklist, and the state of entry is found in the blacklist, and the state of the
the unidirectional link is "probable", then the Request MUST be unidirectional link is "probable", then the Request MUST be
silently discarded. silently discarded.
- Else, if the Route Request was received through a network - Else, if the Route Request was received through a network
interface that requires physically bidirectional links for interface that requires physically bidirectional links for unicast
unicast transmission, the node MUST check if the Route Request transmission, the node MUST check if the Route Request was last
was last forwarded by a node on its Blacklist. If such an entry forwarded by a node on its blacklist. If such an entry is found
is found in the Blacklist, and the state of the unidirectional in the blacklist, and the state of the unidirectional link is
link is "questionable", then the node MUST create and unicast "questionable", then the node MUST create and unicast a Route
a Route Request packet to that previous node, setting the Request packet to that previous node, setting the IP Time-To-Live
IP Time-To-Live (TTL) to 1 to prevent the Request from being (TTL) to 1 to prevent the Request from being propagated. If the
propagated. If the node receives a Route Reply in response to node receives a Route Reply in response to the new Request, it
the new Request, it MUST remove the Blacklist entry for that MUST remove the blacklist entry for that node, and SHOULD continue
node, and SHOULD continue processing. If the node does not processing. If the node does not receive a Route Reply within
receive a Route Reply within some reasonable amount of time, the some reasonable amount of time, the node MUST silently discard the
node MUST silently discard the Route Request packet. Route Request packet.
- Else, the node MUST search its Route Request Table for an entry - Else, the node MUST search its Route Request Table for an entry
for the initiator of this Route Request (the IP Source Address for the initiator of this Route Request (the IP Source Address
field). If such an entry is found in the table, the node MUST field). If such an entry is found in the table, the node MUST
search the cache of Identification values of recently received search the cache of Identification values of recently received
Route Requests in that table entry, to determine if an entry Route Requests in that table entry, to determine if an entry is
is present in the cache matching the Identification value present in the cache matching the Identification value and target
and target node address in this Route Request. If such an node address in this Route Request. If such an (Identification,
(Identification, target address) entry is found in this cache in target address) entry is found in this cache in this entry in the
this entry in the Route Request Table, then the node MUST discard Route Request Table, then the node MUST discard the entire packet
the entire packet carrying the Route Request option. carrying the Route Request option.
- Else, this node SHOULD further process the Route Request - Else, this node SHOULD further process the Route Request according
according to the following sequence of steps: to the following sequence of steps:
o Add an entry for this Route Request in its cache of o Add an entry for this Route Request in its cache of
(Identification, target address) values of recently received (Identification, target address) values of recently received
Route Requests. Route Requests.
o Conceptually create a copy of this entire packet and perform o Conceptually create a copy of this entire packet and perform
the following steps on the copy of the packet. the following steps on the copy of the packet.
o Append this node's own IP address to the list of Address[i] o Append this node's own IP address to the list of Address[i]
values in the Route Request, and increase the value of the values in the Route Request and increase the value of the Opt
Opt Data Len field in the Route Request by 4 (the size of Data Len field in the Route Request by 4 (the size of an IP
an IP address). However, if the node has multiple network address). However, if the node has multiple network
interfaces, this step MUST be modified by the special interfaces, this step MUST be modified by the special
processing specified in Section sec:multiple. processing specified in Section 8.4.
o This node SHOULD search its own Route Cache for a route o This node SHOULD search its own Route Cache for a route (from
(from itself, as if it were the source of a packet) to the itself, as if it were the source of a packet) to the target of
target of this Route Request. If such a route is found in this Route Request. If such a route is found in its Route
its Route Cache, then this node SHOULD follow the procedure Cache, then this node SHOULD follow the procedure outlined in
outlined in Section 8.2.3 to return a "cached Route Reply" Section 8.2.3 to return a "cached Route Reply" to the initiator
to the initiator of this Route Request, if permitted by the of this Route Request, if permitted by the restrictions
restrictions specified there. specified there.
o If the node does not return a cached Route Reply, then this o If the node does not return a cached Route Reply, then this
node SHOULD transmit this copy of the packet as a link-layer node SHOULD transmit this copy of the packet as a link-layer
broadcast, with a short jitter delay before the broadcast is broadcast, with a short jitter delay before the broadcast is
sent. The jitter period SHOULD be chosen as a random period, sent. The jitter period SHOULD be chosen as a random period,
uniformly distributed between 0 and BroadcastJitter. uniformly distributed between 0 and BroadcastJitter.
8.2.3. Generating a Route Reply using the Route Cache 8.2.3. Generating a Route Reply Using the Route Cache
As described in Section 3.3.2, it is possible for a node processing a As described in Section 3.3.2, it is possible for a node processing a
received Route Request to avoid propagating the Route Request further received Route Request to avoid propagating the Route Request further
toward the target of the Request, if this node has in its Route Cache toward the target of the Request, if this node has in its Route Cache
a route from itself to this target. Such a Route Reply generated by a route from itself to this target. Such a Route Reply generated by
a node from its own cached route to the target of a Route Request is a node from its own cached route to the target of a Route Request is
called a "cached Route Reply", and this mechanism can greatly reduce called a "cached Route Reply", and this mechanism can greatly reduce
the overall overhead of Route Discovery on the network by reducing the overall overhead of Route Discovery on the network by reducing
the flood of Route Requests. The general processing of a received the flood of Route Requests. The general processing of a received
Route Request is described in Section 8.2.2; this section specifies Route Request is described in Section 8.2.2; this section specifies
skipping to change at page 70, line 40 skipping to change at page 69, line 14
While processing a received Route Request, for a node to possibly While processing a received Route Request, for a node to possibly
return a cached Route Reply, it MUST have in its Route Cache a route return a cached Route Reply, it MUST have in its Route Cache a route
from itself to the target of this Route Request. However, before from itself to the target of this Route Request. However, before
generating a cached Route Reply for this Route Request, the node MUST generating a cached Route Reply for this Route Request, the node MUST
verify that there are no duplicate addresses listed in the route verify that there are no duplicate addresses listed in the route
accumulated in the Route Request together with the route from this accumulated in the Route Request together with the route from this
node's Route Cache. Specifically, there MUST be no duplicates among node's Route Cache. Specifically, there MUST be no duplicates among
the following addresses: the following addresses:
- The IP Source Address of the packet containing the Route Request, - The IP Source Address of the packet containing the Route Request,
- The Address[i] fields in the Route Request, and - The Address[i] fields in the Route Request, and
- The nodes listed in the route obtained from this node's Route - The nodes listed in the route obtained from this node's Route
Cache, excluding the address of this node itself (this node Cache, excluding the address of this node itself (this node itself
itself is the common point between the route accumulated in the is the common point between the route accumulated in the Route
Route Request and the route obtained from the Route Cache). Request and the route obtained from the Route Cache).
If any duplicates exist among these addresses, then the node MUST NOT If any duplicates exist among these addresses, then the node MUST NOT
send a cached Route Reply. The node SHOULD continue to process the send a cached Route Reply using this route from the Route Cache (it
Route Request as described in Section 8.2.2. is possible that this node has another route in its Route Cache for
which the above restriction on duplicate addresses is met, allowing
the node to send a cached Route Reply based on that cached route,
instead). The node SHOULD continue to process the Route Request as
described in Section 8.2.2 if it does not send a cached Route Reply.
If the Route Request and the route from the Route Cache meet the If the Route Request and the route from the Route Cache meet the
restriction above, then the node SHOULD construct and return a cached restriction above, then the node SHOULD construct and return a cached
Route Reply as follows: Route Reply as follows:
- The source route for this reply is the sequence of hop addresses - The source route for this Route Reply is the sequence of hop
addresses
initiator, Address[1], Address[2], ..., Address[n], c-route initiator, Address[1], Address[2], ..., Address[n], c-route
where initiator is the address of the initiator of this Route where initiator is the address of the initiator of this Route
Request, each Address[i] is an address from the Route Request, Request, each Address[i] is an address from the Route Request, and
and c-route is the sequence of hop addresses in the source route c-route is the sequence of hop addresses in the source route to
to this target node, obtained from the node's Route Cache. In this target node, obtained from the node's Route Cache. In
appending this cached route to the source route for the reply, appending this cached route to the source route for the reply, the
the address of this node itself MUST be excluded, since it is address of this node itself MUST be excluded, since it is already
already listed as Address[n]. listed as Address[n].
- Send a Route Reply to the initiator of the Route Request, using - Send a Route Reply to the initiator of the Route Request, using
the procedure defined in Section 8.2.4. The initiator of the the procedure defined in Section 8.2.4. The initiator of the
Route Request is indicated in the Source Address field in the Route Request is indicated in the Source Address field in the
packet's IP header. packet's IP header.
Before sending the cached Route Reply, however, the node MAY delay Before sending the cached Route Reply, however, the node MAY delay
the Reply in order to help prevent a possible Route Reply "storm", as the Reply in order to help prevent a possible Route Reply "storm", as
described in Section 8.2.5. described in Section 8.2.5.
If the node returns a cached Route Reply as described above, If the node returns a cached Route Reply as described above, then the
then the node MUST NOT propagate the Route Request further (i.e., node MUST NOT propagate the Route Request further (i.e., the node
the node MUST NOT rebroadcast the Route Request). In this case, MUST NOT rebroadcast the Route Request). In this case, instead, if
instead, if the packet contains no other DSR options and contains the packet contains no other DSR options and contains no payload
no payload after the DSR Options header (e.g., the Route Request is after the DSR Options header (e.g., the Route Request is not
not piggybacked on a TCP or UDP packet), then the node SHOULD simply piggybacked on a TCP or UDP packet), then the node SHOULD simply
discard the packet. Otherwise (if the packet contains other DSR discard the packet. Otherwise (if the packet contains other DSR
options or contains any payload after the DSR Options header), the options or contains any payload after the DSR Options header), the
node SHOULD forward the packet along the cached route to the target node SHOULD forward the packet along the cached route to the target
of the Route Request. Specifically, if the node does so, it MUST use of the Route Request. Specifically, if the node does so, it MUST use
the following steps: the following steps:
- Copy the Target Address from the Route Request option in the DSR - Copy the Target Address from the Route Request option in the DSR
Options header to the Destination Address field in the packet's Options header to the Destination Address field in the packet's IP
IP header. header.
- Remove the Route Request option from the DSR Options header in - Remove the Route Request option from the DSR Options header in the
the packet, and add a DSR Source Route option to the packet's DSR packet, and add a DSR Source Route option to the packet's DSR
Options header. Options header.
- In the DSR Source Route option, set the Address[i] fields - In the DSR Source Route option, set the Address[i] fields to
to represent the source route found in this node's Route represent the source route found in this node's Route Cache to the
Cache to the original target of the Route Discovery (the original target of the Route Discovery (the new IP Destination
new IP Destination Address of the packet). Specifically, Address of the packet). Specifically, the node copies the hop
the node copies the hop addresses of the source route into addresses of the source route into sequential Address[i] fields in
sequential Address[i] fields in the DSR Source Route option, the DSR Source Route option, for i = 1, 2, ..., n. Address[1],
for i = 1, 2, ..., n. Address[1] here is the address of this here, is the address of this node itself (the first address in the
node itself (the first address in the source route found from source route found from this node to the original target of the
this node to the original target of the Route Discovery). The Route Discovery). The value n, here, is the number of hop
value n here is the number of hop addresses in this source route, addresses in this source route, excluding the destination of the
excluding the destination of the packet (which is instead already packet (which is instead already represented in the Destination
represented in the Destination Address field in the packet's IP Address field in the packet's IP header).
header).
- Initialize the Segments Left field in the DSR Source Route option - Initialize the Segments Left field in the DSR Source Route option
to n as defined above. to n as defined above.
- The First Hop External (F) bit in the DSR Source Route option is - The First Hop External (F) bit in the DSR Source Route option MUST
copied from the External bit flagging the first hop in the source be set to 0.
route for the packet, as indicated in the Route Cache.
- The Last Hop External (L) bit in the DSR Source Route option is - The Last Hop External (L) bit in the DSR Source Route option is
copied from the External bit flagging the last hop in the source copied from the External bit flagging the last hop in the source
route for the packet, as indicated in the Route Cache. route for the packet, as indicated in the Route Cache.
- The Salvage field in the DSR Source Route option MUST be - The Salvage field in the DSR Source Route option MUST be
initialized to some nonzero value; the particular nonzero value initialized to some nonzero value; the particular nonzero value
used SHOULD be MAX_SALVAGE_COUNT. By initializing this field to used SHOULD be MAX_SALVAGE_COUNT. By initializing this field to a
a nonzero value, nodes forwarding or overhearing this packet will nonzero value, nodes forwarding or overhearing this packet will
not consider a link to exist between the IP Source Address of the not consider a link to exist between the IP Source Address of the
packet and the Address[1] address in the DSR Source Route option packet and the Address[1] address in the DSR Source Route option
(e.g., they will not attempt to add this to their Route Cache as (e.g., they will not attempt to add this to their Route Cache as a
a link). By choosing MAX_SALVAGE_COUNT as the nonzero value to link). By choosing MAX_SALVAGE_COUNT as the nonzero value to
which the node initializes this field, nodes furthermore will not which the node initializes this field, nodes furthermore will not
attempt to salvage this packet. attempt to salvage this packet.
- Transmit the packet to the next-hop node on the new source route - Transmit the packet to the next-hop node on the new source route
in the packet, using the forwarding procedure described in in the packet, using the forwarding procedure described in Section
Section 8.1.5. 8.1.5.
8.2.4. Originating a Route Reply 8.2.4. Originating a Route Reply
A node originates a Route Reply in order to reply to a received and A node originates a Route Reply in order to reply to a received and
processed Route Request, according to the procedures described in processed Route Request, according to the procedures described in
Sections 8.2.2 and 8.2.3. The Route Reply is returned in a Route Sections 8.2.2 and 8.2.3. The Route Reply is returned in a Route
Reply option (Section 6.3). The Route Reply option MAY be returned Reply option (Section 6.3). The Route Reply option MAY be returned
to the initiator of the Route Request in a separate IP packet, used to the initiator of the Route Request in a separate IP packet, used
only to carry this Route Reply option, or it MAY be included in any only to carry this Route Reply option, or it MAY be included in any
other IP packet being sent to this address. other IP packet being sent to this address.
The Route Reply option MUST be included in a DSR Options header in The Route Reply option MUST be included in a DSR Options header in
the packet returned to the initiator. To initialize the Route Reply the packet returned to the initiator. To initialize the Route Reply
option, the node performs the following sequence of steps: option, the node performs the following sequence of steps:
- The Option Type in the option MUST be set to the value 3. - The Option Type in the option MUST be set to the value 3.
- The Opt Data Len field in the option MUST be set to the value - The Opt Data Len field in the option MUST be set to the value
(n * 4) + 3, where n is the number of addresses in the source (n * 4) + 3, where n is the number of addresses in the source
route being returned (excluding the Route Discovery initiator route being returned (excluding the Route Discovery initiator
node's address). node's address).
- The Last Hop External (L) bit in the option MUST be - If this node is the target of the Route Request, the Last Hop
initialized to 0. External (L) bit in the option MUST be initialized to 0.
- The Reserved field in the option MUST be initialized to 0. - The Reserved field in the option MUST be initialized to 0.
- The Route Request Identifier MUST be initialized to the - The Route Request Identifier MUST be initialized to the Identifier
Identifier field of the Route Request that this reply is sent in field of the Route Request to which this Route Reply is sent in
response to. response.
- The sequence of hop addresses in the source route are copied into - The sequence of hop addresses in the source route are copied into
the Address[i] fields of the option. Address[1] MUST be set to the Address[i] fields of the option. Address[1] MUST be set to
the first-hop address of the route after the initiator of the the first-hop address of the route after the initiator of the
Route Discovery, Address[n] MUST be set to the last-hop address Route Discovery, Address[n] MUST be set to the last-hop address of
of the source route (the address of the target node), and each the source route (the address of the target node), and each other
other Address[i] MUST be set to the next address in sequence in Address[i] MUST be set to the next address in sequence in the
the source route being returned. source route being returned.
The Destination Address field in the IP header of the packet carrying The Destination Address field in the IP header of the packet carrying
the Route Reply option MUST be set to the address of the initiator the Route Reply option MUST be set to the address of the initiator of
of the Route Discovery (i.e., for a Route Reply being returned in the Route Discovery (i.e., for a Route Reply being returned in
response to some Route Request, the IP Source Address of the Route response to some Route Request, the IP Source Address of the Route
Request). Request).
After creating and initializing the Route Reply option and the IP After creating and initializing the Route Reply option and the IP
packet containing it, send the Route Reply. In sending the Route packet containing it, send the Route Reply. In sending the Route
Reply from this node (but not from nodes forwarding the Route Reply), Reply from this node (but not from nodes forwarding the Route Reply),
this node SHOULD delay the Reply by a small jitter period chosen this node SHOULD delay the Reply by a small jitter period chosen
randomly between 0 and BroadcastJitter. randomly between 0 and BroadcastJitter.
When returning any Route Reply in the case in which the MAC protocol When returning any Route Reply in the case in which the MAC protocol
in use in the network is not capable of transmitting unicast packets in use in the network is not capable of transmitting unicast packets
over unidirectional links, the source route used for routing the over unidirectional links, the source route used for routing the
Route Reply packet MUST be obtained by reversing the sequence of Route Reply packet MUST be obtained by reversing the sequence of hops
hops in the Route Request packet (the source route that is then in the Route Request packet (the source route that is then returned
returned in the Route Reply). This restriction on returning a Route in the Route Reply). This restriction on returning a Route Reply
Reply enables the Route Reply to test this sequence of hops for enables the Route Reply to test this sequence of hops for
bidirectionality, preventing the Route Reply from being received by bidirectionality, preventing the Route Reply from being received by
the initiator of the Route Discovery unless each of the hops over the initiator of the Route Discovery unless each of the hops over
which the Route Reply is returned (and thus each of the hops in the which the Route Reply is returned (and thus each of the hops in the
source route being returned in the Reply) is bidirectional. source route being returned in the Reply) is bidirectional.
If sending a Route Reply to the initiator of the Route Request If sending a Route Reply to the initiator of the Route Request
requires performing a Route Discovery, the Route Reply option MUST requires performing a Route Discovery, the Route Reply option MUST be
be piggybacked on the packet that contains the Route Request. This piggybacked on the packet that contains the Route Request. This
piggybacking prevents a loop wherein the target of the new Route piggybacking prevents a recursive dependency wherein the target of
Request (which was itself the initiator of the original Route the new Route Request (which was itself the initiator of the original
Request) must do another Route Request in order to return its Route Request) must do another Route Request in order to return its
Route Reply. Route Reply.
If sending the Route Reply to the initiator of the Route Request If sending the Route Reply to the initiator of the Route Request does
does not require performing a Route Discovery, a node SHOULD send a not require performing a Route Discovery, a node SHOULD send a
unicast Route Reply in response to every Route Request it receives unicast Route Reply in response to every Route Request it receives
for which it is the target node. for which it is the target node.
8.2.5. Preventing Route Reply Storms 8.2.5. Preventing Route Reply Storms
The ability for nodes to reply to a Route Request based on The ability for nodes to reply to a Route Request based on
information in their Route Caches, as described in Sections 3.3.2 information in their Route Caches, as described in Sections 3.3.2 and
and 8.2.3, could result in a possible Route Reply "storm" in some 8.2.3, could result in a possible Route Reply "storm" in some cases.
cases. In particular, if a node broadcasts a Route Request for a In particular, if a node broadcasts a Route Request for a target node
target node for which the node's neighbors have a route in their for which the node's neighbors have a route in their Route Caches,
Route Caches, each neighbor may attempt to send a Route Reply, each neighbor may attempt to send a Route Reply, thereby wasting
thereby wasting bandwidth and possibly increasing the number of bandwidth and possibly increasing the number of network collisions in
network collisions in the area. the area.
For example, the figure below shows a situation in which nodes B, C, For example, the figure below shows a situation in which nodes B, C,
D, E, and F all receive A's Route Request for target G, and each has D, E, and F all receive A's Route Request for target G, and each has
the indicated route cached for this target: the indicated route cached for this target:
+-----+ +-----+ +-----+ +-----+
| D |< >| C | | D |< >| C |
+-----+ \ / +-----+ +-----+ \ / +-----+
Cache: C - B - G \ / Cache: B - G Cache: C - B - G \ / Cache: B - G
\ +-----+ / \ +-----+ /
skipping to change at page 74, line 49 skipping to change at page 73, line 32
/ \ Cache: G / \ Cache: G
v v v v
+-----+ +-----+ +-----+ +-----+
| E | | F | | E | | F |
+-----+ +-----+ +-----+ +-----+
Cache: F - B - G Cache: B - G Cache: F - B - G Cache: B - G
Normally, each of these nodes would attempt to reply from its own Normally, each of these nodes would attempt to reply from its own
Route Cache, and they would thus all send their Route Replies at Route Cache, and they would thus all send their Route Replies at
about the same time, since they all received the broadcast Route about the same time, since they all received the broadcast Route
Request at about the same time. Such simultaneous Route Replies Request at about the same time. Such simultaneous Route Replies from
from different nodes all receiving the Route Request may cause local different nodes all receiving the Route Request may cause local
congestion in the wireless network and may create packet collisions congestion in the wireless network and may create packet collisions
among some or all of these Replies if the MAC protocol in use does among some or all of these Replies if the MAC protocol in use does
not provide sufficient collision avoidance for these packets. In not provide sufficient collision avoidance for these packets. In
addition, it will often be the case that the different replies will addition, it will often be the case that the different replies will
indicate routes of different lengths, as shown in this example. indicate routes of different lengths, as shown in this example.
In order to reduce these effects, if a node can put its network In order to reduce these effects, if a node can put its network
interface into promiscuous receive mode, it MAY delay sending its interface into promiscuous receive mode, it MAY delay sending its own
own Route Reply for a short period, while listening to see if the Route Reply for a short period, while listening to see if the
initiating node begins using a shorter route first. Specifically, initiating node begins using a shorter route first. Specifically,
this node MAY delay sending its own Route Reply for a random period this node MAY delay sending its own Route Reply for a random period
d = H * (h - 1 + r) d = H * (h - 1 + r)
where h is the length in number of network hops for the route to be where h is the length in number of network hops for the route to be
returned in this node's Route Reply, r is a random floating point returned in this node's Route Reply, r is a random floating point
number between 0 and 1, and H is a small constant delay (at least number between 0 and 1, and H is a small constant delay (at least
twice the maximum wireless link propagation delay) to be introduced twice the maximum wireless link propagation delay) to be introduced
per hop. This delay effectively randomizes the time at which each per hop. This delay effectively randomizes the time at which each
node sends its Route Reply, with all nodes sending Route Replies node sends its Route Reply, with all nodes sending Route Replies
giving routes of length less than h sending their Replies before this giving routes of length less than h sending their Replies before this
node, and all nodes sending Route Replies giving routes of length node, and all nodes sending Route Replies giving routes of length
greater than h sending their Replies after this node. greater than h send their Replies after this node.
Within the delay period, this node promiscuously receives all Within the delay period, this node promiscuously receives all
packets, looking for data packets from the initiator of this Route packets, looking for data packets from the initiator of this Route
Discovery destined for the target of the Discovery. If such a data Discovery destined for the target of the Route Discovery. If such a
packet received by this node during the delay period uses a source data packet received by this node during the delay period uses a
route of length less than or equal to h, this node may infer that the source route of length less than or equal to h, this node may infer
initiator of the Route Discovery has already received a Route Reply that the initiator of the Route Discovery has already received a
giving an equally good or better route. In this case, this node Route Reply giving an equally good or better route. In this case,
SHOULD cancel its delay timer and SHOULD NOT send its Route Reply for this node SHOULD cancel its delay timer and SHOULD NOT send its Route
this Route Discovery. Reply for this Route Discovery.
8.2.6. Processing a Received Route Reply Option 8.2.6. Processing a Received Route Reply Option
Section 8.1.4 describes the general processing for a received packet, Section 8.1.4 describes the general processing for a received packet,
including the addition of routing information from options in the including the addition of routing information from options in the
packet's DSR Options header to the receiving node's Route Cache. packet's DSR Options header to the receiving node's Route Cache.
If the received packet contains a Route Reply, no additional special If the received packet contains a Route Reply, no additional special
processing of the Route Reply option is required beyond what is processing of the Route Reply option is required beyond what is
described there. As described in Section 4.1 anytime a node adds described there. As described in Section 4.1, anytime a node adds
new information to its Route Cache (including the information added new information to its Route Cache (including the information added
from this Route Reply option), the node SHOULD check each packet in from this Route Reply option), the node SHOULD check each packet in
its own Send Buffer (Section 4.2) to determine whether a route to its own Send Buffer (Section 4.2) to determine whether a route to
that packet's IP Destination Address now exists in the node's Route that packet's IP Destination Address now exists in the node's Route
Cache (including the information just added to the Cache). If so, Cache (including the information just added to the Cache). If so,
the packet SHOULD then be sent using that route and removed from the the packet SHOULD then be sent using that route and removed from the
Send Buffer. This general procedure handles all processing required Send Buffer. This general procedure handles all processing required
for a received Route Reply option. for a received Route Reply option.
When using a MAC protocol that requires bidirectional links for When using a MAC protocol that requires bidirectional links for
unicast transmission, a unidirectional link may be discovered by the unicast transmission, a unidirectional link may be discovered by the
propagation of the Route Request. When the Route Reply is sent over propagation of the Route Request. When the Route Reply is sent over
the reverse path, a forwarding node may discover that the next-hop is the reverse path, a forwarding node may discover that the next-hop is
unreachable. In this case, it MUST add the next-hop address to its unreachable. In this case, it MUST add the next-hop address to its
Blacklist (Section 4.6). blacklist (Section 4.6).
8.3. Route Maintenance Processing 8.3. Route Maintenance Processing
Route Maintenance is the mechanism by which a source node S is able Route Maintenance is the mechanism by which a source node S is able
to detect, while using a source route to some destination node D, to detect, while using a source route to some destination node D, if
if the network topology has changed such that it can no longer use the network topology has changed such that it can no longer use its
its route to D because a link along the route no longer works. When route to D because a link along the route no longer works. When
Route Maintenance indicates that a source route is broken, S can Route Maintenance indicates that a source route is broken, S can
attempt to use any other route it happens to know to D, or can invoke 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 Route Discovery again to find a new route for subsequent packets to
to D. Route Maintenance for this route is used only when S is D. Route Maintenance for this route is used only when S is actually
actually sending packets to D. sending packets to D.
Specifically, when forwarding a packet, a node MUST attempt Specifically, when forwarding a packet, a node MUST attempt to
to confirm the reachability of the next-hop node, unless such confirm the reachability of the next-hop node, unless such
confirmation had been received in the last MaintHoldoffTime. confirmation had been received in the last MaintHoldoffTime period.
Individual implementations MAY choose to bypass such confirmation Individual implementations MAY choose to bypass such confirmation for
for some limited number of packets, as long as those packets all some limited number of packets, as long as those packets all fall
fall within MaintHoldoffTime within the last confirmation. If no within MaintHoldoffTime since the last confirmation. If no
confirmation is received after the retransmission of MaxMaintRexmt confirmation is received after the retransmission of MaxMaintRexmt
acknowledgement requests, after the initial transmission of the acknowledgement requests, after the initial transmission of the
packet, and conceptually including all retransmissions provided packet, and conceptually including all retransmissions provided by
by the MAC layer, the node determines that the link for this the MAC layer, the node determines that the link for this next-hop
next-hop node of the source route is "broken". This confirmation node of the source route is "broken". This confirmation from the
from the next-hop node for Route Maintenance can be implemented next-hop node for Route Maintenance can be implemented using a link-
using a link-layer acknowledgement (Section 8.3.1), using a layer acknowledgement (Section 8.3.1), a "passive acknowledgement"
"passive acknowledgement" (Section 8.3.2), or using a network-layer (Section 8.3.2), or a network-layer acknowledgement (Section 8.3.3);
acknowledgement (Section 8.3.3); the particular strategy for the particular strategy for retransmission timing depends on the type
retransmission timing depends on the type of acknowledgement of acknowledgement mechanism used. When not using link-layer
mechanism used. When passive acknowledgements are being used, each acknowledgements for Route Maintenance, nodes SHOULD use passive
retransmitted acknowledgement request SHOULD be explicit software acknowledgements when possible but SHOULD try requesting a network-
acknowledgement requests. If no acknowledgement is received after layer acknowledgement one or more times before deciding that the link
MaxMaintRexmt retransmissions (if necessary), the node SHOULD has failed and originating a Route Error to the original sender of
originate a Route Error to the original sender of the packet, as the packet, as described in Section 8.3.4.
described in Section 8.3.4.
In deciding whether or not to send a Route Error in response to In deciding whether or not to send a Route Error in response to
attempting to forward a packet from some sender over a broken link, attempting to forward a packet from some sender over a broken link, a
a node MUST limit the number of consecutive packets from a single node MUST limit the number of consecutive packets from a single
sender that the node attempts to forward over this same broken sender that the node attempts to forward over this same broken link
link for which the node chooses not to return a Route Error; this for which the node chooses not to return a Route Error. This
requirement MAY be satisfied by returning a Route Error for each requirement MAY be satisfied by returning a Route Error for each
packet that the node attempts to forward over a broken link. packet that the node attempts to forward over a broken link.
8.3.1. Using Link-Layer Acknowledgements 8.3.1. Using Link-Layer Acknowledgements
If the MAC protocol in use provides feedback as to the successful If the MAC protocol in use provides feedback as to the successful
delivery of a data packet (such as is provided by the link-layer delivery of a data packet (such as is provided for unicast packets by
acknowledgement frame defined by IEEE 802.11 [13]), then the use the link-layer acknowledgement frame defined by IEEE 802.11
of the DSR Acknowledgement Request and Acknowledgement options [IEEE80211]), then the use of the DSR Acknowledgement Request and
is not necessary. If such link-layer feedback is available, it Acknowledgement options is not necessary. If such link-layer
SHOULD be used instead of any other acknowledgement mechanism feedback is available, it SHOULD be used instead of any other
for Route Maintenance, and the node SHOULD NOT use either passive acknowledgement mechanism for Route Maintenance, and the node SHOULD
acknowledgements or network-layer acknowledgements for Route NOT use either passive acknowledgements or network-layer
Maintenance. acknowledgements for Route Maintenance.
When using link-layer acknowledgements for Route Maintenance, the When using link-layer acknowledgements for Route Maintenance, the
retransmission timing and the timing at which retransmission attempts retransmission timing and the timing at which retransmission attempts
are scheduled are generally controlled by the particular link layer are scheduled are generally controlled by the particular link layer
implementation in use in the network. For example, in IEEE 802.11, implementation in use in the network. For example, in IEEE 802.11,
the link-layer acknowledgement is returned after the data packet as the link-layer acknowledgement is returned after a unicast packet as
a part of the basic access method of of the IEEE 802.11 Distributed a part of the basic access method of the IEEE 802.11 Distributed
Coordination Function (DCF) MAC protocol; the time at which the Coordination Function (DCF) MAC protocol; the time at which the
acknowledgement is expected to arrive and the time at which the next acknowledgement is expected to arrive and the time at which the next
retransmission attempt (if necessary) will occur are controlled by retransmission attempt (if necessary) will occur are controlled by
the MAC protocol implementation. the MAC protocol implementation.
When a node receives a link-layer acknowledgement for any packet in When a node receives a link-layer acknowledgement for any packet in
its Maintenance Buffer, that node SHOULD remove that packet, as well its Maintenance Buffer, that node SHOULD remove from its Maintenance
as any other packets in its Maintenance Buffer with the same next-hop Buffer that packet, as well as any other packets in its Maintenance
destination, from its Maintenance Buffer. Buffer with the same next-hop destination.
8.3.2. Using Passive Acknowledgements 8.3.2. Using Passive Acknowledgements
When link-layer acknowledgements are not available, but passive When link-layer acknowledgements are not available, but passive
acknowledgements [18] are available, passive acknowledgements SHOULD acknowledgements [JUBIN87] are available, passive acknowledgements
be used for Route Maintenance when originating or forwarding a packet SHOULD be used for Route Maintenance when originating or forwarding a
along any hop other than the last hop (the hop leading to the IP packet along any hop other than the last hop (the hop leading to the
Destination Address node of the packet). In particular, passive IP Destination Address node of the packet). In particular, passive
acknowledgements SHOULD be used for Route Maintenance in such cases acknowledgements SHOULD be used for Route Maintenance in such cases
if the node can place its network interface into "promiscuous" if the node can place its network interface into "promiscuous"
receive mode, and network links used for data packets generally receive mode, and if network links used for data packets generally
operate bidirectionally. operate bidirectionally.
A node MUST NOT attempt to use passive acknowledgements for Route A node MUST NOT attempt to use passive acknowledgements for Route
Maintenance for a packet originated or forwarded over its last hop Maintenance for a packet originated or forwarded over its last hop
(the hop leading to the IP Destination Address node of the packet), (the hop leading to the IP Destination Address node of the packet),
since the receiving node will not be forwarding the packet and thus since the receiving node will not be forwarding the packet and thus
no passive acknowledgement will be available to be heard by this no passive acknowledgement will be available to be heard by this
node. Beyond this restriction, a node MAY utilize a variety of node. Beyond this restriction, a node MAY utilize a variety of
strategies in using passive acknowledgements for Route Maintenance of strategies in using passive acknowledgements for Route Maintenance of
a packet that it originates or forwards. For example, the following a packet that it originates or forwards. For example, the following
two strategies are possible: two strategies are possible:
- Each time a node receives a packet to be forwarded to a node - Each time a node receives a packet to be forwarded to a node other
other than the final destination (the IP Destination Address than the final destination (the IP Destination Address of the
of the packet), that node sends the original transmission of packet), that node sends the original transmission of that packet
that packet without requesting a network-layer acknowledgement without requesting a network-layer acknowledgement for it. If no
for it. If no passive acknowledgement is received within passive acknowledgement is received within PassiveAckTimeout after
PassiveAckTimeout after this transmission, the node retransmits this transmission, the node retransmits the packet, again without
the packet, again without requesting a network-layer requesting a network-layer acknowledgement for it; the same
acknowledgement for it; the same PassiveAckTimeout timeout value PassiveAckTimeout timeout value is used for each such attempt. If
is used for each such attempt. If no acknowledgement has been no acknowledgement has been received after a total of
received after a total of TryPassiveAcks retransmissions of TryPassiveAcks retransmissions of the packet, network-layer
the packet, network-layer acknowledgements (as described in acknowledgements (as described in Section 8.3.3) are requested for
Section 8.3.3) are used for all remaining attempts for that all remaining attempts for that packet.
packet.
- Each node maintains a table of possible next-hop destination - Each node maintains a table of possible next-hop destination
nodes, noting whether or not passive acknowledgements can nodes, noting whether or not passive acknowledgements can
typically be expected from transmission to that node, and the typically be expected from transmission to that node, and the
expected latency and jitter of a passive acknowledgement from expected latency and jitter of a passive acknowledgement from that
that node. Each time a node receives a packet to be forwarded node. Each time a node receives a packet to be forwarded to a
to a node other than the IP Destination Address, the node checks node other than the IP Destination Address, the node checks its
its table of next-hop destination nodes to determine whether to table of next-hop destination nodes to determine whether to use a
use a passive acknowledgement or a network-layer acknowledgement passive acknowledgement or a network-layer acknowledgement for
for that transmission to that node. The timeout for this packet that transmission to that node. The timeout for this packet can
can also be derived from this table. A node using this method also be derived from this table. A node using this method SHOULD
SHOULD prefer using passive acknowledgements to network-layer prefer using passive acknowledgements to network-layer
acknowledgements. acknowledgements.
In using passive acknowledgements for a packet that it originates or In using passive acknowledgements for a packet that it originates or
forwards, a node considers the later receipt of a new packet (e.g., forwards, a node considers the later receipt of a new packet (e.g.,
with promiscuous receive mode enabled on its network interface) to be with promiscuous receive mode enabled on its network interface) an
an acknowledgement of this first packet if both of the following two acknowledgement of this first packet if both of the following two
tests succeed: tests succeed:
- The Source Address, Destination Address, Protocol, - The Source Address, Destination Address, Protocol, Identification,
Identification, and Fragment Offset fields in the IP header and Fragment Offset fields in the IP header of the two packets
of the two packets MUST match [32], and MUST match [RFC791].
- If either packet contains a DSR Source Route header, both packets - If either packet contains a DSR Source Route header, both packets
MUST contain one, and the value in the Segments Left field in the MUST contain one, and the value in the Segments Left field in the
DSR Source Route header of the new packet MUST be less than that DSR Source Route header of the new packet MUST be less than that
in the first packet. in the first packet.
When a node hears such a passive acknowledgement for any packet in When a node hears such a passive acknowledgement for any packet in
its Maintenance Buffer, that node SHOULD remove that packet, as well its Maintenance Buffer, that node SHOULD remove from its Maintenance
as any other packets in its Maintenance Buffer with the same next-hop Buffer that packet, as well as any other packets in its Maintenance
destination, from its Maintenance Buffer. Buffer with the same next-hop destination.
8.3.3. Using Network-Layer Acknowledgements 8.3.3. Using Network-Layer Acknowledgements
When a node originates or forwards a packet and has no other When a node originates or forwards a packet and has no other
mechanism of acknowledgement available to determine reachability mechanism of acknowledgement available to determine reachability of
of the next-hop node in the source route for Route Maintenance, the next-hop node in the source route for Route Maintenance, that
that node SHOULD request a network-layer acknowledgement from that node SHOULD request a network-layer acknowledgement from that next-
next-hop node. To do so, the node inserts an Acknowledgement Request hop node. To do so, the node inserts an Acknowledgement Request
option in the DSR Options header in the packet. The Identification option in the DSR Options header in the packet. The Identification
field in that Acknowledgement Request option MUST be set to a value field in that Acknowledgement Request option MUST be set to a value
unique over all packets transmitted by this node to the same next-hop unique over all packets recently transmitted by this node to the same
node that are either unacknowledged or recently acknowledged. next-hop node.
When a node receives a packet containing an Acknowledgement Request When a node receives a packet containing an Acknowledgement Request
option, then that node performs the following tests on the packet: option, that node performs the following tests on the packet:
- If the indicated next-hop node address for this packet does not - If the indicated next-hop node address for this packet does not
match any of this node's own IP addresses, then this node MUST match any of this node's own IP addresses, then this node MUST NOT
NOT process the Acknowledgement Request option. The indicated process the Acknowledgement Request option. The indicated next-
next-hop node address is the next Address[i] field in the DSR hop node address is the next Address[i] field in the DSR Source
Source Route option in the DSR Options header in the packet, or Route option in the DSR Options header in the packet, or the IP
is the IP Destination Address in the packet if the packet does Destination Address in the packet if the packet does not contain a
not contain a DSR Source Route option or the Segments Left there DSR Source Route option or the Segments Left there is zero.
is zero.
- If the packet contains an Acknowledgement option, then this node - If the packet contains an Acknowledgement option, then this node
MUST NOT process the Acknowledgement Request option. MUST NOT process the Acknowledgement Request option.
If neither of the tests above fails, then this node MUST process the If neither of the tests above fails, then this node MUST process the
Acknowledgement Request option by sending an Acknowledgement option Acknowledgement Request option by sending an Acknowledgement option
to the previous-hop node; to do so, the node performs the following to the previous-hop node; to do so, the node performs the following
sequence of steps: sequence of steps:
- Create a packet and set the IP Protocol field to the protocol - Create a packet and set the IP Protocol field to the protocol
number assigned for DSR (TBA???). number assigned for DSR (48).
- Set the IP Source Address field in this packet to the IP address - Set the IP Source Address field in this packet to the IP address
of this node, copied from the source route in the DSR Source of this node, copied from the source route in the DSR Source Route
Route option in that packet (or from the IP Destination Address option in that packet (or from the IP Destination Address field of
field of the packet, if the packet does not contain a DSR Source the packet, if the packet does not contain a DSR Source Route
Route option). option).
- Set the IP Destination Address field in this packet to the IP - Set the IP Destination Address field in this packet to the IP
address of the previous-hop node, copied from the source route address of the previous-hop node, copied from the source route in
in the DSR Source Route option in that packet (or from the IP the DSR Source Route option in that packet (or from the IP Source
Source Address field of the packet, if the packet does not Address field of the packet, if the packet does not contain a DSR
contain a DSR Source Route option). Source Route option).
- Add a DSR Options header to the packet, and set the DSR Options - Add a DSR Options header to the packet. Set the Next Header field
header's Next Header field to the "No Next Header" value. in the DSR Options header to the value 59, "No Next Header"
[RFC2460].
- Add an Acknowledgement option to the DSR Options header in the - Add an Acknowledgement option to the DSR Options header in the
packet; set the Acknowledgement option's Option Type field to 6 packet; set the Acknowledgement option's Option Type field to 6
and the Opt Data Len field to 10. and the Opt Data Len field to 10.
- Copy the Identification field from the received Acknowledgement - Copy the Identification field from the received Acknowledgement
Request option into the Identification field in the Request option into the Identification field in the
Acknowledgement option. Acknowledgement option.
- Set the ACK Source Address field in the Acknowledgement option to - Set the ACK Source Address field in the Acknowledgement option to
be the IP Source Address of this new packet (set above to be the be the IP Source Address of this new packet (set above to be the
IP address of this node). IP address of this node).
- Set the ACK Destination Address field in the Acknowledgement - Set the ACK Destination Address field in the Acknowledgement
option to be the IP Destination Address of this new packet (set option to be the IP Destination Address of this new packet (set
above to be the IP address of the previous-hop node). above to be the IP address of the previous-hop node).
- Send the packet as described in Section 8.1.1. - Send the packet as described in Section 8.1.1.
Packets containing an Acknowledgement option SHOULD NOT be placed in Packets containing an Acknowledgement option SHOULD NOT be placed in
the Maintenance Buffer. the Maintenance Buffer.
When a node receives a packet with both an Acknowledgement option When a node receives a packet with both an Acknowledgement option and
and an Acknowledgement Request option, if that node is not the an Acknowledgement Request option, if that node is not the
destination of the Acknowledgement option (the IP Destination Address destination of the Acknowledgement option (the IP Destination Address
of the packet), then the Acknowledgement Request option MUST of the packet), then the Acknowledgement Request option MUST be
be ignored. Otherwise (that node is the destination of the ignored. Otherwise (that node is the destination of the
Acknowledgement option), that node MUST process the Acknowledgement Acknowledgement option), that node MUST process the Acknowledgement
Request option by returning an Acknowledgement option according to Request option by returning an Acknowledgement option according to
the following sequence of steps: the following sequence of steps:
- Create a packet and set the IP Protocol field to the protocol - Create a packet and set the IP Protocol field to the protocol
number assigned for DSR (TBA???). number assigned for DSR (48).
- Set the IP Source Address field in this packet to the IP address - Set the IP Source Address field in this packet to the IP address
of this node, copied from the source route in the DSR Source of this node, copied from the source route in the DSR Source Route
Route option in that packet (or from the IP Destination Address option in that packet (or from the IP Destination Address field of
field of the packet, if the packet does not contain a DSR Source the packet, if the packet does not contain a DSR Source Route
Route option). option).
- Set the IP Destination Address field in this packet to the IP - Set the IP Destination Address field in this packet to the IP
address of the node originating the Acknowledgement option. address of the node originating the Acknowledgement option.
- Add a DSR Options header to the packet, and set the DSR Options - Add a DSR Options header to the packet, and set the DSR Options
header's Next Header field to the "No Next Header" value. header's Next Header field to the value 59, "No Next Header"
[RFC2460].
- Add an Acknowledgement option to the DSR Options header in this - Add an Acknowledgement option to the DSR Options header in this
packet; set the Acknowledgement option's Option Type field to 6 packet; set the Acknowledgement option's Option Type field to 6
and the Opt Data Len field to 10. and the Opt Data Len field to 10.
- Copy the Identification field from the received Acknowledgement - Copy the Identification field from the received Acknowledgement
Request option into the Identification field in the Request option into the Identification field in the
Acknowledgement option. Acknowledgement option.
- Set the ACK Source Address field in the option to be the IP - Set the ACK Source Address field in the option to the IP Source
Source Address of this new packet (set above to be the IP address Address of this new packet (set above to be the IP address of this
of this node). node).
- Set the ACK Destination Address field in the option to be the IP - Set the ACK Destination Address field in the option to the IP
Destination Address of this new packet (set above to be the IP Destination Address of this new packet (set above to be the IP
address of the node originating the Acknowledgement option.) address of the node originating the Acknowledgement option).
- Send the packet directly to the destination. The IP - Send the packet directly to the destination. The IP Destination
Destination Address MUST be treated as a direct neighbor node: Address MUST be treated as a direct neighbor node: the
the transmission to that node MUST be done in a single IP transmission to that node MUST be done in a single IP forwarding
forwarding hop, without Route Discovery and without searching hop, without Route Discovery and without searching the Route
the Route Cache. In addition, this packet MUST NOT contain a Cache. In addition, this packet MUST NOT contain a DSR
DSR Acknowledgement Request, MUST NOT be retransmitted for Route Acknowledgement Request, MUST NOT be retransmitted for Route
Maintenance, and MUST NOT expect a link-layer acknowledgement or Maintenance, and MUST NOT expect a link-layer acknowledgement or
passive acknowledgement. passive acknowledgement.
When using network-layer acknowledgements for Route Maintenance, When using network-layer acknowledgements for Route Maintenance, a
a node SHOULD use an adaptive algorithm in determining the node SHOULD use an adaptive algorithm in determining the
retransmission timeout for each transmission attempt of an retransmission timeout for each transmission attempt of an
acknowledgement request. For example, a node SHOULD maintain a acknowledgement request. For example, a node SHOULD maintain a
separate round-trip time (RTT) estimate for each to which it has separate round-trip time (RTT) estimate for each node to which it has
recently attempted to transmit packets, and it SHOULD use this RTT recently attempted to transmit packets, and it SHOULD use this RTT
estimate in setting the timeout for each retransmission attempt estimate in setting the timeout for each retransmission attempt for
for Route Maintenance. The TCP RTT estimation algorithm has been Route Maintenance. The TCP RTT estimation algorithm has been shown
shown to work well for this purpose in implementation and testbed to work well for this purpose in implementation and testbed
experiments with DSR [22, 24]. experiments with DSR [MALTZ99b, MALTZ01].
8.3.4. Originating a Route Error 8.3.4. Originating a Route Error
When a node is unable to verify reachability of a next-hop node after When a node is unable to verify reachability of a next-hop node after
reaching a maximum number of retransmission attempts, a node SHOULD reaching a maximum number of retransmission attempts, it SHOULD send
send a Route Error to the IP Source Address of the packet. When a Route Error to the IP Source Address of the packet. When sending a
sending a Route Error for a packet containing either a Route Error Route Error for a packet containing either a Route Error option or an
option or an Acknowledgement option, a node SHOULD add these existing Acknowledgement option, a node SHOULD add these existing options to
options to its Route Error, subject to the limit described below. its Route Error, subject to the limit described below.
A node transmitting a Route Error MUST perform the following steps: A node transmitting a Route Error MUST perform the following steps:
- Create an IP packet and set the Source Address field in this - Create an IP packet and set the IP Protocol field to the protocol
packet's IP header to the address of this node. number assigned for DSR (48). Set the Source Address field in
this packet's IP header to the address of this node.
- If the Salvage field in the DSR Source Route option in the - If the Salvage field in the DSR Source Route option in the packet
packet triggering the Route Error is zero, then copy the triggering the Route Error is zero, then copy the Source Address
Source Address field of the packet triggering the Route Error field of the packet triggering the Route Error into the
into the Destination Address field in the new packet's IP Destination Address field in the new packet's IP header;
header; otherwise, copy the Address[1] field from the DSR Source otherwise, copy the Address[1] field from the DSR Source Route
Route option of the packet triggering the Route Error into the option of the packet triggering the Route Error into the
Destination Address field in the new packet's IP header Destination Address field in the new packet's IP header
- Insert a DSR Options header into the new packet. - Insert a DSR Options header into the new packet.
- Add a Route Error Option to the new packet, setting the Error - Add a Route Error Option to the new packet, setting the Error Type
Type to NODE_UNREACHABLE, the Salvage value to the Salvage to NODE_UNREACHABLE, the Salvage value to the Salvage value from
value from the DSR Source Route option of the packet triggering the DSR Source Route option of the packet triggering the Route
the Route Error, and the Unreachable Node Address field to Error, and the Unreachable Node Address field to the address of
the address of the next-hop node from the original source the next-hop node from the original source route. Set the Error
route. Set the Error Source Address field to this node's IP Source Address field to this node's IP address, and the Error
address, and the Error Destination field to the new packet's IP Destination field to the new packet's IP Destination Address.
Destination Address.
- If the packet triggering the Route Error contains any Route Error - If the packet triggering the Route Error contains any Route Error
or Acknowledgement options, the node MAY append to its Route or Acknowledgement options, the node MAY append to its Route Error
Error each of these options, with the following constraints: each of these options, with the following constraints:
o The node MUST NOT include any Route Error option from the o The node MUST NOT include any Route Error option from the
packet triggering the new Route Error, for which the total packet triggering the new Route Error, for which the total
salvage count (Section 6.4) of that included Route Error Salvage count (Section 6.4) of that included Route Error would
would be greater than MAX_SALVAGE_COUNT in the new packet. be greater than MAX_SALVAGE_COUNT in the new packet.
o If any Route Error option from the packet triggering the new o If any Route Error option from the packet triggering the new
Route Error is not included in the packet, the node MUST NOT Route Error is not included in the packet, the node MUST NOT
include any following Route Error or Acknowledgement options include any following Route Error or Acknowledgement options
from the packet triggering the new Route Error. from the packet triggering the new Route Error.
o Any appended options from the packet triggering the Route o Any appended options from the packet triggering the Route Error
Error MUST follow the new Route Error in the packet. MUST follow the new Route Error in the packet.
o In appending these options to the new Route Error, the order o In appending these options to the new Route Error, the order of
of these options from the packet triggering the Route Error these options from the packet triggering the Route Error MUST
MUST be preserved. be preserved.
- Send the packet as described in Section 8.1.1. - Send the packet as described in Section 8.1.1.
8.3.5. Processing a Received Route Error Option 8.3.5. Processing a Received Route Error Option
When a node receives a packet containing a Route Error option, that When a node receives a packet containing a Route Error option, that
node MUST process the Route Error option according to the following node MUST process the Route Error option according to the following
sequence of steps: sequence of steps:
- The node MUST remove from its Route Cache the link from the - The node MUST remove from its Route Cache the link from the node
node identified by the Error Source Address field to the node identified by the Error Source Address field to the node
identified by the Unreachable Node Address field (if this link is identified by the Unreachable Node Address field (if this link is
present in its Route Cache). If the node implements its Route present in its Route Cache). If the node implements its Route
Cache as a link cache, as described in Section 4.1, only this Cache as a link cache, as described in Section 4.1, only this
single link is removed; if the node implements its Route Cache as single link is removed; if the node implements its Route Cache as
a path cache, however, all routes (paths) that use this link are a path cache, however, all routes (paths) that use this link are
removed. either truncated before the link or removed completely.
- If the option following the Route Error is an Acknowledgement - If the option following the Route Error is an Acknowledgement or
or Route Error option sent by this node (that is, with Route Error option sent by this node (that is, with
Acknowledgement or Error Source Address equal to this node's Acknowledgement or Error Source Address equal to this node's
address), copy the DSR options following the current Route address), copy the DSR options following the current Route Error
Error into a new packet with IP Source Address equal to this into a new packet with IP Source Address equal to this node's own
node's own IP address and IP Destination Address equal to the IP address and IP Destination Address equal to the Acknowledgement
Acknowledgement or Error Destination Address. Transmit this or Error Destination Address. Transmit this packet as described
packet as described in Section 8.1.1, with the salvage count in Section 8.1.1, with the Salvage count in the DSR Source Route
in the DSR Source Route option set to the Salvage value of the option set to the Salvage value of the Route Error.
Route Error.
In addition, after processing the Route Error as described above, In addition, after processing the Route Error as described above, the
the node MAY initiate a new Route Discovery for any destination node node MAY initiate a new Route Discovery for any destination node for
for which it then has no route in its Route Cache as a result of which it then has no route in its Route Cache as a result of
processing this Route Error, if the node has indication that a route processing this Route Error, if the node has indication that a route
to that destination is needed. For example, if the node has an open to that destination is needed. For example, if the node has an open
TCP connection to some destination node, then if the processing of TCP connection to some destination node, then if the processing of
this Route Error removed the only route to that destination from this this Route Error removed the only route to that destination from this
node's Route Cache, then this node MAY initiate a new Route Discovery node's Route Cache, then this node MAY initiate a new Route Discovery
for that destination node. Any node, however, MUST limit the rate at for that destination node. Any node, however, MUST limit the rate at
which it initiates new Route Discoveries for any single destination which it initiates new Route Discoveries for any single destination
address, and any new Route Discovery initiated in this way as part of address, and any new Route Discovery initiated in this way as part of
processing this Route Error MUST conform to this limit. processing this Route Error MUST conform as a part of this limit.
8.3.6. Salvaging a Packet 8.3.6. Salvaging a Packet
When an intermediate node forwarding a packet detects through Route When an intermediate node forwarding a packet detects through Route
Maintenance that the next-hop link along the route for that packet is Maintenance that the next-hop link along the route for that packet is
broken (Section 8.3), if the node has another route to the packet's broken (Section 8.3), if the node has another route to the packet's
IP Destination Address in its Route Cache, the node SHOULD "salvage" IP Destination Address in its Route Cache, the node SHOULD "salvage"
the packet rather than discarding it. To do so using the route found the packet rather than discard it. To do so using the route found in
in its Route Cache, this node processes the packet as follows: its Route Cache, this node processes the packet as follows:
- If the MAC protocol in use in the network is not capable of
transmitting unicast packets over unidirectional links, as
discussed in Section 3.3.1, then if this packet contains a Route
Reply option, remove and discard the Route Reply option in the
packet; if the DSR Options header in the packet then contains no
DSR options, remove the DSR Options header from the packet. If
the resulting packet then contains only an IP header, the node
SHOULD NOT salvage the packet and instead SHOULD discard the
entire packet.
When returning any Route Reply in the case in which the MAC - If the MAC protocol in use in the network is not capable of
protocol in use in the network is not capable of transmitting transmitting unicast packets over unidirectional links, as
unicast packets over unidirectional links, the source route discussed in Section 3.3.1, then if this packet contains a Route
used for routing the Route Reply packet MUST be obtained by Reply option, remove and discard the Route Reply option in the
reversing the sequence of hops in the Route Request packet (the packet; if the DSR Options header in the packet then contains no
source route that is then returned in the Route Reply). This DSR options or only a DSR Source Route Option, remove the DSR
restriction on returning a Route Reply and on salvaging a packet Options header from the packet. If the resulting packet then
that contains a Route Reply option enables the Route Reply to contains only an IP header (e.g., no transport layer header or
test this sequence of hops for bidirectionality, preventing the payload), the node SHOULD NOT salvage the packet and instead
Route Reply from being received by the initiator of the Route SHOULD discard the entire packet.
Discovery unless each of the hops over which the Route Reply is
returned (and thus each of the hops in the source route being
returned in the Reply) is bidirectional.
- Modify the existing DSR Source Route option in the packet so - Modify the existing DSR Source Route option in the packet so that
that the Address[i] fields represent the source route found in the Address[i] fields represent the source route found in this
this node's Route Cache to this packet's IP Destination Address. node's Route Cache to this packet's IP Destination Address.
Specifically, the node copies the hop addresses of the source Specifically, the node copies the hop addresses of the source
route into sequential Address[i] fields in the DSR Source Route route into sequential Address[i] fields in the DSR Source Route
option, for i = 1, 2, ..., n. Address[1] here is the address option, for i = 1, 2, ..., n. Address[1], here, is the address of
of the salvaging node itself (the first address in the source the salvaging node itself (the first address in the source route
route found from this node to the IP Destination Address of the found from this node to the IP Destination Address of the packet).
packet). The value n here is the number of hop addresses in this The value n, here, is the number of hop addresses in this source
source route, excluding the destination of the packet (which is route, excluding the destination of the packet (which is instead
instead already represented in the Destination Address field in already represented in the Destination Address field in the
the packet's IP header). packet's IP header).
- Initialize the Segments Left field in the DSR Source Route option - Initialize the Segments Left field in the DSR Source Route option
to n as defined above. to n as defined above.
- The First Hop External (F) bit in the DSR Source Route option is - The First Hop External (F) bit in the DSR Source Route option MUST
copied from the External bit flagging the first hop in the source be set to 0.
route for the packet, as indicated in the Route Cache.
- The Last Hop External (L) bit in the DSR Source Route option is - The Last Hop External (L) bit in the DSR Source Route option is
copied from the External bit flagging the last hop in the source copied from the External bit flagging the last hop in the source
route for the packet, as indicated in the Route Cache. route for the packet, as indicated in the Route Cache.
- The Salvage field in the DSR Source Route option is set to 1 plus - The Salvage field in the DSR Source Route option is set to 1 plus
the value of the Salvage field in the DSR Source Route option of the value of the Salvage field in the DSR Source Route option of
the packet that caused the error. the packet that caused the error.
- Transmit the packet to the next-hop node on the new source route - Transmit the packet to the next-hop node on the new source route
in the packet, using the forwarding procedure described in in the packet, using the forwarding procedure described in Section
Section 8.1.5. 8.1.5.
As described in Section 8.3.4, the node in this case also SHOULD As described in Section 8.3.4, the node in this case also SHOULD
return a Route Error to the original sender of the packet. If the return a Route Error to the original sender of the packet. If the
node chooses to salvage the packet, it SHOULD do so after originating node chooses to salvage the packet, it SHOULD do so after originating
the Route Error. the Route Error.
8.4. Multiple Network Interface Support When returning any Route Reply in the case in which the MAC protocol
in use in the network is not capable of transmitting unicast packets
over unidirectional links, the source route used for routing the
Route Reply packet MUST be obtained by reversing the sequence of hops
in the Route Request packet (the source route that is then returned
in the Route Reply). This restriction on returning a Route Reply and
on salvaging a packet that contains a Route Reply option enables the
Route Reply to test this sequence of hops for bidirectionality,
preventing the Route Reply from being received by the initiator of
the Route Discovery unless each of the hops over which the Route
Reply is returned (and thus each of the hops in the source route
being returned in the Reply) is bidirectional.
8.4. Multiple Network Interface Support
A node using DSR MAY have multiple network interfaces that support A node using DSR MAY have multiple network interfaces that support
ad hoc network routing. This section describes special packet DSR ad hoc network routing. This section describes special packet
processing at such nodes. processing at such nodes.
A node with multiple network interfaces MUST have some policy for A node with multiple network interfaces that support DSR ad hoc
determining which Route Request packets are forwarded out which network routing MUST have some policy for determining which Route
network interfaces. For example, a node MAY choose to forward all Request packets are forwarded using which network interfaces. For
Route Requests out all network interfaces. example, a node MAY choose to forward all Route Requests over all
network interfaces.
When a node with multiple network interfaces propagates a Route When a node with multiple network interfaces that support DSR
Request on an network interface other than the one one which it propagates a Route Request on a network interface other than the one
received the Route Request, it MUST modify the address list between on which it received the Route Request, it MUST in this special case
receipt and propagation as follows: modify the Address list in the Route Request as follows:
- Append the address of the incoming network interface. - Append the node's IP address for the incoming network interface.
- Append the address of the outgoing network interface. - Append the node's IP address for the outgoing network interface.
When a node forwards a packet containing a source route, it MUST When a node forwards a packet containing a source route, it MUST
assume that the next-hop node is reachable on the incoming network assume that the next-hop node is reachable on the incoming network
interface, unless the next hop is the address of one of this node's interface, unless the next hop is the address of one of this node's
network interfaces, in which case this node MUST skip over this network interfaces, in which case this node MUST skip over this
address in the source route and process the packet in the same way as address in the source route and process the packet in the same way as
if it had just received it from that network interface, as described if it had just received it from that network interface, as described
in section 8.1.5. in Section 8.1.5.
If a node that previously had multiple network interfaces receives If a node that previously had multiple network interfaces that
a packet sent with a source route specifying a change to a network support DSR receives a packet sent with a source route specifying a
interface that is no longer available, it MAY send a Route Error to change to a network interface, as described above, that is no longer
the source of the packet without attempting to forward the packet available, it MAY send a Route Error to the source of the packet
on the incoming network interface, unless the network uses an without attempting to forward the packet on the incoming network
autoconfiguration mechanism that may have allowed another node to interface, unless the network uses an autoconfiguration mechanism
acquire the now unused address of the unavailable network interface. that may have allowed another node to acquire the now unused address
of the unavailable network interface.
8.5. IP Fragmentation and Reassembly 8.5. IP Fragmentation and Reassembly
When a node using DSR wishes to fragment a packet that contains a DSR When a node using DSR wishes to fragment a packet that contains a DSR
header not containing a Route Request option, it MUST perform the header not containing a Route Request option, it MUST perform the
following sequence of steps: following sequence of steps:
- Remove the DSR Options header from the packet. - Remove the DSR Options header from the packet.
- Fragment the packet. When determining the size of each fragment - Fragment the packet using normal IP fragmentation processing
to create from the original packet, the fragment size MUST be [RFC791]. However, when determining the size of each fragment to
reduced by the size of the DSR Options header from the original create from the original packet, the fragment size MUST be reduced
packet. by the size of the DSR Options header from the original packet.
- IP-in-IP encapsulate each fragment [28]. The IP Destination - IP-in-IP encapsulate each fragment [RFC2003]. The IP Destination
address of the outer (encapsulating) packet MUST be set equal to address of the outer (encapsulating) packet MUST be set equal to
the IP Destination address of the original packet. the IP Destination address of the original packet.
- Add the DSR Options header from the original packet to each - Add the DSR Options header from the original packet to each
resulting encapsulating packet. If a Source Route header is resulting encapsulating packet. If a Source Route header is
present in the DSR Options header, increment the Salvage field. present in the DSR Options header, increment the Salvage field.
When a node using the DSR protocol receives an IP-in-IP encapsulated When a node using the DSR protocol receives an IP-in-IP encapsulated
packet destined to itself, it SHOULD decapsulate the packet [28] and packet destined to itself, it SHOULD decapsulate the packet [RFC2003]
then process the inner packet according to standard IP reassembly and then process the inner packet according to standard IP reassembly
processing [32]. processing [RFC791].
8.6. Flow State Processing 8.6. Flow State Processing
A node implementing the optional DSR flow state extension MUST follow A node implementing the optional DSR flow state extension MUST follow
these additional processing steps. these additional processing steps.
8.6.1. Originating a Packet 8.6.1. Originating a Packet
When originating any packet to be routed using flow state, a node When originating any packet to be routed using flow state, a node
using DSR flow state MUST: using DSR flow state MUST do the following:
- If the route to be used for this packet has never had a DSR - If the route to be used for this packet has never had a DSR flow
flow state established along it (or the existing flow state has state established along it (or the existing flow state has
expired): expired):
o Generate a 16-bit Flow ID larger than any unexpired Flow IDs o Generate a 16-bit Flow ID larger than any unexpired Flow IDs
used for this destination. Odd Flow IDs MUST be chosen for used by this node for this destination. Odd Flow IDs MUST be
"default" flows; even Flow IDs MUST be chosen for non-default chosen for "default" flows; even Flow IDs MUST be chosen for
flows. non-default flows.
o Add a DSR Options header, as described in Section 8.1.2. o Add a DSR Options header, as described in Section 8.1.2.
o Add a DSR Flow State header, as described in Section 8.6.2. o Add a DSR Flow State header, as described in Section 8.6.2.
o Initialize the Hop Count field in the DSR Flow State header o Initialize the Hop Count field in the DSR Flow State header to
to 0. 0.