JGroups – pt 2 ~ Protocols review

All

Continuing on JGroups

   Message

                        [destination][headers] [payload]

    Protocols

The protocols always are from the org.jgroups.protocolshot

<config xmlns="urn:org:jgroups"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd">
    <UDP
         mcast_port="${jgroups.udp.mcast_port:45588}"
         ip_ttl="4"
         max_bundle_size="64K"
         enable_diagnostics="true"
         thread_pool.min_threads="2"
         thread_pool.max_threads="8"
         thread_pool.keep_alive_time="5000" />

    <PING />
    <MERGE3 max_interval="30000" min_interval="10000"/>
    <FD_SOCK/>
    <FD_ALL/>
    <VERIFY_SUSPECT timeout="1500"  />
    <pbcast.NAKACK2 xmit_interval="500" />
    <UNICAST3 xmit_interval="500" />
    <pbcast.STABLE desired_avg_gossip="50000"
                   max_bytes="4M"/>
    <pbcast.GMS print_local_addr="true" join_timeout="2000"/>
    <UFC max_credits="2M"
         min_threshold="0.4"/>
    <MFC max_credits="2M"
         min_threshold="0.4"/>
    <FRAG2 frag_size="60K"  />
</config>

   UDP

mcast_port specifies the multicast port number. If omitted, the default is 45566

ip_ttl: time to live IP Multicast packets

   PING

       For the cluster maintain a list of current member nodes at all times.

   MERGE3

This service enables the node coordinators in partitions to put the cluster back again in case of failure and form a single cluster back again.

   FD SOCK

Fail detection protocol based on sockets.

   FD ALL

Failure detection protocol based on simple heartbeat protocol.

  VERIFY_SUSPECT

  pbcast.NAKACK2

Reliable delivery protocol: NAKACK protocol is used for multicast messages, which are numbered in a sequence. In case the receiver misses one message, he can ask to re-transmit it.

   UNICAST3

Reliable delivery protocol: Unicast is not necessary in case of TCP.

   pbcast.STABLE

Is responsible to calculate the stable messages (the ones delivered by members), then send <STABLE> events so then the GC can act (with the NAKACK) – the GC applies on the messages we are accumulating  – regulated either by the <> or <>

• desired_avg_gossip
     specifies intervals (in milliseconds) of garbage collection
• max_bytes
     specifies the maximum number of bytes received before the cluster

   pbcast.GMS

Group membership protocol. Handles joins/leaves/crashes (suspicions) and emits new views accordingly.

   UFC

Unified Flow Control protocol based on credit system in which sender has a limited amount implemented using protected java.util.Map<Address,FlowControl.Credit>

   MFC

Another Flow Control protocol based on credit system in which sender has a limited amount  but implemented using protected CreditMap

   FRAG2

This protocol will fragment a message, on this case any that is larger than <60K>

Reading the Protocols

The reading is from top to down so the stack will be built from UDP to FRAG2 protocols  (bottom up) and each protocol is implemented a independent Java class.

Although very outdated, this guide comes in hand to understand it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s