Subject: [AAA-WG]: username len

From: Justin Britten <[email-masked]>
Date: Tue, 20 Mar 2001 17:10:44 -0500 (EST)

I can't find any reference to a maximum username length in the Diameter
drafts.  Since User-Name AVP is of type OctetString, and the draft
states that the maximum avp length is 65527, does this mean the
username can be up to 65519 bytes? (8 bytes go to avp header)

Also, how was the maximum length value of 65527 determined?  If the
minimum diameter packet header is 16 bytes doesn't this mean the maximum
avp length is 65535 - 16 = 65519 (techically 65516 when set on an even
word boundary)?  Now, the max username is 65508.

      OctetString
         The data contains arbitrary data of variable length. Unless
         otherwise noted, the AVP Length field MUST be set to at least 9
         (13 if the 'V' bit is enabled).  Data used to transmit (human
         readable) character string data uses the UTF-8 [24] character
         set and is NOT NULL-terminated. The minimum Length field MUST
         be 9, but can be set to any value up to 65527 bytes. AVP Values
         of this type that do not align on a 32-bit boundary MUST have
         the necessary padding.

Thanks,
Justin

---

From: David Frascone <[email-masked]>
Date: Tue, 20 Mar 2001 17:15:36 -0600

> username can be up to 65519 bytes? (8 bytes go to avp header)

I have always assumed that the username could be arbitrarily long.  (I.e.
only constrained by the maximum payloads)

> word boundary)?  Now, the max username is 65508.

I think I see what Pat did :)  He did his math only taking into consideration
the size of the AVP header, and did not notice that it would cause the AVP
to grow too large to be able to fit into a Diameter message.

i.e.: The maximum length of an avp is 0xffff or 65535 bytes.  Subtracting
the minimum header length (8 bytes) yields a AVP size of 65527 bytes.

I think your number is more accurate. . . . anyone else wanna check the
math?

---

From: Patrice Calhoun <[email-masked]>
Date: Mon, 26 Mar 2001 14:19:56 -0800 (PST)

> username can be up to 65519 bytes? (8 bytes go to avp header)

Correct, Diameter doesn't impose a maximum length on *any* AVPs of type
OctetString. I would note, however, that RFC 2486 does state that all
implementations MUST support a minimum length of 72 bytes, but doesn't set a
maximum size.

> word boundary)?  Now, the max username is 65508.

You are correct, the spec had a bug, and it will be corrected in -02.

Thanks for the feedback.

PatC