Decentralized messenger and new generation telephone network
Every time when an article about a new messenger appears, the majority of Habr's users are interested in comments - centralized or decentralized IM?
If not, then - “everyone, guys, we differ”.
Many also mention Skype’s decentralization as an example, implying how it was until 2011.
Let us then, as a guide and introduction to the main idea of the article, consider what Skype was in its golden years, before buying Microsoft.
So, before you the structure of the decentralized peer-to-peer network Skype:
As we see, the clients are mainly connected through the so-called supernotes.
What are supernods and why did they need Skype?
How is pure P2P?
Why it is impossible to connect users directly with each other, since this is P2P?
In order to answer the question of why we needed supernotes, we need to remember what Skype was at that time.
And he was a “dialer” between users, first with audio calls, and then with video.
And here there was such a problem - the majority of users sat under NAT, and sometimes under double, triple NAT and in such conditions it is almost impossible to establish audio and, moreover, video communication, if you connect them directly.
Roughly speaking, these supermodes played the role of a kind of TURN server, which was engaged in signaling and traffic passing, “punching” NATY and connecting users.
Again - this is important primarily for audio and video calls.
The nodes were computers with white IP addresses, powerful enough, which sat on wide channels, as heavy media traffic went through them.
And they became nodes, completely unaware of this - users of the nodes sometimes only later discovered that their computer suddenly began to consume and give off a large amount of traffic.
It all looked like some kind of virus, which is not surprising - there was a perception that Skype was done by former hackers who had previously been made by pirated exchangers and this fit into their approach to solving problems.
But we will not delve into this topic.
Instead, let's see how it
works ... ordinary telephone: The above scheme describes the principle of the public telephone network - the so-called PSTN or the international term - PSTN (Public Switched Telephone Network).
And although this diagram shows what happened in the golden time of the PSTN (70s-80s-early 90s), everything works the same way now.
The technologies have changed, the giants (Alcatel, Nortel, etc.) have left, but the principle itself has remained.
Looking at the picture, you can find nodes - these are urban exchanges, to which certain subscribers are connected that have the prefixes of the corresponding exchanges and the supernods - long-distance exchanges.
All nodes (PBX) can communicate with each other, and subscribers with each other - only through such nodes.
It turns out that the PSTN network is also a decentralized P2P network, built approximately like Skype (or vice versa)?
Most likely it is.
And it is easy to see - for example, when a PBX has few channels of access to another urban PBX, then at rush hour (CNN is the highest load hour) it is difficult or impossible for subscribers of one PBX to reach another, but at the same time subscribers of the same the PBX can call each other without problems.
Now there is no such problem, because the stations are connected to each other by wide channels and everywhere is a figure, but until that time it had happened all the time.
So, we have determined that the modern telephone network (PSTN) is a decentralized P2P network.
A natural question arises - if it is P2P, can we become a member of this decentralized network (raise our server, etc.)?
What is needed for this and how is it done (suppose you have a lot of money and you are a relatively large company)?
- You need to become an operator of local or zonal or long-distance communication.
To do this, you need to obtain the appropriate license from the regulator, although in some countries this is not required.
For simplicity, consider an example that you want to become a local service provider - i.e. raise a simple city node.
- You need to get a pool of telephone numbers geographically related to the place where you put your node (telephone exchange).
This pool also provides a regulator.
“... There is an ITU-T recommendation numbered E.164, defining a common international telecommunication numbering plan used in public switched telephone networks and some other networks. Consonant E.164 numbers can have a maximum of 15 digits and are usually written with a “+” prefix.
The Russian "Rules for the provision of telephone services"  define the subscriber number as "allocated to the subscriber when entering into an agreement on the provision of telephone services, the number by which the subscriber device connected to the telephone network is identified when other subscriber devices connect to it". In Russia, the regulator in the field of telephone numbers is the Ministry of Communications (in particular, the Federal Communications Agency) ... ”
- After receiving a pool of numbers, you must build and commission a PSTN node. We omit all the details that you need to have SORM and so on.
These are all organizational issues, we will not dwell on them in detail, especially since they are also different in different countries.
Instead, we briefly denote the technical points.
Firstly, now all operators, both large and small, make stations on VOIP equipment.
Those. either an already specialized iron station with VOIP is bought or a software package is made - a server with a specialized sofstvych5 class like Broadcom or even an Asterisk doped up to class 5, etc.
Here, too, everything is simple - either VOIP gateways with FXS ports are installed, in which subscribers can connect regular telephones or IP phones, a mini IP PBX for business users or soft clients (for example, call centers), etc.
Some companies connect users using virtual IP PBXs, because VATS - but the principle is the same.
Next, you need to register your phone pool with all the participants of this common network - for this every regulator or dominant operator sends an official letter to each owner of another station (node) in this common network - make a route with such and such numbers to such and such PBX of our new colleague.
And accordingly, you should in your station (node) register the outgoing routes according to certain rules.
Even in the Russian Federation, there is a rule that when you connect a subscriber, you must take passport data from him, a residence permit, etc.
In principle, about everything, too, do mobile operators.
And then the business part begins - you earn money by selling such numbers for a monthly fee and taking inter-mountain or international payments, which you, in turn, buy from your superior node, etc.
Why are we telling all this in such detail?
The fact is that we have a platform (M1 Messenger) , which, on the one hand, is a decentralized messenger, and on the other hand, can be defined as a new generation telephone network.
And the most important thing is that to add a node to such a network, neither a license, nor obtaining E164 numbers, nor any other permissions are needed, because there is no access to the PSTN.
Those. You yourself can be added to such a network absolutely at any time, independently and become an independent node - a node in the M1 Messenger network.
You can easily add your IP stations, small office and large provider providers to this platform - and all stations can communicate with each other, as well as with ordinary messenger users:
This versatility is due to the fact that the M1 Messenger platform supports the SIP protocol.
Each user receives a login when registering, as well as a SIP URI, i.e., receives 2 identifiers at once.
Thanks to the login, interaction occurs within the messenger users and outgoing communications to the outside, i.e. To connected IP PBXs, and thanks to the SIP URI, each user can be available for incoming calls from any SIP compatible network.
Here IP PBX under the letters A, B and C are connected to the platform via a SIP trunk, i.e., these PBXs are registered on the platform.
The number of simultaneous calls in such a trunk, as well as the number of trunks themselves per IP PBX is not limited.
Thus, users, for example, IP PBX under the letter A can have their own internal numbering, and for calls to IP PBXs under the letters B and C, for example, use their SIP URI.
Incoming calls from other PBXs or from the messenger can be processed by such PBXs in two different ways:
- As a single number (serial number) that goes, for example, to standard IVR and further along the established algorithm.
- Each user within such a third-party IP PBX can be assigned its own trunk and routed by means of PBX.
Thus, each PBX user can receive a call intended only for him from users of the platform.
Also, due to the fact that all users of the messengerreceive immediately and SIP URI, you can easily get incoming numbers from the providers of virtual numbers (DID).
The number of incoming numbers associated with the login is also not limited.
Currently, there are almost no messengers that connect equipment to their network.
Last was Skype.
For example, in 2012, a DECT phone with Skype support was announced:
Prior to this, a desktop phone with Skype support was sold:
About a year ago, Skype announced that it would not support such phones and that all users who had bought them had turned into a pumpkin.
In contrast, to the M1 Messenger platformabsolutely any IP phone (including a videophone) or a VOIP gateway can be connected:
This is not a concept, it all works.
Thus, any IP PBX can be connected to the platform, as well as any VOIP equipment.
To connect, you just need to download the messenger, register and enter the SIP equipment tab:
Using 3 parameters - login, password and server address:
you can connect either IP PBX or any VOIP hardware.
And using SIP URI, digital firstname.lastname@example.org, any user or connected IP PBX or connected equipment can receive VOIP calls from any VOIP network, even if this network is not connected to the M1 platform (for example, virtual DID number providers, etc.). d.)
Thus, a network is obtained that is not subject to regulation from any side, but at the same time can be connected to already existing IP PBXs, and no matter what equipment is used - either a small Atseris or a box PBX or a large station of a large operator.
And the most interesting is that calls in such a network are not charged in any way, and are carried out directly, bypassing the officially issued phone numbers.
It turns out a network for communication, which does not depend on anyone, and which is open to the connection of any user - be it individuals, companies with their users or large operators.
No regulators, no SORMs, no e164 phone numbers that you may lose or may have taken from you.
And no monthly fees and fees for minutes of conversation.