The peer-to-peer filesystem
This is my first draft. The basic idea should be there...
(not yet finished, in draft stage)
Why?
There are lots of solutions right now but I don't find any of them suitable for my scenario. All I want is to share some of my files with the others over the LAN. I want to be able to read others' files aswell and I want this all to be accessible at the kernel level (as a filesystem) so I can use standard aplications to read the files directly from the source computer without the need to download it.
How?
My idea was to have a daemon running in the background (the server part) and the kernel module which will serve others' files (the client part). You can run only the server, only the client or both.
The client
When you launch the client, you specify the address of any server on the network. It asks it for two things. The files it offers and other servers it knows. If the client gets more server addresses to try, it keeps going until all of them have been asked for their files. At this moment, we know all the files on the network.
The server
The server generaly listens for client connections and answers their questions on offered files. It also keeps a database of other servers to give it to clients when they ask. The main task is to serve the files, of course.
Common namespace
The main purpose of this thing is to provide the users with a transparent filesystem without causing them headaches with complex configuration. Users don't need to know the exact address of the computer it's on so we won't tell them. The main idea is too keep a common namespace so there will be for example a dir "movies" with "KillBill" and "TheMatrix" in it. Who cares the "KillBill" in on computer A, while "TheMatrix" is on B?
Example
So, to be more specific. Let's simulate some communication...
- A launches a server offering "movies/KillBill"
- B launches a server offering "movies/TheMatrix"
- C launches a client telling it to connect to server A
- C asks A for its files and gets answer
- C asks A for other servers
- A answers there's also B which has some files
- C connects to B and ask for files
- B answers
- C asks B for other servers
- B aswers there's also A
- C already knows about A so it's done working
C now sees there's dir "movies" with "KillBill" and "TheMatrix" inside
C wants to watch "KillBill" so it asks A for a piece of the file
- A gives C the file (a block C asked for)
Implementation (current status)
The draft has been written a long time ago. Since then I've changed some concepts but essentially, the idea is the same. You can check my early development versions in my mercurial repo.