Subject: Re: [Ips]Invalid key

From: Mike Ko <[email-masked]>
Date: Fri, 20 May 2005 09:57:52 -0700

I wouldn't jump to the conclusion that if a key is NotUnderstood, that the 
recommended course of action is to close the connection.  In iSER (iSCSI 
Extensions for RDMA), the initiator (or target) offers the key 
RDMAExtensions to determine if the target (or initiator) can operate in 
iSER mode.  If the response is NotUnderstood, then the connection remains 
in iSCSI mode.  This is not a protocol error and closing the connection in 
this case would be inappropriate.

Mike
Sent by:        [email-masked]
To:     "sundara senthil" <[email-masked]>
cc:     [email-masked] 
Subject:        Re: [Ips]Invalid key

On May 19, 2005, at 4:56 AM, sundara senthil wrote:

> Hi All,
>
>  According to the iscsi RFC 3720, mentioned in the section  5.2
>
> "Any key not understood by the acceptor may be ignored by the
> acceptor without affecting the basic function. However, the answer
> for a key not understood MUST be key=NotUnderstood."
>
> I would like to know that if initiator sends any invalid key name and
> a value
> pair to the iscsi target, should the target  ignore the key pair
> without responding or target should respond as invalid
> key=NotUnderstood.

The acceptor (the target could have made the initial offer, after all)
must reply "invalid_key-NotUnderstood".

Note however that we are assuming the unknown key came with some sort
of conceivably reasonable initial offer. If the initial offer were
something like "Reject", "Irrelevant", or "NotUnderstood", then there
is a protocol error. I'd recommend closing the connection.

Take care,

Bill

_______________________________________________
Ips mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/ips

_______________________________________________
Ips mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/ips

---

From: William Studenmund <[email-masked]>
Date: Fri, 20 May 2005 14:00:07 -0700

> this case would be inappropriate.

I'm sorry, I wasn't clear.

If you get a key you don't understand AND what should be an initial 
offer is instead "Reject", "NotUnderstood" or "Irrelevant" (a response 
to an offer that you didn't make as you don't understand the key), THEN 
you should consider it a protocol error and close the connection.

As an RDMA-aware initiator or target (the one that made the offer) will 
understand the key, it will not fall into the case above. It will 
merely find one of its offers was not understood. This latter behavior 
is the point of "NotUnderstood" and I agree we should NOT close the 
connection at that point.

The whole point here is that if a key somehow gets in the negotiation 
stream that is not understood by either side, then the connection 
should close. This scenario came up once when an initiator was creating 
malformed offers, and both sides kept responding, "NotUnderstood", to 
each other.

So to reply to the original question, if you get a key you don't 
understand, you should look at the value passed with the key. If the 
value is "Reject", "Irrelevant", or "NotUnderstood", then something bad 
happened. If the value is ANYTHING else, then you MUST reply 
"NotUnderstood" and otherwise ignore the occurrence. That means that if 
everything else looks fine in the negotiations, you transition along as 
normal.

Take care,

Bill

---

From: "Faraz Ahmed" <[email-masked]>
Date: Sun, 29 May 2005 01:10:28 -0700

Hi all;
      I dont know whether this should be discussed here. As part of
implementing a iSCSI target, we often need to search for a particular Text
key. Here i have discovered a hashing fucntion which perfectly hashes all
the 23 iSCSI text key.
     The Bernsteins Hash Function wiht the MAGIC value of 34043539 hashes
all the keys perfectly.

#define FARAZ_HASH_VAL 34043539
#define PR_COL  0
#define IDX_COL 1
char __key_hash[MAX_KEYS][2];

/*
 * Berstein Hash Fucntion for strings. Hashes all the keys uniquely
 */
inline int __djb2_hash(char *str_orig)
{
unsigned long hash = FARAZ_HASH_VAL;
char *str = str_orig;
int c;
 while ((c=*str++)!='\0')
   hash = ((hash << 5) + hash) + c; /* hash * 33 + c */

 iSCSIDEBUGINFO("__djb2_hash(%s)=%d",str_orig,(int)hash%MAX_KEYS);

 return hash%MAX_KEYS;
}