Subject: [Dime] clarification of message length

From: "David Lehmann" <[email-masked]>
Date: Wed, 14 Jul 2010 11:29:03 -0400

The RFC states the following for AVPs in section 4.

"The length of the padding is not reflected in the AVP Length field."

In section 4.2, it states:

"Thus the AVP length field of an AVP of type Grouped is always a
multiple of 4."
 
These statements are clear for the AVP lengths.  However, the length of
the message is not so clear.  Section 3 states:
"The Message Length field is three octets and indicates the length of
the Diameter message including the header fields."

My question is:  Is the message length always a multiple of 4, as is the
case for grouped AVPs?  If so, should section 3 provide a clear
statement to that fact?

e.g. "The Message Length field is three octets and indicates the length
of the Diameter message including the header fields and the padded AVPs.
Thus the message length field is always a multiple of 4."

-David

---

From: "David Lehmann" <[email-masked]>
Date: Fri, 16 Jul 2010 10:15:20 -0400

No comments?  I thought the response would be quick for this question.
Maybe everybody is too busy packing for Maastricht. J

--

David Lehmann

Ulticom, Inc.

856-787-2952

From: [email-masked] [mailto:[email-masked]] On Behalf Of
David Lehmann
Sent: Wednesday, July 14, 2010 11:29 AM
To: [email-masked]
Subject: [Dime] clarification of message length

 

-David

---

From: jouni korhonen <[email-masked]>
Date: Fri, 16 Jul 2010 17:41:33 +0300

Hi David,

Yes, the message length is always a multiple of 4, just like it is the case with grouped AVPs. I am not sure whether that needs to be explicitly stated, because all AVPs the message "sees" are already multiple of 4. I can understand why that was stated for grouped AVPs as their length field *does* take the padding of the last sub-AVP into account, which might not be immediately obvious based on the Section 4 text.

- Jouni

On Jul 14, 2010, at 6:29 PM, David Lehmann wrote:

> “The length of the padding is not reflected in the AVP Length field.”
>  
> “Thus the AVP length field of an AVP of type Grouped is always a multiple of 4.”
>  
> These statements are clear for the AVP lengths.  However, the length of the message is not so clear.  Section 3 states:
> “The Message Length field is three octets and indicates the length of the Diameter message including the header fields.”
>  
> My question is:  Is the message length always a multiple of 4, as is the case for grouped AVPs?  If so, should section 3 provide a clear statement to that fact?
> e.g. “The Message Length field is three octets and indicates the length of the Diameter message including the header fields and the padded AVPs. Thus the message length field is always a multiple of 4.”
>  
> -David
>  
> _______________________________________________
> DiME mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/dime

---

From: "David Lehmann" <[email-masked]>
Date: Fri, 16 Jul 2010 11:13:37 -0400

Jouni,

Thanks for the response.

I also worked on an implementation of SCTP.  In SCTP, when DATA chunks
are bundled into one SCTP packet, the SCTP packet length includes the
padding for all of the data chunks, except for the last data chunk.

Since another IETF protocol (namely SCTP) uses a different methodology
in calculating the length of a message based on padded components, I
think explicit wording is prudent.  It certainly won't hurt, especially
since there is a bis I-D already in the works.

--
David Lehmann
Ulticom, Inc.
856-787-2952

> -----Original Message-----
> From: jouni korhonen [mailto:[email-masked]]
> Sent: Friday, July 16, 2010 10:42 AM
> To: David Lehmann
> Cc: [email-masked]
> Subject: Re: [Dime] clarification of message length
> 
> Hi David,
> 
> Yes, the message length is always a multiple of 4, just like it is the
case
> with grouped AVPs. I am not sure whether that needs to be explicitly
stated,
> because all AVPs the message "sees" are already multiple of 4. I can
> understand why that was stated for grouped AVPs as their length field
*does*
> take the padding of the last sub-AVP into account, which might not be
> immediately obvious based on the Section 4 text.
> 
> - Jouni
> 
multiple
> of 4."
> > "The Message Length field is three octets and indicates the length
of the
> Diameter message including the header fields."
> >
statement to
> that fact?
> > e.g. "The Message Length field is three octets and indicates the
length of
> the Diameter message including the header fields and the padded AVPs.
Thus
> the message length field is always a multiple of 4."
> >
> > -David
> >