Subject: [6lowpan] Review of draft-bormann-6lowpan-ghc-04

From: Yoshihiro Ohba <[email-masked]>
Date: Mon, 21 May 2012 12:20:33 +0900

I have read draft-bormann-6lowpan-ghc-04.

The draft is well written, simple and useful, and I support the draft
to be an RFC.

I have one comment on code byte representation in the draft.
Please see below.

The code byte representation such as "0kkkkkkk" is confusing.
Which does it mean  1) or 2) below?

1) 00000000 (for k=0b0) or 01111111 (for k=0b1).

2) the least significant 7 bits of the code byte value has a
decimal value of k, where the right-most bit is the least significant bit.

If it means 2), then representation of code byte should be changed
to be more accurate.  Here is the suggested change for the code bytes
definition in section 2:

"
The most significant bit: The leftmost bit in the code byte.

c_i: The i-th significant bit of code byte
     (c_0 is the most significant bit)

sum_{i=x}^{y}: sum with increasing variable i from x up to y by 1.

* (wildcard bit): The bit can be 0 or 1.

The code bytes are defined as follows:

Code Byte Action                                        Argument
----------------------------------------------------------------
0*******  Append k = sum_{i=1}^{7} c_i*2^(7-i)          k bytes
          bytes of data to bytecode argument (k<96).    data

1000****  Append  sum_{i=4}^{7}{c_i*2^(7-i)}
          bytes of zeros.

10010000  STOP code

101*****  Set up extended arguments for a backreference:
          sa += sum_{i=4}^{7} c_i*2^(10-i);
          na += c_3*2^3

11******  Backreference:
          n = na + sum_{i=2}^{4} c_i*2^(4-i) +2;
          s = sum_{i=5}^{7} c_i*2^(7-i) + sa + n;
          append n bytes from previously output bytes,
          starting s bytes to the left of the current
          output pointer; set sa=0, na=0.
-----------------------------------------------------------------
"

Best Regards,
Yoshihiro Ohba