<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="info"
  docName="draft-blanchet-tvr-forwarding-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">
  <front>
    <title abbrev="Forwarding in context of TVR">Forwarding in the context of Time-Variant Routing(TVR)</title> <!-- https://authors.ietf.org/en/rfcxml-vocabulary#title-4 -->
    <seriesInfo name="Internet-Draft" value="draft-blanchet-tvr-forwarding-00"/>
    <author fullname="Marc Blanchet" initials="MB">
        <organization>Viagenie</organization>
      <address>
        <email>marc.blanchet@viagenie.ca</email>  
      </address>
    </author>
    <date year="2023"/> 
    <area>Routing</area>
    <workgroup>Internet Engineering Task Force</workgroup>
    <keyword>forwarding</keyword>
    <keyword>dtn</keyword>
    <keyword>tvr</keyword>
    <keyword>disruption</keyword>
    <abstract>
        <t>Some networks, such as in space, have links that are up and down based on a known schedule. In this context, IP Packets or Bundle Protocol Bundles
            should then be saved locally until the destination becomes reachable again. This document describes forwarding node policies
            regarding how to manage the local store as well as forwarding decisions. This specification applies to both IP packets or Bundle Protocol bundles.
        </t>
    </abstract>
  </front>
  <middle>
    <section>
      <name>Introduction</name>
      <t>Some networks, such as in space, have links that are up and down based on a known schedule. In this context, IP Packets or Bundle Protocol Bundles
          should then be saved locally until the destination becomes reachable again. This document describes forwarding node policies
          regarding how to manage the local store as well as forwarding decisions. This specification applies to both IP packets or Bundle Protocol <xref target="RFC9171"/> bundles.</t>
          <t>For easier reading, this document will use the word "packet" to encompass both IP packets and Bundle Protocol bundles. </t>
      <t>In typical IP forwarding engines, if the route for a destination does not exist, a forwarding engine would drop the packet and then return an ICMP Unreachable Error Message to the source of the packet. This specification describes an atypical behavior of IP forwarding engines.</t>
      <t>Bundles of the Bundle Protocol are defined for the purpose of store and forward, therefore it is a normal behavior to store the bundles until reachability is possible.</t>
      <t>This document was written mostly based on Bundle Protocol implementations that are targetted for space networks. It was then generalized for IP. The IP behavior may be underspecified or inadequately specified for the first versions of this document.</t>
      <section anchor="requirements">
        <name>Requirements Language</name>
        <t>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 <xref target="RFC2119"/>
          <xref target="RFC8174"/> when, and only when, they appear in
          all capitals, as shown here.</t>
      </section>
    </section>
    <section>
      <name>Forwarding</name>
      <t>If the destination is unreachable, the packet is not discarded and therefore saved in memory. Whether volatile or non-volatile is an implementation decision. The packet should be saved with a timestamp to be used by policies described in this document.</t>
      <t>When a new route is installed, or in general when the forwarding table has changed, then saved packets are parsed, and those that can be sent are sent, in order of the preference policy discussed below. How saved packets are parsed is implementation decision. For example, an implementation may index saved packets based on destination prefixes, so that the lookup is fast.</t>
      <t>Policies are needed to guide the forwarding engine when the following events happen.</t>
      <ul>
          <li>Packet memory store is full and a new packet is incoming.</li>
          <li>A destination becomes reachable by a new route entry in the forwarding table. Which stored packets should be forwarded first.</li>
          <li>A packet has expired. BP Bundles have lifetimes. IP packets have TTL (IPv4) or Hop Limit (IPv6). However, this specification does not change the behavior of IP packets when TTL or Hop Limit has a value of zero.</li>
          <li>The capability of storing packets for a forwarding node may be resource demanding, especially in scenarios where node resources are very limited, such as in space. Therefore, the forwarding node owner may want to have preference on which types of packets are stored or not. For example, the forwarding node may prefer by policy to store packets based on the source address, destination address, both addresses or various fields, such as Flow Label, Diffserv or else. Bundles also have various fields that may be used for such policies.</li>
          <li>When a packet needs to be dropped, an error should be sent back to the source. Both IP and BP has those error messages. However, in a constraint environment, error messages may be too costly to send back to source. Another case is when the packet is just "too" old to make an error message relevant to be sent. A policy may tell the forwarding node to not send error messages back to source when dropping packets.</li>
      </ul>
    </section>
   <section>
     <name>Policies</name>
     <t>This section describes some policies that may be configured on the forwarding node.</t>
   <section>
     <name>Drop Policy</name>
     <t>When the packet memory store is full and space is needed such as a new packet is incoming, the drop policy comes into effect. It may also happen by other reasons, such as an asynchronous "garbage collection" process. The drop policy may be one (TBD: or many? with weights?) of the following.</t>
     <ul>
         <li>Drop oldest: The oldest packets are dropped. Error messages are sent to the source.</li>
        <li>Drop last from these sources. Keep the packets from these sources as long as possible: e.g. drop them after dropping all others, Sources are specified as a list of prefixes. Order in the list is relevant: first one in the list is the last one to drop.</li>
        <li>Drop last for these destinations. Keep the packets to this destination as long as possible: e.g. drop them after dropping all others. Destinations are specified as a list of prefixes. Order in the list is relevant: first one in the list is the last one to drop.</li>
        <li>Drop last if a field is set to a value. Keep the packets with the specified field having the specified value as long as possible: e.g. drop them after dropping all others</li>
     </ul>
     <t>An additional characteristic of the drop policy is related to the error messages when dropping a packet. The following list the possible error messages policies that may be added to any of the above drop policies. If no error message policy is added, then the default error message behavior from the respective stacks (IP or BP) are used.</t>
     <ul>
         <li>do not send error message: If packets are dropped, error messages are not sent to the source. </li>
         <li>send error message only if newer than x min/hour/day: If packets are dropped, error messages are sent to the source only if the timestamp of the packet is newer than the specified period from now.</li>
         </ul>
   </section>
   <section>
     <name>Forwarding Preference Policy</name>
     <t>When a destination becomes reachable by a new route in the forwarding table, the forwarding node may need to prefer starting sending some packets instead of others, for various reasons. For example, in a "short" time window of reachability, some packets or destinations may be preferred over others. In bandwidth limited links, control plane packets may be preferred to be sent first over data or telemetry or large media. The forwarding preference policy may be one of the following.</t>
     <ul>
        <li>Forward first from these sources: Start forwarding packets of this list of sources before forwarding others. Sources are specified as a list of prefixes. Order in the list is relevant: first one in the list is the first one to forward.</li>
        <li>Forward first for these destinations: Start forwarding packets of this list of destinations before forwarding others. Destinations are specified as a list of prefixes. Order in the list is relevant: first one in the list is the first one to forward.</li>
        <li>Forward first if a field is set to a value: Start forwarding packets with the specified field having the specified value.</li>
     </ul>
   </section>
   </section>
   <section>
       <name>TODO and Comments</name>
       <ul>
           <li>Information model in Yang to describe policies?</li>
           <li>Default route "policy": avoid sending packets back to Earth?</li>
           <li>weighted multiple concurrent policies?</li>
       </ul>
    </section>
    
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>This memo includes no request to IANA.</t>
    </section>
    
    <section anchor="Security">
      <name>Security Considerations</name>
      <t>TBD</t>
    </section>
    
    <!-- NOTE: The Acknowledgements and Contributors sections are at the end of this template -->
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9171.xml"/>
      </references>
    </references>
    <section anchor="Acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>The following people have provided comments to improve this document: </t>
    </section>
 </back>
</rfc>
