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