2020-03-02-types-of-networks.html (5439B) - raw
1 <!-- title: Centralized, decentralized and distributed networks --> 2 <!-- slug: types-of-networks --> 3 <!-- categories: Miscellany --> 4 <!-- date: 2020-03-02T00:00:00Z --> 5 6 <p> 7 When we are trying to understand a communications network, having an approximate image of how the 8 network operates can be very valuable. Do all communications go through the same node? Is there a 9 central authority? Can nodes communicate directly with each other? Depending on how the network 10 operates, we can classify it as centralized, decentralized or distributed.</p> 11 <!-- /p --> 12 13 <h2>Centralized networks</h2> 14 15 <p> 16 When all the nodes on a network are connected to one unique node, we call it a centralized 17 network. All communications happen through that one "master" node. An example of a centralized 18 network is the one created by most instant messengers, for example <a href="https://signal.org/">Signal</a>. 19 Every time we send a message, it goes to Signal's servers and it is then sent to its destination. 20 This creates a network similar to the following, where everyone is connected to one server (or 21 cluster of servers).</p> 22 <!-- /p --> 23 24 <p style="text-align: center"><svg class="basic-svg" viewBox="0 0 633.9 523.77"><use xlink:href="/img/blog/2020/03/types-of-networks/centralized-network.svg#l"></use></svg></p> 25 26 <p> 27 Having everything go through the same computer has its pros and cons. On the one hand, it makes 28 deployment easier and faster, data consistency is easy to maintain and it is an efficient network 29 (if, for instance, you need to gather data, it is all in one server). On the other hand, it 30 creates a single point of failure for the whole network (which also facilitates censorship) and it 31 makes it easier to abuse users (as the central server has a monopoly over the network)<sup 32 id="fnref1"><a href="#fn1">1</a></sup>. This type of network also makes escalation much harder, as 33 the resources are provided by one sole party.</p> 34 <!-- /p --> 35 36 <h2>Decentralized networks</h2> 37 38 <p> 39 Decentralized networks don't have one central node, but multiple of them, which are connected 40 between themselves. When clients connect to the network, their communications go through their 41 "master" node, to the destination's "master" node, and finally to the destination. An example of a 42 decentralized network is <a href="https://en.wikipedia.org/wiki/Email">e-mail</a>. When Alice 43 (<code>alice@example.com</code>) wants to send an e-mail to Bob (<code>bob@example.org</code>), 44 Alice's computer sends the message to <code>example.com</code>'s server. From there, it is sent to 45 <code>example.org</code>, and finally <code>example.org</code> sends it to Bob's computer. A 46 decentralized network looks similar to the following network.</p> 47 <!-- /p --> 48 49 <p style="text-align: center"><svg class="basic-svg" viewBox="0 0 633.9 523.77"><use xlink:href="/img/blog/2020/03/types-of-networks/decentralized-network.svg#l"></use></svg></p> 50 51 <p> 52 Decentralized networks solve some of the centralization problems: no entity has control over the 53 whole network anymore, allowing users to choose between different providers and switch servers (or 54 self-host) if one starts abusing its power. If a server is down, others can still communicate 55 ordinarily, which also makes censorship more difficult. Decentralized networks are also easier to 56 escalate. Nonetheless, this type of network requires more infrastructure and can become less 57 efficient for certain operations (like global tasks). It is also harder to deploy updates, as 58 servers might update at different times, when each administrator decides to do so.</p> 59 <!-- /p --> 60 61 <h2>Distributed networks</h2> 62 63 <p> 64 Distributed networks only have one type of node, and they are connected with each other (although 65 not necessarily all with all). This creates a very robust network where all nodes are client and 66 server at the same time. The <a href="https://en.wikipedia.org/wiki/BitTorrent">BitTorrent 67 protocol</a> is an example of a protocol that works with a distributed network. The following 68 image shows what a distributed network looks like.</p> 69 <!-- /p --> 70 71 <p style="text-align: center"><svg class="basic-svg" viewBox="0 0 633.9 523.77"><use xlink:href="/img/blog/2020/03/types-of-networks/distributed-network.svg#l"></use></svg></p> 72 73 <p> 74 Because there are no central servers, distributed networks easily circumvent censorship and are 75 practically immune to denial-of-service attacks. Since every user is client and server at the same 76 time, these networks are highly scalable without the need for additional central resources. 77 However, distributed networks make deployment a lot harder.</p> 78 <!-- /p --> 79 80 <h2>Final comments</h2> 81 82 <p> 83 I hope this post has clarified the main differences between centralized, decentralized and 84 distributed networks as well as showed some applications for each of them. In the future, I might 85 refer to this post when talking about services and the type of network they rely on.</p> 86 <!-- /p --> 87 88 <!-- footnotes --> 89 <hr /> 90 91 <ol> 92 <li id="fn1"> 93 This is pretty usual. Whether it is services selling user's data, censoring content, a sudden 94 rise of prices, etc., when dealing with centralized services, users don't have much choice but 95 to leave the network completely (which might not be affordable). <a href="#fnref1" title="Jump 96 back to footnote 1 in the text">↩</a></li> 97 <!-- /li --> 98 </ol>