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