Subject: iSCSI: 12-97 Bit Rule

From: [email-masked]
Date: Wed, 12 Jun 2002 11:41:06 -0600

Julian,
 
The bit rule added to 12-97 (1.3.4 page 31) is inconsistant with the clauses above it: Word Rule,  Half-Word Rule and Byte Rule. 
 
It says "when the sequence of bits has a positional significance (e.g., a modulo 2 polynomial) then bit 7 of the lowest numbered byte is considered the most significant bit (2**n), followed by ...."
 
When bits represent a number, they have positional significance so that sentence applies. However, the other rules apply the opposite significance to the bits within each byte.
 
Also, note that bits represent polynomials at other times than the CRC such as for the purpose of authentication or encryption algorithms and those algorithms do not necessarily use the bit significance of the Bit Rule. The bit rule only applies to bit significance for CRC calculation. 
 
Bit Rule should be CRC Bit Rule and the associated text should make it clear that it only applies to the CRC calculation. Since it only applies there, it would be kinder to the reader to put the text in 11.1 rather than making the reader of 11.1 look nearly 200 pages back in the spec.
 
Regards,
Pat

---

From: "Julian Satran" <[email-masked]>
Date: Thu, 13 Jun 2002 22:39:35 +0300

Luben,

We are writing based on IETF rules. You are not reading a book - you are 
reading an IETF draft!

Julo

Luben Tuikov <[email-masked]>
Sent by: [email-masked]
06/13/2002 10:19 PM
Please respond to Luben Tuikov

        To:     Julian Satran/Haifa/IBM@IBMIL
        cc:     iSCSI <[email-masked]>
        Subject:        Re: iSCSI: 12-97 Bit Rule

Julian Satran wrote:
> 
> Luben,
> 
> The draft has figure that are an integral part of it.
> In every one of those bit 7 is the least significant.
> I don't know what your NORMALLY means.

Julian, any book you open on computer architecture,
assumes that bit 7 is more significant than bit 6,
simply because 2^7 > 2^6.

Stipulating that bit 7 is less significant than
bit 6, needs explicitly to be said so, NOT
inferred from ``figures in the text''.

Nevertheless, as you may have already noticed,
the algorithm which I sent you, is _independent_
of iSCSI's implication that bit 7 is less significant
than bit 6.

So, anywhich way you order the bits in the bytes
for the rest of the draft, the algoritm would
produce the same results, simply because
it explicitly mentions ordering in step 1 (and 2).

-- 
Luben

---

From: [email-masked]
Date: Thu, 13 Jun 2002 16:36:45 -0600

Thank you Julian, I am very happy with this text.
 
Regards,
Pat
-----Original Message-----
From: Julian Satran [mailto:[email-masked]]
Sent: Thursday, June 13, 2002 7:20 AM
To: [email-masked]
Cc: [email-masked]; [email-masked]
Subject: Re: iSCSI: 12-97 Bit Rule
Importance: High

I took out completely the bit rule. 
I reformulated the CRC text as: 

The CRC MUST be calculated by a method that produces the same results as the following process: 

 - The PDU bits are considered as the coefficients of a polyno-mial M(x) of degree n-1; bit 7 of the lowest numbered byte is considered the most significant bit (x^n-1), followed by bit 6 of the lowest numbered byte and through bit 0 of the high-est numbered byte (x^0). 

- The most significant 32 bits are complemented. 

- The polynomial is multiplied by x^32 then divided by G(x). The generator polynomial produces a remainder R(x) of degree <= 31. 

- The coefficients of R(x) are considered a 32 bit sequence. 

- The bit sequence is complemented and the result is the CRC. 

- the CRC bits are mapped into the digest word - the x^31 coef-ficient in bit 7 of the lowest numbered byte of the digest continuing to through the byte up to the x^24 coefficient in bit 0 of the lowest numbered byte, continuing with the x^23 coefficient in bit 7 of next byte through x^0 in bit 0 of the highest numbered byte. 

- Computing the CRC over any segment (data or header) extended to include the CRC built using the generator 0x11edc6f41 will get always the value 0x1c2d19ed as its final CRC. This value is given here in its polynomial form - i.e. not mapped as the digest word 

I hope you will find it less confusing 

Julo 

	[email-masked] 

06/12/2002 08:41 PM 
Please respond to pat_thaler 

        To:        Julian Satran/Haifa/IBM@IBMIL 
        cc:        [email-masked], [email-masked] 
        Subject:        iSCSI: 12-97 Bit Rule 

Julian, 

  

  
Regards, 
Pat

---

From: "Julian Satran" <[email-masked]>
Date: Fri, 14 Jun 2002 16:02:26 +0300

Excellent - we are now spending time in the Never-Endian space :-) (coined 
by a good friend) - I am deleting the whole thread on my mailer.
If you think I should pay attention to something please change the subject 
line.  I know ( an changed already) the remainder word. Thanks

Julo

[email-masked]
Sent by: [email-masked]
06/14/2002 02:38 AM
Please respond to pat_thaler

        To:     [email-masked]
        cc:     [email-masked]
        Subject:        RE: iSCSI: 12-97 Bit Rule

Luben,

If I ruled the world, I would number the least significant bit 0. I agree
that that is a more logical numbering. My second choice would be for the
whole world to use the same numbering even if it was different from that.
However, neither you nor I rule the world and IETF has chosen to number 
the
most significant bit 0 and the choices made by other organizations vary 
all
over the map and we get to flop and flip bits to match them to the
environment.

A convention that is used throughout the document (like the significance 
of
bits within a field) belongs at the front. That convention also gets
reinforced when one looks at other parts of the document like chapter 9.
That is why it is satisfactory for 1.3.1 through 1.3.3 to be at the front. 
A
detail that only applies one place like the different ordering of the bits
in the CRC calculation should be in the place where it is used. That is 
why
it wasn't good to have 11.1 reference 1.3.4 for how to order the bits in 
the
CRC calculation. This is just good editorial practice for building a 
usable
document.

On the particular text:
8) The message sent is P and appended at the end are the
   bit coefficients of CRC(x), with x^31 bit coefficient
   first, then x^30, etc.
the problem is that the x^31 bit doesn't go first when it is in the frame.
Also, bits can go through their entire existence without being sent in
serial order so nothing is first. Say which bit of the CRC goes into which
bit of the digest field and you are done.

Sincerely,
Pat

-----Original Message-----
From: Luben Tuikov [mailto:[email-masked]]
Sent: Thursday, June 13, 2002 4:13 PM
To: [email-masked]
Cc: [email-masked]; [email-masked]
Subject: Re: iSCSI: 12-97 Bit Rule

[email-masked] wrote:
>
> TCP/IP Illustrated numbers bits with bit 0 as the
> most significant. My books on Sonet number bits
> in a byte from 1 to 8. I guess you could argue
> these are not books on computer architecture, but
> the point is that not everyone numbers bits the
> same.

Uuuh, here we go again...

Yes, I can argue that those are NOT books
on computer architecure. Let me get home
I'll send you the titles/authors/ISBN
of a few books on Computer Architecture
which use the NATURAL bit ordering:

2^(x+1) > 2^x, x >= 0,
so it only _makes_sense_ to say that
bit x+1 is more significant than bit x.

Take the number 791, is the 2rd digit
more significant than the 1nd?
Well: 791 = 7*10^2 + 9*10^1 + 1*10^0.

> If you will read 1.3.1 through 1.3.3, they do
> explicitly state the significance of bits in
> iSCSI words, half-words and bytes.

Yep, and you were complaining that it was
200 pages away from 11.1 where the CRC
digest was --- or was that in a private
email? Trying to score points?

> Julian's new description is accurate and clear.

Are you sure? Are you really sure?

> Item 8 in your description is unclear and confusing
> because the bits do not "follow" each other in the
> order you state (and any viewing of bits in a message
> as a serial stream is entirely hypothetical).

Here is 8:

8) The message sent is P and appended at the end are the
   bit coefficients of CRC(x), with x^31 bit coefficient
   first, then x^30, etc.

That is after you send P, send CRC(x) as indicated.
What doesn't follow what?

Of course it is hypothetical...

Pat, let me ask you this: Is Mathematics hypothetical?

-- 
Luben

---

From: [email-masked]
Date: Fri, 14 Jun 2002 10:11:43 -0600

Hi Luben,

When Bill pointed out that the text of the spec required the receiver to
complement the remainder in order to obtain the magic number 0x1c2d19ed I
re-read the text and came to the same interpretation as Bill. With that
interpretation I do believe there is a problem in the text. I had previously
read the text and not seen a problem. 

The reason I thought it was my fault is that in recent private
correspondence between you, Pat and Julian I noticed that Pat had it correct
in one of her memos and I corrected her (erroneously) and nobody objected
and Julian changed the text and I, for one, felt comfortable with it. I know
that you also had it right (from my perspective) in your description but
what we are commenting on is what is in the text.

As Bill pointed out, the text defines, in its description of the CRC
proceesing at the transmitter, that the "CRC computation" includes bit
complementing.

Later, in the description of the receiver computation at the receiver, the
text refers to "CRC computation" once more. The reader has no clue that "CRC
computation" at the receiver should not include the complement operation if
he is to obtain the value 0x1c2d19ed. Thus I agree that hte text is
misleading. 

We need to make it explicit that the receiver follows a different algorithm
(no complementing) and expects 0x1c2d19ed or that it implements the same
algorithm and expects 0xe3d2e612.

Vince

|-----Original Message-----
|From: Luben Tuikov [mailto:[email-masked]]
|Sent: Thursday, June 13, 2002 5:43 PM
|To: CAVANNA,VICENTE V (A-Roseville,ex1)
|Cc: 'Bill Studenmund'; Julian Satran; THALER,PAT (A-Roseville,ex1);
[email-masked]
|Subject: Re: iSCSI: 12-97 Bit Rule
|
|
|"CAVANNA,VICENTE V (A-Roseville,ex1)" wrote:
|> 
|> I believe Bill is correct. The receiver, unlike the 
|transmitter, should not complement the remainder if he expects 
|to get 0x1c2d19ed.
|> I am afraid I may be reponsible for this mistake during an 
|email exchange I and others had with Julian recently. Julian 
|and those others must have trusted me a little too much. Sorry 
|Julian and others.
|
|Vince, you had it right. The text was mentioning that it was 
|the CRC that
|was the magic constant, and since the CRC is complemented in 
|the course of
|computation, one more was needed to get ``back'' to the remainder.
|
|Yes, Bill, your empirical conclusion is correct.
|
|The magic constant _is_ the pure remainder in polynomial
|form (0x1c2d19ed).
|
|The CRC is the complemented (and byte mirrored) remainder.
|
|That is: you have 2 algoritms, one to compute the pure
|remainder, and another to complement it (and maybe byte-mirror)
|and inject it at the end of the message to be sent.
|
|The sender does both algorithms (compute and inject),
|and the receiver does just the first (compute) and compares
|the result with the magic value.
|
|This has already been mentioned in a more formal (and
|maybe confusing :-)) manner in an email from me at the
|beginning of this thread (take a look at it, the one
|with bit-sequences).
|
|-- 
|Luben
|

---

From: [email-masked]
Date: Fri, 14 Jun 2002 10:07:30 -0600

All,
 
I am also done with this thread.
 
Regards,
Pat
-----Original Message-----
From: Julian Satran [mailto:[email-masked]]
Sent: Friday, June 14, 2002 6:02 AM
To: [email-masked]
Cc: [email-masked]; [email-masked]; [email-masked]
Subject: RE: iSCSI: 12-97 Bit Rule
Importance: High

Excellent - we are now spending time in the Never-Endian space :-) (coined by a good friend) - I am deleting the whole thread on my mailer. 
If you think I should pay attention to something please change the subject line.  I know ( an changed already) the remainder word. Thanks 

Julo 

	[email-masked] 

06/14/2002 02:38 AM 

        To:        [email-masked] 
        cc:        [email-masked] 

Luben,

If I ruled the world, I would number the least significant bit 0. I agree
that that is a more logical numbering. My second choice would be for the
whole world to use the same numbering even if it was different from that.
However, neither you nor I rule the world and IETF has chosen to number the
most significant bit 0 and the choices made by other organizations vary all
over the map and we get to flop and flip bits to match them to the
environment.

A convention that is used throughout the document (like the significance of
bits within a field) belongs at the front. That convention also gets
reinforced when one looks at other parts of the document like chapter 9.
That is why it is satisfactory for 1.3.1 through 1.3.3 to be at the front. A
detail that only applies one place like the different ordering of the bits
in the CRC calculation should be in the place where it is used. That is why
it wasn't good to have 11.1 reference 1.3.4 for how to order the bits in the
CRC calculation. This is just good editorial practice for building a usable
document.

On the particular text:

Sincerely,
Pat

-----Original Message-----
From: Luben Tuikov [mailto:[email-masked]]
Sent: Thursday, June 13, 2002 4:13 PM
To: [email-masked]
Cc: [email-masked]; [email-masked]
Subject: Re: iSCSI: 12-97 Bit Rule

2^(x+1) > 2^x, x >= 0,

Here is 8: 

-- 
Luben