Distributed Systems Communication

Peter O
4 min readSep 2, 2021

--

Imagine on a vacation you met a special person, you both enjoyed similar things. You enjoy each other’s company so you decided to keep in touch while you both moved back home. You decided that rather than using just a telephone you want to have a dynamic interaction to keep the spark going. You both decided to chat on WhatsApp, occasionally video call via Facetime, and when important things needed to get done you both send an Email with an attachment. All these activities function under a distributed network made of physical computers, virtual machines, and programmable protocols. So how are you able to accomplish all this in milliseconds while in your home in Springfield Michigan, far from your partner in the Prague Czech Republic?

Thanks to a distributed communication network that sends messages in the form of an eclectic pulse, dedicated as a byte of data through a wire that is distributed around the world. But in this case, your communication is transferred from your home in Springfield Michigan to the Prague Czech Republic in almost real-time. This distributed communication network is also described as a Distributed System.

A Distributed System communicates messages sent through a network of switching nodes to an end-point. The nodes would be computers instead of the telephone in this case, controlled by switches so that they would be intelligent enough to decide the best route for sending each message.

In a Distributed System many nodes and connections create redundancy so that messages could arrive through many different paths. Messages are broken up into blocks of uniform length to make transmissions simpler and more efficient. This idea of message block switching also referred to as packet switching, is the basic design of networks described as the Internet.

When you contact a modern web service such as Google or WhatsApp, you are not just interacting with a single machine, behind the scenes are complex services built from a large collection of machines, each of which cooperates to provide the particular service of the site or application.

A distributed system is an ensemble of physical machines that communicate over network links, composed of software processes that communicate via inter-process communication (IPC) mechanisms like HTTP. From an implementation perspective, a distributed system is a set of loosely coupled components that can be deployed and scaled independently called services.

A service implements one specific part of the overall system’s capabilities. A service interface is used to communicate with the outside world.

An “inbound” interface defines the operations that a service offers to its clients. In contrast, an outbound interface defines operations that the service uses to communicate with external services, like data stores, messaging services, and many others.

An inbound adapter is part of the device’s Application Programming Interface (APl); it handles the requests received from an IPC mechanism, like HTTP. by invoking operation communication between processes over the network, an inter-process communication (IPC).

Network protocols are arranged in a stack, where each layer builds on the abstraction provided by the layer below. Lower layers are closer to the hardware. When a process sends data to another through the network, it moves through the stack from the top layer to the bottom one and vice-versa on the other end.

The below diagram describes the stack layering hierarchy

Application Layer

The application layer defines high-level communication protocols, like HTTP or DNS. Typically your code will target this level of ab-straction.

Transport Layer

The transport layer transmits data between two processes using port numbers to address the processes on either end. The most important protocol in this layer is the Transmission Control

Protocol (TCP). TCP is a transport-layer protocol that exposes a reliable communication channel between two processes on top of IP. TCP guarantees that a stream of bytes arrives in order, without any gaps, duplication or corruption.

Ethernet/Internet Layer

The Ethernet/internet layer uses addresses to route packets from one machine. The Internet Protocol (IP) is the core protocol of this layer, which delivers packets on a best-effort basis. Routers operate at this layer and forward IP packets based on their destination IP address.

The link layer consists of network protocols that operate on local network links, like Ethernet or Wi-Fi, and provides an interface to the underlying network hardware. Switches operate at this layer and forward Ethernet packets based on their destination Address, called a MAC address.

Abstraction of Stack Levels

  1. High-level protocols — provides dialog control and synchronization — Presentation — resolves differences in formats among sites and contain a set of standard app
  2. Transport protocols(TCP) — Transfer messages between clients, including breaking them into packets
  3. Lower-level protocols — Physical — deals with mechanical and electrical details — groups bits into frames and ensure that they are correctly received. It describes how packet are routed through the IP address

In conclusion, your message transmission, that seems in real time, is transmitted through a process that consists of abstract programable protocols, virtual machines as well as physical computers through a network with a port address over a physical network. These processes are enabled by Distributed Systems.

--

--