Are RequestID's of SearchRequestMessage uniques ?

Are RequestID's of SearchRequestMessage uniques ?

by Gabriel Fleischer -
Number of replies: 4

I have an issue regarding the RequestID in the SearchAll :
In the pdf for the task 6, there is
"Each SearchRequestMessage must be provided with a unique RequestID, which will be the same in each responding SearchReplyMessage"

So my understanding is that we should generate a new id for each request message.
But then, when a request is received, it is sometimes forwarded. And for it to be understood by the sender, it needs to have the same RequestID. Therefore, the id is not unique per message.

So my question is : why not just having a single ID for the whole request ?

It makes more sense in my mind and there is already the PacketID the identify each message uniquely.
It is also easier to implement in my opinion. 

In reply to Gabriel Fleischer

Re: Are RequestID's of SearchRequestMessage uniques ?

by Yuchen Qian -
Yes, please generate a unique RequestID for each request message.

If a peer sends out multiple SearchRequestMessage with the same RequestID,
how does the peer keep track of which SearchReplyMessage corresponds to which
SearchRequestMessage?
In reply to Yuchen Qian

Re: Are RequestID's of SearchRequestMessage uniques ?

by Tianxiao Shen -
Does "each request message" mean the request with the same key, or the exact request packet sent to different peers? For example, in the following two cases, which one is expected? I think both can be valid, but the first one doesn't make much sense.



In reply to Yuchen Qian

Re: Are RequestID's of SearchRequestMessage uniques ?

by Wanhao Zhou -
For the SearchAll method, when the peer calls this method to initiate a query, it could generate only one RequestID and create the channel associated with that RequestID. Each neighbor will receive the packet with the same RequestID for the same query. When the peer processes the reply from neighbors, it only needs to put everything into one channel, since they belong to the same query.

In this case, does the peer still need to generate different RequestIDs for each neighbor? It is clear for the peer that this RequestID corresponds to one specific SearchAll query. However, if the peer generates different RequestIDs for different neighbors, then to receive all information belonging to the same query, it needs to listen to multiple channels.

Of course, if the peer calls SearchAll multiple times, the RequestID will be different.