V
V
Vitaly Barilko2015-07-17 17:58:23
Communication protocols
Vitaly Barilko, 2015-07-17 17:58:23

TeamViewer and Ammyy admin. How do these programs work?

Good afternoon.
I became interested in the question of the work of programs of this class. And in general, it is interesting how you can organize the work of a similar service.
How do I understand this and think how it is implemented in the very first approximation?
The whole complex may consist of the following main programs:

  1. Client (which we all download, run and use)
  2. Authorization servers (contains a database of clients, a list of connection servers, statistics and other additional information)
  3. Connection Servers

The algorithm is probably something like this:
  1. "Client A" at startup tries to contact any of the available authorization servers (the list of servers is fixed and hard-coded, for example, ammyy responds to rl.ammyy.com , there may be some others), which fixes the fact of using licensing, fixes that the client connected, fixes additional. client settings.
  2. Next, the authorization server searches for the least loaded connection server from the list of servers in its database, taking into account the capacity of each server and the number of users already connected to them.
  3. Finds the least loaded and tells the client which server will be the connection server for him personally. Let's say it's "Connection Server A".
  4. "Client A" establishes a permanent connection with "Connection Server A".
  5. Similar actions are performed with "Client B" and "Connection Server B" is located and connected to it.
  6. "Client A" wants to connect to "Client B". To do this, the authorization server is again contacted and the authorization server is looking for which server "Client B" is connected to. "Client A" receives information about "Connection Server B"
  7. "Client A" sends "Connection Server B" saying that I want to connect to you, to "Client B", which is located at your place.
  8. "Connection Server B", if it finds such a connection, connects "Client A" to itself and redirects all packets of "Client A" to "Client B" and vice versa (?).
  9. After the session ends, "Client A" closes the connection to "Connection Server B".

This scheme of work will allow you to quickly increase the number of connection servers.
Again, I think in the very first approximation, it can work like this. Although, of course, some points may be incorrect and / or missing (for example, registering a connection / disconnection between A and B on the authorization server in the database).
Actually, now the questions are:
1) Is this the scheme of work?
2) How do you ensure that authorization servers have one database? After all, if the authorization server falls off, then the whole scheme will not work. In this regard, Connection Servers are secondary in terms of reliable operation, since if they are not available, then authorization servers simply will not connect to them, and if one of the connection servers falls off during operation, then the clients of this server will again contact the authorization server and it will give them new connection servers.
3) What can be the capacity of authorization servers and connection servers?
4) Can the clients themselves be used as connection servers, according to the principle of torrents?
5) On what can each of the service programs be written?
In general, an interesting topic, of course ...
What do you think?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2015-07-17
@Diversus

An authorization server is needed exclusively for paying customers, to provide additional functions. There is a small load.
A connection server is not needed, because the task is not to connect someone to someone, but to transfer information about where to connect.
If you connect by teamweaver ID, then the teamweaver server will tell you that the ID where you are connecting is IP abcd port x
If a person is sitting at nat, the teamweaver server will simply tell you the IP of this person's router with the port that is mapped on the router for teamweaver.
A good article to learn more about everything that is higher on Habré:
habrahabr.ru/post/129347

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question