Subject: [manet] AODVv2 RREQ / RREP Message Format

From: Lotte Steenbrink <[email-masked]>
Date: Sun, 3 Nov 2013 21:14:55 +0100

Hi,
working my way through the AODVv2 RFC5444 format for RREQ and RREP
messages, I've stumbled across some things that were unclear to me.
Any input would be greatly appreciated. 

- The AddrBlk flags state that ahasfulltail = ahaszerotail = 0. According to 
RFC5444, page 12, neither a tail-length nor a tail should be included. The RREQ 
Message Format specification does, however, include Orig.Tail and Target.Tail. 
To me, that doesn't quite add up, what did I miss?

- The capitalization seems inconsistent to me. Is there any reason why the draft
doesn't stick to either capitalizing every first letter (like the OLSRv2 draft 
does) or keeping it all in lowercase (like RFC5444)? 

- The naming seems a bit off to me as well. In some places, the terms don't 
quite match the ones used in RFC5444, causing unnecessary confusion. 
I'd like to suggest the following changes, which include some renaming and 
missing closing parentheses:

A.1.  RREQ Message Format 

   Figure 4 illustrates a packet format for an example RREQ message.

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | PV=0 |  PF=0  | msg-type=RREQ | MF=4  | MAL=3 |  msg-size=28  |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |  msg-size=28  | msg-hop-limit |      msg.tlvs-length=0        |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |   num-addr=2  |1|0|0|0|0| Rsv | head-length=3 |Head(Orig&Targ)|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | head (bytes for Orig & Target)|   Orig.Tail   |  Target.Tail  |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |      addr.tlvs-length=11      |tlv-type=SeqNum|0|1|0|1|0|0|Rsv|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | Index-start=0 |   length=2    |       Orig.Node SeqNum        |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |tlv-type=Metric|0|1|0|1|0|0|Rsv| Index-start=0 |   length=1    |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | OrigNodeHopCt |
     +-+-+-+-+-+-+-+-+

       Figure 4: Example IPv4 RREQ, with SeqNum and Metric AddrTLVs

   The fields in Figure 4 are to be interpreted as follows:

   o  PV=0 (Packet Header Version = 0)
   o  PF=0 (Packet Flags = 0)
   o  msg-type=RREQ (first [and only] message is of type RREQ)
   o  MF=4 (Message Flags = 4 [only msg-hop-limit field is present])
   o  MAL=3 (Message Address Length indicator [3 for IPv4, 15 for IPv6])
   o  msg-size=28 (octets -- counting MsgHdr, MsgTLVs, and AddrBlks)
   o  msg-hop-limit (initially MAX_HOPCOUNT by default)
   o  msg.tlvs-length=0 (no Message TLVs)
   o  num-addr=2 (OrigNode and TargNode addresses in RteMsg AddrBlock)
   o  addr-flags:

      *  bit 0 (ahashead): 1
      *  bit 1 (ahasfulltail): 0
      *  bit 2 (ahaszerotail): 0
      *  bit 3 (ahassingleprelen): 0
      *  bit 4 (ahasmultiprelen): 0
      *  bits 5-7: RESERVED
   o  head-length=3 (length of head part of each address is 3 octets)
   o  head (3 initial bytes for both Originating & Target addresses)
   o  Orig.Tail (4th byte of Originating Node IP address)
   o  Target.Tail (4th byte of Target Node IP address)
   o  addr.tlvs-length=11 (length in bytes for SeqNum and Metric TLVs)
   o  tlv-type=SeqNum (AddrTLV type of first AddrBlk TLV, values 2 octets)
   o  AddrTLV flags for SeqNum TLV:

      *  bit 0 (thastypeext): 0
      *  bit 1 (thassingleindex): 1
      *  bit 2 (thasmultiindex): 0
      *  bit 3 (thasvalue): 1
      *  bit 4 (thasextlen): 0
      *  bit 5 (tismultivalue): 0
      *  bits 6-7: RESERVED
   o  Index-start=0 (SeqNum TLV values start at index 0)
   o  length=2 (so there is only one TLV value, [1 = 2/2])
   o  Orig.Node SeqNum (first [and only] TLV value for SeqNum TLVs)
   o  tlv-type=Metric (AddrTLV type of second AddrBlk TLV, values 1 octet)
   o  AddrTLV flags for Metric TLV:

      *  bit 0 (thastypeext): 0
      *  bit 1 (thassingleindex): 1
      *  bit 2 (thasmultiindex): 0
      *  bit 3 (thasvalue): 1
      *  bit 4 (thasextlen): 0
      *  bit 5 (tismultivalue): 0
      *  bits 6-7: RESERVED
   o  Index-start=0 (Metric TLV values start at index 0)
   o  length=1 (so there is only one TLV value, [1 = 1/1])
   o  OrigNodeHopCt (first [and only] TLV value for Metric TLVs)

A.2.  RREP Message Format

   Figure 5 illustrates a packet format for an example RREP message.

        0                   1                   2                   3
        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       | PV=0 |  PF=0  | msg-type=RREP | MF=4  | MAL=3 |  msg-size=30  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |  msg-size=30  | msg-hop-limit |      msg.tlvs-length=0        |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |   num-addr=2  |1|0|0|0|0| Rsv | head-length=3 |Head(Orig&Targ)|
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       | Head (bytes for Orig & Target)|   Orig.Tail   |  Target.Tail  |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |      addr.tlvs-length=13      |tlv-type=SeqNum|0|1|0|1|0|0|Rsv|
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       | Index-start=0 | tlv-length=2  |       Orig.Node SeqNum        |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |      Target.Node SeqNum       |tlv-type=Metric|0|1|0|1|0|0|Rsv|
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       | Index-start=1 | tlv-length=1  | TargNodeHopCt |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

         Figure 5: Example IPv4 RREP, with 2 SeqNums and 1 Metric

   The fields in Figure 5 are to be interpreted as follows:
   o  PV=0 (Packet Header Version = 0)
   o  PF=0 (Packet Flags = 0)
   o  msg-type=RREP (first [and only] message is of type RREP)
   o  MF=4 (Message Flags = 4 [only msg-hop-limit field is present])
   o  MAL=3 (Message Address Length indicator [3 for IPv4, 15 for IPv6])
   o  msg-size=28 (octets -- counting MsgHdr, MsgTLVs, and AddrBlks)
   o  msg-hop-limit (initially MAX_HOPCOUNT by default)
   o  msg.tlvs-length=0 (no Message TLVs)
   o  num-addr=2 (OrigNode and TargNode addresses in RteMsg AddrBlock)
   o  addr-flags:
      *  bit 0 (ahashead): 1
      *  bit 1 (ahasfulltail): 0
      *  bit 2 (ahaszerotail): 0
      *  bit 3 (ahassingleprelen): 0
      *  bit 4 (ahasmultiprelen): 0
      *  bits 5-7: RESERVED
   o  head-length=3 (length of head part of each address is 3 octets)
   o  Head (3 initial bytes for both Originating & Target addresses)
   o  Orig.Tail (4th byte of Originating Node IP address)
   o  Target.Tail (4th byte of Target Node IP address)
   o  addr.tlvs-length=13 (length in bytes for SeqNum and Metric TLVs)
   o  tlv-type=SeqNum (AddrTLV type of first AddrBlk TLV, values 2 octets)
   o  AddrTLV flags for SeqNum TLV:
      *  bit 0 (thastypeext): 0
      *  bit 1 (thassingleindex): 1
      *  bit 2 (thasmultiindex): 0
      *  bit 3 (thasvalue): 1
      *  bit 4 (thasextlen): 0
      *  bit 5 (tismultivalue): 0
      *  bits 6-7: RESERVED
   o  Index-start=0 (SeqNum TLV values start at index 0)
   o  tlv-length=4 (so there is are two TLV values, [2 = 4/2])
   o  Orig.Node SeqNum (first of two TLV values for SeqNum TLVs)
   o  Targ.Node SeqNum (second of two TLV values for SeqNum TLVs)
   o  tlv-type=Metric (AddrTLV type of second AddrBlk TLV, values 1 octet)
   o  AddrTLV flags for Metric TLV:
      *  bit 0 (thastypeext): 0
      *  bit 1 (thassingleindex): 1
      *  bit 2 (thasmultiindex): 0
      *  bit 3 (thasvalue): 1
      *  bit 4 (thasextlen): 0
      *  bit 5 (tismultivalue): 0
      *  bits 6-7: RESERVED
   o  Index-start=1 (Metric TLV values start at index 1)
   o  tlv-length=1 (so there is only one TLV value, [1 = 1/1])
   o  TargNodeHopCt (first [and only] TLV value for Metric TLVs)

With kind regards,
Lotte Steenbrink