Instant Messaging Protocol
This page is a draft for a complete messaging system in RetroShare.
The biggest difference between RetroShare and IRC/IM services is that, obviously, everything is decentralized. This brings some problems like synchronization of members list with dynamic groups or prevention of misbehaviour (like flooding) on public ChatRoom.
Because the word Channel is already used for video streaming, we are going to use the word ChatRoom instead.
The following concepts are here for the sake of completeness and discussing about them. They won't all be put into the final system.
Total public ChatRoom
A total public ChatRoom is a ChatRoom where everyone can talk with everyone.
B---A J---I |\ /| |\ /| | X | | X | |/ \| |/ \| C---D---E---F---G---H
In this configuration, a message broadcast by B to A,C,D is relayed through E,F,G and is broadcast to I,J,H.
There could be a limited number of "total" ChatRooms that would be broadcast by everyone, whether they participate or not.
Is there any use to that kind of design?
Friends public ChatRoom
That's what we have right now. Sending a message to that ChatRoom means we broadcast to every friend we have.
B---A---E |\ /| | X | |/ \| C---D
When A talks, he broadcasts to B,C,D,E. However when B talks, he broadcasts only to A,C,D.
Problem of the ghost
So right now the problem is that people seem to be talking to themselves, for instance E only knows what A is saying. Defnax suggests to extend a bit the message scope, so you can see friends of friends talking.
This means that A must broadcast the message to all his friends who are not part of that "circle of friends". A can have a list of the friends of his friends, so he knows who received the message and who didn't. But it can cause a problem in the following case:
,D. / | \ A--B--C \ | / `E‘
When E talks with his friends A,B,C, he broadcasts to them a message. So they have to send it to D, but who is going to send it? If we just "broadcast everywhere", D is going to receive three times the same message.
We can solve that by either: - add a unique tag to each message (for instance a 64bit timestamp) - make A,B,C elect a proxy who will be in charge of relaying messages to D
This is a simple form of channel, you pick up which of your friends will participate and the list won't change over time. Is it really useful?