Gossip protocol

In Consul, the gossip protocol is used to manage client and server communication through message broadcasting between multiple data centers and within the same data center. 

The gossip protocol in Consul is based on the Scalable Weakly-consistent Infection-style Process Group Membership (SWIM) protocol that was developed by Cornell University. Its implementation is done through a tool called Serf (https://www.serf.io/docs/internals/gossip.html), which is based on a modified SWIM protocol that has been enhanced by Hashicorp. This protocol is used to provide communication membership, failure detection, and event broadcasting. 

Gossip protocol communicates over UDP to build a membership list and to converge it as soon as possible. TCP is used to exchange full details about nodes. 

Consul uses two gossip protocols:

  • LAN gossip protocol
  • WAN gossip protocol

Within a data center, Consul agents enable the LAN gossip protocol across all servers and clients. Its primary functions are as follows:

  • Allowing clients to discover servers automatically.
  • Distributing failure detection communication across the entire cluster
  • Enabling reliable and fast broadcasting for events such as the election of a new leader

The WAN gossip protocol is deployed across all data centers. Only servers can take part in WAN gossip, regardless of which data center it has been configured in. When all the servers have been identified, the WAN gossip protocol does the following:

  • Allows servers to communicate with other servers across other data centers
  • Integrates failure detection, allowing the Consul agents to decommission servers or isolate data centers
  • Uses embedded libraries in Consul
The purpose of this book is not to delve into the intricate working of the RAFT, CAP and Gossip protocols. You can refer to the Further reading section for more information.

In this section, we have gone through the Consul tenants of a data center and client/server, as well as the protocols that are used in Consul. In the next section, we will go through the control and data plane concepts for the purpose of showing how Consul implements the service mesh.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.131.178