GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing datatracker.ietf.org — RFC 5717: Partial Lock Remote Procedure Call (RPC) for NETCONF Network Working Group B. Lengyel
Request for Comments: 5717 Ericsson
Category: Standards Track M. Bjorklund
Tail-f Systems
December 2009
RFC 5717 Partial Lock RPC for NETCONF December 2009 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. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Definition of Terms . . . . . . . . . . . . . . . . . . . 3 2. Partial Locking Capability . . . . . . . . . . . . . . . . . . 3 2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1.1. Usage Scenarios . . . . . . . . . . . . . . . . . . . 4 2.2. Dependencies . . . . . . . . . . . . . . . . . . . . . . . 5 2.3. Capability Identifier . . . . . . . . . . . . . . . . . . 5 2.4. New Operations . . . . . . . . . . . . . . . . . . . . . . 5 2.4.1. <partial-lock> . . . . . . . . . . . . . . . . . . . . 5 2.4.2. <partial-unlock> . . . . . . . . . . . . . . . . . . . 10 2.5. Modifications to Existing Operations . . . . . . . . . . . 10 2.6. Interactions with Other Capabilities . . . . . . . . . . . 11 2.6.1. Candidate Configuration Capability . . . . . . . . . . 11 2.6.2. Confirmed Commit Capability . . . . . . . . . . . . . 11 2.6.3. Distinct Startup Capability . . . . . . . . . . . . . 11 3. Security Considerations . . . . . . . . . . . . . . . . . . . 12 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 13 6. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.1. Normative References . . . . . . . . . . . . . . . . . . . 13 6.2. Informative References . . . . . . . . . . . . . . . . . . 13 Appendix A. XML Schema for Partial Locking (Normative) . . . . . 14 Appendix B. YANG Module for Partial Locking (Non-Normative) . . . 17 Appendix C. Usage Example - Reserving Nodes for Future Editing (Non-Normative) . . . . . . . . . . . . . . . 19 Lengyel & Bjorklund Standards Track [Page 2] RFC 5717 Partial Lock RPC for NETCONF December 2009 RFC 5717 Partial Lock RPC for NETCONF December 2009 The system MUST ensure that configuration resources covered by the lock are not modified by other NETCONF or non-NETCONF management operations such as Simple Network Management Protocol (SNMP) and the Command Line Interface (CLI). The duration of the partial lock begins when the partial lock is granted and lasts until (1) either the corresponding <partial-unlock> operation succeeds or (2) the NETCONF session terminates. A NETCONF session MAY have multiple parts of the running datastore locked using partial lock operations. The <partial-lock> operation returns a lock-id to identify each successfully acquired lock. The lock-id is unique at any given time for a NETCONF server for all partial-locks granted to any NETCONF or non-NETCONF sessions. RFC 5717 Partial Lock RPC for NETCONF December 2009 RFC 5717 Partial Lock RPC for NETCONF December 2009 Locking a node protects the node itself and the complete subtree under the node from modification by others. The set of locked nodes is called the scope of the lock, while all the locked nodes and the nodes in the subtrees under them make up the protected area. The XPath expressions are evaluated only once: at lock time. Thereafter, the scope of the lock is maintained as a set of nodes, i.e., the returned nodeset, and not by the XPath expression. If the configuration data is later altered in a way that would make the original XPath expressions evaluate to a different set of nodes, this does not affect the scope of the partial lock. Let's say the agent's data model includes a list of interface nodes. If the XPath expression in the partial-lock operation covers all interface nodes at locking, the scope of the lock will be maintained as the list of interface nodes at the time when the lock was granted. If someone later creates a new interface, this new interface will not be included in the locked-nodes list created previously so the new interface will not be locked. A <partial-lock> operation MUST be handled atomically by the NETCONF server. The server either locks all requested parts of the datastore or none. If during the <partial-lock> operation one of the requested parts cannot be locked, the server MUST unlock all parts that have already been locked during that operation. If a node in the scope of the lock is deleted by the session owning the lock, it is removed from the scope of the lock, so any other session or non-NETCONF mechanism can recreate it. If all nodes in the scope of the lock are deleted, the lock will still be present. However, its scope will become empty (since the lock will not cover any nodes). A NETCONF server that supports partial locking MUST be able to grant multiple simultaneous partial locks to a single NETCONF session. If the protected area of the individual locks overlap, nodes in the common area MUST be protected until all of the overlapping locks are released. A <partial-lock> operation MUST fail if: o Any NETCONF session (including the current session) owns the global lock on the running datastore. o Any part of the area to be protected is already locked (or protected by partial locking) by another management session, including other NETCONF sessions using <partial-lock> or any other non-NETCONF management method. Lengyel & Bjorklund Standards Track [Page 6] RFC 5717 Partial Lock RPC for NETCONF December 2009 o The requesting user is not successfully authenticated. o The NETCONF server implements access control and the locking user does not have sufficient access rights. The exact handling of access rights is outside the scope of this document, but it is assumed that there is an access control system that MAY deny or allow the <partial-lock> operation. The <partial-lock> operation is designed for simplicity, so when a partial lock is executed, you get what you asked for: a set of nodes that are locked for writing. As a consequence, users must observe the following: o Locking does not affect read operations. o If part of the running datastore is locked, this has no effect on any unlocked parts of the datastore. If this is a problem (e.g., changes depend on data values or nodes outside the protected part of the datastore), these nodes SHOULD be included in the protected area of the lock. o Configuration data can be edited both inside and outside the protected area of a lock. It is the responsibility of the NETCONF client application to lock all relevant parts of the datastore that are crucial for a specific management action. Note: The <partial-lock> operation does not modify the global <lock> operation defined in the base NETCONF protocol [NETCONF]. If part of the running datastore is already locked by <partial-lock>, then a global lock for the running datastore MUST fail even if the global lock is requested by the NETCONF session that owns the partial lock. RFC 5717 Partial Lock RPC for NETCONF December 2009 If the device supports the :xpath capability, any valid XPath 1.0 expression can be used. If the device does not support the :xpath capability, the XPath expression MUST be limited to an Instance Identifier expression. An Instance Identifier is an absolute path expression in abbreviated syntax, where predicates are used only to specify values for nodes defined as keys to distinguish multiple instances. Example: Lock virtual router 1 and interface eth1 <nc:rpc xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="135"> <partial-lock> <select xmlns:rte="http://example.com/ns/route"> /rte:routing/rte:virtualRouter[rte:routerName='router1'] </select> <select xmlns:if="http://example.com/ns/interface"> /if:interfaces/if:interface[if:id='eth1'] </select> </partial-lock> </nc:rpc> <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" message-id="135"> <lock-id>127</lock-id> <locked-node xmlns:rte="http://example.com/ns/route"> /rte:routing/rte:virtualRouter[rte:routerName='router1'] </locked-node> <locked-node xmlns:if="http://example.com/ns/interface"> /if:interfaces/if:interface[if:id='eth1'] </locked-node> </nc:rpc-reply> Note: The XML Schema in [NETCONF] has a known bug that requires the <data> XML element in a <rpc-reply>. This means that the above examples will not validate using the XML Schema found in [NETCONF]. Positive Response: If the device was able to satisfy the request, an <rpc-reply> is sent with a <lock-id> element (lock identifier) in the <rpc-reply> element. A list of locked nodes is also returned in Instance Identifier format. Lengyel & Bjorklund Standards Track [Page 8] RFC 5717 Partial Lock RPC for NETCONF December 2009 Negative Response: If any select expression is an invalid XPath expression, the <error- tag> is 'invalid-value'. If any select expression returns something other than a node set, the <error-tag> is 'invalid-value', and the <error-app-tag> is 'not-a- node-set'. If all the select expressions return an empty node set, the <error- tag> is 'operation-failed', and the <error-app-tag> is 'no-matches'. If the :xpath capability is not supported and the XPath expression is not an Instance Identifier, the <error-tag> is 'invalid-value', the <error-app-tag> is 'invalid-lock-specification'. If access control denies the partial lock, the <error-tag> is 'access-denied'. Access control SHOULD be checked before checking for conflicting locks to avoid giving out information about other sessions to an unauthorized client. If a lock is already held by another session on any node within the subtrees to be locked, the <error-tag> element is 'lock-denied' and the <error-info> element includes the <session-id> of the lock owner. If the lock is held by a non-NETCONF session, a <session-id> of 0 (zero) SHOULD be included. The same error response is returned if the requesting session already holds the (global) lock for the running datastore. If needed, the returned session-id may be used to <kill-session> the NETCONF session holding the lock. RFC 5717 Partial Lock RPC for NETCONF December 2009 RFC 5717 Partial Lock RPC for NETCONF December 2009 running datastore are affected, including: <edit-config>, <copy- config>, <delete-config>, <commit>, and <discard-changes>. If partial lock prevents <edit-config> from modifying some data, but the operation includes the continue-on-error option, modification of other parts of the datastore, which are not protected by partial locking, might still succeed. If the datastore contains nodes locked by partial lock, this will cause the (global) <lock> operation to fail. The <error-tag> element 'lock-denied' and an <error-info> element including the <session-id> of the lock owner will be returned. If the lock is held by a non- NETCONF session, a <session-id> of 0 (zero) is returned. All of these operations are affected only if they are targeting the running datastore. RFC 5717 Partial Lock RPC for NETCONF December 2009 RFC 5717 Partial Lock RPC for NETCONF December 2009 Index Capability Identifier ------------- --------------------------------------------------- :partial-lock urn:ietf:params:netconf:capability:partial-lock:1.0 URI: urn:ietf:params:xml:ns:netconf:partial-lock:1.0 Registrant Contact: The IESG. XML: N/A, the requested URI is an XML namespace. RFC 5717 Partial Lock RPC for NETCONF December 2009 RFC 5717 Partial Lock RPC for NETCONF December 2009 <xs:complexType name="partialLockType"> <xs:annotation> <xs:documentation> A NETCONF operation that locks parts of the running datastore. </xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="nc:rpcOperationType"> <xs:sequence> <xs:element name="select" type="xs:string" maxOccurs="unbounded"> <xs:annotation> <xs:documentation> XPath expression that specifies the scope of the lock. An Instance Identifier expression must be used unless the :xpath capability is supported in which case any XPath 1.0 expression is allowed. </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="partialUnLockType"> <xs:annotation> <xs:documentation> A NETCONF operation that releases a previously acquired partial-lock. </xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="nc:rpcOperationType"> <xs:sequence> <xs:element name="lock-id" type="lock-id-type"> <xs:annotation> <xs:documentation> Identifies the lock to be released. MUST be the value received in the response to the partial-lock operation. </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:extension> Lengyel & Bjorklund Standards Track [Page 15] RFC 5717 Partial Lock RPC for NETCONF December 2009 </xs:complexContent> </xs:complexType> <!-- <partial-lock> operation --> <xs:element name="partial-lock" type="partialLockType" substitutionGroup="nc:rpcOperation"/> <!-- <partial-unlock> operation --> <xs:element name="partial-unlock" type="partialUnLockType" substitutionGroup="nc:rpcOperation"/> <!-- reply to <partial-lock> --> <xs:complexType name="contentPartInPartialLockReplyType"> <xs:annotation> <xs:documentation> The content of the reply to a successful partial-lock request MUST conform to this complex type. </xs:documentation> </xs:annotation> <xs:sequence> <xs:element name="lock-id" type="lock-id-type"> <xs:annotation> <xs:documentation> Identifies the lock to be released. Must be the value received in the response to a partial-lock operation. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="locked-node" type="xs:string" maxOccurs="unbounded"> <xs:annotation> <xs:documentation> List of locked nodes in the running datastore. </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:schema> <CODE ENDS> Lengyel & Bjorklund Standards Track [Page 16] RFC 5717 Partial Lock RPC for NETCONF December 2009 RFC 5717 Partial Lock RPC for NETCONF December 2009 "XPath expression that specifies the scope of the lock. An Instance Identifier expression MUST be used unless the :xpath capability is supported, in which case any XPath 1.0 expression is allowed."; } } output { leaf lock-id { type lock-id-type; description "Identifies the lock, if granted. The lock-id SHOULD be used in the partial-unlock rpc."; } leaf-list locked-node { type instance-identifier; min-elements 1; description "List of locked nodes in the running datastore"; } } } rpc partial-unlock { description "A NETCONF operation that releases a previously acquired partial-lock."; input { leaf lock-id { type lock-id-type; description "Identifies the lock to be released. MUST be the value received in the response to a partial-lock operation."; } } } } <CODE ENDS> Lengyel & Bjorklund Standards Track [Page 18] RFC 5717 Partial Lock RPC for NETCONF December 2009 RFC 5717 Partial Lock RPC for NETCONF December 2009 Step 2 - Receiving existing data <rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <data> <top xmlns="http://example.com/users"> <users> <user> <name>fred</name> <phone>8327</phone> </user> </users> </top> </data> </rpc-reply> We want to add the new user Joe and immediately lock him using partial locking. The way to do this, is to first lock all <user> nodes by locking the <users> node. Note that if we would lock all the <user> nodes using the select expression '/usr:top/usr:users/usr:user'; this would not lock the new user Joe, which we will create after locking. So we rather have to lock the <users> node. Step 3 - Lock users <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" message-id="102"> <partial-lock> <select xmlns:usr="http://example.com/users"> /usr:top/usr:users </select> </partial-lock> </nc:rpc> The NETCONF server grants the partial lock. The scope of the lock includes only the <users> node. The lock protects the <users> node and all <user> nodes below it from modification (by other sessions). Lengyel & Bjorklund Standards Track [Page 20] RFC 5717 Partial Lock RPC for NETCONF December 2009 Step 4 - Receive lock <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" message-id="102"> <lock-id>1</lock-id> <locked-node xmlns:usr="http://example.com/users"> /usr:top/usr:users </locked-node> </nc:rpc-reply> Next we create user Joe. Joe is protected by the lock received above, as it is under the subtree rooted at the <users> node. Step 5 - Create user Joe <rpc message-id="103" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <top xmlns:usr="http://example.com/users"> <users> <user> <name>Joe</name> </user> </users> </top> </config> </edit-config> </rpc> We receive a positive reply to the <edit-config> (not shown). Next we request a lock, that locks only <user> Joe, and release the lock on the <users> node. This will allow other managers to create additional new users. Lengyel & Bjorklund Standards Track [Page 21] RFC 5717 Partial Lock RPC for NETCONF December 2009 Step 6 - Lock user Joe <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" message-id="104"> <partial-lock> <select xmlns:usr="http://example.com/users"> /usr:top/usr:users/user[usr:name="Joe"]" </select> </partial-lock> </nc:rpc> The NETCONF server grants the partial lock. The scope of this second lock includes only the <user> node with name Joe. The lock protects all data below this particular <user> node. Step 7 - Receive lock <nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" message-id="104"> <lock-id>2</lock-id> <locked-node xmlns:usr="http://example.com/users"> /usr:top/usr:users/user[usr:name="Joe"]" </locked-node> </nc:rpc-reply> The scope of the second lock is the <user> node Joe. It protects this <user> node and any data below it (e.g., phone number). At this point of time, these nodes are protected both by the first and second lock. Next, we unlock the other <user>s and the <users> node, to allow other managers to work on them. We still keep the second lock, so the <user> node Joe and the subtree below is still protected. Step 8 - Release lock on <users> <nc:rpc xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="105"> <partial-unlock> <lock-id>1</lock-id> </partial-unlock> </nc:rpc> Lengyel & Bjorklund Standards Track [Page 22] RFC 5717 Partial Lock RPC for NETCONF December 2009 Authors' Addresses Balazs Lengyel Ericsson EMail: [email protected] Martin Bjorklund Tail-f Systems EMail: [email protected] Lengyel & Bjorklund Standards Track [Page 23]
Datatracker
RFC 5717
Show sidebar by default
Yes
No
Tab to show by default
Info
Contents
HTMLization configuration
HTMLize the plaintext
Plaintextify the HTML
Maximum font size
Page dependencies
Inline
Reference
Citation links
Go to reference section
Go to linked document
| ||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |