-
Notifications
You must be signed in to change notification settings - Fork 46
/
rfc3561.txt
2075 lines (1442 loc) · 88.2 KB
/
rfc3561.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Network Working Group C. Perkins
Request for Comments: 3561 Nokia Research Center
Category: Experimental E. Belding-Royer
University of California, Santa Barbara
S. Das
University of Cincinnati
July 2003
Ad hoc On-Demand Distance Vector (AODV) Routing
Status of this Memo
This memo defines an Experimental Protocol for the Internet
community. It does not specify an Internet standard of any kind.
Discussion and suggestions for improvement are requested.
Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2003). All Rights Reserved.
Abstract
The Ad hoc On-Demand Distance Vector (AODV) routing protocol is
intended for use by mobile nodes in an ad hoc network. It offers
quick adaptation to dynamic link conditions, low processing and
memory overhead, low network utilization, and determines unicast
routes to destinations within the ad hoc network. It uses
destination sequence numbers to ensure loop freedom at all times
(even in the face of anomalous delivery of routing control messages),
avoiding problems (such as "counting to infinity") associated with
classical distance vector protocols.
Table of Contents
1. Introduction ............................................... 2
2. Overview .................................................. 3
3. AODV Terminology ........................................... 4
4. Applicability Statement .................................... 6
5. Message Formats ............................................ 7
5.1. Route Request (RREQ) Message Format ................... 7
5.2. Route Reply (RREP) Message Format ..................... 8
5.3. Route Error (RERR) Message Format ..................... 10
5.4. Route Reply Acknowledgment (RREP-ACK) Message Format .. 11
6. AODV Operation ............................................. 11
6.1. Maintaining Sequence Numbers .......................... 11
6.2. Route Table Entries and Precursor Lists ............... 13
Perkins, et. al. Experimental [Page 1]
RFC 3561 AODV Routing July 2003
6.3. Generating Route Requests ............................. 14
6.4. Controlling Dissemination of Route Request Messages ... 15
6.5. Processing and Forwarding Route Requests .............. 16
6.6. Generating Route Replies .............................. 18
6.6.1. Route Reply Generation by the Destination ...... 18
6.6.2. Route Reply Generation by an Intermediate
Node ........................................... 19
6.6.3. Generating Gratuitous RREPs .................... 19
6.7. Receiving and Forwarding Route Replies ................ 20
6.8. Operation over Unidirectional Links ................... 21
6.9. Hello Messages ........................................ 22
6.10 Maintaining Local Connectivity ........................ 23
6.11 Route Error (RERR) Messages, Route Expiry and Route
Deletion .............................................. 24
6.12 Local Repair .......................................... 26
6.13 Actions After Reboot ................................. 27
6.14 Interfaces ............................................ 28
7. AODV and Aggregated Networks ............................... 28
8. Using AODV with Other Networks ............................. 29
9. Extensions ................................................. 30
9.1. Hello Interval Extension Format ....................... 30
10. Configuration Parameters ................................... 31
11. Security Considerations .................................... 33
12. IANA Considerations ........................................ 34
13. IPv6 Considerations ........................................ 34
14. Acknowledgments ............................................ 34
15. Normative References ....................................... 35
16. Informative References ..................................... 35
17. Authors' Addresses ......................................... 36
18. Full Copyright Statement ................................... 37
1. Introduction
The Ad hoc On-Demand Distance Vector (AODV) algorithm enables
dynamic, self-starting, multihop routing between participating mobile
nodes wishing to establish and maintain an ad hoc network. AODV
allows mobile nodes to obtain routes quickly for new destinations,
and does not require nodes to maintain routes to destinations that
are not in active communication. AODV allows mobile nodes to respond
to link breakages and changes in network topology in a timely manner.
The operation of AODV is loop-free, and by avoiding the Bellman-Ford
"counting to infinity" problem offers quick convergence when the ad
hoc network topology changes (typically, when a node moves in the
network). When links break, AODV causes the affected set of nodes to
be notified so that they are able to invalidate the routes using the
lost link.
Perkins, et. al. Experimental [Page 2]
RFC 3561 AODV Routing July 2003
One distinguishing feature of AODV is its use of a destination
sequence number for each route entry. The destination sequence
number is created by the destination to be included along with any
route information it sends to requesting nodes. Using destination
sequence numbers ensures loop freedom and is simple to program.
Given the choice between two routes to a destination, a requesting
node is required to select the one with the greatest sequence number.
2. Overview
Route Requests (RREQs), Route Replies (RREPs), and Route Errors
(RERRs) are the message types defined by AODV. These message types
are received via UDP, and normal IP header processing applies. So,
for instance, the requesting node is expected to use its IP address
as the Originator IP address for the messages. For broadcast
messages, the IP limited broadcast address (255.255.255.255) is used.
This means that such messages are not blindly forwarded. However,
AODV operation does require certain messages (e.g., RREQ) to be
disseminated widely, perhaps throughout the ad hoc network. The
range of dissemination of such RREQs is indicated by the TTL in the
IP header. Fragmentation is typically not required.
As long as the endpoints of a communication connection have valid
routes to each other, AODV does not play any role. When a route to a
new destination is needed, the node broadcasts a RREQ to find a route
to the destination. A route can be determined when the RREQ reaches
either the destination itself, or an intermediate node with a 'fresh
enough' route to the destination. A 'fresh enough' route is a valid
route entry for the destination whose associated sequence number is
at least as great as that contained in the RREQ. The route is made
available by unicasting a RREP back to the origination of the RREQ.
Each node receiving the request caches a route back to the originator
of the request, so that the RREP can be unicast from the destination
along a path to that originator, or likewise from any intermediate
node that is able to satisfy the request.
Nodes monitor the link status of next hops in active routes. When a
link break in an active route is detected, a RERR message is used to
notify other nodes that the loss of that link has occurred. The RERR
message indicates those destinations (possibly subnets) which are no
longer reachable by way of the broken link. In order to enable this
reporting mechanism, each node keeps a "precursor list", containing
the IP address for each its neighbors that are likely to use it as a
next hop towards each destination. The information in the precursor
lists is most easily acquired during the processing for generation of
a RREP message, which by definition has to be sent to a node in a
precursor list (see section 6.6). If the RREP has a nonzero prefix
Perkins, et. al. Experimental [Page 3]
RFC 3561 AODV Routing July 2003
length, then the originator of the RREQ which solicited the RREP
information is included among the precursors for the subnet route
(not specifically for the particular destination).
A RREQ may also be received for a multicast IP address. In this
document, full processing for such messages is not specified. For
example, the originator of such a RREQ for a multicast IP address may
have to follow special rules. However, it is important to enable
correct multicast operation by intermediate nodes that are not
enabled as originating or destination nodes for IP multicast
addresses, and likewise are not equipped for any special multicast
protocol processing. For such multicast-unaware nodes, processing
for a multicast IP address as a destination IP address MUST be
carried out in the same way as for any other destination IP address.
AODV is a routing protocol, and it deals with route table management.
Route table information must be kept even for short-lived routes,
such as are created to temporarily store reverse paths towards nodes
originating RREQs. AODV uses the following fields with each route
table entry:
- Destination IP Address
- Destination Sequence Number
- Valid Destination Sequence Number flag
- Other state and routing flags (e.g., valid, invalid, repairable,
being repaired)
- Network Interface
- Hop Count (number of hops needed to reach destination)
- Next Hop
- List of Precursors (described in Section 6.2)
- Lifetime (expiration or deletion time of the route)
Managing the sequence number is crucial to avoiding routing loops,
even when links break and a node is no longer reachable to supply its
own information about its sequence number. A destination becomes
unreachable when a link breaks or is deactivated. When these
conditions occur, the route is invalidated by operations involving
the sequence number and marking the route table entry state as
invalid. See section 6.1 for details.
3. AODV Terminology
This protocol specification uses conventional meanings [1] for
capitalized words such as MUST, SHOULD, etc., to indicate requirement
levels for various protocol features. This section defines other
terminology used with AODV that is not already defined in [3].
Perkins, et. al. Experimental [Page 4]
RFC 3561 AODV Routing July 2003
active route
A route towards a destination that has a routing table entry
that is marked as valid. Only active routes can be used to
forward data packets.
broadcast
Broadcasting means transmitting to the IP Limited Broadcast
address, 255.255.255.255. A broadcast packet may not be
blindly forwarded, but broadcasting is useful to enable
dissemination of AODV messages throughout the ad hoc network.
destination
An IP address to which data packets are to be transmitted.
Same as "destination node". A node knows it is the destination
node for a typical data packet when its address appears in the
appropriate field of the IP header. Routes for destination
nodes are supplied by action of the AODV protocol, which
carries the IP address of the desired destination node in route
discovery messages.
forwarding node
A node that agrees to forward packets destined for another
node, by retransmitting them to a next hop that is closer to
the unicast destination along a path that has been set up using
routing control messages.
forward route
A route set up to send data packets from a node originating a
Route Discovery operation towards its desired destination.
invalid route
A route that has expired, denoted by a state of invalid in the
routing table entry. An invalid route is used to store
previously valid route information for an extended period of
time. An invalid route cannot be used to forward data packets,
but it can provide information useful for route repairs, and
also for future RREQ messages.
Perkins, et. al. Experimental [Page 5]
RFC 3561 AODV Routing July 2003
originating node
A node that initiates an AODV route discovery message to be
processed and possibly retransmitted by other nodes in the ad
hoc network. For instance, the node initiating a Route
Discovery process and broadcasting the RREQ message is called
the originating node of the RREQ message.
reverse route
A route set up to forward a reply (RREP) packet back to the
originator from the destination or from an intermediate node
having a route to the destination.
sequence number
A monotonically increasing number maintained by each
originating node. In AODV routing protocol messages, it is
used by other nodes to determine the freshness of the
information contained from the originating node.
valid route
See active route.
4. Applicability Statement
The AODV routing protocol is designed for mobile ad hoc networks with
populations of tens to thousands of mobile nodes. AODV can handle
low, moderate, and relatively high mobility rates, as well as a
variety of data traffic levels. AODV is designed for use in networks
where the nodes can all trust each other, either by use of
preconfigured keys, or because it is known that there are no
malicious intruder nodes. AODV has been designed to reduce the
dissemination of control traffic and eliminate overhead on data
traffic, in order to improve scalability and performance.
Perkins, et. al. Experimental [Page 6]
RFC 3561 AODV Routing July 2003
5. Message Formats
5.1. Route Request (RREQ) Message Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |J|R|G|D|U| Reserved | Hop Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RREQ ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination IP Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator IP Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The format of the Route Request message is illustrated above, and
contains the following fields:
Type 1
J Join flag; reserved for multicast.
R Repair flag; reserved for multicast.
G Gratuitous RREP flag; indicates whether a
gratuitous RREP should be unicast to the node
specified in the Destination IP Address field (see
sections 6.3, 6.6.3).
D Destination only flag; indicates only the
destination may respond to this RREQ (see
section 6.5).
U Unknown sequence number; indicates the destination
sequence number is unknown (see section 6.3).
Reserved Sent as 0; ignored on reception.
Hop Count The number of hops from the Originator IP Address
to the node handling the request.
Perkins, et. al. Experimental [Page 7]
RFC 3561 AODV Routing July 2003
RREQ ID A sequence number uniquely identifying the
particular RREQ when taken in conjunction with the
originating node's IP address.
Destination IP Address
The IP address of the destination for which a route
is desired.
Destination Sequence Number
The latest sequence number received in the past
by the originator for any route towards the
destination.
Originator IP Address
The IP address of the node which originated the
Route Request.
Originator Sequence Number
The current sequence number to be used in the route
entry pointing towards the originator of the route
request.
5.2. Route Reply (RREP) Message Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |R|A| Reserved |Prefix Sz| Hop Count |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination IP address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator IP address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The format of the Route Reply message is illustrated above, and
contains the following fields:
Type 2
R Repair flag; used for multicast.
A Acknowledgment required; see sections 5.4 and 6.7.
Reserved Sent as 0; ignored on reception.
Perkins, et. al. Experimental [Page 8]
RFC 3561 AODV Routing July 2003
Prefix Size If nonzero, the 5-bit Prefix Size specifies that the
indicated next hop may be used for any nodes with
the same routing prefix (as defined by the Prefix
Size) as the requested destination.
Hop Count The number of hops from the Originator IP Address
to the Destination IP Address. For multicast route
requests this indicates the number of hops to the
multicast tree member sending the RREP.
Destination IP Address
The IP address of the destination for which a route
is supplied.
Destination Sequence Number
The destination sequence number associated to the
route.
Originator IP Address
The IP address of the node which originated the RREQ
for which the route is supplied.
Lifetime The time in milliseconds for which nodes receiving
the RREP consider the route to be valid.
Note that the Prefix Size allows a subnet router to supply a route
for every host in the subnet defined by the routing prefix, which is
determined by the IP address of the subnet router and the Prefix
Size. In order to make use of this feature, the subnet router has to
guarantee reachability to all the hosts sharing the indicated subnet
prefix. See section 7 for details. When the prefix size is nonzero,
any routing information (and precursor data) MUST be kept with
respect to the subnet route, not the individual destination IP
address on that subnet.
The 'A' bit is used when the link over which the RREP message is sent
may be unreliable or unidirectional. When the RREP message contains
the 'A' bit set, the receiver of the RREP is expected to return a
RREP-ACK message. See section 6.8.
Perkins, et. al. Experimental [Page 9]
RFC 3561 AODV Routing July 2003
5.3. Route Error (RERR) Message Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type |N| Reserved | DestCount |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Unreachable Destination IP Address (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Unreachable Destination Sequence Number (1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-|
| Additional Unreachable Destination IP Addresses (if needed) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Additional Unreachable Destination Sequence Numbers (if needed)|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The format of the Route Error message is illustrated above, and
contains the following fields:
Type 3
N No delete flag; set when a node has performed a local
repair of a link, and upstream nodes should not delete
the route.
Reserved Sent as 0; ignored on reception.
DestCount The number of unreachable destinations included in the
message; MUST be at least 1.
Unreachable Destination IP Address
The IP address of the destination that has become
unreachable due to a link break.
Unreachable Destination Sequence Number
The sequence number in the route table entry for
the destination listed in the previous Unreachable
Destination IP Address field.
The RERR message is sent whenever a link break causes one or more
destinations to become unreachable from some of the node's neighbors.
See section 6.2 for information about how to maintain the appropriate
records for this determination, and section 6.11 for specification
about how to create the list of destinations.
Perkins, et. al. Experimental [Page 10]
RFC 3561 AODV Routing July 2003
5.4. Route Reply Acknowledgment (RREP-ACK) Message Format
The Route Reply Acknowledgment (RREP-ACK) message MUST be sent in
response to a RREP message with the 'A' bit set (see section 5.2).
This is typically done when there is danger of unidirectional links
preventing the completion of a Route Discovery cycle (see section
6.8).
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Type 4
Reserved Sent as 0; ignored on reception.
6. AODV Operation
This section describes the scenarios under which nodes generate Route
Request (RREQ), Route Reply (RREP) and Route Error (RERR) messages
for unicast communication towards a destination, and how the message
data are handled. In order to process the messages correctly,
certain state information has to be maintained in the route table
entries for the destinations of interest.
All AODV messages are sent to port 654 using UDP.
6.1. Maintaining Sequence Numbers
Every route table entry at every node MUST include the latest
information available about the sequence number for the IP address of
the destination node for which the route table entry is maintained.
This sequence number is called the "destination sequence number". It
is updated whenever a node receives new (i.e., not stale) information
about the sequence number from RREQ, RREP, or RERR messages that may
be received related to that destination. AODV depends on each node
in the network to own and maintain its destination sequence number to
guarantee the loop-freedom of all routes towards that node. A
destination node increments its own sequence number in two
circumstances:
- Immediately before a node originates a route discovery, it MUST
increment its own sequence number. This prevents conflicts with
previously established reverse routes towards the originator of a
RREQ.
Perkins, et. al. Experimental [Page 11]
RFC 3561 AODV Routing July 2003
- Immediately before a destination node originates a RREP in
response to a RREQ, it MUST update its own sequence number to the
maximum of its current sequence number and the destination
sequence number in the RREQ packet.
When the destination increments its sequence number, it MUST do so by
treating the sequence number value as if it were an unsigned number.
To accomplish sequence number rollover, if the sequence number has
already been assigned to be the largest possible number representable
as a 32-bit unsigned integer (i.e., 4294967295), then when it is
incremented it will then have a value of zero (0). On the other
hand, if the sequence number currently has the value 2147483647,
which is the largest possible positive integer if 2's complement
arithmetic is in use with 32-bit integers, the next value will be
2147483648, which is the most negative possible integer in the same
numbering system. The representation of negative numbers is not
relevant to the increment of AODV sequence numbers. This is in
contrast to the manner in which the result of comparing two AODV
sequence numbers is to be treated (see below).
In order to ascertain that information about a destination is not
stale, the node compares its current numerical value for the sequence
number with that obtained from the incoming AODV message. This
comparison MUST be done using signed 32-bit arithmetic, this is
necessary to accomplish sequence number rollover. If the result of
subtracting the currently stored sequence number from the value of
the incoming sequence number is less than zero, then the information
related to that destination in the AODV message MUST be discarded,
since that information is stale compared to the node's currently
stored information.
The only other circumstance in which a node may change the
destination sequence number in one of its route table entries is in
response to a lost or expired link to the next hop towards that
destination. The node determines which destinations use a particular
next hop by consulting its routing table. In this case, for each
destination that uses the next hop, the node increments the sequence
number and marks the route as invalid (see also sections 6.11, 6.12).
Whenever any fresh enough (i.e., containing a sequence number at
least equal to the recorded sequence number) routing information for
an affected destination is received by a node that has marked that
route table entry as invalid, the node SHOULD update its route table
information according to the information contained in the update.
Perkins, et. al. Experimental [Page 12]
RFC 3561 AODV Routing July 2003
A node may change the sequence number in the routing table entry of a
destination only if:
- it is itself the destination node, and offers a new route to
itself, or
- it receives an AODV message with new information about the
sequence number for a destination node, or
- the path towards the destination node expires or breaks.
6.2. Route Table Entries and Precursor Lists
When a node receives an AODV control packet from a neighbor, or
creates or updates a route for a particular destination or subnet, it
checks its route table for an entry for the destination. In the
event that there is no corresponding entry for that destination, an
entry is created. The sequence number is either determined from the
information contained in the control packet, or else the valid
sequence number field is set to false. The route is only updated if
the new sequence number is either
(i) higher than the destination sequence number in the route
table, or
(ii) the sequence numbers are equal, but the hop count (of the
new information) plus one, is smaller than the existing hop
count in the routing table, or
(iii) the sequence number is unknown.
The Lifetime field of the routing table entry is either determined
from the control packet, or it is initialized to
ACTIVE_ROUTE_TIMEOUT. This route may now be used to send any queued
data packets and fulfills any outstanding route requests.
Each time a route is used to forward a data packet, its Active Route
Lifetime field of the source, destination and the next hop on the
path to the destination is updated to be no less than the current
time plus ACTIVE_ROUTE_TIMEOUT. Since the route between each
originator and destination pair is expected to be symmetric, the
Active Route Lifetime for the previous hop, along the reverse path
back to the IP source, is also updated to be no less than the current
time plus ACTIVE_ROUTE_TIMEOUT. The lifetime for an Active Route is
updated each time the route is used regardless of whether the
destination is a single node or a subnet.
Perkins, et. al. Experimental [Page 13]
RFC 3561 AODV Routing July 2003
For each valid route maintained by a node as a routing table entry,
the node also maintains a list of precursors that may be forwarding
packets on this route. These precursors will receive notifications
from the node in the event of detection of the loss of the next hop
link. The list of precursors in a routing table entry contains those
neighboring nodes to which a route reply was generated or forwarded.
6.3. Generating Route Requests
A node disseminates a RREQ when it determines that it needs a route
to a destination and does not have one available. This can happen if
the destination is previously unknown to the node, or if a previously
valid route to the destination expires or is marked as invalid. The
Destination Sequence Number field in the RREQ message is the last
known destination sequence number for this destination and is copied
from the Destination Sequence Number field in the routing table. If
no sequence number is known, the unknown sequence number flag MUST be
set. The Originator Sequence Number in the RREQ message is the
node's own sequence number, which is incremented prior to insertion
in a RREQ. The RREQ ID field is incremented by one from the last
RREQ ID used by the current node. Each node maintains only one RREQ
ID. The Hop Count field is set to zero.
Before broadcasting the RREQ, the originating node buffers the RREQ
ID and the Originator IP address (its own address) of the RREQ for
PATH_DISCOVERY_TIME. In this way, when the node receives the packet
again from its neighbors, it will not reprocess and re-forward the
packet.
An originating node often expects to have bidirectional
communications with a destination node. In such cases, it is not
sufficient for the originating node to have a route to the
destination node; the destination must also have a route back to the
originating node. In order for this to happen as efficiently as
possible, any generation of a RREP by an intermediate node (as in
section 6.6) for delivery to the originating node SHOULD be
accompanied by some action that notifies the destination about a
route back to the originating node. The originating node selects
this mode of operation in the intermediate nodes by setting the 'G'
flag. See section 6.6.3 for details about actions taken by the
intermediate node in response to a RREQ with the 'G' flag set.
A node SHOULD NOT originate more than RREQ_RATELIMIT RREQ messages
per second. After broadcasting a RREQ, a node waits for a RREP (or
other control message with current information regarding a route to
the appropriate destination). If a route is not received within
NET_TRAVERSAL_TIME milliseconds, the node MAY try again to discover a
route by broadcasting another RREQ, up to a maximum of RREQ_RETRIES
Perkins, et. al. Experimental [Page 14]
RFC 3561 AODV Routing July 2003
times at the maximum TTL value. Each new attempt MUST increment and
update the RREQ ID. For each attempt, the TTL field of the IP header
is set according to the mechanism specified in section 6.4, in order
to enable control over how far the RREQ is disseminated for the each
retry.
Data packets waiting for a route (i.e., waiting for a RREP after a
RREQ has been sent) SHOULD be buffered. The buffering SHOULD be
"first-in, first-out" (FIFO). If a route discovery has been
attempted RREQ_RETRIES times at the maximum TTL without receiving any
RREP, all data packets destined for the corresponding destination
SHOULD be dropped from the buffer and a Destination Unreachable
message SHOULD be delivered to the application.
To reduce congestion in a network, repeated attempts by a source node
at route discovery for a single destination MUST utilize a binary
exponential backoff. The first time a source node broadcasts a RREQ,
it waits NET_TRAVERSAL_TIME milliseconds for the reception of a RREP.
If a RREP is not received within that time, the source node sends a
new RREQ. When calculating the time to wait for the RREP after
sending the second RREQ, the source node MUST use a binary
exponential backoff. Hence, the waiting time for the RREP
corresponding to the second RREQ is 2 * NET_TRAVERSAL_TIME
milliseconds. If a RREP is not received within this time period,
another RREQ may be sent, up to RREQ_RETRIES additional attempts
after the first RREQ. For each additional attempt, the waiting time
for the RREP is multiplied by 2, so that the time conforms to a
binary exponential backoff.
6.4. Controlling Dissemination of Route Request Messages
To prevent unnecessary network-wide dissemination of RREQs, the
originating node SHOULD use an expanding ring search technique. In
an expanding ring search, the originating node initially uses a TTL =
TTL_START in the RREQ packet IP header and sets the timeout for
receiving a RREP to RING_TRAVERSAL_TIME milliseconds.
RING_TRAVERSAL_TIME is calculated as described in section 10. The
TTL_VALUE used in calculating RING_TRAVERSAL_TIME is set equal to the
value of the TTL field in the IP header. If the RREQ times out
without a corresponding RREP, the originator broadcasts the RREQ
again with the TTL incremented by TTL_INCREMENT. This continues
until the TTL set in the RREQ reaches TTL_THRESHOLD, beyond which a
TTL = NET_DIAMETER is used for each attempt. Each time, the timeout
for receiving a RREP is RING_TRAVERSAL_TIME. When it is desired to
have all retries traverse the entire ad hoc network, this can be
achieved by configuring TTL_START and TTL_INCREMENT both to be the
same value as NET_DIAMETER.
Perkins, et. al. Experimental [Page 15]
RFC 3561 AODV Routing July 2003
The Hop Count stored in an invalid routing table entry indicates the
last known hop count to that destination in the routing table. When
a new route to the same destination is required at a later time
(e.g., upon route loss), the TTL in the RREQ IP header is initially
set to the Hop Count plus TTL_INCREMENT. Thereafter, following each
timeout the TTL is incremented by TTL_INCREMENT until TTL =
TTL_THRESHOLD is reached. Beyond this TTL = NET_DIAMETER is used.
Once TTL = NET_DIAMETER, the timeout for waiting for the RREP is set
to NET_TRAVERSAL_TIME, as specified in section 6.3.
An expired routing table entry SHOULD NOT be expunged before
(current_time + DELETE_PERIOD) (see section 6.11). Otherwise, the
soft state corresponding to the route (e.g., last known hop count)
will be lost. Furthermore, a longer routing table entry expunge time
MAY be configured. Any routing table entry waiting for a RREP SHOULD
NOT be expunged before (current_time + 2 * NET_TRAVERSAL_TIME).
6.5. Processing and Forwarding Route Requests
When a node receives a RREQ, it first creates or updates a route to
the previous hop without a valid sequence number (see section 6.2)
then checks to determine whether it has received a RREQ with the same
Originator IP Address and RREQ ID within at least the last
PATH_DISCOVERY_TIME. If such a RREQ has been received, the node
silently discards the newly received RREQ. The rest of this
subsection describes actions taken for RREQs that are not discarded.
First, it first increments the hop count value in the RREQ by one, to
account for the new hop through the intermediate node. Then the node
searches for a reverse route to the Originator IP Address (see
section 6.2), using longest-prefix matching. If need be, the route
is created, or updated using the Originator Sequence Number from the
RREQ in its routing table. This reverse route will be needed if the
node receives a RREP back to the node that originated the RREQ
(identified by the Originator IP Address). When the reverse route is
created or updated, the following actions on the route are also
carried out:
1. the Originator Sequence Number from the RREQ is compared to the
corresponding destination sequence number in the route table entry
and copied if greater than the existing value there
2. the valid sequence number field is set to true;
3. the next hop in the routing table becomes the node from which the
RREQ was received (it is obtained from the source IP address in
the IP header and is often not equal to the Originator IP Address
field in the RREQ message);
Perkins, et. al. Experimental [Page 16]
RFC 3561 AODV Routing July 2003
4. the hop count is copied from the Hop Count in the RREQ message;
Whenever a RREQ message is received, the Lifetime of the reverse
route entry for the Originator IP address is set to be the maximum of
(ExistingLifetime, MinimalLifetime), where
MinimalLifetime = (current time + 2*NET_TRAVERSAL_TIME -
2*HopCount*NODE_TRAVERSAL_TIME).
The current node can use the reverse route to forward data packets in
the same way as for any other route in the routing table.
If a node does not generate a RREP (following the processing rules in
section 6.6), and if the incoming IP header has TTL larger than 1,
the node updates and broadcasts the RREQ to address 255.255.255.255
on each of its configured interfaces (see section 6.14). To update
the RREQ, the TTL or hop limit field in the outgoing IP header is
decreased by one, and the Hop Count field in the RREQ message is
incremented by one, to account for the new hop through the
intermediate node. Lastly, the Destination Sequence number for the
requested destination is set to the maximum of the corresponding
value received in the RREQ message, and the destination sequence
value currently maintained by the node for the requested destination.
However, the forwarding node MUST NOT modify its maintained value for
the destination sequence number, even if the value received in the
incoming RREQ is larger than the value currently maintained by the
forwarding node.
Otherwise, if a node does generate a RREP, then the node discards the
RREQ. Notice that, if intermediate nodes reply to every transmission
of RREQs for a particular destination, it might turn out that the
destination does not receive any of the discovery messages. In this
situation, the destination does not learn of a route to the
originating node from the RREQ messages. This could cause the
destination to initiate a route discovery (for example, if the
originator is attempting to establish a TCP session). In order that
the destination learn of routes to the originating node, the
originating node SHOULD set the "gratuitous RREP" ('G') flag in the
RREQ if for any reason the destination is likely to need a route to
the originating node. If, in response to a RREQ with the 'G' flag
set, an intermediate node returns a RREP, it MUST also unicast a
gratuitous RREP to the destination node (see section 6.6.3).
Perkins, et. al. Experimental [Page 17]
RFC 3561 AODV Routing July 2003
6.6. Generating Route Replies
A node generates a RREP if either:
(i) it is itself the destination, or
(ii) it has an active route to the destination, the destination
sequence number in the node's existing route table entry
for the destination is valid and greater than or equal to
the Destination Sequence Number of the RREQ (comparison
using signed 32-bit arithmetic), and the "destination only"
('D') flag is NOT set.
When generating a RREP message, a node copies the Destination IP
Address and the Originator Sequence Number from the RREQ message into
the corresponding fields in the RREP message. Processing is slightly
different, depending on whether the node is itself the requested
destination (see section 6.6.1), or instead if it is an intermediate
node with an fresh enough route to the destination (see section
6.6.2).
Once created, the RREP is unicast to the next hop toward the
originator of the RREQ, as indicated by the route table entry for
that originator. As the RREP is forwarded back towards the node
which originated the RREQ message, the Hop Count field is incremented
by one at each hop. Thus, when the RREP reaches the originator, the
Hop Count represents the distance, in hops, of the destination from
the originator.
6.6.1. Route Reply Generation by the Destination
If the generating node is the destination itself, it MUST increment
its own sequence number by one if the sequence number in the RREQ
packet is equal to that incremented value. Otherwise, the
destination does not change its sequence number before generating the
RREP message. The destination node places its (perhaps newly
incremented) sequence number into the Destination Sequence Number
field of the RREP, and enters the value zero in the Hop Count field
of the RREP.
The destination node copies the value MY_ROUTE_TIMEOUT (see section
10) into the Lifetime field of the RREP. Each node MAY reconfigure