Diameter AVPs are the basic unit inside the Diameter message that carries the Data(Authentication Data , Security Data , Data pertaining to Application etc). There must be at least one AVP inside Diameter message.
AVP has following frame format.
Diameter AVP Structure
AVP Code (4-bytes)
The AVP Code, combined with the Vendor-Id field, identifies the attribute uniquely. AVP numbers 256 and above are used for Diameter, which are allocated by IANA.
AVP numbers 1 through 255 are reserved for backward compatibility with RADIUS, without setting the Vendor-Id field.
AVP Flag (1-Byte [VMPRRRRR])
These flag give the information to the receiver how the each attribute to be handled. R- Reserved bits and SHOULD be set to 0.
* Means If this bit is Set then Diameter Client, Server,Proxy and Translation Agent MUST support the handling of this AVP. If Handling is not support(Either AVP or Its value is Unrecognized) by the mentioned Diameter Agents then Diameter message MUST be Rejected.
* Diameter Relay and Redirect Agent MUST not reject the message with unrecognized AVPs.
* If M bit is clear and Receiver does not support the handling of considered Avp then Receiver may ignore the considered AVP.
V- Vendor Id Bit
* It is just the indication whether Vendor-Id field is there in the AVP or Not
* If V is Set the Vendor-Id Field is prsent in the AVP Otherwise missing this Field.
Vendor-ID (4- bytes)
Vendor-ID field contains the IANA assigned "SMI Network Management Private Enterprise Codes" value.
As we know Diameter is Extensible Protocol, so any vendor wishs to implement vendor-specific Diameter AVp MUST use Their OWN Vendor-ID along with their privately managed AVP address Space.
This bit is set indicates that Avp data is encrypted for end-to-end security.
AVP Length (3- bytes)
Contains No. of octets used by Data + Vendor-ID + AVP Code + AVP Length + AVP Flags.
Data Field is of ZERO or More octets and contains information. AVP with Zero octet length is used for indications only.The format of the Data field MUST be one of the data type defined in Base Diameter protocol RFC-3588.
Grouped AVP more or less same like the single AVPs except that the data field of grouped avp contains the one or move avps rather than Raw data. Here avps act as data.