Professional Documents
Culture Documents
TH Iet Keung Dung Chat
TH Iet Keung Dung Chat
1 2
3 4
5 6
1
Message Types Message Types
Fixed-length header Variable-length header
Fast process, low overhead Flexbile
Large overhead
Good for lower layers’ protocol
Tag header
Not flexible XML-based
0 128
<messageID>000</messageID><name>xxx</named>
<passwd>yyy</passwd>
Message ID Option
Untagged header
User name Using special characters to divide keywords
E.g. \r\n in SMTP
Password messageID:000\r\nname:xxx\r\npasswd:yyy
7 8
9 10
11 12
2
Reliability Security
Authentication: do we need to know who each user
Does a user need to know (reliably) if all the is?
other users receives a message? Login based on user name and password is required
Password should be encrypted
What happens if a message is lost?
Authorization: do some users have more privileges
resend? than others?
application level or at user level? Who will be group administrators?
What happens when a user quits? Privacy:
Do messages need to be secure?
Does everyone else need to know?
Functionality vs. efficiency
What happens when a user PC is down? Do we need to make sure messages cannot be forged?
13 14
Client/Server Client/Server
Client Server is well known.
Client Client
Life is easier for clients - don’t need to know
about all other clients.
Limited number of clients?
Client Server Client
Security is centralized.
Server might get overloaded?
Client
Client Over 10000 connections at a time
Client
15 16
17 18
3
Peer-to-Peer Service Architecture Peer-to-Peer
Client
Client Client
No server, no client
We are equivalent!
No server overload
Client Client
No single point of failure
But many points of failure!
Can deploy in a large scale
Cheap???
Client Client
Client
19 20
21 22
23 24
4
Hybrid Hybrid (2)
Clients connect to server and gather control Still exit a single point of failure
information: A secondary server may be a solution
Login
Server load is reduced
List of other clients.
List of chat groups.
Messages are sent directly (not through
server).
Could use connectionless protocol (UDP or
transaction based TCP).
How to authenticate between users?
25 26
27 28
29 30