Subject: Re: [Netconf] WG Last Call for draft-ietf-netconf-system-notifications-04.txt

From: Andy Bierman <[email-masked]>
Date: Mon, 01 Aug 2011 13:45:09 -0700

On 07/29/2011 06:36 AM, Phil Shafer wrote:
> Martin Bjorklund writes:
>> NEW:
>>      leaf killed-by {
>>        when "../termination-reason = 'killed'";
>>        type nc:session-id-type-or-zero;
>>        description
>>          "The ID of the session that terminated this session, or the
>>           value '0' if it was terminated in some other way.";
>
> Why emit the leaf at all if it doesn't have a valuable value?
>

It could be valuable to know a non-NETCONF session killed your session.
I do not think all servers are required to give non-zero session IDs
to non-NETCONF sessions.  I know they MAY do that, but not MUST do that.
So it is possible for a server to know a non-NETCONF session killed a
NETCONF session without assigning it a non-zero session ID.

> Thanks,
>   Phil

Andy

---

From: Phil Shafer <[email-masked]>
Date: Mon, 1 Aug 2011 16:30:28 -0400

>NETCONF session without assigning it a non-zero session ID.

Sorry, but I might have confused you.  I'll try again.

If you want to indicate that a session was not terminated by another
session, you can represent this in two ways.  Your proposal is:

    <killed-by>0</killed-by>

But I'm asked why you would emit this tag if the value it contains
is not valuable.  If you don't know the session that killed it,
then don't emit the tag at all.

This is a general topic where folks use "magic numbers" to change
the meaning of a field.  I'd rather see a <there-was-no-foo>
leaf than see the value zero mean there is no foo.

Thanks,
 Phil

---

From: Andy Bierman <[email-masked]>
Date: Mon, 01 Aug 2011 14:07:10 -0700

> Sorry, but I might have confused you.  I'll try again.

I think you are confused.
It is possible for the session doing the abnormal terminating
to be a non-NETCONF session which is identified by the value '0'.
A server MAY choose to identify all such sessions with the value '0',
or represent all of them with a single ID -- 0.

    leaf killed-by {
        when "../termination-reason = 'killed'";
        type nc:session-id-type-or-zero;
        description
          "The ID of the session that terminated this session, or the
           value '0' if it was terminated by a non-NETCONF session
	  identified to this server with the ID '0'.";

Andy

> the meaning of a field.  I'd rather see a<there-was-no-foo>

---

From: Phil Shafer <[email-masked]>
Date: Mon, 1 Aug 2011 16:48:48 -0400

>I think you are confused.

Entirely possible.

>to be a non-NETCONF session which is identified by the value '0'.

That session can't be "identified" by 0 if 0 means "non-netconf".
So the question is why emit the field at all?  If it's not there,
the caller knows it was a non-netconf session.

>or represent all of them with a single ID -- 0.

Huh?

Thanks,
 Phil

---

From: Andy Bierman <[email-masked]>
Date: Tue, 02 Aug 2011 08:50:12 -0700

>> I think you are confused.

Ditto for me.

> the caller knows it was a non-netconf session.

 From RFC 6022:

leaf locked-by-session:
                  If the lock is held by a session that is not managed
                  by the NETCONF server (e.g., a CLI session), a session
                  id of 0 (zero) is reported.";

  list session {
         key session-id;
         description
           "All NETCONF sessions managed by the NETCONF server
            MUST be reported in this list.";

         leaf session-id {
           type uint32 {
             range "1..max";
           }

This is the text that sets the precedent for the notifications draft.
According to Martin, a server MAY include non-NETCONF sessions in the
session list -- as long as the ID is '1..max'.  IMO the text clearly
says NETCONF sessions.

The only mention in any RFC I can find about NETCONF reported non-NETCONF
sessions is from locked-by-session.

Perhaps the server has non-NETCONF sessions that have non-zero IDs,
and are not reported in this list.  Then <killed-by> could be non-zero.

Summary of issues here:

   a) It is possible the <killed-by> session ID does not represent
      a NETCONF session  (consensus: yes?)
   b) It is possible a non-NETCONF session can be identified to the NETCONF
      server with the ID value '0' (consensus: yes?)
   c) It is possible a non-NETCONF session can be identified to the NETCONF
      server with the ID value in the range '1..max' (consensus: yes?)

NEW:
     leaf killed-by {
       when "../termination-reason = 'killed' and .";
       type nc:session-id-type;
       description
         "The ID of the session that directly caused this session
          to be abnormally terminated.  If this session was abnormally
          terminated by a non-NETCONF session unknown to the server,
	 then this leaf will not be present.";
     }

I think this text conveys the correct session-id semantics.
It will not be present if 0, as you requested.

IMO, it should be possible to look this session ID up in the <sessions> list.
Clearly, that is not the case with zero (b).  Not sure about (c) above either.
The data model allows it, but the description-stmts are clearly NETCONF-only.

Andy

---

From: Andy Bierman <[email-masked]>
Date: Tue, 02 Aug 2011 11:52:03 -0700

>>> I think you are confused.

I have not heard any response, so I will go with the last iteration of <killed-by>.
The session-id description-stmt will also be changed:

NEW:

    leaf session-id {
       description
         "Identifier of the session.
          A NETCONF session MUST be identified by a non-zero value.
          A non-NETCONF session MAY be identified by the value zero.";
       type nc:session-id-or-zero-type;
       mandatory true;
     }

Andy