RFC 9510
Alternative Delta Time Encoding for Content-Centric Networking (CCNx) Using Compact Floating-Point Arithmetic
RFC 9510: Alternative Delta Time Encoding for Content-Centric Networking (CCNx) Using Compact Floating-Point Arithmetic โจ
okay bestie, this one is a whole vibe ๐ธ here's the title-block tea first:
- Stream: Internet Research Task Force (IRTF) ๐
- Request for Comments: 9510 ๐
- Category: Experimental ๐งช
- Date: February 2024 ๐
- ISSN: 2070-1721
- Updates: RFC 8609 ("CCNx messages in TLV Format") ๐ฆ
- Obsoletes: nothing is listed in the title block ๐
The authors are C. Gรผndoฤan (Huawei), TC. Schmidt (HAW Hamburg), D. Oran (Network Systems Research and Design), and M. Wรคhlisch (TU Dresden). It's giving research-group squad goals ๐
Abstract ๐
okay so CCNx uses delta time for a bunch of stuff ๐ธ when your nodes are tiny or your bandwidth is tight, having a squished version of delta time is literally so valuable. buuut squishing it means you have to give up either accuracy or dynamic range ๐ญ since the current delta-time uses don't need both at the same time, a logarithmic encoding is lowkey the move ๐ฆ this doc updates RFC 8609 ("CCNx messages in TLV Format") to spec that alternative encoding โจ
this doc is a product of the IRTF Information-Centric Networking Research Group (ICNRG) ๐
Status of This Memo ๐
this document is not an Internet Standards Track specification. it's published for examination, experimental implementation, and evaluation ๐งช
this document defines an Experimental Protocol for the Internet community. it's a product of the Internet Research Task Force (IRTF), which publishes the results of Internet-related research and development activities. these results might not be suitable for deployment ๐ this RFC represents the consensus of the Information-Centric Networking Research Group of the Internet Research Task Force (IRTF). Documents approved for publication by the IRSG are not candidates for any level of Internet Standard; see Section 2 of RFC 7841 ๐
for info on the current status of this document, any errata, and how to give feedback on it, check https://www.rfc-editor.org/info/rfc9510 ๐ฅ
Copyright Notice ยฉ๏ธ
Copyright (c) 2024 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 (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. please review these documents carefully, because they describe your rights and restrictions with respect to this document ๐
Table of Contents ๐๏ธ
1. Introduction
2. Terminology
3. Usage of Time Values in CCNx
3.1. Relative Time in CCNx
3.2. Absolute Time in CCNx
4. A Compact Time Representation with Logarithmic Range
5. Protocol Integration of the Compact Time Representation
5.1. Interest Lifetime
5.2. Recommended Cache Time
6. IANA Considerations
7. Security Considerations
8. References
8.1. Normative References
8.2. Informative References
Appendix A. Test Vectors
Appendix B. Efficient Time Value Approximation
Acknowledgments
Authors' Addresses
1. Introduction โจ
CCNx is so well suited for Internet of Things (IoT) applications [RFC7927] ๐ง Low-Power Wireless Personal Area Network (LoWPAN) adaptation layers (e.g., [RFC9139]) confirm the advantages of a space-efficient packet encoding for low-power and lossy networks. CCNx uses absolute and delta time values for a bunch of functions. when you're running CCNx in resource-constrained environments, a compact representation of time values is super valuable ๐ buuut any compact time representation has to sacrifice accuracy or dynamic range. for some time uses this is relatively straightforward to achieve, and for other uses it is not ๐ญ
as a result of experiments in bandwidth-constrained IEEE 802.15.4 deployments [ICNLOWPAN], this document looks at the various cases of time values, proposes a compact encoding for delta times, and updates [RFC8609] to use this encoding format in CCNx messages ๐ฆ
this document has received fruitful reviews from the members of the research group (see the Acknowledgments section) ๐ซถ it is the consensus of ICNRG that this document should be published in the IRTF Stream of the RFC series. this document does not constitute an IETF standard, so no big-deal vibes here ๐
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 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
this document uses the terminology of [RFC8569] and [RFC8609] for CCNx entities ๐
the following terms are used in the document and defined as follows:
- byte: synonym for octet ๐
- time value: a time offset measured in seconds โฑ๏ธ
- time code: an 8-bit encoded time value as defined in [RFC5497] โจ
3. Usage of Time Values in CCNx ๐ฆ
3.1. Relative Time in CCNx
CCNx, as currently specified in [RFC8569], uses delta time for only the lifetime of an Interest message (see Sections 2.1, 2.2, 2.4.2, and 10.3 of [RFC8569]) ๐ it's a hop-by-hop header value, and it's currently encoded via the T_INTLIFE TLV as a 64-bit integer (Section 3.4.1 of [RFC8609]). while formally an optional TLV, every Interest message is expected to carry the Interest Lifetime TLV in all but some corner cases. so having a compact encoding is particularly valuable to keep Interest messages short ๐โโ๏ธ๐จ
since the current uses of delta time don't require both accuracy and dynamic range at the same time, one can consider a logarithmic encoding such as the one specified in [IEEE.754.2019] and outlined in Section 4 ๐งฎ this document updates CCNx messages in TLV format [RFC8609] to permit this alternative encoding for selected time values ๐
3.2. Absolute Time in CCNx
CCNx, as currently specified in [RFC8569], uses absolute time for various important functions ๐ each of these absolute time usages poses a different challenge for a compact representation. these are discussed in the following subsections ๐ซง
3.2.1. Signature Time and Expiry Time
Signature Time is the time the signature of a Content Object was generated (see Sections 8.2-8.4 of [RFC8569]) โ๏ธ Expiry Time indicates the time after which a Content Object is considered expired (Section 4 of [RFC8569]). both values are content message TLVs and represent absolute timestamps in milliseconds since the POSIX epoch. they are currently encoded via the T_SIGTIME and T_EXPIRY TLVs as 64-bit unsigned integers (see Sections 3.6.4.1.4.5 and 3.6.2.2.2 of [RFC8609], respectively) ๐ฐ๏ธ
both time values could be in the past or in the future, potentially by a large delta ๐ they're also included in the security envelope of the message. so, it seems there's no practical way to define an alternative compact encoding that preserves its semantics and security properties. therefore, this approach is not considered further ๐
this is the one spot where compact encoding just isn't it, bestie. the security envelope is non-negotiable ๐
3.2.2. Recommended Cache Time
Recommended Cache Time (RCT) for a Content Object (Section 4 of [RFC8569]) is a hop-by-hop header stating the expiration time for a cached Content Object in milliseconds since the POSIX epoch ๐๏ธ it's currently encoded via the T_CACHETIME TLV as a 64-bit unsigned integer (see Section 3.4.2 of [RFC8609]).
a Recommended Cache Time could be far in the future, but it cannot be in the past, and it's likely to be a reasonably short offset from the current time ๐ธ so this document allows the Recommended Cache Time to be interpreted as a relative time value rather than an absolute time. the reason is that the semantics associated with an absolute time value don't seem to be critical to the utility of this value ๐ this document therefore updates the Recommended Cache Time with the following rule set:
- Use absolute time as per [RFC8609]
- Use relative time, if the compact time representation is used (see Sections 4 and 5)
if relative time is used, the time offset recorded in a message will typically not account for residence times on lower layers (e.g., for processing, queuing) and link delays for every hop. thus, the Recommended Cache Time cannot be as accurate as when absolute time is used ๐ซ this document targets low-power networks, where delay bounds are rather loose or don't exist. an accumulated error due to transmission delays in the range of milliseconds and seconds for the Recommended Cache Time is still tolerable in these networks, and it does not impact the protocol performance ๐
networks with tight latency bounds use dedicated hardware, optimized software routines, and traffic engineering to reduce latency variations. time offsets can then be corrected on every hop to yield exact cache times โก
4. A Compact Time Representation with Logarithmic Range โจ
okay so this section is where the compact time magic happens ๐ช It uses the compact time representation from "Information-Centric Networking (ICN) Adaptation to Low-Power Wireless Personal Area Networks (LoWPANs)" (see Section 7 of [RFC9139]), which was inspired by [RFC5497] and [IEEE.754.2019]. The logarithmic encoding lets it cover everything from milliseconds all the way up to years ๐ญ๐ซถ Figure 1 shows the vibe:
|| | | | | | | | | | |
+-----------------------------------------------------------------+
milliseconds years
Figure 1: A logarithmic range representation allows for higher
precision in the smaller time ranges and still supports large
time deltas.
Time codes pack the exponent and mantissa into a single byte ๐ Compared to [IEEE.754.2019], time codes only encode non-negative numbers, so there's no separate bit for integer signedness. Figure 2 shows the layout: a 5-bit exponent and a 3-bit mantissa ๐
<--- one byte wide --->
+----+----+----+----+----+----+----+----+
| exponent (b) | mantissa (a) |
+----+----+----+----+----+----+----+----+
0 1 2 3 4 5 6 7
Figure 2: A time code with exponent and mantissa to encode a
logarithmic range time representation.
The base unit for time values is seconds โฑ๏ธ A time value is calculated with the formula below (adopted from [RFC5497] and [RFC9139]), where (a) is the mantissa, (b) is the exponent, and (C) is a constant factor set to C := 1/32 ๐ธ
Subnormal (b == 0): (0 + a/8) * 2 * C
Normalized (b > 0): (1 + a/8) * 2^b * C
The subnormal form gives you a gradual underflow between zero and the smallest normalized number, which is honestly so smart ๐ง There are eight time values in the subnormal range [0s,~0.0546875s], with a step size of ~0.0078125s between each one. This setup also encodes these convenient numbers in seconds: [1, 2, 4, 8, 16, 32, 64, ...] ๐ Appendix A has test vectors that show off the logarithmic range.
There's an example algorithm for turning a time value into an exponent and mantissa, written as pseudocode in Figure 3. Not every time value can be represented by a time code, though ๐ฅบ For those cases, the algorithm produces a time code that represents the time value closest to, and smaller than, the input.
input: float v // time value
output: int a, b // mantissa, exponent of time code
(a, b) encode (v):
if (v == 0)
return (0, 0)
if (v < 2 * C) // subnormal
a = floor (v * 4 / C) // round down
return (a, 0)
else // normalized
if (v > (1 + 7/8) * 2^31 * C) // check bounds
return (7, 31) // return maximum
else
b = floor (log2(v / C)) // round down
a = floor ((v / (2^b * C) - 1) * 8) // round down
return (a, b)
Figure 3: Algorithm in pseudocode.
For example, there's no specific time code for 0.063 ๐ But the algorithm maps it to the closest valid time code that's smaller than 0.063, which is exponent 1 and mantissa 0. That's the same as the time value 0.0625 ๐
5. Protocol Integration of the Compact Time Representation
okay bestie, the most straightforward way to fit compact time into the protocol is to use a 1-byte length field to signal this alternative encoding, while keeping the existing TLV registry entries ๐ฆ This approach does cause backward compatibility problems, but it's still on the table for these reasons:
- Both CCNx RFCs ([RFC8569] and [RFC8609]) are Experimental and not Standards Track, so the expectations for forward and backward compatibility aren't as strict. "Flag day" upgrades of deployed CCNx networks are inconvenient, but they're still feasible ๐๏ธ
- The main use case for these compressed encodings is smaller-scale IoT and/or sensor networks, where the populations of consumers, producers, and forwarders are reasonably small ๐ฑ
- The current TLVs have hop-by-hop semantics, so they aren't covered by any signed hash and can be freely re-encoded by any forwarder ๐ That means a forwarder that supports the new encoding can translate freely between the two encodings โจ
- Assigning new TLV registry values doesn't substantially fix the interoperability problems anyway ๐ค
5.1. Interest Lifetime
The Interest Lifetime definition in [RFC8609] allows a variable-length lifetime representation, where a length of 1 encodes the linear range [0,255] in milliseconds โณ This document changes the definition so that 1-byte Interest Lifetime values are always encoded in the compact time value representation (see Figure 4). For any other length, Interest Lifetimes are encoded as described in Section 3.4.1 of [RFC8609].
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
+---------------+---------------+---------------+---------------+
| T_INTLIFE | Length = 1 |
+---------------+---------------+---------------+---------------+
| COMPACT_TIME |
+---------------+
Figure 4: Changes to the definition of the Interest Lifetime TLV.
5.2. Recommended Cache Time
The Recommended Cache Time definition in [RFC8609] specifies an absolute time representation with a fixed length of 8 bytes ๐ฆ This document changes it so that 1-byte Recommended Cache Time values are always encoded in the compact relative time value representation (see Figure 5). For any other length, Recommended Cache Times are encoded as described in Section 3.4.2 of [RFC8609].
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
+---------------+---------------+---------------+---------------+
| T_CACHETIME | Length = 1 |
+---------------+---------------+---------------+---------------+
| COMPACT_TIME |
+---------------+
Figure 5: Changes to the definition of the Recommended Cache Time
TLV.
The packet processing is adapted to calculate an absolute time from the relative time code, based on the absolute reception time ๐ฐ๏ธ On transmission, a new relative time code is calculated based on the current system time ๐ซ
6. IANA Considerations
No IANA actions here, bestie ๐ This document has no IANA actions.
7. Security Considerations
This is the serious part, so pay attention ๐ This document makes no semantic changes to [RFC8569], nor to any of the security properties of the message encodings described in [RFC8609]. That means it has the same security considerations as those two documents. Careful consideration is needed for networks that deploy forwarders with support (updated forwarder) and without support (legacy forwarder) for this compact time representation ๐จ
- Interest Lifetime: A legacy forwarder interprets a time code as an Interest Lifetime between 0 and 255 milliseconds. This may lead to a degradation of network performance, since Pending Interest Table (PIT) entries time out quicker than expected ๐ฑ An updated forwarder interprets short lifetimes set by a legacy forwarder as time codes, which configures timeouts of up to 4 years. This leads to an inefficient occupation of state space ๐
- Recommended Cache Time: A legacy forwarder considers a Recommended Cache Time with length 1 as a structural or syntactical error, and it SHOULD discard the packet (Section 10.3.9 of [RFC8569]). Otherwise, a legacy forwarder interprets time codes as absolute time values far in the past, which impacts cache utilization ๐๏ธ
8. References
8.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, <https://www.rfc-editor.org/info/rfc2119>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8569] Mosko, M., Solis, I., and C. Wood, "Content-Centric Networking (CCNx) Semantics", RFC 8569, DOI 10.17487/RFC8569, July 2019, <https://www.rfc-editor.org/info/rfc8569>.
[RFC8609] Mosko, M., Solis, I., and C. Wood, "Content-Centric Networking (CCNx) Messages in TLV Format", RFC 8609, DOI 10.17487/RFC8609, July 2019, <https://www.rfc-editor.org/info/rfc8609>.
8.2. Informative References
[ICNLOWPAN] Gรผndoฤan, C., Kietzmann, P., Schmidt, T., and M. Wรคhlisch, "Designing a LoWPAN convergence layer for the Information Centric Internet of Things", Computer Communications, Vol. 164, No. 1, p. 114-123, Elsevier, December 2020, <https://doi.org/10.1016/j.comcom.2020.10.002>.
[IEEE.754.2019] IEEE, "Standard for Floating-Point Arithmetic", IEEE Std 754-2019, DOI 10.1109/IEEESTD.2019.8766229, June 2019, <https://standards.ieee.org/content/ieee-standards/en/standard/754-2019.html>.
[RFC5497] Clausen, T. and C. Dearlove, "Representing Multi-Value Time in Mobile Ad Hoc Networks (MANETs)", RFC 5497, DOI 10.17487/RFC5497, March 2009, <https://www.rfc-editor.org/info/rfc5497>.
[RFC7927] Kutscher, D., Ed., Eum, S., Pentikousis, K., Psaras, I., Corujo, D., Saucez, D., Schmidt, T., and M. Waehlisch, "Information-Centric Networking (ICN) Research Challenges", RFC 7927, DOI 10.17487/RFC7927, July 2016, <https://www.rfc-editor.org/info/rfc7927>.
[RFC9139] Gรผndoฤan, C., Schmidt, T., Wรคhlisch, M., Scherb, C., Marxer, C., and C. Tschudin, "Information-Centric Networking (ICN) Adaptation to Low-Power Wireless Personal Area Networks (LoWPANs)", RFC 9139, DOI 10.17487/RFC9139, November 2021, <https://www.rfc-editor.org/info/rfc9139>.
Appendix A. Test Vectors ๐งชโจ
okay so the test vectors in Table 1 are literally the cheat sheet ๐ they show sample time codes next to their matching time values, using the algorithm from Section 4. bestie, check it out ๐
+===========+======================+
| Time Code | Time Value (seconds) |
+===========+======================+
| 0x00 | 0.0000000 |
+-----------+----------------------+
| 0x01 | 0.0078125 |
+-----------+----------------------+
| 0x04 | 0.0312500 |
+-----------+----------------------+
| 0x08 | 0.0625000 |
+-----------+----------------------+
| 0x15 | 0.2031250 |
+-----------+----------------------+
| 0x28 | 1.0000000 |
+-----------+----------------------+
| 0x30 | 2.0000000 |
+-----------+----------------------+
| 0xF8 | 67108864.0000000 |
+-----------+----------------------+
| 0xFF | 125829120.0000000 |
+-----------+----------------------+
Table 1: Test Vectors
Appendix B. Efficient Time Value Approximation ๐
okay this one is so clever ๐ค a forwarder keeps converting compact time into milliseconds so it can compare Interest Lifetimes and how long cache entries last. the catch is that on lots of architectures, multiplication and division are slower than addition, subtraction, and bit shifts ๐ข so these equations approximate the formulas from Section 4 and scale from seconds into the milliseconds range by using a factor of 2^10 instead of 10^3. the trade-off? an error of 2.4%. not me being impressed by a tiny error for a huge speed win ๐
b == 0: 2^10 * a * 2^-3 * 2^1 * 2^-5
= a << 3
b > 0: (2^10 + a * 2^-3 * 2^10) * 2^b * 2^-5
= (1 << 5 + a << 2) << b
Acknowledgments ๐
the authors want to thank the active members of ICNRG for their constructive thoughts ๐ซถ special shoutouts to Marc Mosko and Ken Calvert for their valuable feedback on the encoding scheme and protocol integration ๐ธ and extra big thanks to Carsten Bormann for his constructive in-depth comments during the IRSG review ๐
Authors' Addresses ๐ฆ
Cenk Gรผndoฤan
Huawei Technologies Duesseldorf GmbH
Riesstrasse 25
D-80992 Munich
Germany
Email: cenk.gundogan@huawei.com
Thomas C. Schmidt
HAW Hamburg
Berliner Tor 7
D-20099 Hamburg
Germany
Email: t.schmidt@haw-hamburg.de
URI: http://inet.haw-hamburg.de/members/schmidt
Dave Oran
Network Systems Research and Design
4 Shady Hill Square
Cambridge, MA 02138
United States of America
Email: daveoran@orandom.net
Matthias Wรคhlisch
TUD Dresden University of Technology
Helmholtzstr. 10
D-01069 Dresden
Germany
Email: m.waehlisch@tu-dresden.de
that's a wrap on RFC 9510 ๐๐
๐ฆ where this page comes from
- ietf: rfc9510 2024-02
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms