idnits 2.17.1 draft-ietf-manet-aodvv2-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 4 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The exact meaning of the all-uppercase expression 'MAY NOT' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. == The expression 'MAY NOT', while looking like RFC 2119 requirements text, is not defined in RFC 2119, and should not be used. Consider using 'MUST NOT' instead (if that is what you mean). Found 'MAY NOT' in this paragraph: Active An Active route is in current use for forwarding packets. An Active route is maintained continuously by AODVv2 and is considered to remain active as long as it is used at least once during every ACTIVE_INTERVAL, or if the Route.Timed flag is true. When a route that is not a timed route is no longer active the route becomes an Idle route. Idle An Idle route can be used for forwarding packets, even though it is not in current use. If an Idle route is used to forward a packet, it becomes an Active route once again. After an Idle route remains idle for MAX_IDLETIME, it becomes an Expired route. Expired After a route has been idle for too long, it expires, and may no longer be used for forwarding packets. An Expired route is not used for forwarding, but the sequence number information can be maintained until the destination sequence number has had no updates for MAX_SEQNUM_LIFETIME; after that time, old sequence number information is considered no longer valuable and the Expired route MUST BE expunged. Broken A route marked as Broken cannot be used for forwarding packets but still has valid destination sequence number information. When the link to a route's next hop is broken, the route is marked as being Broken, and afterwards the route MAY NOT be used. Timed The expiration of a Timed route is controlled by the Route.ExpirationTime time of the route table entry (instead of MAX_IDLETIME). Until that time, a Timed route can be used for forwarding packets. A route is indicated to be a Timed route by the setting of the Route.Timed flag in the route table entry. Afterwards, the route MAY be expunged; otherwise the route must be must be marked as Expired. -- The document date (December 30, 2014) is 3398 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'MANETs' is mentioned on line 160, but not defined == Missing Reference: 'Address' is mentioned on line 343, but not defined == Missing Reference: 'OrigAddr' is mentioned on line 1195, but not defined == Missing Reference: 'TargAddr' is mentioned on line 1109, but not defined == Missing Reference: 'MetricType' is mentioned on line 1139, but not defined == Missing Reference: 'TBD' is mentioned on line 1831, but not defined -- Looks like a reference, but probably isn't: '0' on line 2561 == Outdated reference: A later version (-03) exists of draft-perkins-irrep-02 Summary: 0 errors (**), 0 flaws (~~), 10 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Mobile Ad hoc Networks Working Group C. Perkins 3 Internet-Draft Futurewei 4 Intended status: Standards Track S. Ratliff 5 Expires: July 3, 2015 Idirect 6 J. Dowdell 7 Airbus Defence and Space 8 L. Steenbrink 9 HAW Hamburg, Dept. Informatik 10 December 30, 2014 12 Dynamic MANET On-demand (AODVv2) Routing 13 draft-ietf-manet-aodvv2-06 15 Abstract 17 The revised Ad Hoc On-demand Distance Vector (AODVv2) routing 18 protocol is intended for use by mobile routers in wireless, multihop 19 networks. AODVv2 determines unicast routes among AODVv2 routers 20 within the network in an on-demand fashion, offering rapid 21 convergence in dynamic topologies. 23 Status of This Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at http://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on July 3, 2015. 40 Copyright Notice 42 Copyright (c) 2014 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents 47 (http://trustee.ietf.org/license-info) in effect on the date of 48 publication of this document. Please review these documents 49 carefully, as they describe your rights and restrictions with respect 50 to this document. Code Components extracted from this document must 51 include Simplified BSD License text as described in Section 4.e of 52 the Trust Legal Provisions and are provided without warranty as 53 described in the Simplified BSD License. 55 Table of Contents 57 1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4 58 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 59 3. Data Elements and Notational Conventions . . . . . . . . . . 8 60 4. Applicability Statement . . . . . . . . . . . . . . . . . . . 8 61 5. AODVv2 Message Transmission . . . . . . . . . . . . . . . . . 10 62 6. Data Structures . . . . . . . . . . . . . . . . . . . . . . . 10 63 6.1. Route Table Entry . . . . . . . . . . . . . . . . . . . . 10 64 6.2. Bidirectional Connectivity and Blacklists . . . . . . . . 12 65 6.3. Router Clients and Client Networks . . . . . . . . . . . 13 66 6.4. Sequence Numbers . . . . . . . . . . . . . . . . . . . . 13 67 6.5. Metrics . . . . . . . . . . . . . . . . . . . . . . . . . 14 68 6.5.1. The Cost() function . . . . . . . . . . . . . . . . . 15 69 6.5.2. The LoopFree() function . . . . . . . . . . . . . . . 15 70 6.5.3. Default Metric type . . . . . . . . . . . . . . . . . 16 71 6.5.4. Alternate Metrics . . . . . . . . . . . . . . . . . . 16 72 6.6. RREQ Table: Received RREQ Messages . . . . . . . . . . . 16 73 7. AODVv2 Operations on Route Table Entries . . . . . . . . . . 18 74 7.1. Evaluating Incoming Routing Information . . . . . . . . . 18 75 7.2. Applying Route Updates To Route Table Entries . . . . . . 19 76 7.3. Route Table Entry Timeouts . . . . . . . . . . . . . . . 20 77 8. Routing Messages RREQ and RREP (RteMsgs) . . . . . . . . . . 20 78 8.1. Route Discovery Retries and Buffering . . . . . . . . . . 21 79 8.2. RteMsg Structure . . . . . . . . . . . . . . . . . . . . 22 80 8.3. RREQ Generation . . . . . . . . . . . . . . . . . . . . . 23 81 8.4. RREP Generation . . . . . . . . . . . . . . . . . . . . . 24 82 8.5. Handling a Received RteMsg . . . . . . . . . . . . . . . 24 83 8.5.1. Additional Handling for Incoming RREQ . . . . . . . . 25 84 8.5.2. Additional Handling for Incoming RREP . . . . . . . . 26 85 8.6. Suppressing Redundant RREQ messages . . . . . . . . . . . 26 86 9. Route Maintenance and RERR Messages . . . . . . . . . . . . . 27 87 9.1. Maintaining Route Lifetimes During Packet Forwarding . . 27 88 9.2. Next-hop Router Adjacency Monitoring . . . . . . . . . . 28 89 9.3. RERR Generation . . . . . . . . . . . . . . . . . . . . . 28 90 9.3.1. Case 1: Undeliverable Packet . . . . . . . . . . . . 29 91 9.3.2. Case 2: Broken Link . . . . . . . . . . . . . . . . . 30 92 9.4. Receiving and Handling RERR Messages . . . . . . . . . . 30 93 10. Representing AODVv2 data elements using RFC 5444 . . . . . . 32 94 11. Simple Internet Attachment . . . . . . . . . . . . . . . . . 33 95 12. Multiple Interfaces . . . . . . . . . . . . . . . . . . . . . 34 96 13. AODVv2 Control Message Generation Limits . . . . . . . . . . 35 97 14. Optional Features . . . . . . . . . . . . . . . . . . . . . . 35 98 14.1. Expanding Rings Multicast . . . . . . . . . . . . . . . 35 99 14.2. Intermediate RREP . . . . . . . . . . . . . . . . . . . 35 100 14.3. Precursor Lists and Notifications . . . . . . . . . . . 35 101 14.3.1. Overview . . . . . . . . . . . . . . . . . . . . . . 36 102 14.3.2. Precursor Notification Details . . . . . . . . . . . 36 103 14.4. Multicast RREP Response to RREQ . . . . . . . . . . . . 37 104 14.5. RREP_ACK . . . . . . . . . . . . . . . . . . . . . . . . 37 105 14.6. Message Aggregation . . . . . . . . . . . . . . . . . . 37 106 15. Administratively Configurable Parameters and Timer Values . . 38 107 15.1. Timers . . . . . . . . . . . . . . . . . . . . . . . . . 38 108 15.2. Protocol constants . . . . . . . . . . . . . . . . . . . 39 109 15.3. Administrative (functional) controls . . . . . . . . . . 39 110 15.4. Other administrative parameters and lists . . . . . . . 39 111 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 40 112 16.1. AODVv2 Message Types Specification . . . . . . . . . . . 40 113 16.2. Message TLV Type Specification . . . . . . . . . . . . . 40 114 16.3. Address Block TLV Specification . . . . . . . . . . . . 41 115 16.4. Metric Type Number Allocation . . . . . . . . . . . . . 41 116 17. Security Considerations . . . . . . . . . . . . . . . . . . . 41 117 18. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 43 118 19. References . . . . . . . . . . . . . . . . . . . . . . . . . 43 119 19.1. Normative References . . . . . . . . . . . . . . . . . . 43 120 19.2. Informative References . . . . . . . . . . . . . . . . . 44 121 Appendix A. Example Algorithms for AODVv2 Protocol Operations . 45 122 A.1. Subroutines for AODVv2 Protocol Operations . . . . . . . 47 123 A.2. Example Algorithms for AODVv2 RREQ Operations . . . . . . 48 124 A.2.1. Generate_RREQ . . . . . . . . . . . . . . . . . . . . 48 125 A.2.2. Receive_RREQ . . . . . . . . . . . . . . . . . . . . 49 126 A.2.3. Regenerate_RREQ . . . . . . . . . . . . . . . . . . . 50 127 A.3. Example Algorithms for AODVv2 RREP Operations . . . . . . 51 128 A.3.1. Generate_RREP . . . . . . . . . . . . . . . . . . . . 52 129 A.3.2. Receive_RREP . . . . . . . . . . . . . . . . . . . . 53 130 A.3.3. Regenerate_RREP . . . . . . . . . . . . . . . . . . . 54 131 A.3.4. Consume_RREP . . . . . . . . . . . . . . . . . . . . 55 132 A.4. Example Algorithms for AODVv2 RERR Operations . . . . . . 55 133 A.4.1. Generate_RERR . . . . . . . . . . . . . . . . . . . . 55 134 A.4.2. Receive_RERR . . . . . . . . . . . . . . . . . . . . 56 135 A.4.3. Regenerate_RERR . . . . . . . . . . . . . . . . . . . 57 136 A.5. Example Algorithms for AODVv2 RREP-Ack Operations . . . . 59 137 A.5.1. Generate_RREP_Ack . . . . . . . . . . . . . . . . . . 59 138 A.5.2. Consume_RREP_Ack . . . . . . . . . . . . . . . . . . 59 139 A.5.3. Timeout_RREP_Ack . . . . . . . . . . . . . . . . . . 59 140 Appendix B. Example RFC 5444-compliant packet formats . . . . . 59 141 B.1. RREQ Message Format . . . . . . . . . . . . . . . . . . . 60 142 B.2. RREP Message Format . . . . . . . . . . . . . . . . . . . 62 143 B.3. RERR Message Format . . . . . . . . . . . . . . . . . . . 64 144 B.4. RREP_ACK Message Format . . . . . . . . . . . . . . . . . 65 146 Appendix C. Changes since revision ...-05.txt . . . . . . . . . 65 147 Appendix D. Changes since revision ...-04.txt . . . . . . . . . 66 148 Appendix E. Changes since revision ...-03.txt . . . . . . . . . 67 149 Appendix F. Changes since revision ...-02.txt . . . . . . . . . 67 150 Appendix G. Multi-homing Considerations . . . . . . . . . . . . 68 151 Appendix H. Shifting Network Prefix Advertisement Between AODVv2 152 Routers . . . . . . . . . . . . . . . . . . . . . . 68 153 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 68 155 1. Overview 157 The revised Ad Hoc On-demand Distance Vector (AODVv2) routing 158 protocol [formerly named DYMO] enables on-demand, multihop unicast 159 routing among AODVv2 routers in mobile ad hod networks 160 [MANETs][RFC2501]. The basic operations of the AODVv2 protocol are 161 route discovery and route maintenance. Route discovery is performed 162 when an AODVv2 router must transmit a packet towards a destination 163 for which it does not have a route. Route maintenance is performed 164 to avoid prematurely expunging routes from the route table, and to 165 avoid dropping packets when a route breaks. 167 During route discovery, the originating AODVv2 router (RREQ_Gen) 168 multicasts a Route Request message (RREQ) to find a route toward some 169 target destination. Using a hop-by-hop regeneration algorithm, each 170 AODVv2 router receiving the RREQ message records a route toward the 171 originator. When the target's AODVv2 router (RREP_Gen) receives the 172 RREQ, it records a route toward RREQ_Gen and generates a Route Reply 173 (RREP) unicast toward RREQ_Gen. Each AODVv2 router that receives the 174 RREP stores a route toward the target, and again unicasts the RREP 175 toward the originator. When RREQ_Gen receives the RREP, routes have 176 then been established between RREQ_Gen (the originating AODVv2 177 router) and RREP_Gen (the target's AODVv2 router) in both directions. 179 Route maintenance consists of two operations. In order to maintain 180 routes, AODVv2 routers extend route lifetimes upon successfully 181 forwarding a packet. When a data packet is received to be forwarded 182 but there is no valid route for the destination, then the AODVv2 183 router of the source of the packet is notified via a Route Error 184 (RERR) message. Each upstream router that receives the RERR marks 185 the route as broken. Before such an upstream AODVv2 router could 186 forward a packet to the same destination, it would have to perform 187 route discovery again for that destination. RERR messages are also 188 used to notify upstream routers when routes break (say, due to loss 189 of a link to a neighbor). 191 AODVv2 uses sequence numbers to assure loop freedom [Perkins99], 192 similarly to AODV. Sequence numbers enable AODVv2 routers to 193 determine the temporal order of AODVv2 route discovery messages, 194 thereby avoiding use of stale routing information. See Section 10 195 for the mapping of AODVv2 data elements to RFC 5444 Address Block, 196 Address TLV, and Message TLV formats. 198 2. Terminology 200 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 201 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 202 "OPTIONAL" in this document are to be interpreted as described in 203 [RFC2119]. 205 This document uses terminology from [RFC5444]. 207 This document defines the following terms: 209 Adjacency 210 A bi-directional relationship between neighboring AODVv2 routers 211 for the purpose of exchanging routing information. Not every pair 212 of neighboring routers will necessarily form an adjacency. 213 Monitoring of adjacencies where packets are being forwarded is 214 required (see Section 9.2). 215 AODVv2 Router 216 An IP addressable device in the ad-hoc network that performs the 217 AODVv2 protocol operations specified in this document. 218 AODVv2 Sequence Number (SeqNum) 219 Same as Sequence Number. 220 Client Interface 221 An interface that directly connects Router Clients to the Router. 222 Current_Time 223 The current time as maintained by the AODVv2 router. 224 Data Element 225 A named object used within AODVv2 protocol messages 226 Disregard 227 Ignore for further processing (see Section 5). 228 Handling Router (HandlingRtr) 229 HandlingRtr denotes the AODVv2 router receiving and handling an 230 AODVv2 message. 231 Incoming Link 232 A link over which an AODVv2 Router has received a message from an 233 adjacent router. 234 MANET 235 A Mobile Ad Hoc Network as defined in [RFC2501]. 236 MetricList 237 A MetricList is a list of Metrics associated with the addresses in 238 an AddressList. 239 Node 240 An IP addressable device in the ad-hoc network. A node may be an 241 AODVv2 router, or it may be a device in the network that does not 242 perform any AODVv2 protocol operations. All nodes in this 243 document are either AODVv2 Routers or else Router Clients. 244 OrigAddr 245 The IP address of the Originating Node used as a data element 246 within AODVv2 messages. 247 Originating Node (OrigNode) 248 The Originating Node is the node that launched the application 249 requiring communication with the Target Address. If OrigNode is a 250 Router Client, its AODVv2 router (RREQ_Gen) has the responsibility 251 to generate a AODVv2 RREQ message on behalf of OrigNode as 252 necessary to discover a route. 253 PrefixLengthList 254 A PrefixLengthList is the list of prefix lengths associated with 255 the addresses in an AddressList. 256 Reactive 257 A protocol operation is called "reactive" if it is performed only 258 in reaction to specific events. As used in this document, 259 "reactive" is synonymous with "on-demand". 260 Routable Unicast IP Address 261 A routable unicast IP address is a unicast IP address that is 262 scoped sufficiently to be forwarded by a router. Globally-scoped 263 unicast IP addresses and Unique Local Addresses (ULAs) [RFC4193] 264 are examples of routable unicast IP addresses. 265 Route Error (RERR) 266 A RERR message is used to indicate that an AODVv2 router does not 267 have a route toward one or more particular destinations. 268 Route Reply (RREP) 269 A RREP message is used to establish a route between the Target 270 Address and the Originating Address, at all the AODVv2 routers 271 between them. 272 Route Request (RREQ) 273 An AODVv2 router uses a RREQ message to discover a valid route to 274 a particular destination address, called the Target Address. An 275 AODVv2 router processing a RREQ receives routing information for 276 the Originating Address. 277 Router Client 278 A node that requires the services of an AODVv2 router for route 279 discovery and maintenance. An AODVv2 router is always its own 280 client, so that its list of client IP addresses is never empty. 281 Router Interface 282 An interface supporting the transmission or reception of Router 283 Messages. 284 RREP Generating Router (RREP_Gen) 285 The RREP Generating Router is the AODVv2 router that serves 286 TargNode. RREP_Gen generates the RREP message to advertise a 287 route towards TargAddr from OrigAddr. 288 RREQ Generating Router (RREQ_Gen) 289 The RREQ Generating Router is the AODVv2 router that serves 290 OrigNode. RREQ_Gen generates the RREQ message to discover a route 291 for TargAddr. 292 Sequence Number (SeqNum) 293 A Sequence Number is an unsigned integer maintained by an AODVv2 294 router to avoid re-use of stale messages. The router associates 295 SeqNum with an IP address of one of its network interfaces. The 296 value zero (0) is reserved to indicate that the Sequence Number 297 for an address is unknown. 298 SeqNumList 299 A SeqNumList is the list of Sequence Numbers associated with the 300 addresses in an AddressList. 301 TargAddr 302 The IP address of the Target Node used as a data element within 303 AODVv2 messages. 304 Target Node (TargNode) 305 The Target Node denotes the node hosting the IP address towards 306 which a route is needed. 307 Unreachable Addr (UnreachableAddr) 308 An UnreachableAddr is an address for which a valid route is not 309 known. 310 upstream 311 In the direction from TargAddr to OrigAddr. 312 Valid route 313 A route that can be used for forwarding; in other words a route 314 that is not Broken or Expired. 316 3. Data Elements and Notational Conventions 318 This document uses the Data Elements and conventions found in Table 1 319 and Table 2. 321 +---------------+-------------------------------------------------+ 322 | Data Elements | Meaning | 323 +---------------+-------------------------------------------------+ 324 | msg_hop_limit | Number of hops allowable for the message. | 325 | msg_hop_count | Number of hops traversed so far by the message. | 326 | AckReq | Acknowledgement Requested for RREP | 327 | MetricType | Metric Type for Metric data element | 328 | PktSource | The IP address which is unreachable. | 329 | AddressList | A list of IP addresses | 330 | SeqNum | Sequence Number | 331 | SeqNumList | Sequence Number List | 332 | Metric | Metric value for route to associated IP address | 333 | OrigSeqNum | Originating Node Sequence Number | 334 | TargSeqNum | Target Node Sequence Number | 335 +---------------+-------------------------------------------------+ 337 Table 1 339 +------------------------+------------------------------------------+ 340 | Notation | Meaning | 341 +------------------------+------------------------------------------+ 342 | Route[Address] | A route table entry towards Address | 343 | Route[Address].{field} | A field in a route table entry | 344 | -- | -- | 345 | RREQ_Gen | AODVv2 router originating an RREQ | 346 | RREP_Gen | AODVv2 router responding to an RREQ | 347 | RteMsg | Either RREQ or RREP | 348 | RteMsg.{field} | Field in RREQ or RREP | 349 | AdvRte | a route advertised in an incoming RteMsg | 350 | HandlingRtr | Handling Router | 351 | UnreachableAddr | Unreachable Addr | 352 +------------------------+------------------------------------------+ 354 Table 2 356 4. Applicability Statement 358 The AODVv2 routing protocol is a reactive routing protocol designed 359 for stub (i.e., non-transit) or disconnected (i.e., from the 360 Internet) mobile ad hoc networks (MANETs). AODVv2 handles a wide 361 variety of mobility patterns by determining routes on-demand. AODVv2 362 also handles a wide variety of traffic patterns. In networks with a 363 large number of routers, AODVv2 is best suited for relatively sparse 364 traffic scenarios where any particular router forwards packets to 365 only a small percentage of the AODVv2 routers in the network, due to 366 the on-demand nature of route discovery and route maintenance. 367 AODVv2 supports routers with multiple interfaces, as long as each 368 interface has its own (unicast routeable) IP address; the set of all 369 network interfaces supporting AODVv2 is administratively configured 370 in a list (namely, AODVv2_INTERFACES). 372 Although AODVv2 is closely related to AODV [RFC3561], and shares some 373 features of DSR [RFC4728], AODVv2 is not interoperable with either of 374 those other two protocols. 376 AODVv2 is applicable to memory constrained devices, since only a 377 little routing state is maintained in each AODVv2 router. Routes 378 that are not needed for forwarding data do not have to be maintained, 379 in contrast to proactive routing protocols that require routing 380 information to all routers within the MANET be maintained. 382 In addition to routing for its own local applications, each AODVv2 383 router can also route on behalf of other non-routing nodes (in this 384 document, "Router Clients"), reachable via Client Interfaces. Each 385 AODVv2 router, if serving router clients other than itself, SHOULD be 386 configured with information about the IP addresses of its clients, 387 using any suitable method. In the initial state, no AODVv2 router is 388 required to have information about the relationship between any other 389 AODVv2 router and its Router Clients (see Section 6.3). 391 The coordination among multiple AODVv2 routers to distribute routing 392 information correctly for a shared address (i.e. an address that is 393 advertised and can be reached via multiple AODVv2 routers) is not 394 described in this document. The AODVv2 router operation of shifting 395 responsibility for a routing client from one AODVv2 router to another 396 is described in Appendix H. Address assignment procedures are 397 entirely out of scope for AODVv2. A Router Client SHOULD NOT be 398 served by more than one AODVv2 router at any one time. 400 AODVv2 routers perform route discovery to find a route toward a 401 particular destination. AODVv2 routers MUST must be configured to 402 respond to RREQs for themselves and their clients. When AODVv2 is 403 the only protocol interacting with the forwarding table, AODVv2 MAY 404 be configured to perform route discovery for all unknown unicast 405 destinations. 407 AODVv2 only supports bidirectional links. In the case of possible 408 unidirectional links, blacklists (see Section 6.2) SHOULD be used, or 409 other means (e.g. adjacency establishment with only neighboring 410 routers that have bidirectional communication as indicated by NHDP 411 [RFC6130]) of assuring and monitoring bi-directionality are 412 recommended. Otherwise, persistent packet loss or persistent 413 protocol failures could occur. The cost of bidirectional link L 414 (denoted Cost(L)) may depend upon the direction across the link for 415 which the cost is measured. If received over a link that is 416 unidirectional, metric information from incoming AODVv2 messages MUST 417 NOT be used for route table updates. 419 The routing algorithm in AODVv2 may be operated at layers other than 420 the network layer, using layer-appropriate addresses. The routing 421 algorithm makes use of some persistent state; if there is no 422 persistent storage available for this state, recovery can impose a 423 performance penalty (e.g., in case of AODVv2 router reboots). 425 5. AODVv2 Message Transmission 427 In its default mode of operation, AODVv2 sends messages using the 428 parameters for port number and IP protocol specified in [RFC5498]. 429 By default, AODVv2 messages are sent with the IP destination address 430 set to the link-local multicast address LL-MANET-Routers [RFC5498] 431 unless otherwise specified. Therefore, all AODVv2 routers MUST 432 subscribe to LL-MANET-Routers [RFC5498] to receive AODVv2 messages. 433 In order to reduce multicast overhead, regenerated multicast packets 434 in MANETs SHOULD be done according to methods specified in [RFC6621]. 435 AODVv2 does not specify which method should be used to restrict the 436 set of AODVv2 routers that have the responsibility to regenerate 437 multicast packets. Note that multicast packets MAY be sent via 438 unicast. For example, this may occur for certain link-types (non- 439 broadcast media), for manually configured router adjacencies, or in 440 order to improve robustness. 442 The IPv4 TTL (IPv6 Hop Limit) field for all packets containing AODVv2 443 messages is set to 255. If a packet is received with a value other 444 than 255, any AODVv2 message contained in the packet MUST be 445 disregarded by AODVv2. This mechanism, known as "The Generalized TTL 446 Security Mechanism" (GTSM) [RFC5082] helps to assure that packets 447 have not traversed any intermediate routers. 449 IP packets containing AODVv2 protocol messages SHOULD be given 450 priority queuing and channel access. 452 6. Data Structures 454 6.1. Route Table Entry 456 The route table entry is a conceptual data structure. 457 Implementations MAY use any internal representation so long as it 458 provides access to the information specified below. 460 A route table entry has the following fields: 462 Route.Address 463 An address or address prefix of a node 464 Route.PrefixLength 465 The length of the address or prefix. If the value of 466 Route.PrefixLength is less than the length of addresses in the 467 address family used by the AODVv2 routers, the associated address 468 is a routing prefix, rather than an address. A PrefixLength is 469 stored for every route in the route table. 470 Route.SeqNum 471 The Sequence Number associated with Route.Address, as obtained 472 from the last packet that successfully updated this route table 473 entry. 474 Route.NextHopAddress 475 The IP address of the adjacent AODVv2 router used for the path 476 toward the Route.Address 477 Route.NextHopInterface 478 The interface used to send packets toward Route.Address 479 Route.LastUsed 480 The time that this route was last used 481 Route.ExpirationTime 482 The time at which this route must expire 483 Route.MetricType 484 The type of the metric for the route towards Route.Address 485 Route.Metric 486 The cost of the route towards Route.Address expressed in units 487 consistent with Route.MetricType 488 Route.State 489 The last *known* state of the route. Route.State is one of the 490 following: Active, Idle, Expired, or Broken. 491 Route.Timed 492 The Route.Timed flag is true if the route was specified to have a 493 specific lifetime for use. 494 Route.Precursors (optional) 495 A list of upstream nodes using the route. 497 A route table entry (i.e., a route) is in one of the following 498 states: 500 Active 501 An Active route is in current use for forwarding packets. An 502 Active route is maintained continuously by AODVv2 and is 503 considered to remain active as long as it is used at least once 504 during every ACTIVE_INTERVAL, or if the Route.Timed flag is true. 505 When a route that is not a timed route is no longer active the 506 route becomes an Idle route. 507 Idle 508 An Idle route can be used for forwarding packets, even though it 509 is not in current use. If an Idle route is used to forward a 510 packet, it becomes an Active route once again. After an Idle 511 route remains idle for MAX_IDLETIME, it becomes an Expired route. 512 Expired 513 After a route has been idle for too long, it expires, and may no 514 longer be used for forwarding packets. An Expired route is not 515 used for forwarding, but the sequence number information can be 516 maintained until the destination sequence number has had no 517 updates for MAX_SEQNUM_LIFETIME; after that time, old sequence 518 number information is considered no longer valuable and the 519 Expired route MUST BE expunged. 520 Broken 521 A route marked as Broken cannot be used for forwarding packets but 522 still has valid destination sequence number information. When the 523 link to a route's next hop is broken, the route is marked as being 524 Broken, and afterwards the route MAY NOT be used. 525 Timed 526 The expiration of a Timed route is controlled by the 527 Route.ExpirationTime time of the route table entry (instead of 528 MAX_IDLETIME). Until that time, a Timed route can be used for 529 forwarding packets. A route is indicated to be a Timed route by 530 the setting of the Route.Timed flag in the route table entry. 531 Afterwards, the route MAY be expunged; otherwise the route must be 532 must be marked as Expired. 534 MAX_SEQNUM_LIFETIME is the time after a reboot during which an AODVv2 535 router MUST NOT transmit any routing messages. Thus, if all other 536 AODVv2 routers expunge routes to the rebooted router after that time 537 interval, the rebooted AODVv2 router's sequence number will not be 538 considered stale by any other AODVv2 router in the MANET. 540 6.2. Bidirectional Connectivity and Blacklists 542 To avoid repeated failure of Route Discovery, an AODVv2 router 543 (HandlingRtr) handling a RREP message MUST attempt to verify 544 connectivity towards RREQ_Gen. This MAY be done by including the 545 Acknowledgement Request (AckReq) data element in the RREP. In reply 546 to an AckReq, an RREP_ACK message message MUST be sent. If the 547 verification is not received within UNICAST_MESSAGE_SENT_TIMEOUT, 548 HandlingRtr MUST put the upstream neighbor in the blacklist. RREQs 549 received from a blacklisted router, or any router over a link that is 550 known to be incoming-only, MUST NOT be regenerated by HandlingRtr. 551 However, the upstream neighbor SHOULD NOT be permanently blacklisted; 552 after a certain time (MAX_BLACKLIST_TIME), it SHOULD once again be 553 considered as a viable upstream neighbor for route discovery 554 operations. 556 For this purpose, a list of blacklisted routers along with their time 557 of removal SHOULD be maintained: 559 Blacklist.Router 560 An IP address of the router that did not verify bidirectional 561 connectivity. 562 Blacklist.RemoveTime 563 The time at which Blacklist.Router MAY be removed from the 564 blacklist. 566 6.3. Router Clients and Client Networks 568 An AODVv2 router may offer routing services to other nodes that are 569 not AODVv2 routers; such nodes are defined as Router Clients in this 570 document. 572 For this purpose, CLIENT_ADDRESSES must be configured on each AODVv2 573 router with the following information: 575 Client IP address 576 The IP address of the node that requires routing service from the 577 AODVv2 router. 578 Client Prefix Length 579 The length of the routing prefix associated with the client IP 580 address. 582 If the Client Prefix Length is not the full length of the Client IP 583 address, then the prefix defines a Client Network. If an AODVv2 584 router is configured to serve a Client Network, then the AODVv2 585 router MUST serve every node that has an address within the range 586 defined by the routing prefix of the Client Network. The list of 587 Routing Clients for an AODVv2 router is never empty, since an AODVv2 588 router is always its own client as well. 590 6.4. Sequence Numbers 592 Sequence Numbers allow AODVv2 routers to evaluate the freshness of 593 routing information. Each AODVv2 router in the network MUST maintain 594 its own sequence number. Each RREQ and RREP generated by an AODVv2 595 router includes that sequence number. Each AODVv2 router MUST make 596 sure that its sequence number is unique and monotonically increasing. 597 This can be achieved by incrementing it with every RREQ or RREP it 598 generates. 600 Every router receiving a RREQ or RREP can thus use the Sequence 601 Number of a RREQ or RREP as information concerning the freshness of 602 the packet's route update: if the new packet's Sequence Number is 603 lower than the one already stored in the route table, its information 604 is considered stale. 606 As a consequence, loop freedom is assured. 608 If the router has multiple network interfaces, it can use the same 609 SeqNum for the IP addresses of all of them, or it can assign 610 different SeqNums for use with different IP addresses. However, the 611 router MUST NOT use multiple SeqNums for any particular IP address. 612 A Router Client has the same SeqNum as the IP address of the network 613 interface that the AODVv2 router uses to forward packets to that 614 Router Client. Similarly, a route to a subnet has the same SeqNum as 615 the IP address of the network interface that the AODVv2 router uses 616 to forward packets to that subnet. The Sequence Number guarantees 617 the temporal order of routing information to maintain loop-free 618 routes, and fulfills the same role as the "Destination Sequence 619 Number" of DSDV [Perkins94], and as the AODV Sequence Number in RFC 620 3561[RFC3561]. 622 An AODVv2 router increments its SeqNum as follows. Most of the time, 623 SeqNum is incremented by simply adding one (1). But when the SeqNum 624 has the value of the largest possible number representable as a 625 16-bit unsigned integer (i.e., 65,535), it MUST be incremented by 626 setting to one (1). In other words, the sequence number after 65,535 627 is 1. 629 An AODVv2 router SHOULD maintain its SeqNum in persistent storage. 630 If an AODVv2 router's SeqNum is lost, it MUST take the following 631 actions to avoid the danger of routing loops. First, the AODVv2 632 router MUST set Route.State = Broken for each entry. Furthermore the 633 AODVv2 router MUST wait for at least MAX_SEQNUM_LIFETIME before 634 transmitting or regenerating any AODVv2 RREQ or RREP messages. If an 635 AODVv2 protocol message is received during this waiting period, the 636 AODVv2 router SHOULD perform normal route table entry updates, but 637 not forward the message to other nodes. If a data packet is received 638 for forwarding to another destination during this waiting period, the 639 AODVv2 router MUST transmit a RERR message indicating that no route 640 is available. At the end of the waiting period the AODVv2 router 641 sets its SeqNum to one (1) and begins performing AODVv2 protocol 642 operations again. 644 6.5. Metrics 646 Metrics describe the quality of a route or a link. They can take 647 various aspects into account, such as latency, delay, financial, 648 energy, etc. Whenever an AODV router receives metric information in 649 an incoming message, the value of the metric is as measured by the 650 transmitting router, and does not reflect the cost of traversing the 651 incoming link. 653 Each routing table entry is associated with metric information. When 654 presented with information which may update a route, deciding whether 655 to use the information involves evaluating the metric. For some 656 metrics, a maximum value is defined, namely MAX_METRIC[i] where 'i' 657 is the Metric Type. AODVv2 does not store routes in its route table 658 that cost more than MAX_METRIC[i]. 660 Each metric has to have a Metric Type, and the Metric Type is 661 allocated by IANA as specified in [RFC6551]. Apart from its default 662 metric type, which is detailed in Section 6.5.3, AODVv2 enables the 663 use of generic metrics, whose data type depends on the metric used. 664 The Metric Type is specified by the MetricType TLV of each RteMsg. 665 As a natural result of the way routes are looked up according to 666 conformant metric type, all intermediate routers handling a RteMsg 667 will assign the same metric type to all metric information in the 668 RteMsg. 670 6.5.1. The Cost() function 672 In order to simplify the description of storing accumulated route 673 costs in the route table, a Cost() function is defined. This 674 function returns the Cost of traversing a Route ('Cost(R)') or a Link 675 ('Cost(L)'). The specification of Cost(L) for metric types other 676 than DEFAULT_METRIC_TYPE is beyond the scope of this document. 678 6.5.2. The LoopFree() function 680 Since determining loop freedom is known to depend on comparing the 681 Cost(R) of route update information to the Cost(R) of an existing 682 stored route using the same metric, AODVv2 must also be able to 683 invoke an abstract routine which in this document is called 684 "LoopFree(R1, R2)". LoopFree(R1, R2) returns TRUE when, (under the 685 assumption of nondecreasing SeqNum during Route Discovery) given that 686 R2 is loop-free and Cost(R2) is the cost of route R2, Cost(R1) is 687 known to guarantee loop freedom of the route R1. In this document, 688 an AODVv2 router will only invoke LoopFree (AdvRte, Route), for 689 routes AdvRte and Route which use the same metric to the same 690 destination. AdvRte is the route advertised in an incoming RREQ or 691 RREP, and is used as parameter R1 for LoopFree. Route is a route 692 already existing in the AODVv2 router's route table, and is used as 693 parameter R2 for LoopFree. 695 6.5.3. Default Metric type 697 HopCount is still the default metric for use in MANETs, 698 notwithstanding the above objections. Therefore, the default Metric 699 Type DEFAULT_METRIC_TYPE is Hop Count. It is also the only metric 700 described in detail by this protocol. With this metric, Cost(L) is 701 always 1, and Cost(R) is simply the hop count between the router and 702 the destination. 704 MAX_METRIC[DEFAULT_METRIC_TYPE] is defined to be MAX_HOPCOUNT. 705 MAX_HOPCOUNT MUST be larger than the AODVv2 network diameter. 706 Otherwise, AODVv2 protocol messages may not reach their intended 707 destinations. 709 Using Metric Type DEFAULT_METRIC_TYPE, LoopFree (AdvRte, Route) is 710 TRUE when Cost(AdvRte) <= Cost(Route). The specification of Cost(R) 711 and LoopFree(AdvRte, Route) for metric types other than 712 DEFAULT_METRIC_TYPE is beyond the scope of this document. 714 6.5.4. Alternate Metrics 716 Some applications may require metric information other than Hop 717 Count, which has traditionally been the default metric associated 718 with routes in MANET. It is well known that reliance on Hop Count 719 can cause selection of the worst possible route in many situations. 720 For this reason, it is important to enable route selection based on 721 metric information other than Hop Count -- in other words, based on 722 "alternate metrics". 724 The range and data type of each such alternate metric may be 725 different. For instance, the data type might be integers, or 726 floating point numbers, or restricted subsets thereof. It is out of 727 the scope of this document to specify for alternate metrics the 728 Cost(L) and Cost(R) functions, or their return type. 730 6.6. RREQ Table: Received RREQ Messages 732 Two incoming RREQ messages are considered to be "comparable" if they 733 were generated by the same AODVv2 router in order to discover a route 734 for the same destination with the same metric type. According to 735 that notion of comparability, when RREQ messages are flooded in a 736 MANET, an AODVv2 router may well receive comparable RREQ messages 737 from more than one of its neighbors. A router, after receiving an 738 RREQ message, MUST check against previous RREQs to assure that its 739 response message would contain information that is not redundant (see 740 Section 8.6 regarding suppression of redundant RREQ messages). 741 Otherwise, multicast RREQs are likely to be regenerated again and 742 again with almost no additional benefit, but generating a great deal 743 of unnecessary signaling traffic and interference. 745 To avoid transmission of redundant RREQ messages, while still 746 enabling the proper handling of earlier RREQ messages that may have 747 somehow been delayed in the network, it is needed for each AODVv2 748 router to keep a list of the certain information about RREQ messages 749 which it has recently received. 751 This list is called the AODVv2 Received RREQ Table -- or, more 752 briefly, the RREQ Table. Two AODVv2 RREQ messages are comparable if: 754 o they have the same metric type 755 o they have the same OrigAddr and TargAddr 757 Each entry in the RREQ Table has the following fields: 759 o OrigAddr 760 o TargAddr 761 o OrigNode Sequence Number 762 o TargNode Sequence Number (if present in RREQ) 763 o Metric Type 764 o Metric 765 o Timestamp 767 The RREQ Table is maintained so that no two entries in the RREQ 768 Table are comparable -- that is, all RREQs represented in the RREQ 769 Table either have a different OrigAddr, different TargAddr, or 770 different metric types. If two RREQs have the same metric type, 771 OrigAddr, and TargAddr, the information from the one with the older 772 Sequence Number is not needed in the table; in case they have the 773 same Sequence Number, the one with the greater Metric value is not 774 needed; in case they have the same Metric as well, it does not matter 775 which table entry is maintained. Whenever a RREQ Table entry is 776 updated, its Timestamp field should also be updated to reflect the 777 Current_Time. 779 When optional multicast RREP (see Section 14.4) is used to enable 780 selection from among multiple possible return routes, an AODVv2 781 router can eliminate redundant RREP messages using the analogous 782 mechanism along with a RREP Table. The description in this section 783 only refers to RREQ multicast messages. 785 Protocol handling of RERR messages eliminates the need for tracking 786 RERR messages, since the rules for RERR regeneration prevent the 787 phenomenon of redundant retansmission that affects RREQ and RREP 788 multicast. 790 7. AODVv2 Operations on Route Table Entries 792 In this section, operations are specified for updating the route 793 table due to timeouts and route updates within AODVv2 messages. 794 Route update information in AODVv2 messages includes IP addresses, 795 along with the SeqNum and prefix length associated with each IP 796 address, and including the Metric measured from the node transmitting 797 the AODVv2 message to the IP address in the route update. A RREQ 798 message advertises a route to OrigAddr, and a RREP message 799 analogously advertises a route to TargAddr. In this section, RteMsg 800 is either RREQ or RREP, and AdvRte is the route advertised by the 801 RteMsg. All SeqNum comparisons use signed 16-bit arithmetic. 803 7.1. Evaluating Incoming Routing Information 805 If the incoming RteMsg does not have a Metric Type data element, then 806 the metric information contained by AdvRte is considered to be of 807 type DEFAULT_METRIC_TYPE -- in other words, 3 (for HopCount) unless 808 changed by administrative action. The AODVv2 router (HandlingRtr) 809 checks the advertised route (AdvRte) to see whether the AdvRte should 810 be used to update an existing route table entry. HandlingRtr 811 searches its route table to see if there is a route table entry with 812 the same Metric Type as the AdvRte, matching AdvRte.Address. If not, 813 HandlingRtr creates a route table entry for AdvRte.Address as 814 described in Section 7.2. Otherwise, HandlingRtr compares the 815 incoming routing information for AdvRte against the already stored 816 routing information in the route table entry (Route) for 817 AdvRte.Address, as described next. 819 Route[AdvRte.Address] uses the same metric type as the incoming 820 routing information, and the route entry contains Route.SeqNum, 821 Route.Metric, and Route.State. Define AdvRte.SeqNum and 822 AdvRte.Metric to be the corresponding routing information for 823 Route.Address in the incoming RteMsg. Define AdvRte.Cost to be 824 (AdvRte.Metric + Cost(L)), where L is the link from which the 825 incoming message was received. The incoming routing information is 826 classified as follows: 828 1. Stale:: AdvRte.SeqNum < Route.SeqNum : 829 If AdvRte.SeqNum < Route.SeqNum the incoming information is stale. 830 Using stale routing information is not allowed, since that might 831 result in routing loops. In this case, HandlingRtr MUST NOT 832 update the route table entry using the routing information for 833 AdvRte.Address. 834 2. Unsafe against loops:: (TRUE != LoopFree (AdvRte, Route)) : 835 If AdvRte is not Stale (as in (1) above), AdvRte.Cost is next 836 considered to insure loop freedom. If (TRUE != LoopFree (AdvRte, 837 Route)) (see Section 6.5), then the incoming AdvRte information is 838 not guaranteed to prevent routing loops, and it MUST NOT be used 839 to update any route table entry. 840 3. More costly:: 841 (AdvRte.Cost >= Route.Metric) && (Route.State != Broken) 842 When AdvRte.SeqNum is the same as in a valid route table entry, 843 and LoopFree (AdvRte, Route) assures loop freedom, incoming 844 information still does not offer any improvement over the existing 845 route table information if AdvRte.Cost >= Route.Metric. Using 846 such incoming routing information to update a route table entry is 847 not recommended. 848 4. Offers improvement:: 849 Advertised routing information that does not match any of the 850 above criteria is better than existing route table information and 851 SHOULD be used to improve the route table. The following pseudo- 852 code illustrates whether advertised routing information should be 853 used to update an existing route table entry as described in 854 Section 7.2. 856 (AdvRte.SeqNum > Route.SeqNum) OR 857 ((AdvRte.SeqNum == Route.SeqNum) AND 858 [(AdvRte.Cost < Route.Metric) OR 859 ((Route.State == Broken) && LoopFree (AdvRte, Route))]) 861 The above logic corresponds to placing the following conditions 862 (compared to the existing route table entry) on the advertised 863 route update before it can be used: 865 * it is more recent, or 866 * it is not stale and is less costly, or 867 * it can safely repair a broken route. 869 7.2. Applying Route Updates To Route Table Entries 871 To apply the route update, a route table entry for AdvRte.Address is 872 either found to already exist in the route table, or else a new route 873 table entry for AdvRte.Address is created and inserted into the route 874 table. If the route table entry already exists, and the state is 875 Expired or Broken, then the state is reset to be Idle. If the route 876 table entry had to be created, the state is set to be Active. The 877 route table entry is populated with the following information: 879 o If AdvRte.PrefixLength exists, then Route.PrefixLength := 880 AdvRte.PrefixLength. Otherwise, Route.PrefixLength := maximum 881 length for address family (either 32 or 128). 882 o Route.SeqNum := AdvRte.SeqNum 883 o Route.NextHopAddress := IP.SourceAddress (i.e., an address of the 884 node from which the RteMsg was received) 886 o Route.NextHopInterface is set to the interface on which RteMsg was 887 received 888 o Route.MetricType := AdvRte.MetricType 889 o Route.Metric := AdvRte.Cost 890 o Route.LastUsed := Current_Time 891 o If RteMsg.VALIDITY_TIME is included, then 892 Route.Timed := TRUE and Route.ExpirationTime := Current_Time + 893 RteMsg.VALIDITY_TIME. Otherwise, Route.ExpirationTime := 894 Current_Time + (ACTIVE_INTERVAL + MAX_IDLETIME). 896 With these assignments to the route table entry, a route has been 897 made available, and the route can be used to send any buffered data 898 packets and subsequently to forward any incoming data packets for 899 Route.Address. An updated route entry also fulfills any outstanding 900 route discovery (RREQ) attempts for Route.Address. 902 7.3. Route Table Entry Timeouts 904 During normal operation, AODVv2 does not require any explicit 905 timeouts to manage the lifetime of a route. However, the route table 906 entry MUST be examined before using it to forward a packet, as 907 discussed in Section 9.1. Any required expiry or deletion can occur 908 at that time. Alternatively, timers and timeouts MAY be implemented 909 to achieve the same effect. 911 At any time, the route table can be examined and route table entries 912 can be expunged according to their current state at the time of 913 examination, as follows. 915 o An Active route MUST NOT be expunged. 916 o An Idle route SHOULD NOT be expunged. 917 o An Expired route MAY be expunged (least recently used first). 918 o A route MUST be expunged if (Current_Time - Route.LastUsed) >= 919 MAX_SEQNUM_LIFETIME. 920 o A route MUST be expunged if Current_Time >= Route.ExpirationTime 922 If precursor lists are maintained for the route (as described in 923 Section 14.3) then the precursor lists must also be expunged at the 924 same time that the route itself is expunged. 926 8. Routing Messages RREQ and RREP (RteMsgs) 928 AODVv2 message types RREQ and RREP are together known as Routing 929 Messages (RteMsgs) and are used to discover a route between an 930 Originating and Target Addr, denoted by OrigAddr and TargAddr. The 931 constructed route is bidirectional, enabling packets to flow between 932 OrigAddr and TargAddr. RREQ and RREP have similar information and 933 function, but have some differences in their rules for handling. 935 When a node receives a RREQ or a RREP, the node then creates or 936 updates a route to the OrigAddr or the TargAddr respectively. The 937 main difference between the two messages is that RREQ messages are 938 typically multicast to solicit a RREP, whereas RREP is typically 939 unicast as a response to RREQ. 941 When an AODVv2 router needs to forward a data packet from a node 942 (with IP address OrigAddr) in its set of router clients, and it does 943 not have a forwarding route toward the packet's IP destination 944 address (TargAddr), the AODVv2 router (RREQ_Gen) generates a RREQ (as 945 described in Section 8.3) to discover a route toward TargAddr. 946 Subsequently RREQ_Gen awaits reception of an RREP message (see 947 Section 8.4) or other route table update (see Section 7.2) to 948 establish a route toward TargAddr. The RREQ message contains routing 949 information to enable RREQ recipients to route packets back to 950 OrigAddr, and the RREP message contains routing information enabling 951 RREP recipients to route packets to TargAddr. 953 8.1. Route Discovery Retries and Buffering 955 After issuing a RREQ, as described above RREQ_Gen awaits a RREP 956 providing a bidirectional route toward the Target Address. If the 957 RREP is not received within RREQ_WAIT_TIME, RREQ_Gen MAY retry the 958 Route Discovery by generating another RREQ. Route Discovery SHOULD 959 be considered to have failed after DISCOVERY_ATTEMPTS_MAX and the 960 corresponding wait time for a RREP response to the final RREQ. After 961 the attempted Route Discovery has failed, RREQ_Gen MUST wait at least 962 RREQ_HOLDDOWN_TIME before attempting another Route Discovery to the 963 same destination. 965 To reduce congestion in a network, repeated attempts at route 966 discovery for a particular Target Address SHOULD utilize a binary 967 exponential backoff. 969 Data packets awaiting a route SHOULD be buffered by RREQ_Gen. This 970 buffer SHOULD have a fixed limited size (BUFFER_SIZE_PACKETS or 971 BUFFER_SIZE_BYTES). Determining which packets to discard first is a 972 matter of policy at each AODVv2 router; in the absence of policy 973 constraints, by default older data packets SHOULD be discarded first. 974 Buffering of data packets can have both positive and negative effects 975 (albeit usually positive). Nodes without sufficient memory available 976 for buffering SHOULD be configured to disable buffering by 977 configuring BUFFER_SIZE_PACKETS == 0 and BUFFER_SIZE_BYTES == 0. 978 Doing so will affect the latency required for launching TCP 979 applications to new destinations. 981 If a route discovery attempt has failed (i.e., DISCOVERY_ATTEMPTS_MAX 982 attempts have been made without receiving a RREP) to find a route 983 toward the Target Address, any data packets buffered for the 984 corresponding Target Address MUST BE dropped and a Destination 985 Unreachable ICMP message (Type 3) SHOULD be delivered to the source 986 of the data packet. The code for the ICMP message is 1 (Host 987 unreachable error). If RREQ_Gen is not the source (OrigNode), then 988 the ICMP is sent to OrigAddr. 990 8.2. RteMsg Structure 992 RteMsgs have the following general format: 994 +---------------------------------------------------------------+ 995 | msg_hop_limit, msg_hop_count | 996 +---------------------------------------------------------------+ 997 | AckReq, MetricType | 998 +---------------------------------------------------------------+ 999 | AddressList := {OrigAddr,TargAddr} | 1000 +---------------------------------------------------------------+ 1001 | Address Prefix Length for OrigAddr OR TargAddr | 1002 +---------------------------------------------------------------+ 1003 | SeqNumList (OrigSeqNum AND/OR TargSeqNum) | 1004 +---------------------------------------------------------------+ 1005 | MetricList (Metric for OrigAddr OR TargAddr) | 1006 +---------------------------------------------------------------+ 1008 Figure 1: RREQ and RREP (RteMsg) message structure 1010 RteMsg Data Elements 1012 msg_hop_limit 1013 The remaining number of hops allowed for dissemination of the 1014 RteMsg message. 1015 msg_hop_count 1016 The number of hops already traversed during dissemination of 1017 the RteMsg message. 1018 AckReq 1019 (RREP Only) Acknowledgement Requested by sender (optional). 1020 MetricType 1021 If MetricType != DEFAULT_METRIC_TYPE, the MetricType associated 1022 with route to OrigAddr or TargAddr. 1023 AddressList 1024 AddressList contains OrigAddr and TargAddr. 1025 OrigSeqNum AND/OR TargSeqNum 1026 At least one of OrigSeqNum or TargSeqNum is REQUIRED and 1027 carries the destination sequence number(s) associated with 1028 OrigNode or TargNode respectively. 1029 MetricList 1030 The MetricList data element is REQUIRED, and carries the route 1031 metric information associated with either OrigAddr or TargAddr 1032 (but not both). 1034 RteMsgs carry information about OrigAddr and TargAddr, as identified 1035 in the context of the RREQ_Gen. Either the OrigSeqNum or TargSeqNum 1036 MUST appear. Both MAY appear in the same RteMsg when SeqNum is 1037 available for both OrigAddr and TargAddr. 1039 If the OrigSeqNum data element appears, then it MUST apply only to 1040 OrigAddr. The other address in the Address List is TargAddr. 1042 If the TargSeqNum data element appears, then it MUST apply only to 1043 TargAddr. The other address in the AddressList is OrigAddr. 1045 8.3. RREQ Generation 1047 RREQ_Gen (the AODVv2 router generating the RREQ and associated data 1048 elements on behalf of its client OrigNode) follows the steps in this 1049 section. OrigAddr MUST be a unicast address. The order of data 1050 elements is illustrated schematically in Figure 1. RREQ_Gen SHOULD 1051 include TargSeqNum, if a previous value of the TargNode's SeqNum is 1052 known (e.g., from an invalid route table entry using longest-prefix 1053 matching). If TargSeqNum is not included, AODVv2 routers handling 1054 the RREQ assume that RREQ_Gen does not have that information. 1056 1. RREQ_Gen MUST increment the SeqNum for OrigAddr by one (1) 1057 according to the rules specified in Section 6.4. This assures 1058 that each node receiving the RREQ will update its route table 1059 using the information in the RREQ. 1060 2. msg_hop_limit SHOULD be set to MAX_HOPCOUNT. 1061 3. msg_hop_count, if included, MUST be set to 0. 1063 * This RFC 5444 constraint causes certain RREQ payloads to incur 1064 additional enlargement (otherwise, msg_hop_count could often 1065 be used as the metric). 1066 4. AddressList := {OrigAddr, TargAddr} 1067 5. If Route[OrigAddr].PrefixLength is equal to the number of bits in 1068 the addresses of the RREQ (32 for IPv4, 128 for IPv6), then no 1069 PrefixLengthList is included. Otherwise, PrefixLengthList := 1070 {Route[OrigAddr].PrefixLength, null}. 1071 6. OrigSeqNum := OrigAddr's SeqNum number 1072 7. If known, TargSeqNum := Route[TargAddr].SeqNum 1073 8. RREQ.MetricList := {Route[OrigAddr].Metric, null} 1075 By default, the RREQ message is multicast to LL-MANET-Routers. An 1076 example RREQ message format is illustrated in Appendix B.1. 1078 8.4. RREP Generation 1080 This section specifies the generation of an RREP by an AODVv2 router 1081 (RREP_Gen) that provides connectivity for TargAddr, thus enabling the 1082 establishment of a route between OrigAddr and TargAddr. If TargAddr 1083 is not a unicast IP address, the RREP MUST NOT be generated, and 1084 processing for the RREQ is complete. Before transmitting a RREP, the 1085 routing information of the RREQ is processed as specified in 1086 Section 7.2; after such processing, RREP_Gen has an updated route to 1087 OrigAddr as well as TargAddr. The basic format of an RREP conforms 1088 to the structure for RteMsgs as shown in Figure 1. 1090 RREP_Gen creates data elements and generates the RREP as follows: 1092 1. RREP_Gen checks the RREQ against recently received RREQ messages 1093 as specified in Section 8.6. If a previously received RREQ has 1094 made the information in the incoming RREQ to be redundant, no 1095 RREP is generated and processing is complete. 1096 2. RREP_Gen MUST increment TargAddr's SeqNum by one (1) according to 1097 the rules specified in Section 6.4. 1098 3. msg_hop_count, if included, MUST be set to 0. 1099 4. msg_hop_limit SHOULD be set to RREQ.msg_hop_count. 1100 5. If (DEFAULT_METRIC_TYPE != Route[TargAddr].MetricType) then 1101 include the MetricType data element and set MetricType := 1102 Route[TargAddr].MetricType 1103 6. AddressList := {OrigAddr, TargAddr} 1104 7. TargSeqNum := Route[TargAddr].SeqNum 1105 8. If Route[TargAddr].PrefixLength is equal to the number of bits in 1106 the addresses of the RREQ (32 for IPv4, 128 for IPv6), then no 1107 PrefixLengthList is included in the RREP. Otherwise, 1108 PrefixLengthList := {null, Route[TargAddr].PrefixLength} 1109 9. MetricList := {null, Route[TargAddr].Metric}} 1111 By default, the RREP message is unicast to OrigAddr. An example 1112 message format for RREP is illustrated in Appendix B.2. 1114 8.5. Handling a Received RteMsg 1116 Before an AODVv2 router can make use of a received RteMsg (i.e., RREQ 1117 or RREP), the router must verify that the RteMsg is valid according 1118 to the following steps. First the router extracts the data elements 1119 from the message (see Section 10). RteMsg_Metric is the single 1120 Metric. In this section (unless qualified by additional description) 1121 all occurrences of the term "router" refer to the AODVv2 router 1122 handling the received RteMsg. 1124 1. A router MUST handle RteMsgs only from neighbors as specified in 1125 Section 5. RteMsgs from other sources MUST be disregarded. 1127 2. The router verifies that the RteMsg contains the required data 1128 elements: msg_hop_limit, OrigAddr, TargAddr, RteMsg_Metric, and 1129 either OrigSeqNum or TargSeqNum. If the required data elements 1130 are absent, the message is disregarded. 1131 3. The router checks that OrigAddr and TargAddr are routable unicast 1132 addresses. If not, the message is disregarded. 1133 4. If the MetricType is absent, the router uses DEFAULT_METRIC_TYPE 1134 for the metric type. Otherwise the router verifies that the 1135 MetricType is known; if not, the message is disregarded. 1137 * DISCUSSION: or, can change Metric data element to use 1138 HopCount, e.g., measured from msg_hop_count. 1139 5. If (MAX_METRIC[MetricType] - Cost(L)) <= RteMsg_Metric, where L 1140 denotes the incoming link, the RteMsg is disregarded. 1142 An AODVv2 router handles a valid RteMsg as follows: 1144 1. The router MUST process the advertised route for OrigAddr or 1145 TargAddr contained in the RteMsg as specified in Section 7.1. 1146 2. If msg_hop_limit is zero (0), no further action is taken, and the 1147 RteMsg is not regenerated. Otherwise, the router MUST decrement 1148 msg_hop_limit. 1149 3. If the RteMsg.msg_hop_count is present, and MAX_HOPCOUNT <= 1150 msg_hop_count, then no further action is taken. Otherwise, the 1151 router MUST increment msg_hop_count. 1153 Further actions to regenerate an updated RteMsg depend upon whether 1154 the incoming RteMsg is an RREP or an RREQ. 1156 8.5.1. Additional Handling for Incoming RREQ 1158 o By sending a RREQ, a router advertises that it will forward 1159 packets to the OrigAddr contained in the RteMsg according to the 1160 information enclosed. The router MAY choose not to regenerate the 1161 RREQ, though not regenerating the RREQ could decrease connectivity 1162 in the network or result in nonoptimal paths. The circumstances 1163 under which a router might choose not to re-transmit a RREQ are 1164 not specified in this document. Some examples might include the 1165 following: 1167 * The router is already heavily loaded and does not want to 1168 advertise routing for more traffic 1169 * The router recently transmitted the same routing information 1170 (e.g. in a RREQ advertising the same metric) Section 8.6 1171 * The router is low on energy and has to reduce energy expended 1172 for sending protocol messages or packet forwarding 1174 Unless the router is prepared to advertise the new route, it halts 1175 processing. 1176 o If the upstream router sending a RREQ is in the Blacklist, and 1177 Current_Time < Blacklist.RemoveTime, then the router receiving 1178 that RREQ MUST NOT transmit any outgoing RteMsg, and processing is 1179 complete. 1180 o Otherwise, if the upstream router is in the Blacklist, and 1181 Current_Time >= Blacklist.RemoveTime, then the upstream router 1182 SHOULD be removed from the Blacklist, and message processing 1183 continued. 1184 o The incoming RREQ MUST be checked against previously received 1185 information from the RREQ Table (Section 8.6). If the information 1186 in the incoming RteMsg is redundant, then then no further action 1187 is taken. 1188 o If TargNode is a client of the router receiving the RREQ, then the 1189 router generates a RREP message as specified in Section 8.4, and 1190 subsequently processing for the RREQ is complete. Otherwise, 1191 processing continues as follows. 1192 o If (DEFAULT_METRIC_TYPE != Route[OrigAddr].MetricType) then 1193 include the MetricType data element and assign MetricType := 1194 Route[OrigAddr].MetricType 1195 o Metric := Route[OrigAddr].Metric 1196 o The RREQ (with updated fields as specified above>) SHOULD be 1197 multicast the IP address LL-MANET-Routers [RFC5498]. If the RREQ 1198 is unicast, the IP.DestinationAddress is set to 1199 Route[RREQ.TargAddr].NextHopAddress. 1201 8.5.2. Additional Handling for Incoming RREP 1203 The OrigAddr and TargAddr data elements are extracted from the 1204 AddressList of the incoming RREP, for instance according to the 1205 format of message elements as shown in Section 10. 1207 o If no forwarding route exists to OrigAddr, then a RERR SHOULD be 1208 transmitted to TargAddr. Otherwise, if HandlingRtr is not 1209 RREQ_Gen then the outgoing RREP is sent to the 1210 Route.NextHopAddress for OrigAddr. 1211 o If HandlingRtr is RREQ_Gen then the RREP satisfies RREQ_Gen's 1212 earlier RREQ, and RREP processing is completed. Any packets 1213 buffered for OrigAddr should be transmitted. 1215 8.6. Suppressing Redundant RREQ messages 1217 Since RREQ messages are multicast, there are common circumstances 1218 under which an AODVv2 router might transmit a redundant response 1219 (RREQ or RREP), duplicating the information transmitted in response 1220 to some other recent RREQ (see Section 6.6). Before responding, an 1221 AODVv2 router MUST suppress such RREQ messages. This is done by 1222 checking the list of recently received RREQs to determine whether the 1223 incoming RREQ is redundant, as follows: 1225 o The AODVv2 router searches the RREQ Table for recent entries with 1226 the same OrigAddr, TargAddr, and MetricType. If not, the incoming 1227 RREQ message is not suppressed, and a new entry for the incoming 1228 RREQ is created in the RREQ Table. 1229 o If there is such an entry, and the incoming RREQ has a newer 1230 sequence number, the incoming RREQ is not suppressed, and the 1231 existing table entry MUST be updated to reflect the new Sequence 1232 Number and Metric. 1233 o Similarly, if the Sequence Numbers are the same, and the incoming 1234 RREQ offers a better Metric, the incoming RREQ is not suppressed, 1235 and the RREQ Table entry MUST be updated to reflect the new 1236 Metric. 1237 o Otherwise, the incoming RREQ is suppressed. 1239 9. Route Maintenance and RERR Messages 1241 AODVv2 routers attempt to maintain active routes. When a routing 1242 problem is encountered, an AODVv2 router (denoted RERR_Gen) sends the 1243 RERR to quickly notify upstream routers. Two kinds of routing 1244 problems can trigger generation of a RERR message. The first case 1245 happens when the router receives a packet but does not have a route 1246 for the destination of the packet. The second case happens 1247 immediately upon detection of a broken link (see Section 9.2) for an 1248 Active route. 1250 9.1. Maintaining Route Lifetimes During Packet Forwarding 1252 Before using a route to forward a packet, an AODVv2 router MUST check 1253 the status of the route as follows. 1255 o If the route is marked has been marked as Broken, it cannot be 1256 used for forwarding. 1257 o If Current_Time > Route.ExpirationTime, the route table entry has 1258 expired, and cannot be used for forwarding. 1259 o Similarly, if (Route.ExpirationTime == MAXTIME), and if 1260 (Current_Time - Route.LastUsed) > (ACTIVE_INTERVAL + 1261 MAX_IDLETIME), the route has expired, and cannot be used for 1262 forwarding. 1263 o Furthermore, if Current_Time - Route.LastUsed > 1264 MAX_SEQNUM_LIFETIME, the route table entry MUST be expunged. 1266 If any of the above route error conditions hold true, the route 1267 cannot be used to forward the packet, and an RERR message MUST be 1268 generated (see Section 9.3). 1270 Otherwise, Route.LastUsed := Current_Time, and the packet is 1271 forwarded to the route's next hop. 1273 Optionally, if a precursor list is maintained for the route, see 1274 Section 14.3 for precursor lifetime operations. 1276 9.2. Next-hop Router Adjacency Monitoring 1278 Neighboring routers MAY form an adjacency based on AODVv2 messages, 1279 other protocols (e.g. NDP [RFC4861] or NHDP [RFC6130]), or manual 1280 configuration. Loss of a routing adjacency may also be indicated by 1281 similar information. AODVv2 routers SHOULD monitor connectivity to 1282 adjacent routers along active routes. This monitoring can be 1283 accomplished by one or several mechanisms, including: 1285 o Neighborhood discovery [RFC6130] 1286 o Route timeout 1287 o Lower layer trigger that a link is broken 1288 o TCP timeouts 1289 o Promiscuous listening 1290 o Other monitoring mechanisms or heuristics 1292 If a next-hop AODVv2 router has become unreachable, RERR_Gen follows 1293 the procedures in Section 9.3.2. 1295 9.3. RERR Generation 1297 An RERR message is generated by a AODVv2 router (i.e., RERR_Gen) in 1298 order to notify upstream routers that packets cannot be delivered to 1299 one or more destinations. An RERR message has the following general 1300 structure: 1302 +---------------------------------------------------------------+ 1303 | msg_hop_limit, msg_hop_count | 1304 +---------------------------------------------------------------+ 1305 | PktSource, MetricType | 1306 +---------------------------------------------------------------+ 1307 | Unreachable Address List | 1308 +---------------------------------------------------------------+ 1309 | Unreachable Address PrefixLength List | 1310 +---------------------------------------------------------------+ 1311 | Unreachable Address Sequence Number List | 1312 +---------------------------------------------------------------+ 1314 Figure 2: RERR message structure 1316 RERR Data Elements 1317 msg_hop_limit 1318 The remaining number of hops allowed for dissemination of the 1319 RERR message. 1320 msg_hop_count 1321 The number of hops already traversed during dissemination of 1322 the RERR message. 1323 PktSource 1324 The IP address of the unreachable destination triggering RERR 1325 generation. 1326 MetricType 1327 If MetricType != DEFAULT_METRIC_TYPE, the MetricType associated 1328 with routes affected by a broken link. 1329 AddressList 1330 A list of IP addresses not reachable by the AODVv2 router 1331 transmitting the RERR. 1332 PrefixLengthList 1333 The list of prefix lengths associated with the addresses in the 1334 Unreachable Address List. 1335 SeqNumList 1336 The list of destination sequence numbers associated with the 1337 Unreachable Address List. 1339 There are two kinds of events indicating that packets cannot be 1340 delivered to certain destinations. The two cases differ in the way 1341 that the neighboring IP destination address for the RERR is chosen, 1342 and in the way that the set of UnreachableAddrs is identified. 1344 In both cases, the msg_hop_limit MUST be included and SHOULD be set 1345 to MAX_HOPCOUNT. msg_hop_count SHOULD be included and set to 0, to 1346 facilitate use of various route repair strategies including expanding 1347 rings multicast and Intermediate RREP [I-D.perkins-irrep]. 1349 9.3.1. Case 1: Undeliverable Packet 1351 The first case happens when the router receives a packet from another 1352 AODVv2 router but does not have a valid route for the destination of 1353 the packet. In this case, there is exactly one UnreachableAddr to be 1354 included in the RERR's AddressList (either the Destination Address of 1355 the IP header from a data packet, or the OrigAddr found in the 1356 AddressList of an RREP message). The RERR SHOULD be sent to the 1357 multicast address LL-MANET-Routers, but RERR_Gen MAY instead send the 1358 RERR to the next hop towards the source IP address of the packet 1359 which was undeliverable. For unicast RERR, the PktSource data 1360 element MUST be included, containing the the source IP address of the 1361 undeliverable packet, or TargAddr in case the undeliverable packet 1362 was an RREP message for a route to TargAddr. If a Sequence Number 1363 for UnreachableAddr is known, that Sequence Number SHOULD be included 1364 in a Seqnum data element the RERR. Otherwise all nodes handling the 1365 RERR will assume their route through RERR_Gen towards the 1366 UnreachableAddr is no longer valid and mark those routes as broken, 1367 regardless of the Sequence Number information for those routes. 1368 RERR_Gen MUST discard the packet or message that triggered generation 1369 of the RERR. 1371 If an AODVv2 router receives an ICMP packet from the address of one 1372 of its client nodes, it simply relays the packet to the ICMP packet's 1373 destination address, and does not generate any RERR message. 1375 9.3.2. Case 2: Broken Link 1377 The second case happens when the link breaks to an active adjacent 1378 AODVv2 router (i.e., the next hop of an active route). In this case, 1379 the RERR MUST be sent to the multicast address LL-MANET-Routers, 1380 except when the optional feature of maintaining precursor lists is 1381 used as specified in Section 14.3. All routes (Active, Idle and 1382 Expired) that use the broken link MUST be marked as Broken. The 1383 AddressList (which will contain the Unreachable Addresses) is 1384 initialized by first identifying those Active routes which use the 1385 broken link. For each such Active Route, Route.Dest is added to the 1386 AddressList. After the Active Routes using the broken link have all 1387 been indicated in the AddressList, Idle routes MAY also be included, 1388 if allowed by the setting of ENABLE_IDLE_IN_RERR, as long as the 1389 packet size of the RERR does not exceed the MTU (interface "Maximum 1390 Transfer Unit") of the physical medium. 1392 If there are no Unreachable Addresses in the AddressList, no RERR is 1393 generated. Otherwise, RERR_Gen generates a new RERR using the 1394 AddressList. If any Unreachable Address is associated with a routing 1395 prefix (i.e., a prefix length shorter than the maximum length for the 1396 address family), then the AddressList MUST be accompanied by a 1397 PrefixLengthList; otherwise, if no such entry, the PrefixLengthList 1398 SHOULD NOT be included. The value (from the route table) for each 1399 Unreachable Address's SeqNum MUST be placed in the SeqNum data 1400 element. 1402 Every broken route reported in the RERR MUST have the same 1403 MetricType. If the MetricType is not DEFAULT_METRIC_TYPE, then the 1404 RERR message MUST contain a MetricType data element indicating the 1405 MetricType of the broken route(s). 1407 9.4. Receiving and Handling RERR Messages 1409 When an AODVv2 router (HandlingRtr) receives a RERR message, it uses 1410 the information provided to mark affected routes as broken. If 1411 HandlingRtr has neighbors that are using the affected routes, then 1412 HandlingRtr subsequently sends an RERR message to those neighbors. 1414 This regeneration of the RERR message is counted as another "hop" for 1415 purposes of properly modifying msg_hop_limit and msg_hop_count in the 1416 RERR message header. 1418 HandlingRtr examines the incoming RERR to assure that it contains 1419 msg_hop_limit and at least one Unreachable Address; otherwise, the 1420 incoming RERR message is disregarded and further processing stopped. 1421 For each UnreachableAddr, HandlingRtr searches its route table for a 1422 route using longest prefix matching. If no such Route is found, 1423 processing is complete for that UnreachableAddr. Otherwise, 1424 HandlingRtr verifies the following: 1426 1. The UnreachableAddr is a routable unicast address. 1427 2. Route.NextHopAddress is the same as the SourceAddress in the IP 1428 header of the RERR packet. 1429 3. Route.NextHopInterface is the same as the interface on which the 1430 RERR was received. 1431 4. The UnreachableAddr.SeqNum is unknown, OR Route.SeqNum <= 1432 UnreachableAddr.SeqNum (using signed 16-bit arithmetic). 1434 If the Route satisfies all of the above conditions, HandlingRtr 1435 checks whether Route.PrefixLength is the same as the prefix length 1436 for UnreachableAddr. If so, HandlingRtr simply sets the state for 1437 that Route to be Broken. Otherwise, HandlingRtr creates a new route 1438 (call it BrokenRoute) with the same PrefixLength as the prefix length 1439 for UnreachableAddr, and sets Route.State == Broken for BrokenRoute. 1440 If the prefix length for the new route is shorter than 1441 Route.PrefixLength, then Route MUST be expunged from the route table 1442 (since it is a subroute of the larger route which is reported to be 1443 broken). If msg_hop_limit is 0, then HandlingRtr takes no further 1444 action on the RERR message. 1446 If there are no UnreachableAddrs to be transmitted in an RERR to 1447 upstream routers, HandlingRtr takes no further action on the RERR 1448 message. 1450 Otherwise, msg_hop_limit is decremented by one (1) and processing 1451 continues as follows: 1453 o The UnreachableAddrs data element is included in the RERR. 1454 o msg_hop_limit is decremented by one (1). 1455 o (Optional) If precursor lists are maintained, the outgoing RERR 1456 SHOULD be sent to the active precursors of the broken route as 1457 specified in Section 14.3. 1458 o Otherwise, if the incoming RERR message was received at the LL- 1459 MANET-Routers [RFC5498] multicast address, the outgoing RERR 1460 SHOULD be sent to LL-MANET-Routers. 1462 o Otherwise, if the PktSource data element is present, and 1463 HandlingRtr has a Route to PktSource.Addr, then HandlingRtr MUST 1464 send the outgoing RERR to Route[PktSource.Addr].NextHop. 1465 o Otherwise, the outgoing RERR MUST be sent to LL-MANET-Routers. 1467 10. Representing AODVv2 data elements using RFC 5444 1469 AODVv2 specifies that all control plane messages between Routers 1470 SHOULD use the Generalised Mobile Ad-hoc Network Packet and Message 1471 Format [RFC5444], which provides a multiplexed transport for multiple 1472 protocols. AODVv2 therefore specifies Route Messages comprising data 1473 elements that map to message elements in RFC5444 but, in line with 1474 the concept of use, does not specify which order the messages should 1475 be arranged in an RFC5444 packet. An implementation of an RFC5444 1476 parser may choose to optimise the content of certain message elements 1477 to reduce control plane overhead. 1479 Here is a brief summary of the RFC 5444 format. 1481 A packet formatted according to RFC 5444 contains zero or more 1482 messages. 1483 A message contains a message header, message TLV block, and zero 1484 or more address blocks. 1485 Each address block MAY also have an associated TLV block; this TLV 1486 block MAY encode multiple TLVs. Each such TLV may include an 1487 array of values. The list of TLV values may be associated with 1488 various subsets of the addresses in the address block. 1490 If a packet contains only a single AODVv2 message and no packet TLVs, 1491 it need only include a minimal Packet-Header [RFC5444]. The length 1492 of an address (32 bits for IPv4 and 128 bits for IPv6) inside an 1493 AODVv2 message is indicated by the msg-addr-length (MAL) in the msg- 1494 header, as specified in [RFC5444]. 1496 This section specifies a way to represent the data elements specified 1497 by AODVv2 within RFC 5444 message format. 1499 Type-Length-Value structure (TLV) 1500 A generic way to represent information, conformant to use in 1501 [RFC5444]. 1503 AODVv2 uses the following RFC5444 message elements: 1505 o Message Hop Count, , which should be mapped to the 1506 element in . 1507 o Message Hop Limit, , which should be mapped to the 1508 element in . 1510 +---------------------+---------------------------------------------+ 1511 | Data Element | RFC 5444 Message Representation | 1512 +---------------------+---------------------------------------------+ 1513 | msg_hop_limit | RFC 5444 Message Header | 1514 | msg_hop_count | RFC 5444 Message Header | 1515 | AckReq | Acknowledgement Requested Message TLV | 1516 | MetricType | Metric Type Message TLV | 1517 | AddressList | RFC 5444 Address TLV Block | 1518 | PrefixLengthsList | Included in RFC 5444 Address TLV Block | 1519 | MetricList | Metric Address Block TLV | 1520 | SeqNumList | Sequence Number Address Block TLV | 1521 | OrigSeqNum | Originating Node Sequence Number Address | 1522 | | Block TLV | 1523 | TargSeqNum | Target Node Sequence Number Address Block | 1524 | | TLV | 1525 | OrigAddr | Included in AddressList | 1526 | TargAddr | Included in AddressList | 1527 | UnreachableAddr | Included in AddressList | 1528 | SeqNum | Included in SeqNumList | 1529 | Metric | Included in MetricList | 1530 +---------------------+---------------------------------------------+ 1532 Table 3 1534 For handling of messages that contain unknown TLV types, ignore the 1535 information for processing, but preserve it unmodified for 1536 forwarding. 1538 11. Simple Internet Attachment 1540 Simple Internet attachment means attachment of a stub (i.e., non- 1541 transit) network of AODVv2 routers to the Internet via a single 1542 Internet AODVv2 router (called IAR). 1544 As in any Internet-attached network, AODVv2 routers, and their 1545 clients, wishing to be reachable from hosts on the Internet MUST have 1546 IP addresses within the IAR's routable and topologically correct 1547 prefix (e.g. 191.0.2.0/24). 1549 /-------------------------\ 1550 / +----------------+ \ 1551 / | AODVv2 Router | \ 1552 | | 191.0.2.2/32 | | 1553 | +----------------+ | Routable 1554 | +-----+--------+ Prefix 1555 | | Internet | /191.0.2/24 1556 | | AODVv2 Router| / 1557 | | 191.0.2.1 |/ /---------------\ 1558 | | serving net +------+ Internet \ 1559 | | 191.0.2/24 | \ / 1560 | +-----+--------+ \---------------/ 1561 | +----------------+ | 1562 | | AODVv2 Router | | 1563 | | 191.0.2.3/32 | | 1564 \ +----------------+ / 1565 \ / 1566 \-------------------------/ 1568 Figure 3: Simple Internet Attachment Example 1570 When an AODVv2 router within the AODVv2 MANET wants to discover a 1571 route toward a node on the Internet, it uses the normal AODVv2 route 1572 discovery for that IP Destination Address. The IAR MUST respond to 1573 RREQ on behalf of all Internet destinations. 1575 When a packet from a node on the Internet destined for a node in the 1576 AODVv2 MANET reaches the IAR, if the IAR does not have a route toward 1577 that destination it will perform normal AODVv2 route discovery for 1578 that destination. 1580 12. Multiple Interfaces 1582 AODVv2 MAY be used with multiple interfaces; therefore, the 1583 particular interface over which packets arrive MUST be known whenever 1584 a packet is received. Whenever a new route is created, the interface 1585 through which the route's destination can be reached is also recorded 1586 in the route table entry. 1588 When multiple interfaces are available, a node transmitting a 1589 multicast packet to LL-MANET-Routers MUST send the packet on all 1590 interfaces that have been configured for AODVv2 operation. 1592 Similarly, AODVv2 routers MUST subscribe to LL-MANET-Routers on all 1593 their AODVv2 interfaces. 1595 13. AODVv2 Control Message Generation Limits 1597 To avoid congestion, each AODVv2 router's rate of packet/message 1598 generation SHOULD be limited. The rate and algorithm for limiting 1599 messages (CONTROL_TRAFFIC_LIMITS) is left to the implementor and 1600 should be administratively configurable. AODVv2 messages SHOULD be 1601 discarded in the following order of preference: RREQ, RREP, and 1602 finally RERR. 1604 14. Optional Features 1606 Some optional features of AODVv2, associated with AODV, are not 1607 required by minimal implementations. These features are expected to 1608 apply in networks with greater mobility, or larger node populations, 1609 or requiring reduced latency for application launches. The optional 1610 features are as follows: 1612 o Expanding Rings Multicast 1613 o Intermediate RREPs (iRREPs): Without iRREP, only the destination 1614 can respond to a RREQ. 1615 o Precursor lists. 1616 o Reporting Multiple Unreachable Addresses: a RERR message can carry 1617 more than one Unreachable Destination Address for cases when a 1618 single link breakage causes multiple destinations to become 1619 unreachable from an intermediate router. 1620 o RREP_ACK. 1621 o Message Aggregation. 1623 14.1. Expanding Rings Multicast 1625 For multicast RREQ, msg_hop_limit MAY be set in accordance with an 1626 expanding ring search as described in [RFC3561] to limit the RREQ 1627 propagation to a subset of the local network and possibly reduce 1628 route discovery overhead. 1630 14.2. Intermediate RREP 1632 This specification has been published as a separate Internet Draft 1633 [I-D.perkins-irrep]. 1635 14.3. Precursor Lists and Notifications 1637 This section specifies an interoperable enhancement to AODVv2 (and 1638 possibly other reactive routing protocols) enabling more economical 1639 notifications to traffic sources upon determination that a route 1640 needed to forward such traffic to its destination has become Broken. 1642 14.3.1. Overview 1644 In many circumstances, there can be several sources of traffic for a 1645 certain destination. Each such source of traffic is known as a 1646 "precursor" for the destination, as well as all upstream routers 1647 between the forwarding AODVv2 router and the traffic source. For 1648 each destination, an AODVv2 router MAY choose to keep track of the 1649 upstream neighbors that have provided traffic for that destination; 1650 there is no need to keep track of upstream routers any farther away 1651 than the next hop. 1653 Moreover, any particular link to an adjacent AODVv2 router may be a 1654 path component of multiple routes towards various destinations. The 1655 precursors for all destinations using the next hop across any link 1656 are collectively known as the precursors for that next hop. 1658 When an AODVv2 router determines that an link to one of its neighbors 1659 has broken, the AODVv2 router detecting the broken link must mark 1660 multiple routes as Broken, for each of the newly unreachable 1661 destinations, as described in Section 9.3. Each route that relies on 1662 the newly broken link is no longer valid. Furthermore, the 1663 precursors of the broken link should be notified (using RERR) about 1664 the change in status of their route to a destination relying upon the 1665 broken next hop. 1667 14.3.2. Precursor Notification Details 1669 During normal operation, each AODVv2 router wishing to maintain 1670 precursor lists as described above, maintains a precursor table and 1671 updates the table whenever the node forwards traffic to one of the 1672 destinations in its route table. For each precursor in the precursor 1673 list, a record must be maintained to indicate whether the precursor 1674 has been used for recent traffic (in other words, whether the 1675 precursor is an Active precursor). So, when traffic arrives from a 1676 precursor, the Current_Time is used to mark the time of last use for 1677 the precursor list element associated with that precursor. 1679 When an AODVv2 router detects that a link is broken, then for each 1680 precursor using that next hop, the node MAY notify the precursor 1681 using either unicast or multicast RERR: 1683 unicast RERR to each Active precursor 1684 This option is applicable when there are few Active precursors 1685 compared to the number of neighboring AODVv2 routers. 1686 multicast RERR to RERR_PRECURSORS 1687 RERR_PRECURSORS is, by default, LL-MANET-Routers [RFC5498]. This 1688 option is typically preferable when there are many precursors, 1689 since fewer packet transmissions are required. 1691 Each upstream neighbor (i.e., precursor) MAY then execute the same 1692 procedure until all upstream routers have received the RERR 1693 notification. 1695 14.4. Multicast RREP Response to RREQ 1697 The RREQ Target Router (RREP_Gen) MAY, as an alternative to 1698 unicasting a RREP, be configured to distribute routing information 1699 about the route toward TargAddr. That is, RREP_Gen MAY be configured 1700 respond to a route discovery by generating a RREP, using the 1701 procedure in Section 8.4, but multicasting the RREP to LL-MANET- 1702 Routers [RFC5498] (subject to similar suppression algorithm for 1703 redundant RREP multicasts as described in Section 8.6). The 1704 redundant message suppression must occur at every router handling the 1705 multicast RREP. Afterwards, RREP_Gen processing for the incoming 1706 RREQ is complete. 1708 Broadcast RREP response to incoming RREQ was originally specified to 1709 handle unidirectional links, but it is expensive. Due to the 1710 significant overhead, AODVv2 routers MUST NOT use multicast RREP 1711 unless configured to do so by setting the administrative parameter 1712 USE_MULTICAST_RREP. 1714 14.5. RREP_ACK 1716 Instead of relying on existing mechanisms for requesting verification 1717 of link bidirectionality during Route Discovery, RREP_Ack is provided 1718 as an optional feature and modeled on the RREP_Ack message type from 1719 AODV [RFC3561]. 1721 Since the RREP_ACK is simply echoed back to the node from which the 1722 RREP was received, there is no need for other data elements. 1723 Considerations of packet TTL are as specified in Section 5. An 1724 example message format is illustrated in section Appendix B.4. 1726 14.6. Message Aggregation 1728 The aggregation of multiple messages into a packet is specified in 1729 RFC 5444 [RFC5444]. 1731 Implementations MAY choose to briefly delay transmission of messages 1732 for the purpose of aggregation (into a single packet) or to improve 1733 performance by using jitter [RFC5148]. 1735 15. Administratively Configurable Parameters and Timer Values 1737 AODVv2 uses various configurable parameters of various types: 1739 o Timers 1740 o Protocol constants 1741 o Administrative (functional) controls 1742 o Other administrative parameters and lists 1744 The tables in the following sections show the parameters along their 1745 definitions and default values (if any). 1747 Note: several fields have limited size (bits or bytes). These sizes 1748 and their encoding may place specific limitations on the values that 1749 can be set. For example, is a 8-bit field and 1750 therefore MAX_HOPCOUNT cannot be larger than 255. 1752 15.1. Timers 1754 AODVv2 requires certain timing information to be associated with 1755 route table entries. The default values are as follows, subject to 1756 future experience: 1758 +------------------------------+---------------+ 1759 | Name | Default Value | 1760 +------------------------------+---------------+ 1761 | ACTIVE_INTERVAL | 5 second | 1762 | MAX_IDLETIME | 200 seconds | 1763 | MAX_BLACKLIST_TIME | 200 seconds | 1764 | MAX_SEQNUM_LIFETIME | 300 seconds | 1765 | RREQ_WAIT_TIME | 2 seconds | 1766 | UNICAST_MESSAGE_SENT_TIMEOUT | 1 second | 1767 | RREQ_HOLDDOWN_TIME | 10 seconds | 1768 +------------------------------+---------------+ 1770 Table 4: Timing Parameter Values 1772 The above timing parameter values have worked well for small and 1773 medium well-connected networks with moderate topology changes. 1775 The timing parameters SHOULD be administratively configurable for the 1776 network where AODVv2 is used. Ideally, for networks with frequent 1777 topology changes the AODVv2 parameters should be adjusted using 1778 either experimentally determined values or dynamic adaptation. For 1779 example, in networks with infrequent topology changes MAX_IDLETIME 1780 may be set to a much larger value. 1782 15.2. Protocol constants 1784 AODVv2 protocol constants typically do not require changes. The 1785 following table lists these constants, along with their values and a 1786 reference to the specification describing their use. 1788 +------------------------+--------------------+---------------------+ 1789 | Name | Default Value | Description | 1790 +------------------------+--------------------+---------------------+ 1791 | DISCOVERY_ATTEMPTS_MAX | 3 | Section 8.1 | 1792 | MAX_HOPCOUNT | 20 hops | Section 6.5 | 1793 | MAX_METRIC[i] | Specified only for | Section 6.5 | 1794 | | HopCount | | 1795 | MAXTIME | [TBD] | Maximum expressible | 1796 | | | clock time | 1797 +------------------------+--------------------+---------------------+ 1799 Table 5: Parameter Values 1801 15.3. Administrative (functional) controls 1803 The following administrative controls may be used to change the 1804 operation of the network, by enabling optional behaviors. These 1805 options are not required for correct routing behavior, although they 1806 may potentially reduce AODVv2 protocol messaging in certain 1807 situations. The default behavior is to NOT enable most such options, 1808 options. Packet buffering is enabled by default. 1810 +------------------------+------------------------------------+ 1811 | Name | Description | 1812 +------------------------+------------------------------------+ 1813 | DEFAULT_METRIC_TYPE | 3 (i.e, Hop Count (see [RFC6551])) | 1814 | ENABLE_IDLE_IN_RERR | Section 9.3.2 | 1815 | ENABLE_IRREP | Section 8.3 | 1816 | USE_MULTICAST_RREP | Section 14.4 | 1817 +------------------------+------------------------------------+ 1819 Table 6: Administratively Configured Controls 1821 15.4. Other administrative parameters and lists 1823 The following table lists contains AODVv2 parameters which should be 1824 administratively configured for each specific network. 1826 +-----------------------+-----------------------+-----------------+ 1827 | Name | Default Value | Cross Reference | 1828 +-----------------------+-----------------------+-----------------+ 1829 | AODVv2_INTERFACES | | Section 4 | 1830 | BUFFER_SIZE_PACKETS | 2 | Section 8.1 | 1831 | BUFFER_SIZE_BYTES | MAX_PACKET_SIZE [TBD] | Section 8.1 | 1832 | CLIENT_ADDRESSES | AODVv2_INTERFACES | Section 6.3 | 1833 | CONTROL_TRAFFIC_LIMIT | TBD [50 packets/sec?] | Section 13 | 1834 +-----------------------+-----------------------+-----------------+ 1836 Table 7: Other Administrative Parameters 1838 16. IANA Considerations 1840 This section specifies several RFC 5444 message types, message tlv- 1841 types, and address tlv-types. Also, a new registry of 16-bit 1842 alternate metric types is specified. 1844 16.1. AODVv2 Message Types Specification 1846 +----------------------------------------+------------+ 1847 | Name | Type (TBD) | 1848 +----------------------------------------+------------+ 1849 | Route Request (RREQ) | 10 | 1850 | Route Reply (RREP) | 11 | 1851 | Route Error (RERR) | 12 | 1852 | Route Reply Acknowledgement (RREP_ACK) | 13 | 1853 +----------------------------------------+------------+ 1855 Table 8: AODVv2 Message Types 1857 16.2. Message TLV Type Specification 1859 +-----------------------------------+-------+---------+-------------+ 1860 | Name | Type | Length | Cross | 1861 | | (TBD) | in | Reference | 1862 | | | octets | | 1863 +-----------------------------------+-------+---------+-------------+ 1864 | AckReq (Acknowledgment Request) | 10 | 0 | Section 6.2 | 1865 | PktSource (Packet Source) | 11 | 4 or 16 | Section 9.3 | 1866 | MetricType | 12 | 1 | Section 8.2 | 1867 +-----------------------------------+-------+---------+-------------+ 1869 Table 9: Message TLV Types 1871 16.3. Address Block TLV Specification 1873 +-----------------------------+--------+--------------+-------------+ 1874 | Name | Type | Length | Value | 1875 | | (TBD) | | | 1876 +-----------------------------+--------+--------------+-------------+ 1877 | Metric | 10 | depends on | Section 8.2 | 1878 | | | Metric Type | | 1879 | Sequence Number (SeqNum) | 11 | 2 octets | Section 8.2 | 1880 | Originating Node Sequence | 12 | 2 octets | Section 8.2 | 1881 | Number (OrigSeqNum) | | | | 1882 | Target Node Sequence Number | 13 | 2 octets | Section 8.2 | 1883 | (TargSeqNum) | | | | 1884 | VALIDITY_TIME | 1 | 1 octet | [RFC5497] | 1885 +-----------------------------+--------+--------------+-------------+ 1887 Table 10: Address Block TLV (AddrTLV) Types 1889 16.4. Metric Type Number Allocation 1891 Metric types are identified according to the assignments as specified 1892 in [RFC6551]. The metric type of the Hop Count metric is assigned to 1893 be 3, in order to maintain compatibility with that existing table of 1894 values from RFC 6551. Non-addititve metrics are not supported in 1895 this draft. 1897 +-----------------------+----------+-------------+ 1898 | Name | Type | Metric Size | 1899 +-----------------------+----------+-------------+ 1900 | Unallocated | 0 -- 2 | TBD | 1901 | Hop Count | 3 - TBD | 1 octet | 1902 | Unallocated | 4 -- 254 | TBD | 1903 | Reserved | 255 | Undefined | 1904 +-----------------------+----------+-------------+ 1906 Table 11: Metric Types 1908 17. Security Considerations 1910 The objective of the AODVv2 protocol is for each router to 1911 communicate reachability information about addresses for which it is 1912 responsible. Positive routing information (i.e. a route exists) is 1913 distributed via RREQ and RREP messages. Negative routing information 1914 (i.e. a route does not exist) is distributed via RERRs. AODVv2 1915 routers store the information contained in these messages in order to 1916 properly forward data packets, and they generally provide this 1917 information to other AODVv2 routers. 1919 This section does not mandate any specific security measures. 1920 Instead, this section describes various security considerations and 1921 potential avenues to secure AODVv2 routing. 1923 The most important security mechanisms for AODVv2 routing are 1924 integrity/authentication and confidentiality. 1926 In situations where routing information or router identity are 1927 suspect, integrity and authentication techniques SHOULD be applied to 1928 AODVv2 messages. In these situations, routing information that is 1929 distributed over multiple hops SHOULD also verify the integrity and 1930 identity of information based on originator of the routing 1931 information. 1933 A digital signature could be used to identify the source of AODVv2 1934 messages and information, along with its authenticity. A nonce or 1935 timestamp SHOULD also be used to protect against replay attacks. S/ 1936 MIME and OpenPGP are two authentication/integrity protocols that 1937 could be adapted for this purpose. 1939 In situations where confidentiality of AODVv2 messages is important, 1940 cryptographic techniques can be applied. 1942 In certain situations, for example sending a RREP or RERR, an AODVv2 1943 router could include proof that it has previously received valid 1944 routing information to reach the destination, at one point of time in 1945 the past. In situations where routers are suspected of transmitting 1946 maliciously erroneous information, the original routing information 1947 along with its security credentials SHOULD be included. 1949 Note that if multicast is used, any confidentiality and integrity 1950 algorithms used MUST permit multiple receivers to handle the message. 1952 Routing protocols, however, are prime targets for impersonation 1953 attacks. In networks where the node membership is not known, it is 1954 difficult to determine the occurrence of impersonation attacks, and 1955 security prevention techniques are difficult at best. However, when 1956 the network membership is known and there is a danger of such 1957 attacks, AODVv2 messages must be protected by the use of 1958 authentication techniques, such as those involving generation of 1959 unforgeable and cryptographically strong message digests or digital 1960 signatures. While AODVv2 does not place restrictions on the 1961 authentication mechanism used for this purpose, IPsec Authentication 1962 Message (AH) is an appropriate choice for cases where the nodes share 1963 an appropriate security association that enables the use of AH. 1965 In particular, routing messages SHOULD be authenticated to avoid 1966 creation of spurious routes to a destination. Otherwise, an attacker 1967 could masquerade as that destination and maliciously deny service to 1968 the destination and/or maliciously inspect and consume traffic 1969 intended for delivery to the destination. RERR messages SHOULD be 1970 authenticated in order to prevent malicious nodes from disrupting 1971 routes between communicating nodes. 1973 If the mobile nodes in the ad hoc network have pre-established 1974 security associations, the purposes for which the security 1975 associations are created should include that of authorizing the 1976 processing of AODVv2 control packets. Given this understanding, the 1977 mobile nodes should be able to use the same authentication mechanisms 1978 based on their IP addresses as they would have used otherwise. 1980 If the mobile nodes in the ad hoc network have pre-established 1981 security associations, the purposes for which the security 1982 associations Most AODVv2 messages are transmitted to the multicast 1983 address LL-MANET-Routers [RFC5498]. It is therefore required for 1984 security that AODVv2 neighbors exchange security information that can 1985 be used to insert an ICV [RFC6621] into the AODVv2 message block 1986 [RFC5444]. This enables hop-by-hop security. For destination-only 1987 RREP discovery procedures, AODVv2 routers that share a security 1988 association SHOULD use the appropriate mechanisms as specified in RFC 1989 6621. The establishment of these security associations is out of 1990 scope for this document. 1992 18. Acknowledgments 1994 AODVv2 is a descendant of the design of previous MANET on-demand 1995 protocols, especially AODV [RFC3561] and DSR [RFC4728]. Changes to 1996 previous MANET on-demand protocols stem from research and 1997 implementation experiences. Thanks to Elizabeth Belding-Royer for 1998 her long time authorship of AODV. Additional thanks to Derek Atkins, 1999 Emmanuel Baccelli, Abdussalam Baryun, Ramon Caceres, Thomas Clausen, 2000 Christopher Dearlove, Ulrich Herberg, Henner Jakob, Luke Klein- 2001 Berndt, Lars Kristensen, Tronje Krop, Koojana Kuladinithi, Kedar 2002 Namjoshi, Alexandru Petrescu, Henning Rogge, Fransisco Ros, Pedro 2003 Ruiz, Christoph Sommer, Lotte Steenbrink, Romain Thouvenin, Richard 2004 Trefler, Jiazi Yi, Seung Yi, and Cong Yuan, for their reviews AODVv2 2005 and DYMO, as well as numerous specification suggestions. 2007 19. References 2009 19.1. Normative References 2011 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2012 Requirement Levels", BCP 14, RFC 2119, March 1997. 2014 [RFC5082] Gill, V., Heasley, J., Meyer, D., Savola, P., and C. 2015 Pignataro, "The Generalized TTL Security Mechanism 2016 (GTSM)", RFC 5082, October 2007. 2018 [RFC5444] Clausen, T., Dearlove, C., Dean, J., and C. Adjih, 2019 "Generalized Mobile Ad Hoc Network (MANET) Packet/Message 2020 Format", RFC 5444, February 2009. 2022 [RFC5497] Clausen, T. and C. Dearlove, "Representing Multi-Value 2023 Time in Mobile Ad Hoc Networks (MANETs)", RFC 5497, March 2024 2009. 2026 [RFC5498] Chakeres, I., "IANA Allocations for Mobile Ad Hoc Network 2027 (MANET) Protocols", RFC 5498, March 2009. 2029 [RFC6551] Vasseur, JP., Kim, M., Pister, K., Dejean, N., and D. 2030 Barthel, "Routing Metrics Used for Path Calculation in 2031 Low-Power and Lossy Networks", RFC 6551, March 2012. 2033 19.2. Informative References 2035 [I-D.perkins-irrep] 2036 Perkins, C. and I. Chakeres, "Intermediate RREP for 2037 dynamic MANET On-demand (AODVv2) Routing", draft-perkins- 2038 irrep-02 (work in progress), November 2012. 2040 [Perkins94] 2041 Perkins, C. and P. Bhagwat, "Highly Dynamic Destination- 2042 Sequenced Distance-Vector Routing (DSDV) for Mobile 2043 Computers", Proceedings of the ACM SIGCOMM '94 Conference 2044 on Communications Architectures, Protocols and 2045 Applications, London, UK, pp. 234-244, August 1994. 2047 [Perkins99] 2048 Perkins, C. and E. Royer, "Ad hoc On-Demand Distance 2049 Vector (AODV) Routing", Proceedings of the 2nd IEEE 2050 Workshop on Mobile Computing Systems and Applications, New 2051 Orleans, LA, pp. 90-100, February 1999. 2053 [RFC2501] Corson, M. and J. Macker, "Mobile Ad hoc Networking 2054 (MANET): Routing Protocol Performance Issues and 2055 Evaluation Considerations", RFC 2501, January 1999. 2057 [RFC3561] Perkins, C., Belding-Royer, E., and S. Das, "Ad hoc On- 2058 Demand Distance Vector (AODV) Routing", RFC 3561, July 2059 2003. 2061 [RFC4193] Hinden, R. and B. Haberman, "Unique Local IPv6 Unicast 2062 Addresses", RFC 4193, October 2005. 2064 [RFC4728] Johnson, D., Hu, Y., and D. Maltz, "The Dynamic Source 2065 Routing Protocol (DSR) for Mobile Ad Hoc Networks for 2066 IPv4", RFC 4728, February 2007. 2068 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 2069 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 2070 September 2007. 2072 [RFC5148] Clausen, T., Dearlove, C., and B. Adamson, "Jitter 2073 Considerations in Mobile Ad Hoc Networks (MANETs)", RFC 2074 5148, February 2008. 2076 [RFC6130] Clausen, T., Dearlove, C., and J. Dean, "Mobile Ad Hoc 2077 Network (MANET) Neighborhood Discovery Protocol (NHDP)", 2078 RFC 6130, April 2011. 2080 [RFC6621] Macker, J., "Simplified Multicast Forwarding", RFC 6621, 2081 May 2012. 2083 Appendix A. Example Algorithms for AODVv2 Protocol Operations 2085 The following subsections show example algorithms for protocol 2086 operations required by AODVv2, including RREQ, RREP, RERR, and RREP- 2087 ACK. 2089 Processing for RREQ, RREP, and RERR messages follows the following 2090 general outline: 2092 1. Receive incoming message. 2093 2. Update route table as appropriate. 2094 3. Respond as needed, often regenerating the incoming message with 2095 updated information. 2097 Once the route table has been updated, the information contained 2098 there is known to be the most recent available information for any 2099 fields in the outgoing message. For this reason, the algorithms are 2100 written as if outgoing message field values are assigned from the 2101 route table information, even though it is often equally appropriate 2102 to use fields from the incoming message. 2104 AODVv2_algorithms: 2106 o Process_Routing_Info 2107 o Generate_RREQ 2108 o Receive_RREQ 2109 o Regenerate_RREQ 2110 o Generate_RREP 2111 o Receive_RREP 2112 o Regenerate_RREP 2113 o Generate_RERR 2114 o Receive_RERR 2115 o Regenerate_RERR 2116 o Generate_RREP_Ack 2117 o Consume_RREP_Ack() 2118 o Timeout RREP_Ack() 2120 The following lists indicate the meaning of the field names used in 2121 subsequent sections to describe message processing for the above 2122 algorithms. 2124 Incoming RREQ message parameters: 2126 inRREQ.origIP := originator IP address 2127 inRREQ.origSeq := originator IP sequence # 2128 inRREQ.metType := metric type 2129 inRREQ.origMet := metric to originator 2130 inRREQ.targIP := target IP address 2131 inRREQ.targSeq := target sequence # (if known) 2132 inRREQ.hopLim := msg-hop-limit /* from RFC 5444 header */ 2133 inRREQ.nbrIP := IP address of the neighbor that sent the RREQ 2135 Outgoing RREQ message parameters: 2137 outRREQ.origIP := originator IP address 2138 outRREQ.origSeq := originator IP sequence # 2139 outRREQ.metType := metric type 2140 outRREQ.origMet := metric to origNode {initially 2141 MIN_METRIC[MetType]} 2142 outRREQ.targIP := target IP address 2143 outRREQ.targSeq := target sequence # (if known) 2144 outRREQ.hopLim /* initially MAX_HOPCOUNT at originator */ 2146 Incoming RREP message parameters: 2148 inRREP.hoplim /* msg-hop-limit from RFC 5444 header */ 2149 inRREP.origIP := originator's IP address 2150 inRREP.metType := metric type 2151 inRREP.targIP := target IP address 2152 inRREP.targSeq := target sequence # 2153 inRREP.targMet := target's metric {initially MIN_METRIC[MetType]} 2154 inRREP.PfxLen 2156 Outgoing RREP message parameters: 2158 outRREP.origIP := originator's IP address 2159 outRREP.metType := metric type 2160 outRREP.targIP := target IP address 2161 outRREP.targSeq := target sequence # 2162 outRREP.targMet := target's metric {starting with zero} 2163 outRREP.PfxLen 2164 outRREP.hopLim /* initially MAX_HOPCOUNT at originator */ 2166 Incoming RERR message parameters: 2168 inRERR.PktSrc := source IP of unforwardable packet (if present) 2169 inRERR.metType := metric type for routes to unreachable 2170 destinations 2171 inRERR.PfxLen[] := prefix lengths for unreachable destinations 2172 inRERR.LostDest[] := unreachable destinations 2173 inRERR.LostSeq[] := sequence #s for unreachable destinations 2175 Outgoing RERR message parameters: 2177 outRERR.PktSrc := source IP of unforwardable packet (if present) 2178 outRERR.metType := metric type for routes to unreachable 2179 destinations 2180 outRERR.PfxLen[] := prefix lengths for unreachable destinations 2181 outRERR.LostDest[] := unreachable destinations 2182 outRERR.LostSeq[] := sequence #s for unreachable destinations 2184 A.1. Subroutines for AODVv2 Protocol Operations 2185 /* Compare incoming route information to current route, maybe use */ 2186 Process_Routing_Info (dest, seq#, metric_type, metric, 2187 last_hop_metric) 2188 /* last_hop_metric: either Cost(inRREQ.netif) or (inRREP.netif) */ 2189 { 2190 new_metric := metric + last_hop_metric; 2191 rte := Fetch_Route_Table_Entry (dest, seq#, metric_type); 2192 if (NULL == rte) { 2193 rte := Create_Route_Table_Entry 2194 (dest, seq#, metric_type, new_metric); 2195 } else if (seq# > rte.seq#) { /* stale rte route entry */ 2196 Update_Route_Table_Entry (rte, seq#, metric_type, new_metric); 2197 } else if (seq# < rte.seq#) { /* stale incoming route infor */ 2198 return(NULL); 2199 } else if (rte.state == broken) { /* when (seq# == rte.seq#) */ 2200 Update_Route_Table_Entry (rte, seq#, metric_type, new_metric); 2201 } else if (rte.metric > (new_metric) { /* and (seq# == rte.seq#) */ 2202 Update_Route_Table_Entry (rte, seq#, metric_type, new_metric); 2203 } else { /* incoming route information is not useful */ 2204 return(NULL); 2205 } 2206 return (rte); 2207 } 2209 A.2. Example Algorithms for AODVv2 RREQ Operations 2211 A.2.1. Generate_RREQ 2212 Generate_RREQ { 2213 /* Marshall parameters */ 2214 outRREQ.origIP := IP address used by application 2215 outRREQ.origSeq := originating router's sequence # 2216 outRREQ.metType := (if included) metric type needed by application 2217 outRREQ.origMet := 0 (default) or MIN_METRIC(Metric_type) 2218 outRREQ.targIP := target IP address 2219 outRREQ.targSeq := target sequence # /* if known from route table */ 2220 outRREQ.hopLim := msg-hop-limit /* RFC 5444 */ 2222 /* build RFC 5444 message header fields */ 2223 { 2224 msg-type=RREQ (message is of type RREQ) 2225 MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2226 MAL=3 or 15 (Message Address Length [3 for IPv4, 15 for IPv6]) 2227 msg-size=NN (octets -- counting MsgHdr, AddrBlk, and AddrTLVs) 2228 msg-hop-limit := MAX_HOPCOUNT 2229 if (Metric_type == DEFAULT) { 2230 msg.tlvs-length=0 2231 } else { /* Metric_type != HopCount */ 2232 /* Build Metric_type Message TLV */ 2233 } 2234 } 2236 /* build AddrBlk */ 2237 num-addr := 2 2238 AddrBlk := {outRREQ.origIP and outRREQ.targIP addresses} 2240 /* Include each available Sequence Number in appropriate AddrTLV */ 2241 /* put outRREQ.origSeq in OrigSeqNum AddrTLV */ 2242 if (NULL != targSeq) { 2243 /* put outRREQ.targSeq in TargSeqNum AddrTLV */ 2244 } 2246 /* Build Metric AddrTLV containing OrigAddr metric */ 2247 /* use MIN_METRIC(metric type) [==0 for default metric type */ 2248 } 2250 A.2.2. Receive_RREQ 2251 Receive_RREQ (inRREQ) { 2252 /* Extract inRREQ values */ 2253 origRTE = Process_Routing_Info (inRREQ.origIP, inRREQ.origSeq, ...) 2254 if (inRREQ.targIP belongs to me or my client subnet) { 2255 Generate_RREP() 2256 } else if (inRREQ present in RREQ_table) { 2257 return; /* don't regenerate RREQ... */ 2258 } else if (inRREQ.nbrIP not present in blacklist) { 2259 Regenerate_RREQ(origRTE, inRREQ) 2260 } else if (blacklist_expiration_time > current_time) { 2261 return; /* don't regenerate RREQ... */ 2262 } else { 2263 Remove nbrIP from blacklist; 2264 Regenerate_RREQ(origRTE, inRREQ) 2265 } 2266 } 2268 A.2.3. Regenerate_RREQ 2269 Regenerate_RREQ (origRTE, inRREQ) { /* called from receive_RREQ() */ 2270 outRREQ.hopLim := inRREQ.hopLim - 1 2271 if (outRREQ.hopLim == 0) { /* don't regenerate */ 2272 return() 2273 } 2274 /* Marshall parameters */ 2275 outRREQ.origIP := origRTE.origIP 2276 outRREQ.origSeq := origRTE.origSeq 2277 outRREQ.origMet := origRTE.origMet 2278 outRREQ.metType := origRTE.metType 2279 outRREQ.targIP := inRREQ.targIP 2280 outRREQ.targSeq := inRREQ.targSeq /* if present */ 2282 /* build RFC 5444 message header fields */ 2283 { 2284 msg-type=RREQ (message is of type RREQ) 2285 MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2286 MAL=3 or 15 (Message Address Length [3 for IPv4, 15 for IPv6]) 2287 msg-size=NN (octets -- counting MsgHdr, AddrBlk, and AddrTLVs) 2288 msg-hop-limit := MAX_METRIC(Metric Type) (default, MAX_HOPCOUNT) 2289 if (Metric_type == DEFAULT) { 2290 msg.tlvs-length=0 2291 } else { /* Metric_type != HopCount */ 2292 /* Build Metric_type Message TLV */ 2293 } 2294 } 2296 /* build AddrBlk */ 2297 num-addr := 2 2298 AddrBlk := {outRREQ.origIP and outRREQ.targIP addresses} 2300 /* Include each available Sequence Number in its proper AddrTLV */ 2301 /* put outRREQ.origSeq in OrigSeqNum AddrTLV */ 2302 if (NULL != targSeq) { 2303 /* put outRREQ.targSeq in TargSeqNum AddrTLV */ 2304 } 2306 /* Build Metric AddrTLV to contain outRREQ.origMet */ 2308 } 2310 A.3. Example Algorithms for AODVv2 RREP Operations 2311 A.3.1. Generate_RREP 2313 Generate_RREP { 2314 /* Marshall parameters */ 2315 outRREP.origIP := origRTE.origIP 2316 metric_type := origRTE.metType /* if not default */ 2317 if (DEFAULT != metric_type) 2318 outRREP.metType := metric_type 2319 outRREP.targIP := inRREQ.targIP 2320 outRREP.targMet := MIN_METRIC(outRREP.metType) (0 by default) 2321 my_sequence_# := (1 + my_sequence_#) /* from nonvolatile storage */ 2322 outRREP.targSeq := my_sequence_# 2324 /* build RFC 5444 message header fields */ 2325 { 2326 msg-type=RREP 2327 MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2328 MAL=3 or 15 (Message Address Length [3 for IPv4, 15 for IPv6]) 2329 msg-size=NN (octets -- counting MsgHdr, AddrBlk, and AddrTLVs) 2330 msg-hop-limit := MAX_HOPCOUNT 2331 /* Include the AckReq TLV when: 2332 - previous RREP does not seem to enable any data flow, OR 2333 - when RREQ is received from same OrigAddr after RREP was 2334 unicast to targRTE.nextHop 2335 */ 2336 if (DEFAULT != metric_type) { 2337 msg.tlvs-length=0 2338 } else { /* Metric_type != HopCount */ 2339 /* Build Metric_type Message TLV */ 2340 } 2341 } 2343 /* build AddrBlk */ 2344 num-addr := 2 2345 AddrBlk := {outRREQ.origIP and outRREQ.targIP addresses} 2347 /* put outRREP.TargSeq in TargSeqNum AddrTLV */ 2349 /* Build Metric AddrTLV containing TargAddr metric */ 2350 /* use MIN_METRIC(origRTE.metType) */ 2351 } 2353 A.3.2. Receive_RREP 2355 Receive_RREP (inRREP) 2356 { 2357 If (RREP includes AckReq data element) { 2358 Generate_RREP_Ack() 2359 } 2360 /* Extract inRREP values */ 2361 targRTE := Process_Routing_Info (inRREP.targIP, inRREP.targSeq, ...) 2362 if (inRREP.targIP belongs to me, a client, or a client subnet) { 2363 Consume_RREP(inRREP) 2364 } else { 2365 Regenerate_RREP(targRTE, inRREP) 2366 } 2367 } 2369 A.3.3. Regenerate_RREP 2371 Regenerate_RREP(targRTE, inRREP) { 2372 outRREP.hopLim := inRREP.hopLim - 1 2373 if (outRREP.hopLim == 0) { /* don't regenerate */ 2374 return() 2375 } 2376 /* Marshall parameters */ 2377 outRREP.targIP := targRTE.targIP 2378 outRREP.targSeq := targRTE.targSeq 2379 outRREP.targMet := targRTE.targMet 2380 metric_type := origRTE.metType /* if not default */ 2381 if (DEFAULT != metric_type) 2382 outRREP.metType := metric_type 2383 outRREP.origIP := inRREP.origIP 2384 outRREP.nextHop := targRTE.nextHop 2386 /* build RFC 5444 message header fields */ 2387 { 2388 msg-type=RREP (message is of type RREP) 2389 MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2390 MAL=3 or 15 (Message Address Length [3 for IPv4, 15 for IPv6]) 2391 msg-size=NN (octets -- counting MsgHdr, AddrBlk, and AddrTLVs) 2392 /* Include the AckReq data element when: 2393 - previous RREP does not seem to enable any data flow, OR 2394 - when RREQ is received from same OrigAddr after RREP was 2395 unicast to targRTE.nextHop 2396 */ 2397 msg-hop-limit := outRREP.hopLim; 2398 if (metric_type == DEFAULT) { 2399 msg.tlvs-length=0 2400 } else { /* Metric_type != HopCount */ 2401 /* Build Metric_type Message TLV */ 2402 } 2403 } 2405 /* build AddrBlk */ 2406 num-addr := 2 2407 AddrBlk := {outRREQ.origIP and outRREQ.targIP addresses} 2409 /* put outRREP.targSeq in TargSeqNum AddrTLV */ 2411 /* Build Metric AddrTLV containing TargAddr metric */ 2412 } 2414 A.3.4. Consume_RREP 2416 /* executed by RREQ_Gen */ 2417 /* TargAddr route table entry was updated by Receive_RREP() */ 2418 Consume_RREP() { 2419 /* Transmit buffered packet(s) (if any) to TargAddr */ 2420 } 2422 A.4. Example Algorithms for AODVv2 RERR Operations 2424 A.4.1. Generate_RERR 2426 Generate_RERR() 2427 { 2428 metric_type := DEFAULT; 2429 switch (error_type) in { 2430 case (broken_link): 2431 num-broken-addr=0 2432 /* find unreachable destinations, seqNums, prefixes */ 2433 for (every rte (route table entry) in route table) { 2434 if (broken_link == rte.next_hop) { 2435 rte.state := broken; 2436 outRERR.LostDest[num-broken-addr] := rte.dest 2437 outRERR.LostSeq[num-broken-addr] := rte.seq# 2438 outRERR.PfxLen[num-broken-addr] := rte.pfx 2439 metric_type := rte.metType 2440 num-broken-addr := (num-broken-addr+1) 2441 } 2442 } 2443 /* No offending-src for this case */ 2444 case (undeliverable packet): 2445 offending-src := undeliverable_packet.srcIP 2446 outRERR.LostDest[] := undeliverable_packet.destIP 2447 outRERR.LostPfxSiz[] := MAX_PFX_SIZE /* 31 or 127 */ 2448 num-broken-addr=1 2449 } 2451 /* build RFC 5444 message header fields */ 2452 { 2453 msg-type=RERR (message is of type RERR) 2454 MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2455 MAL=3 or 15 (Message Address Length [3 for IPv4, 15 for IPv6]) 2456 msg-size=NN (octets -- counting MsgHdr, AddrBlk, and AddrTLVs) 2457 msg-hop-limit := outRERR.hopLim; 2458 if (NULL != offending-src) { 2459 /* Build PktSource Message TLV */ 2460 } 2461 if (metric_type != DEFAULT) { /* Metric_type != HopCount */ 2462 /* Build Metric_type Message TLV */ 2463 } 2464 } 2466 /* build AddrBlk */ 2467 num-addr := num-broken-addr; 2468 AddrBlk := outRERR.LostDest[]; 2470 /* Add AddrBlk Seq# TLV */ 2471 Seq#TLV := outRERR.LostSeq[] 2473 /* only add AddrBlk PfxSiz TLV if prefixes are nondefault */ 2474 for (pfx in outRERR.LostPfx[]) { 2475 if (pfx != Max_Prefix_Size) { /* 31 for IPv4, 127 for IPv6 */ 2476 PfxSizTLV := outRERR.LostPfx[] 2477 return; 2478 } 2479 } 2480 } 2482 A.4.2. Receive_RERR 2483 Receive_RERR (inERR) 2484 { 2485 /* Extract inERR values */ 2486 next_hop := inRERR.nbrIP 2487 offending-src := inRERR.offending-src; /* NULL if not present */ 2489 precursors[] := NULL; 2490 num-broken-addr := 0; 2491 in-broken-addr := 0; 2492 for (IPaddr := inRERR.LostDest[in-broken-addr]) { 2493 rte := Fetch_Route_Table_Entry (dest, metric_type); 2494 if (NULL == rte) { 2495 continue; 2496 } else if (rte.nextHop != inRERR.fromIP) { 2497 continue; 2498 } else if (NULL != rte.precursors) { 2499 /* add rte.precursors to precursors */ 2500 } else if (rte.PfxSiz < inRERR.PfxSiz) { 2501 /*********************************************************** 2502 If the reported prefix from the incoming RERR is *longer* 2503 than the prefix from Route Table, then create a new route 2504 with the longer prefix. 2505 The newly created route will be marked as broken, and used 2506 to regenerate RERR, NOT using shorter the routing prefix. 2507 This avoids unnecessarily invalidating the larger subnet. 2508 **********************************************************/ 2509 rte := Create_Route_Table_Entry (IPaddr, seq#, 2510 metric_type, new_metric, inRERR.PfxSiz); 2511 } 2512 LostDest[num-broken-addr] := rte.Dest; 2513 Seq#[num-broken-addr] := rte.Seq#; 2514 PfxSiz[num-broken-addr] := rte.PfxSiz; 2515 rte.state = broken; 2516 num-broken-addr := (num-broken-addr + 1); 2517 in-broken-addr := (in-broken-addr + 1); 2518 } 2519 if (num-broken-addr > 0) { 2520 Regenerate_RERR (offending-src, precursors, 2521 LostDest[], Seq#[], PfxSiz[]) 2522 } 2523 } 2525 A.4.3. Regenerate_RERR 2526 Regenerate_RERR (offending-src, precursors, 2527 LostDest[], LostSeq#[], PfxSiz[]) 2528 { 2529 /* build RFC 5444 message header fields */ 2530 { 2531 msg-type=RERR (message is of type RERR) 2532 MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2533 MAL=3 or 15 (Message Address Length [3 for IPv4, 15 for IPv6]) 2534 msg-size=NN (octets -- counting MsgHdr, AddrBlk, and AddrTLVs) 2535 outRERR.hopLim := inRERR.hopLim - 1 2536 msg-hop-limit := outRERR.hopLim; 2538 if (NULL != offending-src) { 2539 /* Build PktSource Message TLV */ 2540 } 2541 if (metric_type != DEFAULT) { /* Metric_type != HopCount */ 2542 /* Build Metric_type Message TLV */ 2543 } 2544 } 2546 /* build AddrBlk */ 2547 num-addr := num-broken-addr; 2548 AddrBlk := LostDest[]; 2550 /* Add AddrBlk Seq# TLV */ 2551 Seq#TLV := LostSeq[] 2553 /* only add AddrBlk PfxSiz TLV if prefixes are nondefault */ 2554 for (pfx in PfxSiz[]) { 2555 if (pfx != Max_Prefix_Size) { /* 31 for IPv4, 127 for IPv6 */ 2556 PfxSizTLV := PfxSiz[] 2557 } 2558 } /* If all are default, don't include PfxSize AddrTLV */ 2560 if (#precursors == 1) { 2561 unicast RERR to precursor[0]; 2562 } else if (#precursors > 1) { 2563 multicast RERR to RERR_PRECURSORS; 2564 } else if (offending-src != NULL) { 2565 unicast RERR to offending-src; 2566 } else { 2567 multicast RERR to RERR_PRECURSORS; 2568 } 2569 } 2571 A.5. Example Algorithms for AODVv2 RREP-Ack Operations 2573 A.5.1. Generate_RREP_Ack 2575 /* To be sent when RREP includes the AckReq TLV */ 2576 Generate_RREP_Ack() 2577 { 2578 /* assign RFC 5444 fields */ 2579 msgtype := RREPAck 2580 MF := 0 2581 MAL := 3 2582 msg-size := 4 2583 } 2585 A.5.2. Consume_RREP_Ack 2587 Consume_RREP_Ack() 2588 { 2589 /* turn off timeout event for the node sending RREP_Ack */ 2590 } 2592 A.5.3. Timeout_RREP_Ack 2594 Timeout_RREP_Ack() 2595 { 2596 /* insert unresponsive node into blacklist */ 2597 } 2599 Appendix B. Example RFC 5444-compliant packet formats 2601 The following subsections show example RFC 5444-compliant packets for 2602 AODVv2 message types RREQ, RREP, RERR, and RREP-Ack. These proposed 2603 message formats are designed based on expected savings from IPv6 2604 addressable MANET nodes, and a layout for the Address TLVs that may 2605 be viewed as natural, even if perhaps not the absolute most compact 2606 possible encoding. 2608 For RteMsgs, the msg-hdr fields are followed by at least one and 2609 optionally two Address Blocks. The first AddrBlk contains OrigAddr 2610 and TargAddr. For each AddrBlk, there must be AddrTLVs of type 2611 Metric and one of the SeqNum types (i.e, OrigSeqNum, TargSeqNum, or 2612 Seqnum). 2614 There is no Metric Type Message TLV present, so the Metric AddrTLV 2615 measures HopCount. The Metric AddrTLV also provides a way for the 2616 AODV router generating the RREQ or RREP to supply an initial nonzero 2617 cost for the route to its client node (OrigAddr or TargAddr, for RREQ 2618 or RREP respectively). 2620 In all cases, the length of an address (32 bits for IPv4 and 128 bits 2621 for IPv6) inside an AODVv2 message is indicated by the msg-addr- 2622 length (MAL) in the msg-header, as specified in [RFC5444]. 2624 The RFC 5444 header preceding AODVv2 messages in this document has 2625 the format illustrated in Figure 4. 2627 0 1 2 3 2628 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 2629 +-+-+-+-+-+-+-+-+ 2630 | PV=0 | PF=0 | 2631 +-+-+-+-+-+-+-+-+ 2633 Figure 4: RFC 5444 Packet Header 2635 The fields in Figure 4 are to be interpreted as follows: 2637 o PV=0 (Packet Header Version = 0) 2638 o PF=0 (Packet Flags = 0) 2640 B.1. RREQ Message Format 2642 Figure 5 illustrates an example RREQ message format. 2644 0 1 2 3 2645 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 2646 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2647 | msg-type=RREQ | MF=4 | MAL=3 | msg-size=28 | 2648 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2649 | msg-hop-limit | msg.tlvs-length=0 | num-addr=2 | 2650 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2651 |1|0|0|0|0| Rsv | head-length=3 | Head (bytes for Orig & Target): 2652 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2653 :Head(Orig&Targ)| Orig.Mid | Target.Mid |addr.TLV.len=11: 2654 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2655 :addr.TLV.len=11|type=OrigSeqNum|0|1|0|1|0|0|Rsv| Index-start=0 | 2656 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2657 | tlv-length=2 | Orig.Node Sequence # | type=Metric | 2658 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2659 |0|1|0|1|0|0|Rsv| Index-start=0 | tlv-length=1 | OrigAddrHopCt | 2660 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2662 Figure 5: Example IPv4 RREQ, with OrigSeqNum and Metric AddrTLVs 2664 The fields in Figure 5 are to be interpreted as follows: 2666 o msg-type=RREQ (first [and only] message is of type RREQ) 2667 o MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2668 o MAL=3 (Message Address Length indicator [3 for IPv4, 15 for IPv6]) 2669 o msg-size=28 (octets -- counting MsgHdr, MsgTLVs, and AddrBlks) 2670 o msg-hop-limit (initially MAX_HOPCOUNT by default) 2671 o msg.tlvs-length=0 (no Message TLVs) 2672 o num-addr=2 (OrigAddr and TargAddr in RteMsg AddrBlock) 2673 o AddrBlk flags: 2675 * bit 0 (ahashead): 1 2676 * bit 1 (ahasfulltail): 0 2677 * bit 2 (ahaszerotail): 0 2678 * bit 3 (ahassingleprelen): 0 2679 * bit 4 (ahasmultiprelen): 0 2680 * bits 5-7: RESERVED 2681 o head-length=3 (length of head part of each address is 3 octets) 2682 o Head (3 initial bytes for both Originating & Target addresses) 2683 o Orig.Mid (4th byte of Originating Address) 2684 o Target.Mid (4th byte of Target Address) 2685 o addr.TLV.len = 11 (length in bytes for OrigSeqNum and Metric TLVs 2686 o type=OrigSeqNum (type of first AddrBlk TLV, value 2 octets) 2687 o AddrTLV flags for the OrigSeqNum TLV: 2689 * bit 0 (thastypeext): 0 2690 * bit 1 (thassingleindex): 1 2691 * bit 2 (thasmultiindex): 0 2692 * bit 3 (thasvalue): 1 2693 * bit 4 (thasextlen): 0 2694 * bit 5 (tismultivalue): 0 2695 * bits 6-7: RESERVED 2696 o Index-start=0 (OrigSeqNum TLV value applies at index 0) 2697 o tlv-length=2 (so there is only one TLV value, [1 = 2/2]) 2698 o Orig.Node Sequence # (TLV value for the OrigSeqNum TLV 2699 o type=Metric (AddrTLV type of second AddrBlk TLV, values 1 octet) 2700 o AddrTLV flags for Metric_TLV: 2702 * bit 0 (thastypeext): 0 2703 * bit 1 (thassingleindex): 1 2704 * bit 2 (thasmultiindex): 0 2705 * bit 3 (thasvalue): 1 2706 * bit 4 (thasextlen): 0 2707 * bit 5 (tismultivalue): 0 2708 * bits 6-7: RESERVED 2709 o Index-start=0 (Metric TLV values start at index 0) 2710 o tlv-length=1 (so there is only one TLV value, [1 = 1/1]) 2711 o OrigAddrHopCt (first [and only] TLV value for the Metric TLV) 2713 B.2. RREP Message Format 2715 Figure 6 illustrates a packet format for an example RREP message. 2717 0 1 2 3 2718 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 2719 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2720 | msg-type=RREP | MF=4 | MAL=3 | msg-size=28 | 2721 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2722 | msg-hop-limit | msg.tlvs-length=0 | num-addr=2 | 2723 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2724 |1|0|0|0|0| Rsv | head-length=3 | Head (bytes for Orig & Target): 2725 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2726 :Head(Orig&Targ)| Orig.Mid | Target.Mid |addr.TLV.len=11: 2727 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2728 :addr.TLV.len=11|type=TargSeqNum|0|1|0|1|0|0|Rsv| Index-start=1 | 2729 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2730 | tlv-length=2 | Targ.Node Sequence # | type=Metric | 2731 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2732 |0|1|0|1|0|0|Rsv| Index-start=1 | tlv-length=1 | TargAddrHopCt | 2733 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2735 Figure 6: Example IPv4 RREP, with TargSeqNum TLV and 1 Metric 2737 The fields in Figure 6 are to be interpreted as follows: 2739 o msg-type=RREP (first [and only] message is of type RREP) 2740 o MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2741 o MAL=3 (Message Address Length indicator [3 for IPv4, 15 for IPv6]) 2742 o msg-size=28 (octets -- counting MsgHdr, MsgTLVs, and AddrBlks) 2743 o msg-hop-limit (initially MAX_HOPCOUNT by default) 2744 o msg.tlvs-length=0 (no Message TLVs) 2745 o num-addr=2 (OrigAddr and TargAddr in RteMsg AddrBlock) 2746 o AddrBlk flags: 2748 * bit 0 (ahashead): 1 2749 * bit 1 (ahasfulltail): 0 2750 * bit 2 (ahaszerotail): 0 2751 * bit 3 (ahassingleprelen): 0 2752 * bit 4 (ahasmultiprelen): 0 2753 * bits 5-7: RESERVED 2754 o head-length=3 (length of head part of each address is 3 octets) 2755 o Head (3 initial bytes for both Originating & Target addresses) 2756 o Orig.Mid (4th byte of Originating Address) 2757 o Target.Mid (4th byte of Target Address) 2758 o addr.TLV.len = 11 (length in bytes for TargSeqNum TLV and Metric 2759 TLV 2760 o type=TargSeqNum (type of first AddrBlk TLV, value 2 octets) 2761 o AddrTLV flags for the TargSeqNum TLV: 2763 * bit 0 (thastypeext): 0 2764 * bit 1 (thassingleindex): 1 2765 * bit 2 (thasmultiindex): 0 2766 * bit 3 (thasvalue): 1 2767 * bit 4 (thasextlen): 0 2768 * bit 5 (tismultivalue): 0 2769 * bits 6-7: RESERVED 2770 o Index-start=1 (TargSeqNum TLV value applies to address at index 1) 2771 o tlv-length=2 (there is one TLV value, 2 bytes in length) 2772 o Targ.Node Sequence # (value for the TargSeqNum TLV) 2773 o type=Metric (AddrTLV type of second AddrBlk TLV, value 1 octet) 2774 o AddrTLV flags for the Metric TLV [01010000, same as for TargSeqNum 2775 TLV] 2776 o Index-start=1 (Metric TLV values start at index 1) 2777 o tlv-length=1 (there is one TLV value, 1 byte in length) 2778 o TargAddrHopCt (first [and only] TLV value for Metric TLV) 2780 B.3. RERR Message Format 2782 Figure 7 illustrates an example RERR message format. 2784 0 1 2 3 2785 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 2786 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2787 | msg-type=RERR | MF=4 | MAL=3 | msg-size=24 | 2788 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2789 | msg-hop-limit | msg.tlvs-length=0 | num-addr=2 | 2790 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2791 |1|0|0|0|0| Rsv | head-length=3 | Head (for both destinations) : 2792 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2793 :Head (3rd byte)| Mid (Dest_1) | Mid (Dest_2) | addr.TLV.len=7: 2794 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2795 :addr.TLV.len=7 | type=SeqNum |0|0|1|1|0|1|Rsv| tlv-length=4 | 2796 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2797 | Dest_1 Sequence # | Dest_2 Sequence # | 2798 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2800 Figure 7: Example IPv4 RERR with Two Unreachable Addresses 2802 The fields in Figure 7 are to be interpreted as follows: 2804 o msg-type=RERR (first [and only] message is of type RERR) 2805 o MF=4 (Message Flags = 4 [only msg-hop-limit field is present]) 2806 o MAL=3 (Message Address Length indicator [3 for IPv4, 15 for IPv6]) 2807 o msg-size=24 (octets -- counting MsgHdr, MsgTLVs, and AddrBlks) 2808 o msg-hop-limit (initially MAX_HOPCOUNT by default) 2809 o msg.tlvs-length=0 (no Message TLVs) 2810 o num-addr=2 (OrigAddr and TargAddr in RteMsg AddrBlock) 2811 o AddrBlk flags == 10000000 [same as RREQ and RREP AddrBlk examples] 2812 o head-length=3 (length of head part of each address is 3 octets) 2813 o Head (3 initial bytes for both Unreachable Addresses, Dest_1 and 2814 Dest_2) 2815 o Dest_1.Mid (4th byte of Dest_1 IP address) 2816 o Dest_2.Mid (4th byte of Dest_2 IP address) 2817 o addr.TLV.len = 7 (length in bytes for SeqNum TLV 2818 o type=SeqNum (AddrTLV type of AddrBlk TLV, values 2 octets each) 2819 o AddrTLV flags for SeqNum TLV: 2821 * bit 0 (thastypeext): 0 2822 * bit 1 (thassingleindex): 0 2823 * bit 2 (thasmultiindex): 1 2824 * bit 3 (thasvalue): 1 2825 * bit 4 (thasextlen): 0 2826 * bit 5 (tismultivalue): 1 2827 * bits 6-7: RESERVED 2829 o tlv-length=4 (so there are two TLV values, [2 = 4/2]) 2830 o Dest_1 Sequence # (first of two TLV values for the SeqNum TLV) 2831 o Dest_2 Sequence # (second of two TLV values for the SeqNum TLV) 2833 B.4. RREP_ACK Message Format 2835 The figure below illustrates a packet format for an example RREP_ACK 2836 message. 2838 0 1 2 3 2839 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 2840 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2841 |msgtype=RREPAck| MF=0 | MAL=3 | msg-size=4 | 2842 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2844 Figure 8: Example IPv4 RREP_ACK 2846 Appendix C. Changes since revision ...-05.txt 2848 This section lists the changes since AODVv2 revision ...-05.txt 2850 o Added Lotte Steenbrink as co-author. 2851 o Reorganized section on Metrics to improve readability by putting 2852 specific topics into subsections. 2853 o Introduced concept of data element, which is used to clarify the 2854 method of enabling RFC 5444 representation for AODVv2 data 2855 elements. A list of Data Elements was introduced in section 3, 2856 which provides a better understanding of their role than was 2857 previously supplied by the table of notational devices. 2858 o Replaced instances of OrigNode by OrigAddr whenever the more 2859 specific meaning is appropriate. Similarly for instances of other 2860 node versus address terminology. 2861 o Introduced concepts of PrefixLengthList and MetricList in order to 2862 avoid use of index-based terminology such as OrigNdx and TargNdx. 2863 o Added section 5, "AODVv2 Message Transmission", describing the 2864 intended interface to RFC 5444. 2865 o Included within the main body of the specification the mandatory 2866 setting of the TLV flag thassingleindex for TLVs OrigSeqNum and 2867 TargSeqNum. 2868 o Removed the Route.Timed state. Created a new flag for route table 2869 entries known as Route.Timed. This flag can be set when the route 2870 is in the active state. Previous description would require that 2871 the route table entry be in two states at the same time, which 2872 seems to be misleading. The new flag is used to clarify other 2873 specification details for Timed routes. 2874 o Created table 3 to show the correspondence between AODVv2 data 2875 elements and RFC 5444 message components. 2876 o Replaced "invalid" terminology by the more specific terms "broken" 2877 or "expired" where appropriate. 2878 o Eliminated the instance of duplicate specification for inclusion 2879 of OrigNode (now, OrigAddr) in the message. 2880 o Corrected the terminology to be Mid instead of Tail for the 2881 trailing address bits of OrigAddr and TargAddr for the example 2882 message formats in the appendices. 2883 o Repaired remaining instances of phraseology that could be 2884 construed as indicating that AODV only supports a single network 2885 interface. 2886 o Numerous editorial improvements and clarifications. 2888 Appendix D. Changes since revision ...-04.txt 2890 This section lists the changes since AODVv2 revision ...-04.txt 2892 o Normative text moved out of definitions into the relevant section 2893 of the body of the specification. 2894 o Editorial improvements and improvements to consistent terminology 2895 were made. Replaced "retransmit" by the slightly more accurate 2896 term "regenerate". 2897 o Issues were resolved as discussed on the mailing list. 2898 o Changed definition of LoopFree as suggested by Kedar Namjoshi and 2899 Richard Trefler to avoid the failure condition that they have 2900 described. In order to make understanding easier, replaced 2901 abstract parameters R1 by RteMsg and R2 by Route to reduce the 2902 level of abstraction when the function LoopFree is discussed. 2903 o Added text to clarify that different metrics may have different 2904 data types and different ranges of acceptable values. 2905 o Added text to section "RteMsg Structure" to emphasize the proper 2906 use of RFC 5444. 2907 o Included within the main body of the specification the mandatory 2908 setting of the TLV flag thassingleindex for TLVs OrigSeqNum and 2909 TargSeqNum. 2910 o Made more extensive use of the AdvRte terminology, in order to 2911 better distinguish between the incoming RREQ or RREP message 2912 (i.e., RteMsg) versus the route advertised by the RteMsg (i.e., 2913 AdvRte). 2915 Appendix E. Changes since revision ...-03.txt 2917 This section lists the changes since AODVv2 revision ...-03.txt 2919 o An appendix was added to exhibit algorithmic code for 2920 implementation of AODVv2 functions. 2921 o Numerous editorial improvements and improvements to consistent 2922 terminology were made. Terminology related to prefix lengths was 2923 made consistent. Some items listed in "Notational Conventions" 2924 were no longer used, and so deleted. 2925 o Issues were resolved as discussed on the mailing list. 2926 o Appropriate instances of "may" were changed to "MAY". 2927 o Definition inserted for "upstream". 2928 o Route.Precursors included as an *optional* route table field 2929 o Reworded text to avoid use of "relevant". 2930 o Deleted references to "DestOnly" flag. 2931 o Refined statements about Metric Type TLV to allow for omission 2932 when Metric Type == HopCount. 2933 o Bulletized list in section 8.1 2934 o ENABLE_IDLE_UNREACHABLE renamed to be ENABLE_IDLE_IN_RERR 2935 o Transmission and subscription to LL-MANET-Routers converted to 2936 MUST from SHOULD. 2938 Appendix F. Changes since revision ...-02.txt 2940 This section lists the changes since AODVv2 revision ...-02.txt 2942 o The "Added Node" feature was removed. This feature was intended 2943 to enable additional routing information to be carried within a 2944 RREQ or a RREP message, thus increasing the amount of topological 2945 information available to nodes along a routing path. However, 2946 enlarging the packet size to include information which might never 2947 be used can increase congestion of the wireless medium. The 2948 feature can be included as an optional feature at a later date 2949 when better algorithms are understood for determining when the 2950 inclusion of additional routing information might be worthwhile. 2951 o Numerous editorial improvements and improvements to consistent 2952 terminology were made. Instances of OrigNodeNdx and TargNodeNdx 2953 were replaced by OrigNdx and TargNdx, to be consistent with the 2954 terminology shown in Table 2. 2955 o Example RREQ and RREP message formats shown in the Appendices were 2956 changed to use OrigSeqNum and TargSeqNum message TLVs instead of 2957 using the SeqNum message TLV. 2958 o Inclusion of the OrigNode's SeqNum in the RREP message is not 2959 specified. The processing rules for the OrigNode's SeqNum were 2960 incompletely specified in previous versions of the draft, and very 2961 little benefit is foreseen for including that information, since 2962 reverse path forwarding is used for the RREP. 2964 o Additional acknowledgements were included, and contributors names 2965 were alphabetized. 2966 o Definitions in the Terminology section capitalize the term to be 2967 defined. 2968 o Uncited bibliographic entries deleted. 2969 o Ancient "Changes" sections were deleted. 2971 Appendix G. Multi-homing Considerations 2973 Multi-homing is not supported by the AODVv2 specification. There has 2974 been previous work indicating that it can be supported by expanding 2975 the sequence number to include the AODVv2 router's IP address as a 2976 parsable field of the SeqNum. Otherwise, comparing sequence numbers 2977 would not work to evaluate freshness. Even when the IP address is 2978 included, there isn't a good way to compare sequence numbers from 2979 different IP addresses, but at least a handling node can determine 2980 whether the two given sequence numbers are comparable. If the route 2981 table can store multiple routes for the same destination, then multi- 2982 homing can work with sequence numbers augmented by IP addresses. 2984 This non-normative information is provided simply to document the 2985 results of previous efforts to enable multi-homing. The intention is 2986 to simplify the task of future specification if multihoming becomes 2987 needed for reactive protocol operation. 2989 Appendix H. Shifting Network Prefix Advertisement Between AODVv2 2990 Routers 2992 Only one AODVv2 router within a MANET SHOULD be responsible for a 2993 particular address at any time. If two AODVv2 routers dynamically 2994 shift the advertisement of a network prefix, correct AODVv2 routing 2995 behavior must be observed. The AODVv2 router adding the new network 2996 prefix must wait for any existing routing information about this 2997 network prefix to be purged from the network. Therefore, it must 2998 wait at least ROUTER_SEQNUM_AGE_MAX_TIMEOUT after the previous AODVv2 2999 router for this address stopped advertising routing information on 3000 its behalf. 3002 Authors' Addresses 3004 Charles E. Perkins 3005 Futurewei Inc. 3006 2330 Central Expressway 3007 Santa Clara, CA 95050 3008 USA 3010 Phone: +1-408-330-4586 3011 Email: charliep@computer.org 3012 Stan Ratliff 3013 Idirect 3014 13861 Sunrise Valley Drive, Suite 300 3015 Herndon, VA 20171 3016 USA 3018 Email: ratliffstan@gmail.com 3020 John Dowdell 3021 Airbus Defence and Space 3022 Celtic Springs 3023 Newport, Wales NP10 8FZ 3024 United Kingdom 3026 Email: john.dowdell486@gmail.com 3028 Lotte Steenbrink 3029 HAW Hamburg, Dept. Informatik 3030 Berliner Tor 7 3031 D-20099 Hamburg 3032 Germany 3034 Email: lotte.steenbrink@haw-hamburg.de