JGroups Protocol PING: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
m (Ovidiu moved page JGroups Protocols PING to JGroups Protocol PING without leaving a redirect)
No edit summary
Line 2: Line 2:


* [[JGroups#Protocols|JGroups]]
* [[JGroups#Protocols|JGroups]]
!!!JGroups PING (Discovery) Protocol
<font color=red>
!!!TODO
* Next time I dive into this, come up with a full explanation for 'num_initial_members' below.
</font>
!!!External
* JGroups Wiki [http://community.jboss.org/wiki/JGroupsPING]
* JGroups Manual [http://www.jgroups.org/manual/html/protlist.html#d0e4501]
!!!Internal
|[MPING]
|[TCPPING]
|[MERGE2]
!!!Overview
PING performs the initial (dirty) discovery of members, by multicasting PING request to an IP multicast address (or connecting to a GossipRouter). The PING request is a Message with a {{PingHeader.GET_MBRS_REQ}} header. Each member replies with a (C, A) packet where C = coordinator address and A its own address. After a set number of milliseconds ('{{timeout}}') or replies ('{{num_initial_members}}'), the joiner determines the coordinator from responses, and sends a JOIN to it. The JOIN request is handled by the [GMS] layer. If nobody responds, the joiner assumes it's the first member of a group.
!!!Sample Configuration
{{{
    <PING timeout="2000" num_initial_members="3"/>
   
}}}
!!!Difference between PING and MPING
MPING, unlike PING, uses its own IP multicast socket to send discovery requests. PING simply sends a discover event down the stack to be sent by the underlying transport protocol.
=Periodic GET_MBRS_REQ Requests=
The super-type Discovery protocol is in charge with sending GET_MBRS_REQ (get members) requests upon receiving a FIND_INITIAL_MBRS event. FIND_INITIAL_MBRS events are sent either by the [GMS] protocol, when initializing, or periodically by the FindSubgroupsTask of the [MERGE2] protocol.
The discovery requests are generated by the PingSenderTask, in the form of OOB messages with PingHeader.GET_MBRS_REQ headers. PingSenderTask sends these messages in a delayed loop. The delay between requests is {{timeout }}/{{num_ping_requests}} where {{timeout}} and {{num_ping_requests}} are configuration parameters described below. Normally that should be about 1.5 sec (1,500 ms).
The loop is interrupted either after a 'timeout' milliseconds (which means that all 'num_ping_requests' discovery requests have been sent), or after the first valid response - which allows determining who the coordinator is - is received. <font color=red>Further clarifications needed as to how 'num_initial_members' works.</font>
A new PingSenderTask - and the loop - will be started again when a new GET_MBRS_REQ message needs to be sent.
!!Stack Boot Time Factor
The whole stack is waiting while the first discovery loop is running, setting the 'timeout' to a smaller value can reduce the stack boot time.
!!!Configuration
!timeout
The timeout to wait for the initial members. Default is 3000 ms.
<font color=red>
!num_initial_members
</font>
!num_ping_requests
Number of discovery requests to be sent distributed over {{timeout}}. Default is 2.
!Filtering Out
If you want to filter these messages out, the header id is __6__.
__Referenced by:__\\
[{INSERT com.ecyrd.jspwiki.plugin.ReferringPagesPlugin WHERE max=20, maxwidth=50}]

Revision as of 06:35, 2 March 2016

Internal

!!!JGroups PING (Discovery) Protocol

!!!TODO

  • Next time I dive into this, come up with a full explanation for 'num_initial_members' below.

!!!External

  • JGroups Wiki [1]
  • JGroups Manual [2]

!!!Internal

|[MPING] |[TCPPING] |[MERGE2]

!!!Overview

PING performs the initial (dirty) discovery of members, by multicasting PING request to an IP multicast address (or connecting to a GossipRouter). The PING request is a Message with a Template:PingHeader.GET MBRS REQ header. Each member replies with a (C, A) packet where C = coordinator address and A its own address. After a set number of milliseconds ('Template:Timeout') or replies ('Template:Num initial members'), the joiner determines the coordinator from responses, and sends a JOIN to it. The JOIN request is handled by the [GMS] layer. If nobody responds, the joiner assumes it's the first member of a group.

!!!Sample Configuration

{{{

    <PING timeout="2000" num_initial_members="3"/>
   

}}}


!!!Difference between PING and MPING

MPING, unlike PING, uses its own IP multicast socket to send discovery requests. PING simply sends a discover event down the stack to be sent by the underlying transport protocol.

Periodic GET_MBRS_REQ Requests

The super-type Discovery protocol is in charge with sending GET_MBRS_REQ (get members) requests upon receiving a FIND_INITIAL_MBRS event. FIND_INITIAL_MBRS events are sent either by the [GMS] protocol, when initializing, or periodically by the FindSubgroupsTask of the [MERGE2] protocol.

The discovery requests are generated by the PingSenderTask, in the form of OOB messages with PingHeader.GET_MBRS_REQ headers. PingSenderTask sends these messages in a delayed loop. The delay between requests is Template:Timeout/Template:Num ping requests where Template:Timeout and Template:Num ping requests are configuration parameters described below. Normally that should be about 1.5 sec (1,500 ms).

The loop is interrupted either after a 'timeout' milliseconds (which means that all 'num_ping_requests' discovery requests have been sent), or after the first valid response - which allows determining who the coordinator is - is received. Further clarifications needed as to how 'num_initial_members' works.

A new PingSenderTask - and the loop - will be started again when a new GET_MBRS_REQ message needs to be sent.

!!Stack Boot Time Factor

The whole stack is waiting while the first discovery loop is running, setting the 'timeout' to a smaller value can reduce the stack boot time.


!!!Configuration

!timeout

The timeout to wait for the initial members. Default is 3000 ms.

!num_initial_members

!num_ping_requests

Number of discovery requests to be sent distributed over Template:Timeout. Default is 2.


!Filtering Out

If you want to filter these messages out, the header id is __6__.


__Referenced by:__\\ [{INSERT com.ecyrd.jspwiki.plugin.ReferringPagesPlugin WHERE max=20, maxwidth=50}]