Subject: Re: iSCSI: Serial Number Arithmetic

From: "THALER,PAT (A-Roseville,ex1)" <[email-masked]>
Date: Thu, 4 Oct 2001 17:14:40 -0600

Julian,
 
The draft says serial number arithmetic as defined in RFC 1982 is to be used
for comparisons and arithmetic on CmdSN but but it uses operations which are
inconsistant with that statement.
 
2.2.2.1 (bottom half of page 26) re: the processing for MaxCmdSN and
ExpCmdSN - "and with a difference bounded by 2**31-1" should be deleted (3
places). The RFC 1982 Serial Number Arithmetic rules cover the meaning of
addition of a positive integer of limited range and comparison (<, > and =)
for serial numbers. "Only two operations are defined upon serial numbers,
addition of a positive integer of limited range, and comparison with another
serial number."  The operation difference is not defined for Serial
Numbers.<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" />

2.2.2.2 re: "difference is greater than 2**31-1" - The operation difference
is not defined for Serial number arithmetic. Even if it was defined as the
inverse of addition, addition is only defined for adding a value up to
2**31-1. Is the intent of the statement that it should cover only the value
where the results of StatSN > ExpStatSN and StatSN < ExpStatSN are undefined
or is the intent that it cover that value plus the values where ExpStat >
StatSN? The former doesn't seem useful and the latter seems rather severe.

Regards,
Pat Thaler

---

From: "Julian Satran" <[email-masked]>
Date: Sat, 6 Oct 2001 08:11:02 +0300

Pat - Comments in text - Thanks, Julo
_____________________
Julian,
 
The draft says serial number arithmetic as defined in RFC 1982 is to be 
used
for comparisons and arithmetic on CmdSN but but it uses operations which 
are
inconsistant with that statement.
 
2.2.2.1 (bottom half of page 26) re: the processing for MaxCmdSN and
ExpCmdSN - "and with a difference bounded by 2**31-1" should be deleted (3
places). The RFC 1982 Serial Number Arithmetic rules cover the meaning of
addition of a positive integer of limited range and comparison (<, > and 
=)
for serial numbers. "Only two operations are defined upon serial numbers,
addition of a positive integer of limited range, and comparison with 
another
serial number."  The operation difference is not defined for Serial
Numbers.<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" />

+++ will fix - 2**31-1 is implied by serial arithmetic+++

2.2.2.2 re: "difference is greater than 2**31-1" - The operation 
difference
is not defined for Serial number arithmetic. Even if it was defined as the
inverse of addition, addition is only defined for adding a value up to
2**31-1. Is the intent of the statement that it should cover only the 
value
where the results of StatSN > ExpStatSN and StatSN < ExpStatSN are 
undefined
or is the intent that it cover that value plus the values where ExpStat >
StatSN? The former doesn't seem useful and the latter seems rather severe.

Regards,
Pat Thaler
++++ StatSN follows regular mod(2**32) arithmetic. 2**31 is meant to state 
the limit at which recovery action becomes mandatory 
Here is a new 2.2.2.2 that perhaps states this clearer+++

1.1.1.1 Response/Status Numbering and Acknowledging

Responses in transit from the target to the initiator are numbered.  The 
StatSN (Status Sequence Number) is used for this purpose. StatSN is a 
counter maintained per connection.  ExpStatSN is used by the initiator to 
acknowledge status. The status sequence number space is that of 32bit 
integers and the arithmetic operations are the regular mod(2**32) 
arithmetic.

Status numbering starts with the Login response to the first Login request 
of the connection. The Login response includes an initial value for status 
numbering.

To enable command recovery the target MAY maintain enough state 
information to enable data and status recovery after a connection failure. 
 A target can discard all the state information maintained for recovery 
after the status delivery is acknowledged through ExpStatSN.

A large absolute difference between StatSN and ExpStatSN may indicate a 
failed connection. Initiators undertake recovery actions if the difference 
is greater than an implementation defined constant that SHALL NOT exceed 
2**31-1. 

Initiators and Targets MUST support the response-numbering scheme.

---

From: "THALER,PAT (A-Roseville,ex1)" <[email-masked]>
Date: Tue, 9 Oct 2001 15:01:30 -0600

Julian,

The suggested text:
"A large absolute difference between StatSN and ExpStatSN may indicate a
failed connection. Initiators undertake recovery actions if the difference
is greater than an implementation defined constant that SHALL NOT exceed
2**31-1."
is inconsistant with serial number arithmetic. 

Serial number arithmetic does not define a "difference" operation and is
very specific about the operations which are defined. If we wanted to use
difference to compare serial numbers, we could define "difference" in terms
of the already defined serial number arithmetic operations. For instance, we
could say something like the difference between A and B is equal to the
value D which satisfies the following:

 For A < B, A + D = B  or
 For A > B, B + A = D

So the difference of A and B is greater than D if 
  A < B and A + D < B  or
  A > B and B + D > A

However A < B and A > B are not defined for A and B when the integer value
of 
A equals the integer value of B plus 2**31-1 or vice versa. The comparison
may yield either result or it may yield an error. Therefore, this test
doesn't work for difference greater than 2**31-1.

Note also that there is exactly one value of StatSN for a given value of
ExpStatSN that exceeds the distance 2**31-1. Mandating recovery actions to
be initiated for only one value out of 2^32 possible values of StatSN
doesn't seem useful. The connection could be failed without us ever seeing
that particular value. If we want to initiate recovery for large differences
between StatSN and ExpStatSN it would make sense to do it for a lower value
of difference so that serial number arithmetic would still handle it. The
alternative is to delete the text and rely on other tests to initiate
recovery.
 
Regards,
Pat

-----Original Message-----
From: Julian Satran [mailto:[email-masked]]
Sent: Friday, October 05, 2001 10:11 PM
To: [email-masked]
Subject: Re: iSCSI: Serial Number Arithmetic

Regards,
Pat Thaler 

To enable command recovery the target MAY maintain enough state information
to enable data and status recovery after a connection failure.  A target can
discard all the state information maintained for recovery after the status
delivery is acknowledged through ExpStatSN.