Subject: [AAA-WG]: draft-ietf-aaa-diameter-01 / 14.0 AVP Table

From: "Bob Kopacz" <[email-masked]>
Date: Wed, 28 Mar 2001 21:34:44 -0500

Hi Pat,

I'm trying to sort out what validation checks to make when
parsing the AVPs in a received Diameter message, in particular
when counting the occurrences of certain AVPs in the message.

Section 1.0 (Introduction) says that "AVPs may be added
arbitrarily to Diameter messages, so long as the required AVPs
are included and AVPs which are explicitly excluded are not
included."

Section 14.0 (AVP Table) specifies a table of AVPs which appear
in the various Diameter messages and whether they occur 0, 1,
0-1, or 0+ times.  The legend for the table says that "0" and
"1" indicate MUSTs, while "0+" and "0-1" indicate MAYs, i.e.:

> 0   The AVP MUST NOT be present in the message.
> 0+  Zero or more instances of the AVP MAY be present
> 0-1 Zero or one instance of the AVP MAY be present
> 1   One instance of the AVP MUST be present in the message.

Can someone comment on the following more detailed 
interpretation of what I think the AVP table says 
and what I think the introduction says?

| When parsing a received Diameter message:
| 
| 1. If the message contains an AVP which table indicates MUST
| appear "0" times, then this is a "an explicitly excluded AVP is
| included" error.  [A new DIAMETER_AVP_NOT_ALLOWED code needs to
| be defined, to use as the value for the Result-Code AVP in the
| resulting error message].
| 
| 2. If the table indicates a certain AVP MUST appear "1" times,
| and the message contains no occurrences of this AVP, then this
| is a "required AVP not present" error.  The Result-Code AVP
| value to use in the resulting error message is
| DIAMETER_MISSING_AVP.
| 
| 3. If the table indicates a certain AVP MUST appear "1" times,
| and the message contains 2+ occurrences of this AVP, then this is
| a "too many occurrences of this AVP" error. [A new
| DIAMETER_AVP_OCCURS_TOO_MANY_TIMES code needs to be defined, to
| use as the value for the Result-Code AVP in the resulting error
| message].
| 
| 4. If the table indicates a certain AVP MAY appear "0-1" times,
| and the message contains 2+ occurrences of this AVP, then it's
| unclear how to handle this.  There seem to be two choices:
| 
|   a. Since the table legend indicates "MAY", it seems like an
| implementation should just be friendly and not treat the 2nd
| occurrence as an error.  But then what's the difference
| between "0-1" and "0+", if you're not going to enforce the
| upper limit of 1?  
| 
|   b. Or is the intent of "0-1" that 2+ occurrences of such an
| AVP be treated as a "too many occurrences of this AVP" error?
| 
| 5. If the received message contains an AVP that is not listed in
| the table, then this is one of those "neither required nor
| explicitly excluded AVPs that can be arbitrarily added to a
| Diameter message", so is treated like a "0+".  So no problem.
| 
| Section 10.0 (End-to-End Error Signaling) describes six
| different types of error conditions: Bad Message, Unknown
| Command, Unknown AVP, Bad AVP Value, Request/Query Error, and
| Answer/Response/Ind Error.
| 
| When an AVP occurrence errors per cases 1-5 above happens, it is
| treated as either a Request/Query Error or a Answer/Response/Ind
| Error, depending on the command code.

Also, two tiny nit-picks: 

1. Rename section 14.0 from "AVP Table" to the more descriptive
"AVP Occurrence Table". 

2. Add a legend entry for "1+", which appears in the table.

Bob K.

---

From: Patrice Calhoun <[email-masked]>
Date: Thu, 29 Mar 2001 16:49:52 -0800 (PST)

> | Error, depending on the command code.

All of the above assumptions are correct, but not described anywhere in the
spec. Are you proposing that such statements be added to the base protocol for
clarification (and the missing Result-Codes, of course)?

Anyone else?

PatC

---

From: "Bob Kopacz" <[email-masked]>
Date: Thu, 29 Mar 2001 23:19:17 -0500

----- Original Message ----- 
From: Patrice Calhoun <[email-masked]>
To: Bob Kopacz <[email-masked]>
Cc: Pat Calhoun <[email-masked]>; Aaa-Wg <[email-masked]>
Sent: Thursday, March 29, 2001 7:49 PM
Subject: Re: draft-ietf-aaa-diameter-01 / 14.0 AVP Table

> clarification (and the missing Result-Codes, of course)?

I think this would be too much verbage to add to the base.

Other than the missing Result-Code, the only real question in all my 
blathering was case #4 above, whether (a) or (b) is the intended handling
of a "0-1" AVP occurring 2+ times.

---

From: Patrice Calhoun <[email-masked]>
Date: Fri, 30 Mar 2001 06:50:58 -0800 (PST)

> I think this would be too much verbage to add to the base.

ok, good. 

> Other than the missing Result-Code, 

which I agree are missing, and I will add them.

> the only real question in all my 

If the I-D states that zero or one times, then more than one is an error, and
your proposed DIAMETER_AVP_OCCURS_TOO_MANY_TIMES Result-Code would work just
fine. I can make sure that this one particular case is clarified.

PatC