--- 1/draft-ietf-netconf-partial-lock-08.txt 2009-07-05 03:12:29.000000000 +0200 +++ 2/draft-ietf-netconf-partial-lock-09.txt 2009-07-05 03:12:30.000000000 +0200 @@ -1,42 +1,52 @@ NETCONF B. Lengyel Internet-Draft Ericsson Intended status: Standards Track M. Bjorklund -Expires: December 5, 2009 Tail-f Systems - June 03, 2009 +Expires: January 3, 2010 Tail-f Systems + July 02, 2009 Partial Lock RPC for NETCONF - draft-ietf-netconf-partial-lock-08 + draft-ietf-netconf-partial-lock-09 Status of this Memo This Internet-Draft is submitted to IETF in full conformance with the - provisions of BCP 78 and BCP 79. + provisions of BCP 78 and BCP 79. This document may contain material + from IETF Documents or IETF Contributions published or made publicly + available before November 10, 2008. The person(s) controlling the + copyright in some of this material may not have granted the IETF + Trust the right to allow modifications of such material outside the + IETF Standards Process. Without obtaining an adequate license from + the person(s) controlling the copyright in such materials, this + document may not be modified outside the IETF Standards Process, and + derivative works of it may not be created outside the IETF Standards + Process, except to format it for publication as an RFC or to + translate it into languages other than English. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. - This Internet-Draft will expire on December 5, 2009. + This Internet-Draft will expire on January 3, 2010. Copyright Notice Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents in effect on the date of publication of this document (http://trustee.ietf.org/license-info). Please review these documents carefully, as they describe your rights @@ -45,57 +55,58 @@ Abstract The NETCONF protocol defines the lock and unlock RPCs, used to lock entire configuration datastores. In some situations, a way to lock only parts of a configuration datastore is required. This document defines a capability-based extension to the NETCONF protocol for locking portions of a configuration datastore. 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 . . . . . . . . . . . . . . . . . . . . . . . 6 - 2.3. Capability Identifier . . . . . . . . . . . . . . . . . . 6 - 2.4. New Operations . . . . . . . . . . . . . . . . . . . . . . 6 - 2.4.1. . . . . . . . . . . . . . . . . . . . . 6 - 2.4.2. . . . . . . . . . . . . . . . . . . . 11 - 2.5. Modifications to Existing Operations . . . . . . . . . . . 11 - 2.6. Interactions with Other Capabilities . . . . . . . . . . . 12 - 2.6.1. Candidate Configuration Capability . . . . . . . . . . 12 - 2.6.2. Confirmed Commit Capability . . . . . . . . . . . . . 12 - 2.6.3. Distinct Startup Capability . . . . . . . . . . . . . 12 - 3. Security Considerations . . . . . . . . . . . . . . . . . . . 12 - 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 - 5. Appendix A - XML Schema for Partial Locking (normative) . . 15 + 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 + 1.1. Definition of Terms . . . . . . . . . . . . . . . . . . . 4 + 2. Partial Locking Capability . . . . . . . . . . . . . . . . . . 4 + 2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 4 + 2.1.1. Usage Scenarios . . . . . . . . . . . . . . . . . . . 5 + 2.2. Dependencies . . . . . . . . . . . . . . . . . . . . . . . 7 + 2.3. Capability Identifier . . . . . . . . . . . . . . . . . . 7 + 2.4. New Operations . . . . . . . . . . . . . . . . . . . . . . 7 + 2.4.1. . . . . . . . . . . . . . . . . . . . . 7 + 2.4.2. . . . . . . . . . . . . . . . . . . . 12 + 2.5. Modifications to Existing Operations . . . . . . . . . . . 13 + 2.6. Interactions with Other Capabilities . . . . . . . . . . . 14 + 2.6.1. Candidate Configuration Capability . . . . . . . . . . 14 + 2.6.2. Confirmed Commit Capability . . . . . . . . . . . . . 14 + 2.6.3. Distinct Startup Capability . . . . . . . . . . . . . 14 + 3. Security Considerations . . . . . . . . . . . . . . . . . . . 14 + 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 + 5. Appendix A - XML Schema for Partial Locking (normative) . . 16 6. Appendix B - YANG Module for Partial Locking - (non-normative) . . . . . . . . . . . . . . . . . . . . . . . 19 + (non-normative) . . . . . . . . . . . . . . . . . . . . . . . 20 7. Appendix C - Usage Example - Reserving nodes for future - editing (non-normative) . . . . . . . . . . . . . . . . . . . 22 - 8. Appendix D - Change Log . . . . . . . . . . . . . . . . . . 27 - 8.1. 07-08 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 - 8.2. 06-07 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 - 8.3. 05-06 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 - 8.4. 04-05 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 - 8.5. 03-04 . . . . . . . . . . . . . . . . . . . . . . . . . . 27 - 8.6. 02-03 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 - 8.7. 01-02 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 - 8.8. 00-01 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 - 8.9. -00 . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 - 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 29 - 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 30 - 10.1. Normative References . . . . . . . . . . . . . . . . . . . 30 - 10.2. Informative References . . . . . . . . . . . . . . . . . . 30 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 31 + editing (non-normative) . . . . . . . . . . . . . . . . . . . 23 + 8. Appendix D - Change Log . . . . . . . . . . . . . . . . . . 28 + 8.1. 08-09 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 + 8.2. 07-08 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 + 8.3. 06-07 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 + 8.4. 05-06 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 + 8.5. 04-05 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 + 8.6. 03-04 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 + 8.7. 02-03 . . . . . . . . . . . . . . . . . . . . . . . . . . 29 + 8.8. 01-02 . . . . . . . . . . . . . . . . . . . . . . . . . . 29 + 8.9. 00-01 . . . . . . . . . . . . . . . . . . . . . . . . . . 29 + 8.10. -00 . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 + 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30 + 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31 + 10.1. Normative References . . . . . . . . . . . . . . . . . . . 31 + 10.2. Informative References . . . . . . . . . . . . . . . . . . 31 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 32 1. Introduction The [NETCONF] protocol describes the lock and unlock operations that operate on entire configuration datastores. Often, multiple management sessions need to be able to modify the configuration of a managed device in parallel. In these cases, locking only parts of a configuration datastore is needed. This document defines a capability based extension to the NETCONF protocol to support partial locking of NETCONF datastores using a mechanism based on the existing @@ -114,22 +125,22 @@ node in the conceptual XML datastore. It contains an absolute path expression in abbreviated syntax, where predicates are used only to specify values for nodes defined as keys to distinguish multiple instances. o Scope of the lock: initially the set of nodes returned by the XPath expressions in a successful partial-lock operation. The set might be modified if some of the nodes are deleted. o Protected area: the set of nodes that are protected from - modification by the lock. This consist of nodes in the scope of - the lock and nodes in subtrees under them. + modification by the lock. This set consists of nodes in the scope + of the lock and nodes in subtrees under them. 2. Partial Locking Capability 2.1. Overview The :partial-lock capability indicates that the device supports the locking of its configuration with a more limited scope than a complete configuration datastore. The scope to be locked is specified by using restricted or full XPath expressions. Partial locking only affects configuration data. @@ -147,100 +158,103 @@ The operation returns a lock-id to identify each successfully acquired lock. The lock-id is unique for a NETCONF server for all partial-locks granted to any NETCONF or non-NETCONF sessions. 2.1.1. Usage Scenarios In the following we describe a few scenarios for partial locking. Partial locking is primarily useful towards the running - configuration. However it can be used to lock a candidate datastore - as well. While scenarios using the running datastore are seen as the - most important, as an example a scenario involving the candidate - datastore is also presented. Besides the three described here, there - are many other usage scenarios possible. + configuration. However it can be used to lock parts of a candidate + datastore as well. While scenarios using the running datastore are + seen as the most important, as an example a scenario involving the + candidate datastore is also presented. Besides the three described + here, there are many other usage scenarios possible. -2.1.1.1. Multiple managers handling the writable running datastore +2.1.1.1. Multiple managers handling the writable running datastore with + overlapping sections Multiple managers are handling the same NETCONF agent simultaneously. The agent is handled via the writable running datastore. Each manager has his or her own task, which might involve the modification of overlapping sections of the datastore. After collecting and analyzing input and preparing the NETCONF operations off-line, the manager locks the areas that are important for his task using one single operation. The manager executes a number of operations to modify the configuration, then releases the partial-lock. The lock should be - held for only a short time (seconds rather then minutes). The - manager should collect all human input before locking anything. As - each manager locks only a part of the data model, usually multiple - operators can execute the operations simultaneously. + held for the shortest possible time (e.g. seconds rather then + minutes). The manager should collect all human input before locking + anything. As each manager locks only a part of the data model, + usually multiple operators can execute the operations + simultaneously. 2.1.1.2. Multiple managers handling the writable running datastore, distinct management areas Multiple managers are handling the same NETCONF agent simultaneously. The agent is handled via the writable running datastore. The agent's data model contains a number of well defined separate areas that can be configured without impacting other areas. An example can be a server with multiple applications running on it, or a number of a network elements with a common NETCONF agent for management. Each manager has his or her own task, which does not involve the modification of overlapping sections of the datastore. The manager locks his area with a operation, uses a number of commands to modify it, later releases the lock. As each manager has his functional area assigned to him, and he locks only that area, multiple managers can edit the configuration - simultaneously. Locks can be held for extended periods (minutes, - hours), as this will not hinder other managers. + simultaneously. Locks can be held for extended periods (e.g. + minutes, hours), as this will not hinder other managers. This scenario assumes, that the global lock operation from [NETCONF] is not used. 2.1.1.3. Multiple managers handling the candidate datastore in a semi- coordinated work mode Multiple managers are handling the same NETCONF agent simultaneously. The agent is handled via the candidate datastore. Each manager has his or her own task which might involve the modification of overlapping sections of the datastore. After collecting and analyzing input and preparing the NETCONF operations off-line, the manager locks the areas that are important for his task using one single operation in both the candidate and the running datastore. He executes a number of operations to modify the configuration, then releases the - partial-lock. The lock should be held for only a short time (seconds - rather then minutes). + partial-lock. The lock should only be held for the shortest possible + time (e.g. seconds rather then minutes). Operators coordinate with each other. When all of them finish their tasks one of them orders commit. If any of the operators are still working, and holds a lock, the commit will fail, and will need to be repeated after all managers finish. Warning: When multiple managers use the candidate configuration in parallel, there is a risk that the interaction of access control (which is still implementation specific at the time of this writing) - and the commit operation might result in a dead-lock, as illustrated - by the following sequence. + and the commit operation might result in a manager becoming unable + both to commit or discard changes, as illustrated by the following + sequence. Manager A only has access to the interfaces branch in the model, and edits it in candidate - Manager B only has access to the routing branch in the model, and edits it in candidate Manager A terminates it's session + Now Manager B can not issue because it can not modify interfaces in the running datastore Manager B can not issue because it can not modify interfaces in the candidate datastore The situation is not a result of partial locking as a lock can be easily removed; it is the result of a potential interaction between access control, which by nature is specific for different parts of the datastore and the global nature of the commit operation. @@ -283,26 +297,27 @@ running datastore. For this reason allows the locking of the same sections of the management data in multiple datastores. 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 users. If the - XPath expression in the partial lock operation covers all users at - locking, the scope of the lock will be maintained as the list of - "user" nodes at the time when the lock was granted. If someone later - creates a new user, this new user will not be included in the locked- - nodes list created previously, the new user will not be locked. + 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, the new + interface will not be locked. A operation MUST be handled atomically by the NETCONF server. The server either locks all requested parts of the datastore(s) or none. If during the 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, 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 @@ -333,21 +348,21 @@ The 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 a 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 + 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 a datastore that are crucial for a specific management action. Note: The operation does not modify the global operation defined in the base NETCONF Protocol [NETCONF]. If part of a datastore is already locked by , then a global lock @@ -457,24 +474,24 @@ not an Instance Identifier, the is 'invalid-value', the is 'invalid-lock-specification'. If access control denies the partial lock, the is 'access-denied'. 2.4.1.2. Deadlock Avoidance As with most locking systems, it is possible that two management sessions trying to lock different parts of the configuration could - become dead-locked. To avoid this situation, clients should lock + become dead-locked. To avoid this situation, clients SHOULD lock everything they need in one operation. If locking fails, the client - should back-off, release any previously acquired locks, and retry the - procedure after waiting some randomized time interval. + MUST back-off, release any previously acquired locks, and SHOULD + retry the procedure after waiting some randomized time interval. 2.4.2. The operation unlocks the parts of the datastores that were previously locked using during the same session. Parameters: lock-id: Identity of the lock to be unlocked. This lock-id MUST have been received as a response to a lock request by the manager @@ -580,39 +597,42 @@ users's sessions. The NETCONF server may log partial lock requests in an audit trail. A lock that is hung for some reason (e.g., a broken TCP connection that the server has not yet recognised) can be released using another NETCONF session by explicitly killing the session owning that lock using the operation. - Partial locking is NOT an authorization mechanism; it SHOULD NOT be + Partial locking is not an authorization mechanism; it SHOULD NOT be used to provide security or access control. Partial locking SHOULD only be used as a mechanism for providing consistency when multiple managers are trying to configure the node. It is vital that users easily understand the exact scope of a lock. This is why the scope is determined when granting a lock and is not modified thereafter. 4. IANA Considerations - This document registers two URIs for the NETCONF XML namespace in the - IETF XML registry [RFC3688]. Note that the capability URN is - compliant to [NETCONF] section 10.3. + This document registers one capability identifier URN from the + "Network Configuration Protocol (NETCONF) Capability URNs" registry, + and one URI for the NETCONF XML namespace in the "IETF XML registry" + [RFC3688]. Note that the capability URN is compliant to [NETCONF] + section 10.3. +---------------+---------------------------------------------------+ | 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. 5. Appendix A - XML Schema for Partial Locking (normative) The following XML Schema defines the and operations: @@ -970,20 +990,25 @@ 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 nodes by locking the node. + Note that if we would lock all the 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 node. + Step 3 - Lock users @@ -1085,100 +1110,104 @@ 1 8. Appendix D - Change Log -8.1. 07-08 +8.1. 08-09 Clarifications -8.2. 06-07 +8.2. 07-08 + + Clarifications + +8.3. 06-07 Changed XSD and YANG to allow additional proprietary datastores to be locked. -8.3. 05-06 +8.4. 05-06 Added usage example Clarified error messages Clarified interaction with edit-config continue-on-error Improved YANG: indentation, canonical order, contact info Added usage example in appendix C Synchronized YANG and XSD -8.4. 04-05 +8.5. 04-05 Language and editorial updates all app-tags are with dashes without spaces Added usage scenarios Changed encoding Clarified definitions, separated scope of lock and protected area -8.5. 03-04 +8.6. 03-04 Minor clarifications Added list of locked-nodes to the output of partial-lock. Added wrapper around datastore names. Allowed atomic/one operation locking of datastore parts in multiple datastores. Improved English (hopefully) Removed the element from rpc-reply following the text of rfc4741. -8.6. 02-03 +8.7. 02-03 Minor clarifications Same descriptions in XSD and YANG. -8.7. 01-02 +8.8. 01-02 Made XSD normative Clarified that no specific access control is assumed. Clarified that non-existing nodes are NOT covered by the lock, even if they where existing and covered by the lock when it was originally granted. Some rewording Added app-tags for two of the error cases. Made YANG an informative reference Enhanced security considerations. -8.8. 00-01 +8.9. 00-01 Added YANG module. -8.9. -00 +8.10. -00 Created from draft-lengyel-ngo-partial-lock-01.txt 9. Acknowledgements Thanks to Andy Bierman, Sharon Chisholm, Phil Shafer , David Harrington, Mehmet Ersue, Wes Hardaker, Juergen Schoenwaelder, Washam Fan and many other members of the NETCONF WG for providing important input to this document. @@ -1192,22 +1221,22 @@ [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004. 10.2. Informative References [I-D.ietf-netmod-yang] Bjorklund, M., "YANG - A data modeling language for - NETCONF", draft-ietf-netmod-yang-05 (work in progress), - April 2009. + NETCONF", draft-ietf-netmod-yang-06 (work in progress), + June 2009. Authors' Addresses Balazs Lengyel Ericsson Email: balazs.lengyel@ericsson.com Martin Bjorklund Tail-f Systems