draft-ietf-netconf-partial-lock-03.txt   draft-ietf-netconf-partial-lock-04.txt 
NETCONF B. Lengyel NETCONF B. Lengyel
Internet-Draft Ericsson Hungary Internet-Draft Ericsson
Intended status: Standards Track M. Bjorklund Intended status: Standards Track M. Bjorklund
Expires: February 7, 2009 Tail-f Systems Expires: May 2, 2009 Tail-f Systems
August 06, 2008 October 29, 2008
Partial Lock RPC for NETCONF Partial Lock RPC for NETCONF
draft-ietf-netconf-partial-lock-03 draft-ietf-netconf-partial-lock-04
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
skipping to change at page 1, line 35 skipping to change at page 1, line 35
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on February 7, 2009. This Internet-Draft will expire on May 2, 2009.
Copyright Notice Copyright Notice
Copyright (C) The IETF Trust (2008). Copyright (C) The IETF Trust (2008).
Abstract Abstract
The NETCONF protocol defines the lock and unlock RPCs that lock The NETCONF protocol defines the lock and unlock RPCs, used to lock
entire configuration datastores. In some situations, a way to lock entire configuration datastores. In some situations, a way to lock
only parts of a configuration datastore is required. This document only parts of a configuration datastore is required. This document
defines a capability-based extension to the NETCONF protocol for defines a capability-based extension to the NETCONF protocol for
locking portions of a configuration datastore. locking portions of a configuration datastore.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Definition of Terms . . . . . . . . . . . . . . . . . . . 3 1.1. Definition of Terms . . . . . . . . . . . . . . . . . . . 3
2. Partial Locking Capability . . . . . . . . . . . . . . . . . . 3 2. Partial Locking Capability . . . . . . . . . . . . . . . . . . 3
2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2. Dependencies . . . . . . . . . . . . . . . . . . . . . . . 4 2.2. Dependencies . . . . . . . . . . . . . . . . . . . . . . . 4
2.3. Capability Identifier . . . . . . . . . . . . . . . . . . 4 2.3. Capability Identifier . . . . . . . . . . . . . . . . . . 4
2.4. New Operations . . . . . . . . . . . . . . . . . . . . . . 4 2.4. New Operations . . . . . . . . . . . . . . . . . . . . . . 4
2.4.1. <partial-lock> . . . . . . . . . . . . . . . . . . . . 4 2.4.1. <partial-lock> . . . . . . . . . . . . . . . . . . . . 4
2.4.2. <partial-unlock> . . . . . . . . . . . . . . . . . . . 8 2.4.2. <partial-unlock> . . . . . . . . . . . . . . . . . . . 8
2.5. Modifications to Existing Operations . . . . . . . . . . . 9 2.5. Modifications to Existing Operations . . . . . . . . . . . 9
2.6. Interactions with Other Capabilities . . . . . . . . . . . 9 2.6. Interactions with Other Capabilities . . . . . . . . . . . 9
2.6.1. Writable-Running Capability . . . . . . . . . . . . . 9 2.6.1. Candidate Configuration Capability . . . . . . . . . . 9
2.6.2. Candidate Configuration Capability . . . . . . . . . . 9 2.6.2. Confirmed Commit Capability . . . . . . . . . . . . . 9
2.6.3. Distinct Startup Capability . . . . . . . . . . . . . 9 2.6.3. Distinct Startup Capability . . . . . . . . . . . . . 10
3. Security Considerations . . . . . . . . . . . . . . . . . . . 9 3. Security Considerations . . . . . . . . . . . . . . . . . . . 10
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11
5. Appendix A - XML Schema for Partial Locking (normative) . . 11 5. Appendix A - XML Schema for Partial Locking (normative) . . 12
6. Appendix B - YANG Module for Partial Locking 6. Appendix B - YANG Module for Partial Locking
(non-normative) . . . . . . . . . . . . . . . . . . . . . . . 13 (non-normative) . . . . . . . . . . . . . . . . . . . . . . . 16
7. Appendix C - Change Log . . . . . . . . . . . . . . . . . . 15 7. Appendix C - Change Log . . . . . . . . . . . . . . . . . . 19
7.1. 02-03 . . . . . . . . . . . . . . . . . . . . . . . . . . 15 7.1. 03-04 . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.2. 01-02 . . . . . . . . . . . . . . . . . . . . . . . . . . 15 7.2. 02-03 . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.3. 00-01 . . . . . . . . . . . . . . . . . . . . . . . . . . 15 7.3. 01-02 . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.4. -00 . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 7.4. 00-01 . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 16 7.5. -00 . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 17 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 21
9.1. Normative References . . . . . . . . . . . . . . . . . . . 17 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.2. Informative References . . . . . . . . . . . . . . . . . . 17 9.1. Normative References . . . . . . . . . . . . . . . . . . . 22
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 18 9.2. Informative References . . . . . . . . . . . . . . . . . . 22
Intellectual Property and Copyright Statements . . . . . . . . . . 19 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 23
Intellectual Property and Copyright Statements . . . . . . . . . . 24
1. Introduction 1. Introduction
The NETCONF protocol [NETCONF] describes the lock and unlock RPCs The NETCONF protocol [NETCONF] describes the lock and unlock RPCs
that operate on entire configuration datastores. Often, multiple that operate on entire configuration datastores. Often, multiple
management sessions need to be able to modify the configuration of a management sessions need to be able to modify the configuration of a
managed device in parallel. In these cases, locking only parts of a managed device in parallel. In these cases, locking only parts of a
configuration datastore is needed. This document defines an configuration datastore is needed. This document defines an
extension to the NETCONF protocol to allow this. extension to the NETCONF protocol to allow this.
skipping to change at page 3, line 31 skipping to change at page 3, line 31
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14, [RFC2119]. 14, [RFC2119].
2. Partial Locking Capability 2. Partial Locking Capability
2.1. Overview 2.1. Overview
The :partial-lock capability indicates that the device supports the The :partial-lock capability indicates that the device supports the
locking of its configuration with a scope smaller then a complete locking of its configuration with a more limited scope than a
configuration datastore. The scope to be locked is specified by complete configuration datastore. The scope to be locked is
using restricted or full XPath expressions. Partial locking covers specified by using restricted or full XPath expressions. Partial
configuration data, but not state data. locking covers configuration data, but not state data.
The system MUST ensure that configuration resources covered by the The system MUST ensure that configuration resources covered by the
lock are not modified by other NETCONF or non-NETCONF management lock are not modified by other NETCONF or non-NETCONF management
operations such as SNMP and the CLI. operations such as SNMP and the CLI.
The duration of the partial lock is defined as beginning when the The duration of the partial lock begins when the partial lock is
partial lock is granted. The partial lock lasts until either the granted and lasts until (1) either the corresponding <partial-unlock>
corresponding <partial-unlock> operation succeeds or the NETCONF operation succeeds or (2) the NETCONF session terminates.
session terminates.
A NETCONF session MAY have multiple parts of one or more datastores A NETCONF session MAY have multiple parts of one or more datastores
(running, candidate,startup) locked using partial lock operations. (running, candidate,startup) locked using partial lock operations.
The <partial-lock> operation returns a lock-id to identify each The <partial-lock> operation returns a lock-id to identify each
successfully acquired lock. successfully acquired lock.
2.2. Dependencies 2.2. Dependencies
The device MUST support the restricted XPath expressions in the The device MUST support restricted XPath expressions in the select
select element, as described in Section 2.4.1. If optionally the element, as described in Section 2.4.1. Optionally, if the :xpath
:xpath capability is also supported, the device MUST also support the capability is also supported, the device MUST also support using any
usage of any XPath 1.0 expression in the select element. XPath 1.0 expression in the select element.
2.3. Capability Identifier 2.3. Capability Identifier
urn:ietf:params:netconf:capability:partial-lock:1.0 urn:ietf:params:netconf:capability:partial-lock:1.0
2.4. New Operations 2.4. New Operations
2.4.1. <partial-lock> 2.4.1. <partial-lock>
The <partial-lock> operation allows the client to lock a portion of a The <partial-lock> operation allows the client to lock a portion of
data store. The portion to lock is specified by using XPath one or more datastores. The portion to lock is specified with XPath
expressions in the select elements of the <partial-lock> operation. expressions in the select elements and the list of datastores in the
Each XPath expression MUST return a node set. Locking a node target element in the <partial-lock> operation. Each XPath
protects the complete subtree under it from modification by others. expression MUST return a node set. Locking a node also protects the
complete subtree under the node from modification by others.
The select XPath expressions are evaluated only once at lock time, In some situations it is desirable that the same set of nodes are
thereafter the scope of the lock is maintained as a set of nodes. If locked in more than one datastore. As an example: if an interface is
the configuration data is later altered in a way that would make the configured in the candidate datastore, it is dangerous if it is
original select XPath expressions evaluate to a different set of configured by someone else in a possibly conflicting manner in the
running datastore. For this reason <partial-lock> allows the locking
of the same sections of the management data in one or multiple
datastores.
The select XPath expressions are evaluated only once at lock time.
Thereafter, the scope of the lock is maintained as a set of nodes.
If the configuration data is later altered in a way that would make
the original select XPath expressions evaluate to a different set of
nodes, this does not affect the scope of the partial lock. nodes, this does not affect the scope of the partial lock.
XPath is only used for the creation of the partial lock. XPath is only used for the creation of the partial lock.
Conceptually the scope of the lock is defined by the returned node Conceptually, the scope of the lock is defined by the returned node
set and not by the XPath expression. set and not by the XPath expression.
A <partial-lock> operation MUST be handled atomically by the NETCONF A <partial-lock> operation MUST be handled atomically by the NETCONF
server. The server either locks all requested parts of the data server. The server either locks all requested parts of the
store or none; I.e. if during the operation one of the requested datastore(s) or none. That is, if during the <partial-lock>
parts cannot be locked the server MUST unlock all parts that have operation one of the requested parts cannot be locked, the server
been already locked during that operation. MUST unlock all parts that were previously locked during that
operation.
If a node is locked by a session, only that same session is able to If a node is locked by a session, only that same session is able to
modify that node or any node in the subtree underneath it. modify that node or any node in the subtree underneath it.
If a top level node of a locked subtree is deleted, any other session If a top level node of a locked subtree is deleted, any other session
can recreate it, as it is not covered by the lock anymore. If all can recreate it, as it is no longer covered by the lock. If all top
top level nodes are deleted, the lock will still be present, however level nodes are deleted, the lock will still be present. However,
it's scope will become nil i.e. it will not cover any nodes. its scope will become nil (i.e., the lock will not cover any nodes).
A NETCONF server MUST be able to grant multiple simultaneous partial
locks to a single NETCONF session. If the scope of the individual
locks overlaps, nodes in the common area MUST be locked until all of
the locks are released.
A partial lock operation MUST fail if: A partial lock operation MUST fail if:
o Any NETCONF session (including the current session) owns the o Any NETCONF session (including the current session) owns the
global lock on the datastore. global lock on any target datastore.
o Any part of the scope to be locked is already locked by another o Any part of the scope to be locked is already locked by another
management session/protocol, including other NETCONF sessions management session/protocol, including other NETCONF sessions
using the <partial-lock> or any other non-NETCONF management using the <partial-lock> or any other non-NETCONF management
method. method.
o The NETCONF server implements access control and the locking user o The NETCONF server implements access control, and the locking user
does not have sufficient privileges, to all parts of the datastore does not have sufficient rights to all parts of a datastore
section to be locked. The exact handling of access rights is section to be locked. The exact handling of access rights is
outside the scope of this document, but it is assumed that there outside the scope of this document, but it is assumed that there
is an access control system that MAY deny or allow the partial is an access control system that MAY deny or allow the partial
lock operation. lock operation.
Note: If partial lock is requested for the running datastore, and the As with most locking systems, it is possible that two management
NETCONF server implements the :confirmed-commit capability, and there sessions trying to lock different parts of the configuration could
was a recent confirmed <commit> operation, where the confirming become dead-locked. To avoid this situation, clients SHOULD lock
<commit> operation has not been received. In this case the lock MUST everything they need in one operation. If that operation fails, the
be denied, because if the confirmation does not arrive, the running client SHOULD back down, release any previously acquired locks, and
datastore MUST be rolled back to its state before the commit, thus retry the procedure after waiting some time interval. The length of
the NETCONF server might need to modify the configuration. the interval SHOULD be random to avoid repeated dead-locks when both
(or all) clients back down and then retry the partial lock operation.
As with most locking systems, there is a possibility that two
management sessions trying to lock different parts of the
configuration become dead-locked. To avoid this situation, clients
SHOULD lock everything they need in one operation. If that operation
still fails, the client SHOULD back down, release any already
acquired locks, and retry the procedure after some time interval.
The length of the interval should preferably be random to avoid
repeated dead-locks when both (or all) clients back down and then
repeat locking.
It is the intention to keep partial-locking simple, so when a partial The <partial-lock> operation is designed for simplicity, so when a
lock is executed you get what you asked for: a set of nodes that are partial lock is executed you get what you asked for: a set of nodes
locked for writing. There are some other issues that are that are locked for writing. There are some other issues that are
intentionally not addressed for the sake of simplicity: intentionally not addressed:
o Locking does not affect read operations. o Locking does not affect read operations.
o If a part of a datastore is locked, this has no effect on any 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. the unlocked parts of the datastore. If this is a problem (e.g.,
operator's changes depend on data values in the unlocked part of changes depend on data values in the unlocked part of the
the datastore, the operator should include these values in the datastore), these values SHOULD be included in the scope of the
scope of the lock. lock.
o An operator is allowed to edit the configuration both inside and o Configuration data can be edited both inside and outside the scope
outside the scope of a lock. It is the operator's responsibility of a lock. It is the responsibility of the NETCONF client
to lock all parts of the datastore that are crucial for a specific application to lock all relevant parts of a datastore that are
management action. crucial for a specific management action.
Note: The <partial-lock> operation does not modify the global <lock> Note: The <partial-lock> operation does not modify the global <lock>
operation defined in the base NETCONF Protocol [NETCONF]. If part of operation defined in the base NETCONF Protocol [NETCONF]. If part of
a datastore is already locked by <partial-lock>, then a global lock a datastore is already locked by <partial-lock>, then a global lock
for that datastore fails even if the global lock is attempted by the for that datastore MUST fail even if the global lock is requested by
same NETCONF session which owns the partial-lock. the NETCONF session that owns the partial lock.
2.4.1.1. Parameters, Result, Examples 2.4.1.1. Parameters, Result, Examples
Parameters: Parameters:
target: Name of the configuration datastore of which a part shall be target: Name of one or more configuration datastores of which a part
locked. One <partial-lock> operation can affect only one of the shall be locked. If multiple datastores are specified the same
datastores. URLs are not accepted. select parameter(s) are used for all of them. For each datastore
locking of the same set of nodes will be requested.
select: One or more 'select' elements each containing an XPath select: One or more 'select' elements, each containing an XPath
expression. The XPath expression is evaluated in a context where expression. The XPath expression is evaluated in a context where
the context node is the root of the server's conceptual data the context node is the root of the server's conceptual data
model, and the set of namespace declarations are those in scope model, and the set of namespace declarations are those in scope
on the select element. on the select element.
The select expressions MUST each return a node set, and at least Each select expression is evaluated for each targeted datastore.
one of the node sets must be non-empty.
If the device supports the :xpath capability as well any valid The nodes that matched the select expression and are locked are
XPath 1.0 expression can be used, if not, the XPath expression reported in the rpc-reply message. Note that if some of the
MUST be limited to an Instance Identifier expression. An requested nodes exist only in one of the datastores, the lock is
Instance Identifier is an absolute path expression in abbreviated granted on different nodes in different datastores.
syntax, where predicates are used only to specify values for
nodes defined as keys to distinguish multiple instances. Each select expression MUST return a node set, and at least one
of the node sets for one of the specified datastores MUST be non-
empty.
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 Example: Lock virtual router 1 and interface eth1
<nc:rpc <nc:rpc
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
xmlns:rte="http://example.com/ns/route"> xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns:if="http://example.com/ns/interface"> message-id="135">
nc:message-id="135">
<partial-lock> <partial-lock>
<nc:running/> <target>
<select> <running/>
/routing/virtualRouter['routerName=router1'] </target>
<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> </select>
<select>/interfaces/interface[Id='eth1']</select>
</partial-lock> </partial-lock>
</nc:rpc> </nc:rpc>
<nc:rpc-reply <nc:rpc-reply
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
xmlns:rte="http://example.com/ns/route"> message-id="135">
xmlns:if="http://example.com/ns/interface">
nc:message-id="135">
<nc:data>
<lock-id>127</lock-id> <lock-id>127</lock-id>
</nc:data> <running>
<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>
</running>
</nc:rpc-reply> </nc:rpc-reply>
Positive Response: Positive Response:
If the device was able to satisfy the request, an <rpc-reply> is sent If the device was able to satisfy the request, an <rpc-reply> is sent
with a <lock-id> element (lock identifier) in the <data> element. with a <lock-id> element (lock identifier) in the <rpc-reply>
element. A list of locked nodes per datastore is also returned in
Instance Identifier format.
Negative Response: Negative Response:
If a lock is already held on any node within the subtrees to be If a lock is already held by another session on any node within the
locked, the <error-tag> element is 'lock-denied' and the <error-info> subtrees to be locked, the <error-tag> element is 'lock-denied' and
element includes the <session-id> of the lock owner. If the lock is the <error-info> element includes the <session-id> of the lock owner.
held by a non-NETCONF entity, a <session-id> of 0 (zero) is included. If the lock is held by a non-NETCONF session, a <session-id> of 0
(zero) is included. If needed the returned session-id may be used to
<kill-session> the NETCONF session holding the lock. The same error
response is returned if the requesting session already holds the
(global) lock for the same datastore.
If the select expressions return an empty node set, the <error-tag> If all the select expressions return an empty node set, the <error-
is 'operation-failed', and the <error-app-tag> is 'no-matches'. tag> is 'operation-failed', and the <error-app-tag> is 'no-matches'.
If any select expression returns anything but a node set, the <error- If any select expression returns something other than a node set, the
tag> is 'invalid-value', the <error-app-tag> is 'XPath does not <error-tag> is 'invalid-value', the <error-app-tag> is 'XPath does
return a node set'. not return a node set'.
If the :xpath capability is not supported and the XPath expression is If the :xpath capability is not supported and the XPath expression is
not an Instance Identifier, the <error-tag> is 'invalid-value', the not an Instance Identifier, the <error-tag> is 'invalid-value', the
<error-app-tag> is ':xpath capability not supported'. <error-app-tag> is ':xpath capability not supported'.
If access control denies the partial lock, the <error-tag> is If access control denies the partial lock, the <error-tag> is
'access-denied'. 'access-denied'.
2.4.1.2. Reserving model sections for future work 2.4.1.2. Reserving model sections for future work
Partial lock can not be used to lock non-existing nodes, effectively Partial lock cannot be used to lock non-existent nodes, which would
reserving them for future use. To make sure that a node cannot be effectively attempt to reserve them for future use. To guarantee
created by some other session, the parent node should be locked, the that a node cannot be created by some other session, the parent node
top level node of the new section created, and then locked with SHOULD be locked, the top level node of the new section created, and
another <partial-lock> operation. After this the lock on the parent then locked with another <partial-lock> operation. After this, the
node should be removed. lock on the parent node SHOULD be removed.
2.4.2. <partial-unlock> 2.4.2. <partial-unlock>
The operation unlocks a part of a datastore that was previously The operation unlocks the parts of the datastores that were
locked using <partial-lock> during the same session. previously locked using <partial-lock> during the same session.
Parameters: Parameters:
lock-id: Lock identifier to unlock; taken from a reply to a previous lock-id: Lock identifier to unlock, taken from a reply to a previous
<partial-lock> operation. <partial-lock> operation.
Example: Unlock Example: Unlock a previously created lock
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" <nc:rpc xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
nc:message-id="136"> message-id="136">
<partial-unlock> <partial-unlock>
<lock-id>127</lock-id> <lock-id>127</lock-id>
</partial-unlock> </partial-unlock>
</nc:rpc> </nc:rpc>
Positive Response: Positive Response:
If the device was able to satisfy the request, an <rpc-reply> is sent If the device was able to satisfy the request, an <rpc-reply> is sent
that contains an <ok> element. A positive response MUST be sent even that contains an <ok> element. A positive response MUST be sent even
if all of the locked part of the datastore has already been deleted. if all of the locked parts of the datastore(s) have already been
deleted.
Negative Response: Negative Response:
If the <lock-id> parameter does not identify a lock which is owned by If the <lock-id> parameter does not identify a lock which is owned by
the session, an 'invalid-value' error is returned. the session, an 'invalid-value' error is returned.
2.5. Modifications to Existing Operations 2.5. Modifications to Existing Operations
A granted partial-lock will cause another operation to fail, if it A successful partial lock will cause a subsequent operation to fail
tries to modify the locked area and is executed in a NETCONF session if it attempts to modify the locked area and is executed in a NETCONF
other then the one that owns the lock. Affected operations include: session other than the session that owns the lock. All operations
<edit-config>, <copy-config>, <delete-config>, <commit> and <discard- that modify the datastore are affected, including: <edit-config>,
changes>. A granted partial-lock will also cause the (global) <lock> <copy-config>, <delete-config>, <commit> and <discard-changes>. A
operation to fail. All of these operations are affected only if they successful partial lock will also cause the (global) <lock> operation
are for the same datastore. to fail. All of these operations are affected only if they are
targeting the same datastore.
2.6. Interactions with Other Capabilities 2.6. Interactions with Other Capabilities
2.6.1. Writable-Running Capability 2.6.1. Candidate Configuration Capability
Partial locking of the running datastore can only be done if the Partial locking of the candidate datastore can only be done if the
:writable-running capability is supported by the device. :candidate capability is supported by the device. Partial locking of
the candidate datastore does not depend on whether the datastore was
modified or not.
2.6.2. Candidate Configuration Capability 2.6.2. Confirmed Commit Capability
Partial locking of the candidate datastore can only be done if the If:
:candidate capability is supported by the device. The partial
locking of the candidate datastore does not depend on whether the o a partial lock is requested for the running datastore, and
datastore was modified or not.
o the NETCONF server implements the :confirmed-commit capability,
and
o there was a recent confirmed <commit> operation where the
confirming <commit> operation has not been received
then the lock MUST be denied, because if the confirmation does not
arrive, the running datastore MUST be rolled back to its state before
the commit. The NETCONF server might therefore need to modify the
configuration.
In this case the <error-tag> 'in-use' and the <error-app-tag> 'Lock
denied, Outstanding confirmed commit' is returned.
2.6.3. Distinct Startup Capability 2.6.3. Distinct Startup Capability
Partial locking of the startup datastore can only be done if the Partial locking of the startup datastore can only be done if the
:startup capability is supported by the device. :startup capability is supported by the device.
3. Security Considerations 3. Security Considerations
The same considerations as for the base NETCONF Protocol [NETCONF] The same considerations are relevant as for the base NETCONF Protocol
are valid. It is assumed that the <partial-lock> and <partial- [NETCONF]. It is assumed that the <partial-lock> and <partial-
unlock> RPCs are only allowed for an authenticated user after passing unlock> RPCs are only allowed for an authenticated user after passing
some access control mechanism. some access control mechanism.
A lock either a partial-lock or a global lock might prevent other A lock (either a partial lock or a global lock) might prevent other
users from configuring the system. The following mechanisms are in users from configuring the system. The following mechanisms are in
place to prevent the misuse of this possibility: place to prevent the misuse of this possibility:
Only an authenticated user after passing access control can Only an authenticated and authorized user can request a partial
request a partial-lock. lock.
The partial-lock is automatically released when a session is The partial lock is automatically released when a session is
terminated irrespective of the manner the session ends. terminated regardless of how the session ends.
The <kill-session> operation allows terminating other users The <kill-session> operation makes it possible to terminate other
sessions. users's sessions.
The NETCONF server may log partial-lock requests in an audit The NETCONF server may log partial lock requests in an audit
trail. trail.
Partial locking is NOT an authorization mechanism, it should not be A lock that is hung for some reason (e.g., a broken TCP connection
used to provide security or access control. Partial locking should that the server has not yet recognised) can be released using another
only be used as a mechanism to provide consistency in case of NETCONF session by explicitly killing the session owning that lock
multiple managers trying to configure the node. It is vital that the using the <kill-session> operation.
operator can easily understand the exact scope of a lock, for this
reason the scope is determined when granting a lock and is not Partial locking is NOT an authorization mechanism; it SHOULD NOT be
modified dynamically later. 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 4. IANA Considerations
This document registers two URIs for the NETCONF XML namespace in the This document registers two URIs for the NETCONF XML namespace in the
IETF XML registry [RFC3688]. Note that the capability URN is IETF XML registry [RFC3688]. Note that the capability URN is
compliant to [NETCONF] section 10.3. compliant to [NETCONF] section 10.3.
+---------------+---------------------------------------------------+ +---------------+---------------------------------------------------+
| Index | Capability Identifier | | Index | Capability Identifier |
+---------------+---------------------------------------------------+ +---------------+---------------------------------------------------+
skipping to change at page 11, line 29 skipping to change at page 12, line 29
Schema defining the partial-lock and unlock operations. Schema defining the partial-lock and unlock operations.
organization "IETF NETCONF Working Group" organization "IETF NETCONF Working Group"
contact contact
"Balazs Lengyel "Balazs Lengyel
Ericsson Hungary, Inc. Ericsson Hungary, Inc.
balazs.lengyel@ericsson.com" balazs.lengyel@ericsson.com"
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
<xs:import namespace="urn:ietf:params:xml:ns:netconf:base:1.0" <xs:import namespace="urn:ietf:params:xml:ns:netconf:base:1.0"
schemaLocation="netconf.xsd"/> schemaLocation="urn:ietf:params:xml:ns:netconf:base:1.0"/>
<xs:complexType name="partialLockType"> <xs:complexType name="partialLockType">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
A NETCONF operation that locks part of a datastore. A NETCONF operation that locks part of one or more datastores.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
<xs:complexContent> <xs:complexContent>
<xs:extension base="nc:rpcOperationType"> <xs:extension base="nc:rpcOperationType">
<xs:sequence> <xs:sequence>
<xs:element ref="nc:config-name"/> <xs:element name="target">
<xs:annotation>
<xs:documentation>
A list of one or more datastore names for NETCONF.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="startup" minOccurs="0">
<xs:complexType/>
</xs:element>
<xs:element name="candidate" minOccurs="0">
<xs:complexType/>
</xs:element>
<xs:element name="running" minOccurs="0">
<xs:complexType/>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="select" type="xs:string" <xs:element name="select" type="xs:string"
maxOccurs="unbounded"> maxOccurs="unbounded">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
XPath expression that specifies the scope of the lock. XPath expression that specifies the scope of the lock.
An Instance Identifier expression must be used unless An Instance Identifier expression must be used unless
the :xpath capability is supported in which case any the :xpath capability is supported in which case any
XPath 1.0 expression is allowed. XPath 1.0 expression is allowed.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
skipping to change at page 12, line 21 skipping to change at page 13, line 40
A NETCONF operation that releases a previously acquired A NETCONF operation that releases a previously acquired
partial-lock. partial-lock.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
<xs:complexContent> <xs:complexContent>
<xs:extension base="nc:rpcOperationType"> <xs:extension base="nc:rpcOperationType">
<xs:sequence> <xs:sequence>
<xs:element name="lock-id" type="xs:unsignedInt"> <xs:element name="lock-id" type="xs:unsignedInt">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
Identifies the lock to be released. Must be the value Identifies the lock, SHOULD be used in the subsequent
received in the response to the partial-lock operation. partial-lock operation.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
</xs:extension> </xs:extension>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
<!-- <partial-lock> operation --> <!-- <partial-lock> operation -->
<xs:element name="partial-lock" type="partialLockType" <xs:element name="partial-lock" type="partialLockType"
substitutionGroup="nc:rpcOperation"/> substitutionGroup="nc:rpcOperation"/>
<!-- <partial-unlock> operation --> <!-- <partial-unlock> operation -->
<xs:element name="partial-unlock" type="partialUnLockType" <xs:element name="partial-unlock" type="partialUnLockType"
substitutionGroup="nc:rpcOperation"/> substitutionGroup="nc:rpcOperation"/>
<!-- reply to <partial-lock> --> <!-- reply to <partial-lock> -->
<xs:element name="lock-id" type="xs:unsignedInt"/>
<xs:complexType name="dataPartInPpartialLockReplyType">
<xs:annotation>
<xs:documentation>
In a reply to a successful partial-lock request the content
of the <rpc-reply> element MUST conform to this complex type.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="lock-id" type="xs:unsignedInt">
<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:element name="running" minOccurs="0">
<xs:annotation>
<xs:documentation>
List of locked nodes in the running datastore.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="locked-node" type="xs:string"
maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="candidate" minOccurs="0">
<xs:annotation>
<xs:documentation>
List of locked nodes in the candidate datastore.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="locked-node" type="xs:string"
maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="startup" minOccurs="0">
<xs:annotation>
<xs:documentation>
List of locked nodes in the startup datastore.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="locked-node" type="xs:string"
maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema> </xs:schema>
6. Appendix B - YANG Module for Partial Locking (non-normative) 6. Appendix B - YANG Module for Partial Locking (non-normative)
The following YANG module defines the <partial-lock> and <partial- The following YANG module defines the <partial-lock> and <partial-
unlock> operations. The YANG language is defined in unlock> operations. The YANG language is defined in
[I-D.ietf-netmod-yang]. [I-D.ietf-netmod-yang].
module netconf-partial-lock { module netconf-partial-lock {
namespace urn:ietf:params:xml:ns:netconf:partial-lock:1.0; namespace urn:ietf:params:xml:ns:netconf:partial-lock:1.0;
prefix pl; prefix pl;
organization "IETF NETCONF Working Group"; organization "IETF NETCONF Working Group";
contact contact
"Balazs Lengyel "Balazs Lengyel
Ericsson Hungary, Inc. Ericsson
balazs.lengyel@ericsson.com"; balazs.lengyel@ericsson.com";
description description
"This YANG module defines the <partial-lock> and "This YANG module defines the <partial-lock> and
<partial-unlock> operations."; <partial-unlock> operations.";
revision 2008-06-06 { revision 2008-10-31 {
description "Initial version."; description "Initial version.";
} }
grouping configName { grouping configNames {
container target {
description description
"A choice to list the datastore names for NETCONF. "A list of one or more datastore names.";
This could be moved to a netconf.yang module.";
choice configNameType {
leaf running { type empty; } leaf running { type empty; }
leaf candidate { type empty; } leaf candidate { type empty; }
leaf startup { type empty; } leaf startup { type empty; }
must "running or candidate or startup" {
error-message "At least one datastore must be specified.";
}
} }
} }
rpc partial-lock { rpc partial-lock {
description "A NETCONF operation that locks part of a datastore."; description
"A NETCONF operation that locks part of one or more datastores.";
input { input {
uses configName; uses configNames;
leaf-list select { leaf-list select {
description description
"XPath expression that specifies the scope of the lock. "XPath expression that specifies the scope of the lock.
An Instance Identifier expression must be used unless the An Instance Identifier expression MUST be used unless the
:xpath capability is supported in which case any XPath 1.0 :xpath capability is supported, in which case any XPath 1.0
expression is allowed."; expression is allowed.";
type string; type string;
min-elements 1; min-elements 1;
} }
} }
output { output {
leaf lock-id { leaf lock-id {
description description
"Identifies the lock, if granted. The lock-id must be "Identifies the lock, if granted. The lock-id MUST be
used in the partial-unlock rpc."; used in the partial-unlock rpc.";
type uint32; type uint32;
} }
container running {
leaf-list locked-node {
description "List of locked nodes
in the running datastore";
type instance-identifier;
}
}
container candidate {
leaf-list locked-node {
description "List of locked nodes
in the candidate datastore";
type instance-identifier;
}
}
container startup {
leaf-list locked-node {
description "List of locked nodes
in the startup datastore";
type instance-identifier;
}
}
} }
} }
rpc partial-unlock { rpc partial-unlock {
description description
"A NETCONF operation that releases a previously acquired "A NETCONF operation that releases a previously acquired
partial-lock."; partial-lock.";
input { input {
leaf lock-id { leaf lock-id {
description description
"Identifies the lock to be released. Must be the value "Identifies the lock to be released. MUST be the value
received in the response to the partial-lock operation."; received in the response to the partial-lock operation.";
type uint32; type uint32;
} }
} }
} }
} }
7. Appendix C - Change Log 7. Appendix C - Change Log
7.1. 02-03 7.1. 03-04
Minor clarifications
Added list of locked-nodes to the output of partial-lock.
Added <target> wrapper around datastore names.
Allowed atomic/one operation locking of datastore parts in multiple
datastores.
Improved English (hopefully)
Removed the <data> element from rpc-reply following the text of
rfc4741.
7.2. 02-03
Minor clarifications Minor clarifications
Same descriptions in XSD and YANG. Same descriptions in XSD and YANG.
7.2. 01-02 7.3. 01-02
Made XSD normative Made XSD normative
Clarified that no specific access control is assumed. Clarified that no specific access control is assumed.
Clarified that non-existing nodes are NOT covered by the lock, even 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 if they where existing and covered by the lock when it was originally
granted. granted.
Some rewording Some rewording
Added app-tags for two of the error cases. Added app-tags for two of the error cases.
Made YANG an informative reference Made YANG an informative reference
Enhanced security considerations. Enhanced security considerations.
7.3. 00-01 7.4. 00-01
Added YANG module. Added YANG module.
7.4. -00 7.5. -00
Created from draft-lengyel-ngo-partial-lock-01.txt Created from draft-lengyel-ngo-partial-lock-01.txt
8. Acknowledgements 8. Acknowledgements
Thanks to Andy Bierman, Sharon Chisholm, Phil Shafer , David Thanks to Andy Bierman, Sharon Chisholm, Phil Shafer , David
Harrington, Mehmet Ersue and many other members of the NETCONF WG for Harrington, Mehmet Ersue, Wes Hardaker and many other members of the
providing important input to this document. NETCONF WG for providing important input to this document.
9. References 9. References
9.1. Normative References 9.1. Normative References
[NETCONF] Enns, R., "NETCONF Configuration Protocol", RFC 4741, [NETCONF] Enns, R., "NETCONF Configuration Protocol", RFC 4741,
December 2006. December 2006.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
January 2004. January 2004.
9.2. Informative References 9.2. Informative References
[I-D.ietf-netmod-yang] [I-D.ietf-netmod-yang]
Bjorklund, M., "YANG - A data modeling language for Bjorklund, M., "YANG - A data modeling language for
NETCONF", draft-ietf-netmod-yang-00 (work in progress), NETCONF", draft-ietf-netmod-yang-01 (work in progress),
May 2008. August 2008.
Authors' Addresses Authors' Addresses
Balazs Lengyel Balazs Lengyel
Ericsson Hungary Ericsson
Email: balazs.lengyel@ericsson.com Email: balazs.lengyel@ericsson.com
Martin Bjorklund Martin Bjorklund
Tail-f Systems Tail-f Systems
Email: mbj@tail-f.com Email: mbj@tail-f.com
Full Copyright Statement Full Copyright Statement
 End of changes. 77 change blocks. 
196 lines changed or deleted 363 lines changed or added

This html diff was produced by rfcdiff 1.35. The latest version is available from http://tools.ietf.org/tools/rfcdiff/