RFC 7758

Time Capability in NETCONF

๐Ÿ“… published February 2016, from ietf

Time Capability in NETCONF ๐Ÿ’–

Internet Engineering Task Force (IETF) ยท Request for Comments: 7758 ยท February 2016 ยท Category: Experimental ยท ISSN: 2070-1721

okay so bestie, this RFC is by T. Mizrahi and Y. Moses from the Technion ๐ŸŽ€ It's an Experimental doc (not a Standards Track thing!), published in February 2016 ๐ŸŒธ It doesn't obsolete or update any other RFCs, so it's its own little world โœจ and it's all about adding a time capability to NETCONF โฐ

Abstract

okay so the vibe here is: this doc adds a capability-based extension to the Network Configuration Protocol (NETCONF) ๐Ÿฆ‹ It lets clients schedule configuration updates for specific times, and lets servers stamp the data they send back with timestamps ๐Ÿ•ฐ๏ธ literally time-travel energy but make it networking ๐Ÿ’…

Status of This Memo

ngl this section is the "is this official??" part ๐Ÿ™ˆ It's not an Internet Standards Track spec. It's published so people can look at it, try implementing it, and evaluate it ๐Ÿงช It IS an Experimental Protocol for the Internet community, a product of the IETF, and it has consensus, public review, and IESG approval ๐Ÿ‘‘ but not every IESG-approved doc is up for any level of Internet Standard, so see Section 2 of RFC 5741 for the deets ๐ŸŒˆ

Current status, errata, and feedback info live at http://www.rfc-editor.org/info/rfc7758 ๐Ÿ’œ

Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved โœจ

This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as of the publication date. Read those carefully, because they spell out your rights and restrictions ๐Ÿ“œ Any Code Components pulled from this doc must include Simplified BSD License text (per Section 4.e of the Trust Legal Provisions) and come with no warranty, same as that license says ๐Ÿงพ

Table of Contents

1. Introduction ....................................................4
2. Conventions Used in This Document ...............................4
   2.1. Key Words ..................................................4
   2.2. Abbreviations ..............................................5
   2.3. Terminology ................................................5
3. Using Time in NETCONF ...........................................5
   3.1. The Time Capability in a Nutshell ..........................5
   3.2. Notifications and Cancellation Messages ....................7
   3.3. Synchronization Aspects ....................................9
   3.4. Scheduled Time Format .....................................10
   3.5. Scheduling Tolerance ......................................10
   3.6. Scheduling the Near vs. Far Future ........................11
   3.7. Time-Interval Format ......................................13
4. Time Capability ................................................14
   4.1. Overview ..................................................14
   4.2. Dependencies ..............................................14
   4.3. Capability Identifier .....................................14
   4.4. New Operations ............................................14
   4.5. Modifications to Existing Operations ......................15
        4.5.1. Affected Operations ................................15
        4.5.2. Processing Scheduled Operations ....................16
   4.6. Interactions with Other Capabilities ......................16
5. Examples .......................................................17
   5.1. <scheduled-time> Example ..................................17
   5.2. <get-time> Example ........................................18
   5.3. Error Example .............................................19
6. Security Considerations ........................................19
   6.1. General Security Considerations ...........................19
   6.2. YANG Module Security Considerations .......................20
7. IANA Considerations ............................................21
8. References .....................................................22
   8.1. Normative References ......................................22
   8.2. Informative References ....................................22
Appendix A. YANG Module for the Time Capability ...................24
Acknowledgments ...................................................32
Authors' Addresses ................................................32

1. Introduction ๐ŸŒธ

1.1. Hmm, just Introduction

okay so NETCONF (from [RFC6241]) is how you install, change, and delete config on network devices ๐Ÿ”ง Clients poke servers with remote procedure calls (RPCs) ๐Ÿ“ž

BUT here's the tea: NETCONF is asynchronous ๐Ÿ˜ญ When a client sends an RPC, it has zero control over when it actually runs, and the server doesn't tell it when it ran either ๐Ÿ’€

Time-based config ([OneClock] [Time4]) is lowkey a game changer ๐Ÿฆ‹ It makes a whole class of coordinated, scheduled config jobs possible โœจ A client can send RPCs to multiple servers all with the same scheduled time, so the network updates together ๐Ÿ‘ฏ Or it can send n RPCs with n different times, T1, T2, ..., Tn, to set the order they run in ๐ŸŽ€

This memo defines the :time capability for NETCONF ๐Ÿ’… Clients can figure out the scheduled execution time of the RPCs they send, and a server that gets an RPC can report its actual execution time back to the client ๐Ÿซถ

The time capability is meant for scheduling stuff in the near future, so you can coordinate simultaneous changes or set an order for updates ๐Ÿš€ Time-of-day policies and far-future scheduling (like [Cond]) are NOT in scope here ๐Ÿ™…โ€โ™€๏ธ

This memo is experimental ๐Ÿงช The point is to let the community try out the NETCONF time capability, and then the NETCONF working group will look at what they learned and decide whether to adopt it ๐ŸŒˆ

2. Conventions Used in This Document ๐Ÿ’œ

2.1. Key Words ๐Ÿ”‘

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] ๐Ÿ“–

2.2. Abbreviations ๐Ÿ”ค

NETCONF  Network Configuration Protocol

RPC      Remote Procedure Call

2.3. Terminology ๐Ÿ“š

  • Capability [RFC6241]: a functionality that supplements the base NETCONF spec โœจ
  • Client [RFC6241]: invokes protocol operations on a server, and can also subscribe to get notifications from a server ๐Ÿ””
  • Execution time: the time at which a server finishes executing an RPC, before it sends the <rpc-reply> message ๐Ÿ
  • Scheduled RPC: an RPC scheduled to run at a predetermined time, which is included in the <rpc> message ๐Ÿ“…
  • Scheduled time: the time the RPC should start, as decided by the client. The server's job is to enforce it ๐ŸŽฏ
  • Server [RFC6241]: executes protocol operations a client invokes, and can also send notifications to a client ๐Ÿ’Œ

3. Using Time in NETCONF โฐ

3.1. The Time Capability in a Nutshell ๐Ÿฅฐ

The :time capability has two main jobs ๐Ÿ’–

  • Scheduling: when a client sends an RPC, the <rpc> message MAY include the scheduled-time element, shown as Ts in Figure 1 ๐Ÿ“… The server then runs the RPC at the scheduled time Ts, and once it's done, it can reply with an RPC reply message ๐Ÿ’ซ
  • Reporting: when a client sends an RPC, the <rpc> message MAY include a get-time element (see Figure 2) asking the server to tell it the RPC's execution time ๐Ÿ•ต๏ธโ€โ™€๏ธ After the server does the RPC, the reply includes the execution time, Te ๐Ÿฆ‹
                  RPC _________
                executed       \
                               \/
                               Ts
        server  ---------------+-------------        ----> time
                          /\      \
                      rpc /        \ rpc-reply
                     (Ts)/          \
                        /           \/
        client  -----------------------------

        Figure 1: Scheduled RPC
               RPC _________
             executed       \
                            \/
                            Te
        server  ------------+----------------        ----> time
                          /\   \
                   rpc    /     \ rpc-reply
               (get-time)/       \ (Te)
                        /        \/
        client  -----------------------------

        Figure 2: Reporting the Execution Time of an RPC

Example 1. Say a client needs to trigger a commit on n servers, and wants them all to commit as close to simultaneously as possible ๐Ÿคฉ Without the time capability, the client sends n commit messages one after another, so every server commits at a different time ๐Ÿ˜ฉ With the time capability, the client sends commit messages scheduled for one chosen time Ts (like 5 seconds from now), and the servers commit as close to Ts as they can ๐ŸŽ‰

Example 2. Monitoring events or collecting stats usually needs a common time reference ๐Ÿ“Š A client can send a set of get-config messages scheduled to run at multiple servers at the same time, which gives a simultaneous, system-wide snapshot of the servers' state ๐Ÿ“ธ Plus, the client can use the get-time element in its get-config messages, so the sampled data has a time reference attached ๐Ÿท๏ธ

Figures 1 and 2 imply a third scenario (Figure 3), where the client sends an RPC with BOTH a scheduled time, Ts, AND the get-time element ๐Ÿ™Œ That way the client gets feedback on the actual execution time, Te ๐Ÿ” Ideally Ts=Te ๐Ÿ’ฏ But the server might run the RPC a bit off from Ts, for example if it's busy with other tasks right at Ts ๐Ÿ˜…

                  RPC _________
                executed       \
                               \/
                            Ts Te
        server  -------------+-+-------------        ----> time
                        /\        \
               rpc      /          \ rpc-reply
        (Ts + get-time)/            \ (Te)
                      /             \/
        client  -----------------------------

        Figure 3: Scheduling and Reporting

(Part 1 of 5. More to come, bestie! ๐Ÿซถ)

3.2. Notifications and Cancellation Messages โœจ

Notifications ๐Ÿ””

Okay so, as Figure 1 shows, once a scheduled RPC gets executed, the server sends back an <rpc-reply> ๐Ÿ“ฌ. Here's the catch: that <rpc-reply> can show up a long time after the client sent the RPC ๐Ÿ˜ญ. So the client is just sitting there with no clue whether the RPC was even received ๐Ÿซ .

This document defines a new notification, the netconf-scheduled-message notification ๐ŸŽ€. It gives the client an immediate acknowledgement of the scheduled RPC, so no more guessing โœจ.

The <netconf-scheduled-message> notification is sent to the client if it's subscribed to the NETCONF notifications [RFC6470] ๐Ÿ’Œ. As Figure 4 shows, when the server receives a scheduled RPC, it sends a notification to the client ๐Ÿฆ‹.

The <netconf-scheduled-message> notification includes a <schedule-id> element ๐Ÿชช. The <schedule-id> is a unique identifier that the server assigns to every scheduled RPC it receives ๐Ÿ’œ. This is what makes tracking easy, bestie: a client can keep track of all its pending scheduled RPCs ๐Ÿ“‹. A client can uniquely identify a scheduled RPC by the tuple {server, schedule-id} ๐Ÿ”‘.

                RPC ____________
              executed          \
                                \/
                                Ts
      server  -------------------+---------        ----> time
                  /\  \            \
              rpc /    \notifi-     \ rpc-reply
             (Ts)/      \cation      \
                /       \/           \/
      client  -----------------------------

      Figure 4: Scheduled RPC with Notification

Cancellation Messages ๐Ÿ™…โ€โ™€๏ธ

A client can cancel a scheduled RPC by sending a <cancel-schedule> RPC ๐Ÿ›‘. The <cancel-schedule> RPC includes the <schedule-id> of the scheduled RPC that needs to be cancelled ๐Ÿช„.

The <cancel-schedule> RPC, defined in this document, can be used to perform a coordinated all-or-none procedure ๐Ÿค. Either all the servers perform the operation on schedule, or the operation is aborted. No in-between chaos, periodt ๐Ÿ’….

Example 3. A client sends scheduled <rpc> messages to server 1 and server 2, both scheduled to be performed at time Ts ๐Ÿ“จ. Server 1 sends a notification indicating that it has successfully scheduled the RPC ๐ŸŽ‰. Server 2 replies with an unknown-element error [RFC6241] that indicates that it does not support the time capability ๐Ÿ’€. The client sends a <cancel-schedule> RPC to server 1 and receives an <rpc-reply> ๐Ÿซถ. The message exchange between the client and server 1 in this example is illustrated in Figure 5 ๐ŸŽ€.

                          RPC not __________
                          executed          \
                                            \/
                                             Ts
      server  --------------------------------+---      ----> time
                  /\ \            /\        \
              rpc /   \notifi-    /cancel-   \ rpc-reply
             (Ts)/     \cation   /schedule    \
                /      \/       /             \/
      client  ------------------------------------

            Figure 5: Cancellation Message

A <cancel-schedule> RPC MUST NOT include the scheduled-time parameter. ๐ŸŒˆ A server that receives a <cancel-schedule> RPC should try to cancel the schedule as soon as possible โฑ๏ธ. If the server is unable to cancel the scheduled RPC, for example, because it has already been executed, it should respond with an <rpc-error> [RFC6241] ๐Ÿ™ˆ. In that error, the error-type is 'protocol' and the error-tag is 'operation-failed' ๐Ÿงพ.


3.3. Synchronization Aspects โฐ

The time capability defined in this document requires clients and servers to maintain clocks ๐Ÿ•ฐ๏ธ. It's assumed that clocks are synchronized by a method that's outside the scope of this document, e.g., [RFC5905] or [IEEE1588] ๐Ÿงš.

This document does not define any requirements pertaining to the degree of accuracy of performing scheduled RPCs ๐Ÿคทโ€โ™€๏ธ. Two factors affect how accurately the server can perform a scheduled RPC ๐ŸŽฏ. The first factor is the accuracy of the clock synchronization method used to synchronize the clients and servers. The second is the server's ability to execute real-time configuration changes, which really depends on how it's implemented ๐Ÿ› ๏ธ.

Typical networking devices are a combination of hardware and software ๐Ÿ–ฅ๏ธ. The execution time of a hardware module can typically be predicted with a high level of accuracy ๐ŸŽฏ. The execution time of a software module, though? It may be variable and hard to predict ๐Ÿ˜ตโ€๐Ÿ’ซ. A configuration update would typically require the server's software to be involved, so that affects how accurately the RPC can be scheduled ๐Ÿซ .

Another important aspect of synchronization is monitoring ๐Ÿ‘€. A client should be able to check whether a server is synchronized to a reference time source โœ…. Typical synchronization protocols, such as the Network Time Protocol [RFC5905], provide the means ([RFC5907], [RFC7317]) to verify that a clock is synchronized to a time reference by querying its Management Information Base (MIB) ๐Ÿ“Š. The get-time feature defined in this document (see Figure 2) allows a client to obtain a rough estimate of the time offset between the client's clock and the server's clock ๐Ÿ”.

Since servers don't perform configuration changes instantaneously, the processing time of an RPC should not be overlooked ๐Ÿ™…โ€โ™€๏ธ. The scheduled time always refers to the start time of the RPC, and the execution time always refers to its completion time โณ.


3.4. Scheduled Time Format ๐Ÿ“…

The scheduled time and execution time fields in <rpc> messages use a common time format field ๐Ÿ’–.

The time format used in this document is the date-and-time format, defined in Section 5.6 of [RFC3339] and Section 3 of [RFC6991] ๐ŸŽ€.

    leaf scheduled-time {
      type yang:date-and-time;
      description
      "The time at which the RPC is scheduled to be performed.";
    }

    leaf execution-time {
      type yang:date-and-time;
      description
      "The time at which the RPC was executed.";
    }

3.5. Scheduling Tolerance ๐ŸŽš๏ธ

When a client sends an RPC that's scheduled to Ts, the server MUST verify that the value Ts is not too far in the past or in the future. ๐Ÿšฆ As Figure 6 illustrates, the server verifies that Ts is within the scheduling-tolerance range ๐Ÿ”Ž.

              RPC _________
            received       \
                           \/
                                 Ts
        -----+--------------+-----+------------+-------> time

              <------------> <---------------->
              sched-max-past  sched-max-future

              <------------------------------->
                   scheduling tolerance

           Figure 6: Scheduling Tolerance

The scheduling tolerance is determined by two parameters: sched-max-future and sched-max-past ๐Ÿงฎ. These two parameters use the time-interval format (Section 3.7.), and their default value is 15 seconds โฒ๏ธ.

If the scheduled time, Ts, is within the scheduling-tolerance range, the scheduled RPC is performed ๐Ÿฅณ. If Ts occurs in the past and within the scheduling tolerance, the server performs the RPC as soon as possible ๐Ÿƒโ€โ™€๏ธ. If Ts is a future time, the server performs the RPC at Ts ๐ŸŒŸ.

If Ts is not within the scheduling-tolerance range, the scheduled RPC is discarded ๐Ÿ—‘๏ธ. The server responds with an error message [RFC6241] that includes a bad-element error-tag ๐Ÿ˜ฌ. An example is provided in Section 5.3 ๐Ÿ“–.


3.6. Scheduling the Near vs. Far Future ๐Ÿ”ฎ

The scheduling bound defined by sched-max-future guarantees that every scheduled RPC is restricted to a scheduling time in the near future ๐Ÿ›ก๏ธ.

The scheduling mechanism defined in this document is intended for near-future scheduling, on the order of seconds โšก. Far-future scheduling is outside the scope of this document ๐Ÿšซ.

Example 1 is a typical example of using near-future scheduling ๐ŸŽฏ. The goal in the example is to perform the RPC at multiple servers at the same time, so it's best to schedule the RPC to be performed a few seconds in the future ๐Ÿซถ.

The Challenges of Far-Future Scheduling ๐Ÿ˜ฐ

When an RPC is scheduled to be performed at a far-future time, a lot can happen in the long gap between when the RPC is sent and when it's scheduled to run ๐Ÿ•ธ๏ธ. The following erroneous events may occur:

  • The server may restart. ๐Ÿ”„
  • The client's authorization level may be changed. ๐Ÿ”
  • The client may restart and send a conflicting RPC. ๐Ÿ’ฅ
  • A different client may send a conflicting RPC. ๐Ÿ‘ฏ

In these cases, if the server performs the scheduled operation, it may perform an action that is inconsistent with the current network policy or inconsistent with the currently active clients ๐Ÿ™ƒ.

Near-future scheduling guarantees that external events, such as the examples above, have a low probability of occurring during the sched-max-future period ๐Ÿ€. Even when they do, the period of inconsistency is limited to sched-max-future, which is a short period of time โณ.

The Trade-off in Setting the sched-max-future Value โš–๏ธ

The sched-max-future parameter should be configured to a value that is high enough to allow the client to:

  1. Send the scheduled RPC, potentially to multiple servers. ๐Ÿ“ค
  2. Receive notifications or <rpc-error> messages from the server(s), or wait for a timeout and decide that if no response has arrived then something is wrong. ๐Ÿ“ฌ
  3. If necessary, send a cancellation message, potentially to multiple servers. ๐Ÿ›‘

On the other hand, sched-max-future should be configured to a value that is low enough to allow a low probability of the erroneous events above, typically on the order of a few seconds ๐ŸงŠ. Even if sched-max-future is configured to a low value, it's still possible (with a low probability) that an erroneous event will occur ๐ŸŽฒ. However, this short, potentially hazardous period is not significantly worse than in conventional (unscheduled) RPCs ๐Ÿ˜Œ. Even a conventional RPC may in some cases be executed a few seconds after it was sent by the client ๐Ÿ’….

The Default Value of sched-max-future ๐ŸŽ€

The default value of sched-max-future is defined to be 15 seconds ๐Ÿ’œ. This duration is long enough to allow the scheduled RPC to be sent by the client, potentially to multiple servers, and in some cases to send a cancellation message, as described in Section 3.2 ๐ŸŒธ. On the other hand, the 15-second duration yields a very low probability of a reboot or a permission change ๐ŸŒ™.

3.7. Time-Interval Format โณ

okay so the time-interval format is all about how long something lasts ๐Ÿ•ฐ๏ธ It's built on the date-and-time format ๐Ÿ’… and it's what we use for the scheduling tolerance parameters from the last bit.

while the date-and-time type pins down one exact moment โฐ, the time-interval type just tells you the length of a stretch of time without attaching any specific date. ๐Ÿฆ‹

here's how the time-interval type is defined:

typedef time-interval {
  type string {
    pattern '\d{2}:\d{2}:\d{2}(\.\d+)?';
  }
  description
    "Defines a time interval, up to 24 hours.
     The format is specified as HH:mm:ss.f,
     consisting of two digits for hours,
     two digits for minutes, two digits
     for seconds, and zero or more digits
     representing second fractions.";
}

Example ๐ŸŒธ

the sched-max-future parameter is defined (Appendix A) as a time-interval, like so:

leaf sched-max-future {
  type time-interval;
  default 00:00:15.0;
}

the default value for sched-max-future is 0 hours, 0 minutes, and 15 seconds. โœจ

4. Time Capability โœจ

the structure of this section follows Appendix D of [RFC6241] ๐Ÿงš

4.1. Overview ๐ŸŒˆ

a server that supports the time capability can perform time-triggered operations as defined in this document. ๐Ÿ’œ

a server implementing the :time capability:

  • MUST support the ability to receive <rpc> messages that include a time element and perform a time-triggered operation accordingly.
  • MUST support the ability to include a time element in the <rpc-reply> messages that it transmits.

4.2. Dependencies ๐Ÿซถ

With-defaults Capability

the time-capability YANG module (Appendix A) uses default values, so it's assumed that the with-defaults capability [RFC6243] is supported. ๐ŸŽ€

4.3. Capability Identifier ๐Ÿฆ‹

the :time capability is identified by the following capability string:

urn:ietf:params:netconf:capability:time:1.0

4.4. New Operations ๐Ÿ“

<cancel-schedule> ๐Ÿšซ

the <cancel-schedule> RPC is used for cancelling an RPC that was previously scheduled. ๐Ÿ’…

a <cancel-schedule> RPC MUST include the <cancelled-message-id> element, which specifies the message ID of the scheduled RPC that needs to be cancelled. ๐Ÿ˜ญ

a <cancel-schedule> RPC MAY include the <get-time> element. in this case, the <rpc-reply> includes the <execution-time> element, specifying the time at which the scheduled RPC was cancelled. โฑ๏ธ

4.5. Modifications to Existing Operations ๐Ÿ› ๏ธ

4.5.1. Affected Operations ๐Ÿ‘‘

the :time capability defined in this memo can be applied to any of the following operations:

  • get-config
  • get
  • copy-config
  • edit-config
  • delete-config
  • lock
  • unlock
  • commit

three new elements get added to each of these operations: ๐ŸŽ‰

  • <scheduled-time> This element is added to the input of each operation, indicating the time at which the server is scheduled to invoke the operation. Every <rpc> message MAY include the <scheduled-time> element. A server that supports the :time capability and receives an <rpc> message with a <scheduled-time> element MUST perform the operation as close as possible to the scheduled time.

The <scheduled-time> element uses the date-and-time format (Section 3.4.).

  • <get-time> This element is added to the input of each operation. An <rpc> message MAY include a <get-time> element, indicating that the server MUST include an <execution-time> element in its corresponding <rpc-reply>.
  • <execution-time> This element is added to the output of each operation, indicating the time at which the server completed the operation. An <rpc-reply> MAY include the <execution-time> element. A server that supports the :time capability and receives an operation with the <get-time> element MUST include the execution time in its response.

The <execution-time> element uses the date-and-time format (Section 3.4.).

4.5.2. Processing Scheduled Operations โฐ

a server that receives a scheduled RPC MUST start executing the RPC as close as possible to its scheduled execution time. ๐Ÿƒโ€โ™€๏ธ

if a session between a client and a server gets terminated, the server MUST cancel all pending scheduled RPCs that were received in this session. ๐Ÿ™ˆ

scheduled RPCs are processed serially, in an order defined by their scheduled times. so the server sends <rpc-reply> messages to scheduled RPCs according to the order of their corresponding schedules. note that this is a modification to the behavior defined in [RFC6241], which states that replies are sent in the order the requests were received. interoperability with [RFC6241] is guaranteed by the NETCONF capability exchange; a server that does not support the :time capability responds to RPCs in the order the requests were received. a server that supports the :time capability replies to conventional (non-scheduled) RPCs in the order they were received, and replies to scheduled RPCs in the order of their scheduled times. ๐Ÿง 

if a server receives two or more RPCs that are scheduled to be performed at the same time, the server executes the RPCs serially in an arbitrary order. ๐ŸŒ€

4.6. Interactions with Other Capabilities ๐Ÿค

Confirmed Commit Capability

the confirmed commit capability is defined in Section 8.4 of [RFC6241]. according to that document, a confirmed <commit> operation MUST be reverted if a confirming commit is not issued within the timeout period (which is 600 seconds by default). ๐Ÿ”™

when the time capability is supported, and a confirmed <commit> operation is used with the <scheduled-time> element, the confirmation timeout MUST be counted from the scheduled time, i.e., the client begins the timeout measurement starting at the scheduled time. โณโœจ

5. Examples ๐Ÿ“š

5.1. <scheduled-time> Example ๐Ÿ’–

this example extends the one in Section 7.2 of [RFC6241] by adding the time capability. here, the <scheduled-time> element is used to specify the scheduled execution time of the configuration update (as shown in Figure 1). ๐ŸŽ€

<rpc message-id="101"
    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <scheduled-time
       xmlns="urn:ietf:params:yang:ietf-netconf-time">
        2015-10-21T04:29:00.235Z
    </scheduled-time>
    <config>
      <top xmlns="http://example.com/schema/1.2/config">
        <interface>
          <name>Ethernet0/0</name>
          <mtu>1500</mtu>
        </interface>
      </top>
    </config>
  </edit-config>
</rpc>

<rpc-reply message-id="101"
     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <ok/>
</rpc-reply>

5.2. <get-time> Example ๐Ÿงš

this one's basically the same as the example in Section 5.1, except this time the client includes a <get-time> element in its RPC, so the server responds with an <execution-time> element (as shown in Figure 2). ๐Ÿฆ‹

<rpc message-id="101"
    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <get-time
     xmlns="urn:ietf:params:yang:ietf-netconf-time">
    </get-time>
    <config>
      <top xmlns="http://example.com/schema/1.2/config">
        <interface>
          <name>Ethernet0/0</name>
          <mtu>1500</mtu>
        </interface>
      </top>
    </config>
  </edit-config>
</rpc>

<rpc-reply message-id="101"
     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <ok/>
  <execution-time>
      2015-10-21T04:29:00.235Z
  </execution-time>
</rpc-reply>

5.3. Error Example ๐Ÿ’€

this example shows a scenario where the scheduled-time is not within the scheduling tolerance, i.e., it's too far in the past, so an <rpc-error> gets returned. ๐Ÿ™…โ€โ™€๏ธ

<rpc message-id="101"
    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <scheduled-time
       xmlns="urn:ietf:params:yang:ietf-netconf-time">
        2010-10-21T04:29:00.235Z
    </scheduled-time>
    <config>
      <top xmlns="http://example.com/schema/1.2/config">
        <interface>
          <name>Ethernet0/0</name>
          <mtu>1500</mtu>
        </interface>
      </top>
    </config>
  </edit-config>
</rpc>

<rpc-reply message-id="101"
     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>bad-element</error-tag>
    <error-severity>error</error-severity>
    <error-info>
      <bad-element>scheduled-time</bad-element>
    </error-info>
  </rpc-error>
</rpc-reply>

6. Security Considerations ๐Ÿ”

6.1. General Security Considerations ๐Ÿšจ

the security considerations of the NETCONF protocol in general are discussed in [RFC6241]. ๐Ÿ“–

using the time capability defined in this document can help an attacker gather information about the system, like the exact time of future configuration changes. ๐Ÿ‘€ the time elements can also potentially let an attacker learn information about the system's performance. and here's the spicy part: an attacker who sends malicious <rpc> messages can use the time capability to amplify her attack, for example by sending multiple <rpc> messages with the same scheduled time. ๐Ÿ˜ฑ it's important to note that the security measures described in [RFC6241] can prevent these vulnerabilities. ๐Ÿ›ก๏ธ

the time capability relies on an underlying time synchronization protocol. so if an attacker goes after the time protocol, they can potentially compromise NETCONF when it's using the time capability. ๐Ÿ•ต๏ธโ€โ™€๏ธ a detailed discussion of the threats against time protocols, and how to mitigate them, is presented in [RFC7384]. ๐Ÿ“š

the time capability can allow an attacker to attack a NETCONF server by sending malicious RPCs that are scheduled to take place in the future. for example, an attacker can send multiple scheduled RPCs that are scheduled to be performed at the same time. another possible attack is sending a large number of scheduled RPCs to a NETCONF server, potentially causing the server's buffers to overflow. ๐Ÿ’ฅ these attacks can be mitigated by a carefully designed NETCONF server: when a server receives a scheduled RPC that exceeds its currently available resources, it should reply with an <rpc-error> and discard the scheduled RPC. ๐Ÿงฑ

note that if an attacker has been detected and revoked, its future scheduled RPCs are not executed. as defined in Section 4.5.2, once the session with the attacker has been terminated, the corresponding scheduled RPCs are discarded. ๐Ÿซกโœจ

6.2. YANG Module Security Considerations ๐Ÿ”

okay so this memo defines a brand new YANG module, and Appendix A is where you'll find the full spec for it ๐ŸŽ€

the YANG module is built to be accessed through NETCONF [RFC6241]. the lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure SHell (SSH) [RFC6242]. the NETCONF access control model [RFC6536] is what lets you restrict particular NETCONF users to a preconfigured subset of all the available NETCONF protocol operations and content ๐Ÿ”’

now for the spicy part ๐ŸŒถ๏ธ this YANG module defines <sched-max-future> and <sched-max-past>, which are writable, creatable, and deletable. these data nodes may be considered sensitive or vulnerable in some network environments ๐Ÿ˜ฌ an attacker might try to maliciously configure these parameters to a super low value, which would make all the scheduled RPCs get discarded. for example, say a client expects <sched-max-future> to be 15 seconds, but in practice it's been maliciously set to 1 second. then a totally legit scheduled RPC that's supposed to run 5 seconds from now will get discarded by the server ๐Ÿ’€

that's why these knobs need real protection. a wrong value doesn't just look weird, it quietly kills work that was meant to happen.

this YANG module also defines the <cancel-schedule> RPC ๐Ÿงน this RPC may be considered sensitive or vulnerable in some network environments too. the value of the <schedule-id> is known to all the clients that are subscribed to notifications from the server, so the <cancel-schedule> RPC could be used maliciously to attack servers by cancelling their pending RPCs ๐Ÿ™ˆ this attack is handled in two layers:

  • (i) security at the transport layer, which limits the attack only to clients that have successfully initiated a secure session with the server ๐Ÿ”
  • (ii) the authorization level required to cancel an RPC should be the same as the level required to schedule it. this limits the attack only to attackers with an authorization level that is equal to or higher than that of the client that initiated the scheduled RPC ๐Ÿ‘‘

7. IANA Considerations โœจ

okay, IANA stuff time ๐Ÿ—‚๏ธ the following capability identifier URN has been registered in the "Network Configuration Protocol (NETCONF) Capability URNs" registry:

urn:ietf:params:netconf:capability:time:1.0

the following XML namespace URN has been registered in the "IETF XML Registry", following the format defined in [RFC3688] ๐Ÿ’–

URI: urn:ietf:params:xml:ns:yang:ietf-netconf-time

Registrant Contact: The IESG.

XML: N/A, the requested URI is an XML namespace.

and the following module name has been registered in the "YANG Module Names" registry, defined in [RFC6020] ๐ŸŽ€

name: ietf-netconf-time

prefix: nct

namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-time

RFC: 7758

8. References ๐Ÿ“š

8.1. Normative References

8.2. Informative References


Appendix A. YANG Module for the Time Capability ๐Ÿงš

okay the big finale of the spec ๐ŸŽ‰ this section is normative.

<CODE BEGINS> file "ietf-netconf-time@2016-01-26.yang"
module ietf-netconf-time {

   namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-time";

   prefix nct;
   import ietf-netconf { prefix nc; }

   import ietf-yang-types { prefix yang; }

   import ietf-netconf-monitoring { prefix ncm; }

   organization
     "IETF";

   contact
     "Editor: Tal Mizrahi
         <dew@tx.technion.ac.il>
      Editor: Yoram Moses
         <moses@ee.technion.ac.il>";

   description
     "This module defines a capability-based extension to the
      Network Configuration Protocol (NETCONF) that allows
      time-triggered configuration and management operations.
      This extension allows NETCONF clients to invoke configuration
      updates according to scheduled times and allows NETCONF
      servers to attach timestamps to the data they send to NETCONF
      clients.

      Copyright (c) 2016 IETF Trust and the persons identified as
      the authors of the code.  All rights reserved.

      Redistribution and use in source and binary forms, with or
      without modification, is permitted pursuant to, and subject
      to the license terms contained in, the Simplified BSD License
      set forth in Section 4.c of the IETF Trust's Legal Provisions
      Relating to IETF Documents
      (http://trustee.ietf.org/license-info).";

   revision 2016-01-26 {
     description
       "Initial version.";

     reference
       "RFC 7758:
        Time Capability in NETCONF";
   }

   typedef time-interval {
     type string {
       pattern '\d{2}:\d{2}:\d{2}(\.\d+)?';
     }
     description
       "Defines a time interval, up to 24 hours.
        The format is specified as HH:mm:ss.f,
        consisting of two digits for hours,
        two digits for minutes, two digits
        for seconds, and zero or more digits
        representing second fractions.";
   }

   grouping scheduling-tolerance-parameters {
     leaf sched-max-future {
       type time-interval;
       default 00:00:15.0;
       description
         "When the scheduled time is in the future, i.e., greater
          than the present time, this leaf defines the maximal
          difference between the scheduled time
          and the present time that the server is willing to
          accept.  If the difference exceeds this number, the
          server responds with an error.";
     }

     leaf sched-max-past {
       type time-interval;
       default 00:00:15.0;
       description
         "When the scheduled time is in the past, i.e., less
          than the present time, this leaf defines the maximal
          difference between the present time
          and the scheduled time that the server is willing to
          accept.  If the difference exceeds this number, the
          server responds with an error.";
     }

     description
       "Contains the parameters of the scheduling tolerance.";
   }
   // extending the get-config operation
   augment /nc:get-config/nc:input {

     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }

     leaf get-time {
       type empty;
       description
         "Indicates that the rpc-reply should include the
          execution-time.";
     }

     description
       "Adds the time element to <get-config>.";
   }

   augment /nc:get-config/nc:output {
     leaf execution-time {
       type yang:date-and-time;
       description
         "The time at which the RPC was executed.";
     }

     description
       "Adds the time element to <get-config>.";
   }

   augment /nc:get/nc:input {
     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }

     leaf get-time {
       type empty;
       description
         "Indicates that the rpc-reply should include the
          execution-time.";
     }

     description
       "Adds the time element to <get>.";
   }

   augment /nc:get/nc:output {
     leaf execution-time {

       type yang:date-and-time;
       description
         "The time at which the RPC was executed.";
     }

     description
       "Adds the time element to <get>.";
   }

   augment /nc:copy-config/nc:input {
     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }

     leaf get-time {
       type empty;
       description
         "Indicates that the rpc-reply should include the
          execution-time.";
     }

     description
       "Adds the time element to <copy-config>.";
   }

   augment /nc:copy-config/nc:output {
     leaf execution-time {
       type yang:date-and-time;
       description
         "The time at which the RPC was executed.";
     }

     description
       "Adds the time element to <copy-config>.";
   }

   augment /nc:edit-config/nc:input {
     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }

     leaf get-time {
       type empty;
       description

         "Indicates that the rpc-reply should include the
          execution-time.";
     }

     description
       "Adds the time element to <edit-config>.";
   }

   augment /nc:edit-config/nc:output {
     leaf execution-time {
       type yang:date-and-time;
       description
         "The time at which the RPC was executed.";
     }

     description
       "Adds the time element to <edit-config>.";
   }

   augment /nc:delete-config/nc:input {
     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }

     leaf get-time {
       type empty;
       description
         "Indicates that the rpc-reply should include the
          execution-time.";
     }

     description
      "Adds the time element to <delete-config>.";
   }

   augment /nc:delete-config/nc:output {
     leaf execution-time {
       type yang:date-and-time;
       description
         "The time at which the RPC was executed.";
     }
     description
       "Adds the time element to <delete-config>.";
   }

   augment /nc:lock/nc:input {

     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }

     leaf get-time {
       type empty;
       description
         "Indicates that the rpc-reply should include the
          execution-time.";
     }

     description
       "Adds the time element to <lock>.";
   }
   augment /nc:lock/nc:output {
     leaf execution-time {
       type yang:date-and-time;
       description
         "The time at which the RPC was executed.";
     }

     description
       "Adds the time element to <lock>.";
   }

   augment /nc:unlock/nc:input {
     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }

     leaf get-time {
       type empty;
       description
         "Indicates that the rpc-reply should include the
          execution-time.";
     }

     description
       "Adds the time element to <unlock>.";
   }

   augment /nc:unlock/nc:output {
     leaf execution-time {
       type yang:date-and-time;
       description
         "The time at which the RPC was executed.";
     }

     description
       "Adds the time element to <unlock>.";
   }
   augment /nc:commit/nc:input {
     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }

     leaf get-time {
       type empty;
       description
         "Indicates that the rpc-reply should include the
          execution-time.";
     }

     description
       "Adds the time element to <commit>.";
   }

   augment /nc:commit/nc:output {
     leaf execution-time {
       type yang:date-and-time;
       description
         "The time at which the RPC was executed.";
     }

     description
       "Adds the time element to <commit>.";
   }

   augment /ncm:netconf-state {
     container scheduling-tolerance {
       uses scheduling-tolerance-parameters;
       description
         "The scheduling tolerance when the time capability
          is enabled.";
     }
     description
       "The scheduling tolerance of the server.";
   }

   rpc cancel-schedule {

     description
       "Cancels a scheduled message.";
     reference
       "RFC 7758:
        Time Capability in NETCONF";

     input {
       leaf cancelled-message-id {
         type string;
         description
           "The ID of the message to be cancelled.";
       }
       leaf get-time {
         type empty;
         description
           "Indicates that the rpc-reply should include
            the execution-time.";
       }
     }
     output {
       leaf execution-time {
         type yang:date-and-time;
         description
           "The time at which the RPC was executed.";
       }
     }
   }

   notification netconf-scheduled-message {
     leaf schedule-id {
       type string;
       description
         "The ID of the scheduled message.";
     }

     leaf scheduled-time {
       type yang:date-and-time;
       description
         "The time at which the RPC is scheduled to be performed.";
     }
     description
       "Indicates that a scheduled message was received.";
     reference
       "RFC 7758:
        Time Capability in NETCONF";
   }

}
<CODE ENDS>

Acknowledgments ๐Ÿ™โœจ

okay bestie, the authors want to give a huge shoutout to Joe Marcus Clarke, Andy Bierman, Balazs Lengyel, Jonathan Hansford, John Heasley, Robert Sparks, Al Morton, Olafur Gudmundsson, Juergen Schoenwaelder, Joel Jaeggli, Alon Schneider, and Eylon Egozi for their insightful comments ๐Ÿ’– they literally made this so much better ๐Ÿซถ

this work was also supported in part by Israel Science Foundation grant ISF 1520/11 ๐Ÿ‡ฎ๐Ÿ‡ฑ๐ŸŽ€


Authors' Addresses ๐Ÿฆ‹

Tal Mizrahi Department of Electrical Engineering Technion - Israel Institute of Technology Technion City, Haifa, 32000 Israel

Email: dew@tx.technion.ac.il

Yoram Moses Department of Electrical Engineering Technion - Israel Institute of Technology Technion City, Haifa, 32000 Israel

Email: moses@ee.technion.ac.il

๐Ÿ“ฆ where this page comes from