RFC 5497 PROPOSED STANDARD ROUTING · MANET · EXTENSIONS

MANET time TLVs: Representing Multi-Value Time in Mobile Ad Hoc Networks (MANETs)

A compact way for ad hoc network protocols to say how often to expect a message and how long its contents stay valid.

On rfc-editor.org ↗
PUBLISHED
March 2009
AUTHORS
T. Clausen, C. Dearlove
STREAM
IETF
SIZE OF A TIME-CODE
8 bits
EXPONENT BITS
5
MANTISSA BITS
3
MINIMUM REPRESENTABLE TIME-VALUE
C
MAXIMUM REPRESENTABLE TIME-VALUE
15 * 2^28 * C
HOP COUNT WHEN IT IS NOT KNOWN
255
DOI
10.17487/RFC5497
ERRATA
Reported errata

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                                         T. Clausen
Request for Comments: 5497                      LIX, Ecole Polytechnique
Category: Standards Track                                    C. Dearlove
                                                         BAE Systems ATC
                                                              March 2009


    Representing Multi-Value Time in Mobile Ad Hoc Networks (MANETs)

Status of This Memo

   This document specifies an Internet standards track protocol for the
   Internet community, and requests discussion and suggestions for
   improvements.  Please refer to the current edition of the "Internet
   Official Protocol Standards" (STD 1) for the standardization state
   and status of this protocol.  Distribution of this memo is unlimited.

Copyright Notice

   Copyright (c) 2009 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 in effect on the date of
   publication of this document (http://trustee.ietf.org/license-info).
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.

   This document may contain material from IETF Documents or IETF
   Contributions published or made publicly available before November
   10, 2008.  The person(s) controlling the copyright in some of this
   material may not have granted the IETF Trust the right to allow
   modifications of such material outside the IETF Standards Process.
   Without obtaining an adequate license from the person(s) controlling
   the copyright in such materials, this document may not be modified
   outside the IETF Standards Process, and derivative works of it may
   not be created outside the IETF Standards Process, except to format
   it for publication as an RFC or to translate it into languages other
   than English.

Abstract

   This document describes a general and flexible TLV (type-length-value
   structure) for representing time-values, such as an interval or a
   duration, using the generalized Mobile Ad hoc NETwork (MANET) packet/
   message format.  It defines two Message TLVs and two Address Block
   TLVs for representing validity and interval times for MANET routing
   protocols.

Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  3
     1.1.  Motivation and Rationale . . . . . . . . . . . . . . . . .  3
   2.  Terminology  . . . . . . . . . . . . . . . . . . . . . . . . .  5
   3.  Applicability Statement  . . . . . . . . . . . . . . . . . . .  6
   4.  Protocol Overview and Functioning  . . . . . . . . . . . . . .  6
   5.  Representing Time  . . . . . . . . . . . . . . . . . . . . . .  6
   6.  General Time TLV Structure . . . . . . . . . . . . . . . . . .  7
     6.1.  Single-Value Time TLVs . . . . . . . . . . . . . . . . . .  8
     6.2.  Multi-Value Time TLVs  . . . . . . . . . . . . . . . . . .  9
   7.  Message TLVs . . . . . . . . . . . . . . . . . . . . . . . . . 10
     7.1.  INTERVAL_TIME TLV  . . . . . . . . . . . . . . . . . . . . 10
     7.2.  VALIDITY_TIME TLV  . . . . . . . . . . . . . . . . . . . . 10
   8.  Address Block TLVs . . . . . . . . . . . . . . . . . . . . . . 10
     8.1.  INTERVAL_TIME TLV  . . . . . . . . . . . . . . . . . . . . 10
     8.2.  VALIDITY_TIME TLV  . . . . . . . . . . . . . . . . . . . . 11
   9.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 11
     9.1.  Expert Review: Evaluation Guidelines . . . . . . . . . . . 11
     9.2.  Message TLV Types  . . . . . . . . . . . . . . . . . . . . 12
     9.3.  Address Block TLV Types  . . . . . . . . . . . . . . . . . 12
   10. Security Considerations  . . . . . . . . . . . . . . . . . . . 13
   11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13
     11.1. Normative References . . . . . . . . . . . . . . . . . . . 13
     11.2. Informative References . . . . . . . . . . . . . . . . . . 13
   Appendix A.  Acknowledgements  . . . . . . . . . . . . . . . . . . 14

1.  Introduction

   The generalized packet/message format [RFC5444] specifies a signaling
   format that MANET routing protocols can employ for exchanging
   protocol information.  This format presents the ability to express
   and associate attributes to packets, messages, or addresses, by way
   of a general TLV (type-length-value) mechanism.

   This document specifies a general Time TLV structure, which can be
   used by any MANET routing protocol that needs to express either
   single time-values or a set of time-values with each time-value
   associated with a range of hop counts, as provided by the Message
   Header of [RFC5444].  This allows a receiving node to determine a
   single time-value if either it knows its hop count from the
   originator node or the Time TLV specifies a single time-value.

   A time-value is, in this context, not an "absolute point in time",
   but rather an interval or a duration.  An instance of a Time TLV can,
   therefore, express an interval or a duration such as "10 seconds".

   This document also specifies two Message TLV Types, which use the TLV
   structure proposed.  These TLV Types are INTERVAL_TIME and
   VALIDITY_TIME, specifying, respectively, the maximum time before
   another message of the same type as this message from the same
   originator should be received, and the duration for which the
   information in this message is valid after receipt.  Note that, if
   both are present, then the latter will usually be greater than the
   former in order to allow for possible message loss.

   This document also specifies two Address Block TLV Types, which use
   the TLV structure proposed.  These TLV Types are INTERVAL_TIME and
   VALIDITY_TIME, defined equivalently to the two Message TLVs with the
   same names.

1.1.  Motivation and Rationale

   The Time TLV structure, specified in this document, is intended to be
   used as a component in a MANET routing protocol, e.g., to indicate
   the expected spacing between successive transmissions of a given
   Message Type, by including a Time TLV in transmitted messages.

   Some MANET routing protocols may employ very short spacing for some
   messages and very long spacing for others, or may change the message
   transmission rate according to observed behavior.  For example, if a
   network is observed at some point in time to exhibit a highly dynamic
   topology, a very short (sub-second) message spacing could be
   appropriate, whereas if the network later is observed to stabilize,
   multi-hour message spacing may become appropriate.  Different MANET
   routing protocols and different deployments of MANET routing
   protocols may have different granularity requirements and bounds on
   shortest and longest spacing between successive message
   transmissions.

   In addition, MANET routing protocol deployments typically use
   bandwidth-limited wireless network interfaces, and therefore prefer
   to trade off computational complexity for a saving in the number of
   bits transmitted.  This is practical in this case, because the
   intended usages of Time TLVs, including the specified examples of
   message interval time and information validity time, do not require
   high-precision values of time.

   The Time TLV structure, specified in this document, caters to these
   characteristics by:

   o  encoding time-values, such as an interval or a duration, in an
      8-bit field; while

   o  allowing these time-values to range from "very small" (e.g.,
      1/1024 second) to "very long" (e.g., 45 days); and

   o  allowing a MANET routing protocol, or a deployment, to
      parameterize this (e.g., to attain finer granularity at the
      expense of a lower upper bound) through a single parameter, C.

   The parameter C must be the same for all MANET routers in the same
   deployment.

   The TLV mechanism as specified in [RFC5444] allows associating a
   "value" to either a packet, a message, or to addresses.  The data
   structure for doing so -- the TLV -- is identical in each of the
   three cases; however, the TLV's position in a received packet allows
   determining if that TLV is a "Packet TLV" (it appears in the Packet
   Header, before any messages), a "Message TLV" (it appears in the TLV
   Block immediately following a Message Header), or an "Address Block
   TLV" (it appears in the TLV Block immediately following an Address
   Block).

   While TLVs may be structurally identical, that which they express may
   be different.  This is determined from the kind (packet, message, or
   Address Block) and type of the TLV.  For example, one TLV might
   associate a lifetime to an address, another a content sequence number
   to a message, and another a cryptographic signature to a packet.  For
   this reason, [RFC5444] specifies separate registries for Packet TLV
   Types, Message TLV Types, and Address Block TLV Types, and it does
   not specify any structure in the TLV Value field.

   The TLVs defined in this document express, essentially, that "this
   information will be refreshed within X seconds" and that "this
   information is valid for X seconds after being received", each
   allowing the "X seconds" to be specified as a function of the number
   of hops from the originator of the information.  This document
   specifies a general format allowing expressing and encoding this as
   the value field of a TLV.  This representation uses a compact (8-bit)
   representation of time, as message size is an issue in many MANETs,
   and the offered precision and range is appropriate for MANET routing
   protocols.

   A TLV of this format may be used for packets, messages, or addresses.
   For example, a proactive MANET routing protocol periodically
   reporting link-state information could include a TLV of this format
   as a Message TLV.  This may indicate a different periodicity in
   different scopes (possibly frequently up to a few hops, less
   frequently beyond that) because some messages may be sent with
   limited scope, as specified in [RFC5444].  A reactive MANET routing
   protocol could include a TLV of this format as an Address Block TLV
   for reporting the lifetime of routes to individual addresses.

   In addition to defining the general format as outlined above, this
   document requests IANA assignments for INTERVAL_TIME and
   VALIDITY_TIME TLVs.  These IANA assignments are requested in this
   document in order to avoid interdependencies between otherwise
   unrelated MANET protocols and in order to not exhaust the TLV Type
   spaces by having different protocols request types for essentially
   identical data structures.  Only Message TLVs and Address Block TLVs
   are requested, as these are those for which a need has been
   demonstrated.

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].

   Additionally, this document uses terminology from [RFC5444], and
   introduces the following terminology:

   hop count  - the number of hops from the message originator to the
      message recipient.  This is defined to equal the <msg-hop-count>
      field in the <msg-header> element defined in [RFC5444], if
      present, after it is incremented on reception.  If the <msg-hop-
      count> field is not present, or in a Packet TLV, then hop count is
      defined to equal 255.

   time-value  - a time, measured in seconds.

   time-code  - an 8-bit field, representing a time-value.

3.  Applicability Statement

   The TLV structure described in this document is applicable whenever a
   single time-value, or a time-value that varies with the number of
   hops from the originator of a message, is required in a protocol
   using the generalized MANET packet/message format [RFC5444].

   Examples of time-values that may be included in a protocol message
   are:

   o  The maximum time interval until the next message of the same type
      is to be generated by the message's originator node.

   o  The validity time of the information with which the time-value is
      associated.

   Either of these may vary with the hop count between the originating
   and receiving nodes, e.g., if messages of the same type are sent with
   different hop limits as defined in [RFC5444].

   Parts of this document have been generalized from material in the
   proactive MANET routing protocol OLSR (Optimized Link State Routing
   Protocol) [RFC3626].

4.  Protocol Overview and Functioning

   This document does not specify a protocol nor does it mandate
   specific node or protocol behavior.  Rather, it outlines mechanisms
   for encoding time-values using the TLV mechanism of [RFC5444].

5.  Representing Time

   This document specifies a TLV structure in which time-values are each
   represented in an 8-bit time-code, one or more of which may be used
   in a TLV's <value> field.  Of these 8 bits, the least significant 3
   bits represent the mantissa (a), and the most significant 5 bits
   represent the exponent (b), so that:

   o  time-value := (1 + a/8) * 2^b * C

   o  time-code := 8 * b + a
   All nodes in the MANET MUST use the same value of the constant C,
   which will be specified in seconds, hence so will be all time-values.
   C MUST be greater than 0 seconds.  Note that ascending values of the
   time-code represent ascending time-values; time-values may thus be
   compared by comparison of time-codes.

   An algorithm for computing the time-code representing the smallest
   representable time-value not less than the time-value t is:

   1.  find the largest integer b such that t/C >= 2^b;

   2.  set a := 8 * (t / (C * 2^b) - 1), rounded up to the nearest
       integer;

   3.  if a = 8, then set b := b + 1 and set a := 0;

   4.  if 0 <= a <= 7, and 0 <= b <= 31, then the required time-value
       can be represented by the time-code 8 * b + a, otherwise it
       cannot.

   The minimum time-value that can be represented in this manner is C.
   The maximum time-value that can be represented in this manner is 15 *
   2^28 * C, or about 4.0 * 10^9 * C.  If, for example, C = 1/1024
   second, then this is about 45 days.

   A protocol using this time representation MUST define the value of C.
   A protocol using this specification MAY specify that the all-bits
   zero time-value (0) represents a time-value of zero and/or that the
   all-bits one time-value (255) represents an indefinitely large time-
   value.

6.  General Time TLV Structure

   The following data structure allows the representation of a single
   time-value, or of a default time-value plus pairs of (time-values,
   hop counts) for when hop-count-dependent time-values are required.
   The time-values are represented as time-codes as defined in
   Section 5.  This <time-data> data structure is specified, using the
   regular expression syntax of [RFC5444], by:

       <time-data> = (<time-code><hop-count>)*<time-code>

   where:

   <time-code>  is an 8-bit unsigned integer field containing a time-
      code as defined in Section 5.

   <hop-count>  is an 8-bit unsigned integer field specifying a hop
      count from the message originator.

   A <time-data> structure thus consists of an odd number of octets;
   with a repetition factor of n for the (time, hop count) pairs in the
   regular expression syntax, it contains 2n+1 octets.  On reception, n
   is determined from the length.

   A <time-data> field may be thus represented by:

       <t_1><d_1><t_2><d_2> ... <t_i><d_i> ...  <t_n><d_n><t_default>

   <d_1>, ... <d_n>, if present, MUST be a strictly increasing sequence,
   with <d_n> < 255.  Then, at the receiving node's hop count from the
   originator node, the time-value indicated is that represented by the
   time-code:

   o  <t_1>, if n > 0 and hop count <= <d_1>;

   o  <t_i+1>, if n > 1 and <d_i> < hop count <= <d_i+1> for some i such
      that 1 <= i < n;

   o  <t_default> otherwise, i.e. if n = 0 or hop count > <d_n>.

   If included in a message without a <msg-hop-count> field in its
   Message Header, or in a Packet TLV, then the form of this data
   structure with a single time-code in <time-data> (i.e., n = 0) SHOULD
   be used.

6.1.  Single-Value Time TLVs

   The purpose of a single value Time TLV is to allow a single time-
   value to be determined by a node receiving an entity containing the
   Time TLV, based on its hop count from the entity's originator.  The
   Time TLV may contain information that allows that time-value to be a
   function of the hop count; thus, different receiving nodes may
   determine different time-values.

   A single-value Time TLV may be a Packet TLV, a Message TLV, or an
   Address Block TLV.

   A Time TLV that has the tismultivalue flag cleared ('0') in its <tlv-
   flags> field, as defined in [RFC5444], contains a single <time-data>,
   as defined above, in its <value> field.  For such a Time TLV:

   o  The <length> field in the TLV MUST contain the value 2n+1, with n
      being the number of (time-value, hop count) pairs in the Time TLV.

   o  The number of (time-value, hop count) pairs MUST be identified by
      inspecting the <length> field in the TLV.  The number of such
      pairs, n, is:

      *  n := (<length> - 1) / 2

      This MUST be an integer value.

6.2.  Multi-Value Time TLVs

   The purpose of a multi-value Time TLV is to associate a set of <time-
   data> structures to an identically sized set of addresses, as
   described in [RFC5444].  For each of these <time-data> structures, a
   single time-value can be determined by a node receiving an entity
   containing the Time TLV, based on its hop count from the entity's
   originator.  The Time TLV may contain information that allows that
   time-value to be a function of the hop count, and thus different
   receiving nodes may determine different time-values.

   Multi-value Time TLVs MUST be Address Block TLVs.  A multi-value Time
   TLV MUST NOT be a Packet TLV or Message TLV.

   A Time TLV that has the tismultivalue flag set ('1') in its <tlv-
   flags> field, as defined in [RFC5444], contains a sequence of <time-
   data> structures, as defined above, in its <value> field.  For such a
   Time TLV:

   o  The <length> field in the TLV MUST contain the value m * (2n+1),
      with n being the number of (time-value, hop count) pairs in the
      Time TLV, and m being number-values as defined in [RFC5444].

   o  The number of <time-data> structures included in the <value> field
      is equal to number-values as defined in [RFC5444].

   o  The number of (time-value, hop count) pairs in each <time-data>
      structure MUST be the same, and MUST be identified by inspecting
      the <length> field in the TLV and using number-values as defined
      in [RFC5444].  The number of such pairs in each <time-data>
      structure, n, is:

      *  n := ((<length> / number-values) - 1) / 2

      This MUST be an integer value.  The lists of hop count values MAY
      be different.

7.  Message TLVs

   Two Message TLVs are defined, for signaling message interval
   (INTERVAL_TIME) and message validity time (VALIDITY_TIME).

7.1.  INTERVAL_TIME TLV

   An INTERVAL_TIME TLV is a Message TLV that defines the maximum time
   before another message of the same type as this message from the same
   originator should be received.  This interval time MAY be specified
   to depend on the hop count from the originator.  (This is appropriate
   if messages are sent with different hop limits so that receiving
   nodes at greater hop counts have an increased interval time.)

   A message MUST NOT include more than one INTERVAL_TIME TLV.

   An INTERVAL_TIME TLV is an example of a Time TLV specified as in
   Section 5.

7.2.  VALIDITY_TIME TLV

   A VALIDITY_TIME TLV is a Message TLV that defines the validity time
   of the information carried in the message in which the TLV is
   contained.  After this time, the receiving node MUST consider the
   message content to no longer be valid (unless repeated in a later
   message).  The validity time of a message MAY be specified to depend
   on the hop count from its originator.  (This is appropriate if
   messages are sent with different hop limits so that receiving nodes
   at greater hop counts receive information less frequently and must
   treat is as valid for longer.)

   A message MUST NOT include more than one VALIDITY_TIME TLV.

   A VALIDITY_TIME TLV is an example of a Time TLV specified as in
   Section 5.

8.  Address Block TLVs

   Two Address Block TLVs are defined, for signaling address
   advertisement interval (INTERVAL_TIME) and address validity time
   (VALIDITY_TIME).

8.1.  INTERVAL_TIME TLV

   An INTERVAL_TIME TLV is an Address Block TLV that defines the maximum
   time before this address from the same originator should be received
   again.  This interval time MAY be specified to depend on the hop
   count from the originator.  (This is appropriate if addresses are
   contained in messages sent with different hop limits so that
   receiving nodes at greater hop counts have an increased interval
   time.)

   A protocol using this TLV and the same named Message TLV MUST specify
   how to interpret the case when both are present (typically, that the
   former overrides the latter for those addresses that are covered by
   the former).

   An INTERVAL_TIME TLV is an example of a Time TLV specified as in
   Section 5.

8.2.  VALIDITY_TIME TLV

   A VALIDITY_TIME TLV is an Address Block TLV that defines the validity
   time of the addresses to which the TLV is associated.  After this
   time, the receiving node MUST consider the addresses to no longer be
   valid (unless these are repeated in a later message).  The validity
   time of an address MAY be specified to depend on the hop count from
   its originator.  (This is appropriate if addresses are contained in
   messages sent with different hop limits so that receiving nodes at
   greater hop counts receive information less frequently and must treat
   is as valid for longer.)

   A protocol using this TLV and the same named Message TLV MUST specify
   how to interpret the case when both are present (typically, that the
   former overrides the latter for those addresses that are covered by
   the former).

   A VALIDITY_TIME TLV is an example of a Time TLV specified as in
   Section 5.

9.  IANA Considerations

   This specification defines two Message TLV Types, which have been
   allocated from the "Assigned Message TLV Types" repository of
   [RFC5444] as specified in Table 1, and two Address Block TLV Types,
   which have been allocated from the "Assigned Address Block TLV Types"
   repository of [RFC5444] as specified in Table 2.

   IANA has assigned the same numerical value to the Message TLV Type
   and Address Block TLV Type with the same name.

9.1.  Expert Review: Evaluation Guidelines

   For the registries for TLV Type Extensions where an Expert Review is
   required, the designated expert SHOULD take the same general
   recommendations into consideration as are specified by [RFC5444].

9.2.  Message TLV Types

   +---------------+------+-----------+--------------------------------+
   |      Name     | Type |    Type   | Description                    |
   |               |      | Extension |                                |
   +---------------+------+-----------+--------------------------------+
   | INTERVAL_TIME |   0  |     0     | The maximum time before        |
   |               |      |           | another message of the same    |
   |               |      |           | type as this message from the  |
   |               |      |           | same originator should be      |
   |               |      |           | received                       |
   |   Unassigned  |   0  |   1-223   | Expert Review                  |
   |               |      |  224-255  | Experimental Use               |
   | VALIDITY_TIME |   1  |     0     | The time from receipt of the   |
   |               |      |           | message during which the       |
   |               |      |           | information contained in the   |
   |               |      |           | message is to be considered    |
   |               |      |           | valid                          |
   |   Unassigned  |   1  |   1-223   | Expert Review                  |
   |               |      |  224-255  | Experimental Use               |
   +---------------+------+-----------+--------------------------------+

                                  Table 1

9.3.  Address Block TLV Types

   +---------------+------+-----------+--------------------------------+
   |      Name     | Type |    Type   | Description                    |
   |               |      | extension |                                |
   +---------------+------+-----------+--------------------------------+
   | INTERVAL_TIME |   0  |     0     | The maximum time before        |
   |               |      |           | another message of the same    |
   |               |      |           | type as this message from the  |
   |               |      |           | same originator and containing |
   |               |      |           | this address should be         |
   |               |      |           | received                       |
   |   Unassigned  |   0  |   1-223   | Expert Review                  |
   |               |      |  224-255  | Experimental Use               |
   | VALIDITY_TIME |   1  |     0     | The time from receipt of the   |
   |               |      |           | address during which the       |
   |               |      |           | information regarding this     |
   |               |      |           | address is to be considered    |
   |               |      |           | valid                          |
   |   Unassigned  |   0  |   1-223   | Expert Review                  |
   |               |      |  224-255  | Experimental Use               |
   +---------------+------+-----------+--------------------------------+

                                  Table 2

10.  Security Considerations

   This document specifies how to add data structures (TLVs) that
   provide timing information to packets and messages specified using
   [RFC5444].  In particular, information validity durations and
   reporting intervals may be added.

   The general security threats that apply are those general to
   [RFC5444] and described therein, problems of integrity and
   confidentiality.  With regard to the former, modification of a Time
   TLV can cause information to have an invalid validity time, or
   expected interval time.  This may cause incorrect protocol
   performance.  Modification or addition of timed information can add
   to a protocol's workload (especially if a short validity time is
   specified) and storage requirements (especially if a long validity
   time is specified).

   To counter these threats, the security suggestions in [RFC5444], for
   the use of authentication and encryption, are appropriate.

11.  References

11.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC5444]  Clausen, T., Dearlove, C., Dean, J., and C. Adjih,
              "Generalized Mobile Ad Hoc Network (MANET) Packet/Message
              Format", RFC 5444, February 2009.

11.2.  Informative References

   [RFC3626]  Clausen, T. and P. Jacquet, "The Optimized Link State
              Routing Protocol", RFC 3626, October 2003.

Appendix A.  Acknowledgements

   The authors would like to thank Brian Adamson and Justin Dean (both
   NRL) and Ian Chakeres (Motorola) for their contributions, and Alan
   Cullen (BAE Systems) and Jari Arkko (Ericsson, Finland) for their
   careful reviews of this specification.

Authors' Addresses

   Thomas Heide Clausen
   LIX, Ecole Polytechnique, France

   Phone: +33 6 6058 9349
   EMail: T.Clausen@computer.org
   URI:   http://www.ThomasClausen.org/


   Christopher Dearlove
   BAE Systems Advanced Technology Centre

   Phone: +44 1245 242194
   EMail: chris.dearlove@baesystems.com
   URI:   http://www.baesystems.com/

ISO Plain Language

On this page
PROBLEMRouting protocols for mobile ad hoc networks need to say two things about their messages: how soon the next one of the same kind should arrive, and how long the information in this one stays true. Carrying those times in full takes too many bytes on a bandwidth-limited wireless link.
MECHANISMThe RFC defines a Time TLV whose value is an 8-bit time-code, formed from a 5-bit exponent and a 3-bit mantissa, scaled by a parameter C that every node in the deployment shares. The TLV can also carry a list of time codes with the hop count at which each takes effect, so a node works out its own value from how far away the originator is.
WHAT IT ADDSA time value can range from C up to 15 * 2^28 * C, which is about 45 days when C is 1/1024 of a second, using one byte. Two Message TLV types, INTERVAL_TIME and VALIDITY_TIME, and two matching Address Block TLV types are defined for use with the generalized MANET packet format.

§1What This Document Adds

The generalized packet and message format of RFC 5444 specifies a signaling format that MANET routing protocols can employ for exchanging protocol information. That format can express and associate attributes to packets, messages or addresses by way of a general TLV, type-length-value, mechanism.

This document specifies a general Time TLV structure that any MANET routing protocol can use when it needs to express either single time-values or a set of time-values with each time-value associated with a range of hop counts, as provided by the Message Header of RFC 5444. This allows a receiving node to determine a single time-value if it either knows its hop count from the originator node or the Time TLV specifies a single time-value.

A time-value is, in this context, not an absolute point in time, but an interval or a duration. An instance of a Time TLV can express an interval or a duration such as 10 seconds.

The document also specifies two Message TLV Types that use the proposed structure. These are INTERVAL_TIME and VALIDITY_TIME, specifying respectively the maximum time before another message of the same type as this message from the same originator should be received, and the duration for which the information in this message is valid after receipt. If both are present, the latter will usually be greater than the former, in order to allow for possible message loss.

Two Address Block TLV Types are specified as well, again INTERVAL_TIME and VALIDITY_TIME, defined equivalently to the two Message TLVs with the same names.

The MANET packet format of RFC 5444 lets a protocol attach small pieces of extra information to a packet, a message or a list of addresses. This document defines one such piece: a way of saying how long a time is.

§1.1Why Time Needs Its Own Encoding

The Time TLV structure is intended to be used as a component in a MANET routing protocol, for example to indicate the expected spacing between successive transmissions of a given Message Type, by including a Time TLV in transmitted messages.

Some MANET routing protocols use very short spacing for some messages and very long spacing for others, or change the message transmission rate according to observed behaviour. If a network is observed at some point to exhibit a highly dynamic topology, a sub-second message spacing could be appropriate, whereas if the network later stabilises, multi-hour spacing may become appropriate. Different MANET routing protocols and different deployments may have different granularity requirements and bounds on the shortest and longest spacing between successive message transmissions.

MANET routing protocol deployments also typically use bandwidth-limited wireless network interfaces, and therefore prefer to trade off computational complexity for a saving in the number of bits transmitted. That is practical here, because the intended uses of Time TLVs, including message interval time and information validity time, do not require high-precision values of time.

The structure caters to these characteristics by encoding time-values, such as an interval or a duration, in an 8-bit field; by allowing these time-values to range from very small, for example 1/1024 second, to very long, for example 45 days; and by allowing a routing protocol or a deployment to parameterize this, to attain finer granularity at the expense of a lower upper bound, through a single parameter, C. The parameter C must be the same for all MANET routers in the same deployment.

The TLV mechanism of RFC 5444 allows associating a value to a packet, a message or addresses. The data structure is identical in all three cases, but the TLV's position in a received packet determines what it is: a Packet TLV appears in the Packet Header before any messages, a Message TLV appears in the TLV Block immediately following a Message Header, and an Address Block TLV appears in the TLV Block immediately following an Address Block. While TLVs may be structurally identical, what they express may be different, which is why RFC 5444 specifies separate registries for Packet TLV Types, Message TLV Types and Address Block TLV Types.

Two forces shape this design. Wireless links in these networks carry few bits, so a time should not cost many bytes. And the times a routing protocol cares about do not need to be precise, because they describe how long to wait and how long to trust something, not an exact instant.

§5Encoding a Time Value in 8 Bits

Time-values are each represented in an 8-bit time-code, one or more of which may be used in a TLV's value field. Of these 8 bits, the least significant 3 bits represent the mantissa, a, and the most significant 5 bits represent the exponent, b, so that the time-value is (1 + a/8) * 2^b * C and the time-code is 8 * b + a.

All nodes in the MANET MUST use the same value of the constant C, which is specified in seconds, so all time-values are in seconds too. C MUST be greater than 0 seconds. Ascending values of the time-code represent ascending time-values, so time-values may be compared by comparing time-codes.

An algorithm for computing the time-code representing the smallest representable time-value not less than a given time-value t is given in the RFC: find the largest integer b such that t/C is at least 2^b; set a to 8 times (t divided by C times 2^b, minus 1), rounded up to the nearest integer; if a equals 8, set b to b plus 1 and set a to 0; and then, if a is between 0 and 7 and b is between 0 and 31, the required time-value can be represented by the time-code 8 * b + a, otherwise it cannot.

The minimum time-value that can be represented is C. The maximum is 15 * 2^28 * C, or about 4.0 * 10^9 * C; if C is 1/1024 second, that is about 45 days. A protocol using this time representation MUST define the value of C, and MAY specify that the all-bits zero time-value represents a time-value of zero and/or that the all-bits one time-value represents an indefinitely large time-value.

The encoding works like a rounding scheme. Five bits hold a power of two and three bits hold a fraction of it, so the byte can stand for a wide range of durations while still ordering correctly: a bigger number always means a longer time.

One number, C, is shared by everyone in the network. It sets the unit. Choosing C as a thousandth of a second gives times from a thousandth of a second up to about 45 days.

THE 8-BIT TIME-CODE (RFC 5497, SECTION 5)
time-code
FieldNameSizeValueDescription
EXPONENTExponent b5 bitsThe most significant 5 bits. The time-value is (1 + a/8) * 2^b * C.
MANTISSAMantissa a3 bitsThe least significant 3 bits. The time-code is 8 * b + a.

§6The Time TLV Structure

The data structure allows the representation of a single time-value, or of a default time-value plus pairs of time-values and hop counts for when hop-count-dependent time-values are required. Using the regular expression syntax of RFC 5444, it is specified as <time-data> = (<time-code><hop-count>)*<time-code>.

A time-code is an 8-bit unsigned integer field containing a time-code, and a hop-count is an 8-bit unsigned integer field specifying a hop count from the message originator. A time-data structure therefore consists of an odd number of octets: with a repetition factor of n for the (time, hop count) pairs, it contains 2n+1 octets, and on reception n is determined from the length.

The structure may be written as <t_1><d_1><t_2><d_2> ... <t_n><d_n><t_default>. The hop counts d_1 to d_n, if present, MUST be a strictly increasing sequence with d_n less than 255. At the receiving node's hop count from the originator, the indicated time-value is t_1 if n is greater than 0 and the hop count is at most d_1; t_i+1 if n is greater than 1 and d_i is less than the hop count and at most d_i+1; and t_default otherwise, that is, if n is 0 or the hop count is greater than d_n.

Two variants of the TLV exist. A single-value Time TLV, with the tismultivalue flag cleared in its tlv-flags field, contains a single time-data structure in its value field, and its length field MUST contain the value 2n+1, with n being the number of (time-value, hop count) pairs. The number of pairs is found from the length as n := (length - 1) / 2, and that MUST be an integer value.

A multi-value Time TLV, with the tismultivalue flag set, contains a sequence of time-data structures, associating a set of them with an identically sized set of addresses. Multi-value Time TLVs MUST be Address Block TLVs, and MUST NOT be a Packet TLV or a Message TLV. Their length field MUST contain the value m * (2n+1), where n is the number of (time-value, hop count) pairs and m is the number of values as defined in RFC 5444. The number of pairs in each time-data structure is found as n := ((length / number-values) - 1) / 2, and that MUST be an integer value; the lists of hop count values MAY be different.

Hop count is defined as the number of hops from the message originator to the message recipient, equal to the msg-hop-count field in the msg-header element of RFC 5444 if present, after it has been incremented on reception. If that field is not present, or in a Packet TLV, hop count is defined to equal 255. A time-data structure included in a message without a msg-hop-count field, or in a Packet TLV, SHOULD use the single time-code form, that is, n = 0.

The value of the TLV is a list of time codes, each optionally followed by the hop count at which it starts to apply. A node that knows how many hops away it is looks up the entry that covers its own hop count, and uses that time. Everything beyond the last hop count uses the final, default entry.

THE TIME-DATA STRUCTURE (RFC 5497, SECTION 6)
time-data
<time-data> = (<time-code><hop-count>)*<time-code>

<t_1><d_1><t_2><d_2> ... <t_n><d_n><t_default>

n := (length - 1) / 2        octets: 2n+1

§7The Message TLVs and the Address Block TLVs

Two Message TLVs are defined, for signalling message interval and message validity time.

An INTERVAL_TIME Message TLV defines the maximum time before another message of the same type as this message from the same originator should be received. This interval time MAY be specified to depend on the hop count from the originator, which is appropriate if messages are sent with different hop limits so that receiving nodes at greater hop counts have an increased interval time. A message MUST NOT include more than one INTERVAL_TIME TLV.

A VALIDITY_TIME Message TLV defines the validity time of the information carried in the message in which the TLV is contained. After this time the receiving node MUST consider the message content to no longer be valid, unless it is repeated in a later message. The validity time of a message MAY also be specified to depend on the hop count from its originator, which is appropriate if messages are sent with different hop limits so that receiving nodes at greater hop counts receive information less frequently and must treat it as valid for longer. A message MUST NOT include more than one VALIDITY_TIME TLV.

Two Address Block TLVs are defined with the same names. An Address Block INTERVAL_TIME TLV defines the maximum time before this address from the same originator should be received again, and its interval time MAY depend on the hop count from the originator. An Address Block VALIDITY_TIME TLV defines the validity time of the addresses the TLV is associated with; after this time the receiving node MUST consider the addresses to no longer be valid, unless they are repeated in a later message, and the validity time MAY depend on the hop count.

A protocol that uses an Address Block TLV and the same named Message TLV MUST specify how to interpret the case when both are present, typically that the former overrides the latter for the addresses it covers.

In the terminology of the document, a time-value is a time measured in seconds and a time-code is the 8-bit field that represents a time-value.

Two questions are answered by the TLVs. The interval TLV says how long the sender intends to wait before sending the same kind of message again, so a receiver knows when to expect it. The validity TLV says how long the contents should be trusted after they arrive.

Both can be attached to a whole message or to a list of addresses inside a message, and both can say that the time grows with distance from the sender.

§9IANA Considerations

This specification defines two Message TLV Types, allocated from the Assigned Message TLV Types repository of RFC 5444, and two Address Block TLV Types, allocated from the Assigned Address Block TLV Types repository of RFC 5444. IANA has assigned the same numerical value to the Message TLV Type and the Address Block TLV Type with the same name.

INTERVAL_TIME is assigned type 0 and VALIDITY_TIME is assigned type 1 in both registries, with type extension 0. Type extensions 1 to 223 require Expert Review and 224 to 255 are for Experimental Use.

The two new TLVs are registered in the registries of RFC 5444, and the message version and the address list version share the same numbers: zero for the interval and one for the validity time.

§10Security Considerations

This document specifies how to add data structures, TLVs, that provide timing information to packets and messages specified using RFC 5444. In particular, information validity durations and reporting intervals may be added.

The general security threats that apply are those general to RFC 5444, problems of integrity and confidentiality. With regard to integrity, modification of a Time TLV can cause information to have an invalid validity time or expected interval time, which may cause incorrect protocol performance. Modification or addition of timed information can add to a protocol's workload, especially if a short validity time is specified, and to its storage requirements, especially if a long validity time is specified.

To counter these threats, the security suggestions in RFC 5444 for the use of authentication and encryption are appropriate.

The times inside these TLVs are only as trustworthy as the message carrying them. An attacker who changes a validity time can make the network do more work or trust stale information for longer, so the same authentication and encryption used for the rest of the message are the right protection.

§8References