Hi Puja,

To enlarge upon Bert's answer just a bit:  I would say
that the encoding of data within an octet string type
should be specified in the MIB...this is often done via
a Textual Convention (TC) defined for that purpose, but
can be handled in the DESCRIPTION clause if a TC is not
warranted (e.g., the particular encoding is not used
frequently).  It really should not come down to a matter
of guesswork for either agent or management applications
implementors.  I would also be less generous than Bert
was in terms of allowing for an out-going octet string
object to exceed the length specified in the MIB...but
I do agree with his description of what might happen
on the manager side in such a case.

Sincerely,

BobN
- - - - -
>At 4/13/2001:06:41 PM, Wijnen, Bert (Bert) wrote:
>The correct answer is (a).
>
>This question would be better asked on the SNMPv3 mailing list
>than on this generic mailing list.
>
>A manager accepting (b) is behaving in the spirit of "be flexible
>in what you accept", but it will probably interpret the value incorrectly
>according to what was meant in the MIB definition.
>
>Bert
>
>> ----------
>> From:         Puja Singh[SMTP:[EMAIL PROTECTED]]
>> Sent:         Friday, April 13, 2001 3:55 PM
>> To:   [EMAIL PROTECTED]
>> Cc:   [EMAIL PROTECTED]; Shivendra Kumar; Abhishek Bagchi; Puja
>> Singh
>> Subject:      Octet string encoding 
>> 
>> Hi,
>> 
>> We are working on SNMP Agent implementation.  We have a query regarding
>> the encoding of Octet string within a response PDU whether the Octet
>> string should be encoded as ascii or as hex & what should be the size of
>> the variable binding within the PDU?
>> If a MIB object is defined as of type Octet String of size 6 , when we
>> send the response we can send it as:
>> (a) Octet String as Hex , which will get encoded as Octet string of
>> length 6 bytes.
>> The equivalent ASN.1 representation will look like
>> Type = 04 , length = 06 and then the six bytes value
>> (b) Octet string a Ascii , which will get encoded as Octet string of
>> length 12 bytes.
>> Here each hex digit becomes an ASCII character so it needs twice the
>> space.
>> 
>> We would like to understand whether both the above representations are
>> correct and acceptable. Or, Is it that only (a) is acceptable.
>> 
>> I know it is a very basic question, but, I think I need an answer as I
>> find the standard SNMP managers accepting both.
>> 
>> Regards,
>> Puja

Reply via email to