Skip to content

Commit ec13d58

Browse files
committed
docs: add documentation for chatroom discovery
Change-Id: I8901010edf01a16557904a1701bf2b7d1fdeeb8a
1 parent 4212586 commit ec13d58

File tree

2 files changed

+206
-2
lines changed

2 files changed

+206
-2
lines changed

docs/DesignDoc.rst

-2
This file was deleted.

docs/design.rst

+206
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
Design Document
2+
===============
3+
4+
Chatroom Discovery
5+
-------------------
6+
7+
Function
8+
~~~~~~~~~
9+
10+
While running the ChronoChat application, a list of ongoing chatrooms
11+
is maintained with the basic chatroom information which can be
12+
presented to the user whenever he requests. The user can select to
13+
join a chatroom. The application will check if the user is allowed to
14+
join the chatroom. For chatrooms with hierarchical trust model, the
15+
user will join immediately. For chatroom with web of trust
16+
model, if one of the user's chatroom contact is in the chatroom, the
17+
user will send a request for invitation. Otherwise, the application
18+
will tell the user that he is disallowed to join in the chatroom.
19+
20+
Detailed Design
21+
~~~~~~~~~~~~~~~~
22+
23+
When a user starts the ChronoChat application, the application will
24+
begin to discover ongoing chatrooms. Each of the participants in a
25+
chatroom needs to maintain a list of all the participants in the
26+
chatroom for other users to query.
27+
28+
Two kinds of work need to be done during the chatroom discovery
29+
process.
30+
31+
Discovery
32+
+++++++++++++
33+
34+
A user sends a broadcast interest to query for all the ongoing
35+
chatrooms' information with all the existing chatroom in the exclude
36+
filter to enumerate all the existing chatrooms and avoid retrieving
37+
the same data packet from in-network caches. (There can be problems
38+
when there are so many chatrooms and the exclude filter exceeds the
39+
practical limit of NDN packet size. It is an open issue. We assume
40+
in this version that there are not so many chatrooms and we will try
41+
to solve the problem in later version.) No chatroom
42+
needs to be added when generating the list for the first time .
43+
44+
The name of the interest can be:
45+
46+
``/ndn/broadcast/chronochat/chatroom-list``
47+
48+
Every chatroom participant maintains an interest filter under the
49+
prefix:
50+
51+
``/ndn/broadcast/chronochat/chatroom-list``
52+
53+
When a participant in a chatroom receives the interest,
54+
the participant will check the exclude filter and send a data packet
55+
with all the information of the chatroom if the chatroom name is not
56+
in the exclude filter. There might be problems when there are too many
57+
participants in one chatroom which causes the Data packet to exceed
58+
the practical limit of NDN packet size. However, the participants'
59+
information is only used for a user to decide whether to join a
60+
chatroom. Therefore, in this case, we can only send the user
61+
information of a subset of participants.
62+
63+
The name of the data packet can be:
64+
65+
``/ndn/broadcast/chronochat/chatroom-list/chatroom-name``
66+
67+
Because users can obtain the chatroom name through the
68+
data name, the data packet that the information provider sends back
69+
only need to contains: the name of every participant and the
70+
chatroom's trust model.
71+
72+
For every participant, the data structure can be defined as:
73+
::
74+
75+
Participant := PARTICIPANT-TYPE TLV-LENGTH
76+
Name
77+
78+
For every chatroom,
79+
::
80+
81+
Chatroom := CHATROOM-TYPE TLV-LENGTH
82+
TrustModel
83+
Participant+
84+
85+
TrustModel:
86+
::
87+
88+
TrustModel := TRUST-MODEL-TYPE TLV-LENGTH
89+
nonNegativeInteger
90+
91+
TrustModel value:
92+
93+
+------------------+----------------+
94+
| TrustModel | Assigned value |
95+
+==================+================+
96+
| Hierarchical | 0 |
97+
+------------------+----------------+
98+
| Web of Trust | 1 |
99+
+------------------+----------------+
100+
101+
102+
TLV assignments:
103+
104+
+------------------+----------------+----------------------+
105+
| Type | Assigned value | Assigned value (hex) |
106+
+==================+================+======================+
107+
| PARTICIPANT-TYPE | 128 | 0x80 |
108+
+------------------+----------------+----------------------+
109+
| CHATROOM-TYPE | 129 | 0x81 |
110+
+------------------+----------------+----------------------+
111+
| TRUSTMODEL-TYPE | 130 | 0x82 |
112+
+------------------+----------------+----------------------+
113+
114+
115+
After receiving a data packet, the user puts the information of the chatroom into
116+
a list, while adding the data name into the interest's exclude
117+
filter and resend the interest. And he will receive more data
118+
packets with more chatrooms' information. When the interest expired
119+
which means that there is no other chatrooms, the list of chatrooms
120+
is completely generated.
121+
122+
After a specific time(discovery time), the discovery process will
123+
start again. Discovery time can be set as a default time(e.g. 10
124+
minutes) or set by the user.
125+
126+
127+
Refreshing
128+
+++++++++++++
129+
130+
To check the existence of an old chatroom, the user sends an interest
131+
with the name:
132+
133+
``/ndn/broadcast/chronochat/chatroom-list/chatroom-name``
134+
135+
and with MustBeFresh selector to be true which is used querying for
136+
sync data. If a participant of the certain chatroom receives the
137+
interest, he will send a data packet with the chatroom's
138+
information. Otherwise, if the chatroom
139+
no longer exists, there is no data packet sent back. Therefore, if
140+
receiving a data packet, it means that the specific chatroom still
141+
exists. If the interest expires, the chatroom no longer exists.
142+
143+
Security Consideration
144+
~~~~~~~~~~~~~~~~~~~~~~~
145+
146+
In the design above, it is very hard for the user to identify if the
147+
information he received is true. Therefore, although the data
148+
packet can be verified by hierarchical trust model or web of trust,
149+
it can only verify that the data is the person from whom the user
150+
intends to receive. If the data-sending-person intends to send some
151+
fake content in the data packet, there is no way the user can tell if
152+
the content is correct or not. Therefore, an attacker can attack the
153+
design by sending a great number of fake chatroom information to the
154+
network which may cause waste in traffic and even prevent a user to
155+
receive real chatrooms' information. However, there are not many people
156+
having the motivation to do the attack. Therefore, some assumptions
157+
are made below.
158+
159+
For every chatroom, it is assumed that every participant of a
160+
chatroom will not intend to send fake information to other users.
161+
162+
Under this assumption, all the data can be verified by the public key
163+
generated according to the corresponding trust model and the security can
164+
be guaranteed in this level.
165+
166+
Chatroom Discovery Protocol
167+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168+
169+
+ **Timing**
170+
171+
Two duration need to be defined when maintaining the list of
172+
chatroom:
173+
174+
- **Refreshing time:** For every chatroom there is a refreshing time
175+
which measures the frequency of checking the existence. The
176+
refreshing time can be defined in the data packet as FreshnessPeriod
177+
and after the time expired, the user will send a new interest to
178+
check the existence of the specific chatroom. And finally, the
179+
chatroom list changes according to the query result.
180+
181+
- **Discovery time:** Discovery time is defined by the user. When
182+
the timer expired, the user sends an interest to query for new
183+
chatrooms.
184+
185+
+ **Chatroom List Data Structure**
186+
187+
For every chatroom:
188+
189+
::
190+
191+
enum TrustModel { TRUST_MODEL_HIERARCHICAL, TRUST_MODEL_WEBOFTRUST };
192+
193+
struct Chatroom
194+
{
195+
str::string name;
196+
vector<Name> participants;
197+
TrustModel trustModel;
198+
vector<Name> contacts;
199+
};
200+
201+
202+
The whole chatroom list:
203+
204+
::
205+
206+
typedef vector<Chatroom> chatroomList;

0 commit comments

Comments
 (0)