Subject: Re: I-D ACTION:draft-strombergson-shf-02.txt

From: Tony Hansen <[email-masked]>
Date: Fri, 22 Oct 2004 10:34:41 -0400

Nits:

Consider:

    o  name: A compulsory string of arbitrary length used by any
       interested party to identify the specific Block.

If your dump consists of a single <block>, the name of that single block 
will often be redundant with the name of the dump. Look at your own 
examples and consider what 'name="Code"' really adds. Make name optional 
for <block>.

Consider:
    o  word_size: A compulsory 64 bit hexadecimal value representing the
       number of Bytes (the width) of one Word of the data.  If this is
       not given, the Word width is assumed to be 1, i.e.  one Byte.

You say compulsory, but then talk about it defaulting to 1 if not 
present. Change "compulsory" to "optional".

I still feel that the length and checksum should be optional.

s/recieveing/receiving/

Consider:
    o  The words inside a Dump may be in the native endianness of the
       consumer, since this represents raw memory.  However implementers
       may choose to store also this data in a Big Endian format for ease
       of reading: Big Endian values are more human-readable than Little
       Endian ones.

Should there be an optional "endness" attribute (defaulting to Big 
Endian, of course) for those times when the user has chosen a different 
ordering. Possible values might be endness=big, endness=little, and 
endness=native.

Consider:
     whitespace ::= (#x20 | #x9 | #xC | #xD | #xA)+
     hexdigit   ::= [0-9A-Fa-f]
     hexbytes   ::= whitespace* hexdigit (hexdigit|whitespace)*

I believe there's a shift-shift error here. The + should be removed from 
whitespace -- it's supposed need is covered by the * in hexbytes.

Consider:
     A parser reading in an SHF file should silently ignore any other
    characters that (by mistake) appear in any of these elements or

The word "A" is indented incorrectly.

Consider:
               Also note that "whitespace" has no semantic meaning, it
    is only valid for the reason of improving the human readability of
    the Dump.

Change the "," to a ";".

Consider:
    <!ATTLIST block
           name          CDATA    #REQUIRED
           address       CDATA    #REQUIRED
           word_size     CDATA    #REQUIRED
           length        CDATA    #REQUIRED
           checksum      CDATA    #REQUIRED>

Word_size is optional and should be marked #IMPLIED. Of course, I also 
feel that name, length and checksum should also be marked #IMPLIED, 
leaving only address as #REQUIRED.

Consider adding this example:

    The next example is the simplest SHF Dump allowed:

    <dump name="Simplest SHF example">
      <block address="0400">
          41 6c 6c 20 79 6f 75 72 20 62 61 73 65 20 61 72
          65 20 62 65 6c 6f 6e 67 20 74 6f 20 75 73 0a
      </block>
    </dump>

Regards,

	Tony Hansen
	[email-masked]

---

From: "Linus Walleij" <[email-masked]>
Date: Fri, 22 Oct 2004 17:24:02 +0200 (CEST)

Thanks for your comments Tony, clear as always.

> examples and consider what 'name="Code"' really adds. Make name optional

Whereas for a while I had rewritten the draft to make almost everything
optional, my fellow cowriters vote me down on that. The main reason
was that things not compulsory are seldom implemented.

Joachim and Patrik will surely comment on this at some length...

> present. Change "compulsory" to "optional".

Oops a leftover from the "everything optional" version. Good you saw it.

> I still feel that the length and checksum should be optional.

I could accept it, perhaps with the exception of checksum, which is
very important for verifying that you actually get what you request.
We must battle this one out i think...

> ordering. Possible values might be endness=big, endness=little, and

Hm. Will this not be apparent in the application context anyway?
What practical purpose does it serve?

> whitespace -- it's supposed need is covered by the * in hexbytes.

You're right. Fixing it.

> The word "A" is indented incorrectly.

Yep.

>     is only valid for the reason of improving the human readability of

Yep.

> leaving only address as #REQUIRED.

See above...

>           65 20 62 65 6c 6f 6e 67 20 74 6f 20 75 73 0a

Similar to the ones we saw before... Yes it is elegant, we must now
decide if it is practical. :-)

Linus

---

From: Joachim Strömbergson <[email-masked]>
Date: Thu, 28 Oct 2004 22:57:29 +0200

Aloha!

> Joachim and Patrik will surely comment on this at some length...

Yes. My experience with optional thingys is bad in two ways:

(1) They add loads of complexity for the parser/protocol FSM. Agreed 
this is usually not a problem if you work on 32-bit++ computer systems, 
but when worling in cramped embedded systems then protocols with lots of 
optionals is a big hassle. And the way I see it, SHF is a typical 
protocol to implement in this type of environment. I can clearly see 
applications for it there.

(2) Optionals don't get implemented. For many reasons (see (1) for one 
of them), people tend to implement what they MUST implement and leave 
the icing on the cake for some future day when they need it. This 
situation does not improve interoperability.

I can agree with you comment Tom that for dumps that have one block, the 
name _might_ not add much. OTOH, after seeing the talent and ingenuity 
people can show when naming files just to save a character, having a 
compulsory name-field might just be the thing needed to decipher a dump.

If it bothers you, just define the name to "".

> We must battle this one out i think...

The cheksum SHOULD/MUST be mandatory. Not only for parsing hassle 
reasons but more importantly that all other dump formats have had 
checksums and are used to check the integrity. I have a hard time to see 
people starting to use a new dump format that lacks this function.

Also, in general more and more protocols/formats contain integrity 
checks due to increasing need for them. A data storage/transport format 
without an integrity check in 2004 looks to me like an incomplete format.

Doing the check is not a big isse in terms of execution. The main 
problem is memory where SHA-1 eats up a bit more than 512 Bytes, but 
otherwise it can be very fast on even small 8-bit MCUs.

The argument for the length field is similar to the checksum: Cumbersome 
to have optionals, risks adding interoperability tests, other dump 
format contains basic sanity checks/info on the name.

> decide if it is practical. :-)

Add a checksum and length and it would be fine with me.

-- 
Med vänlig hälsning, Cheers!

Joachim Strömbergson
============================================================================
Joachim Strömbergson - ASIC designer, nice to *cute* animals.
     snail:                  phone:                     mail & web:
Östra Eriksbergsgatan 74  +46 31 - 12 14 01         [email-masked]
417 63 Göteborg           +46 733 75 97 02       www.ludd.luth.se/~watchman
============================================================================