[aodvv2-discuss] Re: Review of draft 13a (October 25 edition)

  • From: Victoria Mercieca <vmercieca0@xxxxxxxxx>
  • To: "aodvv2-discuss@xxxxxxxxxxxxx" <aodvv2-discuss@xxxxxxxxxxxxx>
  • Date: Sun, 8 Nov 2015 14:37:44 +0000

Hi John (and Charlie),

Thanks for all the feedback, I've been busy updating. Attached a diff and
draft 13c, and comments in line for important stuff:


On Wed, Nov 4, 2015 at 2:39 AM, John Dowdell <john.dowdell486@xxxxxxxxx>
wrote:

Hi all

So here’s my review of -13a. I’m aware that there is a -13b but since I’m
halfway through -13a it makes sense to carry on. Apologies if I’m raking up
stuff that’s already been addressed.

Section 1. Overview

I’d like to see an extra paragraph between paras 2 and 3 that explains
some more about AODVv2 sending messages that are converted into packets by
the RFC5444 parser. It would make the existing paragraph 3 a bit clearer.
Maybe move the last but one paragraph starting "AODVv2 control plane
messages use the …” to between paras 2 and 3.

The paragraph starting "AODVv2 uses sequence numbers to identify …” is not
compatible with the text at section 4.4 which suggests that loop freedom is
based purely on sequence numbers “As a consequence, loop freedom is
assured”. I think that last sentence should be deleted from section 4.4, or
at least modified to state that sequence numbers form only part of the loop
freedom calculation. While we’re here, the sentence in section 4.4 is also
incompatible with section 5 bullet 5 “A function to analyse routes …”

Last paragraph: I think the word “plane" should be inserted between
“control” and “messages” (to read “control plane messages” since that makes
it consistent with the last but one paragraph (the one I asked to be moved
above).


For consistency, I changed everything to "control message" rather than
"control plane message".

Section 2. Terminology

The definition of Neighbor says "Neighbors exchange routing information
and attempt to verify bidirectionality of the link to a neighbor before
installing a route via that neighbor into the Local Route Set.” It doesn’t
say that if the bidirectionally test fails, we do not install a route via
that neighbor. Possibly just remove the words “attempt to”.

The definition of TargSeqNum says "An AODVv2 Data Element used in a Route
Reply message, containing the sequence number of the AODVv2 router which
originated the Route Reply.” could be reworded to say "An AODVv2 Data
Element used in a Route Reply message, containing a sequence number
generated by the AODVv2 router which originated the Route Reply.”

Section 3: Applicability Statement

I believe the opening sentence should be expanded to briefly illustrate
the differences between AODVv2 as a reactive protocol and the proactive
protocols.

Paragraph 5: “Since the route discovery process typically results …”. I
would suggest replacing “typically results in a route being established”
with “requires a route to be established”

Para 8: I recall the question being asked before (probably by Thomas
Clausen) about whether a single router interface can support multiple IP
addresses. If we do, please say, and if not, please also say.

Section 4.3 Neighbor Table

Definition of Neighbor.ResetTime reads "When the State is Blacklisted,
this time indicates the point at which the State reverts to Unknown. By
default this value is …”. Should this read "When the *value of
Neighbor.State i*s Blacklisted, this time indicates the point at which
the *value of Neighbor.State *reverts to Unknown. By default this value
is …”

Section 4.4 Sequence Numbers

Para 3, last sentence, reads "The value zero (0) is reserved to indicate
that the sequence number for an address is unknown.”. Should this read "The
value zero (0) is reserved to indicate that the sequence number for *a
message* is unknown.”?

Para 4: Should “An AODVV2 router can only attach …” read “An AODVv2 router
*MUST* attach …”?

Para 5: "As a consequence, loop freedom is assured.”. This implies loop
freedom is a function of sequence number only, but this could well be an
old piece of text. My comment to section 1 applies here.

Section 4.5 Multicast Route Message Table (MRMT). This and section 4.6
could really use some introductory words on the uses of the MRMT, Local
Route Set and the RIB (or other forwarding table belonging to the operating
system), just to set the context for what is to be discussed. This table
also needs to be mentioned in the introductory paragraph of section 6.

RREP: It would be worth explaining when RREPs would be multicast, as it is
not obvious (or wasn’t to me anyway).

we changed this not too long ago - based on the fact that if we create a
unicast packet, but we dont know if the link to the neighbour exists, so we
dont have a confirmed route to the neighbour itself (maybe also had
something to do with not being able to assume that routers were on the same
subnet) so if we hand a unicast packet down to the forwarding process, it
might not be able to send it if it doesnt have a route, because we havent
confirmed bidirectionality... i can remember being quite confused but the
solution we went for was to multicast the RREP in this case.

All through this section: would be worth tightening up on the name of the
parameter when mentioned (e.g. RteMsg.OrigPrefixLen: The prefix length
associated with *RteMsg*.OrigAddr)

RteMsg.OrigSeqNum: “The sequence number … if present …”. Why would the
sequence number not be present?

RteMsg.RemoveTime: The time .. MUST be removed …”. Removed from where?
Also there are two event times mentioned in this definition, which takes
priority, or is it whichever is earlier or later?

Section 4.6 Local Route Set

The definition of Idle … this could use a cross-reference to section 6.4
where interaction with the forwarding plane of the host operating system is
discussed.


not sure on this...but have shifted some text around to hopefully help. We
might need more work on this though...in Local Route Set we mention RIB...
but in forwarding plane interaction section we mention signals which mean
we should add/remove/update routes... feels like it could be neater, they
could tie up better....


The definition of Invalid … second sentence “… therefore it is not to be
installed in the RIB. …”. Surely “therefore it is *t**o be withdrawn*
from the RIB”?

Para starting “Note that multiple entries …” (bottom of page 15), second
sentence “… but may offer improvement …”. So why is that route still
Unconfirmed? Is it really up to the implementor to decide which routes to
confirm and which to not? This sounds like a potential interoperability
issue to me.

Not interoperability... some implementations could use this to figure out
a better route even though they already have a valid one installed. The
unconfirmed route would offer improvement if it the next hop link could be
confirmed bidirectional. i.e. if there happened to be a RREP in future that
this router was going to forward to that address, it could test the better
unconfirmed route, and if the link then got confirmed, any unconfirmed
routes that use that next hop can be confirmed and the poorer route(s) can
be replaced.


Section 5 Metrics

Bullet 2 “ …AODVv2 cannot store routes that cost more than
MAX_METRIC(MetricType)”. Anything is possible. Surely “AODVv2 *MUST NOT*
store routes …”?

Section 6.1 Initialisation

The sentence at top of page 18 before the bullets reads “During this wait
period, the router can do the following”. I would suggest to clarify to
“During this wait period, the router *is permitted to* do the following”.
I thought about making this a MUST but thought better of it.

Section 6.2 Next Hop Monitoring

Last sentence of bullet 1, “blacklisted" should read “Blacklisted”.

Section 6.3 Neighbour Table Update

Neighbour.IPAddress … where do we find this information, since it isn’t
(according to the table in section 7.1) explicitly in the RREQ message? I
guess it’s the source address of the RFC5444 packet. In any case, how can
we assure that the neighbour IP address that RFC5444 parser uses is the
same as the one that AODVv2 has allocated to the interface the message was
to be sent over?

Last paragraph in this section on page 20; “However, the reset time allows
..” should perhaps read “However, *Neighbour.ResetTime* allows …”

Section 6.4 Interaction with the Forwarding Plane

Second bullet in the second batch of bullets reads “A route discovery was
not attempted”. Why would the router not attempt the discovery? The
sentence continues “any buffered packets requiring that the route be
discarded” which should perhaps read “*If any packets are buffered, they
MUST be discarded and the source of the packet should be notified that the
destination is unreachable (using an ICMP Destination Unreachable message”.*


It woudltn attempt discovery if the source IP address was not configured as
a router client. The forwarding plane shouldnt have to know about which
addresses AODVv2 will perform route discovery for... it would just say "hey
AODVv2 can you get me a route for this packet" and if the source address
wasnt a router client, AODVv2 would say "nah cant do it for that one,
discard any packets you might have been buffering, i'll send a RERR, (but
maybe you might want to send ICMP destination unreachable...)"


Section 6.6 Route Discovery …

Second para last sentence should read “The AODVv2 router *concerned* is
referred to as RREQ_Gen”.

Fourth paragraph reads "Determining which packets to discard first when
the buffer is full is a matter of policy at each AODVv2 router. Routers
without sufficient memory available for buffering SHOULD have buffering
disabled. This will affect the latency for launching TCP applications to
new destinations.” So what is the behaviour here when buffer space is
constrained? Should the router discard the packets while seeking to
discover the route, without sending ICMP Destination Unreachable? Whatever
the behaviour is, please advise some text to put here because it’s not
clear.

Added "If packets are not queued, no notification should be sent to the
source."

Section 6.7 Processing Received Route Information

“All AODVv2 route messages contain a route”. Surely the RREQ message
generated by RREQ_Gen does not include any route information yet?

Section 6.8 Suppressing Redundant …

First para “… and generates unnecessary signalling traffic and
interference”. Interference? How can we be sure, this will depend on the
exact radio configuration used? Suggest to delete the words “and
interference”.

Page 30 “To determine if a received message …”

Point 1 first bullet “If there is none, the message …” should read “If
there is *no entry*, the message …”

Section 6.9.2 Reporting Invalid Routes

There are three conditions when an RERR SHOULD be sent. Are there no
conditions when an RERR MUST be sent?

Think these should be MUSTS... I think this came from copying words from
later in section 7. Section 7 was also confusing, because of 2 things:
1) the step afterwards where we say "if we are PktSource, dont regenerate"
...but thats flawed. If we invalidate any of our routes, we probably want
to report that to others! I removed that step.
2) the fact that if the route was Active, we MUST report it, but if it was
Idle, we might report it, if we configured ENABLE_IDLE_IN_RERR. I've
updated to make this clearer.


Section 7.1.2 RREQ Reception

Point 1, bullets 1 and 2; where is Remove Time defined? I couldn’t find a
definition.

Good catch. Its ResetTime in the Neighbor Table as Charlie said. I've
updated this bit.


Point 7, suggest the words “is redundant” are replaced by “was previously
received”. The word ‘redundant’ is so abused in the UK (mostly by HR
departments in relation to people they can no longer afford to employ) that
the meaning is now unclear.

I agree with Charlie's comment here... its not "previously received"...
its whether one that was similar but better was previously received. I
think "redundant" is a simpler way of explaining that.



Section 7.2.1 RREP Generation

Point 2 on page 41: what is the basis on which msg_hop_count is included
in the RREP message?

Good question. It's been in the draft forever with no instruction on when
to include it or not.


Section 7.2.2 RREP Reception

Step 1; should the blacklisting also be revoked?


yes thats what is happening when we change state to Confirmed instead of
Blacklisted. I've tidied the neighbor table update step for each message
type since the new section "Neighbor Table Update" handles all the details.

Step 7 7; what should be the action if the route to TargAddr does not match
an outstanding route request? Should the RREP be discarded?


no, because we are probably an intermediate router and we need to
regenerate the RREP toward OrigAddr. Also that statement "if it matches an
outstanding RREQ" fits better in the route processing section referenced,
so I moved it.


Step 9; if not, proceed to step 10?

7.3.2 RREP_Ack Reception

It’s obvious to me, but for the sake of the security AD we probably need
to point out that if the RREP_Ack was not expected, the router must not
respond.

7.4.1 RERR Generation

I was just wondering if we should make an exception for ICMP messages
particularly those signalling errors, and not send an RERR in those cases.
We could potentially have a compound situation where the routers are trying
to deliver ICMP failure messages when the user data IP packet has already
triggered an RERR. Or am I chasing my tail here? This occurred to me
because a router is required to discard the IP packet that triggered the
RERR, and got to wondering whether we should send an ICMP message. I’m open
to discussion here.

If theres an ICMP dest unreachable headed for some address, but we dont
have a route to that address, we would send a RERR to whoever sent the
ICMP, to tell them we have no route to forward their packet (whereas their
packet was sent to the source of the packet that triggered the destination
unreachable - AODVv2 wouldnt do anything for this address based on these
facts).


Third bullet starting “When a link breaks …”. There is a point about MTU
being exceeded … we’re sending AODVv2 messages, not RFC5444 packets. How
will AODVv2 know the MTU is being exceeded? In fact how do we know the MTU
at all, since AODVv2 has not asked to be notified about it by the
forwarding plane in section 6.4. Anyhow is that not the RFC5444 parsers
problem (or maybe even the SMF parser if that is being used as well)?
Perhaps we should convert that text into an advisory to the implementor.

mentions of MTU were scattered around so i have now put them in RERR
generation and regeneration sections, after the statement that AODVv2
message is used to create a RFC5444 message. I think you must be right, it
would be the RFC5444 parsers problem!!


Sending an RERR in response to an undeliverable IP packet … SHOULD be sent
unicast to the next hop or *alternatively* MUST be multicast … which is
it please? I can sort of see what is being said but the logic is not clear.

I imagine there may be a case where the router might not have a route to
the next hop toward the source of the undeliverable packet, in which case
it should multicast the RERR.


Section 7.4.2 RERR Reception

Typo … Step 1 bullet 1 .. ignore this RREP … should read ignore this
*RERR*.

Good catch.


I believe we need to use stronger language in the sentence “If any of the
above are false …”, I propose "If any of the above are false, the
LocalRoute does not need to be made Invalid and the unreachable address
does not need to be advertised in a regenerated RERR.” be changed to "If
any of the above are false, the LocalRoute *MUST NOT* be made Invalid and
the unreachable address *MUST NOT* be advertised in a regenerated RERR.”

There are conflicting directives all over the second half of this section.
If we have routes matching those in the RERR, SHOULD or MUST an RERR be
regenerated? There is no defining logic here. The bullets in step 2
sometimes say we SHOULD, the directive at step 4 is to do it anyway. There
is no clear decision tree. I propose that we MUST regenerate an RERR in all
cases if the RERR passes the validity test in the first half of this
section.

as mentioned earlier, have updated this.


Section 7.4.3 RERR Regeneration

Step 5 … again we need to advise the implementor that an RERR with lots of
addresses could break an MTU and so there needs to be a check somewhere
when the packet is to be sent to the interface. AODVv2 is not in charge of
forming the packet.

Again … SHOULD be unicast or MUST be sent multicast? Which is it please?
Suggest something like "if the message cannot be unicast it MUST be sent
multicast”.

8. RFC5444 Representation.

Hold up. Control plane message SHOULD use RFC5444? I thought that was the
whole point of AODVv2. Surely MUST?

True, its MUST.


I haven’t checked the mapping to RFC5444 TLVs because my head hurts, but
it looks beautiful.

Section 11.2 Protocol Constants / Section 11.6 MetricType Allocation

MAX_METRIC[MetricType] … just a note for the future that DLEP had a
discussion on the field length of a metric. Might as well recommend that
AODVv2 metric fields are compatible with DLEP.

Any suggested text?


Section 13 Security Considerations

There is a theme of reliance on ICV to show the message has integrity.
That’s ok by itself, but it should also be pointed out that the messages
must be robustly processed according to the steps in section 7 (which must
itself be robustly specified). If there are holes in our specifications, or
if there are implementation holes, or chances for common attack vectors
(e.g. sending a huge RERR causing a buffer overflow), then that’s a
problem, particularly for the constrained memory devices we have discussed
in the past.

Appendix C.

My page 74 is blank for some reason.

looked ok on my screen, page 74 definitely had contents...maybe an issue
on a printed copy?


Similarly there are some text flow problems in this section, perhaps where
code blocks are included, e.g. C.2.1.3, C.2.2.

this is a pandoc quirk. By marking the pseudo-code as a code block it
tries to keep it on one page, and often puts it on the next page, however
the heading is not part of this block so stays on the preceding page.


I’m, not going to check the code, not really my area!

Overall

Quite a fabulous document. Looks a whole lot better than it did a year or
so ago. Well done all.

Cheers :)


Cheers
John



Regards,
Vicky.




Mobile Ad hoc Networks Working Group C. Perkins
Internet-Draft Futurewei
Intended status: Standards Track S. Ratliff
Expires: May 11, 2016 Idirect
J. Dowdell
Airbus Defence and Space
L. Steenbrink
HAW Hamburg, Dept. Informatik
V. Mercieca
Airbus Defence and Space
November 8, 2015


Ad Hoc On-demand Distance Vector Version 2 (AODVv2) Routing
draft-ietf-manet-aodvv2-13

Abstract

The Ad Hoc On-demand Distance Vector Version 2 (AODVv2) routing
protocol is intended for use by mobile routers in wireless, multihop
networks. AODVv2 determines unicast routes among AODVv2 routers
within the network in an on-demand fashion, offering rapid
convergence in dynamic topologies.

Status of This Memo

This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."

This Internet-Draft will expire on May 11, 2016.

Copyright Notice

Copyright (c) 2015 IETF Trust and the persons identified as the
document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents



Perkins, et al. Expires May 11, 2016 [Page 1]

Internet-Draft AODVv2 November 2015


(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.

Table of Contents

1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5
3. Applicability Statement . . . . . . . . . . . . . . . . . . . 9
4. Data Structures . . . . . . . . . . . . . . . . . . . . . . . 10
4.1. Interface List . . . . . . . . . . . . . . . . . . . . . 10
4.2. Router Client Table . . . . . . . . . . . . . . . . . . . 10
4.3. Neighbor Table . . . . . . . . . . . . . . . . . . . . . 11
4.4. Sequence Numbers . . . . . . . . . . . . . . . . . . . . 12
4.5. Local Route Set . . . . . . . . . . . . . . . . . . . . . 13
4.6. Multicast Route Message Table . . . . . . . . . . . . . . 15
5. Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6. AODVv2 Protocol Operations . . . . . . . . . . . . . . . . . 18
6.1. Initialization . . . . . . . . . . . . . . . . . . . . . 18
6.2. Next Hop Monitoring . . . . . . . . . . . . . . . . . . . 19
6.3. Neighbor Table Update . . . . . . . . . . . . . . . . . . 20
6.4. Interaction with Forwarding Plane . . . . . . . . . . . . 21
6.5. Message Transmission . . . . . . . . . . . . . . . . . . 22
6.6. Route Discovery, Retries and Buffering . . . . . . . . . 24
6.7. Processing Received Route Information . . . . . . . . . . 26
6.7.1. Evaluating Route Information . . . . . . . . . . . . 27
6.7.2. Applying Route Updates . . . . . . . . . . . . . . . 28
6.8. Suppressing Redundant Messages Using the Multicast Route
Message Table . . . . . . . . . . . . . . . . . . . . . . 30
6.9. Local Route Set Maintenance . . . . . . . . . . . . . . . 32
6.9.1. Local Route State Changes . . . . . . . . . . . . . . 32
6.9.2. Reporting Invalid Routes . . . . . . . . . . . . . . 35
7. AODVv2 Protocol Messages . . . . . . . . . . . . . . . . . . 35
7.1. Route Request (RREQ) Message . . . . . . . . . . . . . . 35
7.1.1. RREQ Generation . . . . . . . . . . . . . . . . . . . 37
7.1.2. RREQ Reception . . . . . . . . . . . . . . . . . . . 38
7.1.3. RREQ Regeneration . . . . . . . . . . . . . . . . . . 39
7.2. Route Reply (RREP) Message . . . . . . . . . . . . . . . 40
7.2.1. RREP Generation . . . . . . . . . . . . . . . . . . . 41
7.2.2. RREP Reception . . . . . . . . . . . . . . . . . . . 43
7.2.3. RREP Regeneration . . . . . . . . . . . . . . . . . . 44
7.3. Route Reply Acknowledgement (RREP_Ack) Message . . . . . 46
7.3.1. RREP_Ack Generation . . . . . . . . . . . . . . . . . 46
7.3.2. RREP_Ack Reception . . . . . . . . . . . . . . . . . 46



Perkins, et al. Expires May 11, 2016 [Page 2]

Internet-Draft AODVv2 November 2015


7.4. Route Error (RERR) Message . . . . . . . . . . . . . . . 46
7.4.1. RERR Generation . . . . . . . . . . . . . . . . . . . 47
7.4.2. RERR Reception . . . . . . . . . . . . . . . . . . . 49
7.4.3. RERR Regeneration . . . . . . . . . . . . . . . . . . 51
8. RFC 5444 Representation . . . . . . . . . . . . . . . . . . . 52
8.1. Route Request Message Representation . . . . . . . . . . 53
8.1.1. Message Header . . . . . . . . . . . . . . . . . . . 53
8.1.2. Message TLV Block . . . . . . . . . . . . . . . . . . 53
8.1.3. Address Block . . . . . . . . . . . . . . . . . . . . 53
8.1.4. Address Block TLV Block . . . . . . . . . . . . . . . 54
8.2. Route Reply Message Representation . . . . . . . . . . . 54
8.2.1. Message Header . . . . . . . . . . . . . . . . . . . 54
8.2.2. Message TLV Block . . . . . . . . . . . . . . . . . . 55
8.2.3. Address Block . . . . . . . . . . . . . . . . . . . . 55
8.2.4. Address Block TLV Block . . . . . . . . . . . . . . . 55
8.3. Route Reply Acknowledgement Message Representation . . . 56
8.3.1. Message Header . . . . . . . . . . . . . . . . . . . 56
8.3.2. Message TLV Block . . . . . . . . . . . . . . . . . . 56
8.3.3. Address Block . . . . . . . . . . . . . . . . . . . . 57
8.3.4. Address Block TLV Block . . . . . . . . . . . . . . . 57
8.4. Route Error Message Representation . . . . . . . . . . . 57
8.4.1. Message Header . . . . . . . . . . . . . . . . . . . 57
8.4.2. Message TLV Block . . . . . . . . . . . . . . . . . . 57
8.4.3. Address Block . . . . . . . . . . . . . . . . . . . . 57
8.4.4. Address Block TLV Block . . . . . . . . . . . . . . . 58
9. Simple External Network Attachment . . . . . . . . . . . . . 58
10. Optional Features . . . . . . . . . . . . . . . . . . . . . . 59
10.1. Expanding Rings Multicast . . . . . . . . . . . . . . . 60
10.2. Precursor Lists . . . . . . . . . . . . . . . . . . . . 60
10.3. Intermediate RREP . . . . . . . . . . . . . . . . . . . 61
10.4. Message Aggregation Delay . . . . . . . . . . . . . . . 61
11. Configuration . . . . . . . . . . . . . . . . . . . . . . . . 61
11.1. Timers . . . . . . . . . . . . . . . . . . . . . . . . . 62
11.2. Protocol Constants . . . . . . . . . . . . . . . . . . . 63
11.3. Local Settings . . . . . . . . . . . . . . . . . . . . . 64
11.4. Network-Wide Settings . . . . . . . . . . . . . . . . . 64
11.5. Optional Feature Settings . . . . . . . . . . . . . . . 64
11.6. MetricType Allocation . . . . . . . . . . . . . . . . . 65
11.7. AddressType Allocation . . . . . . . . . . . . . . . . . 65
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 66
12.1. RFC 5444 Message Types . . . . . . . . . . . . . . . . . 66
12.2. RFC 5444 Address Block TLV Types . . . . . . . . . . . . 66
13. Security Considerations . . . . . . . . . . . . . . . . . . . 66
14. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 69
15. References . . . . . . . . . . . . . . . . . . . . . . . . . 70
15.1. Normative References . . . . . . . . . . . . . . . . . . 70
15.2. Informative References . . . . . . . . . . . . . . . . . 71
Appendix A. Multi-homing Considerations . . . . . . . . . . . . 72



Perkins, et al. Expires May 11, 2016 [Page 3]

Internet-Draft AODVv2 November 2015


Appendix B. Router Client Relocation . . . . . . . . . . . . . . 72
Appendix C. Example Algorithms for AODVv2 Operations . . . . . . 73
C.1. HopCount MetricType . . . . . . . . . . . . . . . . . . . 74
C.2. General Operations . . . . . . . . . . . . . . . . . . . 75
C.2.1. Route Operations . . . . . . . . . . . . . . . . . . 75
C.2.2. LoopFree . . . . . . . . . . . . . . . . . . . . . . 78
C.2.3. Multicast Route Message Table Operations . . . . . . 79
C.3. Message Algorithms . . . . . . . . . . . . . . . . . . . 80
C.3.1. Build_RFC_5444_Message_Header . . . . . . . . . . . . 81
C.3.2. RREQ Operations . . . . . . . . . . . . . . . . . . . 81
C.3.3. RREP Operations . . . . . . . . . . . . . . . . . . . 85
C.3.4. RREP_Ack Operations . . . . . . . . . . . . . . . . . 89
C.3.5. RERR Operations . . . . . . . . . . . . . . . . . . . 89
Appendix D. AODVv2 Draft Updates . . . . . . . . . . . . . . . . 94
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 94

1. Overview

The Ad Hoc On-demand Distance Vector Version 2 (AODVv2) routing
protocol (formerly named DYMO) enables on-demand, multihop unicast
routing among AODVv2 routers in mobile ad hoc networks (MANETs)
[RFC2501].

Compared to AODV [RFC3561], AODVv2 makes some features optional,
notably intermediate route replies, expanding ring search, and
precursor lists. Hello messages and local repair have been removed.
Message formats have been updated and made compliant with [RFC5444].
AODVv2 also provides a mechanism for the use of multiple metric
types.

AODVv2 control messages are defined as sets of Data Elements, which
are mapped to message elements using the Generalized MANET Packet/
Message Format defined in [RFC5444] and sent using the parameters in
[RFC5498].

The basic operations of the AODVv2 protocol are route discovery and
route maintenance.

Route discovery is performed when an AODVv2 router needs to forward
an IP packet for one of its clients, but does not have a valid route
to the packet's destination. AODVv2 routers use Route Request (RREQ)
and Route Reply (RREP) messages to carry route information between
the originator of the route discovery and the target, establishing a
route to both endpoints on all intermediate routers. A metric value
is included to represent the cost of the route contained within the
message.





Perkins, et al. Expires May 11, 2016 [Page 4]

Internet-Draft AODVv2 November 2015


AODVv2 uses sequence numbers to identify stale routing information,
and compares route metric values to determine if advertised routes
could form loops.

Route maintenance involves monitoring the router's links and routes
for changes. This includes confirming bidirectionality of links to
other AODVv2 routers, issuing Route Error messages if link failures
invalidate routes, extending and enforcing route timeouts, and
reacting to received Route Error messages.

Security for authentication of AODVv2 routers and encryption of
control messages is accomplished using the TIMESTAMP and ICV TLVs
defined in [RFC7182].

2. Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
[RFC2119]. In addition, this document uses terminology from
[RFC5444], and defines the following terms:

AddressList
An AODVv2 Data Element containing a list of IP addresses.

AckReq
An AODVv2 Data Element used in a Route Reply message to request
that the Route Reply message is acknowledged by returning a Route
Reply Ack message. This Data Element contains the address of the
AODVv2 router that should acknowledge the Route Reply message.

AdvRte
A route advertised in an incoming route message.

AODVv2 Router
An IP addressable device in the ad hoc network that performs the
AODVv2 protocol operations specified in this document.

CurrentTime
The current time as maintained by the AODVv2 router.

Data Element
A named field used within AODVv2 protocol messages.

ENAR (External Network Access Router)
An AODVv2 router with an interface to an external, non-AODVv2
network.




Perkins, et al. Expires May 11, 2016 [Page 5]

Internet-Draft AODVv2 November 2015


Invalid route
A route that cannot be used for forwarding but still contains
useful sequence number information.

LocalRoute
An entry in the Local Route Set.

MANET
A Mobile Ad Hoc Network as defined in [RFC2501].

MetricType
An AODVv2 Data Element indicating the metric type for a metric
value included in a message.

MetricTypeList
An AODVv2 Data Element used in a Route Error message, containing a
list of metric types associated with the addresses in the
AddressList of the message.

Neighbor
An AODVv2 router from which an AODVv2 message has been received.
Neighbors exchange routing information and verify bidirectionality
of the link to a neighbor before installing a route via that
neighbor into the Local Route Set.

Node
An IP addressable device in the ad hoc network. All nodes in this
document are either AODVv2 Routers or Router Clients.

OrigAddr (Originator Address)
An AODVv2 Data Element containing the source IP address of the IP
packet triggering route discovery.

OrigMetric
An AODVv2 Data Element containing the metric value associated with
the route to the OrigAddr in a message.

OrigPrefixLen
The prefix length, in bits, associated with OrigAddr.

OrigSeqNum
An AODVv2 Data Element used in a Route Request message, containing
the sequence number of the AODVv2 router which originated the
Route Request.

PktSource





Perkins, et al. Expires May 11, 2016 [Page 6]

Internet-Draft AODVv2 November 2015


An AODVv2 Data Element used in a Route Error message, containing
the source address of the IP packet which triggered the Route
Error message.

PrefixLengthList
An AODVv2 Data Element containing a list of routing prefix lengths
associated with the addresses in the AddressList of the message.

Reactive
A protocol operation is called "reactive" if it is performed only
in reaction to specific events. In this document, "reactive" is
synonymous with "on-demand".

RERR (Route Error)
The AODVv2 message type used to indicate that an AODVv2 router
does not have a valid LocalRoute toward one or more particular
destinations.

RERR_Gen (RERR Generating Router)
The AODVv2 router generating a Route Error message.

Routable Unicast IP Address
A routable unicast IP address is a unicast IP address that is
scoped sufficiently to be forwarded by a router. Globally-scoped
unicast IP addresses and Unique Local Addresses (ULAs) [RFC4193]
are examples of routable unicast IP addresses.

Router Client
An address or address range configured on an AODVv2 router,
corresponding to one or more nodes which require that router to
initiate and respond to route discoveries on their behalf, so that
they can send and receive IP traffic to and from remote
destinations. The AODVv2 router's interface addresses are also
configured as Router Clients.

RREP (Route Reply)
The AODVv2 message type used to reply to a Route Request message.

RREP_Gen (RREP Generating Router)
The AODVv2 router configured with TargAddr as a Router Client,
i.e., the router that creates the Route Reply message.

RREQ (Route Request)
The AODVv2 message type used to discover a route to the Target
Address and distribute information about the route to the
Originator Address.

RREQ_Gen (RREQ Generating Router)



Perkins, et al. Expires May 11, 2016 [Page 7]

Internet-Draft AODVv2 November 2015


The AODVv2 router that creates the Route Request message on behalf
of a Router Client.

RteMsg (Route Message)
A Route Request (RREQ) or Route Reply (RREP) message.

Sequence Number (SeqNum)
An AODVv2 Data Element containing the sequence number maintained
by an AODVv2 router to indicate freshness of route information.

SeqNumList
An AODVv2 Data Element containing a list of sequence numbers
associated with the addresses in the AddressList of a message.

TargAddr (Target Address)
An AODVv2 Data Element containing the destination address of the
IP packet triggering route discovery.

TargMetric
An AODVv2 Data Element containing the metric value associated with
the route to the TargAddr in a message.

TargPrefixLen
The prefix length, in bits, associated with TargAddr.

TargSeqNum
An AODVv2 Data Element used in a Route Reply message, containing a
sequence number generated by the AODVv2 router which originated
the Route Reply.

Valid route
A route that can be used for forwarding.

Unreachable Address
An address reported in an RERR message, either the address on a
LocalRoute which became Invalid, or the destination address of an
IP packet that could not be forwarded because a valid LocalRoute
to the destination is not known.

Upstream
In the direction from destination to source (from TargAddr to
OrigAddr).

ValidityTime
An AODVv2 Data Element containing the length of time the route
described by the message is offered.





Perkins, et al. Expires May 11, 2016 [Page 8]

Internet-Draft AODVv2 November 2015


The AODVv2 Data Elements are used to create AODVv2 messages. Their
contents are transferred into [RFC5444] formatted messages (see
Section 8) before sending.

This document uses the notational conventions in Table 1 to simplify
the text.

+-----------------------+------------------------------------+
| Notation | Meaning |
+-----------------------+------------------------------------+
| Route[Address] | A route toward Address |
| Route[Address].Field | A field in a route toward Address |
| RteMsg.Field | A field in either RREQ or RREP |
+-----------------------+------------------------------------+

Table 1: Notational Conventions

3. Applicability Statement

The AODVv2 routing protocol is a reactive routing protocol. While
proactive routing protocols send frequent messages and determine
routes in advance of them being used, a reactive protocol only sends
messages to discover a route when there is data to send on that
route. Therefore, a reactive routing protocol requires certain
interactions with the forwarding plane, and these are discussed in
Section 6.4.

AODVv2 is designed for stub or disconnected mobile ad hoc networks,
i.e., non-transit networks or those not connected to the internet.
AODVv2 can, however, be configured to perform gateway functions when
attached to external networks, as discussed in Section 9.

AODVv2 handles a wide variety of mobility and traffic patterns by
determining routes on-demand. In networks with a large number of
routers, AODVv2 is best suited for relatively sparse traffic
scenarios where each router forwards IP packets to a small percentage
of other AODVv2 routers in the network. In this case fewer routes
are needed, and therefore less control traffic is produced.

Providing security for a reactive routing protocol can be difficult.
AODVv2 provides for message integrity and security against replay
attacks by using integrity check values, timestamps and sequence
numbers, as described in Section 13. If security associations can be
established, encryption can be used for AODVv2 messages to ensure
that only trusted routers participate in routing operations.

Since the route discovery process aims for a route to be established
in both directions along the same path, uni-directional links are not



Perkins, et al. Expires May 11, 2016 [Page 9]

Internet-Draft AODVv2 November 2015


suitable. AODVv2 will detect and exclude those links from route
discovery. The route discovered is optimised for the requesting
router, and the return path may not be the optimal route.

AODVv2 is applicable to memory constrained devices, since only a
little routing state is maintained in each AODVv2 router. In
contrast to proactive routing protocols, which maintain routing
information for all destinations within the MANET, AODVv2 routes that
are not needed for forwarding data do not need to be maintained. On
routers unable to store persistent AODVv2 state, recovery can impose
a performance penalty (e.g., in case of AODVv2 router reboot), since
if a router loses its sequence number, there is a delay before the
router can resume full operations. This is described in Section 6.1.

AODVv2 supports routers with multiple interfaces and multiple IP
addresses per interface. A router may also use the same IP address
on multiple interfaces. AODVv2 requires only that each interface
configured for AODVv2 has at least one unicast IP address. Address
assignment procedures are out of scope for AODVv2.

AODVv2 supports hosts with multiple interfaces, as long as each
interface is configured with its own unicast IP address. Multi-
homing of a host IP address is not supported by AODVv2, and therefore
a Router Client, i.e. an IP Address, SHOULD NOT be served by more
than one AODVv2 router at any one time. Appendix A contains some
notes on this topic.

Although AODVv2 is closely related to AODV [RFC3561], and shares some
features of DSR [RFC4728], AODVv2 is not interoperable with either of
those protocols.

The routing algorithm in AODVv2 MAY be operated at layers other than
the network layer, using layer-appropriate addresses.

4. Data Structures

4.1. Interface List

If multiple interfaces of the AODVv2 router are configured for use by
AODVv2, a list of the interfaces SHOULD be configured in the
AODVv2_INTERFACES list.

4.2. Router Client Table

An AODVv2 router provides route discovery services for its own local
applications and for other non-routing nodes that are reachable
without traversing another AODVv2 router. These nodes, and the
AODVv2 router itself, are referred to as Router Clients. An AODVv2



Perkins, et al. Expires May 11, 2016 [Page 10]

Internet-Draft AODVv2 November 2015


router will only originate Route Request and Route Reply messages on
behalf of configured Router Clients.

Router Client Table entries MUST contain:

RouterClient.IPAddress
An IP address or the start of an address range that requires route
discovery services from the AODVv2 router.

RouterClient.PrefixLength
The length, in bits, of the routing prefix associated with the
RouterClient.IPAddress. If a prefix length is included, the
AODVv2 router MUST provide connectivity for all addresses within
that prefix.

RouterClient.Cost
The cost associated with reaching this Router Client.

The Router Client Table for an AODVv2 router is never empty, since an
AODVv2 router is always its own client. The IP Addresses of the
router's interfaces will appear in the Router Client Table.

In the initial state, an AODVv2 router is not required to have
information about the Router Clients of any other AODVv2 router.

A Router Client address MUST NOT be served by more than one AODVv2
router at any one time, i.e. a Router Client of one AODVv2 router
MUST NOT be configured as a Router Client on another AODVv2 router
using the same Router Client IP address. Shifting responsibility for
a Router Client to a different AODVv2 router is discussed in
Appendix B.

4.3. Neighbor Table

A Neighbor Table MUST be maintained with information about
neighboring AODVv2 routers which are used in discovered routes.

Neighbor Table entries MUST contain:

Neighbor.IPAddress
An IP address of the neighboring router, learned from the source
IP address of a received route message.

Neighbor.State
Indicates whether the link to the neighbor is bidirectional.
There are three possible states: Confirmed, Unknown, and
Blacklisted. Unknown is the initial state. Confirmed indicates
that the link to the neighbor has been confirmed as bidirectional.



Perkins, et al. Expires May 11, 2016 [Page 11]

Internet-Draft AODVv2 November 2015


Blacklisted indicates that the link to the neighbor is uni-
directional. Section 6.2 discusses how to monitor link
bidirectionality.

Neighbor.ResetTime
When the value of Neighbor.State is Blacklisted, this time
indicates the point at which the value of Neighbor.State reverts
to Unknown. By default this value is calculated at the time the
router is blacklisted and is equal to CurrentTime +
MAX_BLACKLIST_TIME. When the value of Neighbor.State is not
Blacklisted, this time is set to INFINITY_TIME.

4.4. Sequence Numbers

Sequence numbers enable AODVv2 routers to determine the temporal
order of route discovery messages, identifying stale routing
information so that it can be discarded. The sequence number
fulfills the same roles as the "Destination Sequence Number" of DSDV
[Perkins94], and the AODV Sequence Number in [RFC3561].

Each AODVv2 router in the network MUST maintain its own sequence
number as a 16-bit unsigned integer.

All RREQ and RREP messages created by an AODVv2 router include the
router's sequence number. Each AODVv2 router MUST ensure that its
sequence number is strictly increasing. It is incremented by one (1)
whenever an RREQ or RREP is created, except when the sequence number
is 65,535 (the maximum value of a 16-bit unsigned integer), in which
case it MUST be reset to one (1). The value zero (0) is reserved to
indicate that the sequence number is unknown.

An AODVv2 router MUST only attach its own sequence number to
information about a route to one of its configured router clients.
All route messages regenerated by other routers retain the
originator's sequence number. Therefore, when two pieces of
information about a route are received, they both contain a sequence
number from the originating router. Comparing the sequence number
will identify which information is stale. The currently stored
sequence number is subtracted from the incoming sequence number. The
result of the subtraction is to be interpreted as a signed 16-bit
integer, and if less than zero, then the information in the AODVv2
message is stale and MUST be discarded.

This, along with the processes in Section 6.7.1, ensures loop
freedom.

An AODVv2 router SHOULD maintain its sequence number in persistent
storage. If the sequence number is lost, the router MUST follow the



Perkins, et al. Expires May 11, 2016 [Page 12]

Internet-Draft AODVv2 November 2015


procedure in Section 6.1 to safely resume routing operations with a
new sequence number.

4.5. Local Route Set

All AODVv2 routers MUST maintain a Local Route Set, containing
information about routes learned from AODVv2 route messages.
Implementations MAY choose to modify the host routing table directly.
Alternatively, the Local Route Set is stored separately, and the
Routing Information Base is updated using information from the Local
Route Set.

Routes learned through AODVv2 route messages are referred to in this
document as LocalRoutes, and MUST contain the following information:

LocalRoute.Address
An address, which, when combined with LocalRoute.PrefixLength,
describes the set of destination addresses this route includes.

LocalRoute.PrefixLength
The prefix length, in bits, associated with LocalRoute.Address.

LocalRoute.SeqNum
The sequence number associated with LocalRoute.Address, obtained
from the last route message that successfully updated this entry.

LocalRoute.NextHop
The source IP address of the message advertising the route to
LocalRoute.Address, i.e. an IP address of the AODVv2 router used
for the next hop on the path toward LocalRoute.Address.

LocalRoute.NextHopInterface
The interface used to send IP packets toward LocalRoute.Address.

LocalRoute.LastUsed
If this route is installed in the Routing Information Base, the
time it was last used to forward an IP packet.

LocalRoute.LastSeqNumUpdate
The time LocalRoute.SeqNum was last updated.

LocalRoute.ExpirationTime
The time at which this entry must be marked as Invalid.

LocalRoute.MetricType
The type of metric associated with this route.

LocalRoute.Metric



Perkins, et al. Expires May 11, 2016 [Page 13]

Internet-Draft AODVv2 November 2015


The cost of the route toward LocalRoute.Address expressed in units
consistent with LocalRoute.MetricType.

LocalRoute.State
The last known state (Unconfirmed, Idle, Active, or Invalid) of
the route.

LocalRoute.Precursors (optional feature)
A list of upstream neighbors using the route (see Section 10.2).

There are four possible states for a LocalRoute:

Unconfirmed
A route learned from a Route Request message, which has not yet
been confirmed as bidirectional. It is not able to be used for
forwarding IP packets, and therefore it is not referred to as a
valid route.

Idle
A route which has been learned from a route message, and has also
been confirmed, but has not been used in the last ACTIVE_INTERVAL.
It is able to be used for forwarding IP packets, and therefore it
is referred to as a valid route.

Active
A route which has been learned from a route message, and has also
been confirmed, and has been used in the last ACTIVE_INTERVAL. It
is able to be used for forwarding IP packets, and therefore it is
referred to as a valid route.

Invalid
A route which has expired or been lost. It is not able to be used
for forwarding IP packets, and therefore it is not referred to as
a valid route. Invalid routes contain sequence number information
which allows incoming information to be assessed for freshness.

When the Local Route State is stored separately from the host routing
table, routes are added to the Routing Information Base when entries
in the Local Route Set become valid (LocalRoute.State set to Active
or Idle), and removed from the Routing Information Base when entries
in the Local Route Set become invalid (LocalRoute.State set to
Invalid).

Changes to LocalRoute state are detailed in Section 6.9.1.

An AODVv2 router MAY offer a route for a limited time. In this case,
the route is referred to as a timed route. The length of time for
which the route is valid is referred to as validity time, and is



Perkins, et al. Expires May 11, 2016 [Page 14]

Internet-Draft AODVv2 November 2015


included in messages which advertise the route. The shortened
validity time is reflected in LocalRoute.ExpirationTime. If a route
is not timed, LocalRoute.ExpirationTime is INFINITY_TIME.

Note that multiple entries for the same address, prefix length and
metric type may exist in the Local Route Set, but only one will be a
valid entry. Any others will be Unconfirmed, but may offer
improvement to the existing valid route, if they can be confirmed as
valid routes (see Section 6.2).

Multiple valid routes for the same address and prefix length but
different metric type may exist in the Local Route Set, but the
decision of which of these routes to install in the Routing
Information Base to use for forwarding is outside the scope of
AODVv2.

4.6. Multicast Route Message Table

A route message (RteMsg) is either a Route Request or Route Reply
message. RREQ messages are multicast by default and regenerated by
multiple times, and RREP messages may be multicast when the link to
the next router is not known to be bidirectional. Multiple similar
route messages might be received during one route discovery attempt.
The AODVv2 router does not need to regenerate or respond to every one
of these messages.

The Multicast Route Message Table is a conceptual table which
contains information about previously received multicast route
messages, so that incoming route messages can be compared with
previously received messages to determine if the incoming information
is redundant, and the router can avoid sending redundant control
traffic.

Multicast Route Message Table entries MUST contain the following
information:

RteMsg.MessageType
Either RREQ or RREP.

RteMsg.OrigAddr
An IP address of the node which requires the route, i.e., the
source address of the IP packet triggering the route request.

RteMsg.OrigPrefixLen
The prefix length associated with RteMsg.OrigAddr.

RteMsg.TargAddr




Perkins, et al. Expires May 11, 2016 [Page 15]

Internet-Draft AODVv2 November 2015


An IP address of the target, i.e., the destination address of the
IP packet triggering the route request.

RteMsg.TargPrefixLen
The prefix length associated with RteMsg.TargAddr.

RteMsg.OrigSeqNum
The sequence number associated with the originator, if RteMsg is
an RREQ.

RteMsg.TargSeqNum
The sequence number associated with the target, if present in
RteMsg.

RteMsg.MetricType
The metric type of the route requested.

RteMsg.Metric
The metric value received in the RteMsg.

RteMsg.Timestamp
The last time this entry was updated.

RteMsg.RemoveTime
The time at which this entry MUST be removed from the Multicast
Route Message Table. This is set to CurrentTime +
MAX_SEQNUM_LIFETIME, whenever the sequence number of this entry
(RteMsg.OrigSeqNum for an RREQ, or RteMsg.TargSeqNum for an RREP)
is updated.

The Multicast Route Message Table is maintained so that no two
entries have the same MessageType, OrigAddr, TargAddr, and
MetricType. See Section 6.8 for details on updating this table.

5. Metrics

Metrics measure a cost or quality associated with a route or a link,
e.g., latency, delay, financial cost, energy, etc. Metric values are
reported in route messages, where the goal is to determine a route
between OrigAddr and TargAddr. In Route Request messages, the metric
describes the cost of the LocalRoute from OrigAddr (the router
client) to the router sending the Route Request. The receiving
router calculates the cost from OrigAddr to itself, combining the
metric value from the message with knowledge of the link cost from
the sender to the receiver, i.e., the incoming link cost. This
updated route cost is included when regenerating the Route Request
message. In Route Reply messages, the metric reflects the cost of
the route from TargAddr (the router client) to the router sending the



Perkins, et al. Expires May 11, 2016 [Page 16]

Internet-Draft AODVv2 November 2015


Route Reply. Routes to OrigAddr and TargAddr are installed in the
Local Route Set at intermediate routers for the purposes of
forwarding a Route Reply message and subsequent data traffic between
OrigAddr and TargAddr. Assuming link metrics are symmetric, the cost
of the routes to OrigAddr and TargAddr installed in the Local Route
Set at each router will be correct.

AODVv2 enables the use of multiple metric types. Each route
discovery attempt indicates the metric type which is requested for
the route. Only one metric type may be used in each route discovery
attempt. However, routes to a single destination might be requested
and installed in the Local Route Set for different metric types.

For each MetricType, AODVv2 requires:

o A MetricType number, to indicate the metric type of a route.
MetricType numbers allocated are detailed in Section 11.6.

o A maximum value, denoted MAX_METRIC[MetricType]. If the cost of a
route exceeds MAX_METRIC[MetricType], the route is ignored.
AODVv2 MUST NOT store routes that cost more than
MAX_METRIC[MetricType].

o A function for incoming link cost, denoted Cost(L). Using
incoming link costs means that the route learned has a path
optimized for the direction from OrigAddr to TargAddr.

o A function for route cost, denoted Cost(R).

o A function to analyze routes for potential loops based on metric
information, denoted LoopFree(R1, R2). LoopFree verifies that a
route R2 is not a sub-section of another route R1. An AODVv2
router invokes LoopFree() as part of the process in Section 6.7.1,
when an advertised route (R1) and an existing LocalRoute (R2) have
the same destination address, metric type, and sequence number.
LoopFree returns FALSE to indicate that an advertised route is not
to be used to update a stored LocalRoute, if it may cause a
routing loop. In the case where the existing LocalRoute is
Invalid, it is possible that the advertised route includes the
existing LocalRoute and came from a router which did not yet
receive notification of the route becoming Invalid, so the
advertised route should not be used to update the Local Route Set,
in case it forms a loop to a broken route.

AODVv2 currently supports cost metrics where Cost(R) is strictly
increasing, by defining:

o Cost(R) := Sum of Cost(L) of each link in the route



Perkins, et al. Expires May 11, 2016 [Page 17]

Internet-Draft AODVv2 November 2015


o LoopFree(R1, R2) := ( Cost(R1) <= Cost(R2) )

Implementers MAY consider other metric types, but the definitions of
Cost and LoopFree functions for such types are undefined, and
interoperability issues need to be considered.

6. AODVv2 Protocol Operations

The AODVv2 protocol's operations include managing sequence numbers,
monitoring next hop AODVv2 routers and updating the Neighbor Table,
performing route discovery and dealing with requests from other
routers, processing incoming route information and updating the Local
Route Set, updating the Multicast Route Message Table and suppressing
redundant messages, and reporting broken routes. These processes are
discussed in detail in the following sections.

6.1. Initialization

During initialization where an AODVv2 router does not have
information about its previous sequence number, or if its sequence
number is lost at any point, the router resets its sequence number to
one (1). However, other AODVv2 routers may still hold sequence
number information that this router previously issued. Since
sequence number information is removed if there has been no update to
the sequence number in MAX_SEQNUM_LIFETIME, the initializing router
must wait for MAX_SEQNUM_LIFETIME before it creates any messages
containing its new sequence number. It can then be sure that the
information it sends will not be considered stale.

Until MAX_SEQNUM_LIFETIME after its sequence number is reset, the
router SHOULD NOT create RREQ or RREP messages.

During this wait period, the router is permitted to do the following:

o Process information in a received RREQ or RREP message to learn a
route to the originator or target of that route discovery

o Regenerate a received RREQ or RREP

o Send an RREP_Ack

o Maintain valid routes in the Local Route Set

o Create, process and regenerate RERR messages







Perkins, et al. Expires May 11, 2016 [Page 18]

Internet-Draft AODVv2 November 2015


6.2. Next Hop Monitoring

AODVv2 routers MUST NOT establish routes over uni-directional links.
Consider the following. An RREQ is forwarded toward TargAddr, and
intermediate routers create a LocalRoute entry for OrigAddr in the
Local Route Set. If, at one of the intermediate routers, this route
was used to forward data traffic, but the link to the next hop toward
OrigAddr was uni-directional, the data packets would be lost.
Further, an RREP sent toward OrigAddr using this link would not reach
the next hop, and would therefore never reach RREQ_Gen, so end-to-end
route establishment will fail.

AODVv2 routers MUST verify that the link to the next hop router is
bidirectional before marking a route as valid in the Local Route Set.
If link bidirectionality cannot be verified, this link MUST be
excluded from the route discovery procedure. AODVv2 routers do not
need to monitor bidirectionality for links to neighboring routers
which are not used as next hops on routes in the Local Route Set.

o For the next hop router on the route toward OrigAddr, the approach
for testing bidirectional connectivity is to request
acknowledgement of Route Reply messages. Receipt of an
acknowledgement proves that bidirectional connectivity exists.
All AODVv2 routers MUST support this process, which is explained
in Section 7.2 and Section 7.3. If a link to a neighbor is
determined to be unidirectional because a requested
acknowledgement is not received within RREP_Ack_SENT_TIMEOUT, the
neighbor MUST have Neighbor.State set to Blacklisted.

o For the next hop router on the route toward TargAddr, receipt of
the Route Reply message containing the route to TargAddr is
confirmation of bidirectionality, since a Route Reply message is a
reply to a Route Request message which previously crossed the link
in the opposite direction.

To assist with next hop monitoring, a Neighbor Table (Section 4.3) is
maintained. When an RREQ or RREP is received from an IP address
which does not already have an entry in the Neighbor Table, a new
entry is created as described in Section 6.3. While the value of
Neighbor.State is Unknown, acknowledgement of RREP messages sent to
that neighbor MUST be requested. While the value of Neighbor.State
is Confirmed, the request for an acknowledgement is unnecessary.

When routers perform other operations such as those from the list
below, these MAY be used as additional indications of connectivity:

o NHDP HELLO Messages [RFC6130]




Perkins, et al. Expires May 11, 2016 [Page 19]

Internet-Draft AODVv2 November 2015


o Route timeout

o Lower layer triggers, e.g. message reception or link status
notifications

o TCP timeouts

o Promiscuous listening

o Other monitoring mechanisms or heuristics

If such an external process signals that the link is bidirectional,
the value of Neighbor.State MAY be set to Confirmed. If an external
process signals that a link is not bidirectional, the AODVv2 router
MAY update the matching Neighbor Table entry by changing the value of
Neighbor.State to Blacklisted. If an external process signals that
the link might not be bidirectional, and the value of Neighbor.State
is currently Confirmed, it MAY be set to Unknown.

For example, receipt of a Neighborhood Discovery Protocol HELLO
message with the receiving router listed as a neighbor is a signal of
bidirectional connectivity. The AODVv2 router MAY update the
matching Neighbor Table entry by changing the value of Neighbor.State
to Confirmed.

Similarly, if AODVv2 receives notification of a timeout, for example,
from TCP or some other protocol, this may be due to a disconnection.
The AODVv2 router MAY update the matching Neighbor Table entry by
setting the value of Neighbor.State to Unknown.

6.3. Neighbor Table Update

On receipt of an RREQ or RREP message, the Neighbor Table MUST be
checked for an entry with Neighbor.IPAddress which matches the source
IP address of the message. If no matching entry is found, a new
entry is created.

A new Neighbor Table entry is created as follows:

o Neighbor.IPAddress := Source IP address of the received route
message

o Neighbor.State := Unknown

o Neighbor.ResetTime := INFINITY_TIME






Perkins, et al. Expires May 11, 2016 [Page 20]

Internet-Draft AODVv2 November 2015


If the message is an RREP which answers a recently sent RREQ, or an
RREP_Ack which answers a recently sent RREP, the link to the neighbor
is bidirectional.

When the link to the neighbor is determined to be bidirectional, the
Neighbor Table entry is updated as follows:

o Neighbor.State := Confirmed

o Neighbor.ResetTime := INFINITY_TIME

When the link to the neighbor is determined to be uni-directional,
the Neighbor Table entry is updated as follows:

o Neighbor.State := Blacklisted

o Neighbor.ResetTime := CurrentTime + MAX_BLACKLIST_TIME

When the Neighbor.ResetTime is reached, the Neighbor Table entry is
updated as follows:

o Neighbor.State := Unknown

When a link to a neighbor is determined to be broken, the Neighbor
Table entry SHOULD be removed.

Route requests from neighbors with Neighbor.State set to Blacklisted
are ignored to avoid persistent IP packet loss or protocol failures.
However, Neighbor.ResetTime allows the neighbor to again be allowed
to participate in route discoveries after MAX_BLACKLIST_TIME, in case
the link between the routers has become bidirectional.

6.4. Interaction with Forwarding Plane

A reactive protocol reacts when a route is needed, when an
application tries to send a packet and the forwarding plane has no
route to the destination of the packet. The fundamental concept of
reactive routing is to avoid creating routes that are not needed.

AODVv2 requires signals from the forwarding plane:

o A packet cannot be forwarded because a route is unavailable:
AODVv2 needs to know the source and destination IP addresses of
the packet, to determine whether it should initiate route
discovery, if the source of the packet is configured as a Router
Client, or create a Route Error message.





Perkins, et al. Expires May 11, 2016 [Page 21]

Internet-Draft AODVv2 November 2015


o A packet is to be forwarded: AODVv2 needs to check the state of
the route to deal with timeouts to ensure the route is still
valid. If the implementation uses timers to enforce route
timeouts, this signal is unnecessary.

o Packet forwarding failure occurs: AODVv2 needs to initiate route
error reports.

o Packet forwarding succeeds: AODVv2 needs to update the record of
when a route was last used to forward a packet.

AODVv2 needs to send signals to the forwarding plane:

o A route discovery is in progress: packets requiring a route may be
buffered while route discovery is attempted.

o A route discovery was not attempted: any buffered packets
requiring that route should be discarded, and the source of the
packet should be notified that the destination is unreachable
(using an ICMP Destination Unreachable message). A route
discovery will not be attempted if the source address of the
packet needing a route is not configured as a Router Client.

o A route discovery failed: any buffered packets requiring that
route should be discarded, and the source of the packet should be
notified that the destination is unreachable (using an ICMP
Destination Unreachable message).

o A route discovery succeeded: install a route into the Routing
Information Base and begin transmitting any buffered packets.

o A route has been lost or has expired: remove a route from the
Routing Information Base.

o A route has been updated: update a route in the Routing
Information Base.

These are conceptual signals, and can be implemented in various ways.
Conformant implementations of AODVv2 are not mandated to implement
the forwarding plane separately from the control plane or data plane;
these signals and interactions are identified simply as assistance
for implementers who may find them useful.

6.5. Message Transmission

AODVv2 sends [RFC5444] formatted messages using the parameters for
port number and IP protocol specified in [RFC5498]. Mapping of
AODVv2 Data Elements to [RFC5444] is detailed in Section 8. Unless



Perkins, et al. Expires May 11, 2016 [Page 22]

Internet-Draft AODVv2 November 2015


otherwise specified, AODVv2 multicast messages are sent to the link-
local multicast address LL-MANET-Routers [RFC5498]. All AODVv2
routers MUST subscribe to LL-MANET-Routers [RFC5498] to receive
AODVv2 messages. Note that multicast messages MAY be sent via
unicast. For example, this may occur for certain link-types (non-
broadcast media), for manually configured router adjacencies, or in
order to improve robustness.

When multiple interfaces are available, an AODVv2 router transmitting
a multicast message to LL-MANET-Routers MUST send the message on all
interfaces that have been configured for AODVv2 operation, as given
in the AODVv2_INTERFACES list (Section 4.1). Similarly, AODVv2
routers MUST subscribe to LL-MANET-Routers on all their AODVv2
interfaces.

Implementations MAY choose to employ techniques to reduce the number
of multicast messages sent. Use of [RFC6621] in deployments is
recommended. Employing [RFC6621] in a subset of the operational
AODVv2 routers in a network, or configuring different algorithms on
different routers, will not cause interoperability issues, but will
reduce the effectiveness of the multicast reduction scheme.

To avoid congestion, each AODVv2 router's rate of message generation
SHOULD be limited (CONTROL_TRAFFIC_LIMIT) and administratively
configurable. To prioritize transmission of AODVv2 control messages
in order to respect the CONTROL_TRAFFIC_LIMIT:

o Highest priority SHOULD be given to RREP_Ack messages. This
allows links between routers to be confirmed as bidirectional and
avoids undesirable blacklisting of next hop routers.

o Second priority SHOULD be given to RERR messages for undeliverable
IP packets, so that broken routes that are still in use by other
AODVv2 routers can be reported to those routers, to avoid IP data
packets being repeatedly forwarded to AODVv2 routers which cannot
forward to their destination.

o Third priority SHOULD be given to RREP messages in order that
RREQs do not time out.

o RREQ messages SHOULD be given priority over RERR messages for
newly invalidated routes, since the invalidated routes may not
still be in use, and if there is an attempt to use the route, a
new RERR message will be generated.

o Lowest priority SHOULD be given to RERR messages generated in
response to RREP messages which cannot be regenerated. In this
case the route request will be retried at a later point.



Perkins, et al. Expires May 11, 2016 [Page 23]

Internet-Draft AODVv2 November 2015


Messages may travel a maximum of MAX_HOPCOUNT hops.

6.6. Route Discovery, Retries and Buffering

AODVv2's RREQ and RREP messages are used for route discovery. The
main difference between the two messages is that, usually, RREQ
messages are multicast to solicit an RREP, whereas RREP is unicast as
a response to the RREQ. The constants used in this section are
defined in Section 11.

When an AODVv2 router needs to forward an IP packet (with source
address OrigAddr and destination address TargAddr) from one of its
Router Clients, it needs a route to the packet's destination in its
Routing Information Base. If no route exists, the AODVv2 router
generates and multicasts a Route Request message (RREQ) using
OrigAddr and TargAddr. The procedure for this is described in
Section 7.1.1. Each new RREQ results in an increment to the sequence
number. The AODVv2 router generating an RREQ is referred to as
RREQ_Gen.

IP packets awaiting a route for forwarding MAY be buffered by
RREQ_Gen. Buffering of IP packets can have both positive and
negative effects. Real-time traffic, voice, and scheduled delivery
may suffer if packets are buffered and subjected to delays, but TCP
connection establishment will benefit if packets are queued while
route discovery is performed. If packets are not queued, no
notification should be sent to the source.

Determining which packets to discard first when the buffer is full is
a matter of policy at each AODVv2 router. Routers without sufficient
memory available for buffering SHOULD have buffering disabled. This
will affect the latency for launching TCP applications to new
destinations.

RREQ_Gen awaits reception of a Route Reply message (RREP) containing
a route toward TargAddr. An RREQ from TargAddr would also fulfill
the request, if the link to the next hop is known to be
bidirectional. If a route to TargAddr is not learned within
RREQ_WAIT_TIME, RREQ_Gen MAY retry the route discovery. To reduce
congestion in a network, repeated attempts at route discovery for a
particular target address SHOULD utilize a binary exponential
backoff: for each additional attempt, the waiting time for receipt of
the RREP is multiplied by 2. If the requested route is not learned
within the wait period, another RREQ MAY be sent, up to a total of
DISCOVERY_ATTEMPTS_MAX. This is the same technique used in AODV
[RFC3561].





Perkins, et al. Expires May 11, 2016 [Page 24]

Internet-Draft AODVv2 November 2015


The RREQ is received by neighboring AODVv2 routers, and processed and
regenerated as described in Section 7.1. Intermediate routers learn
a potential route to OrigAddr from the RREQ and store it in the Local
Route Set. The router responsible for TargAddr responds by generating
a Route Reply message (RREP) and unicasts it back toward RREQ_Gen via
the next hop on the potential route to OrigAddr. Each intermediate
router regenerates the RREP and unicasts toward OrigAddr.

Links which are not bidirectional cause problems. If a link is
unavailable in the direction toward OrigAddr, an RREP is not received
at the next hop, so cannot be regenerated, and it will never reach
RREQ_Gen. However, since routers monitor bidirectionality to next
hops (Section 6.2), the loss of the RREP will cause the last router
which regenerated the RREP to blacklist the router which did not
receive it. Later, a timeout occurs at RREQ_Gen, and a new RREQ MAY
be regenerated. If the new RREQ arrives via the blacklisted router,
it will be ignored, enabling the RREQ to discover a different path
toward TargAddr.

Route discovery SHOULD be considered to have failed after
DISCOVERY_ATTEMPTS_MAX and the corresponding wait time for an RREP
response to the final RREQ, in order to avoid repeatedly generating
control traffic that is unlikely to discover a route. After the
attempted route discovery has failed, RREQ_Gen MUST wait at least
RREQ_HOLDDOWN_TIME before attempting another route discovery to the
same destination, to avoid generating more multicast messages which
are unlikely to discover a route. Any IP packets buffered for
TargAddr MUST also be dropped and a Destination Unreachable ICMP
message (Type 3) with a code of 1 (Host Unreachable Error) SHOULD be
delivered to the source of the packet, so that the application knows
about the failure. The source can be an application on RREQ_Gen
itself, or on a Router Client with address OrigAddr.

If RREQ_Gen does receive a route message containing a route to
TargAddr within the timeout, it MUST process the message according to
Section 7. When a valid LocalRoute entry is created in the Local
Route Set, the route is also installed in the Routing Information
Base, and the router can begin sending the buffered IP packets. Any
retry timers for the corresponding RREQ MUST be cancelled.

During route discovery, all routers on the path learn a route to both
OrigAddr and TargAddr, so that routes are constructed in both
directions. The route is optimized for the forward route, and the
return route uses the same path in reverse.







Perkins, et al. Expires May 11, 2016 [Page 25]

Internet-Draft AODVv2 November 2015


6.7. Processing Received Route Information

All AODVv2 route messages contain a route. A Route Request (RREQ)
includes a route to OrigAddr, and a Route Reply (RREP) contains a
route to TargAddr.

All AODVv2 routers that receive a route message can store the route
contained within it in their Local Route Set. Incoming information is
first checked to verify that it is both safe to use and offers an
improvement to existing information. This process is explained in
Section 6.7.1. The Local Route Set MAY then be updated according to
Section 6.7.2.

In the processes below, RteMsg is used to denote the route message,
AdvRte is used to denote the route contained within it, and
LocalRoute denotes an existing entry in the Local Route Set which
matches AdvRte on address, prefix length, and metric type.

AdvRte has the following properties:

o AdvRte.Address := RteMsg.OrigAddr (in RREQ) or RteMsg.TargAddr (in
RREP)

o AdvRte.PrefixLength := RteMsg.OrigPrefixLen (in RREQ) or
RteMsg.TargPrefixLen (in RREP) if included, or if no prefix length
was included in RteMsg, the address length, in bits, of
AdvRte.Address

o AdvRte.SeqNum := RteMsg.OrigSeqNum (in RREQ) or RteMsg.TargSeqNum
(in RREP)

o AdvRte.NextHop := RteMsg.IPSourceAddress (an address of the router
from which the AdvRte was received)

o AdvRte.MetricType := RteMsg.MetricType

o AdvRte.Metric := RteMsg.Metric

o AdvRte.Cost := Cost(R) using the cost function associated with the
route's metric type, i.e. Cost(R) = AdvRte.Metric + Cost(L), as
described in Section 5, where L is the link from the advertising
router

o AdvRte.ValidityTime := RteMsg.ValidityTime, if included







Perkins, et al. Expires May 11, 2016 [Page 26]

Internet-Draft AODVv2 November 2015


6.7.1. Evaluating Route Information

An incoming route advertisement (AdvRte) is compared to existing
LocalRoutes to determine whether the advertised route is to be used
to update the AODVv2 Local Route Set. The incoming route information
MUST be processed as follows:

1. Search for a LocalRoute in the Local Route Set matching AdvRte's
address, prefix length and metric type

* If no matching LocalRoute exists, AdvRte MUST be used to
update the Local Route Set.

* If all matching LocalRoutes have LocalRoute.State set to
Unconfirmed, AdvRte SHOULD be added to the Local Route Set.

* If a matching LocalRoute exists with LocalRoute.State set to
Active, Idle, or Invalid, continue to Step 2.

2. Compare sequence numbers using the technique described in
Section 4.4

* If AdvRte is more recent, AdvRte MUST be used to update the
Local Route Set.

* If AdvRte is stale, AdvRte MUST NOT be used to update the
Local Route Set.

* If the sequence numbers are equal, continue to Step 3.

3. Check that AdvRte is safe against routing loops (see Section 5)

* If LoopFree(AdvRte, LocalRoute) returns FALSE, AdvRte MUST NOT
be used to update the Local Route Set because using the
incoming information might cause a routing loop.

* If LoopFree(AdvRte, LocalRoute) returns TRUE, continue to Step
4.

4. Compare route costs

* If AdvRte is better, it SHOULD be used to update the Local
Route Set because it offers improvement. If it is not used to
update the existing LocalRoute, the existing non-optimal
LocalRoute will continue to be used, causing data flows to use
a route with a worse cost where this could have been avoided.





Perkins, et al. Expires May 11, 2016 [Page 27]

Internet-Draft AODVv2 November 2015


* If AdvRte is equal in cost and LocalRoute is valid, AdvRte MAY
be used to update the Local Route Set but will offer no
improvement.

* If AdvRte is worse and LocalRoute is valid, AdvRte MUST NOT be
used to update the Local Route Set because it does not offer
any improvement.

* If AdvRte is not better (i.e., it is worse or equal) but
LocalRoute is Invalid, AdvRte SHOULD be used to update the
Local Route Set because it can safely repair the existing
Invalid LocalRoute.

If the advertised route is to be used to update the Local Route Set,
the procedure in Section 6.7.2 MUST be followed. If the route is not
used, non-optimal routes will remain in the Local Route Set.

6.7.2. Applying Route Updates

After determining that AdvRte is to be used to update the Local Route
Set (as described in Section 6.7.1), the following procedure applies.

If AdvRte is learned from an RREQ message, the link to the next hop
neighbor may not be confirmed as bidirectional (see Section 4.3). If
the value of Neighbor.State is Unknown, the route to AdvRte.Address
might not be viable, but it MUST be stored in the Local Route Set to
allow a corresponding RREP to be sent.

The route update is applied as follows:

1. If no existing entry in the Local Route Set matches AdvRte on
address, prefix length and metric type, continue to Step 3 and
create a new entry in the Local Route Set.

2. If a matching entry (LocalRoute) exists in the Local Route Set:

* If AdvRte has a different next hop to LocalRoute, and both
AdvRte.NextHop's Neighbor.State is Unknown and
LocalRoute.State is Active or Idle, the current route is valid
but the advertised route may offer improvement, if the link to
the next hop can be confirmed as bidirectional. AdvRte SHOULD
be stored as an additional entry in the Local Route Set, with
LocalRoute.State set to Unconfirmed. Continue processing from
Step 3 to create a new LocalRoute.

* If AdvRte.NextHop's Neighbor.State is Unknown and
LocalRoute.State is Invalid, the advertised route can replace




Perkins, et al. Expires May 11, 2016 [Page 28]

Internet-Draft AODVv2 November 2015


the existing LocalRoute. Continue processing from Step 4 to
update the existing LocalRoute.

* If AdvRte.NextHop's Neighbor.State is Confirmed, continue
processing from Step 4 to update the existing LocalRoute.

* If the existing LocalRoute.State is Unconfirmed, continue
processing from Step 3 to create a new LocalRoute.

3. Create an entry in the Local Route Set and initialize as follows:

* LocalRoute.Address := AdvRte.Address

* LocalRoute.PrefixLength := AdvRte.PrefixLength

* LocalRoute.MetricType := AdvRte.MetricType

4. Update the LocalRoute as follows:

* LocalRoute.SeqNum := AdvRte.SeqNum

* LocalRoute.NextHop := AdvRte.NextHop

* LocalRoute.NextHopInterface := interface on which RteMsg was
received

* LocalRoute.Metric := AdvRte.Cost

* LocalRoute.LastUsed := CurrentTime

* LocalRoute.LastSeqNumUpdate := CurrentTime

* LocalRoute.ExpirationTime := CurrentTime + AdvRte.ValidityTime
if a validity time exists, otherwise INFINITY_TIME

5. If a new LocalRoute was created, or if the existing
LocalRoute.State is Invalid or Unconfirmed, update LocalRoute as
follows:

* LocalRoute.State := Unconfirmed (if the next hop's
Neighbor.State is Unknown) or Idle (if the next hop's
Neighbor.State is Confirmed)

6. If an existing LocalRoute.State changed from Invalid or
Unconfirmed to become Idle, any matching LocalRoute with worse
metric value SHOULD be expunged.





Perkins, et al. Expires May 11, 2016 [Page 29]

Internet-Draft AODVv2 November 2015


7. If this update results in LocalRoute.State of Active or Idle,
which matches an outstanding route request, the associated route
request retry timers can be cancelled.

8. If this update to the Local Route Set results in multiple
LocalRoutes to the same address, the best LocalRoute will be
Unconfirmed. In order to improve the route used for forwarding,
the router SHOULD try to determine if the link to the next hop of
that LocalRoute is bidirectional, by using that LocalRoute to
forward future RREPs and request acknowledgements. If that
LocalRoute then becomes valid, any remaining LocalRoutes which do
not offer improvement MUST be expunged from the Local Route Set.
Alternatively, if the link to the next hop of the best LocalRoute
is not confirmed to be bidirectional when requested, that
LocalRoute MUST be expunged from the Local Route Set, and the
process can be repeated to test any remaining Unconfirmed
LocalRoutes.

6.8. Suppressing Redundant Messages Using the Multicast Route Message
Table

When route messages are flooded in a MANET, an AODVv2 router may
receive multiple similar messages. Regenerating every one of these
gives little additional benefit, and generates unnecessary signaling
traffic and may generate unnecessary interference.

Each AODVv2 router stores information about recently received route
messages in the AODVv2 Multicast Route Message Table (Section 4.6).

To create a Multicast Route Message Table Entry:

o RteMsg.MessageType := RREQ or RREP

o RteMsg.OrigAddr := OrigAddr from the message

o RteMsg.OrigPrefixLen := the prefix length associated with OrigAddr

o RteMsg.TargAddr := TargAddr from the message

o RteMsg.TargPrefixLen := the prefix length associated with TargAddr

o RteMsg.OrigSeqNum := the sequence number associated with OrigAddr,
if present in the message

o RteMsg.TargSeqNum := the sequence number associated with TargAddr,
if present in the message

o RteMsg.MetricType := the metric type of the route requested



Perkins, et al. Expires May 11, 2016 [Page 30]

Internet-Draft AODVv2 November 2015


o RteMsg.Metric := the metric value associated with OrigAddr in an
RREQ or TargAddr in an RREP

o RteMsg.Timestamp := CurrentTime

o RteMsg.RemoveTime := CurrentTime + MAX_SEQNUM_LIFETIME

Entries in the Multicast Route Message Table SHOULD be maintained for
at least RteMsg_ENTRY_TIME after the last Timestamp update in order
to account for long-lived RREQs traversing the network. An entry
MUST be deleted when the sequence number is no longer valid, i.e.,
after MAX_SEQNUM_LIFETIME. Memory-constrained devices MAY remove the
entry before this time.

To update a Multicast Route Message Table Entry, set:

o RteMsg.OrigSeqNum := the sequence number associated with OrigAddr,
if present in the message

o RteMsg.TargSeqNum := the sequence number associated with TargAddr,
if present in the message

o RteMsg.Metric := the metric value associated with OrigAddr in an
RREQ or TargAddr in an RREP

o RteMsg.Timestamp := CurrentTime

o RteMsg.RemoveTime := CurrentTime + MAX_SEQNUM_LIFETIME

Received route messages are tested against previously received route
messages, and if determined to be redundant, regeneration or response
can be avoided.

To determine if a received message is redundant:

1. Search for an entry in the Multicast Route Message Table with the
same MessageType, OrigAddr, TargAddr, and MetricType

* If there is no entry, the message is not redundant.

* If there is an entry, continue to Step 2.

2. Compare sequence numbers using the technique described in
Section 4.4

* For RREQ messages, use OrigSeqNum of the entry for comparison.
For RREP messages, use TargSeqNum of the entry for comparison.




Perkins, et al. Expires May 11, 2016 [Page 31]

Internet-Draft AODVv2 November 2015


* If the entry has an older sequence number than the received
message, the message is not redundant.

* If the entry has a newer sequence number than the received
message, the message is redundant.

* If the entry has the same sequence number, continue to Step 3.

3. Compare the metric values

* If the entry has a Metric value that is worse than or equal to
the metric in the received message, the message is redundant.

* If the entry has a Metric value that is better than the metric
in the received message, the message is not redundant.

If the message is redundant, update the timestamp on the entry, since
matching route messages are still traversing the network and this
entry should be maintained. This message SHOULD NOT be regenerated
or responded to.

If the message is not redundant, create an entry or update the
existing entry. Where the message is determined not redundant before
Step 3, it MUST be regenerated or responded to. Where the message is
determined not redundant in Step 3, it MAY be suppressed to avoid
extra control traffic. However, since the processing of the message
will result in an update to the Local Route Set, the message SHOULD
be regenerated or responded to, to ensure other routers have up-to-
date information and the best metrics. If not regenerated, the best
route may not be found. Where necessary, regeneration or response is
performed using the processes in Section 7.

6.9. Local Route Set Maintenance

Route maintenance involves monitoring LocalRoutes in the Local Route
Set, updating LocalRoute.State to handle route timeouts and reporting
routes that become Invalid.

6.9.1. Local Route State Changes

During normal operation, AODVv2 does not require any explicit
timeouts to manage the lifetime of a route. At any time, any
LocalRoute MAY be examined and updated according to the rules below.
If timers are not used to prompt updates of LocalRoute.State, the
LocalRoute.State MUST be checked before IP packet forwarding and
before any operation based on LocalRoute.State.





Perkins, et al. Expires May 11, 2016 [Page 32]

Internet-Draft AODVv2 November 2015


An Unconfirmed route MUST become Idle when the link to
LocalRoute.NextHop is confirmed as bidirectional, or MUST be expunged
if the neighbor is blacklisted. An Unconfirmed route MUST be
expunged at MAX_SEQNUM_LIFETIME after LocalRoute.LastSeqNumUpdate.

When LocalRoute.State changes from Unconfirmed to Idle as a result of
the next hop neighbour having Neighbor.State being set to Confirmed
(see Section 4.3), any other matching LocalRoutes with metric values
worse than LocalRoute.Metric MUST be expunged from the Local Route
Set.

An Idle route MUST become Active when used to forward an IP packet.
If the route is not used to forward an IP packet within MAX_IDLETIME,
LocalRoute.State MUST become Invalid.

An Active route which is a timed route (i.e., with
LocalRoute.ExpirationTime not equal to INFINITY_TIME) remain Active
until LocalRoute.ExpirationTime, after which it MUST become Invalid.
If it it not a timed route, it MUST become Idle if the route is not
used to forward an IP packet within ACTIVE_INTERVAL.

An Invalid route SHOULD be maintained until MAX_SEQNUM_LIFETIME after
LocalRoute.LastSeqNumUpdate, after which it MUST be expunged.
LocalRoute.SeqNum is used to classify future information about
LocalRoute.Address as stale or fresh.

In all cases, if the time since LocalRoute.LastSeqNumUpdate exceeds
MAX_SEQNUM_LIFETIME, LocalRoute.SeqNum must be set to zero. This is
required to ensure that any AODVv2 routers following the
initialization procedure can safely begin routing functions using a
new sequence number, and that their messages will not be classified
as stale and ignored. A LocalRoute with LocalRoute.State set to
Active or Idle can remain in the Local Route Set, but if
LocalRoute.State later becomes Invalid, the LocalRoute MUST be
expunged from the Local Route Set.

Appendix C.2.1.1 contains an algorithmic representation of this
timeout behavior.

LocalRoutes can become Invalid before a timeout occurs:

o If a link breaks, all LocalRoutes using that link for
LocalRoute.NextHop MUST immediately have LocalRoute.State set to
Invalid.

o If a Route Error (RERR) message containing the route is received,
either from LocalRoute.NextHop, or with PktSource set to a Router




Perkins, et al. Expires May 11, 2016 [Page 33]

Internet-Draft AODVv2 November 2015


Client address, LocalRoute.State MUST immediately be set to
Invalid.

LocalRoutes are also updated when Neighbor.State is updated:

o While the value of Neighbor.State is set to Unknown, any routes in
the Local Route Set using that neighbor as a next hop MUST have
LocalRoute.State set to Unconfirmed.

o When the value of Neighbor.State is set to Confirmed, the
Unconfirmed routes in the Local Route Set using that neighbor as a
next hop MUST have LocalRoute.State set to Idle (see
Section 6.9.1).

o When the value of Neighbor.State is set to Blacklisted, any valid
routes in the Local Route Set using that neighbor for their next
hop MUST have LocalRoute.State set to Invalid.

o When a Neighbor Table entry is removed, all routes in the Local
Route Set using that neighbor as next hop MUST have
LocalRoute.State set to Invalid.

Memory constrained devices MAY choose to expunge routes from the
AODVv2 Local Route Set before LocalRoute.ExpirationTime, but MUST
adhere to the following rules:

o An Active route MUST NOT be expunged, as it is in use. When IP
traffic is forwarded via this router, it will cause generation of
a Route Error message followed by a necessary Route Request from
the originator's router to re-establish the route.

o An Idle route SHOULD NOT be expunged, as it is still valid for
forwarding IP traffic. If deleted, this could result in dropped
IP packets and a Route Request could be generated to re-establish
the route.

o Any Invalid route MAY be expunged. Least recently used Invalid
routes SHOULD be expunged first, since the sequence number
information is less likely to be useful.

o An Unconfirmed route MUST NOT be expunged if it was installed
within the last RREQ_WAIT_TIME, because it may correspond to a
route discovery in progress. A Route Reply message might be
received which needs to use the LocalRoute.NextHop information.
Otherwise, it MAY be expunged.






Perkins, et al. Expires May 11, 2016 [Page 34]

Internet-Draft AODVv2 November 2015


6.9.2. Reporting Invalid Routes

When LocalRoute.State changes from Active to Invalid as a result of a
broken link or a received Route Error (RERR) message, other AODVv2
routers MUST be informed by sending an RERR message containing
details of the invalidated route.

An RERR message MUST also be sent when an AODVv2 router receives an
IP packet to forward on behalf of another router but does not have a
valid route in its Routing Information Base for the destination of
the packet.

An RERR message MUST also be sent when an AODVv2 router receives an
RREP message to regenerate, but the LocalRoute to the OrigAddr in the
RREP has been lost or is marked as Invalid.

The packet or message triggering the RERR MUST be discarded.

Generation of an RERR message is described in Section 7.4.1.

7. AODVv2 Protocol Messages

AODVv2 defines four message types: Route Request (RREQ), Route Reply
(RREP), Route Reply Acknowledgement (RREP_Ack), and Route Error
(RERR).

Each AODVv2 message is defined as a set of Data Elements. Rules for
the generation, reception and regeneration of each message type are
described in the following sections. Section 8 discusses how the
Data Elements map to [RFC5444] Message TLVs, Address Blocks, and
Address TLVs.

7.1. Route Request (RREQ) Message

Route Request messages are used in route discovery operations to
request a route to a specified target address. RREQ messages have
the following contents:














Perkins, et al. Expires May 11, 2016 [Page 35]

Internet-Draft AODVv2 November 2015


+-----------------------------------------------------------------+
| msg_hop_limit, (optional) msg_hop_count |
+-----------------------------------------------------------------+
| AddressList |
+-----------------------------------------------------------------+
| PrefixLengthList (optional) |
+-----------------------------------------------------------------+
| OrigSeqNum, (optional) TargSeqNum |
+-----------------------------------------------------------------+
| MetricType |
+-----------------------------------------------------------------+
| OrigMetric |
+-----------------------------------------------------------------+
| ValidityTime (optional) |
+-----------------------------------------------------------------+

Figure 1: RREQ message contents

RREQ Data Elements

msg_hop_limit
The remaining number of hops allowed for dissemination of the RREQ
message.

msg_hop_count
The number of hops already traversed during dissemination of the
RREQ message.

AddressList
Contains OrigAddr and TargAddr, the source and destination
addresses of the IP packet for which a route is requested.
OrigAddr and TargAddr MUST be routable unicast addresses.

PrefixLengthList
Contains OrigPrefixLen, i.e., the length, in bits, of the prefix
associated with OrigAddr. If omitted, the prefix length is equal
to OrigAddr's address length in bits.

OrigSeqNum
The sequence number associated with OrigAddr.

TargSeqNum
A sequence number associated with TargAddr. This MAY be included
if an Invalid LocalRoute exists to the target. This is useful for
the optional Intermediate RREP feature (see Section 10.3).

MetricType
The metric type associated with OrigMetric.



Perkins, et al. Expires May 11, 2016 [Page 36]

Internet-Draft AODVv2 November 2015


OrigMetric
The metric value associated with the LocalRoute to OrigAddr, as
measured by the sender of the message.

ValidityTime
The length of time that the message sender is willing to offer a
route toward OrigAddr. Omitted if no time limit is imposed.

7.1.1. RREQ Generation

An RREQ is generated when an IP packet needs to be forwarded for a
Router Client, and no valid route currently exists for the packet's
destination in the Routing Information Base.

Before creating an RREQ, the router SHOULD check if an RREQ has
recently been sent for the requested destination. If so, and the
wait time for a reply has not yet been reached, the router SHOULD
continue to await a response without generating a new RREQ. If the
timeout has been reached, a new RREQ MAY be generated. If buffering
is configured, the incoming IP packet SHOULD be buffered until the
route discovery is completed.

If the limit for the rate of AODVv2 control message generation has
been reached, no message SHOULD be generated. If approaching the
limit, the message should be sent if the priorities in Section 6.5
allow it.

To generate the RREQ, the router (referred to as RREQ_Gen) follows
this procedure:

1. Set msg_hop_limit := MAX_HOPCOUNT

2. Set msg_hop_count := 0, if including it

3. Set AddressList := {OrigAddr, TargAddr}

4. For the PrefixLengthList:

* If OrigAddr is part of an address range configured as a Router
Client, set PrefixLengthList := {OrigPrefixLen, null}.

* Otherwise, omit PrefixLengthList.

5. For OrigSeqNum:

* Increment the router SeqNum as specified in Section 4.4.

* Set OrigSeqNum := SeqNum.



Perkins, et al. Expires May 11, 2016 [Page 37]

Internet-Draft AODVv2 November 2015


6. For TargSeqNum:

* If an Invalid route exists in the Local Route Set matching
TargAddr using longest prefix matching and has a valid
sequence number, set TargSeqNum := LocalRoute.SeqNum.

* If no Invalid route exists in the Local Route Set matching
TargAddr, or the route doesn't have a sequence number, omit
TargSeqNum.

7. Include the MetricType Data Element and set the type accordingly

8. Set OrigMetric := RouterClient.Cost for OrigAddr

9. Include the ValidityTime Data Element if advertising that the
route to OrigAddr via this router is offered for a limited time,
and set ValidityTime accordingly

This AODVv2 message is used to create a corresponding [RFC5444]
message (see Section 8) which is multicast, by default, to LL-MANET-
Routers on all interfaces configured for AODVv2 operation.

7.1.2. RREQ Reception

Upon receiving an RREQ, an AODVv2 router performs the following
steps:

1. Update the Neighbor Table according to Section 6.3

* If the sender has Neighbor.State set to Blacklisted after the
update, ignore this RREQ for further processing.

2. Verify that the message hop count, if included, hasn't exceeded
MAX_HOPCOUNT

* If so, ignore this RREQ for further processing.

3. Verify that the message contains the required Data Elements:
msg_hop_limit, OrigAddr, TargAddr, OrigSeqNum, and OrigMetric,
and that OrigAddr and TargAddr are valid addresses (routable and
unicast)

* If not, ignore this RREQ for further processing.

4. Check that the MetricType is supported and configured for use

* If not, ignore this RREQ for further processing.




Perkins, et al. Expires May 11, 2016 [Page 38]

Internet-Draft AODVv2 November 2015


5. Verify that the cost of the advertised route will not exceed the
maximum allowed metric value for the metric type (Metric <=
MAX_METRIC[MetricType] - Cost(L))

* If it will, ignore this RREQ for further processing.

6. Process the route to OrigAddr as specified in Section 6.7.1

7. Check if the information in the message is redundant by comparing
to entries in the Multicast Route Message table, following the
procedure in (Section 6.8)

* If redundant, ignore this RREQ for further processing.

* If not redundant, continue processing.

8. Check if the TargAddr belongs to one of the Router Clients

* If so, generate an RREP as specified in Section 7.2.1.

* If not, continue to RREQ regeneration.

7.1.3. RREQ Regeneration

By regenerating an RREQ, a router advertises that it will forward IP
packets to the OrigAddr contained in the RREQ according to the
information enclosed. The router MAY choose not to regenerate the
RREQ, though this could decrease connectivity in the network or
result in non-optimal paths. The full set of circumstances under
which a router might avoid regenerating an RREQ are not declared in
this document, though examples include the router being heavily
loaded or low on energy and therefore unwilling to advertise routing
capability for more traffic.

The RREQ SHOULD NOT be regenerated if the limit for the rate of
AODVv2 control message generation has been reached. If approaching
the limit, the message should be sent if the priorities in
Section 6.5 allow it.

The procedure for RREQ regeneration is as follows:

1. Set msg_hop_limit := received msg_hop_limit - 1

2. If msg_hop_limit is now zero, do not continue the regeneration
process

3. Set msg_hop_count := received msg_hop_count + 1, if included,
otherwise omit msg_hop_count



Perkins, et al. Expires May 11, 2016 [Page 39]

Internet-Draft AODVv2 November 2015


4. Set AddressList, PrefixLengthList, sequence numbers and
MetricType to the values in the received RREQ

5. Set OrigMetric := LocalRoute[OrigAddr].Metric

6. If the received RREQ contains a ValidityTime, or if the
regenerating router wishes to limit the time that it offers a
route to OrigAddr, the regenerated RREQ MUST include a
ValidityTime Data Element

* The ValidityTime is either the time limit the previous AODVv2
router specified, or the time limit this router wishes to
impose, whichever is lower.

This AODVv2 message is used to create a corresponding [RFC5444]
message (see Section 8) which is multicast, by default, to LL-MANET-
Routers on all interfaces configured for AODVv2 operation. However,
the regenerated RREQ can be unicast to the next hop address of the
LocalRoute toward TargAddr, if known.

7.2. Route Reply (RREP) Message

When a Route Request message is received, requesting a route to a
Target Address which is configured as a Router Client, a Route Reply
message is sent in response. The RREP offers a route to the Target
Address.

RREP messages have the following contents:

+-----------------------------------------------------------------+
| msg_hop_limit, (optional) msg_hop_count |
+-----------------------------------------------------------------+
| AckReq (optional) |
+-----------------------------------------------------------------+
| AddressList |
+-----------------------------------------------------------------+
| PrefixLengthList (optional) |
+-----------------------------------------------------------------+
| TargSeqNum |
+-----------------------------------------------------------------+
| MetricType |
+-----------------------------------------------------------------+
| TargMetric |
+-----------------------------------------------------------------+
| ValidityTime (optional) |
+-----------------------------------------------------------------+

Figure 2: RREP message contents



Perkins, et al. Expires May 11, 2016 [Page 40]

Internet-Draft AODVv2 November 2015


RREP Data Elements

msg_hop_limit
The remaining number of hops allowed for dissemination of the RREP
message.

msg_hop_count
The number of hops already traversed during dissemination of the
RREP message.

AckReq
The address of the intended next hop of the RREP. This Data
Element is used when the RREP is to be multicast because the next
hop toward OrigAddr is a neighbor with Neighbor.State set to
Unknown. It indicates that an acknowledgement of the RREP is
requested by the sender from the intended next hop (see
Section 6.2).

AddressList
Contains OrigAddr and TargAddr, the source and destination
addresses of the IP packet for which a route is requested.
OrigAddr and TargAddr MUST be routable unicast addresses.

PrefixLengthList
Contains TargPrefixLen, i.e., the length, in bits, of the prefix
associated with TargAddr. If omitted, the prefix length is equal
to TargAddr's address length, in bits.

TargSeqNum
The sequence number associated with TargAddr.

MetricType
The metric type associated with TargMetric.

TargMetric
The metric value associated with the LocalRoute to TargAddr, as
seen from the sender of the message.

ValidityTime
The length of time that the message sender is willing to offer a
route toward TargAddr. Omitted if no time limit is imposed.

7.2.1. RREP Generation

An RREP is generated when an RREQ arrives requesting a route to one
of the AODVv2 router's Router Clients.





Perkins, et al. Expires May 11, 2016 [Page 41]

Internet-Draft AODVv2 November 2015


Before creating an RREP, the router SHOULD check if the corresponding
RREQ is redundant, i.e., a response has already been generated, or if
the limit for the rate of AODVv2 control message generation has been
reached. If so, the RREP SHOULD NOT be created. If approaching the
limit, the message should be sent if the priorities in Section 6.5
allow it.

The RREP is intended to follow the path of the route to OrigAddr. If
the best route to OrigAddr in the Local Route Set is Unconfirmed, the
link to the next hop neighbor is not yet confirmed as bidirectional
(as described in Section 6.2). In this case the RREP MUST include an
AckReq Data Element including the intended next hop address. The
AckReq Data Element indicates that an acknowledgement to the RREP is
requested from the intended next hop router in the form of a Route
Reply Acknowledgement (RREP_Ack). If the best route to OrigAddr in
the Local Route Set is valid, the link the the next hop neighbor is
already confirmed as bidirectional, and the AckReq Data Element can
be omitted.

Implementations MAY allow a number of retries of the RREP if an
acknowledgement is not received within RREP_Ack_SENT_TIMEOUT,
doubling the timeout with each retry, up to a maximum of
RREP_RETRIES, using the same exponential backoff described in
Section 6.6 for RREQ retries. The acknowledgement MUST be considered
to have failed after the wait time for an RREP_Ack response to the
final RREP.

To generate the RREP, the router (also referred to as RREP_Gen)
follows this procedure:

1. Set msg_hop_limit := msg_hop_count from the received RREQ
message, if it was included, or MAX_HOPCOUNT if it was not
included

2. Set msg_hop_count := 0, if including it

3. If the link to the next hop router toward OrigAddr is not known
to be bidirectional, include the AckReq Data Element with the
address of the intended next hop router

4. Set Address List := {OrigAddr, TargAddr}

5. For the PrefixLengthList:

* If TargAddr is part of an address range configured as a Router
Client, set PrefixLengthList := {null, TargPrefixLen}.

* Otherwise, omit PrefixLengthList.



Perkins, et al. Expires May 11, 2016 [Page 42]

Internet-Draft AODVv2 November 2015


6. For the TargSeqNum:

* Increment the router SeqNum as specified in Section 4.4.

* Set TargSeqNum := SeqNum.

7. Include the MetricType Data Element and set the type to match the
MetricType in the received RREQ message

8. Set TargMetric := RouterClient.Cost for TargAddr

9. Include the ValidityTime Data Element if advertising that the
route to TargAddr via this router is offered for a limited time,
and set ValidityTime accordingly

This AODVv2 message is used to create a corresponding [RFC5444]
message (see Section 8). If the Neighbor Table contains an entry for
the next hop router on the best route to OrigAddr, and Neighbor.State
is Confirmed, the RREP is sent by unicast to the next hop.
Otherwise, the RREP is sent multicast to LL-MANET-Routers.

7.2.2. RREP Reception

Upon receiving an RREP, an AODVv2 router performs the following
steps:

1. Update the Neighbor Table according to Section 6.3

2. Verify that the message hop count, if included, hasn't exceeded
MAX_HOPCOUNT

* If so, ignore this RREQ for further processing.

3. Verify that the message contains the required Data Elements:
msg_hop_limit, OrigAddr, TargAddr, TargSeqNum, and TargMetric,
and that OrigAddr and TargAddr are valid addresses (routable and
unicast)

* If not, ignore this RREP for further processing.

4. Check that the MetricType is supported and configured for use

* If not, ignore this RREP for further processing.

5. Verify that the cost of the advertised route does not exceed the
maximum allowed metric value for the metric type (Metric <=
MAX_METRIC[MetricType] - Cost(L))




Perkins, et al. Expires May 11, 2016 [Page 43]

Internet-Draft AODVv2 November 2015


* If it does, ignore this RREP for further processing.

6. If the AckReq Data Element is present, check the intended
recipient of the received RREP

* If the receiving router is the intended recipient, send an
acknowledgement as specified in Section 7.3 and continue
processing.

* If the receiving router is not the intended recipient, ignore
this RREP for further processing.

7. Process the route to TargAddr as specified in Section 6.7.1

8. Check if the message is redundant by comparing to entries in the
Multicast Route Message table (Section 6.8)

* If redundant, ignore this RREP for further processing.

* If not redundant, save the information in the Multicast Route
Message table to identify future redundant RREP messages and
continue processing.

9. Check if the OrigAddr belongs to one of the Router Clients

* If so, no further processing is necessary.

* If not, continue to Step 10.

10. Check if a valid (Active or Idle) or Unconfirmed LocalRoute
exists to OrigAddr

* If so, continue to RREP regeneration.

* If not, a Route Error message SHOULD be transmitted to
TargAddr according to Section 7.4.1 and the RREP SHOULD be
discarded and not regenerated.

7.2.3. RREP Regeneration

A received Route Reply message is regenerated toward OrigAddr.
Unless the router is prepared to advertise the route contained within
the received RREP, it halts processing. By regenerating a RREP, a
router advertises that it will forward IP packets to TargAddr
according to the information enclosed. The router MAY choose not to
regenerate the RREP, in the same way it MAY choose not to regenerate
an RREQ (see Section 7.1.3), though this could decrease connectivity
in the network or result in non-optimal paths.



Perkins, et al. Expires May 11, 2016 [Page 44]

Internet-Draft AODVv2 November 2015


The RREP SHOULD NOT be regenerated if the limit for the rate of
AODVv2 control message generation has been reached. If approaching
the limit, the message should be sent if the priorities in
Section 6.5 allow it.

If the link to the next hop neighbor on the LocalRoute to OrigAddr is
not yet confirmed as bidirectional (as described in Section 6.2), the
RREP MUST include an AckReq Data Element including the intended next
hop address, in order to perform next hop monitoring. If
bidirectionality is already confirmed, the AckReq Data Element can be
omitted. The AckReq Data Element indicates that an acknowledgement
to the RREP is requested in the form of a Route Reply Acknowledgement
(RREP_Ack) from the intended next hop router.

The procedure for RREP regeneration is as follows:

1. Set msg_hop_limit := received msg_hop_limit - 1

2. If msg_hop_limit is now zero, do not continue the regeneration
process

3. Set msg_hop_count := received msg_hop_count + 1, if it was
included, otherwise omit msg_hop_count

4. If the link to the next hop router toward OrigAddr is not known
to be bidirectional, include the AckReq Data Element with the
address of the intended next hop router

5. Set AddressList, PrefixLengthList, TargSeqNum and MetricType to
the values in the received RREP

6. Set TargMetric := LocalRoute[TargAddr].Metric

7. If the received RREP contains a ValidityTime, or if the
regenerating router wishes to limit the time that it will offer a
route to TargAddr, the regenerated RREP MUST include a
ValidityTime Data Element

* The ValidityTime is either the time limit the previous AODVv2
router specified, or the time limit this router wishes to
impose, whichever is lower.

This AODVv2 message is used to create a corresponding [RFC5444]
message (see Section 8). If there is a Confirmed entry in the
Neighbor Table for the next hop router on the route to OrigAddr, the
RREP is sent by unicast to the next hop. Otherwise, the RREP is sent
multicast to LL-MANET-Routers.




Perkins, et al. Expires May 11, 2016 [Page 45]

Internet-Draft AODVv2 November 2015


7.3. Route Reply Acknowledgement (RREP_Ack) Message

The Route Reply Acknowledgement MUST be sent in response to a
received Route Reply which includes an AckReq Data Element with an
address matching one of the receiving router's IP addresses. When
the RREP_Ack message is received, it confirms that the link between
the two routers is bidirectional. The RREP_Ack has no Data Elements.

7.3.1. RREP_Ack Generation

An RREP_Ack MUST be generated when a received RREP includes the
AckReq Data Element with the address of the receiving router. The
RREP_Ack SHOULD NOT be generated if the limit for the rate of AODVv2
control message generation has been reached.

There are no Data Elements in an RREP_Ack. The [RFC5444]
representation is discussed in Section 8. The RREP_Ack is unicast,
by default, to the source IP address of the RREP message that
requested it.

7.3.2. RREP_Ack Reception

Upon receiving an RREP_Ack, an AODVv2 router performs the following
steps:

1. Update the Neighbor Table according to Section 6.3

* If the sender has Neighbor.State set to Blacklisted after the
update, ignore this RREQ for further processing.

2. Check if the RREP_Ack was expected from the IP source address of
the RREP_Ack, in response to an RREP sent previously by this
router

* If it was expected, the router cancels any associated
timeouts.

* If it was not expected, no actions are required.

7.4. Route Error (RERR) Message

A Route Error message is generated by an AODVv2 router to notify
other AODVv2 routers of routes that are no longer available. An RERR
message has the following contents:







Perkins, et al. Expires May 11, 2016 [Page 46]

Internet-Draft AODVv2 November 2015


+-----------------------------------------------------------------+
| msg_hop_limit |
+-----------------------------------------------------------------+
| PktSource (optional) |
+-----------------------------------------------------------------+
| AddressList |
+-----------------------------------------------------------------+
| PrefixLengthList (optional) |
+-----------------------------------------------------------------+
| SeqNumList (optional) |
+-----------------------------------------------------------------+
| MetricTypeList |
+-----------------------------------------------------------------+

Figure 3: RERR message contents

RERR Data Elements

msg_hop_limit
The remaining number of hops allowed for dissemination of the RERR
message.

PktSource
The source address of the IP packet triggering the RERR. If the
RERR is triggered by a broken link, the PktSource Data Element is
not required.

AddressList
The addresses of the routes no longer available through RERR_Gen.

PrefixLengthList
The prefix lengths, in bits, associated with the routes no longer
available through RERR_Gen. These values indicate whether routes
represent a single device or an address range.

SeqNumList
The sequence numbers of the routes no longer available through
RERR_Gen (where known).

MetricTypeList
The metric types associated with the routes no longer available
through RERR_Gen.

7.4.1. RERR Generation

An RERR is generated when an AODVv2 router (also referred to as
RERR_Gen) needs to report that a destination is no longer reachable.
There are three events that cause this response:



Perkins, et al. Expires May 11, 2016 [Page 47]

Internet-Draft AODVv2 November 2015


o When an IP packet that cannot be forwarded because there is no
route in the Routing Information Base for its destination, the
source of the packet needs to be informed that the route to the
destination of the packet does not exist. The RERR generated MUST
contain the PktSource Data Element containing the source address
of the IP packet, and MUST contain only one unreachable address in
the AddressList, the destination address of the IP packet.
RERR_Gen MUST discard the IP packet that triggered generation of
the RERR. The prefix length and sequence number MAY be included
if known from an Invalid LocalRoute entry to PktSource. The
MetricTypeList MUST also be included if a MetricType can be
determined from the IP packet or an existing Invalid LocalRoute to
the unreachable address.

o When an RREP message cannot be regenerated because the LocalRoute
to OrigAddr has been lost or is Invalid, RREP_Gen needs to be
informed that the route to OrigAddr does not exist. The RERR
generated MUST contain the PktSource Data Element containing the
TargAddr of the RREP, and MUST contain only one unreachable
address in the AddressList, the OrigAddr from the RREP. RERR_Gen
MUST discard the RREP message that triggered generation of the
RERR. The prefix length, sequence number and metric type SHOULD
be included if known from an Invalid LocalRoute to the unreachable
address.

o When a link breaks, multiple LocalRoutes may become Invalid, and
the RERR generated MAY contain multiple unreachable addresses.
The RERR MUST include the MetricTypeList Data Element. The
PktSource Data Element is omitted. All previously Active
LocalRoutes that used the broken link MUST be reported. The
AddressList, PrefixLengthList, SeqNumList, and MetricTypeList will
contain entries for each LocalRoute which has become Invalid. An
RERR message is only sent if an Active LocalRoute becomes Invalid,
though an AODVv2 router can also include Idle LocalRoutes that
become Invalid if the configuration parameter ENABLE_IDLE_IN_RERR
is set (see Section 11.3).

In order to avoid flooding the network with RERR messages when a
stream of IP packets to an unreachable address arrives, an AODVv2
router SHOULD determine whether an RERR has recently been sent with
the same unreachable address and PktSource, and SHOULD avoid creating
duplicate RERR messages.

The RERR SHOULD NOT be generated if the limit for the rate of AODVv2
control message generation has been reached. If approaching the
limit, the message should be sent if the priorities in Section 6.5
allow it.




Perkins, et al. Expires May 11, 2016 [Page 48]

Internet-Draft AODVv2 November 2015


Incidentally, if an AODVv2 router receives an ICMP error packet to or
from the address of one of its Router Clients, it simply forwards the
ICMP packet in the same way as any other IP packet, and will not
generate any RERR message based on the contents of the ICMP packet.

To generate the RERR, the router follows this procedure:

1. Set msg_hop_limit := MAX_HOPCOUNT

2. If necessary, include the PktSource Data Element and set the
value to the source address of the IP packet triggering the RERR,
or the TargAddr of an RREP that cannot be regenerated toward
OrigAddr

3. For each LocalRoute that needs to be reported:

* Insert LocalRoute.Address into the AddressList.

* Insert LocalRoute.PrefixLength into PrefixLengthList, if known
and not equal to the address length.

* Insert LocalRoute.SeqNum into SeqNumList, if known.

* Insert LocalRoute.MetricType into MetricTypeList.

The AODVv2 message is used to create a corresponding [RFC5444]
message (see Section 8). If the message contents would cause the MTU
to be exceeded, multiple RERR messages must be created.

If the RERR is sent in response to an undeliverable IP packet or RREP
message, it SHOULD be sent unicast to the next hop on the route to
PktSource, or alternatively, if there is no route to PktSource, it
MUST be multicast to LL-MANET-Routers.

If the RERR is sent in response to a broken link, the RERR is, by
default, multicast to LL-MANET-Routers.

If the optional precursor lists feature (see Section 10.2) is
enabled, the RERR is unicast to the precursors of the LocalRoutes
being reported.

7.4.2. RERR Reception

Upon receiving an RERR, an AODVv2 router performs the following
steps:

1. Update the Neighbor Table according to Section 6.3




Perkins, et al. Expires May 11, 2016 [Page 49]

Internet-Draft AODVv2 November 2015


2. Verify that the message contains the required Data Elements:
msg_hop_limit and at least one unreachable address

* If not, ignore this RRER for further processing.

3. For each address in the AddressList, check that:

* The address is valid (routable and unicast)

* The MetricType is supported and configured for use

* There is a valid LocalRoute with the same MetricType matching
the address using longest prefix matching

* Either the LocalRoute's next hop is the sender of the RERR and
the next hop interface is the interface on which the RERR was
received, or PktSource is present in the RERR and is a Router
Client address

* The unreachable address' sequence number is either unknown, or
is greater than the LocalRoute's sequence number

If any of the above are false, a matching LocalRoute MUST NOT be
made Invalid and the unreachable address MUST NOT be advertised
in a regenerated RERR.

If all of the above are true, the LocalRoute is no longer valid.
If the LocalRoute was previously Active, it MUST be reported in a
regenerated RERR. If the LocalRoute was previously Idle, it MAY
be reported in a regenerated RERR, if ENABLE_IDLE_IN_RERR is
configured. The LocalRoute MUST be made updated according to
these rules:

* If the LocalRoute's prefix length is the same as the
unreachable address' prefix length, set LocalRoute.State to
Invalid.

* If the LocalRoute's prefix length is longer than the
unreachable address' prefix length, the LocalRoute MUST be
expunged from the Local Route Set, since it is a sub-route of
the route which is reported to be Invalid.

* If the prefix length is different, create a new LocalRoute
with the unreachable address, and its prefix length and
sequence number, set LocalRoute.State to Invalid.






Perkins, et al. Expires May 11, 2016 [Page 50]

Internet-Draft AODVv2 November 2015


* Update the sequence number on the existing LocalRoute, if the
reported sequence number is determined to be newer using the
comparison technique described in Section 4.4.

4. Check if there are unreachable addresses which MUST be reported
in a regenerated RERR

* If so, regenerate the RERR as detailed in Section 7.4.3.

* If not, take no further action.

7.4.3. RERR Regeneration

The RERR SHOULD NOT be generated if the limit for the rate of AODVv2
control message generation has been reached. If approaching the
limit, the message should be sent if the priorities in Section 6.5
allow it.

The procedure for RERR regeneration is as follows:

1. Set msg_hop_limit := received msg_hop_limit - 1

2. If msg_hop_limit is now zero, do not continue the regeneration
process

3. If the PktSource Data Element was included in the original RERR,
copy it into the regenerated RERR

4. For each LocalRoute that needs to be reported:

* Insert LocalRoute.Address into the AddressList.

* Insert LocalRoute.PrefixLength into PrefixLengthList, if known
and not equal to the address length.

* Insert LocalRoute.SeqNum into SeqNumList, if known.

* Insert LocalRoute.MetricType into MetricTypeList.

The AODVv2 message is used to create a corresponding [RFC5444]
message (see Section 8). If the message contents would cause the MTU
to be exceeded, multiple RERR messages must be created. If the RERR
contains the PktSource Data Element, the regenerated RERR SHOULD be
sent unicast to the next hop on the LocalRoute to PktSource, or
alternatively if there is no route to PktSource, it MUST be multicast
to LL-MANET-Routers. If the RERR is sent in response to a broken
link, the RERR is, by default, multicast to LL-MANET-Routers.




Perkins, et al. Expires May 11, 2016 [Page 51]

Internet-Draft AODVv2 November 2015


8. RFC 5444 Representation

AODVv2 specifies that all control messages between routers MUST use
the Generalized Mobile Ad Hoc Network Packet/Message Format
[RFC5444], and therefore AODVv2's route messages comprise Data
Elements that map to message elements in [RFC5444].

[RFC5444] provides a multiplexed transport for multiple protocols.
An [RFC5444] multiplexer MAY choose to optimize the content of
certain message elements to reduce control message overhead.

A brief summary of the [RFC5444] format:

1. A packet contains zero or more messages

2. A message contains a Message Header, one Message TLV Block, zero
or more Address Blocks, and one Address Block TLV Block per
Address Block

3. The Message TLV Block MAY contain zero or more Message TLVs

4. An Address Block TLV Block MAY include zero or more Address Block
TLVs

5. Each TLV value in an Address Block TLV Block can be associated
with all of the addresses, or with a contiguous set of addresses,
or with a single address in the Address Block

AODVv2 does not require access to the [RFC5444] packet header.

In the message header, AODVv2 uses <msg-hop-limit>, <msg-hop-count>,
<msg-type> and <msg-addr-length>. The <msg-addr-length> field
indicates the length of any addresses in the message (using <msg-
addr-length> := (address length in octets - 1), i.e. 3 for IPv4 and
15 for IPv6).

Each address included in the Address Block is identified as OrigAddr,
TargAddr, PktSource, or Unreachable Address by including an
ADDRESS_TYPE TLV in the Address Block TLV Block.

The addresses in an Address Block MAY appear in any order, and values
in a TLV in the Address Block TLV Block must be associated with the
correct address in the Address Block by the [RFC5444] implementation.
To indicate which value is associated with each address, the AODVv2
message representation uses lists where the order of the addresses in
the AODVv2 AddressList Data Element matches the order of values in
other list-based Data Elements, e.g., the order of SeqNums in the
SeqNumList in an RERR. [RFC5444] maps this information to Address



Perkins, et al. Expires May 11, 2016 [Page 52]

Internet-Draft AODVv2 November 2015


Block TLVs associated with the relevant addresses in the Address
Block.

The following sections show how AODVv2 Data Elements are represented
in [RFC5444] messages. AODVv2 makes use of the VALIDITY_TIME TLV
from [RFC5497], and defines (in Section 12) a number of new TLVs.

Where the extension type of a TLV is set to zero, this is the default
[RFC5444] value and the extension type will not be included in the
message.

8.1. Route Request Message Representation

8.1.1. Message Header

+---------------+-----------------+---------------------------------+
| Data Element | Header Field | Value |
+---------------+-----------------+---------------------------------+
| None | <msg-type> | RREQ |
| msg_hop_limit | <msg-hop-limit> | MAX_HOPCOUNT, reduced by number |
| | | of hops traversed so far by the |
| | | message. |
| msg_hop_count | <msg-hop-count> | Number of hops traversed so far |
| | | by the message. |
+---------------+-----------------+---------------------------------+

8.1.2. Message TLV Block

An RREQ contains no Message TLVs.

8.1.3. Address Block

An RREQ contains two Addresses, OrigAddr and TargAddr, and each
address has an associated prefix length. If the prefix length has
not been included in the AODVv2 message, it is equal to the address
length in bits.

+-------------------------+------------------------------+
| Data Elements | Address Block |
+-------------------------+------------------------------+
| OrigAddr/OrigPrefixLen | <address> + <prefix-length> |
| TargAddr/TargPrefixLen | <address> + <prefix-length> |
+-------------------------+------------------------------+








Perkins, et al. Expires May 11, 2016 [Page 53]

Internet-Draft AODVv2 November 2015


8.1.4. Address Block TLV Block

Address Block TLVs are always associated with one or more addresses
in the Address Block. The following sections show the TLVs that
apply to each address.

8.1.4.1. Address Block TLVs for OrigAddr

+--------------+---------------+------------+-----------------------+
| Data Element | TLV Type | Extension | Value |
| | | Type | |
+--------------+---------------+------------+-----------------------+
| None | ADDRESS_TYPE | 0 | ADDRTYPE_ORIGADDR |
| OrigSeqNum | SEQ_NUM | 0 | Sequence Number of |
| | | | RREQ_Gen, the router |
| | | | which initiated route |
| | | | discovery. |
| OrigMetric | PATH_METRIC | MetricType | Metric value for the |
| /MetricType | | | route to OrigAddr, |
| | | | using MetricType. |
| ValidityTime | VALIDITY_TIME | 0 | ValidityTime for |
| | | | route to OrigAddr. |
+--------------+---------------+------------+-----------------------+

8.1.4.2. Address Block TLVs for TargAddr

+------------+--------------+-------------+-------------------------+
| Data | TLV Type | Extension | Value |
| Element | | Type | |
+------------+--------------+-------------+-------------------------+
| None | ADDRESS_TYPE | 0 | ADDRTYPE_TARGADDR |
| TargSeqNum | SEQ_NUM | 0 | The last known |
| | | | TargSeqNum for |
| | | | TargAddr. |
+------------+--------------+-------------+-------------------------+

8.2. Route Reply Message Representation

8.2.1. Message Header












Perkins, et al. Expires May 11, 2016 [Page 54]

Internet-Draft AODVv2 November 2015


+---------------+-----------------+---------------------------------+
| Data Element | Header Field | Value |
+---------------+-----------------+---------------------------------+
| None | <msg-type> | RREP |
| msg_hop_limit | <msg-hop-limit> | <msg-hop-count> from |
| | | corresponding RREQ, reduced by |
| | | number of hops traversed so far |
| | | by the message. |
| msg_hop_count | <msg-hop-count> | Number of hops traversed so far |
| | | by the message. |
+---------------+-----------------+---------------------------------+

8.2.2. Message TLV Block

An RREP contains no Message TLVs.

8.2.3. Address Block

An RREP contains a minimum of two Addresses, OrigAddr and TargAddr,
and each address has an associated prefix length. If the prefix
length has not been included in the AODVv2 message, it is equal to
the address length in bits.

It MAY also contain the address of the intended next hop, in order to
request acknowledgement to confirm bidirectionality of the link, as
described in Section 6.2. The prefix length associated with this
address is equal to the address length in bits.

+-------------------------+------------------------------+
| Data Elements | Address Block |
+-------------------------+------------------------------+
| OrigAddr/OrigPrefixLen | <address> + <prefix-length> |
| TargAddr/TargPrefixLen | <address> + <prefix-length> |
| AckReq | <address> + <prefix-length> |
+-------------------------+------------------------------+

8.2.4. Address Block TLV Block

Address Block TLVs are always associated with one or more addresses
in the Address Block. The following sections show the TLVs that
apply to each address.

8.2.4.1. Address Block TLVs for OrigAddr








Perkins, et al. Expires May 11, 2016 [Page 55]

Internet-Draft AODVv2 November 2015


+-------------+---------------+----------------+--------------------+
| Data | TLV Type | Extension Type | Value |
| Element | | | |
+-------------+---------------+----------------+--------------------+
| None | ADDRESS_TYPE | 0 | ADDRTYPE_ORIGADDR |
+-------------+---------------+----------------+--------------------+

8.2.4.2. Address Block TLVs for TargAddr

+--------------+---------------+------------+-----------------------+
| Data Element | TLV Type | Extension | Value |
| | | Type | |
+--------------+---------------+------------+-----------------------+
| None | ADDRESS_TYPE | 0 | ADDRTYPE_TARGADDR |
| TargSeqNum | SEQ_NUM | 0 | Sequence number of |
| | | | RREP_Gen, the router |
| | | | which created the |
| | | | RREP. |
| TargMetric | PATH_METRIC | MetricType | Metric value for the |
| /MetricType | | | route to TargAddr, |
| | | | using MetricType. |
| ValidityTime | VALIDITY_TIME | 0 | ValidityTime for |
| | | | route to TargAddr. |
+--------------+---------------+------------+-----------------------+

8.2.4.3. Address Block TLVs for AckReq Intended Recipient Address

+--------------+---------------+-----------------+------------------+
| Data Element | TLV Type | Extension Type | Value |
+--------------+---------------+-----------------+------------------+
| None | ADDRESS_TYPE | 0 | ADDRTYPE_INTEND |
+--------------+---------------+-----------------+------------------+

8.3. Route Reply Acknowledgement Message Representation

8.3.1. Message Header

+---------------+---------------+-----------+
| Data Element | Header Field | Value |
+---------------+---------------+-----------+
| None | <msg-type> | RREP_Ack |
+---------------+---------------+-----------+

8.3.2. Message TLV Block

An RREP_Ack contains no Message TLVs.





Perkins, et al. Expires May 11, 2016 [Page 56]

Internet-Draft AODVv2 November 2015


8.3.3. Address Block

An RREP_Ack contains no Address Block.

8.3.4. Address Block TLV Block

An RREP_Ack contains no Address Block TLV Block.

8.4. Route Error Message Representation

8.4.1. Message Header

+---------------+-----------------+---------------------------------+
| Data Element | Header Field | Value |
+---------------+-----------------+---------------------------------+
| None | <msg-type> | RERR |
| msg_hop_limit | <msg-hop-limit> | MAX_HOPCOUNT, reduced by number |
| | | of hops traversed so far by the |
| | | message. |
+---------------+-----------------+---------------------------------+

8.4.2. Message TLV Block

An RERR contains no Message TLVs.

8.4.3. Address Block

The Address Block in an RERR MAY contain PktSource, the source
address of the IP packet triggering RERR generation, as detailed in
Section 7.4. Prefix Length associated with PktSource is equal to the
address length in bits.

Address Block always contains one Address per route that is no longer
valid, and each address has an associated prefix length. If a prefix
length has not been included for this address, it is equal to the
address length in bits.

+------------------------------+------------------------------------+
| Data Element | Address Block |
+------------------------------+------------------------------------+
| PktSource | <address> + <prefix-length> for |
| | PktSource |
| AddressList/PrefixLengthList | <address> + <prefix-length> for |
| | each unreachable address in |
| | AddressList |
+------------------------------+------------------------------------+





Perkins, et al. Expires May 11, 2016 [Page 57]

Internet-Draft AODVv2 November 2015


8.4.4. Address Block TLV Block

Address Block TLVs are always associated with one or more addresses
in the Address Block. The following sections show the TLVs that
apply to each type of address in the RERR.

8.4.4.1. Address Block TLVs for PktSource

+--------------+---------------+---------------+--------------------+
| Data Element | TLV Type | Extension | Value |
| | | Type | |
+--------------+---------------+---------------+--------------------+
| PktSource | ADDRESS_TYPE | 0 | ADDRTYPE_PKTSOURCE |
+--------------+---------------+---------------+--------------------+

8.4.4.2. Address Block TLVs for Unreachable Addresses

+----------------+--------------+------------+----------------------+
| Data Element | TLV Type | Extension | Value |
| | | Type | |
+----------------+--------------+------------+----------------------+
| None | ADDRESS_TYPE | 0 | ADDRTYPE_UNREACHABLE |
| SeqNumList | SEQ_NUM | 0 | Sequence Number |
| | | | associated with |
| | | | invalid route to the |
| | | | unreachable address. |
| MetricTypeList | PATH_METRIC | MetricType | None. Extension Type |
| | | | set to MetricType of |
| | | | the route to the |
| | | | unreachable address. |
+----------------+--------------+------------+----------------------+

9. Simple External Network Attachment

Figure 4 shows a stub (i.e., non-transit) network of AODVv2 routers
which is attached to an external network via a single External
Network Access Router (ENAR). The interface to the external network
MUST NOT be configured in the AODVv2_INTERFACES list.

As in any externally-attached network, AODVv2 routers and Router
Clients that wish to be reachable from hosts on the external network
MUST have IP addresses within the ENAR's routable and topologically
correct prefix (i.e., 191.0.2.0/24 in Figure 4). This AODVv2 network
and subnets within it will be advertised to the external network
using procedures which are out of scope for this specification.






Perkins, et al. Expires May 11, 2016 [Page 58]

Internet-Draft AODVv2 November 2015


/-------------------------\
/ +----------------+ \
/ | AODVv2 Router | \
| | 191.0.2.2/32 | |
| +----------------+ | Routable
| +-----+--------+ Prefix
| | ENAR | /191.0.2.0/24
| | AODVv2 Router| /
| | 191.0.2.1 |/ /---------------\
| | serving net +------+ External \
| | 191.0.2.0/24 | \ Network /
| +-----+--------+ \---------------/
| +----------------+ |
| | AODVv2 Router | |
| | 191.0.2.3/32 | |
\ +----------------+ /
\ /
\-------------------------/

Figure 4: Simple External Network Attachment Example

When an AODVv2 router within the AODVv2 MANET wants to discover a
route toward an address on the external network, it uses the normal
AODVv2 route discovery for that IP Destination Address. The ENAR
MUST respond to RREQ on behalf of all external network destinations,
i.e., destinations not on the configured 191.0.2.0/24 subnet. RREQs
for addresses inside the AODVv2 network, i.e. destinations on the
configured 191.0.2.0/24 subnet, are handled using the standard
processes described in Section 7.

When an IP packet from an address on the external network destined
for an address in the AODVv2 MANET reaches the ENAR, if the ENAR does
not have a route toward that exact destination in its Routing
Information Base, it will perform normal AODVv2 route discovery for
that destination.

Configuring the ENAR as a default router is outside the scope of this
specification.

10. Optional Features

A number of optional features for AODVv2, associated initially with
AODV, MAY be useful in networks with greater mobility or larger node
populations, or networks requiring reduced latency for application
launches. These features are not required by minimal
implementations.





Perkins, et al. Expires May 11, 2016 [Page 59]

Internet-Draft AODVv2 November 2015


10.1. Expanding Rings Multicast

For multicast RREQ, msg_hop_limit MAY be set in accordance with an
expanding ring search as described in [RFC3561] to limit the RREQ
propagation to a subset of the local network and possibly reduce
route discovery overhead.

10.2. Precursor Lists

This section specifies an interoperable enhancement to AODVv2
enabling more economical RERR notifications.

There can be several sources of traffic for a certain destination.
Each source of traffic and each upstream router between the
forwarding AODVv2 router and the traffic source is known as a
"precursor" for the destination. For each destination, an AODVv2
router MAY choose to keep track of precursors that have provided
traffic for that destination. Route Error messages about that
destination can be sent unicast to these precursors instead of
multicast to all AODVv2 routers.

Since an RERR will be regenerated if it comes from a next hop on a
valid LocalRoute, the RERR SHOULD ideally be sent backwards along the
route that the source of the traffic uses, to ensure it is
regenerated at each hop and reaches the traffic source. If the
reverse path is unknown, the RERR SHOULD be sent toward the source
along some other route. Therefore, the options for saving precursor
information are as follows:

o Save the next hop on an existing route to the IP packet's source
address as the precursor. In this case, it is not guaranteed that
an RERR that is sent will follow the reverse of the source's
route. In rare situations, this may prevent the route from being
invalidated at the source of the data traffic.

o Save the IP packet's source address as the precursor. In this
case, the RERR can be sent along any existing route to the source
of the data traffic, and SHOULD include the PktSource Data Element
to ensure that the route will be invalidated at the source of the
traffic, in case the RERR does not follow the reverse of the
source's route.

o By inspecting the MAC address of each forwarded IP packet,
determine which router forwarded the packet, and save the router
address as a precursor. This ensures that when an RERR is sent to
the precursor router, the route will be invalidated at that
router, and the RERR will be regenerated toward the source of the
IP packet.



Perkins, et al. Expires May 11, 2016 [Page 60]

Internet-Draft AODVv2 November 2015


During normal operation, each AODVv2 router maintaining precursor
lists for a LocalRoute must update the precursor list whenever it
uses this route to forward traffic to the destination. Precursors
are classified as Active if traffic has recently been forwarded by
the precursor. The precursor is marked with a timestamp to indicate
the time it last forwarded traffic on this route.

When an AODVv2 router detects that one or more LocalRoutes are
broken, it MAY notify each Active precursor using a unicast Route
Error message instead of creating multicast traffic. Unicast is
applicable when there are few Active precursors compared to the
number of neighboring AODVv2 routers. However, the default multicast
behavior is still preferable when there are many precursors, since
fewer message transmissions are required.

When an AODVv2 router supporting precursor lists receives an RERR
message, it MAY identify the list of its own affected Active
precursors for the routes in the RERR, and choose to send a unicast
RERR to those, rather than send a multicast RERR.

When a LocalRoute is expunged, any precursor list associated with it
MUST also be expunged.

10.3. Intermediate RREP

Without iRREP, only the AODVv2 router responsible for the target
address can respond to an RREQ. Using iRREP, route discoveries can
be faster and create less control traffic. This specification has
been published as a separate Internet Draft [I-D.perkins-irrep].

10.4. Message Aggregation Delay

The aggregation of multiple messages into a packet is specified in
[RFC5444].

Implementations MAY choose to briefly delay transmission of messages
for the purpose of aggregation (into a single packet) or to improve
performance by using jitter [RFC5148].

11. Configuration

AODVv2 uses various parameters which can be grouped into the
following categories:

o Timers

o Protocol constants




Perkins, et al. Expires May 11, 2016 [Page 61]

Internet-Draft AODVv2 November 2015


o Administrative parameters and controls

This section show the parameters along with their definitions and
default values (if any).

Note that several fields have limited size (bits or bytes). These
sizes and their encoding may place specific limitations on the values
that can be set.

11.1. Timers

AODVv2 requires certain timing information to be associated with
Local Route Set entries and message replies. The default values are
as follows:

+------------------------+----------------+
| Name | Default Value |
+------------------------+----------------+
| ACTIVE_INTERVAL | 5 second |
| MAX_IDLETIME | 200 seconds |
| MAX_BLACKLIST_TIME | 200 seconds |
| MAX_SEQNUM_LIFETIME | 300 seconds |
| RteMsg_ENTRY_TIME | 12 seconds |
| RREQ_WAIT_TIME | 2 seconds |
| RREP_Ack_SENT_TIMEOUT | 1 second |
| RREQ_HOLDDOWN_TIME | 10 seconds |
+------------------------+----------------+

Table 2: Timing Parameter Values

The above timing parameter values have worked well for small and
medium well-connected networks with moderate topology changes. The
timing parameters SHOULD be administratively configurable. Ideally,
for networks with frequent topology changes the AODVv2 parameters
SHOULD be adjusted using experimentally determined values or dynamic
adaptation. For example, in networks with infrequent topology
changes MAX_IDLETIME MAY be set to a much larger value.

If MAX_SEQNUM_LIFETIME was configured differently across the network,
and any of the routers lost their sequence number or rebooted, this
could result in their next route messages being classified as stale
at any AODVv2 router using a greater value for MAX_SEQNUM_LIFETIME.
This would delay route discovery from and to the re-initializing
router.







Perkins, et al. Expires May 11, 2016 [Page 62]

Internet-Draft AODVv2 November 2015


11.2. Protocol Constants

AODVv2 protocol constants typically do not require changes. The
following table lists these constants, along with their values and a
reference to the section describing their use.

+------------------------+---------+--------------------------------+
| Name | Default | Description |
+------------------------+---------+--------------------------------+
| DISCOVERY_ATTEMPTS_MAX | 3 | Section 6.6 |
| RREP_RETRIES | 2 | Section 7.2.1 |
| MAX_METRIC[MetricType] | [TBD] | Section 5 |
| MAX_METRIC[HopCount] | 20 hops | Section 5 and Section 7 |
| MAX_HOPCOUNT | 20 | Same as MAX_METRIC[HopCount] |
| INFINITY_TIME | [TBD] | Maximum expressible clock time |
| | | (Section 6.7.2) |
+------------------------+---------+--------------------------------+

Table 3: AODVv2 Constants

Note that <msg-hop-count> is an 8-bit field in the [RFC5444] message
header and therefore MAX_HOPCOUNT cannot be larger than 255.

MAX_METRIC[MetricType] MUST always be the maximum expressible metric
value of type MetricType. Field lengths associated with metric
values are found in Section 11.6.

These protocol constants MUST have the same values for all AODVv2
routers in the ad hoc network. If the values were configured
differently, the following consequences may be observed:

o DISCOVERY_ATTEMPTS_MAX: Routers with higher values are likely to
be more successful at finding routes, at the cost of additional
control traffic.

o RREP_RETRIES: Routers with lower values are more likely to
blacklist neighbors when there is a

o MAX_METRIC[MetricType]: No interoperability problems due to
variations on different routers, but routers with lower values may
exhibit overly restrictive behavior during route comparisons.
temporary fluctuation in link quality.

o MAX_HOPCOUNT: Routers with a value too small would not be able to
discover routes to distant addresses.






Perkins, et al. Expires May 11, 2016 [Page 63]

Internet-Draft AODVv2 November 2015


o INFINITY_TIME: No interoperability problems due to variations on
different routers, but if a lower value is used, route state
management may exhibit overly restrictive behavior.

11.3. Local Settings

The following table lists AODVv2 parameters which SHOULD be
administratively configured for each router:

+------------------------+------------------------+--------------+
| Name | Default Value | Description |
+------------------------+------------------------+--------------+
| AODVv2_INTERFACES | | Section 3 |
| BUFFER_SIZE_PACKETS | 2 | Section 6.6 |
| BUFFER_SIZE_BYTES | MAX_PACKET_SIZE [TBD] | Section 6.6 |
| CONTROL_TRAFFIC_LIMIT | [TBD - 50 pkts/sec?] | Section 7 |
+------------------------+------------------------+--------------+

Table 4: Configuration for Local Settings

11.4. Network-Wide Settings

The following administrative controls MAY be used to change the
operation of the network. The same settings SHOULD be used across
the network. Inconsistent settings at different routers in the
network will not result in protocol errors, but poor performance may
result.

+----------------------+-----------+----------------+
| Name | Default | Description |
+----------------------+-----------+----------------+
| ENABLE_IDLE_IN_RERR | Disabled | Section 7.4.1 |
+----------------------+-----------+----------------+

Table 5: Configuration for Network-Wide Settings

11.5. Optional Feature Settings

These options are not required for correct routing behavior, although
they may reduce AODVv2 protocol overhead in certain situations. The
default behavior is to leave these options disabled.










Perkins, et al. Expires May 11, 2016 [Page 64]

Internet-Draft AODVv2 November 2015


+---------------------------+-----------+---------------------------+
| Name | Default | Description |
+---------------------------+-----------+---------------------------+
| PRECURSOR_LISTS | Disabled | Local (Section 10.2) |
| MSG_AGGREGATION | Disabled | Local (Section 10.4) |
| ENABLE_IRREP | Disabled | Network-wide (Section |
| | | 10.3) |
| EXPANDING_RINGS_MULTICAST | Disabled | Network-wide (Section |
| | | 10.1) |
+---------------------------+-----------+---------------------------+

Table 6: Configuration for Optional Features

11.6. MetricType Allocation

The metric types used by AODVv2 are identified according to the
assignments in [RFC6551]. All implementations MUST use these values.

+---------------------+----------+--------------------+
| Name of MetricType | Type | Metric Value Size |
+---------------------+----------+--------------------+
| Unassigned | 0 | Undefined |
| Hop Count | 3 [TBD] | 1 octet |
| Unallocated | 9 - 254 | TBD |
| Reserved | 255 | Undefined |
+---------------------+----------+--------------------+

Table 7: AODVv2 Metric Types

11.7. AddressType Allocation

These values are used in the [RFC5444] Address Type TLV discussed in
Section 8. All implementations MUST use these values.

+-----------------------+--------+
| Address Type | Value |
+-----------------------+--------+
| ADDRTYPE_ORIGADDR | 0 |
| ADDRTYPE_TARGADDR | 1 |
| ADDRTYPE_UNREACHABLE | 2 |
| ADDRTYPE_PKTSOURCE | 3 |
| ADDRTYPE_INTEND | 4 |
| ADDRTYPE_UNSPECIFIED | 255 |
+-----------------------+--------+

Table 8: AODVv2 Address Types





Perkins, et al. Expires May 11, 2016 [Page 65]

Internet-Draft AODVv2 November 2015


12. IANA Considerations

This section specifies several [RFC5444] message types and address
tlv-types required for AODVv2. A registry of metric types is
specified, in addition to a registry of address types.

12.1. RFC 5444 Message Types

This specification defines four Message Types, to be allocated from
the 0-223 range of the "Message Types" namespace defined in
[RFC5444], as specified in Table 9.

+-----------------------------------------+-----------+
| Name of Message | Type |
+-----------------------------------------+-----------+
| Route Request (RREQ) | 10 (TBD) |
| Route Reply (RREP) | 11 (TBD) |
| Route Error (RERR) | 12 (TBD) |
| Route Reply Acknowledgement (RREP_Ack) | 13 (TBD) |
+-----------------------------------------+-----------+

Table 9: AODVv2 Message Types

12.2. RFC 5444 Address Block TLV Types

This specification defines three Address Block TLV Types, to be
allocated from the "Address Block TLV Types" namespace defined in
[RFC5444], as specified in Table 10.

+------------------------+----------+---------------+---------------+
| Name of TLV | Type | Length | Reference |
| | | (octets) | |
+------------------------+----------+---------------+---------------+
| PATH_METRIC | 10 (TBD) | depends on | Section 7 |
| | | MetricType | |
| SEQ_NUM | 11 (TBD) | 2 | Section 7 |
| ADDRESS_TYPE | 15 (TBD) | 1 | Section 8 |
+------------------------+----------+---------------+---------------+

Table 10: AODVv2 Address Block TLV Types

13. Security Considerations

This section describes various security considerations and potential
avenues to secure AODVv2 routing. The objective of the AODVv2
protocol is for each router to communicate reachability information
about addresses for which it is responsible, and for routes it has
learned from other AODVv2 routers. Positive routing information



Perkins, et al. Expires May 11, 2016 [Page 66]

Internet-Draft AODVv2 November 2015


(i.e. a route exists) is distributed via RREQ and RREP messages.
AODVv2 routers store the information contained in these messages in
order to properly forward IP packets, and they generally provide this
information to other AODVv2 routers. Negative routing information
(i.e. a route does not exist) is distributed via RERR messages.
AODVv2 routers process these messages and remove routes, and forward
this information to other AODVv2 routers.

Networks using AODVv2 to maintain connectivity and establish routes
on demand may be vulnerable to certain well-known types of threats.
Flooding attacks using RREQ amount to a denial of service for route
discovery. Valid route table entries can be replaced by maliciously
constructed RREQ and RREP messages. Links could be erroneously
treated as bidirectional if malicious unsolicited RREP or RREP_Ack
messages were to be accepted. Replay attacks using RERR messages
could, in some circumstances, be used to disrupt active routes.
Passive inspection of AODVv2 control messages could enable
unauthorized devices to gain information about the network topology,
since exchanging such information is the main purpose of AODVv2.

The on-demand nature of AODVv2 route discovery reduces the
vulnerability to route disruption. Since control traffic for
updating route tables is diminished, there is less opportunity for
failure. Processing requirements for AODVv2 are typically quite
small, and would typically be dominated by calculations to verify
integrity. This has the effect of reducing (but by no means
eliminating) AODVv2's vulnerability to denial of service attacks.

Encryption MAY be used for AODVv2 messages. If the routers share a
packet-level security association, the message data can be encrypted
prior to message transmission. The establishment of such security
associations is outside the scope of this specification. Encryption
will not only protect against unauthorized devices obtaining
information about network topology but will ensure that only trusted
routers participate in routing operations.

Message integrity checking is enabled by the Integrity Check Value
mechanisms defined in [RFC7182]. The data contained in AODVv2
routing protocol messages SHOULD be verified using ICV values, to
avoid the use of message data if the message has been tampered with
or replayed. Otherwise, it would be possible to disrupt
communications by injecting nonexistent or malicious routes into the
route tables of routers within the ad hoc network. This can result
in loss of data or message processing by unauthorized devices.

The remainder of this section provides specific recommendations for
the use of the integrity checking and timestamp functions defined in
[RFC7182] to ensure the integrity of each AODVv2 message. The



Perkins, et al. Expires May 11, 2016 [Page 67]

Internet-Draft AODVv2 November 2015


calculation used for the Integrity Check Value will depend on the
message type. Sequence numbers can be used as timestamps to protect
against replay, since they are known to be strictly increasing.

RREQ messages advertise a route to OrigAddr, and impose very little
processing requirement for receivers. The main threat presented by
sending an RREQ message with false information is that traffic to
OrigAddr could be disrupted. Since RREQ is multicast and likely to
be received by all routers in the ad hoc network, this threat could
have serious impact on applications communicating by way of OrigAddr.
The actual threat to disrupt routes to OrigAddr is reduced by the
AODVv2 mechanism of marking RREQ-derived routes as "Unconfirmed"
until the link to the next hop is confirmed. If AODVv2 routers
always verify the integrity of the RREQ message data, then the threat
of disruption is minimized. The ICV mechanisms offered in [RFC7182]
are sufficient for this purpose. Since OrigAddr is included as a
Data Element of the RREQ, the ICV can be calculated and verified
using message contents. The ICV SHOULD be verified at every step
along the dispersal path of the RREQ to mitigate the threat. Since
RREQ_Gen's sequence number is incremented for each new RREQ, replay
protection is already afforded and no extra timestamp mechanism is
required.

RREP messages advertise a route to TargAddr, and impose very little
processing requirement for receivers. The main threat presented by
sending an RREP message with false information is that traffic to
TargAddr could be disrupted. Since RREP is unicast, this threat is
restricted to receivers along the path from OrigAddr to TargAddr. If
AODVv2 routers always verify the integrity of the RREP message data,
then this threat is minimized. This facility is offered by the ICV
mechanisms in [RFC7182]. Since TargAddr is included as a Data
Element of the RREP, the ICV can be calculated and verified using
message contents. The ICV SHOULD be verified at every step along the
unicast path of the RREP. Since RREP_Gen's sequence number is
incremented for each new RREP, replay protection is afforded and no
extra timestamp mechanism is required.

RREP_Ack messages are intended to verify bidirectional neighbor
connectivity, and impose very little processing requirement for
receivers. The main threat presented by sending an RREP_Ack message
with false information is that the route advertised to a target
address in an RREP might be erroneously accepted even though the
route would contain a unidirectional link and thus not be suitable
for most traffic. Since RREP_Ack is unicast, this threat is strictly
local to the RREP transmitter expecting the acknowledgement. A
malicious router could also attempt to send an unsolicited RREP_Ack
to convince another router that a bidirectional link exists and
subsequently use further messages to divert traffic along a route



Perkins, et al. Expires May 11, 2016 [Page 68]

Internet-Draft AODVv2 November 2015


which is not valid. If AODVv2 routers always verify the integrity of
the RREP_Ack message data, then this threat is minimized. This
facility is offered by the ICV mechanisms in [RFC7182]. The RREP_Gen
SHOULD use the source IP address of the RREP_Ack to identify the
sender, and so the ICV SHOULD be calculated using the message
contents and the IP source address. The message must also include
the Timestamp defined in [RFC7182] to protect against replay attacks,
using TargSeqNum from the RREP as the value in the TIMESTAMP TLV.

RERR messages remove routes, and impose very little processing
requirement for receivers. The main threat presented by sending an
RERR message with false information is that traffic to the advertised
destinations could be disrupted. Since RERR is multicast and can be
received by many routers in the ad hoc network, this threat could
have serious impact on applications communicating by way of the
sender of the RERR message. However, since the sender of the RERR
message with erroneous information MAY be presumed to be either
malicious or broken, it is better that such routes not be used
anyway. Another threat is that a malicious RERR message MAY be sent
with a PktSource Data Element included, to disrupt PktSource's
ability to send to the addresses contained in the RERR. If AODVv2
routers always verify the integrity of the RERR message data, then
this threat is reduced. This facility is offered by the ICV
mechanisms in [RFC7182]. The receiver of the RERR SHOULD use the
source IP address of the RERR to identify the sender. The message
must also include the Timestamp defined in [RFC7182] to protect
against replay attacks, using SeqNum from RERR_Gen as the value in
the TIMESTAMP TLV.

14. Acknowledgments

AODVv2 is a descendant of the design of previous MANET on-demand
protocols, especially AODV [RFC3561] and DSR [RFC4728]. Changes to
previous MANET on-demand protocols stem from research and
implementation experiences. Thanks to Elizabeth Belding and Ian
Chakeres for their long time authorship of AODV. Additional thanks
to Derek Atkins, Emmanuel Baccelli, Abdussalam Baryun, Ramon Caceres,
Thomas Clausen, Justin Dean, Christopher Dearlove, Ulrich Herberg,
Henner Jakob, Luke Klein-Berndt, Lars Kristensen, Tronje Krop,
Koojana Kuladinithi, Kedar Namjoshi, Keyur Patel, Alexandru Petrescu,
Henning Rogge, Fransisco Ros, Pedro Ruiz, Christoph Sommer, Romain
Thouvenin, Richard Trefler, Jiazi Yi, Seung Yi, and Cong Yuan, for
their reviews of AODVv2 and DYMO, as well as numerous specification
suggestions.







Perkins, et al. Expires May 11, 2016 [Page 69]

Internet-Draft AODVv2 November 2015


15. References

15.1. Normative References

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/
RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>.

[RFC3561] Perkins, C., Belding-Royer, E., and S. Das, "Ad hoc On-
Demand Distance Vector (AODV) Routing", RFC 3561, DOI
10.17487/RFC3561, July 2003,
<http://www.rfc-editor.org/info/rfc3561>.

[RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing
Architecture", RFC 4291, DOI 10.17487/RFC4291, February
2006, <http://www.rfc-editor.org/info/rfc4291>.

[RFC5082] Gill, V., Heasley, J., Meyer, D., Savola, P., Ed., and C.
Pignataro, "The Generalized TTL Security Mechanism
(GTSM)", RFC 5082, DOI 10.17487/RFC5082, October 2007,
<http://www.rfc-editor.org/info/rfc5082>.

[RFC5444] Clausen, T., Dearlove, C., Dean, J., and C. Adjih,
"Generalized Mobile Ad Hoc Network (MANET) Packet/Message
Format", RFC 5444, DOI 10.17487/RFC5444, February 2009,
<http://www.rfc-editor.org/info/rfc5444>.

[RFC5497] Clausen, T. and C. Dearlove, "Representing Multi-Value
Time in Mobile Ad Hoc Networks (MANETs)", RFC 5497, DOI
10.17487/RFC5497, March 2009,
<http://www.rfc-editor.org/info/rfc5497>.

[RFC5498] Chakeres, I., "IANA Allocations for Mobile Ad Hoc Network
(MANET) Protocols", RFC 5498, DOI 10.17487/RFC5498, March
2009, <http://www.rfc-editor.org/info/rfc5498>.

[RFC6551] Vasseur, JP., Ed., Kim, M., Ed., Pister, K., Dejean, N.,
and D. Barthel, "Routing Metrics Used for Path Calculation
in Low-Power and Lossy Networks", RFC 6551, DOI 10.17487/
RFC6551, March 2012,
<http://www.rfc-editor.org/info/rfc6551>.

[RFC7182] Herberg, U., Clausen, T., and C. Dearlove, "Integrity
Check Value and Timestamp TLV Definitions for Mobile Ad
Hoc Networks (MANETs)", RFC 7182, DOI 10.17487/RFC7182,
April 2014, <http://www.rfc-editor.org/info/rfc7182>.




Perkins, et al. Expires May 11, 2016 [Page 70]

Internet-Draft AODVv2 November 2015


15.2. Informative References

[I-D.perkins-irrep]
Perkins, C., "Intermediate RREP for dynamic MANET On-
demand (AODVv2) Routing", draft-perkins-irrep-03 (work in
progress), May 2015.

[Perkins94]
Perkins, C. and P. Bhagwat, "Highly Dynamic Destination-
Sequenced Distance-Vector Routing (DSDV) for Mobile
Computers", Proceedings of the ACM SIGCOMM '94 Conference
on Communications Architectures, Protocols and
Applications, London, UK, pp. 234-244, August 1994.

[Perkins99]
Perkins, C. and E. Royer, "Ad hoc On-Demand Distance
Vector (AODV) Routing", Proceedings of the 2nd IEEE
Workshop on Mobile Computing Systems and Applications, New
Orleans, LA, pp. 90-100, February 1999.

[RFC2501] Corson, S. and J. Macker, "Mobile Ad hoc Networking
(MANET): Routing Protocol Performance Issues and
Evaluation Considerations", RFC 2501, DOI 10.17487/
RFC2501, January 1999,
<http://www.rfc-editor.org/info/rfc2501>.

[RFC4193] Hinden, R. and B. Haberman, "Unique Local IPv6 Unicast
Addresses", RFC 4193, DOI 10.17487/RFC4193, October 2005,
<http://www.rfc-editor.org/info/rfc4193>.

[RFC4728] Johnson, D., Hu, Y., and D. Maltz, "The Dynamic Source
Routing Protocol (DSR) for Mobile Ad Hoc Networks for
IPv4", RFC 4728, DOI 10.17487/RFC4728, February 2007,
<http://www.rfc-editor.org/info/rfc4728>.

[RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman,
"Neighbor Discovery for IP version 6 (IPv6)", RFC 4861,
DOI 10.17487/RFC4861, September 2007,
<http://www.rfc-editor.org/info/rfc4861>.

[RFC5148] Clausen, T., Dearlove, C., and B. Adamson, "Jitter
Considerations in Mobile Ad Hoc Networks (MANETs)", RFC
5148, DOI 10.17487/RFC5148, February 2008,
<http://www.rfc-editor.org/info/rfc5148>.







Perkins, et al. Expires May 11, 2016 [Page 71]

Internet-Draft AODVv2 November 2015


[RFC6130] Clausen, T., Dearlove, C., and J. Dean, "Mobile Ad Hoc
Network (MANET) Neighborhood Discovery Protocol (NHDP)",
RFC 6130, DOI 10.17487/RFC6130, April 2011,
<http://www.rfc-editor.org/info/rfc6130>.

[RFC6621] Macker, J., Ed., "Simplified Multicast Forwarding", RFC
6621, DOI 10.17487/RFC6621, May 2012,
<http://www.rfc-editor.org/info/rfc6621>.

[Sholander02]
Sholander, P., Coccoli, P., Oakes, T., and S. Swank, "A
Portable Software Implementation of a Hybrid MANET Routing
Protocol", 2002.

Appendix A. Multi-homing Considerations

Multi-homing is not supported by the AODVv2 specification. A Router
Client, i.e., an IP Address, can only be served by one AODVv2 router
at any time. The coordination between multiple AODVv2 routers to
distribute routing information correctly for a shared address is not
defined. See Appendix B for information about how to move a Router
Client to a different AODVv2 router.

Previous work indicates that it can be supported by expanding the
sequence number to include the AODVv2 router's IP address as a
parsable field of the SeqNum. Without this, comparing sequence
numbers would not work to evaluate freshness. Even when the IP
address is included, there is no good way to compare sequence numbers
from different IP addresses, but a handling node can determine
whether the two given sequence numbers are comparable. If the route
table can store multiple routes for the same destination, then multi-
homing can work with sequence numbers augmented by IP addresses.

This non-normative information is provided simply to document the
results of previous efforts to enable multi-homing. The intention is
to simplify the task of future specification if multihoming becomes
necessary for reactive protocol operation.

Appendix B. Router Client Relocation

Only one AODVv2 router within a MANET SHOULD be responsible for a
particular address at any time. If two AODVv2 routers dynamically
shift the advertisement of a network prefix, correct AODVv2 routing
behavior must be observed. The AODVv2 router adding the new network
prefix must wait for any existing routing information about this
network prefix to be purged from the network, i.e., it must wait at
least MAX_SEQNUM_LIFETIME after the previous AODVv2 router's last
SeqNum update for this network prefix.



Perkins, et al. Expires May 11, 2016 [Page 72]

Internet-Draft AODVv2 November 2015


Appendix C. Example Algorithms for AODVv2 Operations

The following subsections show example algorithms for protocol
operations required by AODVv2. AODVv2 requires general algorithms
for manipulating and comparing table entries, and algorithms specific
to each message type, and sometimes values and algorithms specific to
each metric type.

The following table indicates the field names used in subsequent
sections and their meaning.

+-------------------------+-----------------------------------------+
| Parameter | Description |
+-------------------------+-----------------------------------------+
| RteMsg | A route message |
| | (inRREQ/outRREQ/inRREP/outRREP) |
| RteMsg.HopLimit | Hop limit for the message |
| RteMsg.HopCount | Hop count for the message |
| RteMsg.AckReq | True/False, optional in RREP |
| RteMsg.MetricType | The type of metric included, optional |
| RteMsg.OrigAddr | Address of source of queued data |
| RteMsg.TargAddr | Address route is requested for |
| RteMsg.OrigPrefixLen | Prefix length of OrigAddr, optional |
| RteMsg.TargPrefixLen | Prefix length of TargAddr, optional |
| RteMsg.OrigSeqNum | SeqNum of OrigAddr, in RREQ only |
| RteMsg.TargSeqNum | SeqNum of TargAddr, in RREP, optional |
| | in RREQ |
| RteMsg.OrigMetric | Metric to OrigAddr, in RREQ only |
| RteMsg.TargMetric | Metric to TargAddr, in RREP only |
| RteMsg.ValidityTime | Time limit for route advertised |
| RteMsg.NbrIP | Sender of the RteMsg |
| RteMsg.Netif | Interface on which the RteMsg arrived |
| AdvRte | Derived from a RteMsg (see Section 6.7) |
| AdvRte.Address | Route destination address |
| AdvRte.PrefixLength | Route destination prefix length |
| AdvRte.SeqNum | SeqNum associated with route |
| AdvRte.MetricType | MetricType associated with route |
| AdvRte.Metric | Advertised metric of route |
| AdvRte.Cost | Cost from receiving router |
| AdvRte.ValidityTime | Time limit for route advertised |
| AdvRte.NextHopIP | Sender of the RteMsg |
| AdvRte.NextHopIntf | Interface on which the RteMsg arrived |
| AdvRte.HopCount | Number of hops traversed |
| AdvRte.HopLimit | Allowed number of hops remaining |
| Route | A Local Route Set entry (see Section |
| | 4.5) |
| Route.Address | Route destination address |
| Route.PrefixLength | Route destination prefix length |



Perkins, et al. Expires May 11, 2016 [Page 73]

Internet-Draft AODVv2 November 2015


| Route.SeqNum | SeqNum associated with route |
| Route.NextHop | Address of router which advertised the |
| | route |
| Route.NextHopInterface | Interface on which next hop is |
| | reachable |
| Route.LastUsed | Time this route was last used for |
| | packet forwarding |
| Route.LastSeqNumUpdate | Time the SeqNum of the route was last |
| | updated |
| Route.ExpirationTime | Time at which the route will expire |
| Route.MetricType | MetricType associated with route |
| Route.Metric | Cost from receiving router |
| Route.State | Active/Idle/Invalid/Unconfirmed |
| Route.Precursors | Optional (see Section 10.2) |
| RERR | Route Error message (inRERR/outRERR) |
| RERR.HopLimit | Hop limit for the message |
| RERR.PktSource | Source address of packet which |
| | triggered RERR |
| RERR.AddressList[] | List of unreachable route addresses |
| RERR.PrefixLengthList[] | List of PrefixLengths for AddressList |
| RERR.SeqNumList[] | List of SeqNums for AddressList |
| RERR.MetricTypeList[] | MetricType for the invalid routes |
| RERR.Netif | Interface on which the RERR arrived |
+-------------------------+-----------------------------------------+

Table 11: Notation used in Appendix

C.1. HopCount MetricType

The HopCount MetricType defines:

o MAX_METRIC[HopCount] := MAX_HOPCOUNT. A constant defined in
Section 11.2. MAX_HOPCOUNT is also used to limit the number of
hops an AODVv2 message can travel, regardless of the MetricType in
use. It MUST be larger than the AODVv2 network diameter, in order
that AODVv2 protocol messages may reach their intended
destinations.

o Cost(L) := 1

o Cost(R) := Sum of Cost(L) of each link in the route, i.e., the hop
count between the router calculating the cost, and the destination
of the route (OrigAddr if RREQ, TargAddr if RREP)

o LoopFree(R1, R2) := ( Cost(R1) <= Cost(R2) ). This is derived
from the fact that route cost increases with number of hops.
Therefore, an advertised route with higher cost than the
corresponding existing route could include the existing route as a



Perkins, et al. Expires May 11, 2016 [Page 74]

Internet-Draft AODVv2 November 2015


sub-section. Replacing the existing route with the advertised
route could form a routing loop.

C.2. General Operations

General AODVv2 operations involve the comparisons of incoming and
current data, and updates to local data sets.

C.2.1. Route Operations

C.2.1.1. Check_Route_State

/* Update the state of the Local Route Set entry based on timeouts. Return
whether the route can be used for forwarding a packet. */

Check_Route_State(route)
{
if (CurrentTime > route.ExpirationTime)
route.State := Invalid;
if ((CurrentTime - route.LastUsed > ACTIVE_INTERVAL + MAX_IDLETIME)
AND (route.State != Unconfirmed)
AND (route.ExpirationTime == INFINITY_TIME)) //not a timed route
route.State := Invalid;
if ((CurrentTime - route.LastUsed > ACTIVE_INTERVAL)
AND (route.State != Unconfirmed)
AND (route.ExpirationTime == INFINITY_TIME)) //not a timed route
route.State := Idle;
if ((CurrentTime - route.LastSeqNumUpdate > MAX_SEQNUM_LIFETIME)
AND (route.State == Invalid OR route.State == Unconfirmed))
/* remove route from route table */
if ((CurrentTime - route.LastSeqNumUpdate > MAX_SEQNUM_LIFETIME)
AND (route.State != Invalid)
route.SeqNum := 0;

if (route still exists AND route.State != Invalid
AND Route.State != Unconfirmed)
return TRUE;
else
return FALSE;
}

C.2.1.2. Process_Routing_Info

(See Section 6.7.1)







Perkins, et al. Expires May 11, 2016 [Page 75]

Internet-Draft AODVv2 November 2015


/* Compare incoming route information to stored route, and if better,
use to update stored route in Local Route Set. */

Process_Routing_Info (advRte)
{
rte := Fetch_Route_Set_Entry (advRte);
if (!rte exists)
{
rte := Create_Route_Set_Entry(advRte);
return rte;
}

if (AdvRte.SeqNum > Route.SeqNum /* stored route is stale */
OR
(AdvRte.SeqNum == Route.SeqNum /* same SeqNum */
AND
((Route.State == Invalid AND LoopFree(advRte, rte))
/* advRte can repair stored */
OR AdvRte.Cost < Route.Metric))) /* advRte is better */
{
if (advRte is from a RREQ)
rte := Create_Route_Set_Entry(advRte);
else
Update_Route_Set_Entry (rte, advRte);
}
return rte;
}

C.2.1.3. Fetch_Route_Set_Entry






















Perkins, et al. Expires May 11, 2016 [Page 76]

Internet-Draft AODVv2 November 2015


/* Lookup a Local Route Set entry matching an advertised route */

Fetch_Route_Set_Entry (advRte)
{
foreach (rteSetEntry in rteSet)
{
if (rteSetEntry.Address == advRte.Address
AND rteSetEntry.MetricType == advRte.MetricType)
return rteSetEntry;
}
return null;
}

/* Lookup a Local Route Set entry matching address and metric type */

Fetch_Route_Set_Entry (destination, metricType)
{
foreach (rteSetEntry in rteSet)
{
if (rteSetEntry.Address == destination
AND rteSetEntry.MetricType == metricType)
return rteSetEntry;
}
return null;
}

C.2.1.4. Update_Route_Set_Entry

/* Update a Local Route Set entry using AdvRte in received RteMsg */

Update_Route_Set_Entry (rte, advRte);
{
rte.SeqNum := advRte.SeqNum;
rte.NextHop := advRte.NextHopIp;
rte.NextHopInterface := advRte.NextHopIntf;
rte.LastUsed := CurrentTime;
rte.LastSeqNumUpdate := CurrentTime;
if (validityTime)
rte.ExpirationTime := CurrentTime + advRte.ValidityTime;
else
rte.ExpirationTime := INFINITY_TIME;

rte.Metric := advRte.Cost;
if (rte.State == Invalid)
rte.State := Idle (if advRte is from RREP);
or Unconfirmed (if advRte is from RREQ);
}




Perkins, et al. Expires May 11, 2016 [Page 77]

Internet-Draft AODVv2 November 2015


C.2.1.5. Create_Route_Set_Entry

/* Create a Local Route Set entry from address and prefix length */

Create_Route_Set_Entry (address, prefixLength, seqNum, metricType)
{
rte := allocate_memory();
rte.Address := address;
rte.PrefixLength := prefixLength;
rte.SeqNum := seqNum;
rte.MetricType := metricType;
}


/* Create a Local Route Set entry from the advertised route */

Create_Route_Set_Entry(advRte)
{
rte := allocate_memory();

rte.Address := advRte.Address;
if (advRte.PrefixLength)
rte.PrefixLength := advRte.PrefixLength;
else
rte.PrefixLength := maxPrefixLenForAddressFamily;

rte.SeqNum := advRte.SeqNum;
rte.NextHop := advRte.NextHopIp;
rte.NextHopInterface := advRte.NextHopIntf;
rte.LastUsed := CurrentTime;
rte.LastSeqNumUpdate := CurrentTime;
if (validityTime)
rte.ExpirationTime := CurrentTime + advRte.ValidityTime;
else
rte.ExpirationTime := INFINITY_TIME;
rte.MetricType := advRte.MetricType;
rte.Metric := advRte.Metric;
rte.State := Idle (if advRte is from RREP);
or Unconfirmed (if advRte is from RREQ);
}

C.2.2. LoopFree









Perkins, et al. Expires May 11, 2016 [Page 78]

Internet-Draft AODVv2 November 2015


/* Return TRUE if the route advRte is LoopFree compared to rte */

LoopFree(advRte, rte)
{
if (advRte.Cost <= rte.Cost)
return TRUE;
else
return FALSE;
}

C.2.3. Multicast Route Message Table Operations

C.2.3.1. Fetch_Rte_Msg_Table_Entry

/* Find an entry in the RteMsg table matching the given
message's msg-type, OrigAddr, TargAddr, MetricType */

Fetch_Rte_Msg_Table_Entry (rteMsg)
{
foreach (entry in RteMsgTable)
{
if (entry.msg-type == rteMsg.msg-type
AND entry.OrigAddr == rteMsg.OrigAddr
AND entry.TargAddr == rteMsg.TargAddr
AND entry.MetricType == rteMsg.MetricType)
return entry;
}
return NULL;
}

C.2.3.2. Update_Rte_Msg_Table

(See Section 4.6)

/* Update the multicast route message suppression table based on the
received RteMsg, return true if it was created or the SeqNum was
updated (i.e. it needs to be regenerated) */

Update_Rte_Msg_Table(rteMsg)
{
/* search for a comparable entry */
entry := Fetch_Rte_Msg_Table_Entry(rteMsg);

/* if there is none, create one */
if (entry does not exist)
{
entry.MessageType := rteMsg.msg_type;
entry.OrigAddr := rteMsg.OrigAddr;



Perkins, et al. Expires May 11, 2016 [Page 79]

Internet-Draft AODVv2 November 2015


entry.TargAddr := rteMsg.TargAddr;
entry.OrigSeqNum := rteMsg.origSeqNum; // (if present)
entry.TargSeqNum := rteMsg.targSeqNum; // (if present)
entry.MetricType := rteMsg.MetricType;
entry.Metric := rteMsg.OrigMetric; // (for RREQ)
or rteMsg.TargMetric; // (for RREP)
entry.Timestamp := CurrentTime;
return TRUE;
}

/* if current entry is stale */
if (
(rteMsg.msg-type == RREQ AND entry.OrigSeqNum < rteMsg.OrigSeqNum)
OR
(rteMsg.msg-type == RREP AND entry.TargSeqNum < rteMsg.TargSeqNum))
{
entry.OrigSeqNum := rteMsg.OrigSeqNum; // (if present)
entry.TargSeqNum := rteMsg.TargSeqNum; // (if present)
entry.Timestamp := CurrentTime;
return TRUE;
}

/* if received rteMsg is stale */
if (
(rteMsg.msg-type == RREQ AND entry.OrigSeqNum > rteMsg.OrigSeqNum)
OR
(rteMsg.msg-type == RREP AND entry.TargSeqNum > rteMsg.TargSeqNum))
{
entry.Timestamp := CurrentTime;
return FALSE;
}

/* if same SeqNum but rteMsg has lower metric */
if (entry.Metric > rteMsg.Metric)
entry.Metric := rteMsg.Metric;

entry.Timestamp := CurrentTime;
return FALSE;
}

C.3. Message Algorithms

Processing for messages follows the following general outline:

1. Receive incoming message.

2. Update route table as appropriate.




Perkins, et al. Expires May 11, 2016 [Page 80]

Internet-Draft AODVv2 November 2015


3. Respond as needed, often regenerating the incoming message with
updated information.

After processing a message, the most recent information is stored in
the route table. For this reason, it is equally appropriate to set
outgoing message field values using route table information or using
fields from the incoming message.

C.3.1. Build_RFC_5444_Message_Header

/* This pseudocode shows possible RFC 5444 actions, and would not
be performed by the AODVv2 implementation. It is shown only to
provide more understanding about the AODVv2 message that will be
constructed by RFC 5444.
MAL := Message Address Length
MF := Message Flags
Size := number of octets in MsgHdr, AddrBlk, AddrTLVs */

Build_RFC_5444_Message_Header (msgType, Flags, AddrFamily, Size,
hopLimit, hopCount, tlvLength)
{
/* Build RFC 5444 message header fields */
msg-type := msgType;
MF := Flags;
MAL := 3 or 15; // for IPv4 or IPv6
msg-size := Size;
msg-hop-limit := hopLimit;
if (hopCount != 0) /* if hopCount is 0, do not include */
msg-hop-count := hopCount;
msg.tlvs-length := tlvLength;
}

C.3.2. RREQ Operations

C.3.2.1. Generate_RREQ

/* Generate a route request message to find a route from OrigAddr
to TargAddr using the given MetricType
origAddr := IP address of Router Client which generated the
packet to be forwarded
origPrefix := prefix length associated with the Router Client
targAddr := destination IP address in the packet to be forwarded
targSeqNum := sequence number in existing route to targAddr
mType := metric type for the requested route */

Generate_RREQ(origAddr, origPrefix, targAddr, targSeqNum, mType)
{
/* Increment sequence number in nonvolatile storage */



Perkins, et al. Expires May 11, 2016 [Page 81]

Internet-Draft AODVv2 November 2015


mySeqNum := (1 + mySeqNum);

/* Marshall parameters */
outRREQ.HopLimit := MAX_HOPCOUNT;
outRREQ.HopCount := 0; // if included
outRREQ.MetricType := mType; //include if not DEFAULT_METRIC_TYPE
outRREQ.OrigAddr := origAddr;
outRREQ.TargAddr := targAddr;
outRREQ.OrigPrefixLen := origPrefix; //include if not address length
outRREQ.OrigSeqNum := mySeqNum;
outRREQ.TargSeqNum := targSeqNum; //included if available
outRREQ.OrigMetric := Route[OrigAddr].Metric; //zero by default
outRREQ.ValidityTime := limit for route to OrigAddr; //if required

/* Build Address Blk using prefix length information from
outRREQ.OrigPrefixLen if necessary */
AddrBlk := {outRREQ.OrigAddr, outRREQ.TargAddr};

/* Include sequence numbers in appropriate Address Block TLVs */
/* OrigSeqNum Address Block TLV */
origSeqNumAddrBlkTlv.value := outRREQ.OrigSeqNum;
/* TargSeqNum Address Block TLV */
if (outRREQ.TargSeqNum is known)
targSeqNumAddrBlkTlv.value := outRREQ.TargSeqNum;

/* Build Metric Address Block TLV, include Metric AddrBlkTlv
Extension type if a non-default metric */
metricAddrBlkTlv.value := outRREQ.OrigMetric;
if (outRREQ.MetricType != DEFAULT_METRIC_TYPE)
metricAddrBlkTlv.typeExtension := outRREQ.MetricType;

if (outRREQ.ValidityTime is required)
{
/* Build VALIDITY_TIME Address Block TLV */
VALIDITY_TIMEAddrBlkTlv.value := outRREQ.ValidityTime;
}

Build_RFC_5444_Message_Header (RREQ, 4, IPv4 or IPv6, NN,
outRREQ.HopLimit, outRREQ.HopCount, tlvLength);

/* multicast RFC 5444 message to LL-MANET-Routers */
}

C.3.2.2. Receive_RREQ

/* Process a RREQ received on link L */

Receive_RREQ (inRREQ, L)



Perkins, et al. Expires May 11, 2016 [Page 82]

Internet-Draft AODVv2 November 2015


{
if (inRREQ.NbrIP present in blacklist)
{
if (blacklist_expiration_time < CurrentTime)
return; // don't process or regenerate RREQ
else
remove nbrIP from blacklist;
}
if (inRREQ does not contain msg_hop_limit, OrigAddr,
TargAddr, OrigSeqNum, OrigMetric)
return;
if (msg_hop_count > MAX_HOPCOUNT)
return;
if (msg_hop_limit < 0)
return;
if (inRREQ.OrigAddr and inRREQ.TargAddr are not valid routable
and unicast addresses)
return;
if (inRREQ.MetricType is present but an unknown value)
return;
if (inRREQ.OrigMetric > MAX_METRIC[inRREQ.MetricType] - Cost(L))
return;

/* Extract inRREQ values */
advRte.Address := inRREQ.OrigAddr;
advRte.PrefixLength := inRREQ.OrigPrefixLen; (if present)
or the address length of advRte.Address;
advRte.SeqNum := inRREQ.OrigSeqNum;
advRte.MetricType := inRREQ.MetricType;
advRte.Metric := inRREQ.OrigMetric;
advRte.Cost := inRREQ.OrigMetric + Cost(L);
//according to the indicated MetricType
advRte.ValidityTime := inRREQ.ValidityTime; //if present
advRte.NextHopIP := inRREQ.NbrIP;
advRte.NextHopIntf := inRREQ.Netif;
advRte.HopCount := inRREQ.HopCount;
advRte.HopLimit := inRREQ.HopLimit;

rte := Process_Routing_Info (advRte);

/* Update the RteMsgTable and determine if the RREQ needs
to be regenerated */
regenerate := Update_Rte_Msg_Table(inRREQ);

if (inRREQ.TargAddr is in Router Client list)
Generate_RREP(inRREQ, rte);
else if (regenerate)
Regenerate_RREQ(inRREQ, rte);



Perkins, et al. Expires May 11, 2016 [Page 83]

Internet-Draft AODVv2 November 2015


}

C.3.2.3. Regenerate_RREQ

/* Called from receive_RREQ()
rte := the route to OrigAddr */

Regenerate_RREQ (inRREQ, rte)
{
outRREQ.HopLimit := inRREQ.HopLimit - 1;
if (outRREQ.HopLimit == 0)
return; // don't regenerate

if (inRREQ.HopCount exists)
{
if (inRREQ.HopCount >= MAX_HOPCOUNT)
return; // don't regenerate
outRREQ.HopCount := inRREQ.HopCount + 1;
}

/* Marshall parameters */
outRREQ.MetricType := rte.MetricType;
outRREQ.OrigAddr := rte.Address;
outRREQ.TargAddr := inRREQ.TargAddr;
/* include prefix length if not equal to address length */
outRREQ.OrigPrefixLen := rte.PrefixLength;
outRREQ.OrigSeqNum := rte.SeqNum;
outRREQ.TargSeqNum := inRREQ.TargSeqNum; // if present
outRREQ.OrigMetric := rte.Metric;
outRREQ.ValidityTime := rte.ValidityTime;
or the time limit this router wishes to put on
route to OrigAddr

/* Build Address Block using prefix length information from
outRREQ.OrigPrefixLen if necessary */
AddrBlk := {outRREQ.OrigAddr, outRREQ.TargAddr};

/* Include sequence numbers in appropriate Address Block TLVs */
/* OrigSeqNum Address Block TLV */
origSeqNumAddrBlkTlv.value := outRREQ.OrigSeqNum;
/* TargSeqNum Address Block TLV */
if (outRREQ.TargSeqNum is known)
targSeqNumAddrBlkTlv.value := outRREQ.TargSeqNum;

/* Build Metric Address Block TLV, include Metric AddrBlkTlv
Extension type if a non-default metric */
metricAddrBlkTlv.value := outRREQ.OrigMetric;
if (outRREQ.MetricType != DEFAULT_METRIC_TYPE)



Perkins, et al. Expires May 11, 2016 [Page 84]

Internet-Draft AODVv2 November 2015


metricAddrBlkTlv.typeExtension := outRREQ.MetricType;

if (outRREQ.ValidityTime is required)
{
/* Build VALIDITY_TIME Address Block TLV */
VALIDITY_TIMEAddrBlkTlv.value := outRREQ.ValidityTime;
}
Build_RFC_5444_Message_Header (RREQ, 4, IPv4 or IPv6, NN,
outRREQ.HopLimit, outRREQ.HopCount, tlvLength);

/* Multicast RFC 5444 message to LL-MANET-Routers, or if
inRREQ was unicast, the message can be unicast to the next
hop on the route to TargAddr, if known */
}

C.3.3. RREP Operations

C.3.3.1. Generate_RREP

Generate_RREP(inRREQ, rte)
{
/* Increment sequence number in nonvolatile storage */
mySeqNum := (1 + mySeqNum);

/* Marshall parameters */
outRREP.HopLimit := inRREQ.HopCount;
outRREP.HopCount := 0;
/* Include the AckReq when:
- previous RREP does not seem to enable any data flow, OR
- when RREQ is received from same OrigAddr after RREP was
unicast to rte.NextHop */
outRREP.AckReq := TRUE or FALSE; //TRUE if acknowledgement required
/* if included, set timeout RREP_Ack_SENT_TIMEOUT */

if (rte.MetricType != DEFAULT_METRIC_TYPE)
outRREP.MetricType := rte.MetricType;
outRREP.OrigAddr := inRREQ.Address;
outRREP.TargAddr := rte.TargAddr;
outRREP.TargPrefixLen := rte.PrefixLength; //if not address length
outRREP.TargSeqNum := mySeqNum;
outRREP.TargMetric := rte.Metric;
outRREP.ValidityTime := limit for route to TargAddr; //if required

if (outRREP.AckReq == TRUE)
/* include AckReq Message TLV */

/* Build Address Block using prefix length information from
outRREP.TargPrefixLen if necessary */



Perkins, et al. Expires May 11, 2016 [Page 85]

Internet-Draft AODVv2 November 2015


AddrBlk := {outRREP.OrigAddr, outRREP.TargAddr};

/* TargSeqNum Address Block TLV */
targSeqNumAddrBlkTlv.value := outRREP.TargSeqNum;

/* Build Metric Address Block TLV include Metric AddrBlkTlv
Extension type if a non-default metric */
metricAddrBlkTlv.value := outRREP.TargMetric;
if (outRREP.MetricType != DEFAULT_METRIC_TYPE)
metricAddrBlkTlv.typeExtension := outRREP.MetricType;

if (outRREP.ValidityTime is required)
{
/* Build VALIDITY_TIME Address Block TLV */
VALIDITY_TIMEAddrBlkTlv.value := outRREP.ValidityTime;
}

Build_RFC_5444_Message_Header (RREP, 4, IPv4 or IPv6, NN,
outRREP.HopLimit, outRREQ.HopCount, tlvLength);

/* unicast RFC 5444 message to rte[OrigAddr].NextHop */
}

C.3.3.2. Receive_RREP

/* Process a RREP received on link L */

Receive_RREP (inRREP, L)
{
if (inRREP.NbrIP present in blacklist)
{
if (blacklist_expiration_time < CurrentTime)
return; // don't process or regenerate RREP
else
remove NbrIP from blacklist;
}

if (inRREP does not contain msg_hop_limit, OrigAddr,
TargAddr, TargSeqNum, TargMetric)
return;
if (msg_hop_count > MAX_HOPCOUNT)
return;
if (msg_hop_limit < 0)
return;
if (inRREP.OrigAddr and inRREQ.TargAddr are not
valid routable and unicast addresses)
return;
if (inRREP.MetricType is present but an unknown value)



Perkins, et al. Expires May 11, 2016 [Page 86]

Internet-Draft AODVv2 November 2015


return;
if (inRREP.TargMetric > MAX_METRIC[inRREP.MetricType])
return;

/* Extract inRREP values */
advRte.Address := inRREP.TargAddr;
advRte.PrefixLength := inRREP.TargPrefixLen; //if present
or the address length of advRte.Address;
advRte.SeqNum := inRREP.TargSeqNum;
advRte.MetricType := inRREP.MetricType;
advRte.Metric := inRREP.TargMetric;
advRte.Cost := inRREP.TargMetric + Cost(L);
//according to the indicated MetricType
advRte.ValidityTime := inRREP.ValidityTime; //if present
advRte.NextHopIP := inRREP.NbrIP;
advRte.NextHopIntf := inRREP.Netif;
advRte.HopCount := inRREP.HopCount;
advRte.HopLimit := inRREP.HopLimit; //if included

rte := Process_Routing_Info (advRte);

` if (inRREP includes AckReq data element)
Generate_RREP_Ack(inRREP);

/* Update the RteMsgTable and determine if the RREP needs
to be regenerated */
regenerate := Update_Rte_Msg_Table(inRREP);

if (inRREP.TargAddr is in the Router Client list)
send_buffered_packets(rte); /* start to use the route */
else if (regenerate)
Regenerate_RREP(inRREP, rte);
}

C.3.3.3. Regenerate_RREP

Regenerate_RREP(inRREP, rte)
{
if (rte does not exist)
{
Generate_RERR(inRREP);
return;
}

outRREP.HopLimit := inRREP.HopLimit - 1;
if (outRREP.HopLimit == 0) /* don't regenerate */
return;




Perkins, et al. Expires May 11, 2016 [Page 87]

Internet-Draft AODVv2 November 2015


if (inRREP.HopCount exists)
{
if (inRREP.HopCount >= MAX_HOPCOUNT)
return; // don't regenerate the RREP
outRREP.HopCount := inRREP.HopCount + 1;
}

/* Marshall parameters */
/* Include the AckReq when:
- previous unicast RREP seems not to enable data flow, OR
- when RREQ is received from same OrigAddr after RREP
was unicast to rte.NextHop */
outRREP.AckReq := TRUE or FALSE; //TRUE if acknowledgement required
/* if included, set timeout RREP_Ack_SENT_TIMEOUT */

if (rte.MetricType != DEFAULT_METRIC_TYPE)
outRREP.MetricType := rte.MetricType;
outRREP.OrigAddr := inRREP.OrigAddr;
outRREP.TargAddr := rte.Address;
outRREP.TargPrefixLen := rte.PrefixLength; //if not address length
outRREP.TargSeqNum := rte.SeqNum;
outRREP.TargMetric := rte.Metric;
outRREP.ValidityTime := limit for route to TargAddr; //if required
outRREP.NextHop := rte.NextHop

if (outRREP.AckReq == TRUE)
/* include AckReq Message TLV */

/* Build Address Block using prefix length information from
outRREP.TargPrefixLen if necessary */
AddrBlk := {outRREP.OrigAddr, outRREP.TargAddr};

/* TargSeqNum Address Block TLV */
targSeqNumAddrBlkTlv.value := outRREP.TargSeqNum;

/* Build Metric Address Block TLV include Metric AddrBlkTlv
Extension type if a non-default metric */
metricAddrBlkTlv.value := outRREP.TargMetric;
if (outRREP.MetricType != DEFAULT_METRIC_TYPE)
metricAddrBlkTlv.typeExtension := outRREP.MetricType;

if (outRREP.ValidityTime is required)
{
/* Build VALIDITY_TIME Address Block TLV */
VALIDITY_TIMEAddrBlkTlv.value := outRREP.ValidityTime;
}

Build_RFC_5444_Message_Header (RREP, 4, IPv4 or IPv6, NN,



Perkins, et al. Expires May 11, 2016 [Page 88]

Internet-Draft AODVv2 November 2015


outRREP.HopLimit, 0, tlvLength);

/* unicast RFC 5444 message to rte[OrigAddr].NextHop */
}

C.3.4. RREP_Ack Operations

C.3.4.1. Generate_RREP_Ack

/* To be sent when a received RREP includes the AckReq data element */

Generate_RREP_Ack(inRREP)
{
Build_RFC_5444_Message_Header (RREP_Ack, 4, IPv4 or IPv6, NN,
1, 0, 0);
/* unicast RFC 5444 message to inRREP.NbrIP */
}

C.3.4.2. Receive_RREP_Ack

Receive_RREP_Ack(inRREP_Ack)
{
/* cancel timeout event for the node sending RREP_Ack */
}

C.3.4.3. Timeout_RREP_Ack

Timeout_RREP_Ack(outRREP)
{
if (numRetries < RREP_RETRIES)
/* resend RREP and double the previous timeout */
else
/* insert unresponsive node into blacklist */
}

C.3.5. RERR Operations

C.3.5.1. Generate_RERR

There are two parts to this function, based on whether it was
triggered by an undeliverable packet or a broken link to neighboring
AODVv2 router.

/* Generate a Route Error message.
errorType := undeliverablePacket or brokenLink */

Generate_RERR(errorType, triggerPkt, brokenLinkNbrIp)
{



Perkins, et al. Expires May 11, 2016 [Page 89]

Internet-Draft AODVv2 November 2015


switch (errorType)
{
case (brokenLink):
doGenerate := FALSE;
num-broken-addr := 0;
precursors[] := new empty precursor list;
outRERR.HopLimit := MAX_HOPCOUNT;
/* find routes which are now Invalid */
foreach (rte in route table)
{
if (brokenLinkNbrIp == rte.NextHop
AND (rte.State == Active
OR
(rte.State == Idle AND ENABLE_IDLE_IN_RERR)))
{
if (rte.State == Active)
doGenerate := TRUE;
rte.State := Invalid;
precursors += rte.Precursors (if any);
outRERR.AddressList[num-broken-addr] := rte.Address;
outRERR.PrefixLengthList[num-broken-addr] :=
rte.PrefixLength;
outRERR.SeqNumList[num-broken-addr] := rte.SeqNum;
outRERR.MetricTypeList[num-broken-addr] := rte.MetricType
num-broken-addr := num-broken-addr + 1;
}
}
}
case (undeliverablePacket):
doGenerate := TRUE;
num-broken-addr := 1;
outRERR.HopLimit := MAX_HOPCOUNT;
outRERR.PktSource := triggerPkt.SrcIP;
or triggerPkt.TargAddr; //if pkt was a RREP
outRERR.AddressList[0] := triggerPkt.DestIP;
or triggerPkt.OrigAddr; //if pkt was RREP
/* optional to include outRERR.PrefixLengthList, outRERR.SeqNumList
and outRERR.MetricTypeList */
}

if (doGenerate == FALSE)
return;

if (triggerPkt exists)
{
/* Build PktSource Message TLV */
pktSourceMessageTlv.value := outRERR.PktSource;
}



Perkins, et al. Expires May 11, 2016 [Page 90]

Internet-Draft AODVv2 November 2015


/* The remaining steps add address, prefix length, sequence
number and metric type information for each unreachable address,
while conforming to the allowed MTU. If the MTU is reached, a new
message MUST be created. */

/* Build Address Block using prefix length information from
outRERR.PrefixLengthList[] if necessary */
AddrBlk := outRERR.AddressList[];

/* Optionally, add SeqNum Address Block TLV, including index values */
seqNumAddrBlkTLV := outRERR.SeqNumList[];

if (outRERR.MetricTypeList contains non-default MetricTypes)
/* include Metric Address Block TLVs with Type Extension set to
MetricType, including index values if necessary */
metricAddrBlkTlv.typeExtension := outRERR.MetricTypeList[];

Build_RFC_5444_Message_Header (RERR, 4, IPv4 or IPv6, NN,
outRERR.HopLimit, 0, tlvLength);

if (undeliverablePacket)
/* unicast outRERR to rte[outRERR.PktSource].NextHop */
else if (brokenLink)
/* unicast to precursors, or multicast to LL-MANET-Routers */
}

C.3.5.2. Receive_RERR

Receive_RERR (inRERR)
{
if (inRERR does not contain msg_hop_limit and at least
one unreachable address)
return;

/* Extract inRERR values, copy relevant unreachable addresses,
their prefix lengths, and sequence numbers to outRERR */
num-broken-addr := 0;
precursors[] := new empty precursor list;
foreach (unreachableAddress in inRERR.AddressList)
{
if (unreachableAddress is not valid routable and unicast)
continue;
if (unreachableAddress MetricType is present but an unknown value)
return;

/* Find a matching route table entry, assume
DEFAULT_METRIC_TYPE if no MetricType included */
rte := Fetch_Route_Set_Entry (unreachableAddress,



Perkins, et al. Expires May 11, 2016 [Page 91]

Internet-Draft AODVv2 November 2015


unreachableAddress MetricType)
if (rte does not exist)
continue;
if (rte.State == Invalid)/* ignore already invalid routes */
continue;
if ((rte.NextHop != inRERR.NbrIP
OR
rte.NextHopInterface != inRERR.Netif)
AND (PktSource is not present OR is not a Router Client))
continue;
if (unreachableAddress SeqNum (if known) < rte.SeqNum)
continue;

/* keep a note of all precursors of newly Invalid routes */
precursors += rte.Precursors; //if any

/* assume prefix length is address length if not included */
if (rte.PrefixLength != unreachableAddress prefixLength)
{
/* create new route with unreachableAddress information */
invalidRte := Create_Route_Set_Entry(unreachableAddress,
unreachableAddress PrefixLength,
unreachableAddress SeqNum,
unreachableAddress MetricType);
invalidRte.State := Invalid;

if (rte.PrefixLength > unreachableAddress prefixLength)
expunge_route(rte);
rte := invalidRte;
}
else if (rte.PrefixLength == unreachableAddress prefixLength)
rte.State := Invalid;

outRERR.AddressList[num-broken-addr] := rte.Address;
outRERR.PrefixLengthList[num-broken-addr] := rte.PrefixLength;
outRERR.SeqNumList[num-broken-addr] := rte.SeqNum;
outRERR.MetricTypeList[num-broken-addr] := rte.MetricType;
num-broken-addr := num-broken-addr + 1;
}

if (num-broken-addr AND (PktSource is not present OR PktSource is not
a Router Client))
Regenerate_RERR(outRERR, inRERR, precursors);
}







Perkins, et al. Expires May 11, 2016 [Page 92]

Internet-Draft AODVv2 November 2015


C.3.5.3. Regenerate_RERR

Regenerate_RERR (outRERR, inRERR, precursors)
{
/* Marshal parameters */
outRERR.HopLimit := inRERR.HopLimit - 1;
if (outRERR.HopLimit == 0) // don't regenerate
return;

outRERR.PktSource := inRERR.PktSource; //if included
/* AddressList[], SeqNumList[], and PrefixLengthList[] are
already up-to-date */

if (outRERR.PktSource exists)
{
/* Build PktSource Message TLV */
pktSourceMessageTlv.value := outRERR.PktSource;
}

/* Build Address Block using prefix length information from
outRERR.PrefixLengthList[] if necessary */
AddrBlk := outRERR.AddressList[];

/* Optionally, add SeqNum Address Block TLV, including index values */
seqNumAddrBlkTLV := outRERR.SeqNumList[];

if (outRERR.MetricTypeList contains non-default MetricTypes)
/* include Metric Address Block TLVs with Type Extension set to
MetricType, including index values if necessary */
metricAddrBlkTlv.typeExtension := outRERR.MetricTypeList[];

Build_RFC_5444_Message_Header (RERR, 4, IPv4 or IPv6, NN,
outRERR.HopLimit, 0, tlvLength);

if (outRERR.PktSource exists)
/* unicast RFC 5444 message to next hop towards
outRERR.PktSource */
else if (number of precursors == 1)
/* unicast RFC 5444 message to precursors[0] */
else if (number of precursors > 1)
/* unicast RFC 5444 message to all precursors, or multicast
RFC 5444 message to RERR_PRECURSORS if preferable */
else
/* multicast RFC 5444 message to LL-MANET-Routers */
}






Perkins, et al. Expires May 11, 2016 [Page 93]

Internet-Draft AODVv2 November 2015


Appendix D. AODVv2 Draft Updates

This section lists the changes between AODVv2 revisions ...-12.txt
and ...-13.txt.

o Separated AODVv2's Local Route Set from the Routing Information
Base.

o Updated Adjacency Monitoring to Next Hop Monitoring.

o Minor editorial improvements.

Authors' Addresses

Charles E. Perkins
Futurewei Inc.
2330 Central Expressway
Santa Clara, CA 95050
USA

Phone: +1-408-330-4586
Email: charliep@xxxxxxxxxxxx


Stan Ratliff
Idirect
13861 Sunrise Valley Drive, Suite 300
Herndon, VA 20171
USA

Email: ratliffstan@xxxxxxxxx


John Dowdell
Airbus Defence and Space
Celtic Springs
Newport, Wales NP10 8FZ
United Kingdom

Email: john.dowdell@xxxxxxxxxx











Perkins, et al. Expires May 11, 2016 [Page 94]

Internet-Draft AODVv2 November 2015


Lotte Steenbrink
HAW Hamburg, Dept. Informatik
Berliner Tor 7
D-20099 Hamburg
Germany

Email: lotte.steenbrink@xxxxxxxxxxxxxx


Victoria Mercieca
Airbus Defence and Space
Celtic Springs
Newport, Wales NP10 8FZ
United Kingdom

Email: victoria.mercieca@xxxxxxxxxx



































Perkins, et al. Expires May 11, 2016 [Page 95]

Other related posts: