Creating a simple P2P search method using SIP subscribe/notify

383 views Asked by At

I'm currently developing a prototype for a P2P SIP-based media sharing application for an assignment in school.

I have to implement a simple search function using SIP Subscribe/Notify. I'm trying to understand how Subscribe/Notify should be used and how I can use it myself for this search function.

The network is designed such as each node has X number of neighbors, so to make it easy I planned to use Query flooding, where if node A wants to search for some file, he sends a query to all his neighbors, who checks if they have the file and either sends a query to all their neighbors or answers back to node A, etc. The problem here is how to use the Subscribe/Notify requests. I'm using JAIN-SIP for java if that matters.

1

There are 1 answers

0
anony115511 On

So I managed to do it in the end. What I did was to use query flooding as mentioned in the question. I sent a query to my neighbors, using SIP subscribe containing my search string. All neighbors then searches localy for the file and either subscribes to their neighbors if the file is not find, or notify back if the file is found. This continues until the file is either found or all the whole network has been searched.