Subject: Octet string encoding

From: "Puja Singh" <[email-masked]>
Date: Fri, 13 Apr 2001 19:25:03 +0530

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

---

From: "Wijnen, Bert (Bert)" <[email-masked]>
Date: Sat, 14 Apr 2001 00:41:17 +0200

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-masked]]
> Sent: 	Friday, April 13, 2001 3:55 PM
> To: 	[email-masked]
> Cc: 	[email-masked]; Shivendra Kumar; Abhishek Bagchi; Puja
> Singh
> Subject: 	Octet string encoding 
> 
> Hi,
> 
> -
> This message was passed through [email-masked], which
> is a sublist of [email-masked]. Not all messages are passed.
> Decisions on what to pass are made solely by Maurizio Codogno.
>

---

From: Bob Natale <[email-masked]>
Date: Sat, 14 Apr 2001 03:10:47 -0400

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: